View Full Version : Join Date "if statement" not working?
Can anyone see what's wrong with this? I can't see why it won't work..
$newyear = 1136091600; //new years day 2006
if ($userinfo[joindate] < $newyear)
{ //code here should be executed if the user's join date is greater than the specified time variable, which should be anyone who has joined prior to Jan 1st 2006.
}
It doesn't work though. Any ideas? Thanks!
TyleR
01-01-2006, 08:15 PM
Can anyone see what's wrong with this? I can't see why it won't work..
$newyear = 1136091600; //new years day 2006
if ($userinfo[joindate] < $newyear)
{ //code here should be executed if the user's join date is greater than the specified time variable, which should be anyone who has joined prior to Jan 1st 2006.
}
It doesn't work though. Any ideas? Thanks!
Where are you trying to add this..?
In the newpost hook as a plugin.
Zachery
01-01-2006, 11:54 PM
$userinfo[joindate] is not valid ;)
$vbulletin->userinfo['joindate']
or
$this->userinfo['joindate']
Both of those cause this:
Fatal error: Call to a member function on a non-object in /blah blah/etc
That didn't happen before, but neither did the code that was supposed to execute.
Zachery
01-02-2006, 04:57 AM
What or where are you trying to hack / plug this in?
I'm putting it the newpost_process plugin. If a member signed up prior to New Years then some code is executed when they post. I know the code works because it worked fine before I added the cutoff date do it.
Basically I just need to pull the members joindate in unix form (your standard timestamp) and compare it to the value specified as $newyear as seen in the code.
Thanks for any ideas. :)
Zachery
01-02-2006, 05:08 AM
try without the single quotes.
Found the problem. Apparently when trying both of those I did a find and replace and accidentally replaced something that was already there.
Works now! Thanks for the help!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.