diff --git a/e107_admin/newspost.php b/e107_admin/newspost.php index ea20fd17a..c8f587d9c 100644 --- a/e107_admin/newspost.php +++ b/e107_admin/newspost.php @@ -11,9 +11,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_admin/newspost.php,v $ -| $Revision: 1.13 $ -| $Date: 2008-05-18 16:34:16 $ -| $Author: e107coders $ +| $Revision: 1.14 $ +| $Date: 2008-05-31 17:55:22 $ +| $Author: e107steved $ +---------------------------------------------------------------+ */ @@ -399,6 +399,8 @@ class newspost if (e_WYSIWYG) { + if (substr($_POST['data'],-7,7) == '[/html]') $_POST['data'] = substr($_POST['data'],0,-7); + if (substr($_POST['data'],0,6) == '[html]') $_POST['data'] = substr($_POST['data'],6); $_POST['data'] .= "
".NWSLAN_49." ".$submitnews_name.""; $_POST['data'] .= ($submitnews_file)? "

": ""; } @@ -1039,6 +1041,9 @@ class newspost // "; + + + // ##### ADDED FOR NEWS ARCHIVE -------------------------------------------------------------------- // the possible archive values are from "0" to "< $pref['newsposts']" // this should really be made as an onchange event on the selectbox for $pref['newsposts'] ... @@ -1139,19 +1144,24 @@ class newspost - function submitted_news($sub_action, $id) { + function submitted_news($sub_action, $id) + { global $rs, $ns, $tp; $sql2 = new db; $text = "
"; - if ($category_total = $sql2->db_Select("submitnews", "*", "submitnews_id !='' ORDER BY submitnews_id DESC")) { + if ($category_total = $sql2->db_Select("submitnews", "*", "submitnews_id !='' ORDER BY submitnews_id DESC")) + { $text .= ""; - while ($row = $sql2->db_Fetch()) { + while ($row = $sql2->db_Fetch()) + { extract($row); + if (substr($submitnews_item,-7,7) == '[/html]') $submitnews_item = substr($submitnews_item,0,-7); + if (substr($submitnews_item,0,6) == '[html]') $submitnews_item = substr($submitnews_item,6); $text .= "\n"; } $text .= "
ID ".NWSLAN_57." ".LAN_OPTIONS."
$submitnews_id "; @@ -1167,12 +1177,13 @@ class newspost
"; - } else { + } + else + { $text .= "
".NWSLAN_59."
"; } $text .= "
"; $ns->tablerender(NWSLAN_47, $text); - } } diff --git a/e107_plugins/tinymce/wysiwyg.php b/e107_plugins/tinymce/wysiwyg.php index ce1673c7f..269993b48 100644 --- a/e107_plugins/tinymce/wysiwyg.php +++ b/e107_plugins/tinymce/wysiwyg.php @@ -4,9 +4,9 @@ | e107 website system - Tiny MCE controller file. | | $Source: /cvs_backup/e107_0.8/e107_plugins/tinymce/wysiwyg.php,v $ -| $Revision: 1.5 $ -| $Date: 2007-04-12 23:37:21 $ -| $Author: e107coders $ +| $Revision: 1.6 $ +| $Date: 2008-05-31 17:55:31 $ +| $Author: e107steved $ +----------------------------------------------------------------------------+ */ @@ -102,7 +102,7 @@ function tinymce_html_bbcode_control(type, source) { source = source.replace(/^\s*|\s*$/g,''); if(source != '') { - source = '[html]\\n' + source + '\\n[/html]'; + source = '[html]\\n' + source + '\\n[/html]';"; /* source = source.replace(/<\/strong>/gi,'[/b]'); source = source.replace(//gi,'[b]'); @@ -115,7 +115,7 @@ function tinymce_html_bbcode_control(type, source) { source = source.replace(/<\/strong>/gi,'[/b]'); source = source.replace(/(.*?)<\/a>/gi,'[link=$1 $2]$3[/link]'); */ - +$text .= " } // Convert e107 paths. @@ -140,11 +140,12 @@ function tinymce_html_bbcode_control(type, source) { if (html_bbcode_check == '[/html]') { source = source.slice(0, -7); - } + }"; /* source = source.replace(/\[b\]/gi,''); source = source.replace(/\[\/b\]/gi,'<\/strong>'); */ +$text .= " source = source.replace(/\{e_IMAGE\}/gi,'".$IMAGES_DIRECTORY."'); source = source.replace(/\{e_PLUGIN\}/gi,'".$PLUGINS_DIRECTORY."'); diff --git a/submitnews.php b/submitnews.php index 7f353058a..a2cf81dbc 100644 --- a/submitnews.php +++ b/submitnews.php @@ -11,12 +11,15 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/submitnews.php,v $ -| $Revision: 1.5 $ -| $Date: 2007-11-13 07:54:30 $ -| $Author: e107coders $ +| $Revision: 1.6 $ +| $Date: 2008-05-31 17:55:22 $ +| $Author: e107steved $ +----------------------------------------------------------------------------+ */ require_once("class2.php"); + +$e_wysiwyg = varsettrue($pref['subnews_htmlarea']) ? 'e107_submitnews_item' : ''; + require_once(HEADERF); if (!isset($pref['subnews_class'])) @@ -48,7 +51,7 @@ if (isset($_POST['submit'])) exit; } $itemtitle = $tp->toDB($_POST['itemtitle']); - $item = $tp->toDB($_POST['item']); + $item = $tp->toDB($_POST['e107_submitnews_item']); $item = str_replace("src="e107_images", "src="" . SITEURL . "e107_images", $item); // Process File Upload ================================================= if ($_FILES['file_userfile'] && $pref['subnews_attach'] && $pref['upload_enabled'] && check_class($pref['upload_class']) && FILE_UPLOADS) @@ -145,11 +148,11 @@ if (!$sql->db_Select("news_category")) else { $text .= " - "; while (list($cat_id, $cat_name, $cat_icon) = $sql->db_Fetch()) { $sel = ($_POST['cat_id'] == $cat_id) ? "selected='selected'" : ""; - $text .= ""; + $text .= ""; } $text .= ""; } @@ -157,28 +160,28 @@ $text .= " " . LAN_62 . " - + "; -if ($pref['subnews_htmlarea']) + + +if (e_WYSIWYG) { - require_once(e_HANDLER . "tiny_mce/wysiwyg.php"); - echo wysiwyg("item"); + $insertjs = "rows='25' "; } else { -require_once(e_HANDLER."ren_help.php"); + require_once(e_HANDLER."ren_help.php"); + $insertjs = "rows='15' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'"; } -$insertjs = (!$pref['subnews_htmlarea'])?"rows='15' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'" : "rows='25' "; $text .= " - " . LAN_135 . " -
"; +
"; -if (!$pref['subnews_htmlarea']) +if (!e_WYSIWYG) { $text .= display_help("helpb","submitnews"); } @@ -206,24 +209,26 @@ $text .= " "; $ns->tablerender(LAN_136, $text); require_once(FOOTERF); + function headerjs() { - $script = ""; return $script; } -?> \ No newline at end of file +?>