1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 05:37:32 +02:00

Fixes #2494 Comment Menu Avatar. eg {CM_AUTHOR_AVATAR: shape=circle}

This commit is contained in:
Cameron
2017-03-05 08:07:09 -08:00
parent 78e9c02028
commit be28d221d6
3 changed files with 13 additions and 2 deletions

View File

@@ -1489,6 +1489,7 @@ class comment
//author - no ned to split now //author - no ned to split now
$comment_author_id = $row['comment_author_id']; $comment_author_id = $row['comment_author_id'];
$ret['comment_author_id'] = $comment_author_id ; $ret['comment_author_id'] = $comment_author_id ;
$ret['comment_author_image'] = $row['user_image'];
$comment_author_name = $row['comment_author_name']; $comment_author_name = $row['comment_author_name'];
$ret['comment_author'] = (USERID ? "<a href='".e107::getUrl()->create('user/profile/view', array('id' => $comment_author_id, 'name' => $comment_author_name))."'>".$comment_author_name."</a>" : $comment_author_name); $ret['comment_author'] = (USERID ? "<a href='".e107::getUrl()->create('user/profile/view', array('id' => $comment_author_id, 'name' => $comment_author_name))."'>".$comment_author_name."</a>" : $comment_author_name);
//comment text //comment text

View File

@@ -69,6 +69,12 @@ class comment_menu_shortcodes extends e_shortcode
return $this->var['comment_author']; return $this->var['comment_author'];
} }
function sc_cm_author_avatar($parm=null)
{
$data = array('user_id'=>$this->var['comment_author_id'], 'user_image'=>$this->var['comment_author_image']);
return e107::getParser()->toAvatar($data, $parm);
}
function sc_cm_comment($parm='') function sc_cm_comment($parm='')
{ {

View File

@@ -26,7 +26,7 @@ $sc_style['CM_DATESTAMP']['post'] = "";
$sc_style['CM_COMMENT']['pre'] = ""; $sc_style['CM_COMMENT']['pre'] = "";
$sc_style['CM_COMMENT']['post'] = ""; $sc_style['CM_COMMENT']['post'] = "";
// $SC_WRAPPER['CM_AUTHOR'] = CM_L13."{---}"; //XXX Not working at time of review // $SC_WRAPPER['CM_AUTHOR'] = CM_L13."{---}"; //XXX Not working as template is loaded the old way.
if (!isset($COMMENT_MENU_TEMPLATE)) if (!isset($COMMENT_MENU_TEMPLATE))
{ {
@@ -39,5 +39,9 @@ if (!isset($COMMENT_MENU_TEMPLATE))
</li>"; </li>";
$COMMENT_MENU_TEMPLATE['end'] = "</ul>"; $COMMENT_MENU_TEMPLATE['end'] = "</ul>";
// {CM_AUTHOR_AVATAR: shape=circle}
} }
?> ?>