PDA

View Full Version : Some assistance


Sylvus
07-27-2003, 01:28 AM
I'm trying to get Afterlab's # of Days registered hack to appear in the user.php and I've got all the tables etc working as it should but everytime I view a member, it lists them as being registered for 12260 days which is incorrect.

I'm not sure why it's doing this as it works just fine in functions.php.

Here is the code if anyone can give me a helping hand and the variable $userinfo[joindate] I've changed to reflect $user[joindate] which is used in user.php to show when a member joined.

The date shown when they joined is listed as yyyy-mm-dd and I'm not sure if the code below takes that into account.

$jointime = (time() - $user[joindate]) / 86400; // Days Joined

// Display Days Registered In Post
// Original Code provided by Afterlab
// Download # of Days Registered Hack:
// http://www.vbulletin.org/hacks/index.php?s=&action=showhack&hackid=517

$regdays = round((time() - $user[joindate]) / 86400); // Days Joined
if ($regdays < 1) { // Must be registered Today
$regdays = "1";
$daytext = "Day";
}
if ($regdays == 1) {
$daytext = "Day Old";
} else {
$daytext = "Days Old";
}
// End of Afterlab's # of Days Registered Hack


Thanks for any help.

Syl...

afterlab
07-27-2003, 03:10 PM
Make sure you put that code before any instance of $user[joindate] as it seems to be formatted within the code. Also make sure that you put it after any instances of $user query to make sure it's actually gathering information.