[geeklog-cvs] geeklog-1.3/public_html lib-common.php,1.255,1.256
geeklog-cvs-admin at lists.geeklog.net
geeklog-cvs-admin at lists.geeklog.net
Sun Sep 7 13:44:53 EDT 2003
Update of /usr/cvs/geeklog/geeklog-1.3/public_html
In directory geeklog_prod:/tmp/cvs-serv21633
Modified Files:
lib-common.php
Log Message:
Introduced {author_fullname} and {author_photo} variables in comment templates (feature request #35).
Index: lib-common.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/lib-common.php,v
retrieving revision 1.255
retrieving revision 1.256
diff -C2 -d -r1.255 -r1.256
*** lib-common.php 7 Sep 2003 09:31:45 -0000 1.255
--- lib-common.php 7 Sep 2003 17:44:51 -0000 1.256
***************
*** 2557,2560 ****
--- 2557,2581 ----
if( $A['uid'] > 1 )
{
+ if( empty( $A['fullname'] ))
+ {
+ $template->set_var( 'author_fullname', $A['username'] );
+ $alttext = $A['username'];
+ }
+ else
+ {
+ $template->set_var( 'author_fullname', $A['fullname'] );
+ $alttext = $A['fullname'];
+ }
+ if( !empty( $A['photo'] ))
+ {
+ $template->set_var( 'author_photo', '<img src="'
+ . $_CONF['site_url']
+ . '/images/userphotos/' . $A['photo']
+ . '" alt="' . $alttext . '">' );
+ }
+ else
+ {
+ $template->set_var( 'author_photo', '' );
+ }
$template->set_var( 'start_author_anchortag', '<a href="'
. $_CONF['site_url'] . '/users.php?mode?profile&uid='
***************
*** 2564,2567 ****
--- 2585,2590 ----
else
{
+ $template->set_var( 'author_fullname', $A['username'] );
+ $template->set_var( 'author_photo', '' );
$template->set_var( 'start_author_anchortag', '' );
$template->set_var( 'end_author_anchortag', '' );
***************
*** 2635,2639 ****
// get children
! $q = "SELECT c.*,u.username,unix_timestamp(c.date) AS nice_date "
. "FROM {$_TABLES['comments']} AS c, {$_TABLES['users']} AS u "
. "WHERE c.uid = u.uid AND sid = '{$A['sid']}' AND pid = {$A['cid']} "
--- 2658,2662 ----
// get children
! $q = "SELECT c.*,u.username,u.fullname,u.photo,unix_timestamp(c.date) AS nice_date "
. "FROM {$_TABLES['comments']} AS c, {$_TABLES['users']} AS u "
. "WHERE c.uid = u.uid AND sid = '{$A['sid']}' AND pid = {$A['cid']} "
***************
*** 2708,2712 ****
{
case 'flat':
! $q = "SELECT c.*,u.username,unix_timestamp(date) AS nice_date "
. "FROM {$_TABLES['comments']} as c, {$_TABLES['users']} as u "
. "WHERE c.uid = u.uid AND sid = '$sid' AND type = '$type' "
--- 2731,2735 ----
{
case 'flat':
! $q = "SELECT c.*,u.username,u.fullname,u.photo,unix_timestamp(date) AS nice_date "
. "FROM {$_TABLES['comments']} as c, {$_TABLES['users']} as u "
. "WHERE c.uid = u.uid AND sid = '$sid' AND type = '$type' "
***************
*** 2717,2721 ****
case 'threaded':
default:
! $q = "SELECT c.*,u.username,unix_timestamp(date) AS nice_date "
. "FROM {$_TABLES['comments']} as c, {$_TABLES['users']} as u "
. "WHERE c.uid = u.uid AND sid = '$sid' AND pid = 0 AND type = '$type' "
--- 2740,2744 ----
case 'threaded':
default:
! $q = "SELECT c.*,u.username,u.fullname,u.photo,unix_timestamp(date) AS nice_date "
. "FROM {$_TABLES['comments']} as c, {$_TABLES['users']} as u "
. "WHERE c.uid = u.uid AND sid = '$sid' AND pid = 0 AND type = '$type' "
More information about the geeklog-cvs
mailing list