From e00da41cda730ee8fe11c1332bcc62d815546722 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 31 May 2016 11:36:52 -0700 Subject: [PATCH 1/9] Hardcode copyright info. --- e107_themes/voux/install/install.xml | 1 - e107_themes/voux/theme.php | 11 ++++++++--- e107_themes/voux/theme.xml | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/e107_themes/voux/install/install.xml b/e107_themes/voux/install/install.xml index 33ae50fd3..99bbd5e84 100644 --- a/e107_themes/voux/install/install.xml +++ b/e107_themes/voux/install/install.xml @@ -7,7 +7,6 @@ )]]> 3 %d %b %Y - {e_THEME}voux/install/logo2B252832529.png diff --git a/e107_themes/voux/theme.php b/e107_themes/voux/theme.php index 35b4cb543..8257df97d 100644 --- a/e107_themes/voux/theme.php +++ b/e107_themes/voux/theme.php @@ -1,6 +1,10 @@
-
- {SITEDISCLAIMER} +
+ + e107 Theme based on "Voux" by ThemeXpose which is realeased under the terms of the GNU General Public license.
{BOOTSTRAP_USERNAV: placement=bottom&dir=up} diff --git a/e107_themes/voux/theme.xml b/e107_themes/voux/theme.xml index 4f18d8863..d5d65f311 100644 --- a/e107_themes/voux/theme.xml +++ b/e107_themes/voux/theme.xml @@ -1,8 +1,8 @@ - + Simple modern blog theme. - Based on the blogger theme by ThemeExpose + Ported from the blogger theme by ThemeExpose blog From 69f613514208f591a313a5676e8ce8dcb2fa4775 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 31 May 2016 12:24:46 -0700 Subject: [PATCH 2/9] Correct a typo --- e107_themes/voux/theme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e107_themes/voux/theme.php b/e107_themes/voux/theme.php index 8257df97d..47e7082a9 100644 --- a/e107_themes/voux/theme.php +++ b/e107_themes/voux/theme.php @@ -269,7 +269,7 @@ $LAYOUT['_footer_'] = '
- e107 Theme based on "Voux" by ThemeXpose which is realeased under the terms of the GNU General Public license. + e107 Theme based on "Voux" by ThemeXpose which is released under the terms of the GNU General Public license.
{BOOTSTRAP_USERNAV: placement=bottom&dir=up} From b9ab0fb109ebf70c6e498a0c3ff72ceb8d2a5c08 Mon Sep 17 00:00:00 2001 From: rica-carv Date: Tue, 31 May 2016 20:32:14 +0100 Subject: [PATCH 3/9] Add files via upload --- e107_plugins/forum/forum.php | 1629 ++++++++++++++++++---------------- 1 file changed, 842 insertions(+), 787 deletions(-) diff --git a/e107_plugins/forum/forum.php b/e107_plugins/forum/forum.php index d2280ceec..a6d2e4036 100644 --- a/e107_plugins/forum/forum.php +++ b/e107_plugins/forum/forum.php @@ -1,787 +1,842 @@ -isInstalled('forum')) -{ - // FIXME GLOBAL - get rid of all e_BASE|e_HTTP|Whatever/index.php - just point to SITEURL - e107::redirect(); - exit; -} -e107::lan('forum', "front", true); -// include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum.php'); // using English_front.php now - -if(!deftrue('BOOTSTRAP')) -{ - $bcDefs = array( - 'FORLAN_11' => 'LAN_FORUM_0039', - 'FORLAN_12' => 'LAN_FORUM_0040', - 'FORLAN_18' => 'LAN_FORUM_0041', - ); - - e107::getLanguage()->bcDefs($bcDefs); -} - - -require_once(e_PLUGIN.'forum/forum_class.php'); -$forum = new e107forum; - -if(e_AJAX_REQUEST) -{ - if(varset($_POST['action']) == 'track') - { - $forum->ajaxTrack(); - } - -} - -/* -if ($untrackId = varset($_REQUEST['untrack'])) -{ - $forum->track('del', USERID, $untrackId); - header('location:'.$e107->url->create('forum/thread/track', array(), 'full=1&encode=0')); - exit; -} -*/ - -if(isset($_GET['f'])) -{ - if(isset($_GET['id'])) - { - $id = (int)$_GET['id']; - } - - switch($_GET['f']) - { - case 'mfar': - $forum->forumMarkAsRead($id); - header('location:'.e_SELF); - exit; - break; - - case 'rules': - include_once(HEADERF); - - forum_rules('show'); - include_once(FOOTERF); - exit; - break; - - case 'track': - include_once(HEADERF); - - forum_track(); - include_once(FOOTERF); - exit; - break; - } -} -$fVars = new e_vars; -$gen = new convert; - -$fVars->FORUMTITLE = e107::pref('forum','title', LAN_PLUGIN_FORUM_NAME); -$fVars->THREADTITLE = LAN_FORUM_0002; -$fVars->REPLYTITLE = LAN_FORUM_0003; -$fVars->LASTPOSTITLE = LAN_FORUM_0004; -$fVars->INFOTITLE = LAN_FORUM_0009; -$fVars->LOGO = IMAGE_e; -$fVars->NEWTHREADTITLE = LAN_FORUM_0075; -$fVars->POSTEDTITLE = LAN_FORUM_0074; -$fVars->NEWIMAGE = IMAGE_new_small; -$fVars->TRACKTITLE = LAN_FORUM_0073; - -$rules_text = forum_rules('check'); - -$fVars->USERINFO = "".LAN_FORUM_0010." | ".LAN_FORUM_0011.""; -if(USER) -{ - $fVars->USERINFO .= " | ".LAN_FORUM_0012." | ".LAN_FORUM_0013." | ".LAN_FORUM_0014.""; - if($forum->prefs->get('attach') && (check_class($pref['upload_class']) || getperms('0'))) - { - $fVars->USERINFO .= " | ".LAN_FORUM_0015.""; - } -} -if(!empty($rules_text)) -{ - $fVars->USERINFO .= " | ".LAN_FORUM_0016.''; -} - - -// v2.x -------------------- -$uInfo = array(); -$uInfo[0] = "".LAN_FORUM_6013.''; - -if(!empty($rules_text)) -{ - $uInfo[1] = "".LAN_FORUM_0016.''; -} - -$trackPref = $forum->prefs->get('track'); -if(!empty($trackPref)) -{ - $uInfo[2] = "".LAN_FORUM_0030.""; -} -$fVars->USERINFOX = implode(" | ",$uInfo); -// ----------- - - - - -$total_topics = $sql->count("forum_thread", "(*)"); -$total_replies = $sql->count("forum_post", "(*)"); -$total_members = $sql->count("user"); -$newest_member = $sql->select("user", "*", "user_ban='0' ORDER BY user_join DESC LIMIT 0,1"); -list($nuser_id, $nuser_name) = $sql->fetch('num'); // FIXME $nuser_id & $user_name return empty even though print_a($newest_member); returns proper result. - -if(!defined('e_TRACKING_DISABLED')) -{ - $member_users = $sql->select("online", "*", "online_location REGEXP('forum.php') AND online_user_id!='0' "); - $guest_users = $sql->select("online", "*", "online_location REGEXP('forum.php') AND online_user_id='0' "); - $users = $member_users+$guest_users; - $fVars->USERLIST = LAN_FORUM_0036.": "; - global $listuserson; - $c = 0; - if(is_array($listuserson)) - { - foreach($listuserson as $uinfo => $pinfo) - { - list($oid, $oname) = explode(".", $uinfo, 2); - $c ++; - $fVars->USERLIST .= "$oname".($c == MEMBERS_ONLINE ? "." :", "); - } - } - $fVars->USERLIST .= "
".LAN_FORUM_0037." ".LAN_FORUM_0038; -} -$fVars->STATLINK = "".LAN_FORUM_0017."\n"; -$fVars->ICONKEY = " -\n - - - - - - -\n
".IMAGE_new_small."".LAN_FORUM_0039."".IMAGE_nonew_small."".LAN_FORUM_0040."".IMAGE_closed_small."".LAN_FORUM_0041."
\n"; - -if(!$srchIcon = $tp->toGlyph('fa-search')) -{ - $srchIcon = LAN_SEARCH; -} - -$fVars->SEARCH = " -
-
- - - - - - - -
- -
\n"; - -$fVars->PERMS = (USER == TRUE || ANON == TRUE ? LAN_FORUM_0043." - ".LAN_FORUM_0045." - ".LAN_FORUM_0047 : LAN_FORUM_0044." - ".LAN_FORUM_0046." - ".LAN_FORUM_0048); - -$fVars->INFO = ""; -if (USER == TRUE) -{ - $total_new_threads = $sql->count('forum_thread', '(*)', "WHERE thread_datestamp>'".USERLV."' "); - if (USERVIEWED != "") - { - $tmp = explode(".", USERVIEWED); // List of numbers, separated by single period - $total_read_threads = count($tmp); - } - else - { - $total_read_threads = 0; - } - - $fVars->INFO = LAN_FORUM_0018." ".USERNAME."
"; - $lastvisit_datestamp = $gen->convert_date(USERLV, 'long'); - $datestamp = $gen->convert_date(time(), "long"); - if (!$total_new_threads) - { - $fVars->INFO .= LAN_FORUM_0019." "; - } - elseif($total_new_threads == 1) - { - $fVars->INFO .= LAN_FORUM_0020; - } - else - { - $fVars->INFO .= LAN_FORUM_0021." ".$total_new_threads." ".LAN_FORUM_0022." "; - } - $fVars->INFO .= LAN_FORUM_0023; - if ($total_new_threads == $total_read_threads && $total_new_threads != 0 && $total_read_threads >= $total_new_threads) - { - $fVars->INFO .= LAN_FORUM_0029; - $allread = TRUE; - } - elseif($total_read_threads != 0) - { - $fVars->INFO .= " (".LAN_FORUM_0027." ".$total_read_threads." ".LAN_FORUM_0028.")"; - } - - $fVars->INFO .= "
- ".LAN_FORUM_0024." ".$lastvisit_datestamp."
- ".LAN_FORUM_0025." ".$datestamp; -} -else -{ - $fVars->INFO .= ''; - if (ANON == TRUE) - { - $fVars->INFO .= LAN_FORUM_0049.'
'.LAN_FORUM_0050." ".LAN_FORUM_0051." ".LAN_FORUM_0052; - } - elseif(USER == FALSE) - { - $fVars->INFO .= LAN_FORUM_0049.'
'.LAN_FORUM_0053." ".LAN_FORUM_0054." ".LAN_FORUM_0055; - } -} - -if (USER && vartrue($allread) != TRUE && $total_new_threads && $total_new_threads >= $total_read_threads) -{ - $fVars->INFO .= "
".LAN_FORUM_0057.''.(e_QUERY != 'new' ? ", ".LAN_FORUM_0058."" : ''); -} - -$trackPref = $forum->prefs->get('track'); -if (USER && vartrue($trackPref) && e_QUERY != 'track') -{ - $fVars->INFO .= "
".LAN_FORUM_0030.''; -} - -$fVars->FORUMINFO = -str_replace("[x]", ($total_topics+$total_replies), LAN_FORUM_0031)." ($total_topics ".($total_topics == 1 ? LAN_FORUM_0032 : LAN_FORUM_0033).", $total_replies ".($total_replies == 1 ? LAN_FORUM_0034 : LAN_FORUM_0035).") -".(!defined("e_TRACKING_DISABLED") ? "" : "
".$users." ".($users == 1 ? LAN_FORUM_0059 : LAN_FORUM_0060)." (".$member_users." ".($member_users == 1 ? LAN_FORUM_0061 : LAN_FORUM_0062).", ".$guest_users." ".($guest_users == 1 ? LAN_FORUM_0063 : LAN_FORUM_0064).")
".LAN_FORUM_0066." ".$total_members."
".LAN_FORUM_0065." ".$nuser_name.".\n"); // FIXME cannot find other references to e_TRACKING_DISABLED, use pref? - -// FIX - core template always override theme template -// Include core template -include(e_PLUGIN.'forum/templates/forum_template.php'); - -// Override with theme template -if (file_exists(THEME.'forum_template.php')) -{ - include_once(THEME.'forum_template.php'); -} -elseif(file_exists(THEME.'templates/forum/forum_template.php')) -{ - require_once(THEME.'templates/forum/forum_template.php'); -} - - - - -if(is_array($FORUM_TEMPLATE) && deftrue('BOOTSTRAP',false)) // new v2.x format. -{ - - if(varset($FORUM_TEMPLATE['main-start'])) // correction of previous v2.x setup. - { - $FORUM_TEMPLATE['main']['start'] = $FORUM_TEMPLATE['main-start']; - $FORUM_TEMPLATE['main']['parent'] = $FORUM_TEMPLATE['main-parent']; - $FORUM_TEMPLATE['main']['forum'] = $FORUM_TEMPLATE['main-forum']; - $FORUM_TEMPLATE['main']['end'] = $FORUM_TEMPLATE['main-end']; - } - - $FORUM_MAIN_START = $FORUM_TEMPLATE['main']['start']; - $FORUM_MAIN_PARENT = $FORUM_TEMPLATE['main']['parent']; - $FORUM_MAIN_FORUM = $FORUM_TEMPLATE['main']['forum']; - $FORUM_MAIN_END = $FORUM_TEMPLATE['main']['end']; - - $FORUM_NEWPOSTS_START = $FORUM_TEMPLATE['main']['start']; // $FORUM_TEMPLATE['new-start']; - $FORUM_NEWPOSTS_MAIN = $FORUM_TEMPLATE['main']['forum']; // $FORUM_TEMPLATE['new-main']; - $FORUM_NEWPOSTS_END = $FORUM_TEMPLATE['main']['end']; // $FORUM_TEMPLATE['new-end']; - - -} - - -require_once(HEADERF); - -$forumList = $forum->forumGetForumList(); -$newflag_list = $forum->forumGetUnreadForums(); - -if (!$forumList) -{ - $ns->tablerender(LAN_PLUGIN_FORUM_NAME, "
".LAN_FORUM_0067.'
', array('forum', '51')); - require_once(FOOTERF); - exit; -} - -$forum_string = ''; -$pVars = new e_vars; -$frm = e107::getForm(); - -foreach ($forumList['parents'] as $parent) -{ - $status = parse_parent($parent); - $pVars->PARENTSTATUS = $status; - - $pVars->PARENTID = $parent['forum_id']; -// $pVars->PARENTNAME = "".$parent['forum_name'].""; - $pVars->PARENTNAME = $parent['forum_name']; - $forum_string .= $tp->simpleParse($FORUM_MAIN_PARENT, $pVars); - if (!count($forumList['forums'][$parent['forum_id']])) - { - $text .= "".LAN_FORUM_0068.""; - } - else - { - //TODO: Rework the restricted string - foreach($forumList['forums'][$parent['forum_id']] as $f) - { - if ($f['forum_class'] == e_UC_ADMIN && ADMIN) - { - $forum_string .= parse_forum($f, LAN_FORUM_0005); - } - elseif($f['forum_class'] == e_UC_MEMBER && USER) - { - $forum_string .= parse_forum($f, LAN_FORUM_0006); - } - elseif($f['forum_class'] == e_UC_READONLY) - { - $forum_string .= parse_forum($f, LAN_FORUM_0007); - } - elseif($f['forum_class'] && check_class($f['forum_class'])) - { - $forum_string .= parse_forum($f, LAN_FORUM_0008); - } - elseif(!$f['forum_class']) - { - $forum_string .= parse_forum($f); - } - } - if (isset($FORUM_MAIN_PARENT_END)) - { - $forum_string .= $tp->simpleParse($FORUM_MAIN_PARENT_END, $pVars); - } - } -} - -function parse_parent($parent) -{ - if(!check_class($parent['forum_postclass'])) - { - $status = '('.LAN_FORUM_0056.')'; - } - return vartrue($status); -} - -function parse_forum($f, $restricted_string = '') -{ - global $FORUM_MAIN_FORUM, $gen, $forum, $newflag_list, $forumList; - $fVars = new e_vars; - $e107 = e107::getInstance(); - $tp = e107::getParser(); - - if(USER && is_array($newflag_list) && in_array($f['forum_id'], $newflag_list)) - { - $fVars->NEWFLAG = "".IMAGE_new.''; - } - elseif(empty($f['forum_replies']) && defined('IMAGE_noreplies')) - { - $fVars->NEWFLAG = IMAGE_noreplies; - } - else - { - $fVars->NEWFLAG = IMAGE_nonew; - } - - if(substr($f['forum_name'], 0, 1) == '*') - { - $f['forum_name'] = substr($f['forum_name'], 1); - } - $f['forum_name'] = $tp->toHTML($f['forum_name'], true, 'no_hook'); - $f['forum_description'] = $tp->toHTML($f['forum_description'], TRUE, "BODY"); - - - //$url= $e107->url->create('forum/forum/view', $f); - $url = e107::url('forum', 'forum', $f); - $fVars->FORUMNAME = "{$f['forum_name']}"; - $fVars->FORUMDESCRIPTION = $f['forum_description'].($restricted_string ? "
$restricted_string" : ""); - $fVars->THREADS = $f['forum_threads']; - $fVars->REPLIES = $f['forum_replies']; - $fVars->FORUMSUBFORUMS = ''; - - - - - - $badgeReplies = ($f['forum_replies']) ? "badge-info" : ""; - $badgeThreads = ($f['forum_threads']) ? "badge-info" : ""; - - $fVars->THREADSX = "".$f['forum_threads'].""; - $fVars->REPLIESX = "".$f['forum_replies'].""; - - - $subId = $f['forum_id']; - if(!empty($forumList['subs']) && is_array($forumList['subs'][$subId])) - { - list($lastpost_datestamp, $lastpost_thread) = explode('.', $f['forum_lastpost_info']); - $ret = parse_subs($forumList, $f['forum_id'], $lastpost_datestamp); - $fVars->FORUMSUBFORUMS = "
".LAN_FORUM_0069.": {$ret['text']}
"; - $fVars->THREADS += $ret['threads']; - $fVars->REPLIES += $ret['replies']; - if(isset($ret['lastpost_info'])) - { - $f['forum_lastpost_info'] = $ret['lastpost_info']; - $f['forum_lastpost_user'] = $ret['lastpost_user']; - $f['forum_lastpost_user_anon'] = $ret['lastpost_user_anon']; - $f['user_name'] = $ret['user_name']; - } - } - - if ($f['forum_lastpost_info']) - { - list($lastpost_datestamp, $lastpost_thread) = explode('.', $f['forum_lastpost_info']); - if ($f['user_name']) - { - - $lastpost_name = " $f['user_name'], 'id' => $f['forum_lastpost_user']))."'>{$f['user_name']}"; - } - else - { - $lastpost_name = $tp->toHTML($f['forum_lastpost_user_anon']); - } - - $lastpost = $forum->threadGetLastpost($lastpost_thread); //XXX TODO inefficient to have SQL query here. - - $fVars->LASTPOSTUSER = $lastpost_name; - // {forum_sef}/{thread_id}-{thread_sef} - - $urlData = array('forum_sef'=>$f['forum_sef'], 'thread_id'=>$lastpost['post_thread'],'thread_sef'=>$lastpost['thread_sef']); - $url = e107::url('forum', 'topic', $urlData)."?last=1#post-".$lastpost['post_id']; - $fVars->LASTPOSTDATE .= "". $gen->computeLapse($lastpost_datestamp, time(), false, false, 'short').""; - $lastpost_datestamp = $gen->convert_date($lastpost_datestamp, 'forum'); - $fVars->LASTPOST = $lastpost_datestamp.'
'.$lastpost_name." $lastpost_name, 'id' => $lastpost_thread))."'>".IMAGE_post2.''; - - } - else - { - $fVars->LASTPOSTUSER = ""; - $fVars->LASTPOSTDATE = "-"; - $fVars->LASTPOST = '-'; - } - - - return $tp->simpleParse($FORUM_MAIN_FORUM, $fVars); -} - - - -function parse_subs($forumList, $id ='', $lastpost_datestamp) -{ - - $tp = e107::getParser(); - $ret = array(); - - $subList = $forumList['subs'][$id]; - - $ret['text'] = ''; - $ret['threads'] = 0; - $ret['replies'] = 0; - - foreach($subList as $sub) - { - // print_a($sub); - - $ret['text'] .= ($ret['text'] ? ', ' : ''); - - $urlData = $sub; - $urlData['parent_sef'] = $forumList['all'][$sub['forum_sub']]['forum_sef']; // = array('parent_sef'=> - $suburl = e107::url('forum','forum', $urlData); - - $ret['text'] .= "".$tp->toHTML($sub['forum_name']).''; - $ret['threads'] += $sub['forum_threads']; - $ret['replies'] += $sub['forum_replies']; - $tmp = explode('.', $sub['forum_lastpost_info']); - - if($tmp[0] > $lastpost_datestamp) - { - $ret['lastpost_info'] = $sub['forum_lastpost_info']; - $ret['lastpost_user'] = $sub['forum_lastpost_user']; - $ret['lastpost_user_anon'] = $sub['forum_lastpost_user_anon']; - $ret['user_name'] = $sub['user_name']; - $lastpost_datestamp = $tmp[0]; - } - } - - - return $ret; -} - - - -if (e_QUERY == 'track') -{ - -} - - - -if (e_QUERY == 'new') -{ - $nVars = new e_vars; - $newThreadList = $forum->threadGetNew(10); - foreach($newThreadList as $thread) - { - $author_name = ($thread['user_name'] ? $thread['user_name'] : $thread['lastuser_anon']); - - $datestamp = $gen->convert_date($thread['thread_lastpost'], 'forum'); - if(!$thread['user_name']) - { - $nVars->STARTERTITLE = $author_name.'
'.$datestamp; - } - else - { - $nVars->STARTERTITLE = " $thread['thread_lastuser'], 'name' => $author_name))."'>{$author_name}
".$datestamp; - } - $nVars->NEWSPOSTNAME = "".$tp->toHTML($thread['thread_name'], TRUE, 'no_make_clickable, no_hook').''; - - $forum_newstring .= $tp->simpleParse($FORUM_NEWPOSTS_MAIN, $nVars); - } - - if (empty($newThreadList)) - { - $nVars->NEWSPOSTNAME = LAN_FORUM_0029; - $forum_newstring = $tp->simpleParse($FORUM_NEWPOSTS_MAIN, $nVars); - - } - $forum_new_start = $tp->simpleParse($FORUM_NEWPOSTS_START, $nVars); - $forum_new_end = $tp->simpleParse($FORUM_NEWPOSTS_END, $nVars); - - if ($forum->prefs->get('enclose')) - { - $ns->tablerender($forum->prefs->get('title'), $forum_new_start.$forum_newstring.$forum_new_end, array('forum', 'main2')); - } - else - { - echo $forum_new_start.$forum_newstring.$forum_new_end; - } -} - -$frm = e107::getForm(); - -$breadarray = array( - array('text'=> $forum->prefs->get('title'), 'url' => e107::url('forum','index') ) -); - -$fVars->FORUM_BREADCRUMB = $frm->breadcrumb($breadarray); - -$forum_main_start = $tp->simpleParse($FORUM_MAIN_START, $fVars); -$forum_main_end = $tp->simpleParse($FORUM_MAIN_END, $fVars); - -if ($forum->prefs->get('enclose')) -{ - $ns->tablerender($forum->prefs->get('title'), $forum_main_start.$forum_string.$forum_main_end, 'forum'); -} -else -{ - echo $forum_main_start.$forum_string.$forum_main_end; -} - - - - - - - - -require_once(FOOTERF); - -function forum_rules($action = 'check') -{ - if (ADMIN == true) - { - $type = 'forum_rules_admin'; - } - elseif(USER == true) - { - $type = 'forum_rules_member'; - } - else - { - $type = 'forum_rules_guest'; - } - $result = e107::getDb()->select('generic', 'gen_chardata', "gen_type = '$type' AND gen_intdata = 1"); - if ($action == 'check') { return $result; } - - if ($result) - { - $row = e107::getDb()->fetch(); - $rules_text = e107::getParser()->toHTML($row['gen_chardata'], true); - } - else - { - $rules_text = LAN_FORUM_0072; - } - - $text = ''; - - if(deftrue('BOOTSTRAP')) - { - $breadarray = array( - array('text'=> e107::pref('forum','title', LAN_PLUGIN_FORUM_NAME), 'url' => e107::url('forum','index') ), - array('text'=>LAN_FORUM_0016, 'url'=>null) - ); - - $text = e107::getForm()->breadcrumb($breadarray); - } - - $text .= "
".$rules_text."
"; - $text .= "
".e107::getForm()->pagination(e107::url('forum','index'), LAN_BACK)."
"; - - e107::getRender()->tablerender(LAN_FORUM_0016, $text, array('forum', 'forum_rules')); -} - - -function forum_track() -{ - global $forum; - - $trackPref = $forum->prefs->get('track'); - $trackEmailPref = $forum->prefs->get('trackemail',true); - - - if(empty($trackPref)) - { - echo "Disabled"; - return false; - } - - - $FORUM_TEMPLATE = null; - - include(e_PLUGIN.'forum/templates/forum_template.php'); - - // Override with theme template - if (file_exists(THEME.'forum_template.php')) - { - include(THEME.'forum_template.php'); - } - elseif(file_exists(THEME.'templates/forum/forum_template.php')) - { - require(THEME.'templates/forum/forum_template.php'); - } - - $IMAGE_nonew_small = IMAGE_nonew_small; - $IMAGE_new_small = IMAGE_new_small; - - if(is_array($FORUM_TEMPLATE) && deftrue('BOOTSTRAP',false)) // new v2.x format. - { - $FORUM_TRACK_START = $FORUM_TEMPLATE['track']['start']; // $FORUM_TEMPLATE['track-start']; - $FORUM_TRACK_MAIN = $FORUM_TEMPLATE['track']['item']; // $FORUM_TEMPLATE['track-main']; - $FORUM_TRACK_END = $FORUM_TEMPLATE['track']['end']; // $FORUM_TEMPLATE['track-end']; - - $IMAGE_nonew_small = IMAGE_nonew; - $IMAGE_new_small = IMAGE_new; - - } - - $sql = e107::getDb(); - $tp = e107::getParser(); - - $trackDiz = ($trackEmailPref) ? LAN_FORUM_3040 : LAN_FORUM_3041; - - - if($trackedThreadList = $forum->getTrackedThreadList(USERID, 'list')) - { - - $viewed = $forum->threadGetUserViewed(); - - $qry = "SELECT t.*,th.*, f.*,u.user_name FROM `#forum_track` AS t - LEFT JOIN `#forum_thread` AS th ON t.track_thread = th.thread_id - LEFT JOIN `#forum` AS f ON th.thread_forum_id = f.forum_id - LEFT JOIN `#user` AS u ON th.thread_lastuser = u.user_id - WHERE t.track_userid = ".USERID." ORDER BY th.thread_lastpost DESC"; - - $forum_trackstring = ''; - $data = array(); - if($sql->gen($qry)) - { - while($row = $sql->fetch()) - { - // e107::getDebug()->log($row); - $row['thread_sef'] = eHelper::title2sef($row['thread_name'],'dashl'); - - $data['NEWIMAGE'] = $IMAGE_nonew_small; - - if ($row['thread_datestamp'] > USERLV && !in_array($row['thread_id'], $viewed)) - { - $data['NEWIMAGE'] = $IMAGE_new_small; - } - - $data['LASTPOSTUSER'] = !empty($row['user_name']) ? " $row['user_name'], 'id' => $row['thread_lastuser']))."'>".$row['user_name']."" : LAN_ANONYMOUS; - $data['LASTPOSTDATE'] = $tp->toDate($row['thread_lastpost'],'relative'); - - $buttonId = "forum-track-button-".intval($row['thread_id']); - - $forumUrl = e107::url('forum','forum',$row); - $threadUrl = e107::url('forum','topic',$row, array('query'=>array('last'=>1))); // ('forum/thread/view', $row); // configs will be able to map thread_* vars to the url - $data['TRACKPOSTNAME'] = "". $row['forum_name']." / ".$tp->toHTML($row['thread_name'], false, 'TITLE').''; - // $data['UNTRACK'] = "".LAN_FORUM_0070.""; - - - $data['UNTRACK'] = "".IMAGE_track.""; - - $forum_trackstring .= $tp->simpleParse($FORUM_TRACK_MAIN, $data); - } - } - // print_a($FORUM_TRACK_START); - - - if(deftrue('BOOTSTRAP')) - { - $breadarray = array( - array('text'=> e107::pref('forum','title', LAN_PLUGIN_FORUM_NAME), 'url' => e107::url('forum','index') ), - array('text'=>LAN_FORUM_0030, 'url'=>null) - ); - - $data['FORUM_BREADCRUMB'] = e107::getForm()->breadcrumb($breadarray); - } - - - $forum_track_start = $tp->simpleParse($FORUM_TRACK_START, $data); - $forum_track_end = $tp->simpleParse($FORUM_TRACK_END, $data); - - // if ($forum->prefs->get('enclose')) - { - // $ns->tablerender($forum->prefs->get('title'), $forum_track_start.$forum_trackstring.$forum_track_end, array('forum', 'main1')); - } - // else - { - $tracktext = $forum_track_start.$forum_trackstring.$forum_track_end; - } - } - - - $text =''; - - - - $text .= $tracktext; - $text .= "
".e107::getForm()->pagination(e107::url('forum','index'), LAN_BACK)."
"; - - e107::getRender()->tablerender(LAN_FORUM_0030, $text, array('forum', 'forum_track')); - - -} - - -?> +isInstalled('forum')) +{ + // FIXME GLOBAL - get rid of all e_BASE|e_HTTP|Whatever/index.php - just point to SITEURL + e107::redirect(); + exit; +} +e107::lan('forum', "front", true); +// include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum.php'); // using English_front.php now + +if(!deftrue('BOOTSTRAP')) +{ + $bcDefs = array( + 'FORLAN_11' => 'LAN_FORUM_0039', + 'FORLAN_12' => 'LAN_FORUM_0040', + 'FORLAN_18' => 'LAN_FORUM_0041', + ); + + e107::getLanguage()->bcDefs($bcDefs); +} + + +require_once(e_PLUGIN.'forum/forum_class.php'); +$forum = new e107forum; + +if(e_AJAX_REQUEST) +{ + if(varset($_POST['action']) == 'track') + { + $forum->ajaxTrack(); + } + +} + +/* +if ($untrackId = varset($_REQUEST['untrack'])) +{ + $forum->track('del', USERID, $untrackId); + header('location:'.$e107->url->create('forum/thread/track', array(), 'full=1&encode=0')); + exit; +} +*/ + +if(isset($_GET['f'])) +{ + if(isset($_GET['id'])) + { + $id = (int)$_GET['id']; + } + + switch($_GET['f']) + { + case 'mfar': + $forum->forumMarkAsRead($id); + header('location:'.e_SELF); + exit; + break; + + case 'rules': + include_once(HEADERF); + + forum_rules('show'); + include_once(FOOTERF); + exit; + break; + + case 'track': + include_once(HEADERF); + + forum_track(); + include_once(FOOTERF); + exit; + break; + } +} + +//echo "


