php forum
php mysql forum
php mysql smarty
 
Page 2 of 3 < 1 2 3 >
Topic Options
#315780 - 09/22/07 08:31 PM Re: Custom island happy birthday [Re: blaaskaak]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 304
Loc: The Netherlands
Nice comfy bed could wait...

Code:
/* 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,t1.USER_MEMBERSHIP_LEVEL
		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,$PostStatus) = $dbh -> fetch_array($sth)) {
		@list($bmonth,$bday,$byear) = @split("/",$birthday);
		$age = "";
		if ($config['AGE_WITH_BIRTHDAYS'] && !$coppauser) {
			$age = $year - $byear;
			$age = "&nbsp;($age)";
		} // end if
		$Color = trim($Color);
		$bdays=$VERSION;
		if ($VERSION<'7.3')
		{
			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>";
				}
			}
		} else
		{
			$uname = $html->user_color($uname, $Color, $PostStatus); 
		}

		$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;


Fixes colorize bug, and introduces compatibility with 7.3 smile Untested that is laugh


Cleanup for post #1 I will still do tomorrow smile

Update: Hmm, doesn't seem to work yet, I'll have a test drive tomorrow smile Don't know if the $VERSION variable is available in a custom island.


Edited by blaaskaak (09/22/07 08:39 PM)
_________________________

Top
#315781 - 09/22/07 09:47 PM Re: Custom island happy birthday [Re: blaaskaak]
AshtarRose Offline
Journeyman

Registered: 09/22/05
Posts: 134
Loc: Orlando, FL
How about one that lists birthdays for the month instead of per day?
_________________________
http://www.riddledindarkness.com * Yeah I need the Crazy Mods.

Top
#315783 - 09/23/07 03:46 AM Re: Custom island happy birthday [Re: AshtarRose]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 304
Loc: The Netherlands
Originally Posted By: AshtarRose
How about one that lists birthdays for the month instead of per day?


could be a busy screen if you have a lot of members. But "a month from now", because "in thos month" is not so interesting. It's not so interesting to see if somebody had it's birthday 30 days ago.
_________________________

Top
#315784 - 09/23/07 04:23 AM Re: Custom island happy birthday [Re: blaaskaak]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 304
Loc: The Netherlands
Originally Posted By: blaaskaak
I'll have a cleanup on post #1 tomorrow.


The bed was very comfy smile

Post #1 now has been cleaned up with the latest greatest version, with the color stuff fixed for mods/admins.
_________________________

Top
#315793 - 09/23/07 11:57 PM Re: Custom island happy birthday [Re: blaaskaak]
AshtarRose Offline
Journeyman

Registered: 09/22/05
Posts: 134
Loc: Orlando, FL
Why are there lines all through it, is it safe to use?
_________________________
http://www.riddledindarkness.com * Yeah I need the Crazy Mods.

Top
#315794 - 09/24/07 01:52 AM Re: Custom island happy birthday [Re: AshtarRose]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 304
Loc: The Netherlands
No, I crossed it out because I didn't want to clear the messsage clear, but the code wasn't working in that message. Just take the island from post #1. There is always the most up-to-date, tested, version there!
_________________________

Top
#315795 - 09/24/07 10:24 AM Re: Custom island happy birthday [Re: blaaskaak]
AshtarRose Offline
Journeyman

Registered: 09/22/05
Posts: 134
Loc: Orlando, FL
I'm using the last safe version smile I'm just anxious
_________________________
http://www.riddledindarkness.com * Yeah I need the Crazy Mods.

Top
#316190 - 10/31/07 02:02 PM Re: Custom island happy birthday [Re: blaaskaak]
Zarzal Offline
Coder

Registered: 07/03/01
Posts: 806
Loc: Berlin, Germany
Very nice, thank you for sharing.
_________________________
my forum: http://www.dragon-clan.de
my hobby: http://www.biker-reise.de

Top
#316246 - 11/05/07 09:01 AM Re: Custom island happy birthday [Re: Zarzal]
Ian_W Global Moderator Offline
Veteran

Registered: 02/22/02
Posts: 2575
Loc: England
For some reason - mine has stopped working - it has been showing the same person for the last week or so frown
_________________________
Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)

Top
#316247 - 11/05/07 10:04 AM Re: Custom island happy birthday [Re: Ian_W]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 304
Loc: The Netherlands
Strange, it's still working fine here.
_________________________

Top
#316255 - 11/05/07 01:01 PM Re: Custom island happy birthday [Re: blaaskaak]
sirdude Moderator Offline
Enthusiast

Registered: 11/08/03
Posts: 442
Loc: SoCal
works great here..

clear your cache ?
_________________________

Top
#316259 - 11/05/07 07:35 PM Re: Custom island happy birthday [Re: sirdude]
Ian_W Global Moderator Offline
Veteran

Registered: 02/22/02
Posts: 2575
Loc: England
Uploaded the latest version - all working again.

It is a shame when 90% of users hide their birthday's.

We get threads saying 'happy birthday x' when x is not showing on the birthday list frown
_________________________
Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)

Top
#316263 - 11/06/07 11:33 AM Re: Custom island happy birthday [Re: blaaskaak]
Crasher Offline
Lurker

Registered: 10/18/07
Posts: 6
just like to add my thanks for this simple but very effective mod.
Marvellous smile
_________________________
I don't do a lot, but i do do this

Top
#316540 - 12/31/07 04:16 AM Re: Custom island happy birthday [Re: blaaskaak]
nans Offline
Lurker

Registered: 10/10/04
Posts: 7
I tried this, in the beginning worked fine, but after a fe days, it doesn't update anymore. Probably a caching prob, but how to avoid this?

N

Top
#316541 - 12/31/07 07:39 AM Re: Custom island happy birthday [Re: nans]
Ian_W Global Moderator Offline
Veteran

Registered: 02/22/02
Posts: 2575
Loc: England
ensure you are running the latest version and clear your cache files - then rebuild the cache from your CP.
_________________________
Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)

Top
#316600 - 01/11/08 04:35 PM Birthdays don't show consistently
Bill B Offline
User

Registered: 12/23/01
Posts: 27
Loc: Issaquah, WA
I added the Birthday Island.. It's a big hit... But it seems to only post about one out of every 20 that show up in the Calendar. Any ideas why? I thought that if they showed in the calendar, then the permissions would allow them in the Island.

Here's the code that I used -- from this forum.
===========
Code:
/* PHP CODE HERE */

