Firefox PHP

Show todays Birthdays Mod

Posted by JuergenHansen 
Re: Hack for Show todays Birthdays Mod
December 05, 2006 05:28PM
No, I guess he means that at max 20 days of the year would show a birthday, which makes it "idle" the rest of the year.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Hack for Show todays Birthdays Mod
December 06, 2006 02:10AM
Excactly, you're right. The mod works pretty fast although disabled caching.



Edited 1 time(s). Last edit at 12/06/2006 02:13AM by babba_2000.
Re: Show todays Birthdays Mod
September 23, 2007 10:13PM
Hi,
I had this installed in version 5.1.19 and while checking on why my error logs are huge I discovered thousands of the following error:
PHP Notice: Undefined index: birthday in /usr/local/phorum5/mods/ShowTodaysBirthdays/ShowTodaysBirthdays.php on line 215, referer: [myforum.mysite.com]

Would like some help on being able to stop the error, if possible.

Thanks !
Re: Show todays Birthdays Mod
September 24, 2007 02:57AM
Edit that script and add the green line from the code below:
214    foreach($userlist as $user) {
215        if (empty($user["birthday"])) continue;
216        $birthday = getdate($user["birthday"]);


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Show todays Birthdays Mod
September 24, 2007 02:40PM
Thanks Maurice ! Your great !

This worked and should now take the size of my error logs down from 350 Mb a week to something a litlle more realistic.

Now I just need to fix the error showing in the In Body Attachments mod.
Re: Show todays Birthdays Mod
September 24, 2007 08:05PM
One additional error showed up, most likely because I have the birthday data as part of the registration page. Again, it is likely just missing either an empty or isset. I really wish I was php-literate enough to correct these on my own :(

PHP Notice: Undefined index: PROFILE in /usr/local/phorum5/mods/ShowTodaysBirthdays/ShowTodaysBirthdays.php on line 45, referer: myphorum.mysite.com/register.php?1


45 $birthday = getDate($PHORUM["DATA"]["PROFILE"]["birthday"]);
Re: Show todays Birthdays Mod
September 24, 2007 08:14PM
I think:
$birthday = empty($PHORUM["DATA"]["PROFILE"]["birthday"])
          ? '' : getDate($PHORUM["DATA"]["PROFILE"]["birthday"]);


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Show todays Birthdays Mod
September 24, 2007 09:06PM
That resolved on problem and then generated 24 others !

Now I get:
PHP Notice: Uninitialized string offset: 0 in /usr/local/phorum5/mods/ShowTodaysBirthdays/ShowTodaysBirthdays.php on line 47, referer: [forum5.gayedmonton.com]
This also shows for line 48, 49 and 51, then the entire section is repeated two additional times on the page at lines 73,74,75 and 77 and then again at lines 110, 111, 112 and 114. The same string is located at all. And it also reports all the same errors for the login.php?1 at the same time, thus 24 errors in one call.

Here is the entire string with the change you suggested above:

45 $birthday = empty($PHORUM["DATA"]["PROFILE"]["birthday"])
46 ? '' : getDate($PHORUM["DATA"]["PROFILE"]["birthday"]);
47 $tag = $birthday["mday"];
48 $monat = $birthday["mon"];
49 $jahr = $birthday["year"];
50
51 if($birthday["seconds"] ==0) {
52 $tag = -1;
53 }
Re: Show todays Birthdays Mod
September 25, 2007 02:33AM
Hmm... looks like the coder didn't really care about warnings. They were probably turned off when developing this code. Well, here's another try:

$birthday = empty($PHORUM["DATA"]["PROFILE"]["birthday"])
          ? '' : getDate($PHORUM["DATA"]["PROFILE"]["birthday"]);

if(empty($birthday)) {
    $tag = -1;
    $monat = 0;
    $jahr = 0;
} else {
    $tag = $birthday["mday"];
    $monat = $birthday["mon"];
    $jahr = $birthday["year"];
}

I really don't know if this would work in its bigger context of the full script. If this gives you more problems, then maybe you should try contacting the author of the script. I'm very low on time to go over the code myself currently I'm afraid.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Show todays Birthdays Mod
September 25, 2007 10:29AM
They are notices, not errors or warnings...

If your sites error log is getting huge (compromising it's functionality or something?) you may want to turn off notices to get rid of everyone of them. Then use another server to debug the mods you are using.

---
-=[ Panu ]=-
Sorry, only registered users may post in this forum.

Click here to login