"; + $sc = e107::getScBatch('forum', true); +//echo "
"; +//var_dump ($sc); +// $sc->forum = $forum; +//var_dump ($sc); +//echo $tp->parseTemplate("====>{FORUMTITLE}<====", false, $sc); +//echo "
"; +//var_dump (is_object($sc)); +//var_dump (is_array($sc)); + +//--$fVars = new e_vars; +$gen = new convert; + +/*-- +// Gonne directly to shortcode file +$fVars->FORUMTITLE = e107::pref('forum','title', LAN_PLUGIN_FORUM_NAME); +// Gonne directly to template file +$fVars->THREADTITLE = LAN_FORUM_0002; +// Gonne directly to template file +$fVars->REPLYTITLE = LAN_FORUM_0003; +// Gonne directly to template file +$fVars->LASTPOSTITLE = LAN_FORUM_0004; +// Gonne directly to template file +$fVars->INFOTITLE = LAN_FORUM_0009; +// Gonne directly to shortcode file +$fVars->LOGO = IMAGE_e; +// Gonne directly to template file +$fVars->NEWTHREADTITLE = LAN_FORUM_0075; +// Gonne directly to template file +$fVars->POSTEDTITLE = LAN_FORUM_0074; +// Gonne directly to shortcode file +$fVars->NEWIMAGE = IMAGE_new_small; +// Gonne directly to template file +$fVars->TRACKTITLE = LAN_FORUM_0073; +--*/ +/*-- +// Gonne directly to shortcode file +$rules_text = forum_rules('check'); + +$fVars->USERINFO = "".LAN_FORUM_0010." | ".LAN_FORUM_0011.""; +if(USER) +{ + $fVars->USERINFO .= " | ".LAN_FORUM_0012." | ".LAN_FORUM_0013." | ".LAN_FORUM_0014.""; + if($forum->prefs->get('attach') && (check_class($pref['upload_class']) || getperms('0'))) + { + $fVars->USERINFO .= " | ".LAN_FORUM_0015.""; + } +} +if(!empty($rules_text)) +{ + $fVars->USERINFO .= " | ".LAN_FORUM_0016.''; +} + + +// v2.x -------------------- +$uInfo = array(); +$uInfo[0] = "".LAN_FORUM_6013.''; + +if(!empty($rules_text)) +{ + $uInfo[1] = "".LAN_FORUM_0016.''; +} + +$trackPref = $forum->prefs->get('track'); +if(!empty($trackPref)) +{ + $uInfo[2] = "".LAN_FORUM_0030.""; +} +$fVars->USERINFOX = implode(" | ",$uInfo); +// ----------- +--*/ + + +/*-- +// Gonne to foruminfo shortcode +$total_topics = $sql->count("forum_thread", "(*)"); +$total_replies = $sql->count("forum_post", "(*)"); +$total_members = $sql->count("user"); +$newest_member = $sql->select("user", "*", "user_ban='0' ORDER BY user_join DESC LIMIT 0,1"); +list($nuser_id, $nuser_name) = $sql->fetch('num'); // FIXME $nuser_id & $user_name return empty even though print_a($newest_member); returns proper result. + +if(!defined('e_TRACKING_DISABLED')) +{ + $member_users = $sql->select("online", "*", "online_location REGEXP('forum.php') AND online_user_id!='0' "); + $guest_users = $sql->select("online", "*", "online_location REGEXP('forum.php') AND online_user_id='0' "); + $users = $member_users+$guest_users; +// Gonne to shortcode file +/*-- + $fVars->USERLIST = LAN_FORUM_0036.": "; + global $listuserson; + $c = 0; + if(is_array($listuserson)) + { + foreach($listuserson as $uinfo => $pinfo) + { + list($oid, $oname) = explode(".", $uinfo, 2); + $c ++; + $fVars->USERLIST .= "$oname".($c == MEMBERS_ONLINE ? "." :", "); + } + } + $fVars->USERLIST .= "
".LAN_FORUM_0037." ".LAN_FORUM_0038; +} +--*/ +// Gonne directly to shortcode file +/*-- +$fVars->STATLINK = "".LAN_FORUM_0017."\n"; +$fVars->ICONKEY = " +\n + + + + + + +\n
".IMAGE_new_small."".LAN_FORUM_0039."".IMAGE_nonew_small."".LAN_FORUM_0040."".IMAGE_closed_small."".LAN_FORUM_0041."
\n"; + +if(!$srchIcon = $tp->toGlyph('fa-search')) +{ + $srchIcon = LAN_SEARCH; +} + +$fVars->SEARCH = " +
+
+ + + + + + + +
+ +
\n"; + +$fVars->PERMS = (USER == TRUE || ANON == TRUE ? LAN_FORUM_0043." - ".LAN_FORUM_0045." - ".LAN_FORUM_0047 : LAN_FORUM_0044." - ".LAN_FORUM_0046." - ".LAN_FORUM_0048); + +$fVars->INFO = ""; +if (USER == TRUE) +{ + $total_new_threads = $sql->count('forum_thread', '(*)', "WHERE thread_datestamp>'".USERLV."' "); + if (USERVIEWED != "") + { + $tmp = explode(".", USERVIEWED); // List of numbers, separated by single period + $total_read_threads = count($tmp); + } + else + { + $total_read_threads = 0; + } + + $fVars->INFO = LAN_FORUM_0018." ".USERNAME."
"; + $lastvisit_datestamp = $gen->convert_date(USERLV, 'long'); + $datestamp = $gen->convert_date(time(), "long"); + if (!$total_new_threads) + { + $fVars->INFO .= LAN_FORUM_0019." "; + } + elseif($total_new_threads == 1) + { + $fVars->INFO .= LAN_FORUM_0020; + } + else + { + $fVars->INFO .= LAN_FORUM_0021." ".$total_new_threads." ".LAN_FORUM_0022." "; + } + $fVars->INFO .= LAN_FORUM_0023; + if ($total_new_threads == $total_read_threads && $total_new_threads != 0 && $total_read_threads >= $total_new_threads) + { + $fVars->INFO .= LAN_FORUM_0029; + $allread = TRUE; + } + elseif($total_read_threads != 0) + { + $fVars->INFO .= " (".LAN_FORUM_0027." ".$total_read_threads." ".LAN_FORUM_0028.")"; + } + + $fVars->INFO .= "
+ ".LAN_FORUM_0024." ".$lastvisit_datestamp."
+ ".LAN_FORUM_0025." ".$datestamp; +} +else +{ + $fVars->INFO .= ''; + if (ANON == TRUE) + { + $fVars->INFO .= LAN_FORUM_0049.'
'.LAN_FORUM_0050." ".LAN_FORUM_0051." ".LAN_FORUM_0052; + } + elseif(USER == FALSE) + { + $fVars->INFO .= LAN_FORUM_0049.'
'.LAN_FORUM_0053." ".LAN_FORUM_0054." ".LAN_FORUM_0055; + } +} + +if (USER && vartrue($allread) != TRUE && $total_new_threads && $total_new_threads >= $total_read_threads) +{ + $fVars->INFO .= "
".LAN_FORUM_0057.''.(e_QUERY != 'new' ? ", ".LAN_FORUM_0058."" : ''); +} + +$trackPref = $forum->prefs->get('track'); +if (USER && vartrue($trackPref) && e_QUERY != 'track') +{ + $fVars->INFO .= "
".LAN_FORUM_0030.''; +} + +$fVars->FORUMINFO = +str_replace("[x]", ($total_topics+$total_replies), LAN_FORUM_0031)." ($total_topics ".($total_topics == 1 ? LAN_FORUM_0032 : LAN_FORUM_0033).", $total_replies ".($total_replies == 1 ? LAN_FORUM_0034 : LAN_FORUM_0035).") +".(!defined("e_TRACKING_DISABLED") ? "" : "
".$users." ".($users == 1 ? LAN_FORUM_0059 : LAN_FORUM_0060)." (".$member_users." ".($member_users == 1 ? LAN_FORUM_0061 : LAN_FORUM_0062).", ".$guest_users." ".($guest_users == 1 ? LAN_FORUM_0063 : LAN_FORUM_0064).")
".LAN_FORUM_0066." ".$total_members."
".LAN_FORUM_0065." ".$nuser_name.".\n"); // FIXME cannot find other references to e_TRACKING_DISABLED, use pref? +--*/ + +// FIX - core template always override theme template +// Include core template +include(e_PLUGIN.'forum/templates/forum_template.php'); + +// Override with theme template +if (file_exists(THEME.'forum_template.php')) +{ + include_once(THEME.'forum_template.php'); +} +elseif(file_exists(THEME.'templates/forum/forum_template.php')) +{ + require_once(THEME.'templates/forum/forum_template.php'); +} + +if(is_array($FORUM_TEMPLATE) && deftrue('BOOTSTRAP',false)) // new v2.x format. +{ + + if(varset($FORUM_TEMPLATE['main-start'])) // correction of previous v2.x setup. + { + $FORUM_TEMPLATE['main']['start'] = $FORUM_TEMPLATE['main-start']; + $FORUM_TEMPLATE['main']['parent'] = $FORUM_TEMPLATE['main-parent']; + $FORUM_TEMPLATE['main']['forum'] = $FORUM_TEMPLATE['main-forum']; + $FORUM_TEMPLATE['main']['end'] = $FORUM_TEMPLATE['main-end']; + } + + $FORUM_MAIN_START = $FORUM_TEMPLATE['main']['start']; + $FORUM_MAIN_PARENT = $FORUM_TEMPLATE['main']['parent']; + $FORUM_MAIN_FORUM = $FORUM_TEMPLATE['main']['forum']; + $FORUM_MAIN_END = $FORUM_TEMPLATE['main']['end']; + + $FORUM_NEWPOSTS_START = $FORUM_TEMPLATE['main']['start']; // $FORUM_TEMPLATE['new-start']; + $FORUM_NEWPOSTS_MAIN = $FORUM_TEMPLATE['main']['forum']; // $FORUM_TEMPLATE['new-main']; + $FORUM_NEWPOSTS_END = $FORUM_TEMPLATE['main']['end']; // $FORUM_TEMPLATE['new-end']; +} + +require_once(HEADERF); + +$forumList = $forum->forumGetForumList(); +$newflag_list = $forum->forumGetUnreadForums(); + +if (!$forumList) +{ + $ns->tablerender(LAN_PLUGIN_FORUM_NAME, "
".LAN_FORUM_0067.'
', array('forum', '51')); + require_once(FOOTERF); + exit; +} + +$forum_string = ''; +//--$pVars = new e_vars; +//--$frm = e107::getForm(); +foreach ($forumList['parents'] as $parent) +{ +// Gonne directly to shortcode file +//-- $status = parse_parent($parent); +//-- $pVars->PARENTSTATUS = $status; +//---- $sc->parentstatus = parse_parent($parent); + +// Gonne directly to shortcode file +// $pVars->PARENTNAME = "".$parent['forum_name'].""; +// $pVars->PARENTNAME = $parent['forum_name']; +//---- $sc->parentname = $parent['forum_name']; +//-- $forum_string .= $tp->simpleParse($FORUM_MAIN_PARENT, $pVars); +// $sc->fparent = $parent; + $sc->setVars($parent); + $forum_string .= $tp->parseTemplate($FORUM_MAIN_PARENT, false, $sc); + if (!count($forumList['forums'][$parent['forum_id']])) + { + $text .= "".LAN_FORUM_0068.""; + } + else + { + //TODO: Rework the restricted string + foreach($forumList['forums'][$parent['forum_id']] as $f) + { + if ($f['forum_class'] == e_UC_ADMIN && ADMIN) + { + $forum_string .= parse_forum($f, LAN_FORUM_0005); + } + elseif($f['forum_class'] == e_UC_MEMBER && USER) + { + $forum_string .= parse_forum($f, LAN_FORUM_0006); + } + elseif($f['forum_class'] == e_UC_READONLY) + { + $forum_string .= parse_forum($f, LAN_FORUM_0007); + } + elseif($f['forum_class'] && check_class($f['forum_class'])) + { + $forum_string .= parse_forum($f, LAN_FORUM_0008); + } + elseif(!$f['forum_class']) + { + $forum_string .= parse_forum($f); + } + } + if (isset($FORUM_MAIN_PARENT_END)) + { +//-- $forum_string .= $tp->simpleParse($FORUM_MAIN_PARENT_END, $pVars); + $forum_string .= $tp->parseTemplate($FORUM_MAIN_PARENT_END, false, $sc); + } + } +} + +/*---- +function parse_parent($parent) +{ + if(!check_class($parent['forum_postclass'])) + { + $status = '('.LAN_FORUM_0056.')'; + } + return vartrue($status); +} +*/ +function parse_forum($f, $restricted_string = '') +{ +//---- global $FORUM_MAIN_FORUM, $gen, $forum, $newflag_list, $forumList, $sc; + global $FORUM_MAIN_FORUM, $forumList, $sc; +//-- $fVars = new e_vars; +//---- $e107 = e107::getInstance(); + $tp = e107::getParser(); + +// Gonne directly to shortcode file +/*-- + if(USER && is_array($newflag_list) && in_array($f['forum_id'], $newflag_list)) + { + + $fVars->NEWFLAG = "".IMAGE_new.''; + } + elseif(empty($f['forum_replies']) && defined('IMAGE_noreplies')) + { + $fVars->NEWFLAG = IMAGE_noreplies; + } + else + { + $fVars->NEWFLAG = IMAGE_nonew; + } +--*/ + +// Gonne directly to shortcode file +/*-- + if(substr($f['forum_name'], 0, 1) == '*') + { + $f['forum_name'] = substr($f['forum_name'], 1); + } + $f['forum_name'] = $tp->toHTML($f['forum_name'], true, 'no_hook'); + $f['forum_description'] = $tp->toHTML($f['forum_description'], true, 'no_hook'); + + + //$url= $e107->url->create('forum/forum/view', $f); + $url = e107::url('forum', 'forum', $f); + $fVars->FORUMNAME = "{$f['forum_name']}"; + $fVars->FORUMDESCRIPTION = $f['forum_description'].($restricted_string ? "
$restricted_string" : ""); +--*/ +//-- $fVars->THREADS = $f['forum_threads']; +//---- $sc->threads = $f['forum_threads']; +//-- $fVars->REPLIES = $f['forum_replies']; +//---- $sc->replies = $f['forum_replies']; +//-- $fVars->FORUMSUBFORUMS = ''; + +//-- $badgeReplies = ($f['forum_replies']) ? "badge-info" : ""; +//-- $badgeThreads = ($f['forum_threads']) ? "badge-info" : ""; + +//-- $fVars->THREADSX = "".$f['forum_threads'].""; +//-- $fVars->REPLIESX = "".$f['forum_replies'].""; + + +//---- $subId = $f['forum_id']; +//---- if(!empty($forumList['subs']) && is_array($forumList['subs'][$subId])) + if(!empty($forumList['subs']) && is_array($forumList['subs'][$f['forum_id']])) + { +//---- list($lastpost_datestamp, $lastpost_thread) = explode('.', $f['forum_lastpost_info']); + $lastpost_datestamp = reset(explode('.', $f['forum_lastpost_info'])); + $ret = parse_subs($forumList, $f['forum_id'], $lastpost_datestamp); +// $fVars->FORUMSUBFORUMS = "
".LAN_FORUM_0069.": {$ret['text']}
"; +//-- $fVars->THREADS += $ret['threads']; +//-- $fVars->REPLIES += $ret['replies']; + $f['forum_threads'] += $ret['threads']; + $f['forum_replies'] += $ret['replies']; + if(isset($ret['lastpost_info'])) + { + $f['forum_lastpost_info'] = $ret['lastpost_info']; + $f['forum_lastpost_user'] = $ret['lastpost_user']; + $f['forum_lastpost_user_anon'] = $ret['lastpost_user_anon']; + $f['user_name'] = $ret['user_name']; + } + $f['text'] = $ret['text']; + } + + $sc->setVars($f); +/*-- + if ($f['forum_lastpost_info']) + { + list($lastpost_datestamp, $lastpost_thread) = explode('.', $f['forum_lastpost_info']); + if ($f['user_name']) + { + + $lastpost_name = " $f['user_name'], 'id' => $f['forum_lastpost_user']))."'>{$f['user_name']}"; + } + else + { + $lastpost_name = $tp->toHTML($f['forum_lastpost_user_anon']); + } + + $lastpost = $forum->threadGetLastpost($lastpost_thread); //XXX TODO inefficient to have SQL query here. + + $fVars->LASTPOSTUSER = $lastpost_name; + // {forum_sef}/{thread_id}-{thread_sef} + + $urlData = array('forum_sef'=>$f['forum_sef'], 'thread_id'=>$lastpost['post_thread'],'thread_sef'=>$lastpost['thread_sef']); + $url = e107::url('forum', 'topic', $urlData)."?last=1#post-".$lastpost['post_id']; + $fVars->LASTPOSTDATE .= "". $gen->computeLapse($lastpost_datestamp, time(), false, false, 'short').""; + $lastpost_datestamp = $gen->convert_date($lastpost_datestamp, 'forum'); + $fVars->LASTPOST = $lastpost_datestamp.'
'.$lastpost_name." $lastpost_name, 'id' => $lastpost_thread))."'>".IMAGE_post2.''; + + } + else + { + $fVars->LASTPOSTUSER = ""; + $fVars->LASTPOSTDATE = "-"; + $fVars->LASTPOST = '-'; + } +--*/ + +//-- return $tp->simpleParse($FORUM_MAIN_FORUM, $fVars); + return $tp->parseTemplate($FORUM_MAIN_FORUM, false, $sc); +} + + + +function parse_subs($forumList, $id ='', $lastpost_datestamp) +{ + + $tp = e107::getParser(); + $ret = array(); + + $subList = $forumList['subs'][$id]; + + $ret['text'] = ''; + $ret['threads'] = 0; + $ret['replies'] = 0; + + foreach($subList as $sub) + { + // print_a($sub); + + $ret['text'] .= ($ret['text'] ? ', ' : ''); + + $urlData = $sub; + $urlData['parent_sef'] = $forumList['all'][$sub['forum_sub']]['forum_sef']; // = array('parent_sef'=> + $suburl = e107::url('forum','forum', $urlData); + + $ret['text'] .= "".$tp->toHTML($sub['forum_name']).''; + $ret['threads'] += $sub['forum_threads']; + $ret['replies'] += $sub['forum_replies']; + $tmp = explode('.', $sub['forum_lastpost_info']); + + if($tmp[0] > $lastpost_datestamp) + { + $ret['lastpost_info'] = $sub['forum_lastpost_info']; + $ret['lastpost_user'] = $sub['forum_lastpost_user']; + $ret['lastpost_user_anon'] = $sub['forum_lastpost_user_anon']; + $ret['user_name'] = $sub['user_name']; + $lastpost_datestamp = $tmp[0]; + } + } + + + return $ret; +} + +if (e_QUERY == 'track') +{ + +} + +if (e_QUERY == 'new') +{ +//-- $nVars = new e_vars; + $newThreadList = $forum->threadGetNew(10); + foreach($newThreadList as $thread) + { +//-- $author_name = ($thread['user_name'] ? $thread['user_name'] : $thread['lastuser_anon']); +//---- $sc->author_name = ($thread['user_name'] ? $thread['user_name'] : $thread['lastuser_anon']); + +//-- $datestamp = $gen->convert_date($thread['thread_lastpost'], 'forum'); +//---- $sc->datestamp = $gen->convert_date($thread['thread_lastpost'], 'forum'); +/*-- + if(!$thread['user_name']) + { + $nVars->STARTERTITLE = $author_name.'
'.$datestamp; + } + else + { + $nVars->STARTERTITLE = " $thread['thread_lastuser'], 'name' => $author_name))."'>{$author_name}
".$datestamp; + } + + $nVars->NEWSPOSTNAME = "".$tp->toHTML($thread['thread_name'], TRUE, 'no_make_clickable, no_hook').''; +--*/ + +//-- $forum_newstring .= $tp->simpleParse($FORUM_NEWPOSTS_MAIN, $nVars); + $sc->setVars($thread); + $forum_newstring .= $tp->parseTemplate($FORUM_NEWPOSTS_MAIN, false, $sc); + } + + if (empty($newThreadList)) + { +//-- $nVars->NEWSPOSTNAME = LAN_FORUM_0029; +//-- $forum_newstring = $tp->simpleParse($FORUM_NEWPOSTS_MAIN, $nVars); + $forum_newstring = $tp->parseTemplate($FORUM_NEWPOSTS_MAIN, false, $sc); + + } +//-- $forum_new_start = $tp->simpleParse($FORUM_NEWPOSTS_START, $nVars); +//-- $forum_new_end = $tp->simpleParse($FORUM_NEWPOSTS_END, $nVars); + $forum_new_start = $tp->parseTemplate($FORUM_NEWPOSTS_START, false, $sc); + $forum_new_end = $tp->parseTemplate($FORUM_NEWPOSTS_END, false, $sc); + + if ($forum->prefs->get('enclose')) + { + $ns->tablerender($forum->prefs->get('title'), $forum_new_start.$forum_newstring.$forum_new_end, array('forum', 'main2')); + } + else + { + echo $forum_new_start.$forum_newstring.$forum_new_end; + } +} + +//$frm = e107::getForm(); + +$breadarray = array( + array('text'=> $forum->prefs->get('title'), 'url' => e107::url('forum','index') ) +); + +//-- $fVars->FORUM_BREADCRUMB = $frm->breadcrumb($breadarray); + +//-- $forum_main_start = $tp->simpleParse($FORUM_MAIN_START, $fVars); +$forum_main_start = $tp->parseTemplate($FORUM_MAIN_START, false, $sc); +//-- $forum_main_end = $tp->simpleParse($FORUM_MAIN_END, $fVars); +$forum_main_end = $tp->parseTemplate($FORUM_MAIN_END, false, $sc); + +if ($forum->prefs->get('enclose')) +{ + $ns->tablerender($forum->prefs->get('title'), $forum_main_start.$forum_string.$forum_main_end, 'forum'); +} +else +{ + echo $forum_main_start.$forum_string.$forum_main_end; +} + + + + + + + + +require_once(FOOTERF); + +function forum_rules($action = 'check') +{ + if (ADMIN == true) + { + $type = 'forum_rules_admin'; + } + elseif(USER == true) + { + $type = 'forum_rules_member'; + } + else + { + $type = 'forum_rules_guest'; + } + $result = e107::getDb()->select('generic', 'gen_chardata', "gen_type = '$type' AND gen_intdata = 1"); + if ($action == 'check') { return $result; } + + if ($result) + { + $row = e107::getDb()->fetch(); + $rules_text = e107::getParser()->toHTML($row['gen_chardata'], true); + } + else + { + $rules_text = LAN_FORUM_0072; + } + + $text = ''; + + if(deftrue('BOOTSTRAP')) + { + $breadarray = array( + array('text'=> e107::pref('forum','title', LAN_PLUGIN_FORUM_NAME), 'url' => e107::url('forum','index') ), + array('text'=>LAN_FORUM_0016, 'url'=>null) + ); + + $text = e107::getForm()->breadcrumb($breadarray); + } + + $text .= "
".$rules_text."
"; + $text .= "
".e107::getForm()->pagination(e107::url('forum','index'), LAN_BACK)."
"; + + e107::getRender()->tablerender(LAN_FORUM_0016, $text, array('forum', 'forum_rules')); +} + + +function forum_track() +{ + global $forum; + + $trackPref = $forum->prefs->get('track'); + $trackEmailPref = $forum->prefs->get('trackemail',true); + + + if(empty($trackPref)) + { + echo "Disabled"; + return false; + } + + + $FORUM_TEMPLATE = null; + + include(e_PLUGIN.'forum/templates/forum_template.php'); + + // Override with theme template + if (file_exists(THEME.'forum_template.php')) + { + include(THEME.'forum_template.php'); + } + elseif(file_exists(THEME.'templates/forum/forum_template.php')) + { + require(THEME.'templates/forum/forum_template.php'); + } + + $IMAGE_nonew_small = IMAGE_nonew_small; + $IMAGE_new_small = IMAGE_new_small; + + if(is_array($FORUM_TEMPLATE) && deftrue('BOOTSTRAP',false)) // new v2.x format. + { + $FORUM_TRACK_START = $FORUM_TEMPLATE['track']['start']; // $FORUM_TEMPLATE['track-start']; + $FORUM_TRACK_MAIN = $FORUM_TEMPLATE['track']['item']; // $FORUM_TEMPLATE['track-main']; + $FORUM_TRACK_END = $FORUM_TEMPLATE['track']['end']; // $FORUM_TEMPLATE['track-end']; + + $IMAGE_nonew_small = IMAGE_nonew; + $IMAGE_new_small = IMAGE_new; + + } + + $sql = e107::getDb(); + $tp = e107::getParser(); + + $trackDiz = ($trackEmailPref) ? LAN_FORUM_3040 : LAN_FORUM_3041; + + + if($trackedThreadList = $forum->getTrackedThreadList(USERID, 'list')) + { + + $viewed = $forum->threadGetUserViewed(); + + $qry = "SELECT t.*,th.*, f.*,u.user_name FROM `#forum_track` AS t + LEFT JOIN `#forum_thread` AS th ON t.track_thread = th.thread_id + LEFT JOIN `#forum` AS f ON th.thread_forum_id = f.forum_id + LEFT JOIN `#user` AS u ON th.thread_lastuser = u.user_id + WHERE t.track_userid = ".USERID." ORDER BY th.thread_lastpost DESC"; + + $forum_trackstring = ''; + $data = array(); + if($sql->gen($qry)) + { + while($row = $sql->fetch()) + { + // e107::getDebug()->log($row); + $row['thread_sef'] = eHelper::title2sef($row['thread_name'],'dashl'); + + $data['NEWIMAGE'] = $IMAGE_nonew_small; + + if ($row['thread_datestamp'] > USERLV && !in_array($row['thread_id'], $viewed)) + { + $data['NEWIMAGE'] = $IMAGE_new_small; + } + + $data['LASTPOSTUSER'] = !empty($row['user_name']) ? " $row['user_name'], 'id' => $row['thread_lastuser']))."'>".$row['user_name']."" : LAN_ANONYMOUS; + $data['LASTPOSTDATE'] = $tp->toDate($row['thread_lastpost'],'relative'); + + $buttonId = "forum-track-button-".intval($row['thread_id']); + + $forumUrl = e107::url('forum','forum',$row); + $threadUrl = e107::url('forum','topic',$row, array('query'=>array('last'=>1))); // ('forum/thread/view', $row); // configs will be able to map thread_* vars to the url + $data['TRACKPOSTNAME'] = "". $row['forum_name']." / ".$tp->toHTML($row['thread_name'], false, 'TITLE').''; + // $data['UNTRACK'] = "".LAN_FORUM_0070.""; + + + $data['UNTRACK'] = "".IMAGE_track.""; + + $forum_trackstring .= $tp->simpleParse($FORUM_TRACK_MAIN, $data); + } + } + // print_a($FORUM_TRACK_START); + + + if(deftrue('BOOTSTRAP')) + { + $breadarray = array( + array('text'=> e107::pref('forum','title', LAN_PLUGIN_FORUM_NAME), 'url' => e107::url('forum','index') ), + array('text'=>LAN_FORUM_0030, 'url'=>null) + ); + + $data['FORUM_BREADCRUMB'] = e107::getForm()->breadcrumb($breadarray); + } + + + $forum_track_start = $tp->simpleParse($FORUM_TRACK_START, $data); + $forum_track_end = $tp->simpleParse($FORUM_TRACK_END, $data); + + // if ($forum->prefs->get('enclose')) + { + // $ns->tablerender($forum->prefs->get('title'), $forum_track_start.$forum_trackstring.$forum_track_end, array('forum', 'main1')); + } + // else + { + $tracktext = $forum_track_start.$forum_trackstring.$forum_track_end; + } + } + + + $text =''; + + + + $text .= $tracktext; + $text .= "
".e107::getForm()->pagination(e107::url('forum','index'), LAN_BACK)."
"; + + e107::getRender()->tablerender(LAN_FORUM_0030, $text, array('forum', 'forum_track')); + + +} + + +?> From d4297af1bec4f5805bbb9a8d410a1df87b76fa4c Mon Sep 17 00:00:00 2001 From: rica-carv Date: Tue, 31 May 2016 20:32:56 +0100 Subject: [PATCH 4/9] Add files via upload --- .../shortcodes/batch/forum_shortcodes.php | 575 ++++++++++++++++++ 1 file changed, 575 insertions(+) create mode 100644 e107_plugins/forum/shortcodes/batch/forum_shortcodes.php diff --git a/e107_plugins/forum/shortcodes/batch/forum_shortcodes.php b/e107_plugins/forum/shortcodes/batch/forum_shortcodes.php new file mode 100644 index 000000000..95cafa915 --- /dev/null +++ b/e107_plugins/forum/shortcodes/batch/forum_shortcodes.php @@ -0,0 +1,575 @@ +forum_rules = forum_rules('check'); + } + +// START OF $FVARS + function sc_forumtitle() + { + return e107::pref('forum','title', LAN_PLUGIN_FORUM_NAME); + } + +// LEGACY shortcodes, to be deprecated & directly handled in template file??? + function sc_threadtitle() + { + return LAN_FORUM_0002; + } + function sc_replytitle() + { + return LAN_FORUM_0003; + } + function sc_lastpostitle() + { + return LAN_FORUM_0004; + } + function sc_infotitle() + { + return LAN_FORUM_0009; + } + function sc_newthreadtitle() + { + return LAN_FORUM_0075; + } + function sc_postedtitle() + { + return LAN_FORUM_0074; + } + function sc_tracktitle() + { + return LAN_FORUM_0073; + } + function sc_statlink() + { + return "".LAN_FORUM_0017."\n"; + } + function sc_iconkey() + { + return " +\n + + + + + + +\n
".IMAGE_new_small."".LAN_FORUM_0039."".IMAGE_nonew_small."".LAN_FORUM_0040."".IMAGE_closed_small."".LAN_FORUM_0041."
\n"; + } +// End of LEGACY shortcodes... + + function sc_logo() + { + return IMAGE_e; + } + function sc_newimage() + { + return IMAGE_new_small; + } + + function sc_userinfo() + { +//---- Pass globals via $sc????? + global $forum, $pref; + +$text = "".LAN_FORUM_0010." | ".LAN_FORUM_0011.""; +if(USER) +{ + $text .= " | ".LAN_FORUM_0012." | ".LAN_FORUM_0013." | ".LAN_FORUM_0014.""; +// To be reworked to get the $forum var + if($forum->prefs->get('attach') && (check_class($pref['upload_class']) || getperms('0'))) + { + $text .= " | ".LAN_FORUM_0015.""; + } +} +if(!empty($this->forum_rules)) +{ + $text .= " | ".LAN_FORUM_0016.''; +} + return $text; + } + + + function sc_userinfox() + { + global $forum; + + $uInfo = array(); +$uInfo[0] = "".LAN_FORUM_6013.''; + + if(!empty($this->forum_rules)) +{ + $uInfo[1] = "".LAN_FORUM_0016.''; +} + +// To be reworked to get the $forum var +$trackPref = $forum->prefs->get('track'); +if(!empty($trackPref)) +{ + $uInfo[2] = "".LAN_FORUM_0030.""; +} + return implode(" | ",$uInfo); + } + + function sc_userlist() + { + if(!defined('e_TRACKING_DISABLED')) +{ +// String candidate for USERLIST wrapper + $text = LAN_FORUM_0036.": "; + + global $listuserson; + $c = 0; + if(is_array($listuserson)) + { +//---- foreach($listuserson as $uinfo => $pinfo) + foreach(array_keys($listuserson) as $uinfo) +// foreach($listuserson as $uinfo => &$pinfo) + { + list($oid, $oname) = explode(".", $uinfo, 2); + $c ++; + $text .= "$oname".($c == MEMBERS_ONLINE ? "." :", "); + } + } +// String candidate for USERLIST wrapper + $text .= "
".LAN_FORUM_0037." ".LAN_FORUM_0038; +} + return $text; + } + + function sc_search() + { +// $tp = e107::getParser(); + if(!$srchIcon = e107::getParser()->toGlyph('fa-search')) +{ + $srchIcon = LAN_SEARCH; +} + +// String candidate for USERLIST wrapper +return " +
+
+ + + + + + + +
+ +
\n"; +} + + function sc_perms() + { +return (USER == TRUE || ANON == TRUE ? LAN_FORUM_0043." - ".LAN_FORUM_0045." - ".LAN_FORUM_0047 : LAN_FORUM_0044." - ".LAN_FORUM_0046." - ".LAN_FORUM_0048); + } + + function sc_info() + { +//$fVars->INFO = ""; +// global $forum; +//$sql = e107::getDb(); +//$gen = new convert; + if (ANON == TRUE) + { + $text = LAN_FORUM_0049.'
'.LAN_FORUM_0050." ".LAN_FORUM_0051." ".LAN_FORUM_0052; + } + elseif(USER == FALSE) + { + $text = LAN_FORUM_0049.'
'.LAN_FORUM_0053." ".LAN_FORUM_0054." ".LAN_FORUM_0055; + } + +if (USER == TRUE) +{ + $total_new_threads = e107::getDb()->count('forum_thread', '(*)', "WHERE thread_datestamp>'".USERLV."' "); + $total_read_threads = 0; + if (USERVIEWED != "") + { + $tmp = explode(".", USERVIEWED); // List of numbers, separated by single period + $total_read_threads = count($tmp); + } +/* + else + { + $total_read_threads = 0; + } +*/ + +$gen = new convert; + $text = LAN_FORUM_0018." ".USERNAME."
"; + $lastvisit_datestamp = $gen->convert_date(USERLV, 'long'); + $datestamp = $gen->convert_date(time(), "long"); + +/* + if (!$total_new_threads) + { + $text .= LAN_FORUM_0019." "; + } + elseif($total_new_threads == 1) + { + $text .= LAN_FORUM_0020; + } + else + { + $text .= LAN_FORUM_0021." ".$total_new_threads." ".LAN_FORUM_0022." "; + } +*/ + $text .= (!$total_new_threads?LAN_FORUM_0019." ":($total_new_threads == 1?LAN_FORUM_0020:LAN_FORUM_0021." ".$total_new_threads." ".LAN_FORUM_0022." ")).LAN_FORUM_0023; +// $text .= LAN_FORUM_0023; +// if ($total_new_threads == $total_read_threads && $total_new_threads != 0 && $total_read_threads >= $total_new_threads) + if ($total_new_threads != 0 && $total_read_threads >= $total_new_threads) + { + $text .= LAN_FORUM_0029; + $allread = TRUE; + } + elseif($total_read_threads != 0) + { + $text .= " (".LAN_FORUM_0027." ".$total_read_threads." ".LAN_FORUM_0028.")"; + } + + $text .= "
+ ".LAN_FORUM_0024." ".$lastvisit_datestamp."
+ ".LAN_FORUM_0025." ".$datestamp; +} +/* +else +{ + $text .= ''; + if (ANON == TRUE) + { + $text .= LAN_FORUM_0049.'
'.LAN_FORUM_0050." ".LAN_FORUM_0051." ".LAN_FORUM_0052; + } + elseif(USER == FALSE) + { + $text .= LAN_FORUM_0049.'
'.LAN_FORUM_0053." ".LAN_FORUM_0054." ".LAN_FORUM_0055; + } +} +*/ + +//if (USER && vartrue($allread) != TRUE && $total_new_threads && $total_new_threads >= $total_read_threads) +if (USER && !$allread && $total_new_threads && $total_new_threads >= $total_read_threads) +{ + $text .= "
".LAN_FORUM_0057.''.(e_QUERY != 'new' ? ", ".LAN_FORUM_0058."" : ''); +} + +$forum = new e107forum; +//$trackPref = $forum->prefs->get('track'); +//if (USER && vartrue($trackPref) && e_QUERY != 'track') +if (USER && vartrue($forum->prefs->get('track')) && e_QUERY != 'track') +{ + $text .= "
".LAN_FORUM_0030.''; +} +return $text; +} + + function sc_foruminfo() + { +$sql = e107::getDb(); + +$total_topics = $sql->count("forum_thread", "(*)"); +$total_replies = $sql->count("forum_post", "(*)"); +$total_members = $sql->count("user"); +//----$newest_member = $sql->select("user", "*", "user_ban='0' ORDER BY user_join DESC LIMIT 0,1"); +list($nuser_id, $nuser_name) = $sql->fetch('num'); // FIXME $nuser_id & $user_name return empty even though print_a($newest_member); returns proper result. + +if(!defined('e_TRACKING_DISABLED')) +{ + $member_users = $sql->select("online", "*", "online_location REGEXP('forum.php') AND online_user_id!='0' "); + $guest_users = $sql->select("online", "*", "online_location REGEXP('forum.php') AND online_user_id='0' "); + $users = $member_users+$guest_users; +} + +return str_replace("[x]", ($total_topics+$total_replies), LAN_FORUM_0031)." ($total_topics ".($total_topics == 1 ? LAN_FORUM_0032 : LAN_FORUM_0033).", $total_replies ".($total_replies == 1 ? LAN_FORUM_0034 : LAN_FORUM_0035).") +".(!defined("e_TRACKING_DISABLED") ? "" : "
".$users." ".($users == 1 ? LAN_FORUM_0059 : LAN_FORUM_0060)." (".$member_users." ".($member_users == 1 ? LAN_FORUM_0061 : LAN_FORUM_0062).", ".$guest_users." ".($guest_users == 1 ? LAN_FORUM_0063 : LAN_FORUM_0064).")
".LAN_FORUM_0066." ".$total_members."
".LAN_FORUM_0065." ".$nuser_name.".\n"); // FIXME cannot find other references to e_TRACKING_DISABLED, use pref? + } +// END OF $FVARS + +// START OF $PVARS + function sc_parentstatus() + { +//---- return $this->parentstatus; +// if(!check_class($this->fparent['forum_postclass'])) + if(!check_class($this->var['forum_postclass'])) + { + $status = '('.LAN_FORUM_0056.')'; + } + return vartrue($status); + } + function sc_parentname() + { +//---- return $this->parentname; +// return $this->fparent['forum_name']; + return $this->var['forum_name']; + } +// END OF $PVARS +// Function to show the retrieval of parent ID, not really needed by core template + function sc_parentid() + { +//---- return $this->parentname; +// return $this->fparent['forum_id']; + return $this->var['forum_id']; + } + +// START OF parse_forum function $FVARS + + function sc_newflag() + { + global $newflag_list; +// $e107 = e107::getInstance(); + + if(USER && is_array($newflag_list) && in_array($this->var['forum_id'], $newflag_list)) + { + + return "var)."'>".IMAGE_new.''; + } + elseif(empty($this->var['forum_replies']) && defined('IMAGE_noreplies')) + { + return IMAGE_noreplies; + } +//---- else +//---- { + return IMAGE_nonew; +//---- } +} + function sc_forumname() + { +// global $f; +// $tp = e107::getParser(); + if(substr($this->var['forum_name'], 0, 1) == '*') + { + $this->var['forum_name'] = substr($this->var['forum_name'], 1); + } + $this->var['forum_name'] = e107::getParser()->toHTML($this->var['forum_name'], true, 'no_hook'); + + $url = e107::url('forum', 'forum', $this->var); + return "{$this->var['forum_name']}"; + } + function sc_forumdescription() + { +// global $f, $restricted_string; + global $restricted_string; +// $tp = e107::getParser(); + $this->var['forum_description'] = e107::getParser()->toHTML($this->var['forum_description'], true, 'no_hook'); + return $this->var['forum_description'].($restricted_string ? "
$restricted_string" : ""); + } + function sc_threads() + { + return $this->var['forum_threads']; + } + function sc_replies() + { + return $this->var['forum_replies']; + } + function sc_threadsx() + { +// global $f; +// return "".$f['forum_threads'].""; + return "".$this->var['forum_threads'].""; + } + function sc_repliesx() + { +// global $f; +// return "".$f['forum_replies'].""; + return "".$this->var['forum_replies'].""; + } + function sc_forumsubforums() + { +// VAR_DUMP ($this->ret); +// return ($this->ret)?"
".LAN_FORUM_0069.": {$this->ret['text']}
":""; + return ($this->var['text'])?"
".LAN_FORUM_0069.": {$this->var['text']}
":""; + } + function sc_lastpostuser() + { +// global $f; +// $e107 = e107::getInstance(); +// $tp = e107::getParser(); + +// if ($f['forum_lastpost_info']) + if ($this->var['forum_lastpost_info']) + { +// list($lastpost_datestamp, $lastpost_thread) = explode('.', $f['forum_lastpost_info']); +// $lastpost_name = $tp->toHTML($f['forum_lastpost_user_anon']); + +// if ($f['user_name']) + $lastpost_name = e107::getParser()->toHTML($this->var['forum_lastpost_user_anon']); + + if ($this->var['user_name']) + { + +// $lastpost_name = " $f['user_name'], 'id' => $f['forum_lastpost_user']))."'>{$f['user_name']}"; + $lastpost_name = " $this->var['user_name'], 'id' => $this->var['forum_lastpost_user']))."'>{$this->var['user_name']}"; + } +//---- else +//---- { +//---- $lastpost_name = $tp->toHTML($f['forum_lastpost_user_anon']); +//---- } + +// $lastpost = $forum->threadGetLastpost($lastpost_thread); //XXX TODO inefficient to have SQL query here. + + return $lastpost_name; + // {forum_sef}/{thread_id}-{thread_sef} + +// $urlData = array('forum_sef'=>$f['forum_sef'], 'thread_id'=>$lastpost['post_thread'],'thread_sef'=>$lastpost['thread_sef']); +// $url = e107::url('forum', 'topic', $urlData)."?last=1#post-".$lastpost['post_id']; +// $fVars->LASTPOSTDATE .= "". $gen->computeLapse($lastpost_datestamp, time(), false, false, 'short').""; +// $lastpost_datestamp = $gen->convert_date($lastpost_datestamp, 'forum'); +// $fVars->LASTPOST = $lastpost_datestamp.'
'.$lastpost_name." $lastpost_name, 'id' => $lastpost_thread))."'>".IMAGE_post2.''; + + } +//---- else +//---- { + return ""; +// $fVars->LASTPOSTDATE = "-"; +// $fVars->LASTPOST = '-'; +//---- } +} + function sc_lastpostdate() + { +// global $f, $forum; + global $forum; +// $e107 = e107::getInstance(); +// $tp = e107::getParser(); +$gen = new convert; + +// if ($f['forum_lastpost_info']) + if ($this->var['forum_lastpost_info']) + { +// list($lastpost_datestamp, $lastpost_thread) = explode('.', $f['forum_lastpost_info']); + list($lastpost_datestamp, $lastpost_thread) = explode('.', $this->var['forum_lastpost_info']); +// if ($f['user_name']) +// { + +// $lastpost_name = " $f['user_name'], 'id' => $f['forum_lastpost_user']))."'>{$f['user_name']}"; +// } +// else +// { +// $lastpost_name = $tp->toHTML($f['forum_lastpost_user_anon']); +// } + + $lastpost = $forum->threadGetLastpost($lastpost_thread); //XXX TODO inefficient to have SQL query here. + +// $fVars->LASTPOSTUSER = $lastpost_name; + // {forum_sef}/{thread_id}-{thread_sef} + +// $urlData = array('forum_sef'=>$f['forum_sef'], 'thread_id'=>$lastpost['post_thread'],'thread_sef'=>$lastpost['thread_sef']); + $urlData = array('forum_sef'=>$this->var['forum_sef'], 'thread_id'=>$lastpost['post_thread'],'thread_sef'=>$lastpost['thread_sef']); + $url = e107::url('forum', 'topic', $urlData)."?last=1#post-".$lastpost['post_id']; + return "". $gen->computeLapse($lastpost_datestamp, time(), false, false, 'short').""; +// $lastpost_datestamp = $gen->convert_date($lastpost_datestamp, 'forum'); +// $fVars->LASTPOST = $lastpost_datestamp.'
'.$lastpost_name." $lastpost_name, 'id' => $lastpost_thread))."'>".IMAGE_post2.''; + + } +//---- else +//---- { +// $fVars->LASTPOSTUSER = ""; + return "-"; +// $fVars->LASTPOST = '-'; +//---- } +} + function sc_lastpost() + { +// global $f; + $e107 = e107::getInstance(); +// $tp = e107::getParser(); +$gen = new convert; + +// if ($f['forum_lastpost_info']) + if ($this->var['forum_lastpost_info']) + { +// list($lastpost_datestamp, $lastpost_thread) = explode('.', $f['forum_lastpost_info']); + list($lastpost_datestamp, $lastpost_thread) = explode('.', $this->var['forum_lastpost_info']); +// $lastpost_name = $tp->toHTML($f['forum_lastpost_user_anon']); +// $lastpost_name = e107::getParser()->toHTML($f['forum_lastpost_user_anon']); +// if ($f['user_name']) + $lastpost_name = e107::getParser()->toHTML($this->var['forum_lastpost_user_anon']); + if ($this->var['user_name']) + { + +// $lastpost_name = " $f['user_name'], 'id' => $f['forum_lastpost_user']))."'>{$f['user_name']}"; + $lastpost_name = " $this->var['user_name'], 'id' => $this->var['forum_lastpost_user']))."'>{$this->var['user_name']}"; + } +//---- else +//---- { +//---- $lastpost_name = $tp->toHTML($f['forum_lastpost_user_anon']); +//---- } + +// $lastpost = $forum->threadGetLastpost($lastpost_thread); //XXX TODO inefficient to have SQL query here. + +// $fVars->LASTPOSTUSER = $lastpost_name; + // {forum_sef}/{thread_id}-{thread_sef} + +// $urlData = array('forum_sef'=>$f['forum_sef'], 'thread_id'=>$lastpost['post_thread'],'thread_sef'=>$lastpost['thread_sef']); +// $url = e107::url('forum', 'topic', $urlData)."?last=1#post-".$lastpost['post_id']; +// $fVars->LASTPOSTDATE .= "". $gen->computeLapse($lastpost_datestamp, time(), false, false, 'short').""; + $lastpost_datestamp = $gen->convert_date($lastpost_datestamp, 'forum'); + return $lastpost_datestamp.'
'.$lastpost_name." $lastpost_name, 'id' => $lastpost_thread))."'>".IMAGE_post2.''; + + } +//---- else +//---- { +// $fVars->LASTPOSTUSER = ""; +// $fVars->LASTPOSTDATE = "-"; + return '-'; +//---- } +} +// END OF parse_forum function $FVARS + +// START OF $NVARS + function sc_startertitle() + { +// global $thread; +$gen = new convert; + + $author_name = ($this->var['user_name'] ? $this->var['user_name'] : $this->var['lastuser_anon']); + +//-- $datestamp = $gen->convert_date($thread['thread_lastpost'], 'forum'); + $datestamp = $gen->convert_date($this->var['thread_lastpost'], 'forum'); + + + if(!$this->var['user_name']) + { + return $author_name.'
'.$datestamp; + } +//---- else +//---- { +// $e107 = e107::getInstance(); +// return " $thread['thread_lastuser'], 'name' => $sc->author_name))."'>{$sc->author_name}
".$sc->datestamp; + return " $this->var['thread_lastuser'], 'name' => $author_name))."'>{$author_name}
".$datestamp; +//---- } + } + function sc_newspostname() + { +// global $thread; +// $e107 = e107::getInstance(); +// $tp = e107::getParser(); + +// return empty($thread)?LAN_FORUM_0029:"".$tp->toHTML($thread['thread_name'], TRUE, 'no_make_clickable, no_hook').''; +// Only $this->var???' + return empty($this->var)?LAN_FORUM_0029:"var)."'>".e107::getParser()->toHTML($this->var['thread_name'], TRUE, 'no_make_clickable, no_hook').''; + } +// END OF $NVARS + + + function sc_forum_breadcrumb() + { + global $breadarray; +$frm = e107::getForm(); +return $frm->breadcrumb($breadarray); + } + +} +?> \ No newline at end of file From 4b925691c90d1ee6fb18bb2d31f11ba01f15af66 Mon Sep 17 00:00:00 2001 From: rica-carv Date: Tue, 31 May 2016 20:33:17 +0100 Subject: [PATCH 5/9] Add files via upload --- .../forum/templates/forum_template.php | 369 +++++++++--------- 1 file changed, 188 insertions(+), 181 deletions(-) diff --git a/e107_plugins/forum/templates/forum_template.php b/e107_plugins/forum/templates/forum_template.php index cb3599795..6305dcf20 100644 --- a/e107_plugins/forum/templates/forum_template.php +++ b/e107_plugins/forum/templates/forum_template.php @@ -1,181 +1,188 @@ -\n
\n\n\n\n\n\n\n"; -} -if (!isset($FORUM_MAIN_PARENT)) -{ - $FORUM_MAIN_PARENT = " \n\n"; -} -if (!isset($FORUM_MAIN_FORUM)) -{ - $FORUM_MAIN_FORUM = "\n\n\n\n\n\n"; -} -if (!isset($FORUM_MAIN_END)) -{ - $FORUM_MAIN_END = "
{FORUMTITLE}{THREADTITLE}{REPLYTITLE}{LASTPOSTITLE}
{PARENTNAME} {PARENTSTATUS}
{NEWFLAG}{FORUMNAME}
{FORUMDESCRIPTION}{FORUMSUBFORUMS}
{THREADS}{REPLIES}{LASTPOST}
\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
{INFOTITLE}
{LOGO}{USERINFO}
{INFO}
{FORUMINFO}
{USERLIST}
{STATLINK}
\n
\n
\n\n\n\n\n\n\n
{ICONKEY}{SEARCH}{PERMS}\n
\n
\n
"; -} - -if (!isset($FORUM_NEWPOSTS_START)) -{ - $FORUM_NEWPOSTS_START = "
\n
\n\n\n\n\n\n"; -} - -if (!isset($FORUM_NEWPOSTS_MAIN)) -{ - $FORUM_NEWPOSTS_MAIN = "\n\n\n\n"; -} - -if (!isset($FORUM_NEWPOSTS_END)) -{ - $FORUM_NEWPOSTS_END = "
 {NEWTHREADTITLE}{POSTEDTITLE}
{NEWIMAGE}{NEWSPOSTNAME}{STARTERTITLE}
"; -} - -if (!isset($FORUM_TRACK_START)) -{ - $FORUM_TRACK_START = "
\n
\n\n\n\n\n"; - - if (!isset($FORUM_TRACK_MAIN)) - { - $FORUM_TRACK_MAIN = " - - - - "; - } -} - -if (!isset($FORUM_TRACK_END)) -{ - $FORUM_TRACK_END = "
{TRACKTITLE}
{NEWIMAGE}{TRACKPOSTNAME}{UNTRACK}
\n
\n
"; -} - - -/* -$FORUM_MAIN_START = "
MAIN START"; -$FORUM_MAIN_PARENT = "
MAIN PARENT"; -$FORUM_MAIN_FORUM = "
MAIN FORUM"; -$FORUM_MAIN_END = "
MAIN END"; -$FORUM_NEWPOSTS_START = "
NEWPOSTS-START"; -$FORUM_NEWPOSTS_MAIN = "
NEWPOSTS-MAIN"; -$FORUM_NEWPOSTS_END = "
NEWPOSTS END"; -$FORUM_TRACK_START = "
TRACK-START"; -$FORUM_TRACK_MAIN = "
TRACK-MAIN"; -$FORUM_TRACK_END = "
TRACK-END"; -*/ - -// New in v2.x - requires a bootstrap theme be loaded. - - -$FORUM_TEMPLATE['main']['start'] = "{FORUM_BREADCRUMB} -
- -
- {SEARCH} -
-
-
- - - - - - - - - - - "; - -$FORUM_TEMPLATE['main']['parent'] = " - - - - - "; - - -$FORUM_TEMPLATE['main']['forum'] = " - - - - - - "; - -$FORUM_TEMPLATE['main']['end'] = "
{FORUMTITLE}
{PARENTNAME} {PARENTSTATUS}".LAN_FORUM_0002."
{NEWFLAG}{FORUMNAME}
{FORUMDESCRIPTION}{FORUMSUBFORUMS}
{THREADSX}
"; - - - -// Tracking -$FORUM_TEMPLATE['track']['start'] = "{FORUM_BREADCRUMB}
- - - - - - - - - - - - - - - - "; - -$FORUM_TEMPLATE['track']['item'] = " - - - - - "; - - -$FORUM_TEMPLATE['track']['end'] = "
".LAN_FORUM_1003."".LAN_FORUM_1020."
{NEWIMAGE}{TRACKPOSTNAME}{UNTRACK}
\n
"; - - - - -/* -$FORUM_TEMPLATE['main-end'] .= " - -
- {PERMS} -
-\n -\n\n - -\n -\n\n -\n\n -\n\n\n
{INFOTITLE}
{LOGO}{USERINFO}
{INFO}
{FORUMINFO}
{USERLIST}
{STATLINK}
-"; -*/ - - - - - - - - - - - - -?> \ No newline at end of file +\n
\n\n\n\n\n\n\n"; +*/ +// LEGACY definition with LAN Shortcodes ({THREADTITLE}, {REPLYTITLE}, {LASTPOSTITLE})..... + $FORUM_MAIN_START = "
\n
\n
{FORUMTITLE}".LAN_FORUM_0002."".LAN_FORUM_0003."".LAN_FORUM_0004."
\n\n\n\n\n\n"; +} +if (!isset($FORUM_MAIN_PARENT)) +{ + $FORUM_MAIN_PARENT = " \n\n"; +} +if (!isset($FORUM_MAIN_FORUM)) +{ + $FORUM_MAIN_FORUM = "\n\n\n\n\n\n"; +} +if (!isset($FORUM_MAIN_END)) +{ +// How it should be??? (LAN Shortcodes replaced by their outputed LANS...) +/* + $FORUM_MAIN_END = "
{FORUMTITLE}{THREADTITLE}{REPLYTITLE}{LASTPOSTITLE}
{PARENTNAME} {PARENTSTATUS}
{NEWFLAG}{FORUMNAME}
{FORUMDESCRIPTION}{FORUMSUBFORUMS}
{THREADS}{REPLIES}{LASTPOST}
\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
".LAN_FORUM_0009."
{LOGO}{USERINFO}
{INFO}
{FORUMINFO}
{USERLIST}
{STATLINK}
\n
\n
\n\n\n\n\n\n\n
{ICONKEY}{SEARCH}{PERMS}\n
\n
\n
"; +*/ +// LEGACY definition with LAN Shortcodes ({INFOTITLE})..... +$FORUM_MAIN_END = "
\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
{INFOTITLE}
{LOGO}{USERINFO}
{INFO}
{FORUMINFO}
{USERLIST}
{STATLINK}
\n
\n
\n\n\n\n\n\n\n
{ICONKEY}{SEARCH}{PERMS}\n
\n
\n
"; +} + +if (!isset($FORUM_NEWPOSTS_START)) +{ +// How it should be??? (LAN Shortcodes replaced by their outputed LANS...) +/* + $FORUM_NEWPOSTS_START = "
\n
\n\n\n\n\n\n"; +*/ +// LEGACY definition with LAN Shortcodes ({NEWTHREADTITLE}, {POSTEDTITLE})..... + $FORUM_NEWPOSTS_START = "
\n
\n
 ".LAN_FORUM_0075."".LAN_FORUM_0074."
