From 2d25da40a0b5fd6cd6c70898b91fcc95cc6c32ac Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 26 Apr 2016 13:08:53 -0700 Subject: [PATCH 1/5] Issue #1585 - default language file addqed. --- e107_plugins/tinymce4/langs/en.js | 179 ++++++++++++++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 e107_plugins/tinymce4/langs/en.js diff --git a/e107_plugins/tinymce4/langs/en.js b/e107_plugins/tinymce4/langs/en.js new file mode 100644 index 000000000..a588b8874 --- /dev/null +++ b/e107_plugins/tinymce4/langs/en.js @@ -0,0 +1,179 @@ +tinymce.addI18n('en_GB',{ +"Cut": "Cut", +"Header 2": "Header 2", +"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.", +"Div": "Div", +"Paste": "Paste", +"Close": "Close", +"Font Family": "Font Family", +"Pre": "Pre", +"Align right": "Align right", +"New document": "New document", +"Blockquote": "Blockquote", +"Numbered list": "Numbered list", +"Increase indent": "Increase indent", +"Formats": "Formats", +"Headers": "Headers", +"Select all": "Select all", +"Header 3": "Header 3", +"Blocks": "Blocks", +"Undo": "Undo", +"Strikethrough": "Strike-through", +"Bullet list": "Bullet list", +"Header 1": "Header 1", +"Superscript": "Superscript", +"Clear formatting": "Clear formatting", +"Font Sizes": "Font Sizes", +"Subscript": "Subscript", +"Header 6": "Header 6", +"Redo": "Redo", +"Paragraph": "Paragraph", +"Ok": "Ok", +"Bold": "Bold", +"Code": "Code", +"Italic": "Italic", +"Align center": "Align centre", +"Header 5": "Header 5", +"Decrease indent": "Decrease indent", +"Header 4": "Header 4", +"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.", +"Underline": "Underline", +"Cancel": "Cancel", +"Justify": "Justify", +"Inline": "Inline", +"Copy": "Copy", +"Align left": "Align left", +"Visual aids": "Visual aids", +"Lower Greek": "Lower Greek", +"Square": "Square", +"Default": "Default", +"Lower Alpha": "Lower Alpha", +"Circle": "Circle", +"Disc": "Disc", +"Upper Alpha": "Upper Alpha", +"Upper Roman": "Upper Roman", +"Lower Roman": "Lower Roman", +"Name": "Name", +"Anchor": "Anchor", +"You have unsaved changes are you sure you want to navigate away?": "You have unsaved changes are you sure you want to navigate away?", +"Restore last draft": "Restore last draft", +"Special character": "Special character", +"Source code": "Source code", +"Right to left": "Right to left", +"Left to right": "Left to right", +"Emoticons": "Emoticons", +"Robots": "Robots", +"Document properties": "Document properties", +"Title": "Title", +"Keywords": "Keywords", +"Encoding": "Encoding", +"Description": "Description", +"Author": "Author", +"Fullscreen": "Full-screen", +"Horizontal line": "Horizontal line", +"Horizontal space": "Horizontal space", +"Insert\/edit image": "Insert\/edit image", +"General": "General", +"Advanced": "Advanced", +"Source": "Source", +"Border": "Border", +"Constrain proportions": "Constrain proportions", +"Vertical space": "Vertical space", +"Image description": "Image description", +"Style": "Style", +"Dimensions": "Dimensions", +"Insert image": "Insert image", +"Insert date\/time": "Insert date\/time", +"Remove link": "Remove link", +"Url": "URL", +"Text to display": "Text to display", +"Anchors": "Anchors", +"Insert link": "Insert link", +"New window": "New window", +"None": "None", +"The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?", +"Target": "Target", +"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?", +"Insert\/edit link": "Insert\/edit link", +"Insert\/edit video": "Insert\/edit video", +"Poster": "Poster", +"Alternative source": "Alternative source", +"Paste your embed code below:": "Paste your embed code below:", +"Insert video": "Insert video", +"Embed": "Embed", +"Nonbreaking space": "Non-breaking space", +"Page break": "Page break", +"Paste as text": "Paste as text", +"Preview": "Preview", +"Print": "Print", +"Save": "Save", +"Could not find the specified string.": "Could not find the specified string.", +"Replace": "Replace", +"Next": "Next", +"Whole words": "Whole words", +"Find and replace": "Find and replace", +"Replace with": "Replace with", +"Find": "Find", +"Replace all": "Replace all", +"Match case": "Match case", +"Prev": "Prev", +"Spellcheck": "Spell-check", +"Finish": "Finish", +"Ignore all": "Ignore all", +"Ignore": "Ignore", +"Insert row before": "Insert row before", +"Rows": "Rows", +"Height": "Height", +"Paste row after": "Paste row after", +"Alignment": "Alignment", +"Column group": "Column group", +"Row": "Row", +"Insert column before": "Insert column before", +"Split cell": "Split cell", +"Cell padding": "Cell padding", +"Cell spacing": "Cell spacing", +"Row type": "Row type", +"Insert table": "Insert table", +"Body": "Body", +"Caption": "Caption", +"Footer": "Footer", +"Delete row": "Delete row", +"Paste row before": "Paste row before", +"Scope": "Scope", +"Delete table": "Delete table", +"Header cell": "Header cell", +"Column": "Column", +"Cell": "Cell", +"Header": "Header", +"Cell type": "Cell type", +"Copy row": "Copy row", +"Row properties": "Row properties", +"Table properties": "Table properties", +"Row group": "Row group", +"Right": "Right", +"Insert column after": "Insert column after", +"Cols": "Cols", +"Insert row after": "Insert row after", +"Width": "Width", +"Cell properties": "Cell properties", +"Left": "Left", +"Cut row": "Cut row", +"Delete column": "Delete column", +"Center": "Centre", +"Merge cells": "Merge cells", +"Insert template": "Insert template", +"Templates": "Templates", +"Background color": "Background colour", +"Text color": "Text colour", +"Show blocks": "Show blocks", +"Show invisible characters": "Show invisible characters", +"Words: {0}": "Words: {0}", +"Insert": "Insert", +"File": "File", +"Edit": "Edit", +"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help", +"Tools": "Tools", +"View": "View", +"Table": "Table", +"Format": "Format" +}); \ No newline at end of file From bbd93f6ac62f0ed9141ba9bab34c227ccffafd67 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 26 Apr 2016 13:14:03 -0700 Subject: [PATCH 2/5] Issue #1588 Possible login-menu fix. --- .../login_menu/login_menu_shortcodes.php | 32 ++++++++++++++----- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/e107_plugins/login_menu/login_menu_shortcodes.php b/e107_plugins/login_menu/login_menu_shortcodes.php index 522bbc604..b8c6ccc1d 100755 --- a/e107_plugins/login_menu/login_menu_shortcodes.php +++ b/e107_plugins/login_menu/login_menu_shortcodes.php @@ -384,31 +384,47 @@ e107::getLanguage()->bcDefs($bcDefs); function sc_lm_plugin_stats($parm='') { global $tp, $menu_pref, $new_total, $LOGIN_MENU_STATITEM, $LM_STATITEM_SEPARATOR; + if(!vartrue($menu_pref['login_menu']['external_stats'])) return ''; + $lbox_infos = login_menu_class::parse_external_list(true, false); + if(!vartrue($lbox_infos['stats'])) return ''; + $lbox_active_sorted = $menu_pref['login_menu']['external_stats'] ? explode(',', $menu_pref['login_menu']['external_stats']) : array(); + $ret = array(); + $sep = varset($LM_STATITEM_SEPARATOR, '
'); - foreach ($lbox_active_sorted as $stackid) { + + foreach ($lbox_active_sorted as $stackid) + { if(!varset($lbox_infos['stats'][$stackid])) continue; - foreach ($lbox_infos['stats'][$stackid] as $lbox_item) { + + foreach ($lbox_infos['stats'][$stackid] as $lbox_item) + { $tmp = array(); - if($lbox_item['stat_new']){ - $tmp['LM_STAT_NEW'] = "return '{$lbox_item['stat_new']}';"; - $tmp['LM_STAT_LABEL'] = $lbox_item["stat_new"] == 1 ? "return '{$lbox_item['stat_item']}';" : "return '{$lbox_item['stat_items']}';"; + if($lbox_item['stat_new']) + { + $tmp['LM_STAT_NEW'] = $lbox_item['stat_new']; + $tmp['LM_STAT_LABEL'] = $lbox_item["stat_new"] == 1 ? $lbox_item['stat_item'] : $lbox_item['stat_items']; $tmp['LM_STAT_EMPTY'] = ''; $new_total += $lbox_item['stat_new']; - } else { + } + else + { //if(empty($lbox_item['stat_nonew'])) continue; $tmp['LM_STAT_NEW'] = ''; $tmp['LM_STAT_LABEL'] = ''; - $tmp['LM_STAT_EMPTY'] = "return '{$lbox_item['stat_nonew']}';"; + $tmp['LM_STAT_EMPTY'] = $lbox_item['stat_nonew']; } - $ret[] = $tp -> parseTemplate($LOGIN_MENU_STATITEM, false, $tmp); + + $ret[] = $tp->parseTemplate($LOGIN_MENU_STATITEM, false, $tmp); } } + return $ret ? implode($sep, $ret) : ''; + } From fdfd60419b6a5bd7b7d4bd295c3d72733a2bd3d9 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 27 Apr 2016 09:09:51 -0700 Subject: [PATCH 3/5] Improved DB-Verify debug information and problem detection. --- e107_admin/update_routines.php | 2 +- e107_handlers/db_verify_class.php | 47 ++++++++++++++++++++----------- 2 files changed, 32 insertions(+), 17 deletions(-) diff --git a/e107_admin/update_routines.php b/e107_admin/update_routines.php index 702eb5d54..9cf809404 100644 --- a/e107_admin/update_routines.php +++ b/e107_admin/update_routines.php @@ -575,7 +575,7 @@ function update_706_to_800($type='') ); // List of DB tables not required (includes a few from 0.6xx) - $obs_tables = array('flood', 'headlines', 'stat_info', 'stat_counter', 'stat_last', 'session', 'preset', 'tinymce'); + $obs_tables = array('flood', 'stat_info', 'stat_counter', 'stat_last', 'session', 'preset', 'tinymce'); // List of DB tables newly required (defined in core_sql.php) (The existing dblog table gets renamed) diff --git a/e107_handlers/db_verify_class.php b/e107_handlers/db_verify_class.php index 68058ab42..63519d029 100644 --- a/e107_handlers/db_verify_class.php +++ b/e107_handlers/db_verify_class.php @@ -28,6 +28,8 @@ class db_verify var $results = array(); var $indices = array(); // array(0) - Issue? var $fixList = array(); + private $currentTable = null; + private $internalError = false; var $fieldTypes = array('time','timestamp','datetime','year','tinyblob','blob', 'mediumblob','longblob','tinytext','mediumtext','longtext','text','date'); @@ -50,11 +52,9 @@ class db_verify function __construct() { - $ns = e107::getRender(); $pref = e107::getPref(); $mes = e107::getMessage(); - $frm = e107::getForm(); - + $this->backUrl = e_SELF; $core_data = file_get_contents(e_CORE.'sql/core_sql.php'); @@ -70,6 +70,7 @@ class db_verify { $id = str_replace('_sql','',$file); $data = file_get_contents($filename); + $this->currentTable = $id; $this->tables[$id] = $this->getTables($data); unset($data); } @@ -112,11 +113,8 @@ class db_verify function runComparison($fileArray) { - - $ns = e107::getRender(); $mes = e107::getMessage(); - $frm = e107::getForm(); - + foreach($fileArray as $tab) { $this->compare($tab); @@ -134,12 +132,18 @@ class db_verify } else { - $mes->addSuccess(DBLAN_111); - $mes->addSuccess("".LAN_BACK.""); + if($this->internalError === false) + { + $mes->addSuccess(DBLAN_111); + $mes->addSuccess("".LAN_BACK.""); + } + + //$debug = "
".print_r($this->results,TRUE)."
"; //$mes->add($debug,E_MESSAGE_DEBUG); //$text .= "
".$frm->admin_button('back', DBVLAN_17, 'back')."
"; - $ns->tablerender("Okay",$mes->render().$text); + echo $mes->render(); + // $ns->tablerender("Okay",$mes->render().$text); } } @@ -194,10 +198,14 @@ class db_verify function compare($selection,$language='') { - + + $this->currentTable = $selection; + if(empty($this->tables[$selection]['tables'])) { - return; + //$this->internalError = true; + e107::getMessage()->addDebug("Couldn't read table data for ".$selection); + return false; } foreach($this->tables[$selection]['tables'] as $key=>$tbl) @@ -207,8 +215,8 @@ class db_verify $rawSqlData = $this->getSqlData($tbl,$language); - - if($rawSqlData === FALSE) + + if($rawSqlData === false) { if($language) continue; @@ -222,6 +230,7 @@ class db_verify // echo "

