mirror of
https://github.com/e107inc/e107.git
synced 2025-08-07 07:06:30 +02:00
Merge pull request #1275 from lonalore/master
A few minor fixes and corrections...
This commit is contained in:
@@ -99,11 +99,14 @@ class comment_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
$pref = e107::getPref();
|
$pref = e107::getPref();
|
||||||
$REPLY = '';
|
$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;
|
return $REPLY;
|
||||||
@@ -431,10 +434,10 @@ class comment_shortcodes extends e_shortcode
|
|||||||
if($prov == 'facebook' || $prov == 'twitter')
|
if($prov == 'facebook' || $prov == 'twitter')
|
||||||
{
|
{
|
||||||
//TODO Move styling to e107.css
|
//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 .= e107::getForm()->checkbox('comment_share',$prov,true);
|
||||||
|
|
||||||
$text .= "Share";
|
$text .= LAN_SHARE;
|
||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -42,9 +42,9 @@ $NEXTPREV_TEMPLATE['default_separator'] = ' ';
|
|||||||
|
|
||||||
/* ****************** Default when Bootstrap is enabled ************** */
|
/* ****************** Default when Bootstrap is enabled ************** */
|
||||||
|
|
||||||
$NEXTPREV_TEMPLATE['bootstrap_start'] = "<!-- Start of Next/Prev -->\n<div class='pagination'>\n<ul class='pagination'>";
|
$NEXTPREV_TEMPLATE['bootstrap_start'] = "<!-- Start of Next/Prev -->\n<nav>\n<ul class='pagination'>";
|
||||||
$NEXTPREV_TEMPLATE['bootstrap_end'] = "</ul></div><!-- End of Next/Prev -->";
|
$NEXTPREV_TEMPLATE['bootstrap_end'] = "</ul></nav><!-- End of Next/Prev -->";
|
||||||
$NEXTPREV_TEMPLATE['bootstrap_nav_caption'] = '';
|
$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_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>';
|
$NEXTPREV_TEMPLATE['bootstrap_nav_prev'] = '<li><a class="prev" href="{url}" title="{url_label}">{label}</a></li>';
|
||||||
|
@@ -1204,14 +1204,12 @@ class comment
|
|||||||
//$from = $from + $this->commentsPerPage;
|
//$from = $from + $this->commentsPerPage;
|
||||||
|
|
||||||
|
|
||||||
// from calculations are done by eNav() js.
|
// from calculations are done by eNav() js.
|
||||||
return "
|
if($this->totalComments > $this->commentsPerPage)
|
||||||
<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&type=".$table."&id=".$id."&from=0'>Previous</a>
|
{
|
||||||
|
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&type=".$table."&id=".$id."&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&type=".$table."&id=".$id."&from=0'>Next</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&type=".$table."&id=".$id."&from=0'>" . LAN_NEXT . "</a>";
|
||||||
|
}
|
||||||
";
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1306,7 +1304,7 @@ class comment
|
|||||||
foreach ($files as $file=>$perms)
|
foreach ($files as $file=>$perms)
|
||||||
{
|
{
|
||||||
unset($e_comment, $key);
|
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))
|
if ($e_comment && is_array($e_comment))
|
||||||
{
|
{
|
||||||
$key = $e_comment['eplug_comment_ids'];
|
$key = $e_comment['eplug_comment_ids'];
|
||||||
|
@@ -1030,9 +1030,10 @@ class e_jsmanager
|
|||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
$options = $this->arrayMergeDeepArray(array($this->_e_js_settings));
|
$options = $this->arrayMergeDeepArray(array($this->_e_js_settings));
|
||||||
$json = $tp->toJSON($options);
|
$json = $tp->toJSON($options);
|
||||||
$js = 'jQuery.extend(e107.settings, ' . $json . ');';
|
echo "<script>\n";
|
||||||
echo '<script>' . $js . '</script>';
|
echo "var e107 = e107 || {'settings': {}, 'behaviors': {}};\n";
|
||||||
echo "\n";
|
echo "jQuery.extend(e107.settings, " . $json . ");\n";
|
||||||
|
echo "</script>\n";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'framework': // CDN frameworks - rendered before consolidation script (if enabled)
|
case 'framework': // CDN frameworks - rendered before consolidation script (if enabled)
|
||||||
|
@@ -734,7 +734,7 @@ class e107ForumThread
|
|||||||
exit;
|
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->pages = ceil(($totalPosts) / $this->perPage);
|
||||||
$this->noInc = false;
|
$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})
|
WHERE {$maxage} p.post_forum IN ({$forumList})
|
||||||
ORDER BY p.post_datestamp DESC LIMIT 0, ".$menu_pref['newforumposts_display'];
|
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))
|
if($results = $sql->gen($qry))
|
||||||
{
|
{
|
||||||
$text = "<ul>";
|
$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 = 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']);
|
$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>";
|
$text .= "<li>";
|
||||||
|
|
||||||
|
@@ -101,18 +101,18 @@ $FORUM_TEMPLATE['main-start'] = "{FORUM_BREADCRUMB}
|
|||||||
|
|
||||||
$FORUM_TEMPLATE['main-parent'] = "<tr>
|
$FORUM_TEMPLATE['main-parent'] = "<tr>
|
||||||
<th colspan='2'>{PARENTNAME} {PARENTSTATUS}</th>
|
<th colspan='2'>{PARENTNAME} {PARENTSTATUS}</th>
|
||||||
<th class='hidden-xs' >".LAN_FORUM_0003."</th>
|
<th class='hidden-xs text-center'>".LAN_FORUM_0003."</th>
|
||||||
<th >".LAN_FORUM_0002."</th>
|
<th class='text-center'>".LAN_FORUM_0002."</th>
|
||||||
<th class='hidden-xs' >".LAN_FORUM_0004."</th>
|
<th class='hidden-xs text-center'>".LAN_FORUM_0004."</th>
|
||||||
</tr>";
|
</tr>";
|
||||||
|
|
||||||
|
|
||||||
$FORUM_TEMPLATE['main-forum'] = "<tr>
|
$FORUM_TEMPLATE['main-forum'] = "<tr>
|
||||||
<td>{NEWFLAG}</td>
|
<td>{NEWFLAG}</td>
|
||||||
<td>{FORUMNAME}<br /><small>{FORUMDESCRIPTION}</small>{FORUMSUBFORUMS}</td>
|
<td>{FORUMNAME}<br /><small>{FORUMDESCRIPTION}</small>{FORUMSUBFORUMS}</td>
|
||||||
<td class='hidden-xs'>{REPLIESX}</td>
|
<td class='hidden-xs text-center'>{REPLIESX}</td>
|
||||||
<td >{THREADSX}</td>
|
<td class='text-center'>{THREADSX}</td>
|
||||||
<td class='hidden-xs'><small>{LASTPOSTUSER} {LASTPOSTDATE}</small></td>
|
<td class='hidden-xs text-center'><small>{LASTPOSTUSER} {LASTPOSTDATE}</small></td>
|
||||||
</tr>";
|
</tr>";
|
||||||
|
|
||||||
$FORUM_TEMPLATE['main-end'] = "</table><div class='center'><small>{USERINFOX}</small></div></div>";
|
$FORUM_TEMPLATE['main-end'] = "</table><div class='center'><small>{USERINFOX}</small></div></div>";
|
||||||
|
@@ -310,7 +310,7 @@ $FORUM_VIEWFORUM_TEMPLATE['item'] = "<tr>
|
|||||||
|
|
||||||
</td>
|
</td>
|
||||||
</div>
|
</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>
|
<td class='hidden-xs'><small>{LASTPOSTUSER} {LASTPOSTDATE} </small><div class='span2 right pull-right'>{ADMINOPTIONS}</div></td>
|
||||||
</tr>\n";
|
</tr>\n";
|
||||||
|
|
||||||
@@ -320,15 +320,15 @@ $FORUM_VIEWFORUM_TEMPLATE['item-announce'] = $FORUM_VIEWFORUM_TEMPLATE['item']
|
|||||||
|
|
||||||
$FORUM_VIEWFORUM_TEMPLATE['sub-header'] = "<tr>
|
$FORUM_VIEWFORUM_TEMPLATE['sub-header'] = "<tr>
|
||||||
<th colspan='2'>".LAN_FORUM_1002."</th>
|
<th colspan='2'>".LAN_FORUM_1002."</th>
|
||||||
<th>".LAN_FORUM_0003."</th>
|
<th class='text-center'>".LAN_FORUM_0003."</th>
|
||||||
<th class='hidden-xs'>".LAN_FORUM_0002."</th>
|
<th class='hidden-xs text-center'>".LAN_FORUM_0002."</th>
|
||||||
<th class='hidden-xs'>".LAN_FORUM_0004."</th>
|
<th class='hidden-xs'>".LAN_FORUM_0004."</th>
|
||||||
</tr>";
|
</tr>";
|
||||||
|
|
||||||
$FORUM_VIEWFORUM_TEMPLATE['sub-item'] = "<tr><td>{NEWFLAG}</td>
|
$FORUM_VIEWFORUM_TEMPLATE['sub-item'] = "<tr><td>{NEWFLAG}</td>
|
||||||
<td><div>{SUB_FORUMTITLE}</div><small>{SUB_DESCRIPTION}</small></td>
|
<td><div>{SUB_FORUMTITLE}</div><small>{SUB_DESCRIPTION}</small></td>
|
||||||
<td>{SUB_REPLIESX}</td>
|
<td class='text-center'>{SUB_REPLIESX}</td>
|
||||||
<td class='hidden-xs'>{SUB_THREADSX}</td>
|
<td class='hidden-xs text-center'>{SUB_THREADSX}</td>
|
||||||
<td class='hidden-xs'><small>{SUB_LASTPOSTUSER} {SUB_LASTPOSTDATE}</small></td>
|
<td class='hidden-xs'><small>{SUB_LASTPOSTUSER} {SUB_LASTPOSTDATE}</small></td>
|
||||||
</tr>\n";
|
</tr>\n";
|
||||||
|
|
||||||
|
@@ -386,15 +386,27 @@ $FORUM_VIEWTOPIC_TEMPLATE['thread'] = "
|
|||||||
";
|
";
|
||||||
|
|
||||||
$FORUM_VIEWTOPIC_TEMPLATE['end'] = "</ul>
|
$FORUM_VIEWTOPIC_TEMPLATE['end'] = "</ul>
|
||||||
<div class='row row-fluid clearfix'>
|
<div class='col-xs-12'>
|
||||||
<div class='col-xs-12'><hr /></div>
|
<hr />
|
||||||
<div class='col-md-3 span3 pull-left'>{GOTOPAGES}</div>
|
</div>
|
||||||
<div class='col-xs-12 col-md-6 text-center span6 center'>{QUICKREPLY}</div>
|
<div class='row'>
|
||||||
<div class='col-xs-12 col-md-3 span3 pull-right right '>{BUTTONSX}</div>
|
<div class='col-xs-12 col-md-4'></div>
|
||||||
|
<div class='col-xs-12 col-md-4 text-center'>
|
||||||
|
{GOTOPAGES}
|
||||||
</div>
|
</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