[geeklog-cvs] geeklog-1.3/public_html lib-common.php,1.395,1.396

blaine at iowaoutdoors.org blaine at iowaoutdoors.org
Sat Nov 6 12:13:50 EST 2004


Update of /var/cvs/geeklog-1.3/public_html
In directory www:/tmp/cvs-serv25063/public_html

Modified Files:
	lib-common.php 
Log Message:
Added new function COM_displayName($uid) that can be used by Plugin's or Core Fuctions to return either the members username or fullname.
$_CONF[show_fullname] added to allow the site admin to configure.

Index: lib-common.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/lib-common.php,v
retrieving revision 1.395
retrieving revision 1.396
diff -C2 -d -r1.395 -r1.396
*** lib-common.php	30 Oct 2004 14:57:31 -0000	1.395
--- lib-common.php	6 Nov 2004 17:13:48 -0000	1.396
***************
*** 4095,4098 ****
--- 4095,4129 ----
  }
  
+ 
+ /**
+ * Return the username or fullname for the passed member id (uid)
+ *
+ * Allows the siteAdmin to determine if loginname (username) or fullname
+ * should be displayed.
+ *
+ * @param    int  $uid  site member id
+ * @return   string     username or fullname - default is username
+ *
+ */
+ function COM_getDisplayName($uid='') {
+    global $_TABLES,$_USER,$_CONF;
+  
+    if ($uid == '') {
+       $uid = $_USER['uid'];
+    }
+ 
+    $query = DB_query("SELECT username, fullname FROM {$_TABLES['users']} WHERE uid='$uid' ");
+    list ($username,$fullname) = DB_fetchArray($query);
+  
+    if ($fullname != '' AND $_CONF['show_fullname'] == 1) {
+       return $fullname;
+    } else {
+      return $username;
+    }
+ }
+ 
+ 
+ 
+ 
  /**
  * Adds a hit to the system




More information about the geeklog-cvs mailing list