Profile link for members birthdays plugin?
Posted: 23 May 2006 10:57 AM   [ Ignore ]  
Research Assistant
RankRankRank
Total Posts:  372
Joined  11-04-2005

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!

 Signature 

Eskobar | Smidigt | Digga

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64905 Total Logged-in Users: 49
Total Topics: 81838 Total Anonymous Users: 29
Total Replies: 440013 Total Guests: 258
Total Posts: 521851    
Members ( View Memberlist )