MyBB Support

Registered time function MyBB?

Submitted by AndresXZ09, , Thread ID: 2741

Thread Closed

RE: Registered time function MyBB?

Sozin
Nan Ihier Gelair Mordor
Divine
Level:
0
Reputation:
91
Posts:
2.33K
Likes:
375
Credits:
11K
12-04-2015, 06:04 PM
#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: 1 Guest(s)