MyBB Support

Registered time function MyBB?

Submitted by AndresXZ09, , Thread ID: 2741

Thread Closed

RE: Registered time function MyBB?

OP
#11
12-04-2015, 06:04 PM
AmN Wrote:
just create a plugin file: amn.php

place my code in it.

add:

Code:
function amn_info()
{
   return array(
'name'=> 'AmN',
'description'=> 'Noh.',
'website'=> 'http://askamn.com/',
'author'=> 'AmN',
'authorsite'=> 'http://askamn.com',
'version'=> '1.0',
'compatibility'=> '14*,15*,16*,17*,18*',
'guid'=> ''
);
}
function amn_activate()
{
   //BLA
}
$plugins->add_hook( 'postbit', 'years_of_service' );

function years_of_service(&$post)
{
        $yearsofservice = date( 'Y', TIME_NOW - $post['userregdate'] );
        $years = ( $yearsofservice == 1  ) ? 'year' : 'years';
        return str_replace( '<years_of_service>',' $yearsofservice . ' ' . $years . ' of service', $post['message'] );
}

Hell, I want to learn but I am not going to do so if you just do everything for me <.<

Users browsing this thread: 3 Guest(s)