<?php
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
$plugins->add_hook("postbit", "regtime");
function regtime_info()
{
return array(
"name" => "User Rigistration Time",
"description" => "Shows user registration time in postbit",
"website" => "http://letsforum.com/Thread-How-to-show-register-time-of-users",
"author" => "MyBB Group",
"authorsite" => "http://letsforum.com",
"version" => "1.0",
"compatibility" => "*"
);
}
function regtime(&$post)
{
global $db;
$query = $db->query("
SELECT u.regdate, p.pid, u.uid
FROM ".TABLE_PREFIX."users u
LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=u.uid)
WHERE u.uid='".$post['uid']."'
LIMIT 1
");
while ($users = $db->fetch_array($query)) {
$memregdate = date("G:i", $users['regdate']);
$post['user_details'] = "{$post['user_details']} <br/>Register Time: {$memregdate}";
}
}
?>