Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 11:29 am EST

Geeklog Forums

Changing Logon name to Full name in BDAY Plugin


Anonymous

Anonymous
This is a pretty neat plugin however I would like it to display the users full name, not there logon name. I am sure for you PHP/GL gurus this is an easy task, for me it is an imposibility. I have extracted two functions out of the script which I believe probably control what is displayed, if anybody has a sec and can tell me what to change I would appreciate it.

Thanks..

Text Formatted Code

function block_birthdays() {
        global $_TABLES,$_USER,$LANG_BD00,$_CONF;
        $retval='';
        $curmonth=strftime("%m")+0;
        $stmt = "SELECT * FROM {$_TABLES['users']} as users,{$_TABLES['birthdays']} as bdays                                            
                WHERE users.uid=bdays.uid and users.uid='".$_USER['uid']."'";
        $result= DB_query("$stmt");
        $nrows = DB_numRows($result);
        if (($nrows <= 0) && (!empty($_USER['uid']))) {
                $retval="<a href=".$_CONF['site_url']."/birthdays/index.php?mode=edit&uid=".$_USER['uid']."><small>".$LANG_BD00['add']."</small></a><br>";
        }
        $stmt = "SELECT * FROM {$_TABLES['users']} as users,{$_TABLES['birthdays']} as bdays
                WHERE users.uid=bdays.uid and bdays.month='$curmonth'";
        $result = DB_query("$stmt");
        $nrows = DB_numRows($result);
        if ($nrows > 0) {
                $retval.='<b>This Month</b><ul>';
                for ($i = 1; $i <=$nrows; $i++) {
                        $A = DB_fetchArray($result);
                        if ($A['day'] > "") {
                                $retval.="<li>".$A['username'];
                                $retval.=" ".display_birthday($A['day'],$A['month']);
                        }
                }
                $retval.='</ul>';
        } else {
                $retval.="No Birthdays this month.";
        }
        ++$curmonth;
        if ($curmonth > 12) {
                $curmonth=1;
        }
        $stmt = "SELECT * FROM {$_TABLES['users']} as users,{$_TABLES['birthdays']} as bdays
                WHERE users.uid=bdays.uid and bdays.month='$curmonth'";
        $result = DB_query("$stmt");
        $nrows = DB_numRows($result);
        if ($nrows > 0) {
                $retval.='<b>Coming Up</b><ul>';
                for ($i = 1; $i <=$nrows; $i++) {
                        $A = DB_fetchArray($result);
                        if ($A['day'] > "") {
                                $retval.="<li>".$A['username'];
                                $retval.=" ".display_birthday($A['day'],$A['month']);
                        }
                }
                $retval.='</ul>';
        } //    $retval.="[<a href=".$_CONF['site_url']."/birthdays>".$LANG_BD00['more']."</a>]";

        return $retval;
}
 
Text Formatted Code

function display_birthday($day,$month) {
        global $_BD_CONF;
        switch ($_BD_CONF['format']) {
                case "dmmm":
                        $m=substr(getMonthName($month),0,3);
                        $retval="$m/$day";
                        break;
                case "dm":
                        $retval="$day/$month";
                        break;
                case "md":
                        $retval="$month/$day";
                        break;
                case "mmmd":
                        $m=substr(getMonthName($month),0,3);
                        $retval="$m/$day";
                        break;
                default:
                        $retval="$month/$day";
        }
        return $retval;
 
 Quote

Status: offline

rawdata

Forum User
Full Member
Registered: 02/17/03
Posts: 236
I don't use this plugin but based on what you posted, try changing this line which appears twice in function block_birthdays from: $retval.="<li>".$A['username']; to $retval.="<li>".$A['fullname'];
 Quote

Anonymous

Anonymous
You're a man god! Worked a champ.. Thanks!
 Quote

All times are EST. The time is now 11:29 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content