mirror of
https://github.com/e107inc/e107.git
synced 2025-07-30 19:30:25 +02:00
Bootstrap3 comment styling fixes
This commit is contained in:
@@ -138,9 +138,9 @@ if(e_AJAX_REQUEST) // TODO improve security
|
||||
$row['comment_id'] = $newid;
|
||||
$width = ($pid) ? 1 : 0;
|
||||
|
||||
$ret['html'] = "\n<!-- Appended -->\n";
|
||||
$ret['html'] = "\n<!-- Appended -->\n<li>";
|
||||
$ret['html'] .= e107::getComment()->render_comment($row,'comments','comment',intval($_POST['itemid']),$width);
|
||||
$ret['html'] .= "\n<!-- end Appended -->\n";
|
||||
$ret['html'] .= "</li>\n<!-- end Appended -->\n";
|
||||
|
||||
$ret['error'] = false;
|
||||
|
||||
|
@@ -94,7 +94,7 @@ class comment_shortcodes extends e_shortcode
|
||||
{
|
||||
if ($thisaction == "comment" && $pref['nested_comments'])
|
||||
{
|
||||
$REPLY = "<a id='e-comment-reply-".$this->var['comment_id']."' class='e-comment-reply btn btn-default btn-mini btn-xs' data-type='".$this->var['comment_type']."' data-target='/comment.php' href='".SITEURL."comment.php?reply.".$thistable.".".$this->var['comment_id'].".".$thisid."'>".COMLAN_326."</a>";
|
||||
$REPLY = "<a id='e-comment-reply-".$this->var['comment_id']."' class='e-comment-reply btn btn-default btn-mini btn-xs' data-type='".$this->var['comment_type']."' data-target='".e_HTTP."comment.php' href='".e_HTTP."comment.php?reply.".$thistable.".".$this->var['comment_id'].".".$thisid."'>".COMLAN_326."</a>";
|
||||
}
|
||||
}
|
||||
return $REPLY;
|
||||
@@ -210,7 +210,7 @@ class comment_shortcodes extends e_shortcode
|
||||
$value = (varset($this->var['eaction']) == "edit" ? COMLAN_320 : COMLAN_9);
|
||||
$pid = ($this->var['action'] == 'reply') ? $this->var['pid'] : 0;
|
||||
|
||||
return "<input data-pid='{$pid}' data-sort='{$pref}' data-target='".e_HTTP."comment.php' class='button btn btn-default e-comment-submit' type='submit' name='".$this->var['action']."submit' value='".$value."' />";
|
||||
return "<input data-pid='{$pid}' data-sort='{$pref}' data-target='".e_HTTP."comment.php' class='button btn btn-primary e-comment-submit' type='submit' name='".$this->var['action']."submit' value='".$value."' />";
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -83,26 +83,26 @@ $sc_style['COMMENT_BUTTON']['post'] = "";
|
||||
$sc_style['COMMENT_SHARE']['pre'] = "";
|
||||
$sc_style['COMMENT_SHARE']['post'] = "";
|
||||
|
||||
$sc_style['COMMENT_RATE']['pre'] = '<div class="comment-rate span2">';
|
||||
$sc_style['COMMENT_RATE']['post'] = '</div>';
|
||||
$sc_style['COMMENT_RATE']['pre'] = '';
|
||||
$sc_style['COMMENT_RATE']['post'] = '';
|
||||
|
||||
//$sc_style['USER_AVATAR']['pre'] = '<div class="comment-avatar center">';
|
||||
//$sc_style['USER_AVATAR']['post'] = '</div>';
|
||||
|
||||
$sc_style['COMMENT_MODERATE']['pre'] = '<div class="comment-moderate btn-group span2">';
|
||||
$sc_style['COMMENT_MODERATE']['post'] = '</div>';
|
||||
$sc_style['COMMENT_MODERATE']['pre'] = '<span class="comment-moderate">';
|
||||
$sc_style['COMMENT_MODERATE']['post'] = '</span>';
|
||||
|
||||
$sc_style['MODERATE']['pre'] = '<div class="span12" style="padding:10px">';
|
||||
$sc_style['MODERATE']['post'] = '</div>';
|
||||
|
||||
|
||||
$COMMENT_TEMPLATE['FORM'] = "
|
||||
$COMMENT_TEMPLATE['form'] = "
|
||||
{SETIMAGE: w=100}
|
||||
<div class='media comment-box comment-box-form clearfix'>
|
||||
<div class='comment-box-left pull-left span1' >
|
||||
<div class='comment-box-left media-object pull-left' >
|
||||
{COMMENT_AVATAR}
|
||||
</div>
|
||||
<div class='comment-box-right pull-left span11' style='text-align:left'>
|
||||
<div class='media-body comment-box-right text-left' >
|
||||
<div class='P10'>
|
||||
{AUTHOR_INPUT}
|
||||
{COMMENT_INPUT}
|
||||
@@ -113,26 +113,23 @@ $COMMENT_TEMPLATE['FORM'] = "
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='clear_b'><!-- --></div>";
|
||||
<div class='clear_b'><!-- --></div>
|
||||
<hr>";
|
||||
|
||||
|
||||
$COMMENT_TEMPLATE['ITEM_START'] = "<ul class='comments'>";
|
||||
|
||||
$COMMENT_TEMPLATE['ITEM_END'] = "</ul>";
|
||||
|
||||
|
||||
$COMMENT_TEMPLATE['ITEM'] = '
|
||||
$COMMENT_TEMPLATE['item'] = '
|
||||
{SETIMAGE: w=100}
|
||||
<div class="comment-box-left pull-left span1">
|
||||
<div class="media-object comment-box-left pull-left span1">
|
||||
{COMMENT_AVATAR}
|
||||
</div>
|
||||
<div class="comment-box-right pull-left span11">
|
||||
<div class="row-fluid">
|
||||
<div class="media-body comment-box-right ">
|
||||
<div class="row">
|
||||
|
||||
<div class="comment-box-username span1">{USERNAME}</div>
|
||||
<div class="comment-box-date span2">{TIMEDATE=relative}</div>
|
||||
<div class="comment-status span3">{COMMENT_STATUS}</div>
|
||||
<div class="comment-moderate span6">{COMMENT_RATE} {REPLY} {COMMENTEDIT} {COMMENT_MODERATE}</div>
|
||||
<div class="comment-box-username span2 col-md-2">{USERNAME}</div>
|
||||
<div class="comment-box-date span2 col-md-2">{TIMEDATE=relative}</div>
|
||||
<div class="comment-status span2 col-md-3">{COMMENT_STATUS}</div>
|
||||
<div class="comment-moderate span6 col-md-5 text-right">{COMMENT_RATE} {REPLY} {COMMENTEDIT} {COMMENT_MODERATE}</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -144,13 +141,17 @@ $COMMENT_TEMPLATE['ITEM'] = '
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
';
|
||||
|
||||
|
||||
|
||||
|
||||
$COMMENT_TEMPLATE['LAYOUT'] = '{COMMENTFORM}{COMMENTS} <div style="padding:10px 0px">{MODERATE}</div>';
|
||||
$COMMENT_TEMPLATE['layout'] = '{COMMENTFORM}{COMMENTS} <div style="padding:10px 0px">{MODERATE}</div>';
|
||||
|
||||
|
||||
?>
|
@@ -124,7 +124,7 @@ class comment
|
||||
|
||||
}
|
||||
|
||||
$this->template = $COMMENT_TEMPLATE;
|
||||
$this->template = array_change_key_case($COMMENT_TEMPLATE);
|
||||
|
||||
|
||||
}
|
||||
@@ -258,7 +258,7 @@ class comment
|
||||
|
||||
// -------------------------------------------------------------
|
||||
|
||||
$indent = ($action == 'reply') ? " class='offset1' " : "";
|
||||
$indent = ($action == 'reply') ? " class='media offset1' " : "";
|
||||
$formid = ($action == 'reply') ? "e-comment-form-reply" : "e-comment-form";
|
||||
|
||||
$text = "\n<div{$indent}>\n".e107::getMessage()->render('postcomment', true, false, false);//temporary here
|
||||
@@ -281,7 +281,7 @@ class comment
|
||||
|
||||
e107::getScBatch('comment')->setMode('edit');
|
||||
|
||||
$text .= $tp->parseTemplate($this->template['FORM'], TRUE, e107::getScBatch('comment'));
|
||||
$text .= $tp->parseTemplate($this->template['form'], TRUE, e107::getScBatch('comment'));
|
||||
|
||||
$text .= "\n<div>\n"; // All Hidden Elements.
|
||||
|
||||
@@ -406,8 +406,14 @@ class comment
|
||||
// $COMMENT_TEMPLATE['ITEM_END'] = "\n</div><div class='clear_b'><!-- --></div>\n";
|
||||
|
||||
//XXX Do NOT add to template - too important to allow for modification.
|
||||
$COMMENT_TEMPLATE['ITEM_START'] = "\n\n<li id='{COMMENT_ITEMID}' class='media comment-box clearfix'>\n";
|
||||
$COMMENT_TEMPLATE['ITEM_END'] = "\n</li>\n";
|
||||
$COMMENT_TEMPLATE['item_start'] = "\n\n<li id='{COMMENT_ITEMID}' class='media comment-box clearfix'>\n";
|
||||
$COMMENT_TEMPLATE['item_end'] = "\n</li>\n";
|
||||
|
||||
if(defset('BOOTSTRAP') === 2 || defset('BOOTSTRAP') === true) // Convert Bootstrap3 to Bootstrap 2 when detected.
|
||||
{
|
||||
$COMMENT_TEMPLATE['item'] = str_replace("row", "row-fluid", $COMMENT_TEMPLATE['item']);
|
||||
}
|
||||
|
||||
|
||||
if (vartrue($pref['nested_comments']))
|
||||
{
|
||||
@@ -415,14 +421,14 @@ class comment
|
||||
// $total_width = "95%";
|
||||
if ($width)
|
||||
{
|
||||
$renderstyle = $COMMENT_TEMPLATE['ITEM_START'];
|
||||
$renderstyle .= "<div class='offset".$width."' >".$COMMENT_TEMPLATE['ITEM']."</div>";
|
||||
$renderstyle .= $COMMENT_TEMPLATE['ITEM_END'];
|
||||
$renderstyle = $COMMENT_TEMPLATE['item_start'];
|
||||
$renderstyle .= "<div class='media offset".$width." col-md-offset-".$width."' >".$COMMENT_TEMPLATE['item']."</div>";
|
||||
$renderstyle .= $COMMENT_TEMPLATE['item_end'];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$renderstyle = $COMMENT_TEMPLATE['ITEM_START'].$COMMENT_TEMPLATE['ITEM'].$COMMENT_TEMPLATE['ITEM_END'];
|
||||
$renderstyle = $COMMENT_TEMPLATE['item_start'].$COMMENT_TEMPLATE['item'].$COMMENT_TEMPLATE['item_end'];
|
||||
|
||||
}
|
||||
if ($pref['comments_icon'])
|
||||
@@ -443,7 +449,7 @@ class comment
|
||||
}
|
||||
else
|
||||
{
|
||||
$renderstyle = $COMMENT_TEMPLATE['ITEM'];
|
||||
$renderstyle = $COMMENT_TEMPLATE['item'];
|
||||
}
|
||||
$highlight_search = FALSE;
|
||||
|
||||
@@ -548,6 +554,8 @@ class comment
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
|
||||
$comment = trim($comment);
|
||||
|
||||
if(!e107::getDb()->update("comments","comment_comment=\"".$tp->toDB($comment)."\" WHERE comment_id = ".intval($id).""))
|
||||
{
|
||||
return "Update Failed"; // trigger ajax error message.
|
||||
@@ -992,7 +1000,7 @@ class comment
|
||||
|
||||
$search = array("{MODERATE}","{COMMENTS}","{COMMENTFORM}","{COMMENTNAV}");
|
||||
$replace = array($modcomment,$text,$comment,$pagination);
|
||||
$TEMPL = str_replace($search,$replace,$this->template['LAYOUT']);
|
||||
$TEMPL = str_replace($search,$replace,$this->template['layout']);
|
||||
|
||||
if(!$return)
|
||||
{
|
||||
|
@@ -154,7 +154,7 @@ $(document).ready(function()
|
||||
}
|
||||
|
||||
$(id).attr('contentEditable',true);
|
||||
$(id).after("<div class='e-comment-edit-save'><input data-target='"+url+"' id='e-comment-edit-save-"+sp[3]+"' class='button e-comment-edit-save' type='button' value='Save' /></div>");
|
||||
$(id).after("<div class='e-comment-edit-save'><input data-target='"+url+"' id='e-comment-edit-save-"+sp[3]+"' class='button btn btn-success e-comment-edit-save' type='button' value='Save' /></div>");
|
||||
$('div.e-comment-edit-save').hide().fadeIn(800);
|
||||
$(id).addClass("e-comment-edit-active");
|
||||
$(id).focus();
|
||||
|
Reference in New Issue
Block a user