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 !
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.2 modifications, plugins and integrations → 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 !
i'd like this mod too!
$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 where to imput that and is somebody else doing this mod?
after this code var $out_list will contain list of users, who have birthday in 3 days
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;
anywhere in the index.php file right? does this work with 1.2.10
I wanted to know if you use calendar mod to do this mod.
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. Any solution ?
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
u need only one query, then read data and echo it in the board stats.. it's easy
can you post the actual code for me? I am not that good with php.
Thank you
can you post the actual code for me too?
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
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.
#
#---------[ 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 ]-------------------------------------------------
#
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
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.
# #---------[ 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?
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.
PunBB Forums → PunBB 1.2 modifications, plugins and integrations → the birthday reminder
Powered by PunBB, supported by Informer Technologies, Inc.