MyBB Support

Registered time function MyBB?

Submitted by AndresXZ09, , Thread ID: 2741

Thread Closed

RE: Registered time function MyBB?

#10
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'] );
}
Do not let your difficulties fill you with anxiety, after all it is only in the darkest nights that stars shine more brightly. - Ali(a.s)

Developer( PHP, Python, C++, HTML+CSS, JS I am available for Hire. Message Me for details.


Users browsing this thread: 5 Guest(s)