diff --git a/e107_plugins/forum/shortcodes/batch/forum_shortcodes.php b/e107_plugins/forum/shortcodes/batch/forum_shortcodes.php index b218d1b7c..4038d2bf0 100644 --- a/e107_plugins/forum/shortcodes/batch/forum_shortcodes.php +++ b/e107_plugins/forum/shortcodes/batch/forum_shortcodes.php @@ -558,6 +558,7 @@ $gen = new convert; global $forum; list($lastpost_datestamp, $lastpost_thread) = explode('.', $this->var['forum_lastpost_info']); +/*-- if ($this->var['user_name']) { @@ -567,6 +568,8 @@ $gen = new convert; { $lastpost_name = e107::getParser()->toHTML($this->var['forum_lastpost_user_anon']); } +--*/ + $lastpost_name = ($this->var['user_name'])?" $this->var['user_name'], 'id' => $this->var['forum_lastpost_user']))."'>{$this->var['user_name']}":e107::getParser()->toHTML($this->var['forum_lastpost_user_anon']); $lastpost = $forum->threadGetLastpost($lastpost_thread); //XXX TODO inefficient to have SQL query here. diff --git a/e107_plugins/forum/shortcodes/batch/view_shortcodes.php b/e107_plugins/forum/shortcodes/batch/view_shortcodes.php index cc625123c..920ef4a44 100644 --- a/e107_plugins/forum/shortcodes/batch/view_shortcodes.php +++ b/e107_plugins/forum/shortcodes/batch/view_shortcodes.php @@ -860,7 +860,8 @@ function sc_forumjump() global $forum; $jumpList = $forum->forumGetAllowed(); $text = "