RAW

"; // print_a($rawSqlData); + // $this->currentTable = $tbl;v $sqlDataArr = $this->getTables($rawSqlData); // echo "

PARSED

"; @@ -736,7 +745,8 @@ class db_verify { if(!$sql_data) { - return; + e107::getMessage()->addError("No SQL Data found in file"); + return false; } $ret = array(); @@ -770,7 +780,11 @@ class db_verify $ret['data'] = $match[2]; $ret['engine'] = $match[4]; - + if(empty($ret['tables'])) + { + e107::getMessage()->addDebug("Unable to parse ".$this->currentTable."_sql.php file data. Possibly missing a ';' at the end?"); + e107::getMessage()->addDebug(print_a($regex,true)); + } return $ret; } @@ -927,6 +941,7 @@ class db_verify else { $mes->addDebug('Failed: '.$qry); + $this->internalError = true; return FALSE; } From dc1c46acc1bb21e99f2a392d4ae1fb8f83afd091 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 27 Apr 2016 14:37:43 -0700 Subject: [PATCH 4/5] Forum Post BC-Fixes. Renamed forum-post shortcodes to avoid name conflicts. --- e107_handlers/shortcode_handler.php | 9 +- e107_plugins/forum/forum_post.php | 244 +++++++++++++++++- .../shortcodes/batch/post_shortcodes.php | 40 +-- .../forum/templates/forum_post_template.php | 242 +---------------- e107_plugins/poll/poll_class.php | 22 +- 5 files changed, 291 insertions(+), 266 deletions(-) diff --git a/e107_handlers/shortcode_handler.php b/e107_handlers/shortcode_handler.php index dd2db5e43..033093973 100644 --- a/e107_handlers/shortcode_handler.php +++ b/e107_handlers/shortcode_handler.php @@ -426,14 +426,11 @@ class e_parse_shortcode } elseif(E107_DBG_BBSC || E107_DBG_SC) { - echo "