$maxdaysago=10;

$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,t1.USER_MEMBERSHIP_LEVEL
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,$PostStatus) = $dbh -> fetch_array($sth)) {
@list($bmonth,$bday,$byear) = @split("/",$birthday);
$age = "";
if ($config['AGE_WITH_BIRTHDAYS'] && !$coppauser) {
$age = $year - $byear;
$age = "&nbsp;($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; 

===========
_________________________
Bill Barker
Issaquah, Wa

Top
#316603 - 01/11/08 07:20 PM Re: Birthdays don't show consistently [Re: Bill B]
Ian_W Global Moderator Offline
Veteran

Registered: 02/22/02
Posts: 2575
Loc: England
It looks like you have $maxdaysago=10 - which would mean that only those people who have been active in the last 10 days are shown.

I have mine set to 400, to show anyone who has been online in the last year (or just over)
_________________________
Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)

Top
#316690 - 02/08/08 04:47 PM Re: Birthdays don't show consistently [Re: Ian_W]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 304
Loc: The Netherlands
Originally Posted By: Ian_W
It looks like you have $maxdaysago=10 - which would mean that only those people who have been active in the last 10 days are shown.


That's indeed the secret. Also banned users are excluded.
_________________________

Top
#316692 - 02/10/08 06:34 AM Re: Birthdays don't show consistently [Re: Bill B]
nans Offline
Lurker

Registered: 10/10/04
Posts: 7
I used the same code, and the result is quiet weird, one user, but mentioned twice:


Happy birthday Happy birthday Alone.Alone.

(http://www.femistyle.be/ubbthreads/ubbthreads.php)

Top
#316693 - 02/10/08 07:21 AM Re: Birthdays don't show consistently [Re: nans]
nans Offline
Lurker

Registered: 10/10/04
Posts: 7
Ignore previous mail, I didn't change anything, but now the double is gone.. :-(

Top
Page 2 of 3 < 1 2 3 >


Moderator:  sirdude 
Who's Online
0 registered (), 23 Guests and 12 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
Wisdom needed
by Gizmo
Today at 10:54 AM
How to hide sub forums from summary page
by blaaskaak
Yesterday at 09:54 AM
Spell Check [beta]
by Bill B
12/01/08 09:16 PM
PhotoPost BB Code Popup
by AllenAyres
12/01/08 09:41 AM
Problems reading a lot of old posts here
by AllenAyres
12/01/08 09:35 AM
Forum 'Trader Ratings'.
by AllenAyres
12/01/08 09:33 AM
Customization needed
by Gizmo
11/12/08 12:28 PM
New Mods
User Authentication Class
by
01/19/07 02:59 PM
Multiple Identity Detector
by
12/30/06 06:39 PM
PhotoPost BB Code Popup
by
11/06/06 05:43 PM
Spell Check [beta]
by
10/17/06 09:24 PM
Newest Members
Truth, David DelMonte, nick1, Begbie, cenk
13364 Registered Users
Top Posters
AllenAyres 25452
JoshPet 11330
Rick 8372
LK 7396
Lord Dexter 6503
Greg Hard 5533
Charles Capps 5438

 

 

 
fusionbb message board php hacks