1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 06:38:00 +02:00

Merge pull request #1275 from lonalore/master

A few minor fixes and corrections...
This commit is contained in:
Cameron
2016-01-13 13:59:53 -08:00
9 changed files with 77 additions and 46 deletions

View File

@@ -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 = "<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>";
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='".e_HTTP."comment.php' href='".e_HTTP."comment.php?reply.".$thistable.".".$this->var['comment_id'].".".$thisid."'>".COMLAN_326."</a>";
}
}
}
return $REPLY;
@@ -431,10 +434,10 @@ class comment_shortcodes extends e_shortcode
if($prov == 'facebook' || $prov == 'twitter')
{
//TODO Move styling to e107.css
$text = "<img src='".e_IMAGE."xup/".$prov.".png' style='display:inline-block;width:26px;height:26px;vertical-align:middle' alt='Share' />";
$text = "<img src='".e_IMAGE_ABS."xup/".$prov.".png' style='display:inline-block;width:26px;height:26px;vertical-align:middle' alt='Share' />";
$text .= e107::getForm()->checkbox('comment_share',$prov,true);
$text .= "Share";
$text .= LAN_SHARE;
return $text;
}
}

View File

@@ -42,9 +42,9 @@ $NEXTPREV_TEMPLATE['default_separator'] = '&nbsp;';
/* ****************** Default when Bootstrap is enabled ************** */
$NEXTPREV_TEMPLATE['bootstrap_start'] = "<!-- Start of Next/Prev -->\n<div class='pagination'>\n<ul class='pagination'>";
$NEXTPREV_TEMPLATE['bootstrap_end'] = "</ul></div><!-- End of Next/Prev -->";
$NEXTPREV_TEMPLATE['bootstrap_nav_caption'] = '';
$NEXTPREV_TEMPLATE['bootstrap_start'] = "<!-- Start of Next/Prev -->\n<nav>\n<ul class='pagination'>";
$NEXTPREV_TEMPLATE['bootstrap_end'] = "</ul></nav><!-- End of Next/Prev -->";
$NEXTPREV_TEMPLATE['bootstrap_nav_caption'] = '';
$NEXTPREV_TEMPLATE['bootstrap_nav_first'] = '<li><a class="first hidden-xs" href="{url}" title="{url_label}">{label}</a></li>';
$NEXTPREV_TEMPLATE['bootstrap_nav_prev'] = '<li><a class="prev" href="{url}" title="{url_label}">{label}</a></li>';

View File

@@ -1204,14 +1204,12 @@ class comment
//$from = $from + $this->commentsPerPage;
// from calculations are done by eNav() js.
return "
<a class='e-ajax btn btn-default btn-mini btn-sm' href='#' data-nav-total='{$this->totalComments}' data-nav-dir='down' data-nav-inc='{$this->commentsPerPage}' data-target='comments-container' data-src='".e_BASE."comment.php?mode=list&amp;type=".$table."&amp;id=".$id."&amp;from=0'>Previous</a>
<a class='e-ajax btn btn-default btn-mini btn-sm' href='#' data-nav-total='{$this->totalComments}' data-nav-dir='up' data-nav-inc='{$this->commentsPerPage}' data-target='comments-container' data-src='".e_BASE."comment.php?mode=list&amp;type=".$table."&amp;id=".$id."&amp;from=0'>Next</a>
";
// from calculations are done by eNav() js.
if($this->totalComments > $this->commentsPerPage)
{
return "<a class='e-ajax btn btn-default btn-mini btn-sm' href='#' data-nav-total='{$this->totalComments}' data-nav-dir='down' data-nav-inc='{$this->commentsPerPage}' data-target='comments-container' data-src='".e_BASE."comment.php?mode=list&amp;type=".$table."&amp;id=".$id."&amp;from=0'>" . LAN_PREVIOUS . "</a>
<a class='e-ajax btn btn-default btn-mini btn-sm' href='#' data-nav-total='{$this->totalComments}' data-nav-dir='up' data-nav-inc='{$this->commentsPerPage}' data-target='comments-container' data-src='".e_BASE."comment.php?mode=list&amp;type=".$table."&amp;id=".$id."&amp;from=0'>" . LAN_NEXT . "</a>";
}
}
@@ -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'];

View File

@@ -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 '<script>' . $js . '</script>';
echo "\n";
echo "<script>\n";
echo "var e107 = e107 || {'settings': {}, 'behaviors': {}};\n";
echo "jQuery.extend(e107.settings, " . $json . ");\n";
echo "</script>\n";
break;
case 'framework': // CDN frameworks - rendered before consolidation script (if enabled)

View File

@@ -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;
}

View File

@@ -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>";

View File

@@ -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>";

View File

@@ -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";

View File

@@ -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}
";