Mind blowing SEO improving and Google rank increasing Signature Rotator SEO Tool.

Thread: 

How to show register time of users?

Ads
Midori Offline referral

Posts: 41
Joined: Apr 2014
Reputation: 1

#1
Junior Member
Hi
How can we set in postbit to showing registration time for users . I inserted {$post['userregtime']} variable but no work for me . Thanks
marcus_avrelius Offline referral

Posts: 2,424
Joined: May 2013
Reputation: 102

#2
Support Team
I am not sure MYBB is capturing registration time! There ain't even a column for that! To do that you will have to create a plugin that will store user registration time.

MYBB only stored user reg date.

Modify this plugin so that it will only store user registration time: http://www.mybbsecurity.net/topic-register-time-v-1-2-1
Midori Offline referral

Posts: 41
Joined: Apr 2014
Reputation: 1

#3
Junior Member
Thank you.
Midori Offline referral

Posts: 41
Joined: Apr 2014
Reputation: 1

#4
Junior Member
Thanks again dear Marcus,
In MYBB postbit we have:
=========
Post count {$post['postnum']}
Registration date {$post['userregdate']}
Reputation {$post['replink']}
Warning level {$post['warninglevel']}
=========
How can I add Registration time after Registration date.
marcus_avrelius Offline referral

Posts: 2,424
Joined: May 2013
Reputation: 102

#5
Support Team
You need a plugin for that!

You can use this code:

PHP Code:
$query $db->query("
            SELECT u.regdate
            FROM "
.TABLE_PREFIX."users u
            ORDER BY u.regdate DESC
        "
);

    while (
$users $db->fetch_array($query)) {
        
$memregdate date("G:i"$users['regdate']);
        echo(
"<div>{$memregdate}</div><br/>");
    } 
marcus_avrelius Offline referral

Posts: 2,424
Joined: May 2013
Reputation: 102

#6
Support Team
Just finished the plugin for you Smile

PHP Code:
<?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}";
    } 
}
?>

Save as regtime.php upload it to /inc/plugins directory then activate it from Admin Control Panel >> Plugins
Midori Offline referral

Posts: 41
Joined: Apr 2014
Reputation: 1

#7
Junior Member
Thank you very much my dear teacher . this plugin work very well and nice. thanks again 001_tt1001_tt1Heart
Midori Offline referral

Posts: 41
Joined: Apr 2014
Reputation: 1

#8
Junior Member
Thanks dear Marcus . I found a bug , Registration time in postbit is different with registration time in ACP.
In postbit , Registration time is 9.06 AM but in ACP, Registration time is 12:36 PM.
I tested it in Local .





User(s) browsing this thread: 1 Guest(s)