\n\n\n\n\n"; +} + +if (!isset($FORUM_NEWPOSTS_MAIN)) +{ + $FORUM_NEWPOSTS_MAIN = "\n\n\n\n"; +} + +if (!isset($FORUM_NEWPOSTS_END)) +{ + $FORUM_NEWPOSTS_END = "
 {NEWTHREADTITLE}{POSTEDTITLE}
{NEWIMAGE}{NEWSPOSTNAME}{STARTERTITLE}
"; +} + +if (!isset($FORUM_TRACK_START)) +{ +// How it should be??? (LAN Shortcodes replaced by their outputed LANS...) +/* + $FORUM_TRACK_START = "
\n
\n\n\n\n\n"; +*/ +// LEGACY definition with LAN Shortcodes ({TRACKTITLE})..... +$FORUM_TRACK_START = "
\n
\n
".LAN_FORUM_0073."
\n\n\n\n"; + + if (!isset($FORUM_TRACK_MAIN)) + { + $FORUM_TRACK_MAIN = " + + + + "; + } +} + +if (!isset($FORUM_TRACK_END)) +{ + $FORUM_TRACK_END = "
{TRACKTITLE}
{NEWIMAGE}{TRACKPOSTNAME}{UNTRACK}
\n
\n
"; +} + + +/* +$FORUM_MAIN_START = "
MAIN START"; +$FORUM_MAIN_PARENT = "
MAIN PARENT"; +$FORUM_MAIN_FORUM = "
MAIN FORUM"; +$FORUM_MAIN_END = "
MAIN END"; +$FORUM_NEWPOSTS_START = "
NEWPOSTS-START"; +$FORUM_NEWPOSTS_MAIN = "
NEWPOSTS-MAIN"; +$FORUM_NEWPOSTS_END = "
NEWPOSTS END"; +$FORUM_TRACK_START = "
TRACK-START"; +$FORUM_TRACK_MAIN = "
TRACK-MAIN"; +$FORUM_TRACK_END = "
TRACK-END"; +*/ + +// New in v2.x - requires a bootstrap theme be loaded. + + +$FORUM_TEMPLATE['main']['start'] = "{FORUM_BREADCRUMB} +
+ +
+ {SEARCH} +
+
+
+ + + + + + + + + + + "; + +$FORUM_TEMPLATE['main']['parent'] = " + + + + + "; + + +$FORUM_TEMPLATE['main']['forum'] = " + + + + + + "; + +$FORUM_TEMPLATE['main']['end'] = "
{FORUMTITLE}
{PARENTNAME} {PARENTSTATUS}".LAN_FORUM_0002."
{NEWFLAG}{FORUMNAME}
{FORUMDESCRIPTION}{FORUMSUBFORUMS}
{THREADSX}
"; + + + +// Tracking +$FORUM_TEMPLATE['track']['start'] = "{FORUM_BREADCRUMB}
+ + + + + + + + + + + + + + + + "; + +$FORUM_TEMPLATE['track']['item'] = " + + + + + "; + + +$FORUM_TEMPLATE['track']['end'] = "
".LAN_FORUM_1003."".LAN_FORUM_1020."
{NEWIMAGE}{TRACKPOSTNAME}{UNTRACK}
\n
"; + + + + +/* +$FORUM_TEMPLATE['main-end'] .= " + +
+ {PERMS} +
+\n +\n\n + +\n +\n\n +\n\n +\n\n\n
{INFOTITLE}
{LOGO}{USERINFO}
{INFO}
{FORUMINFO}
{USERLIST}
{STATLINK}
+"; +*/ +?> From eb40a9ac15ab4d3b75ac9abdfc41f65733b89a6c Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 31 May 2016 13:04:05 -0700 Subject: [PATCH 6/9] Added Experimental Inline editing for news items. --- e107_handlers/news_class.php | 22 +++++++++++++++++++++- e107_web/css/e107.css | 3 +++ e107_web/js/inline.php | 3 ++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/e107_handlers/news_class.php b/e107_handlers/news_class.php index 1ecd192da..cd83b0dbd 100644 --- a/e107_handlers/news_class.php +++ b/e107_handlers/news_class.php @@ -376,10 +376,30 @@ class news { $wrapperKey = (!empty($param['template_key'])) ? 'news/'.$param['template_key'].'/item' : 'news/view/item'; + $editable = array( + 'table' => 'news', + 'pid' => 'news_id', + 'vars' => 'news_item', + 'perms' => '0', + 'shortcodes' => array( + 'newstitle' => array('field'=>'news_title', 'type'=>'text', 'container'=>'span'), + 'newsmetadiz' => array('field'=>'news_meta_description','type'=>'text', 'container'=>'div'), + 'newsbody' => array('field'=>'news_body', 'type'=>'html', 'container'=>'div'), + ) + + ); + + // Aliases + $editable['shortcodes']['newstitlelink'] = $editable['shortcodes']['newstitle']; + $editable['shortcodes']['news_title'] = $editable['shortcodes']['newstitle']; + $editable['shortcodes']['news_body'] = $editable['shortcodes']['newsbody']; + + $sc = e107::getScBatch('news') ->wrapper($wrapperKey) ->setScVar('news_item', $news) - ->setScVar('param', $param); + ->setScVar('param', $param) + ->editable($editable); $text = e107::getParser()->parseTemplate($NEWS_PARSE, true, $sc); diff --git a/e107_web/css/e107.css b/e107_web/css/e107.css index 4a73fa353..7f66e062f 100644 --- a/e107_web/css/e107.css +++ b/e107_web/css/e107.css @@ -327,3 +327,6 @@ optgroup.level-5 { padding-left:4em } img.e-emoticon { vertical-align:middle; border:0; width:24px } .e-editable-front:hover { background-color:#FCF8E3 } +.e-editable-front a:hover { background-color:#FCF8E3 } +#uiAlert { z-index: 10001 } +#uiAlert .alert { z-index:10000; box-shadow:1px 4px 5px rgba(0,0,0,0.4) } \ No newline at end of file diff --git a/e107_web/js/inline.php b/e107_web/js/inline.php index 6e3f185fd..d823429b5 100644 --- a/e107_web/js/inline.php +++ b/e107_web/js/inline.php @@ -89,10 +89,11 @@ class e107InlineEdit $ret['msg'] = "Saved"; // LAN_UPDATED; or LAN_SAVED $ret['status'] = 'ok'; } - else + else //FIXME only display error when query fails.. { $ret['msg'] = "Saving Failed"; // LAN_UPDATED_FAILED; $ret['status'] = 'error'; + return false; } From 347a17823eb51b284d550d377786dfcc6da50e16 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 31 May 2016 13:22:52 -0700 Subject: [PATCH 7/9] Forum code formatting and cleanup. --- .../shortcodes/batch/forum_shortcodes.php | 590 +++++++++--------- 1 file changed, 302 insertions(+), 288 deletions(-) diff --git a/e107_plugins/forum/shortcodes/batch/forum_shortcodes.php b/e107_plugins/forum/shortcodes/batch/forum_shortcodes.php index 95cafa915..95152d0bb 100644 --- a/e107_plugins/forum/shortcodes/batch/forum_shortcodes.php +++ b/e107_plugins/forum/shortcodes/batch/forum_shortcodes.php @@ -14,10 +14,10 @@ class forum_shortcodes extends e_shortcode function __construct() { - $this->forum_rules = forum_rules('check'); + $this->forum_rules = forum_rules('check'); } -// START OF $FVARS + // START OF $FVARS function sc_forumtitle() { return e107::pref('forum','title', LAN_PLUGIN_FORUM_NAME); @@ -28,52 +28,61 @@ class forum_shortcodes extends e_shortcode { return LAN_FORUM_0002; } + function sc_replytitle() { return LAN_FORUM_0003; } + function sc_lastpostitle() { return LAN_FORUM_0004; } + function sc_infotitle() { return LAN_FORUM_0009; } + function sc_newthreadtitle() { return LAN_FORUM_0075; } + function sc_postedtitle() { return LAN_FORUM_0074; } + function sc_tracktitle() { return LAN_FORUM_0073; } + function sc_statlink() { - return "".LAN_FORUM_0017."\n"; - } + return "".LAN_FORUM_0017."\n"; + } + function sc_iconkey() { - return " -\n - - - - - - -\n
".IMAGE_new_small."".LAN_FORUM_0039."".IMAGE_nonew_small."".LAN_FORUM_0040."".IMAGE_closed_small."".LAN_FORUM_0041."
\n"; + return " + \n + + + + + + + \n
".IMAGE_new_small."".LAN_FORUM_0039."".IMAGE_nonew_small."".LAN_FORUM_0040."".IMAGE_closed_small."".LAN_FORUM_0041."
\n"; } -// End of LEGACY shortcodes... + // End of LEGACY shortcodes... function sc_logo() { return IMAGE_e; } + function sc_newimage() { return IMAGE_new_small; @@ -81,317 +90,324 @@ class forum_shortcodes extends e_shortcode function sc_userinfo() { -//---- Pass globals via $sc????? - global $forum, $pref; + //---- Pass globals via $sc????? + global $forum, $pref; -$text = "".LAN_FORUM_0010." | ".LAN_FORUM_0011.""; -if(USER) -{ - $text .= " | ".LAN_FORUM_0012." | ".LAN_FORUM_0013." | ".LAN_FORUM_0014.""; -// To be reworked to get the $forum var - if($forum->prefs->get('attach') && (check_class($pref['upload_class']) || getperms('0'))) - { - $text .= " | ".LAN_FORUM_0015.""; + $text = "".LAN_FORUM_0010." | ".LAN_FORUM_0011.""; + if(USER) + { + $text .= " | ".LAN_FORUM_0012." | ".LAN_FORUM_0013." | ".LAN_FORUM_0014.""; + // To be reworked to get the $forum var + if($forum->prefs->get('attach') && (check_class($pref['upload_class']) || getperms('0'))) + { + $text .= " | ".LAN_FORUM_0015.""; + } + } + if(!empty($this->forum_rules)) + { + $text .= " | ".LAN_FORUM_0016.''; + } + return $text; } -} -if(!empty($this->forum_rules)) -{ - $text .= " | ".LAN_FORUM_0016.''; -} - return $text; - } function sc_userinfox() { - global $forum; + global $forum; - $uInfo = array(); -$uInfo[0] = "".LAN_FORUM_6013.''; + $uInfo = array(); + $uInfo[0] = "".LAN_FORUM_6013.''; - if(!empty($this->forum_rules)) -{ - $uInfo[1] = "".LAN_FORUM_0016.''; -} + if(!empty($this->forum_rules)) + { + $uInfo[1] = "".LAN_FORUM_0016.''; + } -// To be reworked to get the $forum var -$trackPref = $forum->prefs->get('track'); -if(!empty($trackPref)) -{ - $uInfo[2] = "".LAN_FORUM_0030.""; -} - return implode(" | ",$uInfo); - } + // To be reworked to get the $forum var + $trackPref = $forum->prefs->get('track'); + if(!empty($trackPref)) + { + $uInfo[2] = "".LAN_FORUM_0030.""; + } + + return implode(" | ",$uInfo); + } function sc_userlist() { - if(!defined('e_TRACKING_DISABLED')) -{ -// String candidate for USERLIST wrapper - $text = LAN_FORUM_0036.": "; + if(!defined('e_TRACKING_DISABLED')) + { + // String candidate for USERLIST wrapper + $text = LAN_FORUM_0036.": "; - global $listuserson; - $c = 0; - if(is_array($listuserson)) - { -//---- foreach($listuserson as $uinfo => $pinfo) - foreach(array_keys($listuserson) as $uinfo) -// foreach($listuserson as $uinfo => &$pinfo) - { - list($oid, $oname) = explode(".", $uinfo, 2); - $c ++; - $text .= "$oname".($c == MEMBERS_ONLINE ? "." :", "); + global $listuserson; + $c = 0; + if(is_array($listuserson)) + { + //---- foreach($listuserson as $uinfo => $pinfo) + foreach(array_keys($listuserson) as $uinfo) + // foreach($listuserson as $uinfo => &$pinfo) + { + list($oid, $oname) = explode(".", $uinfo, 2); + $c ++; + $text .= "$oname".($c == MEMBERS_ONLINE ? "." :", "); + } + + } + // String candidate for USERLIST wrapper + $text .= "
".LAN_FORUM_0037." ".LAN_FORUM_0038; + } + return $text; } - } -// String candidate for USERLIST wrapper - $text .= "
".LAN_FORUM_0037." ".LAN_FORUM_0038; -} - return $text; - } function sc_search() { -// $tp = e107::getParser(); - if(!$srchIcon = e107::getParser()->toGlyph('fa-search')) -{ - $srchIcon = LAN_SEARCH; -} -// String candidate for USERLIST wrapper -return " -
-
- - - - - - - -
+ if(!$srchIcon = e107::getParser()->toGlyph('fa-search')) + { + $srchIcon = LAN_SEARCH; + } -
\n"; -} + // String candidate for USERLIST wrapper + return " +
+
+ + + + + + + +
+ +
\n"; + } function sc_perms() { -return (USER == TRUE || ANON == TRUE ? LAN_FORUM_0043." - ".LAN_FORUM_0045." - ".LAN_FORUM_0047 : LAN_FORUM_0044." - ".LAN_FORUM_0046." - ".LAN_FORUM_0048); - } + return (USER == TRUE || ANON == TRUE ? LAN_FORUM_0043." - ".LAN_FORUM_0045." - ".LAN_FORUM_0047 : LAN_FORUM_0044." - ".LAN_FORUM_0046." - ".LAN_FORUM_0048); + } function sc_info() { -//$fVars->INFO = ""; -// global $forum; -//$sql = e107::getDb(); -//$gen = new convert; - if (ANON == TRUE) - { - $text = LAN_FORUM_0049.'
'.LAN_FORUM_0050." ".LAN_FORUM_0051." ".LAN_FORUM_0052; - } - elseif(USER == FALSE) - { - $text = LAN_FORUM_0049.'
'.LAN_FORUM_0053." ".LAN_FORUM_0054." ".LAN_FORUM_0055; - } + //$fVars->INFO = ""; + // global $forum; + //$sql = e107::getDb(); + //$gen = new convert; + if (ANON == TRUE) + { + $text = LAN_FORUM_0049.'
'.LAN_FORUM_0050." ".LAN_FORUM_0051." ".LAN_FORUM_0052; + } + elseif(USER == FALSE) + { + $text = LAN_FORUM_0049.'
'.LAN_FORUM_0053." ".LAN_FORUM_0054." ".LAN_FORUM_0055; + } -if (USER == TRUE) -{ - $total_new_threads = e107::getDb()->count('forum_thread', '(*)', "WHERE thread_datestamp>'".USERLV."' "); - $total_read_threads = 0; - if (USERVIEWED != "") - { - $tmp = explode(".", USERVIEWED); // List of numbers, separated by single period - $total_read_threads = count($tmp); - } -/* - else - { - $total_read_threads = 0; - } -*/ + if (USER == TRUE) + { + $total_new_threads = e107::getDb()->count('forum_thread', '(*)', "WHERE thread_datestamp>'".USERLV."' "); + $total_read_threads = 0; + if (USERVIEWED != "") + { + $tmp = explode(".", USERVIEWED); // List of numbers, separated by single period + $total_read_threads = count($tmp); + } + /* + else + { + $total_read_threads = 0; + } + */ -$gen = new convert; - $text = LAN_FORUM_0018." ".USERNAME."
"; - $lastvisit_datestamp = $gen->convert_date(USERLV, 'long'); - $datestamp = $gen->convert_date(time(), "long"); + $gen = new convert; + $text = LAN_FORUM_0018." ".USERNAME."
"; + $lastvisit_datestamp = $gen->convert_date(USERLV, 'long'); + $datestamp = $gen->convert_date(time(), "long"); -/* - if (!$total_new_threads) - { - $text .= LAN_FORUM_0019." "; - } - elseif($total_new_threads == 1) - { - $text .= LAN_FORUM_0020; - } - else - { - $text .= LAN_FORUM_0021." ".$total_new_threads." ".LAN_FORUM_0022." "; - } -*/ - $text .= (!$total_new_threads?LAN_FORUM_0019." ":($total_new_threads == 1?LAN_FORUM_0020:LAN_FORUM_0021." ".$total_new_threads." ".LAN_FORUM_0022." ")).LAN_FORUM_0023; -// $text .= LAN_FORUM_0023; -// if ($total_new_threads == $total_read_threads && $total_new_threads != 0 && $total_read_threads >= $total_new_threads) - if ($total_new_threads != 0 && $total_read_threads >= $total_new_threads) - { - $text .= LAN_FORUM_0029; - $allread = TRUE; - } - elseif($total_read_threads != 0) - { - $text .= " (".LAN_FORUM_0027." ".$total_read_threads." ".LAN_FORUM_0028.")"; - } + /* + if (!$total_new_threads) + { + $text .= LAN_FORUM_0019." "; + } + elseif($total_new_threads == 1) + { + $text .= LAN_FORUM_0020; + } + else + { + $text .= LAN_FORUM_0021." ".$total_new_threads." ".LAN_FORUM_0022." "; + } + */ + $text .= (!$total_new_threads?LAN_FORUM_0019." ":($total_new_threads == 1?LAN_FORUM_0020:LAN_FORUM_0021." ".$total_new_threads." ".LAN_FORUM_0022." ")).LAN_FORUM_0023; + // $text .= LAN_FORUM_0023; + // if ($total_new_threads == $total_read_threads && $total_new_threads != 0 && $total_read_threads >= $total_new_threads) + if ($total_new_threads != 0 && $total_read_threads >= $total_new_threads) + { + $text .= LAN_FORUM_0029; + $allread = TRUE; + } + elseif($total_read_threads != 0) + { + $text .= " (".LAN_FORUM_0027." ".$total_read_threads." ".LAN_FORUM_0028.")"; + } - $text .= "
- ".LAN_FORUM_0024." ".$lastvisit_datestamp."
- ".LAN_FORUM_0025." ".$datestamp; -} -/* -else -{ - $text .= ''; - if (ANON == TRUE) - { - $text .= LAN_FORUM_0049.'
'.LAN_FORUM_0050." ".LAN_FORUM_0051." ".LAN_FORUM_0052; - } - elseif(USER == FALSE) - { - $text .= LAN_FORUM_0049.'
'.LAN_FORUM_0053." ".LAN_FORUM_0054." ".LAN_FORUM_0055; - } -} -*/ + $text .= "
+ ".LAN_FORUM_0024." ".$lastvisit_datestamp."
+ ".LAN_FORUM_0025." ".$datestamp; + } + /* + else + { + $text .= ''; + if (ANON == TRUE) + { + $text .= LAN_FORUM_0049.'
'.LAN_FORUM_0050." ".LAN_FORUM_0051." ".LAN_FORUM_0052; + } + elseif(USER == FALSE) + { + $text .= LAN_FORUM_0049.'
'.LAN_FORUM_0053." ".LAN_FORUM_0054." ".LAN_FORUM_0055; + } + } + */ -//if (USER && vartrue($allread) != TRUE && $total_new_threads && $total_new_threads >= $total_read_threads) -if (USER && !$allread && $total_new_threads && $total_new_threads >= $total_read_threads) -{ - $text .= "
".LAN_FORUM_0057.''.(e_QUERY != 'new' ? ", ".LAN_FORUM_0058."" : ''); -} + //if (USER && vartrue($allread) != TRUE && $total_new_threads && $total_new_threads >= $total_read_threads) + if (USER && !$allread && $total_new_threads && $total_new_threads >= $total_read_threads) + { + $text .= "
".LAN_FORUM_0057.''.(e_QUERY != 'new' ? ", ".LAN_FORUM_0058."" : ''); + } -$forum = new e107forum; -//$trackPref = $forum->prefs->get('track'); -//if (USER && vartrue($trackPref) && e_QUERY != 'track') -if (USER && vartrue($forum->prefs->get('track')) && e_QUERY != 'track') -{ - $text .= "
".LAN_FORUM_0030.''; -} -return $text; -} + $forum = new e107forum; + //$trackPref = $forum->prefs->get('track'); + //if (USER && vartrue($trackPref) && e_QUERY != 'track') + if (USER && vartrue($forum->prefs->get('track')) && e_QUERY != 'track') + { + $text .= "
".LAN_FORUM_0030.''; + } + return $text; + } function sc_foruminfo() { -$sql = e107::getDb(); - -$total_topics = $sql->count("forum_thread", "(*)"); -$total_replies = $sql->count("forum_post", "(*)"); -$total_members = $sql->count("user"); -//----$newest_member = $sql->select("user", "*", "user_ban='0' ORDER BY user_join DESC LIMIT 0,1"); -list($nuser_id, $nuser_name) = $sql->fetch('num'); // FIXME $nuser_id & $user_name return empty even though print_a($newest_member); returns proper result. + $sql = e107::getDb(); + + $total_topics = $sql->count("forum_thread", "(*)"); + $total_replies = $sql->count("forum_post", "(*)"); + $total_members = $sql->count("user"); + //----$newest_member = $sql->select("user", "*", "user_ban='0' ORDER BY user_join DESC LIMIT 0,1"); + list($nuser_id, $nuser_name) = $sql->fetch('num'); // FIXME $nuser_id & $user_name return empty even though print_a($newest_member); returns proper result. + + if(!defined('e_TRACKING_DISABLED')) + { + $member_users = $sql->select("online", "*", "online_location REGEXP('forum.php') AND online_user_id!='0' "); + $guest_users = $sql->select("online", "*", "online_location REGEXP('forum.php') AND online_user_id='0' "); + $users = $member_users+$guest_users; + } + + return str_replace("[x]", ($total_topics+$total_replies), LAN_FORUM_0031)." ($total_topics ".($total_topics == 1 ? LAN_FORUM_0032 : LAN_FORUM_0033).", $total_replies ".($total_replies == 1 ? LAN_FORUM_0034 : LAN_FORUM_0035).") + ".(!defined("e_TRACKING_DISABLED") ? "" : "
".$users." ".($users == 1 ? LAN_FORUM_0059 : LAN_FORUM_0060)." (".$member_users." ".($member_users == 1 ? LAN_FORUM_0061 : LAN_FORUM_0062).", ".$guest_users." ".($guest_users == 1 ? LAN_FORUM_0063 : LAN_FORUM_0064).")
".LAN_FORUM_0066." ".$total_members."
".LAN_FORUM_0065." ".$nuser_name.".\n"); // FIXME cannot find other references to e_TRACKING_DISABLED, use pref? + } -if(!defined('e_TRACKING_DISABLED')) -{ - $member_users = $sql->select("online", "*", "online_location REGEXP('forum.php') AND online_user_id!='0' "); - $guest_users = $sql->select("online", "*", "online_location REGEXP('forum.php') AND online_user_id='0' "); - $users = $member_users+$guest_users; -} -return str_replace("[x]", ($total_topics+$total_replies), LAN_FORUM_0031)." ($total_topics ".($total_topics == 1 ? LAN_FORUM_0032 : LAN_FORUM_0033).", $total_replies ".($total_replies == 1 ? LAN_FORUM_0034 : LAN_FORUM_0035).") -".(!defined("e_TRACKING_DISABLED") ? "" : "
".$users." ".($users == 1 ? LAN_FORUM_0059 : LAN_FORUM_0060)." (".$member_users." ".($member_users == 1 ? LAN_FORUM_0061 : LAN_FORUM_0062).", ".$guest_users." ".($guest_users == 1 ? LAN_FORUM_0063 : LAN_FORUM_0064).")
".LAN_FORUM_0066." ".$total_members."
".LAN_FORUM_0065." ".$nuser_name.".\n"); // FIXME cannot find other references to e_TRACKING_DISABLED, use pref? - } -// END OF $FVARS -// START OF $PVARS function sc_parentstatus() { -//---- return $this->parentstatus; -// if(!check_class($this->fparent['forum_postclass'])) - if(!check_class($this->var['forum_postclass'])) - { - $status = '('.LAN_FORUM_0056.')'; - } - return vartrue($status); + //---- return $this->parentstatus; + // if(!check_class($this->fparent['forum_postclass'])) + if(!check_class($this->var['forum_postclass'])) + { + $status = '('.LAN_FORUM_0056.')'; + } + return vartrue($status); } + function sc_parentname() { -//---- return $this->parentname; -// return $this->fparent['forum_name']; - return $this->var['forum_name']; + return $this->var['forum_name']; } -// END OF $PVARS -// Function to show the retrieval of parent ID, not really needed by core template + + // Function to show the retrieval of parent ID, not really needed by core template function sc_parentid() { -//---- return $this->parentname; -// return $this->fparent['forum_id']; - return $this->var['forum_id']; + return $this->var['forum_id']; } // START OF parse_forum function $FVARS function sc_newflag() { - global $newflag_list; -// $e107 = e107::getInstance(); + global $newflag_list; - if(USER && is_array($newflag_list) && in_array($this->var['forum_id'], $newflag_list)) - { - return "var)."'>".IMAGE_new.''; - } - elseif(empty($this->var['forum_replies']) && defined('IMAGE_noreplies')) - { - return IMAGE_noreplies; - } -//---- else -//---- { + if(USER && is_array($newflag_list) && in_array($this->var['forum_id'], $newflag_list)) + { + + return "var)."'>".IMAGE_new.''; + } + elseif(empty($this->var['forum_replies']) && defined('IMAGE_noreplies')) + { + return IMAGE_noreplies; + } + return IMAGE_nonew; -//---- } -} + + } + function sc_forumname() { -// global $f; -// $tp = e107::getParser(); - if(substr($this->var['forum_name'], 0, 1) == '*') - { - $this->var['forum_name'] = substr($this->var['forum_name'], 1); - } - $this->var['forum_name'] = e107::getParser()->toHTML($this->var['forum_name'], true, 'no_hook'); + // global $f; + // $tp = e107::getParser(); + if(substr($this->var['forum_name'], 0, 1) == '*') + { + $this->var['forum_name'] = substr($this->var['forum_name'], 1); + } + $this->var['forum_name'] = e107::getParser()->toHTML($this->var['forum_name'], true, 'no_hook'); + + $url = e107::url('forum', 'forum', $this->var); + return "{$this->var['forum_name']}"; + + } - $url = e107::url('forum', 'forum', $this->var); - return "{$this->var['forum_name']}"; - } function sc_forumdescription() { -// global $f, $restricted_string; - global $restricted_string; -// $tp = e107::getParser(); - $this->var['forum_description'] = e107::getParser()->toHTML($this->var['forum_description'], true, 'no_hook'); - return $this->var['forum_description'].($restricted_string ? "
$restricted_string" : ""); - } + // global $f, $restricted_string; + global $restricted_string; + // $tp = e107::getParser(); + $this->var['forum_description'] = e107::getParser()->toHTML($this->var['forum_description'], true, 'no_hook'); + return $this->var['forum_description'].($restricted_string ? "
$restricted_string" : ""); + } + function sc_threads() { return $this->var['forum_threads']; } + function sc_replies() { return $this->var['forum_replies']; } + function sc_threadsx() { // global $f; // return "".$f['forum_threads'].""; return "".$this->var['forum_threads'].""; } + function sc_repliesx() { // global $f; // return "".$f['forum_replies'].""; return "".$this->var['forum_replies'].""; } + function sc_forumsubforums() { // VAR_DUMP ($this->ret); // return ($this->ret)?"
".LAN_FORUM_0069.": {$this->ret['text']}
":""; return ($this->var['text'])?"
".LAN_FORUM_0069.": {$this->var['text']}
":""; } + function sc_lastpostuser() { // global $f; @@ -411,7 +427,7 @@ return str_replace("[x]", ($total_topics+$total_replies), LAN_FORUM_0031)." ($to { // $lastpost_name = " $f['user_name'], 'id' => $f['forum_lastpost_user']))."'>{$f['user_name']}"; - $lastpost_name = " $this->var['user_name'], 'id' => $this->var['forum_lastpost_user']))."'>{$this->var['user_name']}"; + $lastpost_name = " $this->var['user_name'], 'id' => $this->var['forum_lastpost_user']))."'>{$this->var['user_name']}"; } //---- else //---- { @@ -482,57 +498,55 @@ $gen = new convert; } function sc_lastpost() { -// global $f; - $e107 = e107::getInstance(); -// $tp = e107::getParser(); -$gen = new convert; -// if ($f['forum_lastpost_info']) - if ($this->var['forum_lastpost_info']) - { -// list($lastpost_datestamp, $lastpost_thread) = explode('.', $f['forum_lastpost_info']); - list($lastpost_datestamp, $lastpost_thread) = explode('.', $this->var['forum_lastpost_info']); -// $lastpost_name = $tp->toHTML($f['forum_lastpost_user_anon']); -// $lastpost_name = e107::getParser()->toHTML($f['forum_lastpost_user_anon']); -// if ($f['user_name']) - $lastpost_name = e107::getParser()->toHTML($this->var['forum_lastpost_user_anon']); - if ($this->var['user_name']) - { + $e107 = e107::getInstance(); + $gen = new convert; -// $lastpost_name = " $f['user_name'], 'id' => $f['forum_lastpost_user']))."'>{$f['user_name']}"; - $lastpost_name = " $this->var['user_name'], 'id' => $this->var['forum_lastpost_user']))."'>{$this->var['user_name']}"; - } -//---- else -//---- { -//---- $lastpost_name = $tp->toHTML($f['forum_lastpost_user_anon']); -//---- } + // if ($f['forum_lastpost_info']) + if ($this->var['forum_lastpost_info']) + { + // list($lastpost_datestamp, $lastpost_thread) = explode('.', $f['forum_lastpost_info']); + list($lastpost_datestamp, $lastpost_thread) = explode('.', $this->var['forum_lastpost_info']); + // $lastpost_name = $tp->toHTML($f['forum_lastpost_user_anon']); + // $lastpost_name = e107::getParser()->toHTML($f['forum_lastpost_user_anon']); + // if ($f['user_name']) + $lastpost_name = e107::getParser()->toHTML($this->var['forum_lastpost_user_anon']); -// $lastpost = $forum->threadGetLastpost($lastpost_thread); //XXX TODO inefficient to have SQL query here. + if ($this->var['user_name']) + { + // $lastpost_name = " $f['user_name'], 'id' => $f['forum_lastpost_user']))."'>{$f['user_name']}"; + $lastpost_name = " $this->var['user_name'], 'id' => $this->var['forum_lastpost_user']))."'>{$this->var['user_name']}"; + } + //---- else + //---- { + //---- $lastpost_name = $tp->toHTML($f['forum_lastpost_user_anon']); + //---- } -// $fVars->LASTPOSTUSER = $lastpost_name; - // {forum_sef}/{thread_id}-{thread_sef} + // $lastpost = $forum->threadGetLastpost($lastpost_thread); //XXX TODO inefficient to have SQL query here. -// $urlData = array('forum_sef'=>$f['forum_sef'], 'thread_id'=>$lastpost['post_thread'],'thread_sef'=>$lastpost['thread_sef']); -// $url = e107::url('forum', 'topic', $urlData)."?last=1#post-".$lastpost['post_id']; -// $fVars->LASTPOSTDATE .= "". $gen->computeLapse($lastpost_datestamp, time(), false, false, 'short').""; - $lastpost_datestamp = $gen->convert_date($lastpost_datestamp, 'forum'); - return $lastpost_datestamp.'
'.$lastpost_name." $lastpost_name, 'id' => $lastpost_thread))."'>".IMAGE_post2.''; + // $fVars->LASTPOSTUSER = $lastpost_name; + // {forum_sef}/{thread_id}-{thread_sef} + + // $urlData = array('forum_sef'=>$f['forum_sef'], 'thread_id'=>$lastpost['post_thread'],'thread_sef'=>$lastpost['thread_sef']); + // $url = e107::url('forum', 'topic', $urlData)."?last=1#post-".$lastpost['post_id']; + // $fVars->LASTPOSTDATE .= "". $gen->computeLapse($lastpost_datestamp, time(), false, false, 'short').""; + $lastpost_datestamp = $gen->convert_date($lastpost_datestamp, 'forum'); + return $lastpost_datestamp.'
'.$lastpost_name." $lastpost_name, 'id' => $lastpost_thread))."'>".IMAGE_post2.''; - } -//---- else -//---- { -// $fVars->LASTPOSTUSER = ""; -// $fVars->LASTPOSTDATE = "-"; + } + //---- else + //---- { + // $fVars->LASTPOSTUSER = ""; + // $fVars->LASTPOSTDATE = "-"; return '-'; -//---- } -} -// END OF parse_forum function $FVARS + //---- } + } + -// START OF $NVARS function sc_startertitle() { // global $thread; -$gen = new convert; + $gen = new convert; $author_name = ($this->var['user_name'] ? $this->var['user_name'] : $this->var['lastuser_anon']); @@ -548,9 +562,10 @@ $gen = new convert; //---- { // $e107 = e107::getInstance(); // return " $thread['thread_lastuser'], 'name' => $sc->author_name))."'>{$sc->author_name}
".$sc->datestamp; - return " $this->var['thread_lastuser'], 'name' => $author_name))."'>{$author_name}
".$datestamp; + return " $this->var['thread_lastuser'], 'name' => $author_name))."'>{$author_name}
".$datestamp; //---- } } + function sc_newspostname() { // global $thread; @@ -559,17 +574,16 @@ $gen = new convert; // return empty($thread)?LAN_FORUM_0029:"".$tp->toHTML($thread['thread_name'], TRUE, 'no_make_clickable, no_hook').''; // Only $this->var???' - return empty($this->var)?LAN_FORUM_0029:"var)."'>".e107::getParser()->toHTML($this->var['thread_name'], TRUE, 'no_make_clickable, no_hook').''; + return empty($this->var)?LAN_FORUM_0029:"var)."'>".e107::getParser()->toHTML($this->var['thread_name'], TRUE, 'no_make_clickable, no_hook').''; } // END OF $NVARS function sc_forum_breadcrumb() { - global $breadarray; -$frm = e107::getForm(); -return $frm->breadcrumb($breadarray); - } + global $breadarray; + $frm = e107::getForm(); + return $frm->breadcrumb($breadarray); + } } -?> \ No newline at end of file From 048ab169dae624416a27972168a12a0b8bdc9509 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 31 May 2016 13:25:43 -0700 Subject: [PATCH 8/9] Note added to $gen->convert() which should be replaced by $tp->toDate() in all plugins. --- e107_handlers/date_handler.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/e107_handlers/date_handler.php b/e107_handlers/date_handler.php index a6065d0bf..0f4365f61 100644 --- a/e107_handlers/date_handler.php +++ b/e107_handlers/date_handler.php @@ -202,6 +202,8 @@ class convert /** + * @deprecated - for internal use only. + * @see $tp->toDate() as a replacement. * Converts between unix timestamp and human-readable date-time OR vice-versa. (auto-detected) * @param string $string unix timestamp OR human-readable date-time. * @param string $mask (optional) long | short | input From 26636f318c60937ae4c289839475dcdbf421cc0e Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 31 May 2016 17:44:07 -0700 Subject: [PATCH 9/9] More inline news editing tweaks. --- e107_handlers/news_class.php | 12 +++++------- e107_plugins/news/templates/news_template.php | 15 +++++++-------- e107_web/css/e107.css | 3 +++ e107_web/js/inline.php | 1 + 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/e107_handlers/news_class.php b/e107_handlers/news_class.php index cd83b0dbd..a46b27869 100644 --- a/e107_handlers/news_class.php +++ b/e107_handlers/news_class.php @@ -382,17 +382,15 @@ class news { 'vars' => 'news_item', 'perms' => '0', 'shortcodes' => array( - 'newstitle' => array('field'=>'news_title', 'type'=>'text', 'container'=>'span'), - 'newsmetadiz' => array('field'=>'news_meta_description','type'=>'text', 'container'=>'div'), - 'newsbody' => array('field'=>'news_body', 'type'=>'html', 'container'=>'div'), + 'news_title' => array('field'=>'news_title', 'type'=>'text', 'container'=>'span'), + 'news_description' => array('field'=>'news_meta_description','type'=>'text', 'container'=>'div'), + 'news_body' => array('field'=>'news_body', 'type'=>'html', 'container'=>'div'), + 'news_summary' => array('field'=>'news_summary', 'type'=>'text', 'container'=>'span'), ) ); - // Aliases - $editable['shortcodes']['newstitlelink'] = $editable['shortcodes']['newstitle']; - $editable['shortcodes']['news_title'] = $editable['shortcodes']['newstitle']; - $editable['shortcodes']['news_body'] = $editable['shortcodes']['newsbody']; + $sc = e107::getScBatch('news') diff --git a/e107_plugins/news/templates/news_template.php b/e107_plugins/news/templates/news_template.php index ef937ca94..1f93c3366 100644 --- a/e107_plugins/news/templates/news_template.php +++ b/e107_plugins/news/templates/news_template.php @@ -35,7 +35,7 @@ $NEWS_TEMPLATE['list']['item'] = '
-

