 |
 |
 |
 |
#315616 - 09/10/07 03:00 PM
Re: Custom island happy birthday
[Re: blaaskaak]
|
Member
Registered: 02/25/07
Posts: 299
Loc: The Netherlands
|
So that would be v2.20 atleast  v2.20 it is  added name color stuff, stolen (but redid some of the if's) from showflat.inc.php  /* PHP CODE HERE */
$maxdaysago=60;
$temp = getdate($now);
$month = $temp["mon"];
$mday = $temp["mday"];
$year = $temp["year"];
$visitlimit=time()-60*60*24*$maxdaysago;
if (isset($config['BIRTHDAYS_IN_CALENDAR']) && $config['BIRTHDAYS_IN_CALENDAR']) {
$query = "
SELECT t1.USER_DISPLAY_NAME,t2.USER_BIRTHDAY,t1.USER_IS_UNDERAGE,t1.USER_ID,t2.USER_NAME_COLOR
FROM {$config['TABLE_PREFIX']}USERS as t1,
{$config['TABLE_PREFIX']}USER_PROFILE as t2,
{$config['TABLE_PREFIX']}USER_DATA as t3
WHERE t2.USER_BIRTHDAY LIKE ?
AND t1.USER_IS_BANNED != '1'
AND t2.USER_PUBLIC_BIRTHDAY = '1'
AND t3.USER_LAST_VISIT_TIME >= ?
AND t1.USER_ID = t2.USER_ID
AND t1.USER_ID = t3.USER_ID
";
$sth = $dbh -> do_placeholder_query($query,array("$month/$mday/%",$visitlimit),__LINE__,__FILE__);
$marray[0] = "";
while(list($uname,$birthday,$coppauser,$birthdayuser,$Color) = $dbh -> fetch_array($sth)) {
@list($bmonth,$bday,$byear) = @split("/",$birthday);
$age = "";
if ($config['AGE_WITH_BIRTHDAYS'] && !$coppauser) {
$age = $year - $byear;
$age = " ($age)";
} // end if
$Color = trim($Color);
if ($Color)
{
$uname = "<span style=\"color:$Color;\">$uname</span>";
}
else
{
if ($PostStatus == "Administrator")
{
$uname = "<span class=\"adminname\">$uname</span>";
}
elseif ($PostStatus == "Moderator")
{
$uname = "<span class=\"modname\">$uname</span>";
}
}
$bdays .= "<a href=\"{$config['BASE_URL']}/ubbthreads.php?ubb=showprofile&User=$birthdayuser\">$uname</a>$age, ";
} // end while
} // end if
if (!$bdays)
{
$bdays="No birthdays today";
}
else
{
$bdays = substr($bdays,0,strlen($bdays)-2);
$bdays = "Happy birthday ".$bdays.".";
}
/* BODY HERE */
$body = <<<EOF
$bdays
EOF;
_________________________
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#315778 - 09/22/07 04:28 PM
Re: Custom island happy birthday
[Re: sirdude]
|
Bada bing!
Enthusiast
Registered: 11/08/03
Posts: 439
Loc: SoCal
|
hrm, you have a bug. $PostStatus is undefined.. fyi
SELECT t1.USER_DISPLAY_NAME,t2.USER_BIRTHDAY,
t1.USER_IS_UNDERAGE,t1.USER_ID,t2.USER_NAME_COLOR,
t1.USER_MEMBERSHIP_LEVEL and
while(list($uname,$birthday,$coppauser,$birthdayuser,$Color,$PostStatus) = $dbh -> fetch_array($sth)) {i believe 
_________________________
A taxpayer voting for Obama is like a chicken voting for Colonel Sanders.
|
|
Top
|
|
|
|
 |
 |
 |
 |
|
|