Topic: the birthday reminder

I want a birthday reminder of my members - just like http://board.shodown.net/index.php but that's phpBB
so anyone please help !

Re: the birthday reminder

Moved, its a mod not a plugin

Re: the birthday reminder

i'd like this mod too!

4

Re: the birthday reminder

$date = explode ('.',date("d.m.Y"));
$day = $date[0]+0; 
$month = $date[1]+0;
$year = $date[2];
$cur_date="%-".$month."-".$day;

if ($month=="1"||$month=="3"||$month=="5"||$month=="7"||$month=="8"||$month=="10"||$month=="12") $days=31;
if ($month=="4"||$month=="6"||$month=="9"||$month=="11") $days=30;
if ($month=="2") 
    {
    if(date("Y")%4==0) $days=29;
    else $days=28;

    }

$cur_date2="%-".$month."-".($day+1);
$cur_date3="%-".$month."-".($day+2);
if($day == $days){
$cur_date2="%-".($month+1)."-1";
$cur_date3="%-".($month+1)."-2";
}

$out_list="";
$query    = 'select id,username,birthday from '.$db->prefix.'users where birthday ILIKE \''.$cur_date.'\' or birthday LIKE \''.$cur_date2.'\' or birthday LIKE \''.$cur_date3.'\' order by birthday ASC';
//die($query);
$result = $db->query($query) or error('Unable to fetch user list', __FILE__, __LINE__, $db->error());;
$u_count = $db->num_rows($result);
if ($u_count > 0)
{
while($row=$db->fetch_object($result))
{

$a=strftime("%d-%m-%Y",strtotime($row->birthday));
$b=$row->username;
$id=$row->id;
$out_list=$out_list."\t<li> » <a href=\"/profile.php?id=".$id."\">".$b."</a> </li>\n";
}

something like this

Hm... every pixel has it's own destiny

Re: the birthday reminder

hm where to imput that and is somebody else doing this mod?

6

Re: the birthday reminder

after this code var $out_list will contain list of users, who have birthday in 3 days

Hm... every pixel has it's own destiny

Re: the birthday reminder

where must I imput it?

8

Re: the birthday reminder

anywere.... f.e. you can put it in separate file, called it modules/birthday.php f.e. and :

require PUN_ROOT.'modules/birthday.php';
echo $out_list;
Hm... every pixel has it's own destiny

9 (edited by sanjokidd 2005-11-05 10:39)

Re: the birthday reminder

anywhere in the index.php file right? does this work with  1.2.10

Re: the birthday reminder

oh IC when someone try's it let me know

11 (edited by Bloody 2006-01-30 08:13)

Re: the birthday reminder

I wanted to know if you use calendar mod to do this mod. hmm

I made that on the index.php file :

// liste utilisateurs en ligne aujourd'hui
    echo "\t\t\t".'<dl id="onlinetodaylist">'."\n\t\t\t\t".'<dt><strong>'.$lang_index['Online today'].': </strong></dt>';
               
    if ($num_users_today > 0)
        echo implode(',</dd> ', $users_today).'</dd>'."\n\t\t\t".'</dl>'."\n";
    else
        echo '<dd><em>aucun</em></dd>'."\n\t\t\t".'</dl>'."\n";
}
require PUN_ROOT.'modules/birthday.php';
echo $out_list;

It doesn't work. sad Any solution ?

Benoît V.
My Board

Re: the birthday reminder

can ANYone tell me how to display the birthdays in the board stats in index.php

I have the latest version of the calendar working on version 1.2.11

all I want is to be able to display 'today's birthdays' in the stats.

Can someone PLEASE help me smile

13

Re: the birthday reminder

u need only one query, then read data and echo it in the board stats.. it's easy

Hm... every pixel has it's own destiny

Re: the birthday reminder

can you post the actual code for me?  I am not that good with php.
Thank you smile

15

Re: the birthday reminder

can you post the actual code for me too?

16 (edited by Koos 2008-04-23 21:56)

Re: the birthday reminder

finley9 wrote:

can ANYone tell me how to display the birthdays in the board stats in index.php

I have the latest version of the calendar working on version 1.2.11

all I want is to be able to display 'today's birthdays' in the stats.

Can someone PLEASE help me smile

Hi - this can be done quite easily. Here is how I did it. This should work with both Calendar-2.0.8a beta and Calendar-2.0.7.

Screenshot

#
#---------[ 1. OPEN ]---------------------------------------------------------
#

index.php


#
#---------[ 2. FIND (line: 192) ]---------------------------------------------
#

    $num_users = count($users);


#
#---------[ 3. BEFORE, ADD ]---------------------------------------------------
#

//-------Birthday Code Start-------
    // today's birthdays
    $ttoday = time();
    $tdiff = ($pun_user['timezone'] - $pun_config['o_server_timezone']) * 3600;
    $ttoday += $tdiff;
    $tyear = date("Y");
    $tmonth = date("n");
    $tday = date("j", $ttoday);
    
$result = $db->query('SELECT id, username, birthday FROM '.$db->prefix.'users WHERE DAYOFMONTH(birthday) = '.$tday.' AND MONTH(birthday) = '.$tmonth.' ORDER BY username') or error('Unable to fetch birthday list', __FILE__, __LINE__, $db->error());

    $bdays_today = array();
    while ($pun_bdays_today = $db->fetch_assoc($result)){
        $bparts = Explode('-', $pun_bdays_today['birthday']);
        $bday_year = $bparts[0];
        $age = (strlen($bday_year)!='4')? "": "(".($tyear-$bday_year).")";
        $bdays_today[] .=  "\n\t\t\t\t".'<dd><a href="profile.php?id='.$pun_bdays_today['id'].'">'.$pun_bdays_today['username'].'</a>'.$age;
        }
        
    $num_bdays_today = count($bdays_today);