{NEWSTITLELINK}

+

{NEWS_TITLE: link=1}

{NEWS_SUMMARY}

@@ -85,7 +85,7 @@ $NEWS_WRAPPER['default']['item']['NEWSIMAGE: item=1'] = ' -

{NEWSTITLELINK}

+

{NEWS_TITLE: link=1}


@@ -95,11 +95,10 @@ $NEWS_TEMPLATE['default']['item'] = '
{NEWSIMAGE: item=1} -

{NEWS_SUMMARY}

{NEWSVIDEO: item=1}
- {NEWSBODY} + {NEWS_BODY}
{EXTENDED} @@ -125,7 +124,7 @@ $NEWS_WRAPPER['view']['item']['NEWSIMAGE: item=1'] = ' -

{NEWSTITLELINK}

+

{NEWS_TITLE: link=1}


@@ -137,9 +136,9 @@ $NEWS_TEMPLATE['view']['item'] = '
{NEWSIMAGE: item=1} -

{NEWSSUMMARY}

+

{NEWS_SUMMARY}

- {NEWSBODY=body} + {NEWS_BODY=body}
{NEWSVIDEO: item=1} @@ -164,7 +163,7 @@ $NEWS_TEMPLATE['view']['item'] = ' {NEWSVIDEO: item=5}
- {NEWSBODY=extended} + {NEWS_BODY=extended}
diff --git a/e107_web/css/e107.css b/e107_web/css/e107.css index 7f66e062f..4158e4d45 100644 --- a/e107_web/css/e107.css +++ b/e107_web/css/e107.css @@ -328,5 +328,8 @@ img.e-emoticon { vertical-align:middle; border:0; width:24px } .e-editable-front:hover { background-color:#FCF8E3 } .e-editable-front a:hover { background-color:#FCF8E3 } +.e-editable-front:hover:after { content: "\f044"; z-index:10000; position:relative; top:0; right:-5px; margin-right:4px; padding-right:5px; font-family:'FontAwesome'; font-size:0.8em } + + #uiAlert { z-index: 10001 } #uiAlert .alert { z-index:10000; box-shadow:1px 4px 5px rgba(0,0,0,0.4) } \ No newline at end of file diff --git a/e107_web/js/inline.php b/e107_web/js/inline.php index d823429b5..7900fc8af 100644 --- a/e107_web/js/inline.php +++ b/e107_web/js/inline.php @@ -66,6 +66,7 @@ class e107InlineEdit $srch = array("","","[html]","[/html]"); $content = str_replace($srch,'',$content); + $content = trim($content); if($type == 'html') {