diff --git a/comment.php b/comment.php index 401fea973..3bdac645f 100644 --- a/comment.php +++ b/comment.php @@ -138,9 +138,9 @@ if(e_AJAX_REQUEST) // TODO improve security $row['comment_id'] = $newid; $width = ($pid) ? 1 : 0; - $ret['html'] = "\n\n"; + $ret['html'] = "\n\n
  • "; $ret['html'] .= e107::getComment()->render_comment($row,'comments','comment',intval($_POST['itemid']),$width); - $ret['html'] .= "\n\n"; + $ret['html'] .= "
  • \n\n"; $ret['error'] = false; diff --git a/e107_core/shortcodes/batch/comment_shortcodes.php b/e107_core/shortcodes/batch/comment_shortcodes.php index 902069532..9c8a9396a 100644 --- a/e107_core/shortcodes/batch/comment_shortcodes.php +++ b/e107_core/shortcodes/batch/comment_shortcodes.php @@ -94,7 +94,7 @@ class comment_shortcodes extends e_shortcode { if ($thisaction == "comment" && $pref['nested_comments']) { - $REPLY = "".COMLAN_326.""; + $REPLY = "".COMLAN_326.""; } } 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 ""; + return ""; } } diff --git a/e107_core/templates/comment_template.php b/e107_core/templates/comment_template.php index 0c9f1b1ca..e22898e53 100644 --- a/e107_core/templates/comment_template.php +++ b/e107_core/templates/comment_template.php @@ -83,26 +83,26 @@ $sc_style['COMMENT_BUTTON']['post'] = ""; $sc_style['COMMENT_SHARE']['pre'] = ""; $sc_style['COMMENT_SHARE']['post'] = ""; -$sc_style['COMMENT_RATE']['pre'] = '
    '; -$sc_style['COMMENT_RATE']['post'] = '
    '; +$sc_style['COMMENT_RATE']['pre'] = ''; +$sc_style['COMMENT_RATE']['post'] = ''; //$sc_style['USER_AVATAR']['pre'] = '
    '; //$sc_style['USER_AVATAR']['post'] = '
    '; -$sc_style['COMMENT_MODERATE']['pre'] = '
    '; -$sc_style['COMMENT_MODERATE']['post'] = '
    '; +$sc_style['COMMENT_MODERATE']['pre'] = ''; +$sc_style['COMMENT_MODERATE']['post'] = ''; $sc_style['MODERATE']['pre'] = '
    '; $sc_style['MODERATE']['post'] = '
    '; -$COMMENT_TEMPLATE['FORM'] = " +$COMMENT_TEMPLATE['form'] = " {SETIMAGE: w=100}
    -
    +
    {COMMENT_AVATAR}
    -
    +
    {AUTHOR_INPUT} {COMMENT_INPUT} @@ -113,26 +113,23 @@ $COMMENT_TEMPLATE['FORM'] = "
    -
    "; +
    +
    "; -$COMMENT_TEMPLATE['ITEM_START'] = ""; - - -$COMMENT_TEMPLATE['ITEM'] = ' +$COMMENT_TEMPLATE['item'] = ' {SETIMAGE: w=100} -
    +
    {COMMENT_AVATAR}
    -
    -
    +
    +
    -
    {USERNAME}
    -
    {TIMEDATE=relative}
    -
    {COMMENT_STATUS}
    -
    {COMMENT_RATE} {REPLY} {COMMENTEDIT} {COMMENT_MODERATE}
    +
    {USERNAME}
    +
    {TIMEDATE=relative}
    +
    {COMMENT_STATUS}
    +
    {COMMENT_RATE} {REPLY} {COMMENTEDIT} {COMMENT_MODERATE}
    @@ -144,13 +141,17 @@ $COMMENT_TEMPLATE['ITEM'] = '
    + + + +
    '; -$COMMENT_TEMPLATE['LAYOUT'] = '{COMMENTFORM}{COMMENTS}
    {MODERATE}
    '; +$COMMENT_TEMPLATE['layout'] = '{COMMENTFORM}{COMMENTS}
    {MODERATE}
    '; ?> \ No newline at end of file diff --git a/e107_handlers/comment_class.php b/e107_handlers/comment_class.php index 5cb63911f..d912ff331 100644 --- a/e107_handlers/comment_class.php +++ b/e107_handlers/comment_class.php @@ -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\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
    \n"; // All Hidden Elements. @@ -406,8 +406,14 @@ class comment // $COMMENT_TEMPLATE['ITEM_END'] = "\n
    \n"; //XXX Do NOT add to template - too important to allow for modification. - $COMMENT_TEMPLATE['ITEM_START'] = "\n\n
  • \n"; - $COMMENT_TEMPLATE['ITEM_END'] = "\n
  • \n"; + $COMMENT_TEMPLATE['item_start'] = "\n\n
  • \n"; + $COMMENT_TEMPLATE['item_end'] = "\n
  • \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 .= "
    ".$COMMENT_TEMPLATE['ITEM']."
    "; - $renderstyle .= $COMMENT_TEMPLATE['ITEM_END']; + $renderstyle = $COMMENT_TEMPLATE['item_start']; + $renderstyle .= "
    ".$COMMENT_TEMPLATE['item']."
    "; + $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) { diff --git a/e107_web/js/core/front.jquery.js b/e107_web/js/core/front.jquery.js index 06cc59a7a..623fb7351 100644 --- a/e107_web/js/core/front.jquery.js +++ b/e107_web/js/core/front.jquery.js @@ -154,7 +154,7 @@ $(document).ready(function() } $(id).attr('contentEditable',true); - $(id).after("
    "); + $(id).after("
    "); $('div.e-comment-edit-save').hide().fadeIn(800); $(id).addClass("e-comment-edit-active"); $(id).focus();