diff --git a/e107_core/shortcodes/single/nextprev.php b/e107_core/shortcodes/single/nextprev.php index 4019fa163..2add8255e 100644 --- a/e107_core/shortcodes/single/nextprev.php +++ b/e107_core/shortcodes/single/nextprev.php @@ -75,6 +75,21 @@ function nextprev_shortcode($parm = '') $total_items = intval($parm['total']); $check_render = true; + if(vartrue($parm['glyphs']) && (e_BOOTSTRAP === true)) + { + $LAN_NP_FIRST = ""; + $LAN_NP_PREVIOUS = ""; + $LAN_NP_NEXT = ""; + $LAN_NP_LAST = ""; + } + else + { + $LAN_NP_FIRST = LAN_NP_FIRST; + $LAN_NP_PREVIOUS = LAN_NP_PREVIOUS; + $LAN_NP_NEXT = LAN_NP_NEXT; + $LAN_NP_LAST = LAN_NP_LAST ; + } + // search for template keys - default_start, default_end etc. if(isset($parm['tmpl_prefix'])) { @@ -82,6 +97,12 @@ function nextprev_shortcode($parm = '') $tprefix = vartrue($parm['tmpl_prefix'], 'default'); //$perpage = $parm['amount'] !== 'all' ? intval($parm['amount']) : $total_items; } + elseif(isset($parm['tmpl'])) + { + // forced + $tprefix = vartrue($parm['tmpl'], 'default'); + //$perpage = $parm['amount'] !== 'all' ? intval($parm['amount']) : $total_items; + } // default, based on prefs elseif($pref['old_np']) { @@ -258,7 +279,7 @@ function nextprev_shortcode($parm = '') if($show_first && !empty($tmpl[$tprefix.'nav_first'])) { $e_vars->url = str_replace('[FROM]', $first_page, $url); - $e_vars->label = LAN_NP_FIRST; + $e_vars->label = $LAN_NP_FIRST; $e_vars->url_label = LAN_NP_URLFIRST; $ret_array[] = $tp->simpleParse($tmpl[$tprefix.'nav_first'], $e_vars); } @@ -266,7 +287,7 @@ function nextprev_shortcode($parm = '') if(!empty($tmpl[$tprefix.'nav_prev'])) { $e_vars->url = str_replace('[FROM]', $prev_page, $url); - $e_vars->label = LAN_NP_PREVIOUS; + $e_vars->label = $LAN_NP_PREVIOUS; $e_vars->url_label = LAN_NP_URLPREVIOUS; $ret_array[] = $tp->simpleParse($tmpl[$tprefix.'nav_prev'], $e_vars); } @@ -305,7 +326,7 @@ function nextprev_shortcode($parm = '') if(!empty($tmpl[$tprefix.'nav_next'])) { $e_vars->url = str_replace('[FROM]', $next_page, $url); - $e_vars->label = LAN_NP_NEXT; + $e_vars->label = $LAN_NP_NEXT; $e_vars->url_label = LAN_NP_URLNEXT; $ret_array[] = $tp->simpleParse($tmpl[$tprefix.'nav_next'], $e_vars); } @@ -313,7 +334,7 @@ function nextprev_shortcode($parm = '') if($show_last && !empty($tmpl[$tprefix.'nav_last'])) { $e_vars->url = str_replace('[FROM]', $last_page, $url);//$last_page - $e_vars->label = LAN_NP_LAST; + $e_vars->label = $LAN_NP_LAST; $e_vars->url_label = LAN_NP_URLLAST; $ret_array[] = $tp->simpleParse($tmpl[$tprefix.'nav_last'], $e_vars); } diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index a1bc07aff..4405d1ce8 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -1581,6 +1581,11 @@ class e107 */ public static function css($type, $data, $dep = null, $media = 'all', $preComment = '', $postComment = '', $dependence = null) { + if(strstr($data,'bootstrap') && !defined("e_BOOTSTRAP")) // detect bootstrap is enabled. - used in nextprev.sc currently. + { + define("e_BOOTSTRAP", true); + } + $jshandler = e107::getJs(); $jshandler->setDependency($dep); @@ -2237,6 +2242,11 @@ class e107 else $fname = e_LANGUAGE; $path = $theme.$fname.'.php'; + + if(E107_DBG_INCLUDES) + { + e107::getMessage()->addDebug("Attempting to Load: ".$path); + } e107::setRegistry($cstring, true); self::includeLan($path, false); diff --git a/e107_plugins/forum/forum_class.php b/e107_plugins/forum/forum_class.php index cb08f5790..6ef03cc5f 100644 --- a/e107_plugins/forum/forum_class.php +++ b/e107_plugins/forum/forum_class.php @@ -24,6 +24,7 @@ $(document).ready(function() var thread = $(this).attr('data-forum-thread'); var post = $(this).attr('data-forum-post'); var text = $('#forum-quickreply-text').val(); + var insert = $(this).attr('data-forum-insert'); @@ -37,7 +38,7 @@ $(document).ready(function() $.ajax({ type: "POST", url: script, - data: { thread: thread, action: action, post: post, text: text }, + data: { thread: thread, action: action, post: post, text: text, insert:insert }, success: function(data) { // alert(data); @@ -81,8 +82,8 @@ EON; e107::js('inline',$jscode,'jquery'); - -include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum.php'); +e107::lan('forum','lan_forum'); +// include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum.php'); include_once(e_PLUGIN . 'forum/templates/forum_icons_template.php'); @@ -134,41 +135,51 @@ class e107forum } - + /** + * Handle the Ajax quick-reply. + */ function ajaxQuickReply() { $tp = e107::getParser(); if(varset($_POST['action']) == 'quickreply' && vartrue($_POST['text'])) { - + $postInfo = array(); $postInfo['post_ip'] = e107::getIPHandler()->getIP(FALSE); + if (USER) { $postInfo['post_user'] = USERID; - + } else { $postInfo['post_user_anon'] = $_POST['anonname']; } - $postInfo['post_entry'] = $_POST['text']; - $postInfo['post_forum'] = intval($_POST['post']); - $postInfo['post_datestamp'] = time(); - $postInfo['post_thread'] = intval($_POST['thread']); + + $postInfo['post_entry'] = $_POST['text']; + $postInfo['post_forum'] = intval($_POST['post']); + $postInfo['post_datestamp'] = time(); + $postInfo['post_thread'] = intval($_POST['thread']); $this->postAdd($postInfo); // save it. + $postInfo['user_name'] = USERNAME; $postInfo['user_email'] = USEREMAIL; $postInfo['user_image'] = USERIMAGE; - - $tmpl = e107::getTemplate('forum','forum_viewtopic','replies'); - $sc = e107::getScBatch('view', 'forum'); - $sc->setScVar('postInfo', $postInfo); - - $ret['html'] = $tp->parseTemplate($tmpl, true, vartrue($forum_shortcodes)) . "\n"; - // $ret['html'] = "Help! I can't pass the template!".$tp->toHtml($_POST['text']).""; + + if($_POST['insert'] == 1) + { + $tmpl = e107::getTemplate('forum','forum_viewtopic','replies'); + $sc = e107::getScBatch('view', 'forum'); + $sc->setScVar('postInfo', $postInfo); + $ret['html'] = $tp->parseTemplate($tmpl, true, vartrue($forum_shortcodes)) . "\n"; + } + else + { + $ret['html'] = false; + } $ret['status'] = 'ok'; $ret['msg'] = "Your post has been added"; diff --git a/e107_plugins/forum/forum_post.php b/e107_plugins/forum/forum_post.php index f3050deb8..e1686874f 100644 --- a/e107_plugins/forum/forum_post.php +++ b/e107_plugins/forum/forum_post.php @@ -24,7 +24,7 @@ if (!$e107->isInstalled('forum')) exit; } -include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_post.php'); +// include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_post.php'); if (isset($_POST['fjsubmit'])) { diff --git a/e107_plugins/forum/forum_viewtopic.php b/e107_plugins/forum/forum_viewtopic.php index 6eac23d89..dcdf76b72 100644 --- a/e107_plugins/forum/forum_viewtopic.php +++ b/e107_plugins/forum/forum_viewtopic.php @@ -224,7 +224,7 @@ if ($thread->pages > 1) { if(!$thread->page) $thread->page = 1; $url = rawurlencode(e107::getUrl()->create('forum/thread/view', array('name' => $thread->threadInfo['thread_name'], 'id' => $thread->threadId, 'page' => '[FROM]'))); - $parms = "total={$thread->pages}&type=page¤t={$thread->page}&url=".$url."&caption=off"; + $parms = "total={$thread->pages}&type=page¤t={$thread->page}&url=".$url."&caption=off&tmpl=default&navcount=4&glyphs=1"; //XXX FIXME - pull-down template not practical here. Can we force another? $tVars->GOTOPAGES = $tp->parseTemplate("{NEXTPREV={$parms}}"); @@ -361,11 +361,13 @@ if ($forum->checkPerm($thread->threadInfo['thread_forum_id'], 'post') && $thread //XXX Show only on the last page?? if (!vartrue($forum_quickreply)) { + $ajaxInsert = ($thread->pages == $thread->page) ? 1 : 0; + $tVars->QUICKREPLY = "
$thread->threadId)) . "' method='post'>
- +
"; @@ -378,6 +380,8 @@ if ($forum->checkPerm($thread->threadInfo['thread_forum_id'], 'post') && $thread } } + + $forend = $tp->simpleParse($FORUMEND, $tVars); $forumstring = $forstr . $forthr . vartrue($forrep) . $forend; @@ -388,16 +392,17 @@ if ($thread->threadInfo['thread_lastpost'] > USERLV && !in_array($thread->thread { $tst = $forum->threadMarkAsRead($thread->threadId); } - +$mes = e107::getMessage(); require_once (HEADERF); + if ($forum->prefs->get('enclose')) { - $ns->tablerender(LAN_01, $forumstring, array('forum_viewtopic', 'main')); + $ns->tablerender(LAN_01, $forumstring, $mes->render(). array('forum_viewtopic', 'main')); } else { - echo $forumstring; + echo $mes->render() . $forumstring; } // end ------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/e107_plugins/forum/templates/forum_icons_template.php b/e107_plugins/forum/templates/forum_icons_template.php index 1ae9432f0..19e828c19 100644 --- a/e107_plugins/forum/templates/forum_icons_template.php +++ b/e107_plugins/forum/templates/forum_icons_template.php @@ -14,7 +14,7 @@ if ( ! defined('e107_INIT')) { exit(); } -include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_viewforum.php'); +// include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_viewforum.php'); // Thread info