[geeklog-cvs] geeklog: Avoid code duplication
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Sun Dec 13 10:43:16 EST 2009
changeset 7520:2ee98e8cbff2
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/2ee98e8cbff2
user: Dirk Haun <dirk at haun-online.de>
date: Sat Dec 12 15:49:34 2009 +0100
description:
Avoid code duplication
diffstat:
system/lib-comment.php | 40 +++++++++++++++++-----------------------
1 files changed, 17 insertions(+), 23 deletions(-)
diffs (60 lines):
diff -r 1515e96f2f2d -r 2ee98e8cbff2 system/lib-comment.php
--- a/system/lib-comment.php Sat Dec 12 15:35:38 2009 +0100
+++ b/system/lib-comment.php Sat Dec 12 15:49:34 2009 +0100
@@ -330,39 +330,33 @@
$photo = '';
if ($_CONF['allow_user_photo']) {
- if (isset ($A['photo']) && empty($A['photo'])) {
+ if (isset($A['photo']) && empty($A['photo'])) {
$A['photo'] = '(none)';
}
$photo = USER_getPhoto($A['uid'], $A['photo'], $A['email']);
}
- if( !empty( $photo )) {
- $template->set_var( 'author_photo', $photo );
+ $profile_link = $_CONF['site_url']
+ . '/users.php?mode=profile&uid=' . $A['uid'];
+ if (! empty($photo)) {
+ $template->set_var('author_photo', $photo);
$camera_icon = '<img src="' . $_CONF['layout_url']
- . '/images/smallcamera.' . $_IMAGE_TYPE . '" alt=""' . XHTML . '>';
- $template->set_var( 'camera_icon',
- COM_createLink(
- $camera_icon,
- $_CONF['site_url'] . '/users.php?mode=profile&uid=' . $A['uid']
- )
- );
+ . '/images/smallcamera.' . $_IMAGE_TYPE . '" alt=""'
+ . XHTML . '>';
+ $template->set_var('camera_icon',
+ COM_createLink($camera_icon, $profile_link));
} else {
- $template->set_var( 'author_photo', '' );
- $template->set_var( 'camera_icon', '' );
+ $template->set_var('author_photo', '');
+ $template->set_var('camera_icon', '');
}
- $template->set_var( 'start_author_anchortag', '<a href="'
- . $_CONF['site_url'] . '/users.php?mode=profile&uid='
- . $A['uid'] . '">' );
- $template->set_var( 'end_author_anchortag', '</a>' );
- $template->set_var( 'author_link',
- COM_createLink(
- $fullname,
- $_CONF['site_url'] . '/users.php?mode=profile&uid=' . $A['uid']
- )
- );
+ $template->set_var('start_author_anchortag',
+ '<a href="' . $profile_link . '">' );
+ $template->set_var('end_author_anchortag', '</a>');
+ $template->set_var('author_link',
+ COM_createLink($fullname, $profile_link));
} else {
- //comment is from anonymous user
+ // comment is from anonymous user
if (isset($A['name'])) {
$A['username'] = strip_tags($A['name']);
}
More information about the geeklog-cvs
mailing list