".LAN_FORUM_1017.": "; - foreach($jumpList as $key => $val) +//-- foreach($jumpList as $key => $val) + foreach($jumpList as $val) { $text .= "\n"; } @@ -273,13 +312,16 @@ global $sc, $forum, $forumId; //var_dump ($subsc); //-- $forum_id ?????? -$subList = $forum->forumGetSubs(vartrue($forum_id)); +//--$subList = $forum->forumGetSubs(vartrue($forum_id)); +//--$subList = $forum->forumGetSubs(vartrue($forumId)); +$subList = $forum->forumGetSubs(false); // var_dump ($forum); if(is_array($subList) && isset($subList[$this->var['forum_parent']][$forumId])) { - $newflag_list = $forum->forumGetUnreadForums(); +//-- $newflag_list ?????? +//-- $newflag_list = $forum->forumGetUnreadForums(); $sub_info = ''; global $FORUM_VIEW_SUB, $FORUM_VIEW_SUB_START, $FORUM_VIEW_SUB_END; foreach($subList[$this->var['forum_parent']][$forumId] as $subInfo) @@ -421,12 +463,17 @@ class plugin_forum_viewsubforum_shortcodes extends plugin_forum_viewforum_shortc function sc_newflag() { - global $newflag_list; +//-- global $newflag_list; + global $forum; + $newflag_list = $forum->forumGetUnreadForums(); +/*-- if(USER && is_array($newflag_list) && in_array($this->var['forum_id'], $newflag_list)) { return "".IMAGE_new.''; } return IMAGE_nonew; +--*/ + return (USER && is_array($newflag_list) && in_array($this->var['forum_id'], $newflag_list))?"".IMAGE_new.'':IMAGE_nonew; } @@ -442,15 +489,20 @@ class plugin_forum_viewsubforum_shortcodes extends plugin_forum_viewforum_shortc $lp_thread = " $tmp[1]))."'>".IMAGE_post2.''; $lp_date = $this->gen->convert_date($tmp[0], 'forum'); +/*-- + $lp_name = $this->var['forum_lastpost_user_anon']; if($this->var['user_name']) { $lp_name = " $this->var['forum_lastpost_user'], 'name' => $this->var['user_name']))."'>{$this->var['user_name']}"; } +--*/ +/*-- else { $lp_name = $this->var['forum_lastpost_user_anon']; } - +--*/ + $lp_name = ($this->var['user_name'])?" $this->var['forum_lastpost_user'], 'name' => $this->var['user_name']))."'>{$this->var['user_name']}":$this->var['forum_lastpost_user_anon']; /*---- $tVars['SUB_LASTPOST'] = $lp_date.'
'.$lp_name.' '.$lp_thread; @@ -513,22 +565,30 @@ class plugin_forum_viewforumthread_shortcodes extends plugin_forum_viewforum_sho function sc_viewsx() { +/*-- if(!deftrue('BOOTSTRAP')) { return $this->sc_views; } $badge = ($this->var['thread_views'] > 0) ? "badge-info" : ""; return "".$this->sc_views.""; +--*/ + $badge = ($this->var['thread_views'] > 0) ? "badge-info" : ""; + return deftrue('BOOTSTRAP')?"".$this->sc_views."":$this->sc_views; } function sc_repliesx() { +/*-- if(!deftrue('BOOTSTRAP')) { return $this->sc_replies; } $badge = ($this->var['thread_total_replies'] > 0) ? "badge-info" : ""; return "".$this->sc_replies.""; +--*/ + $badge = ($this->var['thread_total_replies'] > 0) ? "badge-info" : ""; + return deftrue('BOOTSTRAP')?"".$this->sc_replies."":$this->sc_replies; } // function sc__wrapper_() { return 'forum_viewforum';} @@ -541,6 +601,7 @@ class plugin_forum_viewforumthread_shortcodes extends plugin_forum_viewforum_sho { // global $gen; //---- $lastpost_datestamp = $gen->convert_date($this->var['thread_lastpost'], 'forum'); +$LASTPOST = $LASTPOSTUSER = LAN_FORUM_1015; if($this->var['lastpost_username']) { // XXX hopefully & is not allowed in user name - it would break parsing of url parameters, change to array if something wrong happens @@ -549,20 +610,26 @@ class plugin_forum_viewforumthread_shortcodes extends plugin_forum_viewforum_sho //---- $tVars['LASTPOSTUSER'] = "".$this->var['lastpost_username'].""; $LASTPOST = $LASTPOSTUSER = "".$this->var['lastpost_username'].""; } +/*-- else { if(!$this->var['thread_lastuser']) +--*/ + elseif(!$this->var['thread_lastuser']) { //---- $tVars['LASTPOST'] = $tp->toHTML($this->var['thread_lastuser_anon']); //---- $tVars['LASTPOSTUSER'] = $tp->toHTML($this->var['thread_lastuser_anon']); $LASTPOST = $LASTPOSTUSER = e107::getParser()->toHTML($this->var['thread_lastuser_anon']); +/*-- } + else { //---- $tVars['LASTPOST'] = LAN_FORUM_1015; //---- $tVars['LASTPOSTUSER'] = LAN_FORUM_1015; -$LASTPOST = $LASTPOSTUSER = LAN_FORUM_1015; +//--$LASTPOST = $LASTPOSTUSER = LAN_FORUM_1015; } +--*/ } //---- $tVars['LASTPOST'] .= '
'.$lastpost_datestamp; $LASTPOST .= '
'.$this->gen->convert_date($this->var['thread_lastpost'], 'forum'); @@ -582,7 +649,7 @@ $LASTPOSTUSER = $this->var['lastpost_username']; //---- $tVars['LASTPOSTDATE'] .= "". $gen->computeLapse($thread_info['thread_lastpost'],time(), false, false, 'short').""; - return ($caller == 'sc_lastpostuser'?$LASTPOSTUSER:($caller == 'sc_lastpostdate'?"".$this->gen->computeLapse($thread_info['thread_lastpost'],time(), false, false, 'short')."":($caller == 'sc_lastpost'?$LASTPOST:''))); + return ($caller == 'sc_lastpostuser'?$LASTPOSTUSER:($caller == 'sc_lastpostdate'?"".$this->gen->computeLapse($this->var['thread_lastpost'],time(), false, false, 'short')."":($caller == 'sc_lastpost'?$LASTPOST:''))); } @@ -624,6 +691,7 @@ $LASTPOSTUSER = $this->var['lastpost_username']; // $newflag = (USER && $this->var['thread_lastpost'] > USERLV && !in_array($this->var['thread_id'], $threadsViewed)); $newflag = (USER && $this->var['thread_lastpost'] > USERLV && !in_array($this->var['thread_id'], $forum->threadGetUserViewed())); $ICON = ($newflag ? IMAGE_new : IMAGE_nonew); +//-- CANDIDATE FOR TERNARY IF if ($this->var['thread_total_replies'] >= $forum->prefs->get('popular', 10)) { $ICON = ($newflag ? IMAGE_new_popular : IMAGE_nonew_popular); @@ -633,6 +701,7 @@ $LASTPOSTUSER = $this->var['lastpost_username']; $ICON = IMAGE_noreplies; } +//-- CANDIDATE FOR TERNARY IF if ($this->var['thread_sticky'] == 1) { $ICON = ($this->var['thread_active'] ? IMAGE_sticky : IMAGE_stickyclosed); @@ -651,6 +720,7 @@ $LASTPOSTUSER = $this->var['lastpost_username']; function sc_threadtype() { +//-- CANDIDATE FOR TERNARY IF if ($this->var['thread_sticky'] == 1) { return '['.LAN_FORUM_1011.']
'; @@ -667,15 +737,18 @@ $LASTPOSTUSER = $this->var['lastpost_username']; { global $menu_pref, $forum; $tp = e107::getParser(); + $thread_name = strip_tags($tp->toHTML($this->var['thread_name'], false, 'no_hook, emotes_off')); if(isset($this->var['thread_options']['poll'])) { $thread_name = '['.LAN_FORUM_1016.'] ' . $thread_name; } + // if (strtoupper($THREADTYPE) == strtoupper(substr($thread_name, 0, strlen($THREADTYPE)))) // { // $thread_name = substr($thread_name, strlen($THREADTYPE)); // } + $title = ''; if ($forum->prefs->get('tooltip')) { $thread_thread = strip_tags($tp->toHTML($this->var['thread_thread'], true, 'no_hook')); @@ -688,10 +761,12 @@ $LASTPOSTUSER = $this->var['lastpost_username']; $thread_thread = str_replace("'", ''', $thread_thread); $title = "title='".$thread_thread."'"; } +/*-- else { $title = ''; } +--*/ // $tVars['THREADNAME'] = " $threadId, 'name' => $thread_name))."'>{$thread_name}"; // $url = e107::getUrl()->create('forum/thread/view', array('id' => $threadId, 'name' => $thread_name)); @@ -743,6 +818,7 @@ $LASTPOSTUSER = $this->var['lastpost_username']; function sc_adminoptions() { +/*-- if(!deftrue('BOOTSTRAP')) { return $this->sc_admin_icons; @@ -752,13 +828,16 @@ $LASTPOSTUSER = $this->var['lastpost_username']; return fadminoptions($this->var); } return ''; +--*/ + return (!deftrue('BOOTSTRAP')?$this->sc_admin_icons:((MODERATOR)?fadminoptions($this->var):'')); } function sc_poster() { +/*-- if ($this->var['user_name']) { - return " $thread_info['thread_user'], 'name' => $this->var['user_name']))."'>".$this->var['user_name'].""; + return " $this->var['thread_user'], 'name' => $this->var['user_name']))."'>".$this->var['user_name'].""; } // else // { @@ -769,6 +848,10 @@ $LASTPOSTUSER = $this->var['lastpost_username']; // else // { return LAN_FORUM_1015; +--*/ +// else +// { + return (($this->var['user_name'])?" $this->var['thread_user'], 'name' => $this->var['user_name']))."'>".$this->var['user_name']."":(($this->var['thread_user_anon'])?e107::getParser()->toHTML($this->var['thread_user_anon']):LAN_FORUM_1015)); // } // } }