mirror of
https://github.com/e107inc/e107.git
synced 2025-08-22 14:13:03 +02:00
Merge pull request #1275 from lonalore/master
A few minor fixes and corrections...
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
@@ -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 = "<ul>";
|
||||
@@ -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 .= "<li>";
|
||||
|
||||
|
@@ -101,18 +101,18 @@ $FORUM_TEMPLATE['main-start'] = "{FORUM_BREADCRUMB}
|
||||
|
||||
$FORUM_TEMPLATE['main-parent'] = "<tr>
|
||||
<th colspan='2'>{PARENTNAME} {PARENTSTATUS}</th>
|
||||
<th class='hidden-xs' >".LAN_FORUM_0003."</th>
|
||||
<th >".LAN_FORUM_0002."</th>
|
||||
<th class='hidden-xs' >".LAN_FORUM_0004."</th>
|
||||
</tr>";
|
||||
|
||||
|
||||
<th class='hidden-xs text-center'>".LAN_FORUM_0003."</th>
|
||||
<th class='text-center'>".LAN_FORUM_0002."</th>
|
||||
<th class='hidden-xs text-center'>".LAN_FORUM_0004."</th>
|
||||
</tr>";
|
||||
|
||||
|
||||
$FORUM_TEMPLATE['main-forum'] = "<tr>
|
||||
<td>{NEWFLAG}</td>
|
||||
<td>{FORUMNAME}<br /><small>{FORUMDESCRIPTION}</small>{FORUMSUBFORUMS}</td>
|
||||
<td class='hidden-xs'>{REPLIESX}</td>
|
||||
<td >{THREADSX}</td>
|
||||
<td class='hidden-xs'><small>{LASTPOSTUSER} {LASTPOSTDATE}</small></td>
|
||||
<td class='hidden-xs text-center'>{REPLIESX}</td>
|
||||
<td class='text-center'>{THREADSX}</td>
|
||||
<td class='hidden-xs text-center'><small>{LASTPOSTUSER} {LASTPOSTDATE}</small></td>
|
||||
</tr>";
|
||||
|
||||
$FORUM_TEMPLATE['main-end'] = "</table><div class='center'><small>{USERINFOX}</small></div></div>";
|
||||
|
@@ -310,7 +310,7 @@ $FORUM_VIEWFORUM_TEMPLATE['item'] = "<tr>
|
||||
|
||||
</td>
|
||||
</div>
|
||||
<td >{REPLIESX}</td><td class='hidden-xs'>{VIEWSX}</td>
|
||||
<td class='text-center'>{REPLIESX}</td><td class='hidden-xs text-center'>{VIEWSX}</td>
|
||||
<td class='hidden-xs'><small>{LASTPOSTUSER} {LASTPOSTDATE} </small><div class='span2 right pull-right'>{ADMINOPTIONS}</div></td>
|
||||
</tr>\n";
|
||||
|
||||
@@ -320,15 +320,15 @@ $FORUM_VIEWFORUM_TEMPLATE['item-announce'] = $FORUM_VIEWFORUM_TEMPLATE['item']
|
||||
|
||||
$FORUM_VIEWFORUM_TEMPLATE['sub-header'] = "<tr>
|
||||
<th colspan='2'>".LAN_FORUM_1002."</th>
|
||||
<th>".LAN_FORUM_0003."</th>
|
||||
<th class='hidden-xs'>".LAN_FORUM_0002."</th>
|
||||
<th class='text-center'>".LAN_FORUM_0003."</th>
|
||||
<th class='hidden-xs text-center'>".LAN_FORUM_0002."</th>
|
||||
<th class='hidden-xs'>".LAN_FORUM_0004."</th>
|
||||
</tr>";
|
||||
|
||||
$FORUM_VIEWFORUM_TEMPLATE['sub-item'] = "<tr><td>{NEWFLAG}</td>
|
||||
<td><div>{SUB_FORUMTITLE}</div><small>{SUB_DESCRIPTION}</small></td>
|
||||
<td>{SUB_REPLIESX}</td>
|
||||
<td class='hidden-xs'>{SUB_THREADSX}</td>
|
||||
<td class='text-center'>{SUB_REPLIESX}</td>
|
||||
<td class='hidden-xs text-center'>{SUB_THREADSX}</td>
|
||||
<td class='hidden-xs'><small>{SUB_LASTPOSTUSER} {SUB_LASTPOSTDATE}</small></td>
|
||||
</tr>\n";
|
||||
|
||||
|
@@ -386,15 +386,27 @@ $FORUM_VIEWTOPIC_TEMPLATE['thread'] = "
|
||||
";
|
||||
|
||||
$FORUM_VIEWTOPIC_TEMPLATE['end'] = "</ul>
|
||||
<div class='row row-fluid clearfix'>
|
||||
<div class='col-xs-12'><hr /></div>
|
||||
<div class='col-md-3 span3 pull-left'>{GOTOPAGES}</div>
|
||||
<div class='col-xs-12 col-md-6 text-center span6 center'>{QUICKREPLY}</div>
|
||||
<div class='col-xs-12 col-md-3 span3 pull-right right '>{BUTTONSX}</div>
|
||||
<div class='col-xs-12'>
|
||||
<hr />
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class='col-xs-12 col-md-4'></div>
|
||||
<div class='col-xs-12 col-md-4 text-center'>
|
||||
{GOTOPAGES}
|
||||
</div>
|
||||
{THREADSTATUS}
|
||||
|
||||
";
|
||||
<div class='col-xs-12 col-md-4'>
|
||||
<div class='pull-right'>
|
||||
{BUTTONSX}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class='col-xs-12 col-md-6 col-md-offset-3'>
|
||||
{QUICKREPLY}
|
||||
</div>
|
||||
</div>
|
||||
{THREADSTATUS}
|
||||
";
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user