I decided to use the membrs birthdays plugin for one part of my site.
By default the members names are linked to their homepage (if they’ve submitted one in their profile).
I’d really like to have this link to the profile of the member instead. I’m sure it’s quite easy to “hack” for anyone with some php skills, something I sure doesn’t have.
This is how the url part of the plugin code looks:
class pd_birthdays {
var $return_data;
function pd_birthdays()
{
global $TMPL,$LOC,$DB, $FNS;
$day=(!$TMPL->fetch_param('day')) ? date("j",time()) : $TMPL->fetch_param('day');
$month=(!$TMPL->fetch_param('month')) ? date("n",time()) : $TMPL->fetch_param('month');
$year=(!$TMPL->fetch_param('year')) ? date("Y",time()) : $TMPL->fetch_param('year');
$noresults=(!$TMPL->fetch_param('noresults')) ? "No Birthdays" : $TMPL->fetch_param('noresults');
$showage=(!$TMPL->fetch_param('showage')) ? "No" : $TMPL->fetch_param('showage');
$showage=(eregi("No",$showage)) ? "0" : "1";
$monthstring=date("M",strtotime("$month/1/01"));
$results="";
$sql="SELECT username,screen_name,url,bday_d,bday_m,bday_y FROM exp_members
WHERE bday_m = ".$DB->escape_str($month)."
ORDER BY bday_d";
$query=$DB->query($sql);
if ($query->num_rows == 0)
{
$this->return_data=$noresults;
return;
}
foreach($query->result as $row)
{
if (empty($row['screen_name']))
$membername=$row['username'];
else
$membername=$row['screen_name'];
$membername = (empty($row['url'])) ? $membername : "<a href=\"".$row[url]."\" target=\"_blank\">".$membername."</a>";
$tagdata =& $TMPL->tagdata;
$birthdate=$row['bday_m']."/".$row['bday_d'];
$birthday=eregi($birthdate,$month."/".$day) ? "1" : "0";
if ($showage)
{
$tmp_month = (strlen($row['bday_m'])==1) ? "0".$row['bday_m'] : $row['bday_m'];
$tmp_day = (strlen($row['bday_d'])==1) ? "0".$row['bday_d'] : $row['bday_d'];
$dob=$row['bday_y']."-".$tmp_month."-".$tmp_day;
$age=$this->Convert_DOB_to_Age($dob);
}
foreach ($TMPL->var_cond as $val)
{
// ----------------------------------------
// Conditional statements
// ----------------------------------------
Hope someone can help me with this. Thanks!