Couldn't Find Class '".$className."' in ".$path."

"; + // echo "

Couldn't Find Class '".$className."' in ".$path."

"; + echo "
Couldn't Load: ".$path." with class-name: {$className} and pluginName {$pluginName}
"; } } - elseif(E107_DBG_BBSC || E107_DBG_SC) - { - echo "
Couldn't Load: ".$path." with class-name: {$className} and pluginName {$pluginName}
"; - - } + // TODO - throw exception? return null; diff --git a/e107_plugins/forum/forum_post.php b/e107_plugins/forum/forum_post.php index 2c6d59662..8c048e5b1 100644 --- a/e107_plugins/forum/forum_post.php +++ b/e107_plugins/forum/forum_post.php @@ -353,6 +353,7 @@ class forum_post_handler */ function getTemplate($type = 'post') { + $pref = e107::pref('core'); global $FORUMPOST, $subjectbox, $userbox, $poll_form, $fileattach, $fileattach_alert; // needed for BC. @@ -380,9 +381,217 @@ class forum_post_handler } } + // ----------------- Legacy ------------------------- + + if(!defined("USER_WIDTH")){ define("USER_WIDTH","width:95%"); } + + if(empty($userbox)) + { + $userbox = " + ".LAN_FORUM_3010." + + + + "; + } + + if(empty($subjectbox)) + { + $subjectbox = " + ".LAN_FORUM_3011." + + + + "; + } + + if(empty($fileattach)) + { + $fileattach = " + + ".($pref['image_post'] ? LAN_FORUM_3012 : LAN_FORUM_3013)." + + + ".LAN_FORUM_3014." + ".str_replace(array('[', ']'), array('', ''), LAN_FORUM_3015)."
".LAN_FORUM_3016.": ".vartrue($allowed_filetypes)."
".LAN_FORUM_3017."
".LAN_FORUM_3018.": ".(vartrue($max_upload_size) ? $max_upload_size." ".LAN_FORUM_3019 : ini_get('upload_max_filesize'))." +
+
+ + + +
+ + + + "; + + } + // If the upload directory is not writable, we need to alert the user about this. + if(empty($fileattach_alert)) + { + $fileattach_alert = " + + ".($pref['image_post'] ? LAN_FORUM_3012 : LAN_FORUM_3013)." + + + ".str_replace('[x]', e_FILE."public", LAN_FORUM_3021)." + \n"; + } + // ------------ + + if(empty($FORUMPOST)) + { + $FORUMPOST = " +
+
+ {FORMSTART} + + + + + {USERBOX} + {SUBJECTBOX} + + + + + {POLL} + {FILEATTACH} + + + + +
{BACKLINK} +
{POSTTYPE} + {POSTBOX}
+ {EMAILNOTIFY}
+ {NOEMOTES}
+ {POSTTHREADAS} +
+ {BUTTONS} +
+ {FORMEND} + + + + + +
+ {FORUMJUMP} +
+
+ "; + } + + if(empty($FORUMPOST_REPLY)) + { + $FORUMPOST_REPLY = " +
+
+ {FORMSTART} + + + + + {USERBOX} + {SUBJECTBOX} + + + + + + {POLL} + + {FILEATTACH} + + + + +
{BACKLINK} +
{POSTTYPE} + {POSTBOX}
+ {EMAILNOTIFY}
+ {NOEMOTES}
+ {POSTTHREADAS} +
+ {BUTTONS} +
+ {FORMEND} + + + + + +
+ {FORUMJUMP} +
+
+
+ {THREADTOPIC} + {LATESTPOSTS} +
+ "; + } + + if(empty($LATESTPOSTS_START)) + { + $LATESTPOSTS_START = " + + + + "; + } + + if(empty($LATESTPOSTS_POST)) + { + $LATESTPOSTS_POST = " + + + + + "; + } + + if(empty($LATESTPOSTS_END)) + { + $LATESTPOSTS_END = " +
".str_replace('[y]', "{LATESTPOSTSCOUNT}", LAN_FORUM_3022)."
{POSTER} +
".IMAGE_post2." {THREADDATESTAMP}
+ {POST} +
+ "; + } + + if(empty($THREADTOPIC_REPLY)) + { + $THREADTOPIC_REPLY = " + + + + + + + + +
".LAN_FORUM_1003."
{POSTER} +
".IMAGE_post2." {THREADDATESTAMP}
+ {POST} +
+ "; + } + + + // -------------------------------- End Legacy Code ----------------------------------// + + + + + if($type == 'post') { - return (deftrue('BOOTSTRAP')) ? $FORUM_POST_TEMPLATE : array('form'=>$FORUMPOST); + $template= (deftrue('BOOTSTRAP')) ? $FORUM_POST_TEMPLATE : array('form'=>$FORUMPOST); + // print_a($template); + return $this->upgradeTemplate($template); } else { @@ -408,6 +617,39 @@ class forum_post_handler } + private function upgradeTemplate($template) + { + $arr = array( + 'POSTOPTIONS' => "FORUM_POST_OPTIONS", + 'POSTOPTIONS_LABEL' => "FORUM_POST_OPTIONS_LABEL", + 'POLL' => 'FORUM_POST_POLL', + 'FORUM_AUTHOR' => 'FORUM_POST_AUTHOR', + 'FORUM_SUBJECT' => 'FORUM_POST_SUBJECT', + 'BUTTONS' => 'FORUM_POST_BUTTONS', + 'FORMSTART' => 'FORUM_POST_FORM_START', + 'FORMEND' => 'FORUM_POST_FORM_END', + 'POSTBOX' => 'FORUM_POST_TEXTAREA', + 'EMAILNOTIFY' => 'FORUM_POST_EMAIL_NOTIFY', + 'BACKLINK' => 'FORUM_POST_BREADCRUMB', + 'POSTTYPE' => 'FORUM_POST_TEXTAREA_LABEL' + ); + + foreach($arr as $old => $new) + { + //$template = str_replace("{".$old."}", "{".$new."}", $template); + $reg = '/\{'.$old.'((?:=|:)?[^\}]*)\}/'; // handle variations. + $repl = '{'.$new.'$1}'; + $template = preg_replace($reg,$repl, $template); + + } + + // print_a($template); + + return $template; + + } + + function renderFormMove() { if(!deftrue('MODERATOR')) diff --git a/e107_plugins/forum/shortcodes/batch/post_shortcodes.php b/e107_plugins/forum/shortcodes/batch/post_shortcodes.php index bfe6dfa0b..91df5147a 100644 --- a/e107_plugins/forum/shortcodes/batch/post_shortcodes.php +++ b/e107_plugins/forum/shortcodes/batch/post_shortcodes.php @@ -18,7 +18,7 @@ class plugin_forum_post_shortcodes extends e_shortcode $this->e107 = e107::getInstance(); } - function sc_latestposts($parm) + function sc_latestposts($parm) //TODO move elsewhere? { $parm = ($parm ? $parm : 10); global $LATESTPOSTS_START, $LATESTPOSTS_END, $LATESTPOSTS_POST; @@ -48,12 +48,12 @@ class plugin_forum_post_shortcodes extends e_shortcode return e107::getParser()->parseTemplate($THREADTOPIC_REPLY, true); } - function sc_formstart() + function sc_forum_post_form_start() { return "
"; } - function sc_formend() + function sc_forum_post_form_end() { $frm = e107::getForm(); return $frm->hidden('action',$this->var['action']).$frm->close(); @@ -81,7 +81,7 @@ class plugin_forum_post_shortcodes extends e_shortcode return (USER == false ? $userbox : ''); } - function sc_forum_author() + function sc_forum_post_author() { $opts = array('size' => 'xlarge'); $tp = e107::getParser(); @@ -110,7 +110,7 @@ class plugin_forum_post_shortcodes extends e_shortcode return ($this->var['action'] == 'nt' ? $subjectbox : ''); } - function sc_forum_subject() + function sc_forum_post_subject() { $opts = array('size' => 'xlarge'); @@ -144,12 +144,12 @@ class plugin_forum_post_shortcodes extends e_shortcode } - function sc_posttype() + function sc_forum_post_textarea_label() { return ($this->var['action'] == 'nt' ? LAN_FORUM_2015 : LAN_FORUM_2006); } - function sc_postbox() + function sc_forum_post_textarea() { $tp = e107::getParser(); @@ -181,7 +181,7 @@ class plugin_forum_post_shortcodes extends e_shortcode } - function sc_buttons() + function sc_forum_post_buttons() { $ret = " "; @@ -272,10 +272,10 @@ class plugin_forum_post_shortcodes extends e_shortcode } - function sc_postoptions_label() + function sc_forum_post_options_label() { $type = $this->sc_postthreadas(); - $poll = $this->sc_poll('front'); + $poll = $this->sc_forum_post_poll('front'); $attach = $this->sc_forumattachment(); if(empty($type) && empty($poll) && empty($attach)) @@ -288,10 +288,10 @@ class plugin_forum_post_shortcodes extends e_shortcode - function sc_postoptions($parm='') + function sc_forum_post_options($parm='') { $type = $this->sc_postthreadas(); - $poll = $this->sc_poll('front'); + $poll = $this->sc_forum_post_poll('front'); $attach = $this->sc_forumattachment(); $tabs = array(); @@ -369,7 +369,7 @@ class plugin_forum_post_shortcodes extends e_shortcode } - function sc_poll($parm='') + function sc_forum_post_poll($parm=null) { if(!e107::isInstalled('poll')) @@ -390,11 +390,13 @@ class plugin_forum_post_shortcodes extends e_shortcode return $poll_form; } - - return "".LAN_FORUM_3028." + //BC Code below. + return "".LAN_FORUM_3028." + "; + ".$poll_form."
"; } + return ''; } @@ -416,7 +418,7 @@ class plugin_forum_post_shortcodes extends e_shortcode return ''; } - function sc_backlink() + function sc_forum_post_breadcrumb() { global $forum, $threadInfo, $eaction, $action,$forumInfo; @@ -432,11 +434,11 @@ class plugin_forum_post_shortcodes extends e_shortcode function sc_noemotes() { - if(vartrue($eaction) == true) { return ; } + if(vartrue($eaction) == true) { return null; } return " ".LAN_FORUM_3039.''; } - function sc_emailnotify() + function sc_forum_post_email_notify() { diff --git a/e107_plugins/forum/templates/forum_post_template.php b/e107_plugins/forum/templates/forum_post_template.php index f2d2e5f76..f5e4838a5 100644 --- a/e107_plugins/forum/templates/forum_post_template.php +++ b/e107_plugins/forum/templates/forum_post_template.php @@ -9,264 +9,47 @@ */ if (!defined('e107_INIT')) { exit; } -if(!defined("USER_WIDTH")){ define("USER_WIDTH","width:95%"); } - -// the user box and subject box are not always displayed, therefore we need to define them /in case/ they are, if not they'll be ignored. - -if(!vartrue($userbox)) -{ -$userbox = " -".LAN_FORUM_3010." - - - -"; -} - -if(!vartrue($subjectbox)) -{ -$subjectbox = " -".LAN_FORUM_3011." - - - -"; -} - -// the poll is optional, be careful when changing the values here, only change if you know what you're doing ... -if(!vartrue($poll_form)) -{ - if(is_readable(e_PLUGIN.'poll/poll_class.php')) { - require_once(e_PLUGIN.'poll/poll_class.php'); - $pollo = new poll; - $poll_form = $pollo -> renderPollForm('forum'); - } -} - -// finally, file attach is optional, again only change this if you know what you're doing ... -if(!vartrue($fileattach)) -{ -$fileattach = " - - ".($pref['image_post'] ? LAN_FORUM_3012 : LAN_FORUM_3013)." - - - ".LAN_FORUM_3014." - ".str_replace(array('[', ']'), array('', ''), LAN_FORUM_3015)."
".LAN_FORUM_3016.": ".vartrue($allowed_filetypes)."
".LAN_FORUM_3017."
".LAN_FORUM_3018.": ".(vartrue($max_upload_size) ? $max_upload_size." ".LAN_FORUM_3019 : ini_get('upload_max_filesize'))." -
-
- - - -
- - - -"; -// -// -} -// If the upload directory is not writable, we need to alert the user about this. -if(!vartrue($fileattach_alert)) -{ - $fileattach_alert = " - - ".($pref['image_post'] ? LAN_FORUM_3012 : LAN_FORUM_3013)." - - - ".str_replace('[x]', e_FILE."public", LAN_FORUM_3021)." - \n"; -} -// ------------ - -if(!$FORUMPOST) -{ -$FORUMPOST = " -
-
-{FORMSTART} - - - - -{USERBOX} -{SUBJECTBOX} - - - - -{POLL} -{FILEATTACH} - - - - -
{BACKLINK} -
{POSTTYPE} -{POSTBOX}
-{EMAILNOTIFY}
-{NOEMOTES}
-{POSTTHREADAS} -
-{BUTTONS} -
-{FORMEND} - - - - - -
-{FORUMJUMP} -
-
-"; -} - -if(!vartrue($FORUMPOST_REPLY)) -{ -$FORUMPOST_REPLY = " -
-
-{FORMSTART} - - - - -{USERBOX} -{SUBJECTBOX} - - - - - -{POLL} - -{FILEATTACH} - - - - -
{BACKLINK} -
{POSTTYPE} -{POSTBOX}
-{EMAILNOTIFY}
-{NOEMOTES}
-{POSTTHREADAS} -
-{BUTTONS} -
-{FORMEND} - - - - - -
-{FORUMJUMP} -
-
-
-{THREADTOPIC} -{LATESTPOSTS} -
-"; -} - -if(!vartrue($LATESTPOSTS_START)) -{ -$LATESTPOSTS_START = " - - - -"; -} - -if(!vartrue($LATESTPOSTS_POST)) -{ -$LATESTPOSTS_POST = " - - - - -"; -} - -if(!vartrue($LATESTPOSTS_END)) -{ -$LATESTPOSTS_END = " -
".str_replace('[y]', "{LATESTPOSTSCOUNT}", LAN_FORUM_3022)."
{POSTER} -
".IMAGE_post2." {THREADDATESTAMP}
- {POST} -
-"; -} - -if(!vartrue($THREADTOPIC_REPLY)) -{ -$THREADTOPIC_REPLY = " - - - - - - - - -
".LAN_FORUM_1003."
{POSTER} -
".IMAGE_post2." {THREADDATESTAMP}
- {POST} -
-"; -} - // New in v2.x - requires a bootstrap theme be loaded. - $FORUM_POST_TEMPLATE['form'] = " - {FORMSTART} +$FORUM_POST_TEMPLATE['form'] = " + {FORUM_POST_FORM_START}
-
{BACKLINK}
+
{FORUM_POST_BREADCRUMB}
-
{FORUM_AUTHOR}
+
{FORUM_POST_AUTHOR}
-
{FORUM_SUBJECT}
+
{FORUM_POST_SUBJECT}
- +
- {POSTBOX} - {EMAILNOTIFY} + {FORUM_POST_TEXTAREA} + {FORUM_POST_EMAIL_NOTIFY}
- -
{POSTOPTIONS}
+ +
{FORUM_POST_OPTIONS}
- {BUTTONS} + {FORUM_POST_BUTTONS}
- {FORMEND} + {FORUM_POST_FORM_END} "; -$js = << \ No newline at end of file diff --git a/e107_plugins/poll/poll_class.php b/e107_plugins/poll/poll_class.php index c725f412e..51a4a717c 100644 --- a/e107_plugins/poll/poll_class.php +++ b/e107_plugins/poll/poll_class.php @@ -626,6 +626,8 @@ class poll //XXX New v2.x default for front-end. Currently used by forum-post in bootstrap mode. // TODO LAN - Needs a more generic LAN rewrite when used on another area than forum + + if ($mode == 'front') { @@ -722,22 +724,22 @@ class poll //TODO Hardcoded FORUM code needs to be moved somewhere. - if ($mode == 'forum') + if ($mode == 'forum') // legacy code. { $text = " - ".LAN_FORUM_3029." + ".LAN_FORUM_3029." -
".LAN_FORUM_3030.":
- +
".LAN_FORUM_3030.":
+ "; $option_count = (count(vartrue($_POST['poll_option'])) ? count($_POST['poll_option']) : 1); $text .= " - ".LAN_FORUM_3031." - + ".LAN_FORUM_3031." +
"; for($count = 1; $count <= $option_count; $count++) @@ -758,15 +760,15 @@ class poll - ".LAN_FORUM_3033." - + ".LAN_FORUM_3033." + ".LAN_YES."   ".LAN_NO." - ".LAN_FORUM_3034." - + ".LAN_FORUM_3034." + ".LAN_FORUM_3035."
".LAN_FORUM_3036."
".LAN_FORUM_3037." From 501514b06f104a63d23d48ddd32db99a2cb4a5b7 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 27 Apr 2016 15:25:23 -0700 Subject: [PATCH 5/5] Issue #1585 TinyMce Language fix. --- e107_plugins/tinymce4/wysiwyg.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/e107_plugins/tinymce4/wysiwyg.php b/e107_plugins/tinymce4/wysiwyg.php index 307a633bd..1856fa125 100644 --- a/e107_plugins/tinymce4/wysiwyg.php +++ b/e107_plugins/tinymce4/wysiwyg.php @@ -363,13 +363,15 @@ class wysiwyg $this->configName = $config['@attributes']['name']; + $tinyMceLanguage = $this->tinymce_lang(); + unset($config['@attributes']); $ret = array( 'selector' => '.e-wysiwyg', // 'editor_selector' => 'advancedEditor', - 'language' => $this->tinymce_lang() - + 'language' => $tinyMceLanguage, + 'language_url' => SITEURLBASE.e_PLUGIN_ABS."tinymce4/langs/" . $tinyMceLanguage . ".js" ); // if(e_ADMIN_AREA)