1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 11:50:30 +02:00

Work on Avatars (can now be resized at any time). More comment templating options.

This commit is contained in:
CaMer0n
2012-06-15 04:15:46 +00:00
parent 49802bac9d
commit c898921631
12 changed files with 463 additions and 62 deletions

View File

@@ -1612,16 +1612,15 @@ function show_avatars()
$tp = e107::getParser();
$mes = e107::getMessage();
$handle = opendir(e_UPLOAD."avatars/"); //TODO replace with $fl
$avFiles = e107::getFile()->get_files(e_MEDIA."avatars/",".jpg|.png|.gif|.jpeg|.JPG|.GIF|.PNG");
$dirlist = array();
while ($file = readdir($handle))
foreach($avFiles as $f)
{
if ($file != '.' && $file != '..' && $file != "index.html" && $file != "null.txt" && $file != '/' && $file != 'CVS' && $file != 'Thumbs.db' && !is_dir($file))
{
$dirlist[] = $file;
}
$dirlist[] = $f['fname'];
}
closedir($handle);
$text = '';
@@ -1655,10 +1654,10 @@ function show_avatars()
}
//directory?
if(is_dir(e_UPLOADE."avatars/".$image_name))
if(is_dir(e_MEDIA."avatars/".$image_name))
{
//File info
$users = "<a class='e-tooltip' href='#' title='".IMALAN_69.": {$image_name}'><img class='icon S16' src='".e_IMAGE_ABS."admin_images/info_16.png' alt='".IMALAN_66.": {$image_name}' /></a> <span class='error'>".IMALAN_69."</span>";
$users = "<a href='#' title='".IMALAN_69.": {$image_name}'><img class='e-tip icon S16' src='".e_IMAGE_ABS."admin_images/info_16.png' alt='".IMALAN_66.": {$image_name}' title='".IMALAN_69.": {$image_name}' /></a> <span class='error'>".IMALAN_69."</span>";
//Friendly UI - click text to select a form element
$img_src = '<span class="error">'.IMALAN_70.'</span>';
@@ -1667,16 +1666,18 @@ function show_avatars()
else
{
//File info
$users = "<a class='e-tooltip' href='#' title='".IMALAN_66.": {$image_name}'><img src='".e_IMAGE_ABS."admin_images/info_16.png' alt='".IMALAN_66.": {$image_name}' /></a> ".$users;
// $users = "<a class='e-tip' href='#' title='".IMALAN_66.": {$image_name}'><img src='".e_IMAGE_ABS."admin_images/info_16.png' alt='".IMALAN_66.": {$image_name}' /></a> ".$users;
// Control over the image size (design)
$image_size = getimagesize(e_UPLOAD."avatars/".$image_name);
$image_size = getimagesize(e_MEDIA."avatars/".$image_name);
//Friendly UI - click text to select a form element
$img_src = "<label for='image-action-{$count}' title='".IMALAN_56."'><img src='".e_FILE_ABS."public/avatars/{$image_name}' alt='{$image_name}' /></label>";
$img_src = "<label for='image-action-{$count}' title='".IMALAN_56."'>
<img class='e-tip' src='".e_MEDIA."avatars/{$image_name}' alt='{$image_name}' title='".IMALAN_66.": {$image_name}' />
</label>";
if ($image_size[0] > $pref['im_width'] || $image_size[1] > $pref['im_height'])
{
$img_src = "<a class='image-preview' href='".e_FILE_ABS."public/avatars/".rawurlencode($image_name)."' rel='external'>".IMALAN_57."</a>";
$img_src = "<a class='image-preview' href='".e_MEDIA."avatars/".rawurlencode($image_name)."' rel='external'>".IMALAN_57."</a>";
}
}

View File

@@ -185,6 +185,7 @@ if (isset ($_POST['test_mail']))
// ------- Update Options. --------------
if (isset ($_POST['update_options']))
{
$mes = e107::getMessage();
$temp = array();
$temp['avatar_upload'] = (FILE_UPLOADS ? $_POST['avatar_upload'] : 0);
$temp['im_width'] = $_POST['im_width'];

View File

@@ -15,8 +15,199 @@
*/
if (!defined('e107_INIT')) { exit; }
include_once(e_HANDLER.'shortcode_handler.php');
$comment_shortcodes = e107::getScParser()->parse_scbatch(__FILE__);
//include_once(e_HANDLER.'shortcode_handler.php');
//$comment_shortcodes = e107::getScParser()->parse_scbatch(__FILE__);
class comment_shortcodes extends e_shortcode
{
var $var;
function sc_subject($parm)
{
global $SUBJECT, $comrow, $pref, $NEWIMAGE, $tp;
if (isset($pref['nested_comments']) && $pref['nested_comments']) {
$SUBJECT = $NEWIMAGE." ".(empty($this->var['comment_subject']) ? $subject : $tp->toHTML($this->var['comment_subject'], TRUE));
} else {
$SUBJECT = '';
}
return $SUBJECT;
}
function sc_username($parm)
{
global $USERNAME;
if (isset($this->var['user_id']) && $this->var['user_id'])
{
$USERNAME = $parm == 'raw' ? $this->var['user_name'] : "<a href='".e107::getUrl()->create('user/profile/view', array('id' => $this->var['user_id'], 'name' => $this->var['user_name']))."'>".$this->var['user_name']."</a>\n";
}
else
{
$this->var['user_id'] = 0;
$USERNAME = preg_replace("/[0-9]+\./", '', $this->var['comment_author_name']);
$USERNAME = str_replace("Anonymous", LAN_ANONYMOUS, $USERNAME);
}
return $USERNAME;
}
function sc_TIMEDATE($parm)
{
global $TIMEDATE, $datestamp, $gen;
$datestamp = $gen->convert_date($this->var['comment_datestamp'], "short");
return $datestamp;
}
function sc_reply($parm)
{
global $REPLY, $action, $pref, $table, $id, $thisaction, $thistable, $thisid;
$REPLY = '';
if($this->var['comment_lock'] != "1"){
if ($thisaction == "comment" && $pref['nested_comments']) {
$REPLY = "<a href='".SITEURL."comment.php?reply.".$thistable.".".$this->var['comment_id'].".".$thisid."'>".COMLAN_326."</a>";
}
}
return $REPLY;
}
function sc_comment_avatar($parm)
{
$height = e107::getPref("im_height");
$width = e107::getPref("im_width");
$tp = e107::getParser();
if (vartrue($this->var['user_id']))
{
if (vartrue($this->var['user_image']))
{
$img = $tp->thumbUrl(e_MEDIA."avatars/".$this->var['user_image'],"aw=".$width."&ah=".$height);
$text = "<div class='comments-avatar'><img class='comment-avatar' src='".$img."' alt='' /></div>";
}
else
{
$img = $tp->thumbUrl(e_IMAGE."generic/blank_avatar.jpg","aw=".$width."&ah=".$height);
$text = "<div class='comments-avatar'><img class='comment-avatar' src='".$img."' alt='' /></div>";
}
}
else
{
$img = $tp->thumbUrl(e_IMAGE."generic/blank_avatar.jpg","aw=".$width."&ah=".$height);
$text = "<div class='comments-avatar'><img class='comment-avatar' src='".$img."' alt='' /></div>";
}
return $text;
}
function sc_avatar($parm)
{
// --------- Legacy Code below for those who still want to use it.
global $AVATAR;
if (isset($this->var['user_id']) && $this->var['user_id']) {
if (isset($this->var['user_image']) && $this->var['user_image']) {
// require_once(e_HANDLER."avatar_handler.php");
// $this->var['user_image'] = avatar($this->var['user_image']);
$this->var['user_image'] = "<div class='spacer'><img src='".$this->var['user_image']."' alt='' /></div>";
}else{
$this->var['user_image'] = '';
}
}else{
$this->var['user_image'] = '';
}
return $this->var['user_image'];
}
function sc_comments($parm)
{
global $COMMENTS;
return (isset($this->var['user_id']) && $this->var['user_id'] ? COMLAN_99.": ".$this->var['user_comments'] : COMLAN_194)."<br />";
}
function sc_joined($parm)
{
global $JOINED, $gen;
$JOINED = '';
if ($this->var['user_id'] && !$this->var['user_admin']) {
$this->var['user_join'] = $gen->convert_date($this->var['user_join'], "short");
$JOINED = ($this->var['user_join'] ? COMLAN_145." ".$this->var['user_join'] : '');
}
return $JOINED;
}
function sc_comment($parm)
{
global $COMMENT, $pref;
$tp = e107::getParser();
return (isset($this->var['comment_blocked']) && $this->var['comment_blocked'] ? COMLAN_0 : $tp->toHTML($this->var['comment_comment'], TRUE, FALSE, $this->var['user_id']));
}
function sc_commentedit($parm)
{
global $COMMENTEDIT, $pref, $comment_edit_query;
if ($pref['allowCommentEdit'] && USER && $this->var['user_id'] == USERID && $this->var['comment_lock'] != "1")
{
$adop_icon = (file_exists(THEME."images/commentedit.png") ? THEME_ABS."images/commentedit.png" : e_IMAGE_ABS."admin_images/edit_16.png");
//Searching for '.' is BAD!!! It breaks mod rewritten requests. Why is this needed at all?
if (strstr(e_QUERY, "&"))
{
return "<a href='".e_SELF."?".e_QUERY."&amp;comment=edit&amp;comment_id=".$this->var['comment_id']."'><img src='".$adop_icon."' alt='".COMLAN_318."' title='".COMLAN_318."' class='icon' /></a>";
}
else
{
// return "<a href='".e_SELF."?".$comment_edit_query.".edit.".$this->var['comment_id']."'><img src='".e_IMAGE."generic/newsedit.png' alt='".COMLAN_318."' title='".COMLAN_318."' style='border: 0;' /></a>";
return "<a href='".SITEURL."comment.php?".$comment_edit_query.".edit.".$this->var['comment_id']."#e-comment-form'><img src='".$adop_icon."' alt='".COMLAN_318."' title='".COMLAN_318."' class='icon' /></a>";
}
}
else
{
return "";
}
}
function sc_rating($parm)
{
global $RATING;
return $RATING;
}
function sc_ipaddress($parm)
{
global $IPADDRESS, $e107;
//require_once(e_HANDLER."encrypt_handler.php");
return (ADMIN ? "<a href='".SITEURL."userposts.php?0.comments.".$this->var['user_id']."'>".COMLAN_330." ".e107::getIPHandler()->ipDecode($this->var['comment_ip'])."</a>" : "");
}
function sc_level($parm)
{
global $LEVEL, $pref;
//FIXME - new level handler, currently commented to avoid parse errors
//$ldata = get_level($this->var['user_id'], $this->var['user_forums'], $this->var['user_comments'], $this->var['user_chats'], $this->var['user_visits'], $this->var['user_join'], $this->var['user_admin'], $this->var['user_perms'], $pref);
return ($this->var['user_admin'] ? $ldata[0] : $ldata[1]);
}
function sc_location($parm)
{
global $LOCATION;
$tp = e107::getParser();
return (isset($this->var['user_location']) && $this->var['user_location'] ? COMLAN_313.": ".$tp->toHTML($this->var['user_location'], TRUE) : '');
}
function sc_signature($parm)
{
global $SIGNATURE;
$tp = e107::getParser();
$SIGNATURE = (isset($this->var['user_signature']) && $this->var['user_signature'] ? $tp->toHTML($this->var['user_signature'], true) : '');
return $SIGNATURE;
}
}
/*
SC_BEGIN SUBJECT

View File

@@ -161,7 +161,7 @@ $ret = "
<input class='button' type ='button' style=' cursor:pointer' size='30' value='".LAN_USET_38."' onclick='expandit(this)' />
<div style='display:none' >";
$avatarlist[0] = "";
$handle = opendir(e_IMAGE."avatars/");
$handle = opendir(e_MEDIA."avatars/");
while ($file = readdir($handle))
{
if ($file != "." && $file != ".." && $file != "index.html" && $file != "CVS")
@@ -173,7 +173,7 @@ closedir($handle);
for($c = 1; $c <= (count($avatarlist)-1); $c++)
{
$ret .= "<a href='javascript:addtext_us(\"$avatarlist[$c]\")'><img src='".e_IMAGE."avatars/".$avatarlist[$c]."' alt='' /></a> ";
$ret .= "<a href='javascript:addtext_us(\"$avatarlist[$c]\")'><img src='".e_MEDIA."avatars/".$avatarlist[$c]."' alt='' /></a> ";
}
$ret .= "

View File

@@ -0,0 +1,8 @@
$(document).ready(function()
{
$(":input").tipsy({gravity: 'w',fade: true});
});

View File

@@ -475,7 +475,7 @@ class e_bbcode
$temp['mailout'] = $BBCODE_TEMPLATE_MAILOUT;
$temp['page'] = $BBCODE_TEMPLATE_CPAGE;
$temp['maintenance']= $BBCODE_TEMPLATE_ADMIN;
$temp['comment'] = $BBCODE_TEMPLATE;
$temp['comment'] = $BBCODE_TEMPLATE_COMMENT;
$temp['signature'] = $BBCODE_TEMPLATE_SIGNATURE;
if(isset($temp[$template]))
@@ -529,7 +529,7 @@ class e_bbcode
array( "[block]", '<div>'),
array( "[/block]", '</div>'),
array( "[table]\n", '<table>'),
array( "[/table]", '</table>'),
array( "[/table]\n", '</table>'),
array( "[table]\n", '<table class="bbcode-table">'),
array( "[tbody]\n", '<tbody class="bbcode-tbody">'),
array( "[tr]", '<tr class="bbcode-tr">'),
@@ -537,10 +537,15 @@ class e_bbcode
array( "[tbody]\n", '<tbody>'),
array( "[/tbody]\n", '</tbody>'),
array( "[code]\n", '<code>'),
array( "[/code]\n", '</code>'),
array( "[tr]", '<tr>'),
array( "\n[/tr]\n", '</tr>'),
array( "\n\t[td]", '<td>'),
array( "[/td]", '</td>'),
array( "[/td]", '</td>'),
array( "[blockquote]", '<blockquote>'),
array( "[blockquote]", '<blockquote class="indent bbcode-blockquote">'),
array( "[/blockquote]",'</blockquote>'),
);
foreach($convert as $arr)
@@ -554,11 +559,13 @@ class e_bbcode
$text = preg_replace('/<div class="bbcode-(?:[\w]*)" style="text-align: ([\w]*);">([\s\S]*)<\/div>/i',"[$1]$2[/$1]",$text); // left / right / center
$text = preg_replace('/<img(?:\s*)?(?:style="([^"]*)")?\s?(?:src="([^"]*)")(?:\s*)?(?:alt="(\S*)")?(?:\s*)?(?:width="([\d]*)")?\s*(?:height="([\d]*)")?(?:\s*)?\/>/i',"[img style=width:$4px;height:$5px;$1]$2[/img]",$text );
$text = preg_replace('/<img class="bbcode bbcode-img"(?:\s*)?(?:style="([^"]*)")?\s?(?:src="([^"]*)")(?:\s*)?(?:alt="(\S*)")?(?:\s*)?(?:width="([\d]*)")?\s*(?:height="([\d]*)")?(?:\s*)?\/>/i',"[img style=width:$4px;height:$5px;$1]$2[/img]",$text );
$text = preg_replace('/<span (?:class="bbcode-color" )?style=\"color: ?(.*?);\">(.*?)<\/span>/i',"[color=$1]$2[/color]",$text);
// $text = preg_replace('/<span (?:class="bbcode-color" )?style=\"color: ?(.*?);\">(.*?)<\/span>/i',"[color=$1]$2[/color]",$text);
$text = preg_replace('/<span (?:class="bbcode underline bbcode-u" )?style="text-decoration: underline;">(.*?)<\/span>/i',"[u]$1[/u]",$text);
// $text = preg_replace('/<table([^"]*)>/i', "[table $1]",$text);
$text = preg_replace('/<table style="([^"]*)"([\w ="]*)?>/i', "[table style=$1]\n",$text);
$text = preg_replace('/<tbody([\w ="]*)?>/i', "[tbody]\n",$text);
$text = preg_replace('/<code([\w :\-_;="]*)?>/i', "[code]\n",$text);
$blank = array('</li>','width:px;height:px;');

View File

@@ -41,6 +41,28 @@ class comment
6 => 'bugtrack'
);
private $template;
function __construct()
{
global $COMMENTSTYLE;
if (!$COMMENTSTYLE)
{
require_once(e107::coreTemplatePath('comment'));
}
else // BC
{
$COMMENT_TEMPLATE['ITEM_START'] = "";
$COMMENT_TEMPLATE['ITEM'] = $COMMENTSTYLE;
$COMMENT_TEMPLATE['ITEM_END'] = "";
$COMMENT_TEMPLATE['LAYOUT'] = "{COMMENTS}{COMMENTFORM}{MODERATE}";
}
$this->template = $COMMENT_TEMPLATE;
}
/**
* Display the comment editing form
*
@@ -62,7 +84,9 @@ class comment
return;
}
require_once(e_HANDLER."ren_help.php");
// require_once(e_HANDLER."ren_help.php");
if ($this->getCommentPermissions() == 'rw')
{
$itemid = $id;
@@ -185,7 +209,7 @@ class comment
</div>";
//TODO Add Template
if ($tablerender)
{
@@ -223,14 +247,25 @@ class comment
function render_comment($row, $table, $action, $id, $width, $subject, $addrating = FALSE)
{
//addrating : boolean, to show rating system in rendered comment
global $sql, $sc_style, $comment_shortcodes, $COMMENTSTYLE, $rater, $gen;
global $pref, $comrow, $tp, $NEWIMAGE, $USERNAME, $RATING, $datestamp;
global $sc_style, $rater, $gen;
$tp = e107::getParser();
$sql = e107::getDb();
$pref = e107::getPref();
global $NEWIMAGE, $USERNAME, $RATING, $datestamp;
global $thisaction,$thistable,$thisid,$e107;
if (isset($pref['comments_disabled']) && $pref['comments_disabled'] == TRUE)
{
return;
}
$comrow = $row;
e107::getScBatch('comment')->setParserVars($row);
$thistable = $table;
$thisid = $id;
$thisaction = $action;
@@ -256,35 +291,37 @@ class comment
{
define("IMAGE_new_comments", (file_exists(THEME."images/new_comments.png") ? "<img src='".THEME_ABS."images/new_comments.png' alt='' /> " : "<img src='".e_IMAGE_ABS."generic/new_comments.png' alt='' /> "));
}
$ns = new e107table;
if (!$gen || !is_object($gen))
{
$gen = new convert;
}
$url = e_PAGE."?".e_QUERY;
$unblock = "[<a href='".e_ADMIN_ABS."comment.php?unblock-".$comrow['comment_id']."-$url-".$comrow['comment_item_id']."'>".COMLAN_1."</a>] ";
$block = "[<a href='".e_ADMIN_ABS."comment.php?block-".$comrow['comment_id']."-$url-".$comrow['comment_item_id']."'>".COMLAN_2."</a>] ";
$delete = "[<a href='".e_ADMIN_ABS."comment.php?delete-".$comrow['comment_id']."-$url-".$comrow['comment_item_id']."'>".COMLAN_3."</a>] ";
$userinfo = "[<a href='".e_ADMIN_ABS."userinfo.php?".e107::getIPHandler()->ipDecode($comrow['comment_ip'])."'>".COMLAN_4."</a>]";
if (!$COMMENTSTYLE)
{
global $THEMES_DIRECTORY;
$COMMENTSTYLE = "";
if (file_exists(THEME."comment_template.php"))
{
require_once (THEME."comment_template.php");
}
else
{
require_once (e_BASE.$THEMES_DIRECTORY."templates/comment_template.php");
}
}
$url = e_PAGE."?".e_QUERY;
$unblock = "[<a href='".e_ADMIN_ABS."comment.php?unblock-".$comrow['comment_id']."-$url-".$comrow['comment_item_id']."'>".COMLAN_1."</a>] ";
$block = "[<a href='".e_ADMIN_ABS."comment.php?block-".$comrow['comment_id']."-$url-".$comrow['comment_item_id']."'>".COMLAN_2."</a>] ";
$delete = "[<a href='".e_ADMIN_ABS."comment.php?delete-".$comrow['comment_id']."-$url-".$comrow['comment_item_id']."'>".COMLAN_3."</a>] ";
$userinfo = "[<a href='".e_ADMIN_ABS."userinfo.php?".e107::getIPHandler()->ipDecode($comrow['comment_ip'])."'>".COMLAN_4."</a>]";
$COMMENT_TEMPLATE = $this->template;
if ($pref['nested_comments'])
{
$width2 = 100 - $width;
$total_width = "95%";
if ($width)
{
$renderstyle = $COMMENT_TEMPLATE['ITEM_START'];
$renderstyle .= "<div style='margin-left:{$width}%'>".$COMMENT_TEMPLATE['ITEM']."</div>";
$renderstyle .= $COMMENT_TEMPLATE['ITEM_END'];
/*
$renderstyle = "
<table style='width:".$total_width."' border='0'>
<tr>
@@ -293,10 +330,14 @@ class comment
</td>
</tr>
</table>";
* */
}
else
{
$renderstyle = $COMMENTSTYLE;
$renderstyle = $COMMENT_TEMPLATE['ITEM_START'].$COMMENT_TEMPLATE['ITEM'].$COMMENT_TEMPLATE['ITEM_END'];
}
if ($pref['comments_icon'])
{
@@ -316,13 +357,16 @@ class comment
}
else
{
$renderstyle = $COMMENTSTYLE;
$renderstyle = $COMMENT_TEMPLATE['ITEM'];
}
$highlight_search = FALSE;
if (isset($_POST['highlight_search']))
{
$highlight_search = TRUE;
}
if (!defined("IMAGE_rank_main_admin_image"))
{
define("IMAGE_rank_main_admin_image", (isset($pref['rank_main_admin_image']) && $pref['rank_main_admin_image'] && file_exists(THEME."forum/".$pref['rank_main_admin_image']) ? "<img src='".THEME_ABS."forum/".$pref['rank_main_admin_image']."' alt='' />" : "<img src='".e_PLUGIN_ABS."forum/images/lite/main_admin.png' alt='' />"));
@@ -335,8 +379,17 @@ class comment
{
define("IMAGE_rank_admin_image", (isset($pref['rank_admin_image']) && $pref['rank_admin_image'] && file_exists(THEME."forum/".$pref['rank_admin_image']) ? "<img src='".THEME_ABS."forum/".$pref['rank_admin_image']."' alt='' />" : "<img src='".e_PLUGIN_ABS."forum/images/lite/admin.png' alt='' />"));
}
$RATING = ($addrating == TRUE && $comrow['user_id'] ? $rater->composerating($thistable, $thisid, FALSE, $comrow['user_id']) : "");
$comment_shortcodes = e107::getScBatch('comment');
// $text = $tp->parseTemplate($COMMENT_TEMPLATE['ITEM_START'], TRUE, $comment_shortcodes);
$text = $tp->parseTemplate($renderstyle, TRUE, $comment_shortcodes);
if ($action == "comment" && $pref['nested_comments'])
{
$type = $this->getCommentType($thistable);
@@ -362,6 +415,9 @@ class comment
}
}
} // End (nested comment handling)
return $text;
}
@@ -373,7 +429,7 @@ class comment
* @param unknown_type $comment
* @param unknown_type $table
* @param integer $id - reference of item in source table to which comment is linked
* @param unknown_type $pid
* @param unknown_type $pid - parent comment id when it's a reply to a specific comment. t
* @param unknown_type $subject
* @param unknown_type $rateindex
*/
@@ -689,7 +745,13 @@ class comment
{
//compose comment : single call function will render the existing comments and show the form_comment
//rate : boolean, to show/hide rating system in comment, default FALSE
global $pref, $ns, $e107cache, $tp, $totcc;
global $e107cache, $totcc;
$tp = e107::getParser();
$ns = e107::getRender();
$pref = e107::getPref();
if ($this->getCommentPermissions() === FALSE) return;
$sql = e107::getDb();
@@ -734,16 +796,7 @@ class comment
if ($tablerender)
{
$text = $ns->tablerender(COMLAN_99, $text, '', TRUE);
}
if (!$return)
{
echo $text;
}
else
{
$ret['comment'] = $text;
// $text = $ns->tablerender(COMLAN_99, $text, '', TRUE);
}
if (ADMIN && getperms("B"))
@@ -754,7 +807,7 @@ class comment
if ($lock != '1')
{
$comment = $this->form_comment($action, $table, $id, $subject, "", TRUE, $rate, $tablerender);
$comment = $this->form_comment($action, $table, $id, $subject, "", TRUE, $rate, false); // tablerender turned off.
}
else
{
@@ -763,10 +816,28 @@ class comment
if (!$return)
{
echo $modcomment.$comment;
$search = array("{MODERATE}","{COMMENTS}","{COMMENTFORM}");
$replace = array($modcomment,$text,$comment);
$TEMPL = str_replace($search,$replace,$this->template['LAYOUT']);
if ($tablerender)
{
echo $ns->tablerender(COMLAN_99, $TEMPL, 'comment', TRUE);
}
else
{
echo $TEMPL;
}
//echo $modcomment.$comment;
//echo $text;
}
$ret['comment'] = $text . $modcomment;
$ret['comment'] .= $modcomment;
$ret['comment_form'] = $comment;
$ret['caption'] = COMLAN_99;

View File

@@ -24,6 +24,8 @@ $BBCODE_TEMPLATE = "
<div class='field-spacer'><!-- --></div>
";
$BBCODE_TEMPLATE_COMMENT = ""; // no buttons on comments by default.
// $BBCODE_TEMPLATE .= "{BB=blank}";
$BBCODE_TEMPLATE_SIGNATURE = "

View File

@@ -59,7 +59,7 @@ $sc_style['LOCATION']['post'] = "<br />";
$sc_style['SIGNATURE']['pre'] = "";
$sc_style['SIGNATURE']['post'] = "<br />";
/*
$COMMENTSTYLE = "
<table class='fborder' style='".USER_WIDTH."'>
<tr>
@@ -82,6 +82,92 @@ $COMMENTSTYLE = "
</tr>
</table>
<br />";
*/
// from e107.org
$sc_style['COMMENTEDIT']['pre'] = '<div class="clear_b H10"><!-- --></div><div class="comments-box-reply smalltext f-right">';
$sc_style['COMMENTEDIT']['post'] = '</div>';
$sc_style['COMMENT_AVATAR']['pre'] = '<div class="center">';
$sc_style['COMMENT_AVATAR']['post'] = '</div>';
$COMMENT_TEMPLATE['ITEM'] = '
<div class="comments-box-left">
{COMMENT_AVATAR}
</div>
<div class="comments-box-right">
<div class="P10">
<span class="comments-box-username">{USERNAME}</span>
<span class="comments-box-date">{TIMEDATE}</span>
<span class="comments-reply">{REPLY}</span>
<div class="comments-user-badge-bar">
{SUPPORT}
</div>
<div class="clear_b H5"><!-- --></div>
{COMMENT}
{COMMENTEDIT}
</div>
</div>';
$COMMENT_TEMPLATE['ITEM_START'] = '<div class="comments-box clearfix">';
$COMMENT_TEMPLATE['ITEM_END'] = '</div><div class="clear_b"><!-- --></div>';
$COMMENT_TEMPLATE['LAYOUT'] = '{COMMENTFORM}{COMMENTS}{MODERATE}';
$COMMENT_TEMPLATE['FORM'] = ""; //TODO
/*
$COMMENTSTYLE = '
<div class="comments-box clearfix">
<div class="comments-box-left">
{COMMENT_AVATAR}
</div>
<div class="comments-box-right">
<div class="P10">
<span class="comments-box-username">{USERNAME}</span>
<span class="comments-box-date">{TIMEDATE}</span>
<span class="comments-reply">{REPLY}</span>
<div class="comments-user-badge-bar">
{SUPPORT}
</div>
<div class="clear_b H5"><!-- --></div>
{COMMENT}
{COMMENTEDIT}
</div>
</div>
';
*/
?>

View File

@@ -130,3 +130,29 @@ h1.bbcode, h2.bbcode, h3.bbcode, h4.bbcode, h5.bbcode, h6.bbcode { }/* override
div.bbcode { margin: 15px 0px; clear: both; } /* layout control via bbcodes */
/* default comments layout */
.comments-box { padding-bottom:10px; margin-bottom:10px; border-top:1px solid #C0C0C0; }
.comments-box-left { float:left; text-align:center; width:10%; min-width:100px }
.comments-box-userinfo { padding:20px 5px 10px 5px; }
.comments-box-username { padding-left:0px; font-size:1.2em; padding-right: 10px }
.comments-avatar { padding:10px 10px 0px 10px; }
img.comment-avatar { max-width:128px; -webkit-box-shadow:#CCCCCC 0px 0px 10px; -moz-box-shadow:#CCCCCC 0px 0px 10px; box-shadow:#CCCCCC 0px 0px 10px; -webkit-border-radius:5px; -moz-border-radius:5px; border-radius:5px; }
.comments-box-right { width:85%; min-height: 70px; float:left; }
.comments-box-arrow { width:11px; height:26px; float:left; position:relative; top:5px; left:-18px; }
.comments-box-date { }
.comments-user-badge-bar { float:right; margin-left:20px; }
.comments-box-reply { position:relative; bottom:0px; right:-10px; padding:2px 5px; font-size:0.85em; background-color:#EBFAFF; border:1px solid #C6F1FF; border-bottom:0px none; border-right:0px none; -webkit-border-top-left-radius: 5px; -moz-border-radius-topleft: 5px; border-top-left-radius: 5px; }

View File

@@ -45,7 +45,7 @@ require_once(e107::coreTemplatePath('signup')); //correct way to load a core tem
//include_once(e_CORE.'shortcodes/batch/signup_shortcodes.php');
$signup_shortcodes = e107::getScBatch('signup');
$facebook_shortcodes = e107::getScBatch('facebook',TRUE);
// $facebook_shortcodes = e107::getScBatch('facebook',TRUE);
$signup_imagecode = ($pref['signcode'] && extension_loaded('gd'));
$text = '';

View File

@@ -59,6 +59,14 @@ require_once (e_HANDLER.'ren_help.php');
include_once (e107::coreTemplatePath('usersettings')); //correct way to load a core template.
include_once (e_CORE.'shortcodes/batch/usersettings_shortcodes.php');
e107::js('inline',"
function addtext_us(sc)
{
document.getElementById('dataform').image.value = sc;
}
");
// include JS, headerjs not called in header anymore
$js = e107::getJs();
$js->footerInline(headerjs());