';
@@ -324,7 +327,7 @@ class comment_shortcodes extends e_shortcode
/*
- function sc_user_avatar($parm='')
+ function sc_user_avatar($parm = null)
{
$this->var['user_id'] = USERID;
$this->var['user_image'] = USERIMAGE;
@@ -333,7 +336,7 @@ class comment_shortcodes extends e_shortcode
*/
- function sc_comment($parm='')
+ function sc_comment($parm=null)
{
// global $COMMENT, $pref;
$tp = e107::getParser();
@@ -346,7 +349,7 @@ class comment_shortcodes extends e_shortcode
}
- function sc_comment_status($parm='')
+ function sc_comment_status($parm = null)
{
switch ($this->var['comment_blocked'])
{
@@ -359,7 +362,7 @@ class comment_shortcodes extends e_shortcode
break;
default:
- return;
+ return null;
break;
}
@@ -368,7 +371,7 @@ class comment_shortcodes extends e_shortcode
- function sc_commentedit($parm='')
+ function sc_commentedit($parm = null)
{
global $COMMENTEDIT, $comment_edit_query;
$pref = e107::getPref();
@@ -394,14 +397,14 @@ class comment_shortcodes extends e_shortcode
}
- function sc_rating($parm='')
+ function sc_rating($parm = null)
{
global $RATING;
return $RATING;
}
- function sc_ipaddress($parm='')
+ function sc_ipaddress($parm = null)
{
global $IPADDRESS, $e107;
//require_once(e_HANDLER."encrypt_handler.php");
@@ -409,16 +412,16 @@ class comment_shortcodes extends e_shortcode
}
- function sc_level($parm='')
+ function sc_level($parm = null)
{
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'] ? vartrue($ldata[0]) : vartrue($ldata[1]));
+ //return ($this->var['user_admin'] ? vartrue($ldata[0]) : vartrue($ldata[1]));
}
- function sc_location($parm='')
+ function sc_location($parm = null)
{
global $LOCATION;
$tp = e107::getParser();
@@ -426,7 +429,7 @@ class comment_shortcodes extends e_shortcode
}
- function sc_signature($parm='')
+ function sc_signature($parm = null)
{
global $SIGNATURE;
$tp = e107::getParser();
@@ -435,11 +438,11 @@ class comment_shortcodes extends e_shortcode
}
- function sc_comment_share($parm='')
+ function sc_comment_share($parm = null)
{
if(!$xup = e107::getUser()->getProviderName())
{
- return;
+ return null;
}
list($prov,$id) = explode("_",$xup);
diff --git a/e107_handlers/comment_class.php b/e107_handlers/comment_class.php
index ff40f66a6..8e6ad791b 100644
--- a/e107_handlers/comment_class.php
+++ b/e107_handlers/comment_class.php
@@ -1078,6 +1078,7 @@ class comment
$tp = e107::getParser();
$ns = e107::getRender();
$pref = e107::getPref();
+ $frm = e107::getForm();
if ($this->getCommentPermissions() === FALSE) return;
@@ -1166,15 +1167,17 @@ class comment
{
$comment = "
".COMLAN_328."
";
}
-
+
+ $containerTarget = "comments-container-".$frm->name2id($table);
+
if($text)
{
//XXX Do NOT add to template - too important to allow for modification.
- $text = "";
+ $text = "";
}
else
{
- $text = "";
+ $text = "";
}
@@ -1322,6 +1325,9 @@ class comment
//return "table=".$table." id=".$id." from=".$from;
//$from = $from + $this->commentsPerPage;
+ $target = "comments-container-".e107::getForm()->name2id($table);
+
+ $navid = 'comments-nav-'.e107::getForm()->name2id($table);
// from calculations are done by eNav() js.
if($this->totalComments > $this->commentsPerPage)
@@ -1329,8 +1335,8 @@ class comment
$prev = e_HTTP . 'comment.php?mode=list&type=' . $table . '&id=' . $id . '&from=0';
$next = e_HTTP . 'comment.php?mode=list&type=' . $table . '&id=' . $id . '&from=0';
- return "
" . LAN_PREVIOUS . "
-
" . LAN_NEXT . "";
+ return "
" . LAN_PREVIOUS . "
+
" . LAN_NEXT . "";
}
}
diff --git a/e107_web/js/core/all.jquery.js b/e107_web/js/core/all.jquery.js
index 8b8301c81..873b4f696 100644
--- a/e107_web/js/core/all.jquery.js
+++ b/e107_web/js/core/all.jquery.js
@@ -166,6 +166,7 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
ajaxOptions.url = $element.attr('data-src');
// Set Ajax type to "GET".
ajaxOptions.type = 'GET';
+
}
if(ajaxOptions.wait != null)
@@ -428,6 +429,7 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
var val = src.match(/from=(\d+)/);
var amt = parseInt(val[1]);
+
var oldVal = 'from=' + amt;
var newVal = null;
@@ -456,6 +458,11 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
newVal = 'from=' + add;
}
+ if($(e).attr("data-nav-id"))
+ {
+ navid = '.' + $(e).attr("data-nav-id");
+ }
+
if(newVal)
{
src = src.replace(oldVal, newVal);
diff --git a/e107_web/js/core/front.jquery.js b/e107_web/js/core/front.jquery.js
index d25fe4f0b..6ca01a2f5 100644
--- a/e107_web/js/core/front.jquery.js
+++ b/e107_web/js/core/front.jquery.js
@@ -155,9 +155,13 @@ $(document).ready(function()
var sort = $(this).attr("data-sort");
var pid = parseInt($(this).attr("data-pid"));
var formid = (pid != '0') ? "#e-comment-form-reply" : "#e-comment-form";
- var data = $('form'+formid).serialize() ;
- var total = parseInt($("#e-comment-total").text());
-
+ var data = $('form'+formid).serializeArray() ;
+ var total = parseInt($("#e-comment-total").text());
+ var container = '#' + $(this).attr("data-container");
+ var input = '#' + $(this).attr("data-input");
+
+ //TODO replace _POST['comment'] with $(input).val() so we can rename 'comment' in the form to something unique.
+
$.ajax({
type: 'POST',
url: url + '?ajax_used=1&mode=submit',
@@ -167,14 +171,8 @@ $(document).ready(function()
// alert(data);
// console.log(data);
var a = $.parseJSON(data);
-
- $("#comment").val('');
-
- if($('#comments-container').length){
- // alert('true');
- }else{
- // $("#e-comment-form").parent().prepend("");
- }
+
+ $(input).val('');
if(pid != 0)
{
@@ -182,17 +180,18 @@ $(document).ready(function()
}
else if(sort == 'desc')
{
- $('#comments-container').prepend(a.html).hide().slideDown(800); // FIXME - works in jquery 1.7, not 1.8
+ $(container).prepend(a.html).hide().slideDown(800); // FIXME - works in jquery 1.7, not 1.8
}
else
{
- $('#comments-container').append(a.html).hide().slideDown(800); // FIXME - works in jquery 1.7, not 1.8
+ $(container).append(a.html).hide().slideDown(800); // FIXME - works in jquery 1.7, not 1.8
alert('Thank you for commenting'); // possibly needed as the submission may go unoticed by the user
}
if(!a.error)
{
$("#e-comment-total").text(total + 1);
+
if(pid != '0')
{
$(formid).hide();