//-------Birthday Code End-------


#
#---------[ 4. FIND (line: 223) ]---------------------------------------------
#

}
else
    echo "\t\t".'</dl>'."\n\t\t\t".'<div class="clearer"></div>'."\n";


#
#---------[ 5. BEFORE, ADD ]---------------------------------------------------
#

// list today's birthdays           
    if ($num_bdays_today > 0)
        echo "\t\t\t".'<dl id="bdayslist" class= "clearb">'."\n\t\t\t\t".'<dt><strong>'."Today's birthdays".': </strong></dt>'."\t\t\t\t".implode(',</dd> ', $bdays_today).'</dd>'."\n\t\t\t".'</dl>'."\n";
    else
        echo "\t\t\t".'<div class="clearer"></div>'."\n";


#
#---------[ 6. OPEN ]---------------------------------------------------------
#

style/imports/base.css


#
#---------[ 7. FIND (line: 229) ]---------------------------------------------
#

/* 8.1 Horizontal display of online list, main navigation menu and breadcrumbs */


#
#---------[ 8. AFTER, ADD ]---------------------------------------------------
# Note: No blank lines after the comma
#

#bdayslist DD, #bdayslist DT,


#
#---------[ 9. SAVE/UPLOAD ]-------------------------------------------------
#

17 (edited by gleb 2007-10-18 16:17)

Re: the birthday reminder

Koos wrote:
finley9 wrote:

can ANYone tell me how to display the birthdays in the board stats in index.php

I have the latest version of the calendar working on version 1.2.11

all I want is to be able to display 'today's birthdays' in the stats.

Can someone PLEASE help me smile

Hi - this can be done quite easily. Here is how I did it. This should work with both Calendar-2.0.8a beta and Calendar-2.0.7.

Screenshot

#
#---------[ 1. OPEN ]---------------------------------------------------------
#

index.php


#
#---------[ 2. FIND (line: 192) ]---------------------------------------------
#

    $num_users = count($users);


#
#---------[ 3. BEFORE, ADD ]---------------------------------------------------
#

//-------Birthday Code Start-------
    // today's birthdays
    $ttoday = time();
    $tdiff = ($pun_user['timezone'] - $pun_config['o_server_timezone']) * 3600;
    $ttoday += $tdiff;
    $tyear = date("Y");
    $tmonth = date("n");
    $tday = date("j", $ttoday);
    
$result = $db->query('SELECT id, username, birthday FROM '.$db->prefix.'users WHERE DAYOFMONTH(birthday) = '.$tday.' AND MONTH(birthday) = '.$tmonth.' ORDER BY username') or error('Unable to fetch birtday list', __FILE__, __LINE__, $db->error());

    $bdays_today = array();
    while ($pun_bdays_today = $db->fetch_assoc($result)){
        $bparts = Explode('-', $pun_bdays_today['birthday']);
        $bday_year = $bparts[0];
        $age = (strlen($bday_year)!='4')? "": "(".($tyear-$bday_year).")";
        $bdays_today[] .=  "\n\t\t\t\t".'<dd><a href="profile.php?id='.$pun_bdays_today['id'].'">'.$pun_bdays_today['username'].'</a>'.$age;
        }
        
    $num_bdays_today = count($bdays_today);
//-------Birthday Code End-------


#
#---------[ 4. FIND (line: 223) ]---------------------------------------------
#

}
else
    echo "\t\t".'</dl>'."\n\t\t\t".'<div class="clearer"></div>'."\n";


#
#---------[ 5. BEFORE, ADD ]---------------------------------------------------
#

// list today's birthdays           
    if ($num_bdays_today > 0)
        echo "\t\t\t".'<dl id="bdayslist" class= "clearb">'."\n\t\t\t\t".'<dt><strong>'."Today's birthdays".': </strong></dt>'."\t\t\t\t".implode(',</dd> ', $bdays_today).'</dd>'."\n\t\t\t".'</dl>'."\n";
    else
        echo "\t\t\t".'<div class="clearer"></div>'."\n";


#
#---------[ 6. OPEN ]---------------------------------------------------------
#

style/imports/base.css


#
#---------[ 7. FIND (line: 229) ]---------------------------------------------
#

/* 8.1 Horizontal display of online list, main navigation menu and breadcrumbs */


#
#---------[ 8. AFTER, ADD ]---------------------------------------------------
#

#bdayslist DD, #bdayslist DT,


#
#---------[ 9. SAVE/UPLOAD ]-------------------------------------------------
#

Doesn´t seem to wotk at all for http://www.punres.org/viewtopic.php?pid=17767#p17767 Nothing is displayed in the statistic frame? Any solution anyone?

18 (edited by Koos 2008-04-25 18:40)

Re: the birthday reminder

gleb wrote:

Doesn´t seem to wotk at all for http://www.punres.org/viewtopic.php?pid=17767#p17767 Nothing is displayed in the statistic frame? Any solution anyone?

Remember Birthday statistics will only be displayed when it is someone's birthday today. Also: make sure 'yes' is selected in the admin options for 'Users online'. If Birthdays are displayed in the calendar, and you modified the index.php file correctly, there is no reason it shouldn't work.