diff --git a/e107_core/shortcodes/batch/comment_shortcodes.php b/e107_core/shortcodes/batch/comment_shortcodes.php
index 560cc7713..73bf10ce9 100644
--- a/e107_core/shortcodes/batch/comment_shortcodes.php
+++ b/e107_core/shortcodes/batch/comment_shortcodes.php
@@ -99,11 +99,14 @@ class comment_shortcodes extends e_shortcode
$pref = e107::getPref();
$REPLY = '';
- if($this->var['comment_lock'] != "1" && $this->var['comment_blocked'] < 1)
+ if(USERID || $pref['anon_post'] == 1)
{
- if ($thisaction == "comment" && $pref['nested_comments'])
+ if($this->var['comment_lock'] != "1" && $this->var['comment_blocked'] < 1)
{
- $REPLY = "";
+ if ($thisaction == "comment" && $pref['nested_comments'])
+ {
+ $REPLY = "";
+ }
}
}
return $REPLY;
@@ -431,10 +434,10 @@ class comment_shortcodes extends e_shortcode
if($prov == 'facebook' || $prov == 'twitter')
{
//TODO Move styling to e107.css
- $text = "
";
+ $text = "
";
$text .= e107::getForm()->checkbox('comment_share',$prov,true);
- $text .= "Share";
+ $text .= LAN_SHARE;
return $text;
}
}
diff --git a/e107_core/templates/nextprev_template.php b/e107_core/templates/nextprev_template.php
index 8a43b7ab8..c010ae9c0 100644
--- a/e107_core/templates/nextprev_template.php
+++ b/e107_core/templates/nextprev_template.php
@@ -42,9 +42,9 @@ $NEXTPREV_TEMPLATE['default_separator'] = ' ';
/* ****************** Default when Bootstrap is enabled ************** */
-$NEXTPREV_TEMPLATE['bootstrap_start'] = "\n
";
-$NEXTPREV_TEMPLATE['bootstrap_nav_caption'] = '';
+$NEXTPREV_TEMPLATE['bootstrap_start'] = "\n";
+$NEXTPREV_TEMPLATE['bootstrap_nav_caption'] = '';
$NEXTPREV_TEMPLATE['bootstrap_nav_first'] = '{label}';
$NEXTPREV_TEMPLATE['bootstrap_nav_prev'] = '{label}';
diff --git a/e107_handlers/comment_class.php b/e107_handlers/comment_class.php
index 3c950b919..c3e330041 100644
--- a/e107_handlers/comment_class.php
+++ b/e107_handlers/comment_class.php
@@ -1204,14 +1204,12 @@ class comment
//$from = $from + $this->commentsPerPage;
- // from calculations are done by eNav() js.
- return "
- Previous
-
- Next
-
- ";
-
+ // from calculations are done by eNav() js.
+ if($this->totalComments > $this->commentsPerPage)
+ {
+ return "" . LAN_PREVIOUS . "
+ " . LAN_NEXT . "";
+ }
}
@@ -1306,7 +1304,7 @@ class comment
foreach ($files as $file=>$perms)
{
unset($e_comment, $key);
- include (e_PLUGIN.$file."/e_comment.php");
+ include_once (e_PLUGIN.$file."/e_comment.php");
if ($e_comment && is_array($e_comment))
{
$key = $e_comment['eplug_comment_ids'];
diff --git a/e107_handlers/js_manager.php b/e107_handlers/js_manager.php
index c047f1d4b..d6a3e3d17 100644
--- a/e107_handlers/js_manager.php
+++ b/e107_handlers/js_manager.php
@@ -1030,9 +1030,10 @@ class e_jsmanager
$tp = e107::getParser();
$options = $this->arrayMergeDeepArray(array($this->_e_js_settings));
$json = $tp->toJSON($options);
- $js = 'jQuery.extend(e107.settings, ' . $json . ');';
- echo '';
- echo "\n";
+ echo "\n";
break;
case 'framework': // CDN frameworks - rendered before consolidation script (if enabled)
diff --git a/e107_plugins/forum/forum_viewtopic.php b/e107_plugins/forum/forum_viewtopic.php
index fb08876f1..8ecf1977c 100644
--- a/e107_plugins/forum/forum_viewtopic.php
+++ b/e107_plugins/forum/forum_viewtopic.php
@@ -734,7 +734,7 @@ class e107ForumThread
exit;
}
- $totalPosts = $this->threadInfo['thread_total_replies']; // + 1; // add 1 for the original post . ie. not a reply.
+ $totalPosts = $this->threadInfo['thread_total_replies'] + 1; // add +1 for the original post. ie. not a reply.
$this->pages = ceil(($totalPosts) / $this->perPage);
$this->noInc = false;
}
diff --git a/e107_plugins/forum/newforumposts_menu.php b/e107_plugins/forum/newforumposts_menu.php
index c654862c7..090d4c072 100755
--- a/e107_plugins/forum/newforumposts_menu.php
+++ b/e107_plugins/forum/newforumposts_menu.php
@@ -39,9 +39,12 @@ LEFT JOIN `#user` AS u ON u.user_id = p.post_user
WHERE {$maxage} p.post_forum IN ({$forumList})
ORDER BY p.post_datestamp DESC LIMIT 0, ".$menu_pref['newforumposts_display'];
+// Get forum plugin preferences.
+$plugForumPrefs = e107::getPlugConfig('forum')->getPref();
+// New MySQL class instantiation to avoid overrides.
+$db = new e_db_mysql();
-
-
+// TODO: cache menu.
if($results = $sql->gen($qry))
{
$text = "";
@@ -72,7 +75,21 @@ if($results = $sql->gen($qry))
$post = strip_tags($tp->toHTML($row['post_entry'], true, 'emotes_off, no_make_clickable', '', $pref['menu_wordwrap']));
$post = $tp->text_truncate($post, $menu_pref['newforumposts_characters'], $menu_pref['newforumposts_postfix']);
- $url = e107::getUrl()->create('forum/thread/last', $row);
+ // Count previous posts for calculating proper (topic) page number for the current post.
+ $postNum = $db->count('forum_post', '(*)', "WHERE post_id <= " . $row['post_id'] . " AND post_thread = " . $row['thread_id'] . " ORDER BY post_id ASC");
+ // Calculate (topic) page number for the current post.
+ $postPage = ceil($postNum / vartrue($plugForumPrefs['postspage'], 10));
+ // Load thread for passing it to e107::url().
+ $thread = $db->retrieve('forum_thread', '*', 'thread_id = ' . $row['thread_id']);
+
+ // Create URL for post.
+ // like: e107_plugins/forum/forum_viewtopic.php?id=1&p=2#post-55
+ $url = e107::url('forum', 'topic', $thread, array(
+ 'query' => array(
+ 'p' => $postPage, // proper page number
+ ),
+ 'fragment' => 'post-' . $row['post_id'], // jump page to post
+ ));
$text .= "- ";
diff --git a/e107_plugins/forum/templates/forum_template.php b/e107_plugins/forum/templates/forum_template.php
index 31576698b..d237001c8 100644
--- a/e107_plugins/forum/templates/forum_template.php
+++ b/e107_plugins/forum/templates/forum_template.php
@@ -101,18 +101,18 @@ $FORUM_TEMPLATE['main-start'] = "{FORUM_BREADCRUMB}
$FORUM_TEMPLATE['main-parent'] = "
{PARENTNAME} {PARENTSTATUS} |
- ".LAN_FORUM_0003." |
- ".LAN_FORUM_0002." |
- ".LAN_FORUM_0004." |
-
";
-
-
+ ".LAN_FORUM_0003." |
+ ".LAN_FORUM_0002." |
+ ".LAN_FORUM_0004." |
+ ";
+
+
$FORUM_TEMPLATE['main-forum'] = "
{NEWFLAG} |
{FORUMNAME} {FORUMDESCRIPTION}{FORUMSUBFORUMS} |
- {REPLIESX} |
- {THREADSX} |
- {LASTPOSTUSER} {LASTPOSTDATE} |
+ {REPLIESX} |
+ {THREADSX} |
+ {LASTPOSTUSER} {LASTPOSTDATE} |
";
$FORUM_TEMPLATE['main-end'] = "{USERINFOX}
";
diff --git a/e107_plugins/forum/templates/forum_viewforum_template.php b/e107_plugins/forum/templates/forum_viewforum_template.php
index db788e60e..d11c9dd6b 100644
--- a/e107_plugins/forum/templates/forum_viewforum_template.php
+++ b/e107_plugins/forum/templates/forum_viewforum_template.php
@@ -310,7 +310,7 @@ $FORUM_VIEWFORUM_TEMPLATE['item'] = "
- {REPLIESX} | {VIEWSX} |
+ {REPLIESX} | {VIEWSX} |
{LASTPOSTUSER} {LASTPOSTDATE} {ADMINOPTIONS} |
\n";
@@ -320,15 +320,15 @@ $FORUM_VIEWFORUM_TEMPLATE['item-announce'] = $FORUM_VIEWFORUM_TEMPLATE['item']
$FORUM_VIEWFORUM_TEMPLATE['sub-header'] = "
".LAN_FORUM_1002." |
- ".LAN_FORUM_0003." |
- ".LAN_FORUM_0002." |
+ ".LAN_FORUM_0003." |
+ ".LAN_FORUM_0002." |
".LAN_FORUM_0004." |
";
$FORUM_VIEWFORUM_TEMPLATE['sub-item'] = "{NEWFLAG} |
{SUB_FORUMTITLE} {SUB_DESCRIPTION} |
- {SUB_REPLIESX} |
- {SUB_THREADSX} |
+ {SUB_REPLIESX} |
+ {SUB_THREADSX} |
{SUB_LASTPOSTUSER} {SUB_LASTPOSTDATE} |
\n";
diff --git a/e107_plugins/forum/templates/forum_viewtopic_template.php b/e107_plugins/forum/templates/forum_viewtopic_template.php
index 46109d7f6..dd06ebe74 100644
--- a/e107_plugins/forum/templates/forum_viewtopic_template.php
+++ b/e107_plugins/forum/templates/forum_viewtopic_template.php
@@ -386,15 +386,27 @@ $FORUM_VIEWTOPIC_TEMPLATE['thread'] = "
";
$FORUM_VIEWTOPIC_TEMPLATE['end'] = "
-
-
-
{GOTOPAGES}
-
{QUICKREPLY}
-
{BUTTONSX}
+
+
+
+
+
+
+ {GOTOPAGES}
- {THREADSTATUS}
-
- ";
+
+
+
+{THREADSTATUS}
+";