From 277323c81cc87b0ca951d1b67a93748dd876989b Mon Sep 17 00:00:00 2001 From: lia Date: Sat, 13 Jan 2007 22:33:03 +0000 Subject: [PATCH] content: templated admin area, fixed IE7 bug on dropdowns --- e107_plugins/content/admin_content_config.php | 20 +- e107_plugins/content/content_manager.php | 26 +- e107_plugins/content/content_shortcodes.php | 660 ++++- .../content/handlers/content_class.php | 128 +- .../content/handlers/content_db_class.php | 61 +- .../content/handlers/content_form_class.php | 2243 +++++------------ .../templates/content_admin_template.php | 580 +++++ 7 files changed, 2072 insertions(+), 1646 deletions(-) create mode 100644 e107_plugins/content/templates/content_admin_template.php diff --git a/e107_plugins/content/admin_content_config.php b/e107_plugins/content/admin_content_config.php index 8adecdc7e..84519ae87 100644 --- a/e107_plugins/content/admin_content_config.php +++ b/e107_plugins/content/admin_content_config.php @@ -12,9 +12,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/content/admin_content_config.php,v $ -| $Revision: 1.2 $ -| $Date: 2006-12-31 14:46:30 $ -| $Author: e107coders $ +| $Revision: 1.3 $ +| $Date: 2007-01-13 22:33:02 $ +| $Author: lisa_ $ +---------------------------------------------------------------+ */ @@ -24,12 +24,10 @@ if(!getperms("P")){header("location:".e_BASE."index.php"); exit; } $e_sub_cat = 'content'; $e_wysiwyg = "content_text,cat_text"; $plugindir = e_PLUGIN."content/"; +require_once($plugindir."content_shortcodes.php"); -$lan_file = $plugindir.'languages/'.e_LANGUAGE.'/lan_content_admin.php'; -include_once(file_exists($lan_file) ? $lan_file : $plugindir.'languages/English/lan_content_admin.php'); - -$lan_file = $plugindir.'languages/'.e_LANGUAGE.'/lan_content.php'; -include_once(file_exists($lan_file) ? $lan_file : $plugindir.'languages/English/lan_content.php'); +include_lan($plugindir.'languages/'.e_LANGUAGE.'/lan_content_admin.php'); +include_lan($plugindir.'languages/'.e_LANGUAGE.'/lan_content.php'); require_once(e_ADMIN."auth.php"); require_once(e_HANDLER."form_handler.php"); @@ -46,6 +44,12 @@ $fl = new e_file; e107_require_once(e_HANDLER.'arraystorage_class.php'); $eArrayStorage = new ArrayData(); +if(is_readable(e_THEME.$pref['sitetheme']."/content/content_admin_template.php")){ + require_once(e_THEME.$pref['sitetheme']."/content/content_admin_template.php"); +}else{ + require_once(e_PLUGIN."content/templates/content_admin_template.php"); +} + global $tp; $deltest = array_flip($_POST); diff --git a/e107_plugins/content/content_manager.php b/e107_plugins/content/content_manager.php index 9ba9725bb..a2e6824a5 100644 --- a/e107_plugins/content/content_manager.php +++ b/e107_plugins/content/content_manager.php @@ -12,9 +12,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/content/content_manager.php,v $ -| $Revision: 1.2 $ -| $Date: 2006-12-07 12:57:43 $ -| $Author: mrpete $ +| $Revision: 1.3 $ +| $Date: 2007-01-13 22:33:03 $ +| $Author: lisa_ $ +---------------------------------------------------------------+ */ @@ -22,7 +22,6 @@ require_once("../../class2.php"); $plugindir = e_PLUGIN."content/"; require_once($plugindir."content_shortcodes.php"); - global $tp; require_once(e_HANDLER."userclass_class.php"); require_once(e_HANDLER."form_handler.php"); @@ -38,11 +37,14 @@ $adb = new contentdb; require_once($plugindir."handlers/content_form_class.php"); $aform = new contentform; -$lan_file = $plugindir.'languages/'.e_LANGUAGE.'/lan_content_admin.php'; -include_once(file_exists($lan_file) ? $lan_file : $plugindir.'languages/English/lan_content_admin.php'); +include_lan($plugindir.'languages/'.e_LANGUAGE.'/lan_content_admin.php'); +include_lan($plugindir.'languages/'.e_LANGUAGE.'/lan_content.php'); -$lan_file = $plugindir.'languages/'.e_LANGUAGE.'/lan_content.php'; -include_once(file_exists($lan_file) ? $lan_file : $plugindir.'languages/English/lan_content.php'); +if(is_readable(e_THEME.$pref['sitetheme']."/content/content_admin_template.php")){ + require_once(e_THEME.$pref['sitetheme']."/content/content_admin_template.php"); +}else{ + require_once(e_PLUGIN."content/templates/content_admin_template.php"); +} $deltest = array_flip($_POST); @@ -53,11 +55,6 @@ if(e_QUERY){ // define e_pagetitle $aa -> setPageTitle(); -//if(preg_match("#(.*?)_delete_(\d+)#",$deltest[$tp->toJS("delete")],$matches)){ -// $delete = $matches[1]; -// $del_id = $matches[2]; -//} - if(isset($_POST['delete'])){ $tmp = array_pop(array_flip($_POST['delete'])); list($delete, $del_id) = explode("_", $tmp); @@ -161,9 +158,6 @@ if(!e_QUERY){ } } - require_once(FOOTERF); - - ?> \ No newline at end of file diff --git a/e107_plugins/content/content_shortcodes.php b/e107_plugins/content/content_shortcodes.php index 6553f8427..d52142bcf 100644 --- a/e107_plugins/content/content_shortcodes.php +++ b/e107_plugins/content/content_shortcodes.php @@ -1028,5 +1028,663 @@ return $CONTENT_PDF_IMAGES; } SC_END + +//##### ADMIN PAGE -------------------------------------------------- + +SC_BEGIN CONTENT_ID +global $row; +return $row['content_id']; +SC_END + +SC_BEGIN CONTENT_CAT_ICON +global $row, $content_pref, $tp; +$content_cat_icon_path_large = $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]); +//$content_cat_icon_path_small = $tp -> replaceConstants($content_pref["content_cat_icon_path_small"]); +$caticon = $content_cat_icon_path_large.$row['content_icon']; +return ($row['content_icon'] ? "" : " "); +SC_END + +SC_BEGIN CONTENT_ICON +global $CONTENT_ICON; +return $CONTENT_ICON; +SC_END + +SC_BEGIN CONTENT_AUTHOR +global $row, $aa; +$authordetails = $aa -> getAuthor($row['content_author']); +return ($authordetails[0] != "0" ? "".CONTENT_ICON_USER."" : "")." ".$authordetails[1]; +SC_END + +SC_BEGIN CONTENT_HEADING +global $row, $tp; +return $tp->toHTML($row['content_heading'], TRUE, ""); +SC_END + +SC_BEGIN CONTENT_SUBHEADING +global $row, $tp; +$row['content_subheading'] = $tp->toHTML($row['content_subheading'], TRUE, ""); +return ($row['content_subheading'] ? "[".$row['content_subheading']."]" : ""); +SC_END + +SC_BEGIN CONTENT_LINK_ITEM +global $row, $plugindir; +return "".CONTENT_ICON_LINK." "; +SC_END + +SC_BEGIN CONTENT_LINK_CATEGORY +global $row, $plugindir; +return "".CONTENT_ICON_LINK.""; +SC_END + +SC_BEGIN CONTENT_LINK_OPTION +global $row; +return "".CONTENT_ICON_OPTIONS.""; +SC_END + +SC_BEGIN CONTENT_INHERIT +global $row, $content_pref; +return ""; +SC_END + +SC_BEGIN CONTENT_LINK_MANAGER +global $row; +return "".CONTENT_ICON_CONTENTMANAGER_SMALL.""; +SC_END + +SC_BEGIN CONTENT_MANAGER_PRE +global $row, $catarray, $catid; +$pre = ''; +if($row['content_parent'] != "0"){ + for($b=0;$b<(count($catarray[$catid])/2)-1;$b++){ + $pre .= "_"; + } +} +return $pre; +SC_END + +SC_BEGIN CONTENT_ADMIN_HTML_CLASS +global $row; +if($row['content_parent'] == "0"){ + //top level + $class = "forumheader"; +}else{ + //sub level + $class = "forumheader3"; +} +return $class; +SC_END + +SC_BEGIN CONTENT_ADMIN_MANAGER_APPROVE +global $row; +return r_userclass("content_manager_approve", $content_pref["content_manager_approve"], 'off', "public,guest,nobody,member,admin,classes"); +SC_END + +SC_BEGIN CONTENT_ADMIN_MANAGER_PERSONAL +global $row; +return r_userclass("content_manager_personal", $content_pref["content_manager_personal"], 'off', "public,guest,nobody,member,admin,classes"); +SC_END + +SC_BEGIN CONTENT_ADMIN_MANAGER_CATEGORY +global $row; +return r_userclass("content_manager_category", $content_pref["content_manager_category"], 'off', "public,guest,nobody,member,admin,classes"); +SC_END + +SC_BEGIN CONTENT_ORDER +global $row; +return $row['content_order']; +SC_END + +SC_BEGIN CONTENT_ADMIN_CATEGORY +global $CONTENT_ADMIN_CATEGORY; +return $CONTENT_ADMIN_CATEGORY; +SC_END + +SC_BEGIN CONTENT_ADMIN_OPTIONS +global $CONTENT_ADMIN_OPTIONS; +return $CONTENT_ADMIN_OPTIONS; +SC_END + +SC_BEGIN CONTENT_ADMIN_BUTTON +global $CONTENT_ADMIN_BUTTON; +return $CONTENT_ADMIN_BUTTON; +SC_END + +SC_BEGIN CONTENT_ADMIN_SPACER +global $CONTENT_ADMIN_SPACER; +return $CONTENT_ADMIN_SPACER; +SC_END + +SC_BEGIN CONTENT_ADMIN_FORM_TARGET +global $CONTENT_ADMIN_FORM_TARGET; +return $CONTENT_ADMIN_FORM_TARGET; +SC_END + +SC_BEGIN CONTENT_ADMIN_ORDER_SELECT +global $CONTENT_ADMIN_ORDER_SELECT; +return $CONTENT_ADMIN_ORDER_SELECT; +SC_END + +SC_BEGIN CONTENT_ADMIN_ORDER_UPDOWN +global $CONTENT_ADMIN_ORDER_UPDOWN; +return $CONTENT_ADMIN_ORDER_UPDOWN; +SC_END + +SC_BEGIN CONTENT_ADMIN_ORDER_AMOUNT +global $CONTENT_ADMIN_ORDER_AMOUNT; +return $CONTENT_ADMIN_ORDER_AMOUNT; +SC_END + +SC_BEGIN CONTENT_ADMIN_ORDER_CAT +global $CONTENT_ADMIN_ORDER_CAT; +return $CONTENT_ADMIN_ORDER_CAT; +SC_END + +SC_BEGIN CONTENT_ADMIN_ORDER_CATALL +global $CONTENT_ADMIN_ORDER_CATALL; +return $CONTENT_ADMIN_ORDER_CATALL; +SC_END + +SC_BEGIN CONTENT_ADMIN_LETTERINDEX +global $CONTENT_ADMIN_LETTERINDEX; +return $CONTENT_ADMIN_LETTERINDEX; +SC_END + +//##### CONTENT CATEGORY CREATE FORM ------------------------- + +SC_BEGIN CATFORM_CATEGORY +global $CATFORM_CATEGORY; +return $CATFORM_CATEGORY; +SC_END + +SC_BEGIN CATFORM_HEADING +global $row, $rs; +return $rs -> form_text("cat_heading", 90, $row['content_heading'], 250); +SC_END + +SC_BEGIN CATFORM_SUBHEADING +global $row, $rs, $show; +if($show['subheading']===true){ + return $rs -> form_text("cat_subheading", 90, $row['content_subheading'], 250); +} +SC_END + +SC_BEGIN CATFORM_TEXT +global $row, $rs, $show, $pref; +require_once(e_HANDLER."ren_help.php"); +$insertjs = (!$pref['wysiwyg'] ? "onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'" : ""); +$text = $rs -> form_textarea("cat_text", 80, 20, $row['content_text'], $insertjs)."
"; +if (!$pref['wysiwyg']) { $text .= $rs -> form_text("helpb", 90, '', '', "helpbox")."
". display_help("helpb"); } +return $text; +SC_END + +SC_BEGIN CATFORM_DATESTART +global $row, $rs, $show, $months, $ne_day, $ne_month, $ne_year, $current_year; +if($show['startdate']===true){ + $text = " + ".$rs -> form_select_open("ne_day")." + ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_12, 0, "none"); + for($count=1; $count<=31; $count++){ + $text .= $rs -> form_option($count, ($ne_day == $count ? "1" : "0"), $count); + } + $text .= $rs -> form_select_close()." + ".$rs -> form_select_open("ne_month")." + ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_13, 0, "none"); + for($count=1; $count<=12; $count++){ + $text .= $rs -> form_option($months[($count-1)], ($ne_month == $count ? "1" : "0"), $count); + } + $text .= $rs -> form_select_close()." + ".$rs -> form_select_open("ne_year")." + ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_14, 0, "none"); + for($count=($current_year-5); $count<=$current_year; $count++){ + $text .= $rs -> form_option($count, ($ne_year == $count ? "1" : "0"), $count); + } + $text .= $rs -> form_select_close(); + return $text; +} +SC_END + +SC_BEGIN CATFORM_DATEEND +global $row, $rs, $show, $months, $end_day, $end_month, $end_year, $current_year; +if($show['enddate']===true){ + $text = " + ".$rs -> form_select_open("end_day")." + ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_12, 1, "none"); + for($count=1; $count<=31; $count++){ + $text .= $rs -> form_option($count, ($end_day == $count ? "1" : "0"), $count); + } + $text .= $rs -> form_select_close()." + ".$rs -> form_select_open("end_month")." + ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_13, 1, "none"); + for($count=1; $count<=12; $count++){ + $text .= $rs -> form_option($months[($count-1)], ($end_month == $count ? "1" : "0"), $count); + } + $text .= $rs -> form_select_close()." + ".$rs -> form_select_open("end_year")." + ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_14, 1, "none"); + for($count=($current_year-5); $count<=$current_year; $count++){ + $text .= $rs -> form_option($count, ($end_year == $count ? "1" : "0"), $count); + } + $text .= $rs -> form_select_close(); + return $text; +} +SC_END + +SC_BEGIN CATFORM_UPLOAD +global $row, $show, $content_cat_icon_path_large, $content_cat_icon_path_small; +if($show['uploadicon']===true){ + $text=''; + if(!FILE_UPLOADS){ + $text = "".CONTENT_ADMIN_ITEM_LAN_21.""; + }else{ + if(!is_writable($content_cat_icon_path_large)){ + $text = "".CONTENT_ADMIN_ITEM_LAN_22." ".$content_cat_icon_path_large." ".CONTENT_ADMIN_ITEM_LAN_23."
"; + } + $text .= CONTENT_ADMIN_CAT_LAN_62." + + + + "; + } + return $text; +} +SC_END + +SC_BEGIN CATFORM_ICON +global $row, $rs, $show, $fl, $content_cat_icon_path_large; +if($show['selecticon']===true){ + $rejectlist = array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*'); + $iconlist = $fl->get_files($content_cat_icon_path_large,"",$rejectlist); + $text = $rs -> form_text("cat_icon", 60, $row['content_icon'], 100)." + ".$rs -> form_button("button", '', CONTENT_ADMIN_CAT_LAN_8, "onclick=\"expandit('divcaticon')\"")." + "; + return $text; +} +SC_END + +SC_BEGIN CATFORM_COMMENT +global $row, $rs, $show; +if($show['comment']===true){ + return $rs -> form_radio("cat_comment", "1", ($row['content_comment'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85." ".$rs -> form_radio("cat_comment", "0", ($row['content_comment'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86; +} +SC_END + +SC_BEGIN CATFORM_RATING +global $row, $rs, $show; +if($show['rating']===true){ + return $rs -> form_radio("cat_rate", "1", ($row['content_rate'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85." ".$rs -> form_radio("cat_rate", "0", ($row['content_rate'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86; +} +SC_END + +SC_BEGIN CATFORM_PEICON +global $row, $rs, $show; +if($show['pe']===true){ + return $rs -> form_radio("cat_pe", "1", ($row['content_pe'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85." ".$rs -> form_radio("cat_pe", "0", ($row['content_pe'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86; +} +SC_END + +SC_BEGIN CATFORM_VISIBILITY +global $row, $show; +if($show['visibility']===true){ + return r_userclass("cat_class",$row['content_class'], "CLASSES"); +} +SC_END + +//##### CONTENT CREATE FORM ------------------------- + +SC_BEGIN CONTENTFORM_CATEGORYSELECT +global $CONTENTFORM_CATEGORYSELECT; +return $CONTENTFORM_CATEGORYSELECT; +SC_END + +SC_BEGIN CONTENTFORM_CATEGORY +global $CONTENTFORM_CATEGORY; +return $CONTENTFORM_CATEGORY; +SC_END + +SC_BEGIN CONTENTFORM_HEADING +global $row, $rs; +return $rs -> form_text("content_heading", 74, $row['content_heading'], 250); +SC_END + +SC_BEGIN CONTENTFORM_SUBHEADING +global $row, $rs, $show; +if($show['subheading']===true){ + return $rs -> form_text("content_subheading", 74, $row['content_subheading'], 250); +} +SC_END + +SC_BEGIN CONTENTFORM_SUMMARY +global $row, $rs, $show; +if($show['summary']===true){ + return $rs -> form_textarea("content_summary", 74, 5, $row['content_summary']); +} +SC_END + +SC_BEGIN CONTENTFORM_TEXT +global $row, $rs, $tp, $show, $pref; +if(e_WYSIWYG){ + $row['content_text'] = $tp->replaceConstants($row['content_text'], true); +} +require_once(e_HANDLER."ren_help.php"); +$insertjs = (!e_WYSIWYG) ? "onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'": ""; +$text = $rs -> form_textarea("content_text", 74, 20, $row['content_text'], $insertjs)."
"; +if (!$pref['wysiwyg']) { $text .= $rs -> form_text("helpb", 90, '', '', "helpbox")."
".display_help("helpb"); } +return $text; +SC_END + +SC_BEGIN CONTENTFORM_AUTHOR +global $row, $rs, $show, $content_author_name_value, $content_author_name_js, $content_author_email_value, $content_author_email_js, $content_author_id; +$text = " + + +
".CONTENT_ADMIN_ITEM_LAN_14."".$rs -> form_text("content_author_name", 70, $content_author_name_value, 100, "tbox", "", "", $content_author_name_js )."
".CONTENT_ADMIN_ITEM_LAN_15."".$rs -> form_text("content_author_email", 70, $content_author_email_value, 100, "tbox", "", "", $content_author_email_js )." +".$rs -> form_hidden("content_author_id", $content_author_id)." +
"; +return $text; +SC_END + +SC_BEGIN CONTENTFORM_DATESTART +global $row, $rs, $show, $months, $ne_day, $ne_month, $ne_year, $current_year; +if($show['startdate']===true){ + $text = " + ".$rs -> form_select_open("ne_day")." + ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_12, 0, "none"); + for($count=1; $count<=31; $count++){ + $text .= $rs -> form_option($count, (isset($ne_day) && $ne_day == $count ? "1" : "0"), $count); + } + $text .= $rs -> form_select_close()." + ".$rs -> form_select_open("ne_month")." + ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_13, 0, "none"); + for($count=1; $count<=12; $count++){ + $text .= $rs -> form_option($months[($count-1)], (isset($ne_month) && $ne_month == $count ? "1" : "0"), $count); + } + $text .= $rs -> form_select_close()." + ".$rs -> form_select_open("ne_year")." + ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_14, 0, "none"); + for($count=($current_year-5); $count<=($current_year+1); $count++){ + $text .= $rs -> form_option($count, (isset($ne_year) && $ne_year == $count ? "1" : "0"), $count); + } + $text .= $rs -> form_select_close(); + return $text; +} +SC_END + +SC_BEGIN CONTENTFORM_DATEEND +global $row, $rs, $show, $months, $end_day, $end_month, $end_year, $current_year; +if($show['enddate']===true){ + $text = " + ".$rs -> form_select_open("end_day")." + ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_12, 0, "none"); + for($count=1; $count<=31; $count++){ + $text .= $rs -> form_option($count, (isset($end_day) && $end_day == $count ? "1" : "0"), $count); + } + $text .= $rs -> form_select_close()." + ".$rs -> form_select_open("end_month")." + ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_13, 0, "none"); + for($count=1; $count<=12; $count++){ + $text .= $rs -> form_option($months[($count-1)], (isset($end_month) && $end_month == $count ? "1" : "0"), $count); + } + $text .= $rs -> form_select_close()." + ".$rs -> form_select_open("end_year")." + ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_14, 0, "none"); + for($count=($current_year-5); $count<=($current_year+1); $count++){ + $text .= $rs -> form_option($count, (isset($end_year) && $end_year == $count ? "1" : "0"), $count); + } + $text .= $rs -> form_select_close(); + return $text; +} +SC_END + +SC_BEGIN CONTENTFORM_UPLOAD +global $row, $rs, $show, $checkicon, $checkattach, $checkimages, $content_tmppath_icon, $content_tmppath_file, $content_tmppath_image; +if($show['upload']===true){ + $text = ""; + if(!FILE_UPLOADS){ + $text .= "".CONTENT_ADMIN_ITEM_LAN_21.""; + }else{ + if(!is_writable($content_tmppath_icon)){ + $text .= "".CONTENT_ADMIN_ITEM_LAN_22." ".$content_tmppath_icon." ".CONTENT_ADMIN_ITEM_LAN_23."
"; + } + if(!is_writable($content_tmppath_file)){ + $text .= "".CONTENT_ADMIN_ITEM_LAN_22." ".$content_tmppath_file." ".CONTENT_ADMIN_ITEM_LAN_23."
"; + } + if(!is_writable($content_tmppath_image)){ + $text .= "".CONTENT_ADMIN_ITEM_LAN_22." ".$content_tmppath_image." ".CONTENT_ADMIN_ITEM_LAN_23."
"; + } + $text .= "
+ + ".$rs -> form_select_open("uploadtype")." + ".($checkicon ? $rs -> form_option(CONTENT_ADMIN_ITEM_LAN_114, "0", "1") : '')." + ".($checkattach ? $rs -> form_option(CONTENT_ADMIN_ITEM_LAN_115, "0", "2") : '')." + ".($checkimages ? $rs -> form_option(CONTENT_ADMIN_ITEM_LAN_116, "0", "3") : '')." + ".$rs -> form_select_close()." + + + + "; + } + $text .= "
"; + return $text; +} +SC_END + +SC_BEGIN CONTENTFORM_ICON +global $row, $rs, $show, $iconlist; +if($show['icon']===true){ + $text = $rs -> form_text("content_icon", 60, $row['content_icon'], 100)." + ".$rs -> form_button("button", '', CONTENT_ADMIN_ITEM_LAN_105, "onclick=\"expandit('divicon')\"")." + "; + return $text; +} +SC_END + +SC_BEGIN CONTENTFORM_ATTACH +global $row, $rs, $show, $checkattachnumber, $filelist; +if($show['attach']===true){ + + $filetmp = explode("[file]", $row['content_file']); + foreach($filetmp as $key => $value) { + if($value == "") { + unset($filetmp[$key]); + } + } + $attachments = array_values($filetmp); + for($i=0;$i<$checkattachnumber;$i++){ + $k=$i+1; + $num = (strlen($k) == 1 ? "0".$k : $k); + $attachments[$i] = ($attachments[$i] ? $attachments[$i] : ""); + + //choose file + $text .= " +
+ ".$num." ".$rs -> form_text("content_files".$i."", 60, $attachments[$i], 100)." + ".$rs -> form_button("button", '', CONTENT_ADMIN_ITEM_LAN_105, "onclick=\"expandit('divfile".$i."')\"")." +
"; + } + return $text; +} +SC_END + +SC_BEGIN CONTENTFORM_IMAGES +global $row, $rs, $show, $checkimagesnumber, $imagelist; +if($show['images']===true){ + $imagestmp = explode("[img]", $row['content_image']); + foreach($imagestmp as $key => $value) { + if($value == "") { + unset($imagestmp[$key]); + } + } + $imagesarray = array_values($imagestmp); + for($i=0;$i<$checkimagesnumber;$i++){ + $k=$i+1; + $num = (strlen($k) == 1 ? "0".$k : $k); + $imagesarray[$i] = ($imagesarray[$i] ? $imagesarray[$i] : ""); + + //choose image + $text .= " +
+ ".$num." ".$rs -> form_text("content_images".$i."", 60, $imagesarray[$i], 100)." + ".$rs -> form_button("button", '', CONTENT_ADMIN_ITEM_LAN_105, "onclick=\"expandit('divimage".$i."')\"")." +
"; + } + return $text; +} +SC_END + +SC_BEGIN CONTENTFORM_COMMENT +global $row, $rs, $show; +if($show['comment']===true){ + return $rs -> form_radio("content_comment", "1", ($row['content_comment'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85." ".$rs -> form_radio("content_comment", "0", ($row['content_comment'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86; +} +SC_END + +SC_BEGIN CONTENTFORM_RATING +global $row, $rs, $show; +if($show['rating']===true){ + return $rs -> form_radio("content_rate", "1", ($row['content_rate'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85." ".$rs -> form_radio("content_rate", "0", ($row['content_rate'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86; +} +SC_END + +SC_BEGIN CONTENTFORM_PEICON +global $row, $rs, $show; +if($show['pe']===true){ + return $rs -> form_radio("content_pe", "1", ($row['content_pe'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85." ".$rs -> form_radio("content_pe", "0", ($row['content_pe'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86; +} +SC_END + +SC_BEGIN CONTENTFORM_VISIBILITY +global $row, $show; +if($show['visibility']===true){ + return r_userclass("content_class",$row['content_class'], "CLASSES"); +} +SC_END + +SC_BEGIN CONTENTFORM_SCORE +global $row, $rs, $show; +if($show['score']===true){ + $text = $rs -> form_select_open("content_score")." + ".$rs -> form_option(CONTENT_ADMIN_ITEM_LAN_41, 0, "none"); + for($a=1; $a<=100; $a++){ + $text .= $rs -> form_option($a, ($row['content_score'] == $a ? "1" : "0"), $a); + } + $text .= $rs -> form_select_close(); + return $text; +} +SC_END + +SC_BEGIN CONTENTFORM_META +global $row, $rs, $show; +if($show['meta']===true){ + return $rs -> form_text("content_meta", 74, $row['content_meta'], 250); +} +SC_END + +SC_BEGIN CONTENTFORM_LAYOUT +global $row, $rs, $show, $tp, $fl, $content_pref; +if($show['layout']===true){ + + if(!isset($content_pref["content_theme"])){ + $dir = $plugindir."templates/default"; + }else{ + if(is_readable($tp->replaceConstants($content_pref["content_theme"])."content_content_template.php")){ + $dir = $tp->replaceConstants($content_pref["content_theme"]); + }else{ + $dir = $plugindir."templates/default"; + } + } + //get_files($path, $fmask = '', $omit='standard', $recurse_level = 0, $current_level = 0, $dirs_only = FALSE) + $rejectlist = array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*', '.bak'); + $templatelist = $fl->get_files($dir,"content_content",$rejectlist); + + //template + $check = ""; + if(isset($row['content_layout']) && $row['content_layout'] != ""){ + $check = $row['content_layout']; + }else{ + if(isset($content_pref["content_layout"])){ + $check = $content_pref["content_layout"]; + } + } + + $text = $rs -> form_select_open("content_layout")." + ".$rs -> form_option(CONTENT_ADMIN_ITEM_LAN_94, 0, "none"); + foreach($templatelist as $template){ + $templatename = substr($template['fname'], 25, -4); + $templatename = ($template['fname'] == "content_content_template.php" ? "default" : $templatename); + $text .= $rs -> form_option($templatename, ($check == $template['fname'] ? "1" : "0"), $template['fname']); + } + $text .= $rs -> form_select_close(); + return $text; +} +SC_END + +SC_BEGIN CONTENTFORM_CUSTOM +global $CONTENTFORM_CUSTOM; +return $CONTENTFORM_CUSTOM; +SC_END + +SC_BEGIN CONTENTFORM_CUSTOM_KEY +global $CONTENTFORM_CUSTOM_KEY; +return $CONTENTFORM_CUSTOM_KEY; +SC_END + +SC_BEGIN CONTENTFORM_CUSTOM_VALUE +global $CONTENTFORM_CUSTOM_VALUE; +return $CONTENTFORM_CUSTOM_VALUE; +SC_END + +SC_BEGIN CONTENTFORM_PRESET +global $CONTENTFORM_PRESET; +return $CONTENTFORM_PRESET; +SC_END + +SC_BEGIN CONTENTFORM_PRESET_KEY +global $CONTENTFORM_PRESET_KEY; +return $CONTENTFORM_PRESET_KEY; +SC_END + +SC_BEGIN CONTENTFORM_PRESET_VALUE +global $CONTENTFORM_PRESET_VALUE; +return $CONTENTFORM_PRESET_VALUE; +SC_END + */ -?> +?> \ No newline at end of file diff --git a/e107_plugins/content/handlers/content_class.php b/e107_plugins/content/handlers/content_class.php index 006be3eb2..31a70acb2 100644 --- a/e107_plugins/content/handlers/content_class.php +++ b/e107_plugins/content/handlers/content_class.php @@ -12,9 +12,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/content/handlers/content_class.php,v $ -| $Revision: 1.2 $ -| $Date: 2006-12-07 15:41:50 $ -| $Author: sweetas $ +| $Revision: 1.3 $ +| $Date: 2007-01-13 22:33:03 $ +| $Author: lisa_ $ +---------------------------------------------------------------+ */ @@ -838,106 +838,96 @@ class content{ } - - //admin - function ShowOptionCat($currentparent=""){ + //$mode : managecontent, createcontent, category + function ShowOption($currentparent="", $mode=''){ global $qs, $sql, $rs, $plugintable, $tp, $content_pref, $stylespacer; - $string = ""; - if($currentparent == "submit"){ + if( ($mode=='managecontent' || $mode=='createcontent') && $currentparent == "submit"){ $mainparent = $this -> getMainParent( intval($qs[2]) ); $catarray = $this -> getCategoryTree("", intval($mainparent), FALSE); }else{ - $catarray = $this -> getCategoryTree("", "", FALSE); + $catarray = $this -> getCategoryTree("", "", FALSE); } $array = array_keys($catarray); + $string = ""; foreach($array as $catid){ $category_total = $sql -> db_Select($plugintable, "content_id, content_heading, content_parent", "content_id='".intval($catid)."' "); $row = $sql -> db_Fetch(); $pre = ""; - if($row['content_parent'] == "0"){ //main parent level - }else{ //sub level + //sub level + if($row['content_parent'] != "0"){ for($b=0;$b<(count($catarray[$catid])/2)-1;$b++){ $pre .= "  "; } } - $emptystring = "----------------"; + if($row['content_parent'] == 0){ + $name = $row['content_heading']; + $js = "style='font-weight:bold;'"; + }else{ + $js = ""; + $name = $pre.$row['content_heading']; + } - if($qs[0] == "cat"){ - - $js = ""; - $catstring = ""; - $name = $pre.$row['content_heading']; - $selectjs = "if(this.options[this.selectedIndex].value != 'none'){ return document.location=this.options[this.selectedIndex].value; }"; - $label = $catid; - if($row['content_parent'] == 0){ - $name = $row['content_heading']; - $js = "style='font-weight:bold;'"; + if($mode=='managecontent'){ + $checkid = ($currentparent ? $currentparent : ""); + if($qs[0] == 'content' && ($qs[1]=='create' || $qs[1]=='submit') ){ + $value = e_SELF."?content.".$qs[1].".".$catid; + }else{ + $value = e_SELF."?content.".$catid; } + }elseif($mode=='createcontent'){ + if($qs[1] == "create" || $qs[1] == "submit"){ + $checkid = (isset($qs[2]) && is_numeric($qs[2]) ? $qs[2] : ""); + $value = $catid; + }else{ + $checkid = ($currentparent ? $currentparent : ""); + $value = $qs[2].".".$catid; + } + }elseif($mode=='category'){ if($qs[1] == "create"){ $checkid = (isset($qs[2]) && is_numeric($qs[2]) ? $qs[2] : ""); $value = e_SELF."?cat.create.".$catid; - $sel = ($catid == $checkid ? "1" : "0"); }elseif($qs[1] == "edit"){ $checkid = ($currentparent ? $currentparent : ""); $value = e_SELF."?cat.edit.".$qs[2].".".$catid; - $sel = ($catid == $checkid ? "1" : "0"); - } - - //manage items - }elseif($qs[0] == "" || $qs[0] == "content"){ - - $catstring = ""; - $js = ""; - $label = $catid; - $selectjs = "if(this.options[this.selectedIndex].value != 'none'){ return document.location=this.options[this.selectedIndex].value; }"; - $name = $pre.$row['content_heading']; - if($row['content_parent'] == 0){ - $name = $row['content_heading']; - $js = "style='font-weight:bold;'"; - } - if($qs[1] == "create" || $qs[1] == "submit"){ - $checkid = (isset($qs[2]) && is_numeric($qs[2]) ? $qs[2] : ""); - $value = e_SELF."?content.".$qs[1].".".$catid; - $sel = ($catid == $checkid ? "1" : "0"); - }else{ - $checkid = ($currentparent ? $currentparent : ""); - $sel = ($catid == $checkid ? "1" : "0"); - if($qs[1] == "" || is_numeric($qs[1])){ - $value = e_SELF."?content.".$catid; - }else{ - $value = e_SELF."?content.".$qs[1].".".$qs[2].".".$catid; - } } } - $string .= $rs -> form_option($name, $sel, $value, ($label ? "label='".$label."'" : "label='none'")." ".$js ).$catstring; + $sel = ($catid == $checkid ? "1" : "0"); + $string .= $rs -> form_option($name, $sel, $value, $js); } - $selectjs = " onchange=\" document.getElementById('parent').value=this.options[this.selectedIndex].label; ".$selectjs." \""; - $text = $rs -> form_select_open("parent1", $selectjs); - if(!isset($qs[0])){ - $text .= $rs -> form_option(CONTENT_ADMIN_MAIN_LAN_28, "0", "none", "label='none'"); - }elseif( $qs[0] == "content" && $qs[1] == "edit" && is_numeric($qs[2]) ){ - $text .= $rs -> form_option(CONTENT_ADMIN_MAIN_LAN_28, "0", "none", "label='none'"); - }elseif( $qs[0] == "content" && ($qs[1] == "create" || $qs[1] == "submit") ){ - $text .= $rs -> form_option(CONTENT_ADMIN_MAIN_LAN_28, "0", "none", "label='none'"); - }elseif( $qs[0] == "content" && is_numeric($qs[1]) ){ - $text .= $rs -> form_option(CONTENT_ADMIN_MAIN_LAN_28, "0", "none", "label='none'"); - }elseif($qs[0] == "cat" && $qs[1] == "create"){ - $text .= $rs -> form_option(CONTENT_ADMIN_MAIN_LAN_29."  ", (isset($qs[2]) ? "0" : "1"), e_SELF."?cat.create", "label='0' style='font-weight:bold;'"); - }else{ - $text .= $rs -> form_option(CONTENT_ADMIN_MAIN_LAN_29."  ", (isset($qs[2]) ? "0" : "1"), e_SELF."?cat.edit.".$qs[2].".0", "label='0' style='font-weight:bold;'"); + if($mode=='managecontent'){ + $selectjs = " onchange=\" if(this.options[this.selectedIndex].value != 'none'){ return document.location=this.options[this.selectedIndex].value; } \""; + $text = $rs -> form_select_open("parent1", $selectjs); + $text .= $rs -> form_option(CONTENT_ADMIN_MAIN_LAN_28, "0", "none"); + $text .= $string; + $text .= $rs -> form_select_close(); + + }elseif($mode=='createcontent'){ + $redirecturl = e_SELF."?content.".$qs[1]."."; + $selectjs = " onchange=\" if(this.options[this.selectedIndex].value != 'none'){ return document.location='".$redirecturl."'+this.options[this.selectedIndex].value; } \""; + $text = $rs -> form_select_open("parent1", $selectjs); + $text .= $rs -> form_option(CONTENT_ADMIN_MAIN_LAN_28, "0", "none"); + $text .= $string; + $text .= $rs -> form_select_close(); + + }elseif($mode=='category'){ + $selectjs = " onchange=\" if(this.options[this.selectedIndex].value != 'none'){ return document.location=this.options[this.selectedIndex].value; } \""; + $text = $rs -> form_select_open("parent1", $selectjs); + if($qs[1] == "create"){ + $text .= $rs -> form_option(CONTENT_ADMIN_MAIN_LAN_29."  ", (isset($qs[2]) ? "0" : "1"), e_SELF."?cat.create", "style='font-weight:bold;'"); + }else{ + $text .= $rs -> form_option(CONTENT_ADMIN_MAIN_LAN_29."  ", (isset($qs[2]) ? "0" : "1"), e_SELF."?cat.edit.".$qs[2].".0", "style='font-weight:bold;'"); + } + $text .= $string; + $text .= $rs -> form_select_close(); } - $text .= $string; - $text .= $rs -> form_select_close(); - return $text; } - function getOrder(){ global $qs, $content_pref; diff --git a/e107_plugins/content/handlers/content_db_class.php b/e107_plugins/content/handlers/content_db_class.php index 9f9190510..208b4aa60 100644 --- a/e107_plugins/content/handlers/content_db_class.php +++ b/e107_plugins/content/handlers/content_db_class.php @@ -12,8 +12,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/content/handlers/content_db_class.php,v $ -| $Revision: 1.2 $ -| $Date: 2007-01-11 19:12:58 $ +| $Revision: 1.3 $ +| $Date: 2007-01-13 22:33:03 $ | $Author: lisa_ $ +---------------------------------------------------------------+ */ @@ -121,9 +121,29 @@ class contentdb{ } $_POST['content_text'] = $tp -> toDB($_POST['content_text']); - $_POST['parent'] = ($_POST['parent'] ? intval($_POST['parent']) : "0"); $_POST['content_class'] = ($_POST['content_class'] ? intval($_POST['content_class']) : "0"); $_POST['content_meta'] = $tp -> toDB($_POST['content_meta']); + //$_POST['parent'] = ($_POST['parent'] ? intval($_POST['parent']) : "0"); + + //content create + if( isset($qs[0]) && $qs[0]=='content' && isset($qs[1]) && ($qs[1]=='create' || $qs[1]=='submit') && isset($qs[2]) && is_numeric($qs[2]) ){ + $parent = intval($_POST['parent1']); + + //content edit + }elseif( isset($qs[0]) && $qs[0]=='content' && isset($qs[1]) && ($qs[1]=='edit' || $qs[1]=='sa') && isset($qs[2]) && is_numeric($qs[2]) ){ + if( isset($_POST['parent1']) && strpos($_POST['parent1'], ".") ){ + $tmp = explode(".", $_POST['parent1']); + $parent = $tmp[1]; + }else{ + $parent = $_POST['parent1']; + } + } + $_POST['parent'] = $parent; + + + + + if(USER){ if($_POST['content_author_id']){ @@ -322,7 +342,7 @@ class contentdb{ //function dbCategoryUpdate($mode){ function dbCategory($mode){ - global $pref, $sql, $ns, $rs, $aa, $tp, $plugintable, $e107cache, $content_cat_icon_path_large, $content_cat_icon_path_small; + global $pref, $sql, $ns, $rs, $qs, $aa, $tp, $plugintable, $e107cache, $content_cat_icon_path_large, $content_cat_icon_path_small; $_POST['cat_heading'] = $tp -> toDB($_POST['cat_heading']); $_POST['cat_subheading'] = $tp -> toDB($_POST['cat_subheading']); @@ -330,9 +350,40 @@ class contentdb{ $_POST['cat_text'] = $tp->createConstants($_POST['cat_text']); // convert e107_images/ to {e_IMAGE} etc. } $_POST['cat_text'] = $tp -> toDB($_POST['cat_text']); - $_POST['parent'] = ($_POST['parent'] == "0" || $_POST['parent']==$_POST['cat_id'] ? "0" : "0.".intval($_POST['parent'])); $_POST['cat_class'] = ($_POST['cat_class'] ? intval($_POST['cat_class']) : "0"); + //category create + if( isset($qs[0]) && $qs[0]=='cat' && isset($qs[1]) && $qs[1]=='create' ){ + if( isset($qs[2]) && is_numeric($qs[2]) ){ + $parent = intval($qs[2]); + }else{ + $parent = 0; + } + + //category edit + }elseif( isset($qs[0]) && $qs[0]=='cat' && isset($qs[1]) && $qs[1]=='edit' ){ + if( isset($qs[2]) && is_numeric($qs[2]) ){ + + if( isset($qs[3]) && is_numeric($qs[3]) ){ + if(intval($qs[3]) == 0){ + $parent = 0; + }elseif( $qs[2] == $qs[3] ){ + $parent = 0; + }else{ + $parent = "0.".intval($qs[3]); + } + }else{ + if($qs[2]==$_POST['cat_id']){ + $parent = 0; + }else{ + } + } + }else{ + $parent = 0; + } + } + $_POST['parent'] = $parent; + if( isset($_POST['ne_day']) && $_POST['ne_day']!='' && $_POST['ne_day'] != "none" && isset($_POST['ne_month']) && $_POST['ne_month']!='' && $_POST['ne_month'] != "none" && isset($_POST['ne_year']) && $_POST['ne_year']!='' && $_POST['ne_year'] != "none" ){ diff --git a/e107_plugins/content/handlers/content_form_class.php b/e107_plugins/content/handlers/content_form_class.php index e78a716c6..68f572d7b 100644 --- a/e107_plugins/content/handlers/content_form_class.php +++ b/e107_plugins/content/handlers/content_form_class.php @@ -12,9 +12,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/content/handlers/content_form_class.php,v $ -| $Revision: 1.1.1.1 $ -| $Date: 2006-12-02 04:35:05 $ -| $Author: mcfly_e107 $ +| $Revision: 1.2 $ +| $Date: 2007-01-13 22:33:03 $ +| $Author: lisa_ $ +---------------------------------------------------------------+ */ @@ -219,867 +219,555 @@ class contentform{ } function show_create_content($mode, $userid="", $username=""){ - global $qs, $sql, $ns, $rs, $aa, $fl, $tp, $plugintable, $plugindir, $pref, $eArrayStorage; - global $message, $stylespacer, $TOPIC_ROW_SPACER, $TOPIC_ROW, $TOPIC_ROW_NOEXPAND; + global $qs, $sql, $ns, $rs, $aa, $fl, $tp, $content_shortcodes, $content_pref, $plugintable, $plugindir, $pref, $eArrayStorage, $message, $row, $show, $content_author_name_value, $content_author_name_js, $content_author_email_value, $content_author_email_js, $content_author_id, $months, $ne_day, $ne_month, $ne_year, $current_year, $end_day, $end_month, $end_year, $checkicon, $checkattach, $checkimages, $content_tmppath_icon, $content_tmppath_file, $content_tmppath_image, $iconlist, $checkattachnumber, $filelist, $checkimagesnumber, $imagelist, $CONTENTFORM_CATEGORY, $CONTENTFORM_CUSTOM, $CONTENTFORM_CUSTOM_KEY, $CONTENTFORM_CUSTOM_VALUE, $CONTENT_ADMIN_CONTENT_CREATE_CUSTOMSTART, $CONTENT_ADMIN_CONTENT_CREATE_CUSTOMTABLE, $CONTENT_ADMIN_CONTENT_CREATE_CUSTOMEND, $CONTENTFORM_PRESET, $CONTENT_ADMIN_CONTENT_CREATE, $CONTENT_ADMIN_BUTTON; - $months = array(CONTENT_ADMIN_DATE_LAN_0, CONTENT_ADMIN_DATE_LAN_1, CONTENT_ADMIN_DATE_LAN_2, CONTENT_ADMIN_DATE_LAN_3, CONTENT_ADMIN_DATE_LAN_4, CONTENT_ADMIN_DATE_LAN_5, CONTENT_ADMIN_DATE_LAN_6, CONTENT_ADMIN_DATE_LAN_7, CONTENT_ADMIN_DATE_LAN_8, CONTENT_ADMIN_DATE_LAN_9, CONTENT_ADMIN_DATE_LAN_10, CONTENT_ADMIN_DATE_LAN_11); + $months = array(CONTENT_ADMIN_DATE_LAN_0, CONTENT_ADMIN_DATE_LAN_1, CONTENT_ADMIN_DATE_LAN_2, CONTENT_ADMIN_DATE_LAN_3, CONTENT_ADMIN_DATE_LAN_4, CONTENT_ADMIN_DATE_LAN_5, CONTENT_ADMIN_DATE_LAN_6, CONTENT_ADMIN_DATE_LAN_7, CONTENT_ADMIN_DATE_LAN_8, CONTENT_ADMIN_DATE_LAN_9, CONTENT_ADMIN_DATE_LAN_10, CONTENT_ADMIN_DATE_LAN_11); - //if create, first show category select (as preferences need to be loaded from the selected category) - if( $qs[1] == "create" && !isset($qs[2]) ){ - $text = " -
- ".$rs -> form_open("post", e_SELF."?".e_QUERY."", "dataform", "", "enctype='multipart/form-data'")." - - "; + //if create, first show category select (as preferences need to be loaded from the selected category) + if( $qs[1] == "create" && !isset($qs[2]) ){ + //category parent + global $CONTENT_ADMIN_CONTENT_CATSELECT, $CONTENTFORM_CATEGORYSELECT; + $CONTENTFORM_CATEGORYSELECT = $aa -> ShowOption('',"managecontent"); + $text = $tp -> parseTemplate($CONTENT_ADMIN_CONTENT_CATSELECT, FALSE, $content_shortcodes); + $ns -> tablerender(CONTENT_ADMIN_MAIN_LAN_2, $text); + return; + } - $TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_27; - $TOPIC_FIELD = $aa -> ShowOptionCat().$rs->form_hidden("parent", ""); - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); - $text .= "
".CONTENT_ADMIN_MAIN_LAN_2."
"; - $caption = CONTENT_ADMIN_MAIN_LAN_2; - $ns->tablerender($caption, $text); - return; - } + /* + if($mode == 'submit' || $mode=='contentmanager' || ($mode=='sa' && e_PAGE=='content_manager.php') ){ + $border = "border:1px solid #5d6e75;"; + $padding = "padding:6px;"; + $tableprop = "border-collapse: collapse; border-spacing:0px;"; + $TOPIC_ROW_NOEXPAND = " + + {TOPIC_TOPIC} + {TOPIC_FIELD} + "; - if($mode == 'submit' || $mode=='contentmanager' || ($mode=='sa' && e_PAGE=='content_manager.php') ){ - $border = "border:1px solid #5d6e75;"; - $padding = "padding:6px;"; - $tableprop = "border-collapse: collapse; border-spacing:0px;"; - $TOPIC_ROW_NOEXPAND = " - - {TOPIC_TOPIC} - {TOPIC_FIELD} - "; + $TOPIC_ROW = " + + {TOPIC_TOPIC} + + {TOPIC_HEADING} +
+
{TOPIC_HELP}

+ {TOPIC_FIELD} +
+ + "; - $TOPIC_ROW = " - - {TOPIC_TOPIC} - - {TOPIC_HEADING} -
-
{TOPIC_HELP}

- {TOPIC_FIELD} -
- - "; + $TOPIC_TITLE_ROW = "{TOPIC_CAPTION}"; + $TOPIC_ROW_SPACER = ""; + }else{ + $tableprop = ""; + $TOPIC_ROW_SPACER = ""; + } + */ - $TOPIC_TITLE_ROW = "{TOPIC_CAPTION}"; - $TOPIC_ROW_SPACER = ""; - }else{ - $tableprop = ""; - $TOPIC_ROW_SPACER = ""; - } + if($mode == "submit"){ + $mainparent = $aa -> getMainParent( intval($qs[2]) ); + $array = $aa -> getCategoryTree("", $mainparent, FALSE); + }else{ + $array = $aa -> getCategoryTree("", "", FALSE); + $mainparent = $aa -> getMainParent( (isset($qs[3]) && is_numeric($qs[3]) ? $qs[3] : intval($qs[2])) ); + } - if($mode == "submit"){ - $mainparent = $aa -> getMainParent( intval($qs[2]) ); - $array = $aa -> getCategoryTree("", $mainparent, FALSE); - }else{ - $array = $aa -> getCategoryTree("", "", FALSE); - $mainparent = $aa -> getMainParent( (isset($qs[3]) && is_numeric($qs[3]) ? $qs[3] : intval($qs[2])) ); - } - - $content_pref = $aa -> getContentPref($mainparent); - - $content_pref["content_icon_path_tmp"] = ($content_pref["content_icon_path_tmp"] ? $content_pref["content_icon_path_tmp"] : $content_pref["content_icon_path"]."tmp/"); - $content_pref["content_file_path_tmp"] = ($content_pref["content_file_path_tmp"] ? $content_pref["content_file_path_tmp"] : $content_pref["content_file_path"]."tmp/"); - $content_pref["content_image_path_tmp"] = ($content_pref["content_image_path_tmp"] ? $content_pref["content_image_path_tmp"] : $content_pref["content_image_path"]."tmp/"); - $content_cat_icon_path_large = $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]); - $content_cat_icon_path_small = $tp -> replaceConstants($content_pref["content_cat_icon_path_small"]); - $content_icon_path = $tp -> replaceConstants($content_pref["content_icon_path"]); - $content_image_path = $tp -> replaceConstants($content_pref["content_image_path"]); - $content_file_path = $tp -> replaceConstants($content_pref["content_file_path"]); - $content_tmppath_icon = $tp -> replaceConstants($content_pref["content_icon_path_tmp"]); - $content_tmppath_file = $tp -> replaceConstants($content_pref["content_file_path_tmp"]); - $content_tmppath_image = $tp -> replaceConstants($content_pref["content_image_path_tmp"]); + $content_pref = $aa -> getContentPref($mainparent); - if(!is_object($sql)){ $sql = new db; } - $sql2 = new db; - - //check submit permissions - if($mode == 'submit'){ - //check if current item exists (item is a (sub)category) - if($sql -> db_Select($plugintable, "content_id, content_heading, content_parent, content_pref", " content_id='".intval($qs[2])."' ")){ - //check submit perms from main parent - if($content_pref["content_submit"] && check_class($content_pref["content_submit_class"])){ + $content_pref["content_icon_path_tmp"] = ($content_pref["content_icon_path_tmp"] ? $content_pref["content_icon_path_tmp"] : $content_pref["content_icon_path"]."tmp/"); + $content_pref["content_file_path_tmp"] = ($content_pref["content_file_path_tmp"] ? $content_pref["content_file_path_tmp"] : $content_pref["content_file_path"]."tmp/"); + $content_pref["content_image_path_tmp"] = ($content_pref["content_image_path_tmp"] ? $content_pref["content_image_path_tmp"] : $content_pref["content_image_path"]."tmp/"); + $content_cat_icon_path_large = $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]); + $content_cat_icon_path_small = $tp -> replaceConstants($content_pref["content_cat_icon_path_small"]); + $content_icon_path = $tp -> replaceConstants($content_pref["content_icon_path"]); + $content_image_path = $tp -> replaceConstants($content_pref["content_image_path"]); + $content_file_path = $tp -> replaceConstants($content_pref["content_file_path"]); + $content_tmppath_icon = $tp -> replaceConstants($content_pref["content_icon_path_tmp"]); + $content_tmppath_file = $tp -> replaceConstants($content_pref["content_file_path_tmp"]); + $content_tmppath_image = $tp -> replaceConstants($content_pref["content_image_path_tmp"]); + + if(!is_object($sql)){ $sql = new db; } + $sql2 = new db; + + //check submit permissions + if($mode == 'submit'){ + //check if current item exists (item is a (sub)category) + if($sql -> db_Select($plugintable, "content_id, content_heading, content_parent, content_pref", " content_id='".intval($qs[2])."' ")){ + //check submit perms from main parent + if($content_pref["content_submit"] && check_class($content_pref["content_submit_class"])){ + }else{ + header("location:".$plugindir."content_submit.php"); exit; + } + }else{ + header("location:".$plugindir."content_submit.php"); exit; + } + } + + //check manager permissions + if($mode == "contentmanager"){ + //get current item + if($sql -> db_Select($plugintable, "content_id, content_heading, content_parent, content_pref", " content_id='".intval($qs[2])."' ")){ + $rowpcm = $sql -> db_Fetch(); + + //if edit item (query holds item id) + if( isset($qs[1]) && $qs[1] == "edit" && is_numeric($qs[2]) ){ + //get parent + $sql2 -> db_Select($plugintable, "content_id, content_heading, content_parent, content_pref", " content_id='".$rowpcm['content_parent']."' "); + $rowpcm2 = $sql2 -> db_Fetch(); + $pcmcheckpref = $rowpcm2['content_pref']; + $p = $rowpcm['content_parent']; + //create item (query holds category id) + }else{ + $pcmcheckpref = $rowpcm['content_pref']; + $p = $qs[2]; + } + + $pcm_pref = $eArrayStorage->ReadArray($pcmcheckpref); + + //user is allowed to work here + if( (isset($pcm_pref["content_manager_personal"]) && check_class($pcm_pref["content_manager_personal"])) || (isset($pcm_pref["content_manager_category"]) && check_class($pcm_pref["content_manager_category"])) ){ + if($qs[1] == "edit"){ + //if personal manager, assign author query + if( isset($pcm_pref["content_manager_personal"]) && check_class($pcm_pref["content_manager_personal"]) ){ + if(isset($userid) && isset($username) ){ + $userid = intval($userid); + $l = strlen($userid)+1; + $userquery = " AND (content_author = '".$userid."' || LEFT(content_author, ".$l.") = '".$userid."^' OR SUBSTRING_INDEX(content_author, '^', 1) = '".$userid."' || content_author REGEXP '\\\^".$username."' ) "; }else{ - header("location:".$plugindir."content_submit.php"); exit; - } - }else{ - header("location:".$plugindir."content_submit.php"); exit; - } - } - - //check manager permissions - if($mode == "contentmanager"){ - //get current item - if($sql -> db_Select($plugintable, "content_id, content_heading, content_parent, content_pref", " content_id='".intval($qs[2])."' ")){ - $rowpcm = $sql -> db_Fetch(); - - //if edit item (query holds item id) - if( isset($qs[1]) && $qs[1] == "edit" && is_numeric($qs[2]) ){ - //get parent - $sql2 -> db_Select($plugintable, "content_id, content_heading, content_parent, content_pref", " content_id='".$rowpcm['content_parent']."' "); - $rowpcm2 = $sql2 -> db_Fetch(); - $pcmcheckpref = $rowpcm2['content_pref']; - $p = $rowpcm['content_parent']; - //create item (query holds category id) - }else{ - $pcmcheckpref = $rowpcm['content_pref']; - $p = $qs[2]; - } - - $pcm_pref = $eArrayStorage->ReadArray($pcmcheckpref); - - //user is allowed to work here - if( (isset($pcm_pref["content_manager_personal"]) && check_class($pcm_pref["content_manager_personal"])) || (isset($pcm_pref["content_manager_category"]) && check_class($pcm_pref["content_manager_category"])) ){ - if($qs[1] == "edit"){ - //if personal manager, assign author query - if( isset($pcm_pref["content_manager_personal"]) && check_class($pcm_pref["content_manager_personal"]) ){ - if(isset($userid) && isset($username) ){ - $userid = intval($userid); - $l = strlen($userid)+1; - $userquery = " AND (content_author = '".$userid."' || LEFT(content_author, ".$l.") = '".$userid."^' OR SUBSTRING_INDEX(content_author, '^', 1) = '".$userid."' || content_author REGEXP '\\\^".$username."' ) "; - }else{ - $userquery = ""; - } - } - //if category manager, no author query is needed - if( isset($pcm_pref["content_manager_category"]) && check_class($pcm_pref["content_manager_category"]) ){ - $userquery = ""; - } - } - //user is not allowed to work here - }else{ - header("location:".$plugindir."content_manager.php"); exit; + $userquery = ""; } } - - }else{ - $userquery = ""; - } - - //get preferences for submit page - if($mode == "submit"){ - $checksubheading = (isset($content_pref["content_submit_subheading"]) ? $content_pref["content_submit_subheading"] : ""); - $checksummary = (isset($content_pref["content_submit_summary"]) ? $content_pref["content_submit_summary"] : ""); - $checkstartdate = (isset($content_pref["content_submit_startdate"]) ? $content_pref["content_submit_startdate"] : ""); - $checkenddate = (isset($content_pref["content_submit_enddate"]) ? $content_pref["content_submit_enddate"] : ""); - $checkicon = (isset($content_pref["content_submit_icon"]) ? $content_pref["content_submit_icon"] : ""); - $checkattach = (isset($content_pref["content_submit_attach"]) ? $content_pref["content_submit_attach"] : ""); - $checkattachnumber = (isset($content_pref["content_submit_files_number"]) ? $content_pref["content_submit_files_number"] : ""); - $checkimages = (isset($content_pref["content_submit_images"]) ? $content_pref["content_submit_images"] : ""); - $checkimagesnumber = (isset($content_pref["content_submit_images_number"]) ? $content_pref["content_submit_images_number"] : ""); - $checkcomment = (isset($content_pref["content_submit_comment"]) ? $content_pref["content_submit_comment"] : ""); - $checkrating = (isset($content_pref["content_submit_rating"]) ? $content_pref["content_submit_rating"] : ""); - $checkscore = (isset($content_pref["content_submit_score"]) ? $content_pref["content_submit_score"] : ""); - $checkpe = (isset($content_pref["content_submit_pe"]) ? $content_pref["content_submit_pe"] : ""); - $checkvisibility = (isset($content_pref["content_submit_visibility"]) ? $content_pref["content_submit_visibility"] : ""); - $checkmeta = (isset($content_pref["content_submit_meta"]) ? $content_pref["content_submit_meta"] : ""); - $checkcustom = (isset($content_pref["content_submit_customtags"]) ? $content_pref["content_submit_customtags"] : ""); - $checkcustomnumber = (isset($content_pref["content_submit_custom_number"]) ? $content_pref["content_submit_custom_number"] : ""); - $checklayout = (isset($content_pref["content_submit_layout"]) ? $content_pref["content_submit_layout"] : ""); - $checkpreset = (isset($content_pref["content_submit_presettags"]) ? $content_pref["content_submit_presettags"] : ""); - - //get preferences for admin area; posted submitted item. - }elseif($mode == "sa"){ - - //show all preferences from the submit options. if submit pref is not set, check if create prefs are set and use those - $checksubheading = (isset($content_pref["content_submit_subheading"]) ? $content_pref["content_submit_subheading"] : (isset($content_pref["content_admin_subheading"]) ? $content_pref["content_admin_subheading"] : "")); - - $checksummary = (isset($content_pref["content_submit_summary"]) ? $content_pref["content_submit_summary"] : (isset($content_pref["content_admin_summary"]) ? $content_pref["content_admin_summary"] : "")); - - $checkstartdate = (isset($content_pref["content_submit_startdate"]) ? $content_pref["content_submit_startdate"] : (isset($content_pref["content_admin_startdate"]) ? $content_pref["content_admin_startdate"] : "")); - - $checkenddate = (isset($content_pref["content_submit_enddate"]) ? $content_pref["content_submit_enddate"] : (isset($content_pref["content_admin_enddate"]) ? $content_pref["content_admin_enddate"] : "")); - - $checkicon = (isset($content_pref["content_submit_icon"]) ? $content_pref["content_submit_icon"] : (isset($content_pref["content_admin_icon"]) ? $content_pref["content_admin_icon"] : "")); - - $checkattach = (isset($content_pref["content_submit_attach"]) ? $content_pref["content_submit_attach"] : (isset($content_pref["content_admin_attach"]) ? $content_pref["content_admin_attach"] : "")); - - $checkattachnumber = (isset($content_pref["content_submit_files_number"]) ? $content_pref["content_submit_files_number"] : (isset($content_pref["content_admin_files_number"]) ? $content_pref["content_admin_files_number"] : "")); - - $checkimages = (isset($content_pref["content_submit_images"]) ? $content_pref["content_submit_images"] : (isset($content_pref["content_admin_images"]) ? $content_pref["content_admin_images"] : "")); - - $checkimagesnumber = (isset($content_pref["content_submit_images_number"]) ? $content_pref["content_submit_images_number"] : (isset($content_pref["content_admin_images_number"]) ? $content_pref["content_admin_images_number"] : "")); - - $checkcomment = (isset($content_pref["content_submit_comment"]) ? $content_pref["content_submit_comment"] : (isset($content_pref["content_admin_comment"]) ? $content_pref["content_admin_comment"] : "")); - - $checkrating = (isset($content_pref["content_submit_rating"]) ? $content_pref["content_submit_rating"] : (isset($content_pref["content_admin_rating"]) ? $content_pref["content_admin_rating"] : "")); - - $checkscore = (isset($content_pref["content_submit_score"]) ? $content_pref["content_submit_score"] : (isset($content_pref["content_admin_score"]) ? $content_pref["content_admin_score"] : "")); - - $checkpe = (isset($content_pref["content_submit_pe"]) ? $content_pref["content_submit_pe"] : (isset($content_pref["content_admin_pe"]) ? $content_pref["content_admin_pe"] : "")); - - $checkvisibility = (isset($content_pref["content_submit_visibility"]) ? $content_pref["content_submit_visibility"] : (isset($content_pref["content_admin_visibility"]) ? $content_pref["content_admin_visibility"] : "")); - - $checkmeta = (isset($content_pref["content_submit_meta"]) ? $content_pref["content_submit_meta"] : (isset($content_pref["content_admin_meta"]) ? $content_pref["content_admin_meta"] : "")); - - $checkcustom = (isset($content_pref["content_submit_customtags"]) ? $content_pref["content_submit_customtags"] : (isset($content_pref["content_admin_customtags"]) ? $content_pref["content_admin_customtags"] : "")); - - $checkcustomnumber = (isset($content_pref["content_submit_custom_number"]) && $content_pref["content_submit_custom_number"] != "0" ? $content_pref["content_submit_custom_number"] : (isset($content_pref["content_admin_custom_number"]) ? $content_pref["content_admin_custom_number"] : "")); - - $checklayout = (isset($content_pref["content_submit_layout"]) ? $content_pref["content_submit_layout"] : (isset($content_pref["content_admin_layout"]) ? $content_pref["content_admin_layout"] : "")); - - $checkpreset = (isset($content_pref["content_submit_presettags"]) ? $content_pref["content_submit_presettags"] : (isset($content_pref["content_admin_presettags"]) ? $content_pref["content_admin_presettags"] : "")); - - //normal admin content create preferences - }else{ - - $checksubheading = (isset($content_pref["content_admin_subheading"]) ? $content_pref["content_admin_subheading"] : ""); - $checksummary = (isset($content_pref["content_admin_summary"]) ? $content_pref["content_admin_summary"] : ""); - $checkstartdate = (isset($content_pref["content_admin_startdate"]) ? $content_pref["content_admin_startdate"] : ""); - $checkenddate = (isset($content_pref["content_admin_enddate"]) ? $content_pref["content_admin_enddate"] : ""); - $checkicon = (isset($content_pref["content_admin_icon"]) ? $content_pref["content_admin_icon"] : ""); - $checkattach = (isset($content_pref["content_admin_attach"]) ? $content_pref["content_admin_attach"] : ""); - $checkattachnumber = (isset($content_pref["content_admin_files_number"]) ? $content_pref["content_admin_files_number"] : ""); - $checkimages = (isset($content_pref["content_admin_images"]) ? $content_pref["content_admin_images"] : ""); - $checkimagesnumber = (isset($content_pref["content_admin_images_number"]) ? $content_pref["content_admin_images_number"] : ""); - $checkcomment = (isset($content_pref["content_admin_comment"]) ? $content_pref["content_admin_comment"] : ""); - $checkrating = (isset($content_pref["content_admin_rating"]) ? $content_pref["content_admin_rating"] : ""); - $checkscore = (isset($content_pref["content_admin_score"]) ? $content_pref["content_admin_score"] : ""); - $checkpe = (isset($content_pref["content_admin_pe"]) ? $content_pref["content_admin_pe"] : ""); - $checkvisibility = (isset($content_pref["content_admin_visibility"]) ? $content_pref["content_admin_visibility"] : ""); - $checkmeta = (isset($content_pref["content_admin_meta"]) ? $content_pref["content_admin_meta"] : ""); - $checkcustom = (isset($content_pref["content_admin_customtags"]) ? $content_pref["content_admin_customtags"] : ""); - $checkcustomnumber = (isset($content_pref["content_admin_custom_number"]) ? $content_pref["content_admin_custom_number"] : ""); - $checklayout = (isset($content_pref["content_admin_layout"]) ? $content_pref["content_admin_layout"] : ""); - $checkpreset = (isset($content_pref["content_admin_presettags"]) ? $content_pref["content_admin_presettags"] : ""); - } - if($mode == "contentmanager"){ // used in contentmanager - $authordetails = $aa -> getAuthor(USERID); - } - if( !isset($authordetails) ){ - $authordetails = $aa -> getAuthor(USERID); - } - - if( ($qs[1] == "edit" || $qs[1] == "sa") && is_numeric($qs[2]) && !isset($_POST['preview_content']) && !isset($message)){ - if(!$sql -> db_Select($plugintable, "*", "content_id='".intval($qs[2])."' ".$userquery." ")){ - if($mode == "contentmanager"){ - header("location:".$plugindir."content_manager.php"); exit; - }else{ - header("location:".e_SELF."?content"); exit; - } - }else{ - $row = $sql -> db_Fetch(); - - $row['content_heading'] = $tp -> toForm($row['content_heading']); - $row['content_subheading'] = $tp -> toForm($row['content_subheading']); - $row['content_summary'] = $tp -> toForm($row['content_summary']); - $row['content_text'] = $tp -> toForm($row['content_text']); - $row['content_meta'] = $tp -> toForm($row['content_meta']); - $authordetails = $aa -> getAuthor($row['content_author']); + //if category manager, no author query is needed + if( isset($pcm_pref["content_manager_category"]) && check_class($pcm_pref["content_manager_category"]) ){ + $userquery = ""; } } + //user is not allowed to work here + }else{ + header("location:".$plugindir."content_manager.php"); exit; + } + } - if(isset($_POST['preview_content'])){ - $this -> ContentItemPreview(); - } + }else{ + $userquery = ""; + } - //re-prepare the posted fields for the form (after preview) - if( isset($_POST['preview_content']) || isset($message) ){ + //get preferences for submit page + if($mode == "submit"){ + $checksubheading = (isset($content_pref["content_submit_subheading"]) ? $content_pref["content_submit_subheading"] : ""); + $checksummary = (isset($content_pref["content_submit_summary"]) ? $content_pref["content_submit_summary"] : ""); + $checkstartdate = (isset($content_pref["content_submit_startdate"]) ? $content_pref["content_submit_startdate"] : ""); + $checkenddate = (isset($content_pref["content_submit_enddate"]) ? $content_pref["content_submit_enddate"] : ""); + $checkicon = (isset($content_pref["content_submit_icon"]) ? $content_pref["content_submit_icon"] : ""); + $checkattach = (isset($content_pref["content_submit_attach"]) ? $content_pref["content_submit_attach"] : ""); + $checkattachnumber = (isset($content_pref["content_submit_files_number"]) ? $content_pref["content_submit_files_number"] : ""); + $checkimages = (isset($content_pref["content_submit_images"]) ? $content_pref["content_submit_images"] : ""); + $checkimagesnumber = (isset($content_pref["content_submit_images_number"]) ? $content_pref["content_submit_images_number"] : ""); + $checkcomment = (isset($content_pref["content_submit_comment"]) ? $content_pref["content_submit_comment"] : ""); + $checkrating = (isset($content_pref["content_submit_rating"]) ? $content_pref["content_submit_rating"] : ""); + $checkscore = (isset($content_pref["content_submit_score"]) ? $content_pref["content_submit_score"] : ""); + $checkpe = (isset($content_pref["content_submit_pe"]) ? $content_pref["content_submit_pe"] : ""); + $checkvisibility = (isset($content_pref["content_submit_visibility"]) ? $content_pref["content_submit_visibility"] : ""); + $checkmeta = (isset($content_pref["content_submit_meta"]) ? $content_pref["content_submit_meta"] : ""); + $checkcustom = (isset($content_pref["content_submit_customtags"]) ? $content_pref["content_submit_customtags"] : ""); + $checkcustomnumber = (isset($content_pref["content_submit_custom_number"]) ? $content_pref["content_submit_custom_number"] : ""); + $checklayout = (isset($content_pref["content_submit_layout"]) ? $content_pref["content_submit_layout"] : ""); + $checkpreset = (isset($content_pref["content_submit_presettags"]) ? $content_pref["content_submit_presettags"] : ""); + + //get preferences for admin area; posted submitted item. + }elseif($mode == "sa"){ - $row['content_parent'] = $_POST['parent']; - $row['content_heading'] = $tp -> post_toForm($_POST['content_heading']); - $row['content_subheading'] = $tp -> post_toForm($_POST['content_subheading']); - $row['content_summary'] = $tp -> post_toForm($_POST['content_summary']); - $row['content_text'] = $tp -> post_toForm($_POST['content_text']); - $authordetails[0] = $_POST['content_author_id']; - $authordetails[1] = $_POST['content_author_name']; - $authordetails[2] = $_POST['content_author_email']; - $ne_day = $_POST['ne_day']; - $ne_month = $_POST['ne_month']; - $ne_year = $_POST['ne_year']; - $end_day = $_POST['end_day']; - $end_month = $_POST['end_month']; - $end_year = $_POST['end_year']; - $row['content_comment'] = $_POST['content_comment']; - $row['content_rate'] = $_POST['content_rate']; - $row['content_pe'] = $_POST['content_pe']; - $row['content_class'] = $_POST['content_class']; - $row['content_refer'] = $_POST['content_refer']; - $row['content_datestamp'] = $_POST['content_datestamp']; - $row['content_score'] = $_POST['content_score']; - $row['content_meta'] = $_POST['content_meta']; - $row['content_layout'] = $_POST['content_layout']; - $row['content_icon'] = $_POST['content_icon']; + //show all preferences from the submit options. if submit pref is not set, check if create prefs are set and use those + $checksubheading = (isset($content_pref["content_submit_subheading"]) ? $content_pref["content_submit_subheading"] : (isset($content_pref["content_admin_subheading"]) ? $content_pref["content_admin_subheading"] : "")); - //images and attachments - foreach($_POST as $k => $v){ - if(strpos($k, "content_files") === 0){ - $row['content_file'] .= "[file]".$v; - } - if(strpos($k, "content_images") === 0){ - $row['content_image'] .= "[img]".$v; - } - } - //custom tags - for($i=0;$i<$content_pref["content_admin_custom_number"];$i++){ - $keystring = $tp -> post_toForm($_POST["content_custom_key_{$i}"]); - $custom["content_custom_{$keystring}"] = $tp -> post_toForm($_POST["content_custom_value_{$i}"]); - } - //preset tags - foreach($_POST['content_custom_preset_key'] as $k => $v){ - $k = $tp -> post_toForm($k); - $custom['content_custom_presettags'][$k] = $tp -> post_toForm($v); - } - } + $checksummary = (isset($content_pref["content_submit_summary"]) ? $content_pref["content_submit_summary"] : (isset($content_pref["content_admin_summary"]) ? $content_pref["content_admin_summary"] : "")); - $content_author_id = (isset($authordetails[0]) && $authordetails[0] != "" ? $authordetails[0] : USERID); - $content_author_name = (isset($authordetails[1]) && $authordetails[1] != "" ? $authordetails[1] : USERNAME); - $content_author_email = (isset($authordetails[2]) ? $authordetails[2] : USEREMAIL); + $checkstartdate = (isset($content_pref["content_submit_startdate"]) ? $content_pref["content_submit_startdate"] : (isset($content_pref["content_admin_startdate"]) ? $content_pref["content_admin_startdate"] : "")); + + $checkenddate = (isset($content_pref["content_submit_enddate"]) ? $content_pref["content_submit_enddate"] : (isset($content_pref["content_admin_enddate"]) ? $content_pref["content_admin_enddate"] : "")); + + $checkicon = (isset($content_pref["content_submit_icon"]) ? $content_pref["content_submit_icon"] : (isset($content_pref["content_admin_icon"]) ? $content_pref["content_admin_icon"] : "")); + + $checkattach = (isset($content_pref["content_submit_attach"]) ? $content_pref["content_submit_attach"] : (isset($content_pref["content_admin_attach"]) ? $content_pref["content_admin_attach"] : "")); + + $checkattachnumber = (isset($content_pref["content_submit_files_number"]) ? $content_pref["content_submit_files_number"] : (isset($content_pref["content_admin_files_number"]) ? $content_pref["content_admin_files_number"] : "")); + + $checkimages = (isset($content_pref["content_submit_images"]) ? $content_pref["content_submit_images"] : (isset($content_pref["content_admin_images"]) ? $content_pref["content_admin_images"] : "")); + + $checkimagesnumber = (isset($content_pref["content_submit_images_number"]) ? $content_pref["content_submit_images_number"] : (isset($content_pref["content_admin_images_number"]) ? $content_pref["content_admin_images_number"] : "")); + + $checkcomment = (isset($content_pref["content_submit_comment"]) ? $content_pref["content_submit_comment"] : (isset($content_pref["content_admin_comment"]) ? $content_pref["content_admin_comment"] : "")); + + $checkrating = (isset($content_pref["content_submit_rating"]) ? $content_pref["content_submit_rating"] : (isset($content_pref["content_admin_rating"]) ? $content_pref["content_admin_rating"] : "")); + + $checkscore = (isset($content_pref["content_submit_score"]) ? $content_pref["content_submit_score"] : (isset($content_pref["content_admin_score"]) ? $content_pref["content_admin_score"] : "")); + + $checkpe = (isset($content_pref["content_submit_pe"]) ? $content_pref["content_submit_pe"] : (isset($content_pref["content_admin_pe"]) ? $content_pref["content_admin_pe"] : "")); + + $checkvisibility = (isset($content_pref["content_submit_visibility"]) ? $content_pref["content_submit_visibility"] : (isset($content_pref["content_admin_visibility"]) ? $content_pref["content_admin_visibility"] : "")); + + $checkmeta = (isset($content_pref["content_submit_meta"]) ? $content_pref["content_submit_meta"] : (isset($content_pref["content_admin_meta"]) ? $content_pref["content_admin_meta"] : "")); + + $checkcustom = (isset($content_pref["content_submit_customtags"]) ? $content_pref["content_submit_customtags"] : (isset($content_pref["content_admin_customtags"]) ? $content_pref["content_admin_customtags"] : "")); + + $checkcustomnumber = (isset($content_pref["content_submit_custom_number"]) && $content_pref["content_submit_custom_number"] != "0" ? $content_pref["content_submit_custom_number"] : (isset($content_pref["content_admin_custom_number"]) ? $content_pref["content_admin_custom_number"] : "")); + + $checklayout = (isset($content_pref["content_submit_layout"]) ? $content_pref["content_submit_layout"] : (isset($content_pref["content_admin_layout"]) ? $content_pref["content_admin_layout"] : "")); - $formurl = e_SELF."?".e_QUERY; - $text = " -
- ".$rs -> form_open("post", $formurl, "dataform", "", "enctype='multipart/form-data'")." - "; + $checkpreset = (isset($content_pref["content_submit_presettags"]) ? $content_pref["content_submit_presettags"] : (isset($content_pref["content_admin_presettags"]) ? $content_pref["content_admin_presettags"] : "")); - $hidden = ""; - if($mode == "contentmanager"){ - if($qs[1] == "edit"){ - $hidden .= $rs -> form_hidden("parent", $row['content_parent']); - }else{ - $hidden .= $rs -> form_hidden("parent", intval($qs[2])); - } - }else{ - if($mode == "submit"){ - $parent = "submit"; - }else{ - $parent = (isset($qs[3]) && is_numeric($qs[3]) ? $qs[3] : (isset($row['content_parent']) ? $row['content_parent'] : "") ); - } - //category parent - $TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_27; - $TOPIC_FIELD = $aa -> ShowOptionCat($parent).$rs->form_hidden("parent", ""); - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); - //$text .= $TOPIC_ROW_SPACER; - } + //normal admin content create preferences + }else{ - //heading - $row['content_heading'] = (isset($row['content_heading']) ? $row['content_heading'] : ""); - $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_11; - $TOPIC_FIELD = $rs -> form_text("content_heading", 74, $row['content_heading'], 250); - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + $checksubheading = (isset($content_pref["content_admin_subheading"]) ? $content_pref["content_admin_subheading"] : ""); + $checksummary = (isset($content_pref["content_admin_summary"]) ? $content_pref["content_admin_summary"] : ""); + $checkstartdate = (isset($content_pref["content_admin_startdate"]) ? $content_pref["content_admin_startdate"] : ""); + $checkenddate = (isset($content_pref["content_admin_enddate"]) ? $content_pref["content_admin_enddate"] : ""); + $checkicon = (isset($content_pref["content_admin_icon"]) ? $content_pref["content_admin_icon"] : ""); + $checkattach = (isset($content_pref["content_admin_attach"]) ? $content_pref["content_admin_attach"] : ""); + $checkattachnumber = (isset($content_pref["content_admin_files_number"]) ? $content_pref["content_admin_files_number"] : ""); + $checkimages = (isset($content_pref["content_admin_images"]) ? $content_pref["content_admin_images"] : ""); + $checkimagesnumber = (isset($content_pref["content_admin_images_number"]) ? $content_pref["content_admin_images_number"] : ""); + $checkcomment = (isset($content_pref["content_admin_comment"]) ? $content_pref["content_admin_comment"] : ""); + $checkrating = (isset($content_pref["content_admin_rating"]) ? $content_pref["content_admin_rating"] : ""); + $checkscore = (isset($content_pref["content_admin_score"]) ? $content_pref["content_admin_score"] : ""); + $checkpe = (isset($content_pref["content_admin_pe"]) ? $content_pref["content_admin_pe"] : ""); + $checkvisibility = (isset($content_pref["content_admin_visibility"]) ? $content_pref["content_admin_visibility"] : ""); + $checkmeta = (isset($content_pref["content_admin_meta"]) ? $content_pref["content_admin_meta"] : ""); + $checkcustom = (isset($content_pref["content_admin_customtags"]) ? $content_pref["content_admin_customtags"] : ""); + $checkcustomnumber = (isset($content_pref["content_admin_custom_number"]) ? $content_pref["content_admin_custom_number"] : ""); + $checklayout = (isset($content_pref["content_admin_layout"]) ? $content_pref["content_admin_layout"] : ""); + $checkpreset = (isset($content_pref["content_admin_presettags"]) ? $content_pref["content_admin_presettags"] : ""); + } + if($mode == "contentmanager"){ // used in contentmanager + $authordetails = $aa -> getAuthor(USERID); + } + if( !isset($authordetails) ){ + $authordetails = $aa -> getAuthor(USERID); + } - if($checksubheading){ - //subheading - $row['content_subheading'] = (isset($row['content_subheading']) ? $row['content_subheading'] : ""); - $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_16; - $TOPIC_FIELD = $rs -> form_text("content_subheading", 74, $row['content_subheading'], 250); - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); - }else{ - $hidden .= $rs -> form_hidden("content_subheading", $row['content_subheading']); - } - - if($checksummary){ - //summary - $row['content_summary'] = (isset($row['content_summary']) ? $row['content_summary'] : ""); - $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_17; - $TOPIC_FIELD = $rs -> form_textarea("content_summary", 74, 5, $row['content_summary']); - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); - }else{ - $hidden .= $rs -> form_hidden("content_summary", $row['content_summary']); - } + if( ($qs[1] == "edit" || $qs[1] == "sa") && is_numeric($qs[2]) && !isset($_POST['preview_content']) && !isset($message)){ + if(!$sql -> db_Select($plugintable, "*", "content_id='".intval($qs[2])."' ".$userquery." ")){ + if($mode == "contentmanager"){ + header("location:".$plugindir."content_manager.php"); exit; + }else{ + header("location:".e_SELF."?content"); exit; + } + }else{ + $row = $sql -> db_Fetch(); - //text - if(e_WYSIWYG){ - $row['content_text'] = $tp->replaceConstants($row['content_text'], true); - } - require_once(e_HANDLER."ren_help.php"); - $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_18; - $insertjs = (!e_WYSIWYG) ? "onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'": ""; - $TOPIC_FIELD = $rs -> form_textarea("content_text", 74, 20, $row['content_text'], $insertjs)."
"; - if (!$pref['wysiwyg']) { $TOPIC_FIELD .= $rs -> form_text("helpb", 90, '', '', "helpbox")."
".display_help("helpb"); } - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + $row['content_heading'] = $tp -> toForm($row['content_heading']); + $row['content_subheading'] = $tp -> toForm($row['content_subheading']); + $row['content_summary'] = $tp -> toForm($row['content_summary']); + $row['content_text'] = $tp -> toForm($row['content_text']); + $row['content_meta'] = $tp -> toForm($row['content_meta']); + $authordetails = $aa -> getAuthor($row['content_author']); + } + } - //author - $content_author_name_value = ($content_author_name ? $content_author_name : CONTENT_ADMIN_ITEM_LAN_14); - $content_author_name_js = ($content_author_name ? "" : "onfocus=\"if(document.getElementById('dataform').content_author_name.value=='".CONTENT_ADMIN_ITEM_LAN_14."'){document.getElementById('dataform').content_author_name.value='';}\""); - $content_author_email_value = ($content_author_email ? $content_author_email : CONTENT_ADMIN_ITEM_LAN_15); - $content_author_email_js = ($content_author_email ? "" : "onfocus=\"if(document.getElementById('dataform').content_author_email.value=='".CONTENT_ADMIN_ITEM_LAN_15."'){document.getElementById('dataform').content_author_email.value='';}\""); + if(isset($_POST['preview_content'])){ + $this -> ContentItemPreview(); + } - $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_51; - $TOPIC_FIELD = "(".CONTENT_ADMIN_ITEM_LAN_71.")
-
- -
".CONTENT_ADMIN_ITEM_LAN_14."".$rs -> form_text("content_author_name", 70, $content_author_name_value, 100, "tbox", "", "", $content_author_name_js )."
".CONTENT_ADMIN_ITEM_LAN_15."".$rs -> form_text("content_author_email", 70, $content_author_email_value, 100, "tbox", "", "", $content_author_email_js )." - ".$rs -> form_hidden("content_author_id", $content_author_id)." -
"; - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + //re-prepare the posted fields for the form (after preview) + if( isset($_POST['preview_content']) || isset($message) ){ - if(isset($row['content_datestamp']) && $row['content_datestamp'] != "0" && $row['content_datestamp'] != ""){ - $startdate = getdate($row['content_datestamp']); - $ne_day = $startdate['mday']; - $ne_month = $startdate['mon']; - $ne_year = $startdate['year']; - }else{ - $ne_day = (isset($ne_day) ? $ne_day : "0"); - $ne_month = (isset($ne_month) ? $ne_month : "0"); - $ne_year = (isset($ne_year) ? $ne_year : "0"); - } + $row['content_parent'] = $_POST['parent1']; + $row['content_heading'] = $tp -> post_toForm($_POST['content_heading']); + $row['content_subheading'] = $tp -> post_toForm($_POST['content_subheading']); + $row['content_summary'] = $tp -> post_toForm($_POST['content_summary']); + $row['content_text'] = $tp -> post_toForm($_POST['content_text']); + $authordetails[0] = $_POST['content_author_id']; + $authordetails[1] = $_POST['content_author_name']; + $authordetails[2] = $_POST['content_author_email']; + $ne_day = $_POST['ne_day']; + $ne_month = $_POST['ne_month']; + $ne_year = $_POST['ne_year']; + $end_day = $_POST['end_day']; + $end_month = $_POST['end_month']; + $end_year = $_POST['end_year']; + $row['content_comment'] = $_POST['content_comment']; + $row['content_rate'] = $_POST['content_rate']; + $row['content_pe'] = $_POST['content_pe']; + $row['content_class'] = $_POST['content_class']; + $row['content_refer'] = $_POST['content_refer']; + $row['content_datestamp'] = $_POST['content_datestamp']; + $row['content_score'] = $_POST['content_score']; + $row['content_meta'] = $_POST['content_meta']; + $row['content_layout'] = $_POST['content_layout']; + $row['content_icon'] = $_POST['content_icon']; - $smarray = getdate(); - $current_year = $smarray['year']; + //images and attachments + foreach($_POST as $k => $v){ + if(strpos($k, "content_files") === 0){ + $row['content_file'] .= "[file]".$v; + } + if(strpos($k, "content_images") === 0){ + $row['content_image'] .= "[img]".$v; + } + } + //custom tags + for($i=0;$i<$content_pref["content_admin_custom_number"];$i++){ + $keystring = $tp -> post_toForm($_POST["content_custom_key_{$i}"]); + $custom["content_custom_{$keystring}"] = $tp -> post_toForm($_POST["content_custom_value_{$i}"]); + } + //preset tags + foreach($_POST['content_custom_preset_key'] as $k => $v){ + $k = $tp -> post_toForm($k); + $custom['content_custom_presettags'][$k] = $tp -> post_toForm($v); + } + } - if($checkstartdate){ - //start date - $TOPIC_TOPIC = CONTENT_ADMIN_DATE_LAN_15; - $TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_73; - $TOPIC_HELP = CONTENT_ADMIN_DATE_LAN_17; - $TOPIC_FIELD = " - ".$rs -> form_select_open("ne_day")." - ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_12, 0, "none"); - for($count=1; $count<=31; $count++){ - $TOPIC_FIELD .= $rs -> form_option($count, (isset($ne_day) && $ne_day == $count ? "1" : "0"), $count); - } - $TOPIC_FIELD .= $rs -> form_select_close()." - ".$rs -> form_select_open("ne_month")." - ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_13, 0, "none"); - for($count=1; $count<=12; $count++){ - $TOPIC_FIELD .= $rs -> form_option($months[($count-1)], (isset($ne_month) && $ne_month == $count ? "1" : "0"), $count); - } - $TOPIC_FIELD .= $rs -> form_select_close()." - ".$rs -> form_select_open("ne_year")." - ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_14, 0, "none"); - for($count=($current_year-5); $count<=($current_year+1); $count++){ - $TOPIC_FIELD .= $rs -> form_option($count, (isset($ne_year) && $ne_year == $count ? "1" : "0"), $count); - } - $TOPIC_FIELD .= $rs -> form_select_close()." - "; - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); - }else{ - $hidden .= $rs -> form_hidden("ne_day", $ne_day); - $hidden .= $rs -> form_hidden("ne_month", $ne_month); - $hidden .= $rs -> form_hidden("ne_year", $ne_year); - } + if(isset($row['content_datestamp']) && $row['content_datestamp'] != "0" && $row['content_datestamp'] != ""){ + $startdate = getdate($row['content_datestamp']); + $ne_day = $startdate['mday']; + $ne_month = $startdate['mon']; + $ne_year = $startdate['year']; + }else{ + $ne_day = (isset($ne_day) ? $ne_day : "0"); + $ne_month = (isset($ne_month) ? $ne_month : "0"); + $ne_year = (isset($ne_year) ? $ne_year : "0"); + } + if(isset($row['content_enddate']) && $row['content_enddate'] != "0" && $row['content_enddate'] != ""){ + $enddate = getdate($row['content_enddate']); + $end_day = $enddate['mday']; + $end_month = $enddate['mon']; + $end_year = $enddate['year']; + }else{ + $end_day = (isset($end_day) ? $end_day : "0"); + $end_month = (isset($end_month) ? $end_month : "0"); + $end_year = (isset($end_year) ? $end_year : "0"); + } + $smarray = getdate(); + $current_year = $smarray['year']; + //check which areas should be visible (dependent on options in admin:create category) + $hidden = ''; - if(isset($row['content_enddate']) && $row['content_enddate'] != "0" && $row['content_enddate'] != ""){ - $enddate = getdate($row['content_enddate']); - $end_day = $enddate['mday']; - $end_month = $enddate['mon']; - $end_year = $enddate['year']; - }else{ - $end_day = (isset($end_day) ? $end_day : "0"); - $end_month = (isset($end_month) ? $end_month : "0"); - $end_year = (isset($end_year) ? $end_year : "0"); - } + if($checksubheading){ + $show['subheading'] = true; + }else{ + $show['subheading'] = false; + $hidden .= $rs -> form_hidden("content_subheading", $row['content_subheading']); + } + if($checksummary){ + $show['summary'] = true; + }else{ + $show['summary'] = false; + $hidden .= $rs -> form_hidden("content_summary", $row['content_summary']); + } + if($checkstartdate){ + $show['startdate'] = true; + }else{ + $show['startdate'] = false; + $hidden .= $rs -> form_hidden("ne_day", $ne_day); + $hidden .= $rs -> form_hidden("ne_month", $ne_month); + $hidden .= $rs -> form_hidden("ne_year", $ne_year); + } + if($checkenddate){ + $show['enddate'] = true; + }else{ + $show['enddate'] = false; + $hidden .= $rs -> form_hidden("end_day", $end_day); + $hidden .= $rs -> form_hidden("end_month", $end_month); + $hidden .= $rs -> form_hidden("end_year", $end_year); + } + if( $checkicon || $checkattach || $checkimages ){ + $show['upload'] = true; + }else{ + $show['upload'] = false; + } + if($checkicon){ + $show['icon'] = true; + }else{ + $show['icon'] = false; + $hidden .= $rs -> form_hidden("content_icon", $row['content_icon']); + } + if($checkattach){ + $show['attach'] = true; + }else{ + $show['attach'] = false; + $hidden .= $rs -> form_hidden("content_file", $row['content_file']); + } + if($checkimages){ + $show['images'] = true; + }else{ + $show['images'] = false; + $hidden .= $rs -> form_hidden("content_image", $row['content_image']); + } + if($checkcomment){ + $show['comment'] = true; + }else{ + $show['comment'] = false; + $hidden .= $rs -> form_hidden("content_comment", $row['content_comment']); + } + if($checkrating){ + $show['rating'] = true; + }else{ + $show['rating'] = false; + $hidden .= $rs -> form_hidden("content_rate", $row['content_rate']); + } + if($checkpe){ + $show['pe'] = true; + }else{ + $show['pe'] = false; + $hidden .= $rs -> form_hidden("content_pe", $row['content_pe']); + } + if($checkvisibility){ + $show['visibility'] = true; + }else{ + $show['visibility'] = false; + $hidden .= $rs -> form_hidden("content_class", $row['content_class']); + } + if($checkscore){ + $show['score'] = true; + }else{ + $show['score'] = false; + $hidden .= $rs -> form_hidden("content_score", $row['content_score']); + } + if($checkmeta){ + $show['meta'] = true; + }else{ + $show['meta'] = false; + $hidden .= $rs -> form_hidden("content_meta", $row['content_meta']); + } + if($checklayout){ + $show['layout'] = true; + }else{ + $show['layout'] = false; + $hidden .= $rs -> form_hidden("content_layout", $row['content_layout']); + } - if($checkenddate){ - //end date - $TOPIC_TOPIC = CONTENT_ADMIN_DATE_LAN_16; - $TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_74; - $TOPIC_HELP = CONTENT_ADMIN_DATE_LAN_18; - $TOPIC_FIELD = " - ".$rs -> form_select_open("end_day")." - ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_12, 0, "none"); - for($count=1; $count<=31; $count++){ - $TOPIC_FIELD .= $rs -> form_option($count, (isset($end_day) && $end_day == $count ? "1" : "0"), $count); - } - $TOPIC_FIELD .= $rs -> form_select_close()." - ".$rs -> form_select_open("end_month")." - ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_13, 0, "none"); - for($count=1; $count<=12; $count++){ - $TOPIC_FIELD .= $rs -> form_option($months[($count-1)], (isset($end_month) && $end_month == $count ? "1" : "0"), $count); - } - $TOPIC_FIELD .= $rs -> form_select_close()." - ".$rs -> form_select_open("end_year")." - ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_14, 0, "none"); - for($count=($current_year-5); $count<=($current_year+1); $count++){ - $TOPIC_FIELD .= $rs -> form_option($count, (isset($end_year) && $end_year == $count ? "1" : "0"), $count); - } - $TOPIC_FIELD .= $rs -> form_select_close()." - "; - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); - }else{ - $hidden .= $rs -> form_hidden("end_day", $end_day); - $hidden .= $rs -> form_hidden("end_month", $end_month); - $hidden .= $rs -> form_hidden("end_year", $end_year); - } + //category + $CONTENTFORM_CATEGORY = ''; + if($mode == "contentmanager"){ + if($qs[1] == "edit"){ + $hidden .= $rs -> form_hidden("parent1", $row['content_parent']); + }else{ + $hidden .= $rs -> form_hidden("parent1", intval($qs[2])); + } + }else{ + if($mode == "submit"){ + $parent = "submit"; + }else{ + $parent = (isset($qs[3]) && is_numeric($qs[3]) ? $qs[3] : (isset($row['content_parent']) ? $row['content_parent'] : "") ); + } + $CONTENTFORM_CATEGORY = $aa -> ShowOption($parent, "createcontent"); + } - //$text .= $TOPIC_ROW_SPACER; - if( $checkicon || $checkattach || $checkimages ){ - //$text .= $TOPIC_ROW_SPACER; + //author + $content_author_id = (isset($authordetails[0]) && $authordetails[0] != "" ? $authordetails[0] : USERID); + $content_author_name = (isset($authordetails[1]) && $authordetails[1] != "" ? $authordetails[1] : USERNAME); + $content_author_email = (isset($authordetails[2]) ? $authordetails[2] : USEREMAIL); - //upload icon - $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_104; - $TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_112; - $TOPIC_HELP = CONTENT_ADMIN_ITEM_LAN_113; - - $rejectlist = array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*', 'thumb_*'); - $iconlist = $fl->get_files($content_tmppath_icon,"",$rejectlist); - $filelist = $fl->get_files($content_tmppath_file,"",$rejectlist); - $imagelist = $fl->get_files($content_tmppath_image,"",$rejectlist); + $content_author_name_value = ($content_author_name ? $content_author_name : CONTENT_ADMIN_ITEM_LAN_14); + $content_author_name_js = ($content_author_name ? "" : "onfocus=\"if(document.getElementById('dataform').content_author_name.value=='".CONTENT_ADMIN_ITEM_LAN_14."'){document.getElementById('dataform').content_author_name.value='';}\""); + $content_author_email_value = ($content_author_email ? $content_author_email : CONTENT_ADMIN_ITEM_LAN_15); + $content_author_email_js = ($content_author_email ? "" : "onfocus=\"if(document.getElementById('dataform').content_author_email.value=='".CONTENT_ADMIN_ITEM_LAN_15."'){document.getElementById('dataform').content_author_email.value='';}\""); - $TOPIC_FIELD = ""; - if(!FILE_UPLOADS){ - $TOPIC_FIELD .= "".CONTENT_ADMIN_ITEM_LAN_21.""; - }else{ - if(!is_writable($content_tmppath_icon)){ - $TOPIC_FIELD .= "".CONTENT_ADMIN_ITEM_LAN_22." ".$content_tmppath_icon." ".CONTENT_ADMIN_ITEM_LAN_23."
"; - } - if(!is_writable($content_tmppath_file)){ - $TOPIC_FIELD .= "".CONTENT_ADMIN_ITEM_LAN_22." ".$content_tmppath_file." ".CONTENT_ADMIN_ITEM_LAN_23."
"; - } - if(!is_writable($content_tmppath_image)){ - $TOPIC_FIELD .= "".CONTENT_ADMIN_ITEM_LAN_22." ".$content_tmppath_image." ".CONTENT_ADMIN_ITEM_LAN_23."
"; - } - $js = "onclick=\"document.getElementById('parent').value = document.getElementById('parent1').options[document.getElementById('parent1').selectedIndex].label;\" "; - $TOPIC_FIELD .= "
- - ".$rs -> form_select_open("uploadtype")." - ".($checkicon ? $rs -> form_option(CONTENT_ADMIN_ITEM_LAN_114, "0", "1") : '')." - ".($checkattach ? $rs -> form_option(CONTENT_ADMIN_ITEM_LAN_115, "0", "2") : '')." - ".($checkimages ? $rs -> form_option(CONTENT_ADMIN_ITEM_LAN_116, "0", "3") : '')." - ".$rs -> form_select_close()." - - - - "; - } - $TOPIC_FIELD .= "
"; - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); - } + $rejectlist = array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*', 'thumb_*'); + $iconlist = $fl->get_files($content_tmppath_icon,"",$rejectlist); + $filelist = $fl->get_files($content_tmppath_file,"",$rejectlist); + $imagelist = $fl->get_files($content_tmppath_image,"",$rejectlist); - if($checkicon){ - //icon - $row['content_icon'] = (isset($row['content_icon']) ? $row['content_icon'] : ""); - $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_20; - $TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_75; - $TOPIC_HELP = ""; - $TOPIC_FIELD = " - ".$rs -> form_text("content_icon", 60, $row['content_icon'], 100)." - ".$rs -> form_button("button", '', CONTENT_ADMIN_ITEM_LAN_105, "onclick=\"expandit('divicon')\"")." - "; + if(!(isset($_POST['preview_content']) || isset($message))){ + if(isset($row['content_pref']) && $row['content_pref']){ + $custom = $eArrayStorage->ReadArray($row['content_pref']); + } + } - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); - }else{ - $hidden .= $rs -> form_hidden("content_icon", $row['content_icon']); - } + //custom data + $existing_custom = "0"; + $TOPIC_CHECK_VALID = FALSE; + $CONTENTFORM_CUSTOM = ''; + $ctext = ''; + $chidden = ''; + if($checkcustom && $checkcustomnumber){ + $ctext .= $tp -> parseTemplate($CONTENT_ADMIN_CONTENT_CREATE_CUSTOMSTART, FALSE, $content_shortcodes); + } + if(!empty($custom)){ + foreach($custom as $k => $v){ + if(substr($k,0,22) != "content_custom_preset_" && $k != "content_custom_presettags"){ + $key = substr($k,15); - if($checkattach){ - //file - $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_24; - $TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_76; - $TOPIC_HELP = ""; - $TOPIC_FIELD = ""; - $filetmp = explode("[file]", $row['content_file']); - foreach($filetmp as $key => $value) { - if($value == "") { - unset($filetmp[$key]); - } - } - $attachments = array_values($filetmp); - for($i=0;$i<$checkattachnumber;$i++){ - $k=$i+1; - $num = (strlen($k) == 1 ? "0".$k : $k); - $attachments[$i] = ($attachments[$i] ? $attachments[$i] : ""); - - //choose file - $TOPIC_FIELD .= " -
- ".$num." ".$rs -> form_text("content_files".$i."", 60, $attachments[$i], 100)." - ".$rs -> form_button("button", '', CONTENT_ADMIN_ITEM_LAN_105, "onclick=\"expandit('divfile".$i."')\"")." -
"; - } - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); - }else{ - $hidden .= $rs -> form_hidden("content_file", $row['content_file']); - } - - if($checkimages){ - //image - $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_31; - $TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_77; - $TOPIC_HELP = ""; - $TOPIC_FIELD = ""; - $imagestmp = explode("[img]", $row['content_image']); - foreach($imagestmp as $key => $value) { - if($value == "") { - unset($imagestmp[$key]); - } - } - $imagesarray = array_values($imagestmp); - for($i=0;$i<$checkimagesnumber;$i++){ - $k=$i+1; - $num = (strlen($k) == 1 ? "0".$k : $k); - $imagesarray[$i] = ($imagesarray[$i] ? $imagesarray[$i] : ""); - - //choose image - $TOPIC_FIELD .= " -
- ".$num." ".$rs -> form_text("content_images".$i."", 60, $imagesarray[$i], 100)." - ".$rs -> form_button("button", '', CONTENT_ADMIN_ITEM_LAN_105, "onclick=\"expandit('divimage".$i."')\"")." -
"; - } - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); - }else{ - $hidden .= $rs -> form_hidden("content_image", $row['content_image']); - } - - if($checkcomment || $checkrating || $checkpe || $checkvisibility || $checkscore || $checkmeta || $checklayout ){ - //$text .= $TOPIC_ROW_SPACER; - } - if($checkcomment){ - //comment - $row['content_comment'] = (isset($row['content_comment']) ? $row['content_comment'] : ""); - $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_36; - $TOPIC_FIELD = " - ".$rs -> form_radio("content_comment", "1", ($row['content_comment'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85." - ".$rs -> form_radio("content_comment", "0", ($row['content_comment'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86." - "; - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); - }else{ - $hidden .= $rs -> form_hidden("content_comment", $row['content_comment']); - } - - if($checkrating){ - //rating - $row['content_rate'] = (isset($row['content_rate']) ? $row['content_rate'] : ""); - $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_37; - $TOPIC_FIELD = " - ".$rs -> form_radio("content_rate", "1", ($row['content_rate'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85." - ".$rs -> form_radio("content_rate", "0", ($row['content_rate'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86." - "; - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); - }else{ - $hidden .= $rs -> form_hidden("content_rate", $row['content_rate']); - } - - if($checkpe){ - //print/email/pdf icons - $row['content_pe'] = (isset($row['content_pe']) ? $row['content_pe'] : ""); - $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_38; - $TOPIC_FIELD = " - ".$rs -> form_radio("content_pe", "1", ($row['content_pe'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85." - ".$rs -> form_radio("content_pe", "0", ($row['content_pe'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86." - "; - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); - }else{ - $hidden .= $rs -> form_hidden("content_pe", $row['content_pe']); - } - - if($checkvisibility){ - //userclass - $row['content_class'] = (isset($row['content_class']) ? $row['content_class'] : ""); - $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_39; - $TOPIC_FIELD = r_userclass("content_class",$row['content_class'], "CLASSES"); - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); - }else{ - $hidden .= $rs -> form_hidden("content_class", $row['content_class']); - } - - if($checkscore){ - //score - $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_40; - $TOPIC_FIELD = " - ".$rs -> form_select_open("content_score")." - ".$rs -> form_option(CONTENT_ADMIN_ITEM_LAN_41, 0, "none"); - for($a=1; $a<=100; $a++){ - $TOPIC_FIELD .= $rs -> form_option($a, ($row['content_score'] == $a ? "1" : "0"), $a); - } - $TOPIC_FIELD .= $rs -> form_select_close(); - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); - }else{ - $hidden .= $rs -> form_hidden("content_score", $row['content_score']); - } - - if($checkmeta){ - //meta - $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_53; - $TOPIC_FIELD = CONTENT_ADMIN_ITEM_LAN_70."
".$rs -> form_text("content_meta", 74, $row['content_meta'], 250); - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); - }else{ - $hidden .= $rs -> form_hidden("content_meta", $row['content_meta']); - } - - if($checklayout){ - global $fl; - - if(!isset($content_pref["content_theme"])){ - $dir = $plugindir."templates/default"; - }else{ - if(is_readable($tp->replaceConstants($content_pref["content_theme"])."content_content_template.php")){ - $dir = $tp->replaceConstants($content_pref["content_theme"]); - }else{ - $dir = $plugindir."templates/default"; - } - } - //get_files($path, $fmask = '', $omit='standard', $recurse_level = 0, $current_level = 0, $dirs_only = FALSE) - $rejectlist = array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*', '.bak'); - $templatelist = $fl->get_files($dir,"content_content",$rejectlist); - - //template - $check = ""; - if(isset($row['content_layout']) && $row['content_layout'] != ""){ - $check = $row['content_layout']; - }else{ - if(isset($content_pref["content_layout"])){ - $check = $content_pref["content_layout"]; - } - } - $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_92; - $TOPIC_FIELD = " - ".$rs -> form_select_open("content_layout")." - ".$rs -> form_option(CONTENT_ADMIN_ITEM_LAN_94, 0, "none"); - foreach($templatelist as $template){ - $templatename = substr($template['fname'], 25, -4); - $templatename = ($template['fname'] == "content_content_template.php" ? "default" : $templatename); - $TOPIC_FIELD .= $rs -> form_option($templatename, ($check == $template['fname'] ? "1" : "0"), $template['fname']); - } - $TOPIC_FIELD .= $rs -> form_select_close(); - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); - }else{ - $hidden .= $rs -> form_hidden("content_layout", $row['content_layout']); - } - - if( $checkcustom && $checkcustomnumber ){ - //$text .= $TOPIC_ROW_SPACER; - } - - if(!(isset($_POST['preview_content']) || isset($message))){ - if(isset($row['content_pref']) && $row['content_pref']){ - $custom = $eArrayStorage->ReadArray($row['content_pref']); - } - } - - //custom data - $existing_custom = "0"; - $TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_54; - $TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_84; - $TOPIC_HELP = CONTENT_ADMIN_ITEM_LAN_68; - $TOPIC_CHECK_VALID = FALSE; - $TOPIC_FIELD = ""; - if($checkcustom && $checkcustomnumber){ $TOPIC_FIELD = ""; } - if(!empty($custom)){ - foreach($custom as $k => $v){ - if(substr($k,0,22) != "content_custom_preset_" && $k != "content_custom_presettags"){ - $key = substr($k,15); - - $key = $tp -> post_toForm($key); - $v = $tp -> post_toForm($v); - - if($checkcustom && $checkcustomnumber){ - $TOPIC_FIELD .= " - - - - "; - }else{ - $TOPIC_FIELD .= " - ".$rs -> form_hidden("content_custom_key_".$existing_custom, $key)." - ".$rs -> form_hidden("content_custom_value_".$existing_custom, $v); - $TOPIC_CHECK_VALID = TRUE; - } - $existing_custom = $existing_custom + 1; - } - } - } + $key = $tp -> post_toForm($key); + $v = $tp -> post_toForm($v); if($checkcustom && $checkcustomnumber){ + $CONTENTFORM_CUSTOM_KEY = $rs -> form_text("content_custom_key_".$existing_custom."", 20, $key, 100); + $CONTENTFORM_CUSTOM_VALUE = $rs -> form_text("content_custom_value_".$existing_custom."", 70, $v, 250); + $ctext .= $tp -> parseTemplate($CONTENT_ADMIN_CONTENT_CREATE_CUSTOMTABLE, FALSE, $content_shortcodes); + }else{ + $chidden .= " + ".$rs -> form_hidden("content_custom_key_".$existing_custom, $key)." + ".$rs -> form_hidden("content_custom_value_".$existing_custom, $v); $TOPIC_CHECK_VALID = TRUE; - for($i=$existing_custom;$i<$checkcustomnumber;$i++){ - $TOPIC_FIELD .= " - - - - "; - } } - if($checkcustom && $checkcustomnumber){ $TOPIC_FIELD .= "
".$rs -> form_text("content_custom_key_".$existing_custom."", 20, $key, 100)."".$rs -> form_text("content_custom_value_".$existing_custom."", 70, $v, 250)."
".$rs -> form_text("content_custom_key_".$i."", 20, "", 100)."".$rs -> form_text("content_custom_value_".$i."", 70, "", 250)."
"; } - if($TOPIC_CHECK_VALID){ $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); } - - //preset custom data fields - if(count($content_pref["content_custom_preset_key"]) > 0){ - //$text .= $TOPIC_ROW_SPACER; + $existing_custom = $existing_custom + 1; + } + } + } + if($checkcustom && $checkcustomnumber){ + $TOPIC_CHECK_VALID = TRUE; + for($i=$existing_custom;$i<$checkcustomnumber;$i++){ + $CONTENTFORM_CUSTOM_KEY = $rs -> form_text("content_custom_key_".$i."", 20, "", 100); + $CONTENTFORM_CUSTOM_VALUE = $rs -> form_text("content_custom_value_".$i."", 70, "", 250); + $ctext .= $tp -> parseTemplate($CONTENT_ADMIN_CONTENT_CREATE_CUSTOMTABLE, FALSE, $content_shortcodes); + } + $ctext .= $tp -> parseTemplate($CONTENT_ADMIN_CONTENT_CREATE_CUSTOMEND, FALSE, $content_shortcodes); + } + if($TOPIC_CHECK_VALID){ + $CONTENTFORM_CUSTOM = $ctext; + } + $hidden .= ($chidden ? $chidden : ''); + + //preset custom data fields + $CONTENTFORM_PRESET = ''; + for($i=0;$i parseCustomPresetTag($content_pref["content_custom_preset_key"][$i], $custom['content_custom_presettags']); + }else{ + $tmp = explode("^", $content_pref["content_custom_preset_key"][$i]); + if(is_array($custom['content_custom_presettags'][$tmp[0]])){ + $tmp[0] = $tp -> post_toForm($tmp[0]); + $hidden .= $rs -> form_hidden("content_custom_preset_key[$tmp[0]][day]", $custom['content_custom_presettags'][$tmp[0]][day]); + $hidden .= $rs -> form_hidden("content_custom_preset_key[$tmp[0]][month]", $custom['content_custom_presettags'][$tmp[0]][month]); + $hidden .= $rs -> form_hidden("content_custom_preset_key[$tmp[0]][year]", $custom['content_custom_presettags'][$tmp[0]][year]); + }else{ + $tmp[0] = $tp -> post_toForm($tmp[0]); + $hidden .= $rs -> form_hidden("content_custom_preset_key[$tmp[0]]", $custom['content_custom_presettags'][$tmp[0]]); } + } + } + } - for($i=0;$i parseCustomPresetTag($content_pref["content_custom_preset_key"][$i], $custom['content_custom_presettags']); - }else{ - $tmp = explode("^", $content_pref["content_custom_preset_key"][$i]); - if(is_array($custom['content_custom_presettags'][$tmp[0]])){ - $tmp[0] = $tp -> post_toForm($tmp[0]); - $hidden .= $rs -> form_hidden("content_custom_preset_key[$tmp[0]][day]", $custom['content_custom_presettags'][$tmp[0]][day]); - $hidden .= $rs -> form_hidden("content_custom_preset_key[$tmp[0]][month]", $custom['content_custom_presettags'][$tmp[0]][month]); - $hidden .= $rs -> form_hidden("content_custom_preset_key[$tmp[0]][year]", $custom['content_custom_presettags'][$tmp[0]][year]); - }else{ - $tmp[0] = $tp -> post_toForm($tmp[0]); - $hidden .= $rs -> form_hidden("content_custom_preset_key[$tmp[0]]", $custom['content_custom_presettags'][$tmp[0]]); - } - } - } - } + $button = ($hidden ? $hidden : ""); + if($qs[1] == "edit" || $qs[1] == "sa" || isset($_POST['editp']) ){ + if($qs[1] == "sa"){ + $button = $rs -> form_hidden("content_refer", $row['content_refer']); + } + $button .= $rs -> form_hidden("content_datestamp", $row['content_datestamp']); + $button .= $rs -> form_button("submit", "preview_content", (isset($_POST['preview_content']) ? CONTENT_ADMIN_MAIN_LAN_27 : CONTENT_ADMIN_MAIN_LAN_26)); + $button .= $rs -> form_button("submit", "update_content", ($qs[1] == "sa" ? CONTENT_ADMIN_ITEM_LAN_43 : CONTENT_ADMIN_ITEM_LAN_45)); + $button .= $rs -> form_hidden("content_id", $qs[2]); + $button .= $rs -> form_checkbox("update_datestamp", 1, 0)." ".CONTENT_ADMIN_ITEM_LAN_42; + }else{ + $button .= $rs -> form_button("submit", "preview_content", (isset($_POST['preview_content']) ? CONTENT_ADMIN_MAIN_LAN_27 : CONTENT_ADMIN_MAIN_LAN_26)); + $button .= $rs -> form_button("submit", "create_content", CONTENT_ADMIN_ITEM_LAN_44); + } + $CONTENT_ADMIN_BUTTON = $button; - $text .= $TOPIC_ROW_SPACER." - - ".($hidden ? $hidden : ""); - - $js = "onclick=\"document.getElementById('parent').value = document.getElementById('parent1').options[document.getElementById('parent1').selectedIndex].label;\" "; - if($qs[1] == "edit" || $qs[1] == "sa" || isset($_POST['editp']) ){ - if($qs[1] == "sa"){ - $text .= $rs -> form_hidden("content_refer", $row['content_refer']); - } - $text .= $rs -> form_hidden("content_datestamp", $row['content_datestamp']); - $text .= $rs -> form_button("submit", "preview_content", (isset($_POST['preview_content']) ? CONTENT_ADMIN_MAIN_LAN_27 : CONTENT_ADMIN_MAIN_LAN_26), $js); - $text .= $rs -> form_button("submit", "update_content", ($qs[1] == "sa" ? CONTENT_ADMIN_ITEM_LAN_43 : CONTENT_ADMIN_ITEM_LAN_45), $js ); - $text .= $rs -> form_hidden("content_id", $qs[2]); - $text .= $rs -> form_checkbox("update_datestamp", 1, 0)." ".CONTENT_ADMIN_ITEM_LAN_42; - }else{ - $text .= $rs -> form_button("submit", "preview_content", (isset($_POST['preview_content']) ? CONTENT_ADMIN_MAIN_LAN_27 : CONTENT_ADMIN_MAIN_LAN_26), $js); - $text .= $rs -> form_button("submit", "create_content", CONTENT_ADMIN_ITEM_LAN_44, $js); - } - $text .= " - - + $text = $tp -> parseTemplate($CONTENT_ADMIN_CONTENT_CREATE, FALSE, $content_shortcodes); - - -
"; - - $caption = ($qs[1] == "edit" ? CONTENT_ADMIN_ITEM_LAN_45 : CONTENT_ADMIN_ITEM_LAN_44); - $ns -> tablerender($caption, $text); + $caption = ($qs[1] == "edit" ? CONTENT_ADMIN_ITEM_LAN_45 : CONTENT_ADMIN_ITEM_LAN_44); + $ns -> tablerender($caption, $text); } function parseCustomPresetTag($tag, $values){ - global $rs, $TOPIC_ROW_NOEXPAND, $months, $tp; + global $rs, $months, $tp, $content_shortcodes, $CONTENT_ADMIN_CONTENT_CREATE_PRESET, $CONTENTFORM_PRESET_KEY, $CONTENTFORM_PRESET_VALUE; $tmp = explode("^", $tag); @@ -1131,32 +819,26 @@ class contentform{ $str = $rs -> form_checkbox("content_custom_preset_key[{$tmp[0]}]", $tp -> post_toForm($tmp[2]), ($values[$tmp[0]] == $tmp[2] ? "1" : "0"), "", ""); } - $TOPIC_TOPIC = $tmp[0]; - $TOPIC_FIELD = $str; - $text = preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + $CONTENTFORM_PRESET_KEY = $tmp[0]; + $CONTENTFORM_PRESET_VALUE = $str; + $text = $tp -> parseTemplate($CONTENT_ADMIN_CONTENT_CREATE_PRESET, FALSE, $content_shortcodes); return $text; } function show_manage_content($mode, $userid="", $username=""){ - global $qs, $sql, $ns, $rs, $aa, $plugintable, $plugindir, $tp, $eArrayStorage; + global $qs, $sql, $ns, $rs, $aa, $plugintable, $plugindir, $tp, $content_shortcodes, $eArrayStorage; if($mode != "contentmanager"){ //category parent - global $TOPIC_TOPIC, $TOPIC_FIELD, $TOPIC_ROW_NOEXPAND; - $TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_27; - $parent = (is_numeric($qs[1]) ? $qs[1] : ""); - $TOPIC_FIELD = $aa -> ShowOptionCat($parent).$rs->form_hidden("parent", ""); - $text = "
- "; - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); - $text .= "
".CONTENT_ADMIN_MAIN_LAN_2."
"; - $caption = CONTENT_ADMIN_MAIN_LAN_2; - $ns -> tablerender($caption, $text); + global $CONTENT_ADMIN_CONTENT_CATSELECT, $CONTENTFORM_CATEGORYSELECT; + $CONTENTFORM_CATEGORYSELECT = $aa -> ShowOption( (is_numeric($qs[1]) ? $qs[1] : ""), "managecontent" ); + $text = $tp -> parseTemplate($CONTENT_ADMIN_CONTENT_CATSELECT, FALSE, $content_shortcodes); + $ns -> tablerender(CONTENT_ADMIN_MAIN_LAN_2, $text); } - + if(!isset($qs[1])){ return; } @@ -1188,21 +870,6 @@ class contentform{ } } if($personalmanagercheck == TRUE){ - /* - $qryuser = ""; - if(getperms("0")){ - $userid = USERID; - $username = USERNAME; - }else{ - //use user restriction (personal admin) - if(isset($userid) && isset($username) ){ - $userid = intval($userid); - $qryuser = " AND (content_author = '".$userid."' OR SUBSTRING_INDEX(content_author, '^', 1) = '".$userid."' OR SUBSTRING_INDEX(content_author, '^', 2) = '".$userid."^".$username."' OR content_author REGEXP '".$username."' )"; - - //$qryuser = " AND (content_author = '".$userid."' || LEFT(content_author, ".$l.") = '".$userid."^' OR SUBSTRING_INDEX(content_author, '^', 1) = '".$userid."' || content_author REGEXP '\\\^".$username."' ) "; - } - } - */ $formtarget = $plugindir."content_manager.php?content.".intval($qs[1]); $qrycat = " content_parent = '".intval($qs[1])."' "; $qryfirst = " content_parent = '".intval($qs[1])."' "; @@ -1241,30 +908,22 @@ class contentform{ sort($arrletters); if ($distinctfirstletter == 0){ - $text .= "
".CONTENT_ADMIN_ITEM_LAN_4."
"; - $ns -> tablerender(CONTENT_ADMIN_ITEM_LAN_5, $text); - return; + $text .= "
".CONTENT_ADMIN_ITEM_LAN_4."
"; + $ns -> tablerender(CONTENT_ADMIN_ITEM_LAN_5, $text); + return; }elseif ($distinctfirstletter != 1){ - - $text .= " -
-
- - - - -
".CONTENT_ADMIN_ITEM_LAN_6."
"; - for($i=0;$i"; - } + global $tp, $content_shortcodes, $CONTENT_ADMIN_CONTENT_LIST_LETTER, $CONTENT_ADMIN_LETTERINDEX, $CONTENT_ADMIN_FORM_TARGET; + $CONTENT_ADMIN_LETTERINDEX = ""; + for($i=0;$i"; } - $text .= " - -
-
-
"; + } + $CONTENT_ADMIN_LETTERINDEX .= ""; + $CONTENT_ADMIN_FORM_TARGET = $formtarget; + + $text .= $tp -> parseTemplate($CONTENT_ADMIN_CONTENT_LIST_LETTER, FALSE, $content_shortcodes); } // --------------------------------------------------------------------------- @@ -1275,47 +934,27 @@ class contentform{ $qryitem = " ".$qrycat." AND content_refer != 'sa' ".$qryletter." ".$qryuser." ORDER BY content_datestamp DESC"; // --------------------------------------------------------------------------- - $sql2 = new db; + if(!is_object($sql2)){ $sql2 = new db; } if(!$content_total = $sql2 -> db_Select($plugintable, "content_id, content_heading, content_subheading, content_author, content_icon", $qryitem)){ $text .= "
".CONTENT_ADMIN_ITEM_LAN_4."
"; }else{ + global $tp, $content_shortcodes, $row, $CONTENT_ADMIN_CONTENT_LIST_START, $CONTENT_ADMIN_CONTENT_LIST_TABLE, $CONTENT_ADMIN_CONTENT_LIST_END, $CONTENT_ICON, $CONTENT_ADMIN_OPTIONS; + if($content_total < 50 || (isset($letter) && $letter!='') ){ - $text .= " -
- ".$rs -> form_open("post", e_SELF."?".e_QUERY, "deletecontentform","","", "")." - - - - - - - - "; + $text .= $tp -> parseTemplate($CONTENT_ADMIN_CONTENT_LIST_START, FALSE, $content_shortcodes); while($row = $sql2 -> db_Fetch()){ - $delete_heading = str_replace("'", "\'", $row['content_heading']); - $authordetails = $aa -> getAuthor($row['content_author']); - $caticon = $content_icon_path.$row['content_icon']; + $delete_heading = str_replace("'", "\'", $row['content_heading']); $deleteicon = CONTENT_ICON_DELETE; $cid = $row['content_id']; - $row['content_heading'] = $tp->toHTML($row['content_heading'], TRUE, ""); - $row['content_subheading'] = $tp->toHTML($row['content_subheading'], TRUE, ""); - $text .= " - - - - - - - "; + + $CONTENT_ICON = ($row['content_icon'] && is_readable($content_icon_path.$row['content_icon']) ? "" : " "); + + $CONTENT_ADMIN_OPTIONS = "".CONTENT_ICON_EDIT." + toJS(CONTENT_ADMIN_JS_LAN_1."\\n\\n[".CONTENT_ADMIN_JS_LAN_6." ".$cid." : ".$delete_heading."]")."')\"/>"; + + $text .= $tp -> parseTemplate($CONTENT_ADMIN_CONTENT_LIST_TABLE, FALSE, $content_shortcodes); } - $text .= "
".CONTENT_ADMIN_ITEM_LAN_8."".CONTENT_ADMIN_ITEM_LAN_9."".CONTENT_ADMIN_ITEM_LAN_10."".CONTENT_ADMIN_ITEM_LAN_11."".CONTENT_ADMIN_ITEM_LAN_12."
".$cid."".($row['content_icon'] ? "" : " ")."".($authordetails[0] != "0" ? "".CONTENT_ICON_USER."" : "")." ".$authordetails[1]." - ".CONTENT_ICON_LINK." - ".$row['content_heading']." ".($row['content_subheading'] ? "[".$row['content_subheading']."]" : "")." - ".CONTENT_ICON_EDIT." - toJS(CONTENT_ADMIN_JS_LAN_1."\\n\\n[".CONTENT_ADMIN_JS_LAN_6." ".$cid." : ".$delete_heading."]")."')\"/> -
- ".$rs -> form_close()." -
"; + $text .= $tp -> parseTemplate($CONTENT_ADMIN_CONTENT_LIST_END, FALSE, $content_shortcodes); } else { $text .= "
".CONTENT_ADMIN_ITEM_LAN_7."
"; } @@ -1327,7 +966,7 @@ class contentform{ //show_submitted("contentmanager", USERID, USERNAME, $qs[2]); function show_submitted($cat=''){ - global $qs, $rs, $ns, $aa, $plugintable, $tp; + global $qs, $rs, $ns, $aa, $plugintable, $tp, $content_shortcodes, $row, $CONTENT_ADMIN_SUBMITTED_START, $CONTENT_ADMIN_SUBMITTED_TABLE, $CONTENT_ADMIN_SUBMITTED_END, $CONTENT_ICON, $CONTENT_ADMIN_OPTIONS, $CONTENT_ADMIN_CATEGORY; $catqry = ''; if($cat && is_numeric($cat)){ @@ -1339,64 +978,36 @@ class contentform{ }else{ $array = $aa -> getCategoryTree("", "", FALSE); - $text = " -
- ".$rs -> form_open("post", e_SELF, "submittedform","","", "")." - - - - - - - - - "; + $text = $tp -> parseTemplate($CONTENT_ADMIN_SUBMITTED_START, FALSE, $content_shortcodes); while($row = $sql -> db_Fetch()){ + $CONTENT_ICON=FALSE; + $CONTENT_ADMIN_CATEGORY=FALSE; if(array_key_exists($row['content_parent'], $array)){ $mainparent = $array[$row['content_parent']][0]; - $mainparentheading = $array[$row['content_parent']][1]." [".$array[$row['content_parent']][count($array[$row['content_parent']])-1]."]"; + $CONTENT_ADMIN_CATEGORY = $array[$row['content_parent']][1]." [".$array[$row['content_parent']][count($array[$row['content_parent']])-1]."]"; $content_pref = $aa -> getContentPref($mainparent); $iconpath = ($content_pref["content_icon_path"] ? $content_pref["content_icon_path"] : "{e_PLUGIN}content/images/icon/" ); - $content_icon_path = $tp -> replaceConstants($iconpath); - $icon = $content_icon_path.$row['content_icon']; + $icon = $tp -> replaceConstants($iconpath).$row['content_icon']; + $CONTENT_ICON = ($row['content_icon'] ? "" : " "); } $delete_heading = str_replace("'", "\'", $row['content_heading']); - $authordetails = $aa -> getAuthor($row['content_author']); $delid = $row['content_id']; - $row['content_heading'] = $tp->toHTML($row['content_heading'], TRUE, ""); - $row['content_subheading'] = $tp->toHTML($row['content_subheading'], TRUE, ""); - - $text .= " - - - - - - - - "; + $CONTENT_ADMIN_OPTIONS = " + ".CONTENT_ICON_EDIT." + toJS(CONTENT_ADMIN_JS_LAN_10."\\n\\n[".CONTENT_ADMIN_JS_LAN_6." ".$delid." : ".$delete_heading."]")."')\"/>"; + + $text .= $tp -> parseTemplate($CONTENT_ADMIN_SUBMITTED_TABLE, FALSE, $content_shortcodes); } - $text .= "
".CONTENT_ADMIN_ITEM_LAN_8."".CONTENT_ADMIN_ITEM_LAN_9."".CONTENT_ADMIN_ITEM_LAN_48."".CONTENT_ADMIN_ITEM_LAN_10."".CONTENT_ADMIN_ITEM_LAN_11."".CONTENT_ADMIN_ITEM_LAN_12."
".$delid." - ".($row['content_icon'] ? "" : " ")." - ".$mainparentheading." - ".($authordetails[0] != "0" ? "".CONTENT_ICON_USER."" : "")." ".$authordetails[1]." - - ".$row['content_heading']." ".($row['content_subheading'] ? "
[".$row['content_subheading']."]" : "")." -
- ".CONTENT_ICON_EDIT." - toJS(CONTENT_ADMIN_JS_LAN_10."\\n\\n[".CONTENT_ADMIN_JS_LAN_6." ".$delid." : ".$delete_heading."]")."')\"/> -
- ".$rs -> form_close()." -
"; + $text .= $tp -> parseTemplate($CONTENT_ADMIN_SUBMITTED_END, FALSE, $content_shortcodes); } $ns -> tablerender(CONTENT_ADMIN_ITEM_LAN_49, $text); } function manage_cat(){ - global $qs, $sql, $ns, $rs, $aa, $plugintable, $plugindir, $tp, $stylespacer, $eArrayStorage; + global $qs, $sql, $ns, $rs, $aa, $plugintable, $plugindir, $tp, $content_shortcodes, $stylespacer, $eArrayStorage, $CONTENT_ADMIN_CATEGORY_START, $CONTENT_ADMIN_CATEGORY_TABLE, $CONTENT_ADMIN_CATEGORY_END, $CONTENT_ADMIN_OPTIONS, $row, $catarray, $catid, $content_pref; $catarray = $aa -> getCategoryTree("", "", FALSE); $array = array_keys($catarray); @@ -1404,17 +1015,7 @@ class contentform{ if(!is_array($array)){ $text = "
".CONTENT_ADMIN_CAT_LAN_9."
"; }else{ - $text = " -
- ".$rs -> form_open("post", e_SELF."?".$qs[0], "catform","","", "")." - - - - - - - - "; + $text = $tp -> parseTemplate($CONTENT_ADMIN_CATEGORY_START, FALSE, $content_shortcodes); if(!is_object($sql)){ $sql = new db; } foreach($array as $catid){ @@ -1424,56 +1025,22 @@ class contentform{ $row = $sql -> db_Fetch(); $content_pref = $aa -> getContentPref($catarray[$catid][0]); - $content_cat_icon_path_large = $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]); - $content_cat_icon_path_small = $tp -> replaceConstants($content_pref["content_cat_icon_path_small"]); $delete_heading = str_replace("'", "\'", $row['content_heading']); - $authordetails = $aa -> getAuthor($row['content_author']); - $caticon = $content_cat_icon_path_large.$row['content_icon']; - $pre = ""; - if($row['content_parent'] == "0"){ //main parent level - $class = "forumheader"; - $mainparentid = $row['content_id']; - }else{ //sub level - $class = "forumheader3"; - for($b=0;$b<(count($catarray[$catid])/2)-1;$b++){ - $pre .= "_"; - } - } - - $options = "".CONTENT_ICON_EDIT." + $CONTENT_ADMIN_OPTIONS = "".CONTENT_ICON_EDIT."toJS(CONTENT_ADMIN_JS_LAN_9."\\n\\n".CONTENT_ADMIN_JS_LAN_0."\\n\\n[".CONTENT_ADMIN_JS_LAN_6." ".$catid." : ".$delete_heading."]\\n\\n")."')\"/>"; - - $row['content_heading'] = $tp->toHTML($row['content_heading'], TRUE, ""); - $row['content_subheading'] = $tp->toHTML($row['content_subheading'], TRUE, ""); - $text .= " - ".($row['content_parent'] == 0 ? "" : "")." - - - - - - - "; + $text .= $tp -> parseTemplate($CONTENT_ADMIN_CATEGORY_TABLE, FALSE, $content_shortcodes); } } - $text .= " -
".CONTENT_ADMIN_CAT_LAN_24."".CONTENT_ADMIN_CAT_LAN_25."".CONTENT_ADMIN_CAT_LAN_18."".CONTENT_ADMIN_CAT_LAN_19."".CONTENT_ADMIN_CAT_LAN_20."
".$catid."".($row['content_icon'] ? "" : " ")."".($authordetails[0] != "0" ? "".CONTENT_ICON_USER."" : "")." ".$authordetails[1]." - ".CONTENT_ICON_LINK." - ".$pre.$row['content_heading']." ".($row['content_subheading'] ? "[".$row['content_subheading']."]" : "")." - - ".$options." -
- ".$rs -> form_close()." -
"; + $text .= $tp -> parseTemplate($CONTENT_ADMIN_CATEGORY_END, FALSE, $content_shortcodes); } $ns -> tablerender(CONTENT_ADMIN_CAT_LAN_10, $text); unset($row['content_id'], $row['content_heading'], $row['content_subheading'], $row['content_text'], $row['content_icon']); } function manager(){ - global $qs, $sql, $ns, $rs, $aa, $plugintable, $plugindir, $tp, $stylespacer, $eArrayStorage; + global $qs, $sql, $ns, $rs, $aa, $plugintable, $plugindir, $tp, $content_shortcodes, $stylespacer, $eArrayStorage, $CONTENT_ADMIN_MANAGER_START, $CONTENT_ADMIN_MANAGER_TABLE, $CONTENT_ADMIN_MANAGER_END, $catarray, $catid, $row, $pre; $catarray = $aa -> getCategoryTree("", "", FALSE); $array = array_keys($catarray); @@ -1481,15 +1048,7 @@ class contentform{ if(!is_array($array)){ $text = "
".CONTENT_ADMIN_CAT_LAN_9."
"; }else{ - $text = " -
- ".$rs -> form_open("post", e_SELF."?".$qs[0], "catform","","", "")." - - - - - - "; + $text = $tp -> parseTemplate($CONTENT_ADMIN_MANAGER_START, FALSE, $content_shortcodes); if(!is_object($sql)){ $sql = new db; } foreach($array as $catid){ @@ -1497,60 +1056,10 @@ class contentform{ $text .= "
".CONTENT_ADMIN_CAT_LAN_9."
"; }else{ $row = $sql -> db_Fetch(); - - $content_pref = $eArrayStorage->ReadArray($row['content_pref']); - $content_cat_icon_path_large = $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]); - $content_cat_icon_path_small = $tp -> replaceConstants($content_pref["content_cat_icon_path_small"]); - $delete_heading = str_replace("'", "\'", $row['content_heading']); - $authordetails = $aa -> getAuthor($row['content_author']); - $caticon = $content_cat_icon_path_large.$row['content_icon']; - - $pre = ""; - if($row['content_parent'] == "0"){ //main parent level - $class = "forumheader3"; - $mainparentid = $row['content_id']; - }else{ //sub level - $class = "forumheader3"; - for($b=0;$b<(count($catarray[$catid])/2)-1;$b++){ - $pre .= "_"; - } - } - - //$pcmusers = ""; - $options = "".CONTENT_ICON_CONTENTMANAGER_SMALL.""; - /* - if(isset($row['content_pref'])){ - $pcmcontent_pref = $eArrayStorage->ReadArray($row['content_pref']); - } - if(isset($pcmcontent_pref["content_manager_allowed_{$catid}"])){ - $pcm = explode(",", $pcmcontent_pref["content_manager_allowed_{$catid}"]); - if($pcm[0]==""){ unset($pcm[0]); } - $pcmusers = count($pcm); - $options .= " ".($pcmusers ? "(".$pcmusers." ".($pcmusers == 1 ? CONTENT_ADMIN_CAT_LAN_54 : CONTENT_ADMIN_CAT_LAN_55).")" : ""); - } - */ - - $row['content_heading'] = $tp->toHTML($row['content_heading'], TRUE, ""); - $row['content_subheading'] = $tp->toHTML($row['content_subheading'], TRUE, ""); - - $text .= " - ".($row['content_parent'] == 0 ? "" : "")." - - - - - "; + $text .= $tp -> parseTemplate($CONTENT_ADMIN_MANAGER_TABLE, FALSE, $content_shortcodes); } } - $text .= " -
".CONTENT_ADMIN_CAT_LAN_24."".CONTENT_ADMIN_CAT_LAN_19."".CONTENT_ADMIN_CAT_LAN_20."
".$catid." - ".CONTENT_ICON_LINK." - ".$pre.$row['content_heading']." ".($row['content_subheading'] ? "[".$row['content_subheading']."]" : "")." - - ".$options." -
- ".$rs -> form_close()." -
"; + $text .= $tp -> parseTemplate($CONTENT_ADMIN_MANAGER_END, FALSE, $content_shortcodes); } $ns -> tablerender(CONTENT_ADMIN_CAT_LAN_10, $text); unset($row['content_id'], $row['content_heading'], $row['content_subheading'], $row['content_text'], $row['content_icon']); @@ -1558,10 +1067,9 @@ class contentform{ function manager_category(){ - global $plugintable, $qs, $sql, $ns, $rs, $aa, $eArrayStorage; + global $plugintable, $qs, $sql, $ns, $rs, $aa, $eArrayStorage, $tp, $content_shortcodes, $CONTENT_ADMIN_MANAGER_CATEGORY, $CONTENT_ADMIN_BUTTON; - if(!getperms("0")){ js_location(e_SELF); } - if(!is_numeric($qs[1])){ js_location(e_SELF); } + if( !getperms("0") || !is_numeric($qs[1]) ){ js_location(e_SELF); } if(!is_object($sql)){ $sql = new db; } if(!$sql -> db_Select($plugintable, "content_id, content_heading, content_pref", "content_id='".intval($qs[1])."' ")){ @@ -1570,59 +1078,20 @@ class contentform{ $row = $sql -> db_Fetch(); $caption = CONTENT_ADMIN_CAT_LAN_30." : ".$row['content_heading']; } - $content_pref = $eArrayStorage->ReadArray($row['content_pref']); - $qs[1] = intval($qs[1]); - - $text = " -
- ".$rs -> form_open("post", e_SELF."?".e_QUERY, "managerform", "", "enctype='multipart/form-data'")." - - - - - - - - - - - - - - - - -
- ".CONTENT_ADMIN_MANAGER_LAN_0."
".CONTENT_ADMIN_MANAGER_LAN_1."
-
- ".r_userclass("content_manager_approve", $content_pref["content_manager_approve"], 'off', "public,guest,nobody,member,admin,classes")." -
- ".CONTENT_ADMIN_MANAGER_LAN_2."
".CONTENT_ADMIN_MANAGER_LAN_3."
-
- ".r_userclass("content_manager_personal", $content_pref["content_manager_personal"], 'off', "public,guest,nobody,member,admin,classes")." -
- ".CONTENT_ADMIN_MANAGER_LAN_4."
".CONTENT_ADMIN_MANAGER_LAN_5."
-
- ".r_userclass("content_manager_category", $content_pref["content_manager_category"], 'off', "public,guest,nobody,member,admin,classes")." -
- ".$rs -> form_button("submit", "update_manager", LAN_SAVE)." - ".$rs -> form_hidden("options_type", $qs[1])." -
- ".$rs -> form_close()." -
"; - + $content_pref = $eArrayStorage->ReadArray($row['content_pref']); + $CONTENT_ADMIN_BUTTON = $rs -> form_button("submit", "update_manager", LAN_SAVE)." ".$rs -> form_hidden("options_type", intval($qs[1])); + $text = $tp -> parseTemplate($CONTENT_ADMIN_MANAGER_CATEGORY, FALSE, $content_shortcodes); $ns -> tablerender($caption, $text); } function show_create_category(){ - global $qs, $plugintable, $plugindir, $sql, $ns, $rs, $aa, $fl, $pref, $tp; - global $message, $content_parent, $content_heading, $content_subheading, $content_text, $content_icon, $content_comment, $content_rate, $content_pe, $content_class; - global $stylespacer, $TOPIC_ROW_SPACER, $TOPIC_ROW, $TOPIC_ROW_NOEXPAND; + global $qs, $plugintable, $plugindir, $sql, $ns, $rs, $aa, $fl, $pref, $tp, $content_shortcodes, $row, $message; + global $show, $CONTENT_ADMIN_CAT_CREATE, $CONTENT_ADMIN_FORM_TARGET, $CONTENT_ADMIN_BUTTON, $CATFORM_CATEGORY; + global $content_cat_icon_path_large, $content_cat_icon_path_small, $months, $current_year, $ne_day, $ne_month, $ne_year, $end_day, $end_month, $end_year; $months = array(CONTENT_ADMIN_DATE_LAN_0, CONTENT_ADMIN_DATE_LAN_1, CONTENT_ADMIN_DATE_LAN_2, CONTENT_ADMIN_DATE_LAN_3, CONTENT_ADMIN_DATE_LAN_4, CONTENT_ADMIN_DATE_LAN_5, CONTENT_ADMIN_DATE_LAN_6, CONTENT_ADMIN_DATE_LAN_7, CONTENT_ADMIN_DATE_LAN_8, CONTENT_ADMIN_DATE_LAN_9, CONTENT_ADMIN_DATE_LAN_10, CONTENT_ADMIN_DATE_LAN_11); if(!is_object($sql)){ $sql = new db; } - $formurl = e_SELF."?".e_QUERY; $array = $aa -> getCategoryTree("", "", FALSE); $mainparent = $aa -> getMainParent( (isset($qs[3]) && is_numeric($qs[3]) ? $qs[3] : (isset($qs[2]) && is_numeric($qs[2]) ? $qs[2] : "0") ) ); $content_pref = $aa -> getContentPref($mainparent); @@ -1633,7 +1102,6 @@ class contentform{ if(!$sql -> db_Select($plugintable, "*", "content_id='".intval($qs[2])."' ")){ header("location:".e_SELF."?cat"); exit; } - $formurl = e_SELF."?".e_QUERY; } if( $qs[0] == "cat" && $qs[1] == "edit" && isset($qs[2]) && is_numeric($qs[2]) ){ if(!$sql -> db_Select($plugintable, "*", "content_id='".intval($qs[2])."' ")){ @@ -1645,19 +1113,16 @@ class contentform{ } $menuheading = $row['content_heading']; } - $formurl = e_SELF."?".e_QUERY; } - + if(isset($_POST['preview_category'])){ - $formurl = e_SELF."?".e_QUERY; $cat_heading = $tp -> post_toHTML($_POST['cat_heading']); $cat_subheading = $tp -> post_toHTML($_POST['cat_subheading']); - //$cat_text = $tp -> post_toHTML($_POST['cat_text']); if(e_WYSIWYG){ $_POST['cat_text'] = $tp->createConstants($_POST['cat_text']); // convert e107_images/ to {e_IMAGE} etc. } $cat_text = $tp->post_toHTML($_POST['cat_text'],TRUE); - + $text = "
@@ -1680,14 +1145,13 @@ class contentform{
".CONTENT_ADMIN_CAT_LAN_16."".($_POST['cat_pe'] == "1" ? CONTENT_ADMIN_ITEM_LAN_85 : CONTENT_ADMIN_ITEM_LAN_86)."
"; - + $ns -> tablerender($cat_heading, $text); } if( isset($_POST['preview_category']) || isset($message) || isset($_POST['uploadcaticon']) ){ $row['content_heading'] = $tp -> post_toForm($_POST['cat_heading']); $row['content_subheading'] = $tp -> post_toForm($_POST['cat_subheading']); - //$row['content_text'] = $tp -> post_toForm($_POST['cat_text']); if(e_WYSIWYG){ $_POST['cat_text'] = $tp->toHTML($_POST['cat_text'],$parseBB = TRUE); // parse the bbcodes to we can edit as html. $_POST['cat_text'] = $tp->replaceConstants($_POST['cat_text'],TRUE); // eg. replace {e_IMAGE} with e107_images/ and NOT ../e107_images @@ -1710,67 +1174,7 @@ class contentform{ } } - //check which areas should be visible (dependent on options in admin:create category) - $checksubheading = (isset($content_pref["content_admincat_subheading"]) ? $content_pref["content_admincat_subheading"] : (isset($content_pref["content_admincat_subheading"]) ? $content_pref["content_admincat_subheading"] : "")); - - $checkstartdate = (isset($content_pref["content_admincat_startdate"]) ? $content_pref["content_admincat_startdate"] : (isset($content_pref["content_admincat_startdate"]) ? $content_pref["content_admincat_startdate"] : "")); - - $checkenddate = (isset($content_pref["content_admincat_enddate"]) ? $content_pref["content_admincat_enddate"] : (isset($content_pref["content_admincat_enddate"]) ? $content_pref["content_admincat_enddate"] : "")); - - $checkuploadicon = (isset($content_pref["content_admincat_uploadicon"]) ? $content_pref["content_admincat_uploadicon"] : (isset($content_pref["content_admincat_uploadicon"]) ? $content_pref["content_admincat_uploadicon"] : "")); - - $checkselecticon = (isset($content_pref["content_admincat_selecticon"]) ? $content_pref["content_admincat_selecticon"] : (isset($content_pref["content_admincat_selecticon"]) ? $content_pref["content_admincat_selecticon"] : "")); - - $checkcomment = (isset($content_pref["content_admincat_comment"]) ? $content_pref["content_admincat_comment"] : (isset($content_pref["content_admincat_comment"]) ? $content_pref["content_admincat_comment"] : "")); - - $checkrating = (isset($content_pref["content_admincat_rating"]) ? $content_pref["content_admincat_rating"] : (isset($content_pref["content_admincat_rating"]) ? $content_pref["content_admincat_rating"] : "")); - - $checkpe = (isset($content_pref["content_admincat_pe"]) ? $content_pref["content_admincat_pe"] : (isset($content_pref["content_admincat_pe"]) ? $content_pref["content_admincat_pe"] : "")); - - $checkvisibility = (isset($content_pref["content_admincat_visibility"]) ? $content_pref["content_admincat_visibility"] : (isset($content_pref["content_admincat_visibility"]) ? $content_pref["content_admincat_visibility"] : "")); - - $text = " -
- ".$rs -> form_open("post", $formurl, "dataform", "", "enctype='multipart/form-data'")." - "; - - //category parent - $TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_27; - if($qs[1] == "create"){ - $parent = (isset($qs[3]) && is_numeric($qs[3]) ? $qs[3] : (isset($qs[2]) && is_numeric($qs[2]) ? $qs[2] : "0") ); - }elseif($qs[1] == "edit"){ - if(isset($qs[3]) && is_numeric($qs[3])){ - $parent = $qs[3]; - }else{ - $parent = ( strpos($row['content_parent'], ".") ? substr($row['content_parent'],2) : ""); - } - } - $TOPIC_FIELD = $aa -> ShowOptionCat($parent).$rs->form_hidden("parent", ""); - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); - $text .= $TOPIC_ROW_SPACER; - - $row['content_heading'] = (isset($row['content_heading']) ? $row['content_heading'] : ""); - $TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_2; - $TOPIC_FIELD = $rs -> form_text("cat_heading", 90, $row['content_heading'], 250); - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); - - if($checksubheading){ - $row['content_subheading'] = (isset($row['content_subheading']) ? $row['content_subheading'] : ""); - $TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_3; - $TOPIC_FIELD = $rs -> form_text("cat_subheading", 90, $row['content_subheading'], 250); - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); - }else{ - $hidden .= $rs -> form_hidden("cat_subheading", $row['content_subheading']); - } - - $row['content_text'] = (isset($row['content_text']) ? $row['content_text'] : ""); - require_once(e_HANDLER."ren_help.php"); - $TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_4; - $insertjs = (!$pref['wysiwyg'] ? "onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'" : ""); - $TOPIC_FIELD = $rs -> form_textarea("cat_text", 80, 20, $row['content_text'], $insertjs)."
"; - if (!$pref['wysiwyg']) { $TOPIC_FIELD .= $rs -> form_text("helpb", 90, '', '', "helpbox")."
". display_help("helpb"); } - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); - + //date parsing if(isset($row['content_datestamp']) && $row['content_datestamp'] != "0"){ $startdate = getdate($row['content_datestamp']); $ne_day = $startdate['mday']; @@ -1791,176 +1195,94 @@ class contentform{ $end_month = (isset($end_month) ? $end_month : ""); $end_year = (isset($end_year) ? $end_year : ""); } - $smarray = getdate(); $current_year = $smarray['year']; - $text .= $TOPIC_ROW_SPACER; - - if($checkstartdate){ - $TOPIC_TOPIC = CONTENT_ADMIN_DATE_LAN_15; - $TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_73; - $TOPIC_HELP = CONTENT_ADMIN_DATE_LAN_17; - $TOPIC_FIELD = " - ".$rs -> form_select_open("ne_day")." - ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_12, 0, "none"); - for($count=1; $count<=31; $count++){ - $TOPIC_FIELD .= $rs -> form_option($count, ($ne_day == $count ? "1" : "0"), $count); - } - $TOPIC_FIELD .= $rs -> form_select_close()." - ".$rs -> form_select_open("ne_month")." - ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_13, 0, "none"); - for($count=1; $count<=12; $count++){ - $TOPIC_FIELD .= $rs -> form_option($months[($count-1)], ($ne_month == $count ? "1" : "0"), $count); - } - $TOPIC_FIELD .= $rs -> form_select_close()." - ".$rs -> form_select_open("ne_year")." - ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_14, 0, "none"); - for($count=($current_year-5); $count<=$current_year; $count++){ - $TOPIC_FIELD .= $rs -> form_option($count, ($ne_year == $count ? "1" : "0"), $count); - } - $TOPIC_FIELD .= $rs -> form_select_close(); - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + //check which areas should be visible (dependent on options in admin:create category) + if(isset($content_pref["content_admincat_subheading"]) && $content_pref["content_admincat_subheading"]){ + $show['subheading'] = true; }else{ + $show['subheading'] = false; + $hidden .= $rs -> form_hidden("cat_subheading", $row['content_subheading']); + } + if(isset($content_pref["content_admincat_startdate"]) && $content_pref["content_admincat_startdate"]){ + $show['startdate'] = true; + }else{ + $show['startdate'] = false; $hidden .= $rs -> form_hidden("ne_day", $ne_day); $hidden .= $rs -> form_hidden("ne_month", $ne_month); $hidden .= $rs -> form_hidden("ne_year", $ne_year); } - - if($checkenddate){ - $TOPIC_TOPIC = CONTENT_ADMIN_DATE_LAN_16; - $TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_74; - $TOPIC_HELP = CONTENT_ADMIN_DATE_LAN_18; - $TOPIC_FIELD = " - ".$rs -> form_select_open("end_day")." - ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_12, 1, "none"); - for($count=1; $count<=31; $count++){ - $TOPIC_FIELD .= $rs -> form_option($count, ($end_day == $count ? "1" : "0"), $count); - } - $TOPIC_FIELD .= $rs -> form_select_close()." - ".$rs -> form_select_open("end_month")." - ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_13, 1, "none"); - for($count=1; $count<=12; $count++){ - $TOPIC_FIELD .= $rs -> form_option($months[($count-1)], ($end_month == $count ? "1" : "0"), $count); - } - $TOPIC_FIELD .= $rs -> form_select_close()." - ".$rs -> form_select_open("end_year")." - ".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_14, 1, "none"); - for($count=($current_year-5); $count<=$current_year; $count++){ - $TOPIC_FIELD .= $rs -> form_option($count, ($end_year == $count ? "1" : "0"), $count); - } - $TOPIC_FIELD .= $rs -> form_select_close(); - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); + if(isset($content_pref["content_admincat_enddate"]) && $content_pref["content_admincat_enddate"]){ + $show['enddate'] = true; }else{ + $show['enddate'] = false; $hidden .= $rs -> form_hidden("end_day", $end_day); $hidden .= $rs -> form_hidden("end_month", $end_month); $hidden .= $rs -> form_hidden("end_year", $end_year); } - - $rejectlist = array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*'); - $iconlist = $fl->get_files($content_cat_icon_path_large,"",$rejectlist); - - if($checkuploadicon){ - $TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_63; - $TOPIC_HEADING = CONTENT_ADMIN_CAT_LAN_61; - $TOPIC_HELP = ""; - $TOPIC_FIELD = ""; - if(!FILE_UPLOADS){ - $TOPIC_FIELD .= "".CONTENT_ADMIN_ITEM_LAN_21.""; - }else{ - if(!is_writable($content_cat_icon_path_large)){ - $TOPIC_FIELD .= "".CONTENT_ADMIN_ITEM_LAN_22." ".$content_cat_icon_path_large." ".CONTENT_ADMIN_ITEM_LAN_23."
"; - } - $TOPIC_FIELD .= CONTENT_ADMIN_CAT_LAN_62." - - - - "; - } - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); - } - - if($checkselecticon){ - $row['content_icon'] = (isset($row['content_icon']) ? $row['content_icon'] : ""); - $TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_5; - $TOPIC_FIELD = " - ".$rs -> form_text("cat_icon", 60, $row['content_icon'], 100)." - ".$rs -> form_button("button", '', CONTENT_ADMIN_CAT_LAN_8, "onclick=\"expandit('divcaticon')\"")." - "; - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + if(isset($content_pref["content_admincat_uploadicon"]) && $content_pref["content_admincat_uploadicon"]){ + $show['uploadicon'] = true; }else{ + $show['uploadicon'] = false; + } + if(isset($content_pref["content_admincat_selecticon"]) && $content_pref["content_admincat_selecticon"]){ + $show['selecticon'] = true; + }else{ + $show['selecticon'] = false; $hidden .= $rs -> form_hidden("cat_icon", $row['content_icon']); } - - if($checkcomment){ - $row['content_comment'] = (isset($row['content_comment']) ? $row['content_comment'] : ""); - $TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_14; - $TOPIC_FIELD = " - ".$rs -> form_radio("cat_comment", "1", ($row['content_comment'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85." - ".$rs -> form_radio("cat_comment", "0", ($row['content_comment'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86; - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + if(isset($content_pref["content_admincat_comment"]) && $content_pref["content_admincat_comment"]){ + $show['comment'] = true; }else{ + $show['comment'] = false; $hidden .= $rs -> form_hidden("cat_comment", $row['content_comment']); } - - if($checkrating){ - $row['content_rate'] = (isset($row['content_rate']) ? $row['content_rate'] : ""); - $TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_15; - $TOPIC_FIELD = " - ".$rs -> form_radio("cat_rate", "1", ($row['content_rate'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85." - ".$rs -> form_radio("cat_rate", "0", ($row['content_rate'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86; - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + if(isset($content_pref["content_admincat_rating"]) && $content_pref["content_admincat_rating"]){ + $show['rating'] = true; }else{ + $show['rating'] = false; $hidden .= $rs -> form_hidden("cat_rate", $row['content_rate']); } - - if($checkpe){ - $row['content_pe'] = (isset($row['content_pe']) ? $row['content_pe'] : ""); - $TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_16; - $TOPIC_FIELD = " - ".$rs -> form_radio("cat_pe", "1", ($row['content_pe'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85." - ".$rs -> form_radio("cat_pe", "0", ($row['content_pe'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86; - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + if(isset($content_pref["content_admincat_pe"]) && $content_pref["content_admincat_pe"]){ + $show['pe'] = true; }else{ + $show['pe'] = false; $hidden .= $rs -> form_hidden("cat_pe", $row['content_pe']); } - - if($checkvisibility){ - $row['content_class'] = (isset($row['content_class']) ? $row['content_class'] : ""); - $TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_17; - $TOPIC_FIELD = r_userclass("cat_class",$row['content_class'], "CLASSES"); - $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); + if(isset($content_pref["content_admincat_visibility"]) && $content_pref["content_admincat_visibility"]){ + $show['visibility'] = true; }else{ + $show['visibility'] = false; $hidden .= $rs -> form_hidden("cat_class", $row['content_class']); } - $text .= $TOPIC_ROW_SPACER; - $text .= " - - - -
".$hidden; - if($qs[1] == "edit" && is_numeric($qs[2]) ){ - $js = "onclick=\"document.getElementById('parent').value = document.getElementById('parent1').options[document.getElementById('parent1').selectedIndex].label;\" "; - $text .= $rs -> form_button("submit", "preview_category", (isset($_POST['preview_category']) ? CONTENT_ADMIN_MAIN_LAN_27 : CONTENT_ADMIN_MAIN_LAN_26), $js); - $text .= $rs -> form_button("submit", "update_category", CONTENT_ADMIN_CAT_LAN_7, $js).$rs -> form_button("submit", "category_clear", CONTENT_ADMIN_CAT_LAN_21).$rs -> form_hidden("cat_id", $qs[2]).$rs -> form_hidden("id", $qs[2]).$rs -> form_hidden("menuheading", $menuheading); - - $caption = CONTENT_ADMIN_CAT_LAN_1; + //category parent + if($qs[1] == "create"){ + $parent = (isset($qs[3]) && is_numeric($qs[3]) ? $qs[3] : (isset($qs[2]) && is_numeric($qs[2]) ? $qs[2] : "0") ); + }elseif($qs[1] == "edit"){ + if(isset($qs[3]) && is_numeric($qs[3])){ + $parent = $qs[3]; }else{ - $js = "onclick=\"document.getElementById('parent').value = document.getElementById('parent1').options[document.getElementById('parent1').selectedIndex].label;\" "; - $text .= $rs -> form_button("submit", "preview_category", (isset($_POST['preview_category']) ? CONTENT_ADMIN_MAIN_LAN_27 : CONTENT_ADMIN_MAIN_LAN_26), $js); - $text .= $rs -> form_button("submit", "create_category", CONTENT_ADMIN_CAT_LAN_6, $js); - $caption = CONTENT_ADMIN_CAT_LAN_0; + $parent = ( strpos($row['content_parent'], ".") ? substr($row['content_parent'],2) : ""); } - $text .= " -
- ".$rs -> form_close()." -
"; + } + $CATFORM_CATEGORY = $aa -> ShowOption($parent, "category"); + //submit/preview button + $button = $hidden; + if($qs[1] == "edit" && is_numeric($qs[2]) ){ + $button .= $rs -> form_button("submit", "preview_category", (isset($_POST['preview_category']) ? CONTENT_ADMIN_MAIN_LAN_27 : CONTENT_ADMIN_MAIN_LAN_26)); + $button .= $rs -> form_button("submit", "update_category", CONTENT_ADMIN_CAT_LAN_7).$rs -> form_button("submit", "category_clear", CONTENT_ADMIN_CAT_LAN_21).$rs -> form_hidden("cat_id", $qs[2]).$rs -> form_hidden("id", $qs[2]).$rs -> form_hidden("menuheading", $menuheading); + }else{ + $button .= $rs -> form_button("submit", "preview_category", (isset($_POST['preview_category']) ? CONTENT_ADMIN_MAIN_LAN_27 : CONTENT_ADMIN_MAIN_LAN_26)); + $button .= $rs -> form_button("submit", "create_category", CONTENT_ADMIN_CAT_LAN_6); + } + $CONTENT_ADMIN_BUTTON = $button; + + $text = $tp -> parseTemplate($CONTENT_ADMIN_CAT_CREATE, FALSE, $content_shortcodes); + + $caption = ($qs[1] == "edit" && is_numeric($qs[2]) ? CONTENT_ADMIN_CAT_LAN_1 : CONTENT_ADMIN_CAT_LAN_0); $ns -> tablerender($caption, $text); } @@ -2002,7 +1324,7 @@ class contentform{ function show_order(){ - global $qs, $sql, $ns, $rs, $aa, $plugintable, $plugindir, $tp, $stylespacer; + global $qs, $sql, $sql2, $ns, $rs, $aa, $plugintable, $plugindir, $tp, $content_shortcodes, $content_pref, $CONTENT_ADMIN_ORDER_START, $CONTENT_ADMIN_ORDER_TABLE, $CONTENT_ADMIN_ORDER_END, $CONTENT_ADMIN_ORDER_UPDOWN, $CONTENT_ADMIN_ORDER_SELECT, $stylespacer, $catarray, $catid, $CONTENT_ADMIN_ORDER_AMOUNT, $CONTENT_ADMIN_ORDER_CAT, $CONTENT_ADMIN_ORDER_CATALL, $CONTENT_ADMIN_BUTTON, $row; if(!getperms("0")){ header("location:".e_SELF); exit; } @@ -2015,19 +1337,8 @@ class contentform{ if(!is_array($array)){ $text = "
".CONTENT_ADMIN_CAT_LAN_9."
"; }else{ - $text = " -
- ".$rs -> form_open("post", e_SELF."?order", "orderform")." - - - - - - - - - - "; + + $text = $tp -> parseTemplate($CONTENT_ADMIN_ORDER_START, FALSE, $content_shortcodes); if(!is_object($sql)){ $sql = new db; } foreach($array as $catid){ @@ -2036,21 +1347,7 @@ class contentform{ }else{ $row = $sql -> db_Fetch(); - $content_pref = $aa -> getContentPref($catarray[$catid][0]); - $content_cat_icon_path_large = $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]); - $content_cat_icon_path_small = $tp -> replaceConstants($content_pref["content_cat_icon_path_small"]); - $authordetails = $aa -> getAuthor($row['content_author']); - $caticon = $content_cat_icon_path_large.$row['content_icon']; - - $pre = ""; - if($row['content_parent'] == "0"){ //main parent level - $class = "forumheader"; - }else{ //sub level - $class = "forumheader3"; - for($b=0;$b<(count($catarray[$catid])/2)-1;$b++){ - $pre .= "_"; - } - } + $content_pref = $aa -> getContentPref($catarray[$catid][0]); //count subcategories for a main parent if($row['content_parent'] == 0){ @@ -2061,83 +1358,45 @@ class contentform{ $ordermax = count($subs)-1; } + $CONTENT_ADMIN_ORDER_CAT = ""; + $CONTENT_ADMIN_ORDER_CATALL = ""; + //count items in category - $ordercat = ""; - $ordercatall = ""; - $up = ""; - $down = ""; - $selectorder = ""; - - $sqlc = new db; - $n = $sqlc -> db_Count($plugintable, "(*)", "WHERE content_parent='".intval($catid)."' AND content_refer != 'sa' "); + if(!is_object($sql2)){ $sql2 = new db; } + $n = $sql2 -> db_Count($plugintable, "(*)", "WHERE content_parent='".intval($catid)."' AND content_refer != 'sa' "); if($n > 1){ - $ordercat = "".CONTENT_ICON_ORDERCAT.""; - $ordercatall = ($row['content_parent'] == 0 ? "".CONTENT_ICON_ORDERALL."" : ""); + $CONTENT_ADMIN_ORDER_CAT = "".CONTENT_ICON_ORDERCAT.""; + $CONTENT_ADMIN_ORDER_CATALL = ($row['content_parent'] == 0 ? "".CONTENT_ICON_ORDERALL."" : ""); } - $amount = "(".($n == 1 ? $n." ".CONTENT_ADMIN_CAT_LAN_56 : $n." ".CONTENT_ADMIN_CAT_LAN_57).")"; - - //if($ordermax > 1){ - //up arrow - if($row['content_order'] != 1 && $row['content_order'] != 0){ - $up = "".CONTENT_ICON_ORDER_UP." "; - }else{ - $up = "   "; - } - //down arrow - if($row['content_order'] != $ordermax){ - $down = "".CONTENT_ICON_ORDER_DOWN.""; - }else{ - $down = "   "; - } - //select box - //if($ordermax > 1){ + $CONTENT_ADMIN_ORDER_AMOUNT = "(".($n == 1 ? $n." ".CONTENT_ADMIN_CAT_LAN_56 : $n." ".CONTENT_ADMIN_CAT_LAN_57).")"; - $selectorder = " - "; - //} - //} - $row['content_heading'] = $tp->toHTML($row['content_heading'], TRUE, ""); - $row['content_subheading'] = $tp->toHTML($row['content_subheading'], TRUE, ""); + //up arrow + if($row['content_order'] != 1 && $row['content_order'] != 0){ + $up = "".CONTENT_ICON_ORDER_UP." "; + }else{ + $up = "   "; + } + //down arrow + if($row['content_order'] != $ordermax){ + $down = "".CONTENT_ICON_ORDER_DOWN.""; + }else{ + $down = "   "; + } + $CONTENT_ADMIN_ORDER_UPDOWN = $up.$down; - $text .= " - ".($row['content_parent'] == 0 ? "" : "")." - - - - - - - - - "; + //select box + $sel = ""; + $CONTENT_ADMIN_ORDER_SELECT = $sel; + + $text .= $tp -> parseTemplate($CONTENT_ADMIN_ORDER_TABLE, FALSE, $content_shortcodes); } } - $text .= " - - - - - -
".CONTENT_ADMIN_CAT_LAN_24."".CONTENT_ADMIN_CAT_LAN_25."".CONTENT_ADMIN_CAT_LAN_18."".CONTENT_ADMIN_CAT_LAN_19."".CONTENT_ADMIN_ITEM_LAN_58."".CONTENT_ADMIN_ITEM_LAN_59."".CONTENT_ADMIN_ITEM_LAN_60."
".$catid."".($row['content_icon'] ? "" : " ")."".($authordetails[0] != "0" ? "".CONTENT_ICON_USER."" : "")." ".$authordetails[1]." - ".CONTENT_ICON_LINK." - ".$pre.$row['content_heading']." ".($row['content_subheading'] ? "[".$row['content_subheading']."]" : "")." ".$amount." - - ".$ordercat." - ".$ordercatall." - - ".$up." - ".$down." - - ".$selectorder." -
  - ".$rs -> form_button("submit", "update_order", CONTENT_ADMIN_ITEM_LAN_61)." -
- ".$rs -> form_close()." -
"; + $CONTENT_ADMIN_BUTTON = $rs -> form_button("submit", "update_order", CONTENT_ADMIN_ITEM_LAN_61); + $text .= $tp -> parseTemplate($CONTENT_ADMIN_ORDER_END, FALSE, $content_shortcodes); } $ns -> tablerender(CONTENT_ADMIN_ITEM_LAN_62, $text); } @@ -2145,196 +1404,86 @@ class contentform{ function show_content_order($mode){ - global $sql, $ns, $rs, $qs, $plugintable, $plugindir, $aa, $tp; + global $sql2, $ns, $rs, $qs, $plugintable, $plugindir, $aa, $tp, $content_shortcodes, $CONTENT_ADMIN_ORDER_CONTENT_START, $CONTENT_ADMIN_ORDER_CONTENT_TABLE, $CONTENT_ADMIN_ORDER_CONTENT_END, $CONTENT_ADMIN_FORM_TARGET, $CONTENT_ADMIN_BUTTON, $CONTENT_ADMIN_ORDER_UPDOWN, $CONTENT_ADMIN_ORDER_SELECT, $row; $allcats = $aa -> getCategoryTree("", "", FALSE); if($mode == "ci"){ + $qrystring = "order.".$qs[1].".".$qs[2]; $formtarget = e_SELF."?order.".$qs[1].".".$qs[2]; $qry = "content_parent = '".intval($qs[2])."' "; $order = "SUBSTRING_INDEX(content_order, '.', 1)+0"; - }elseif($mode == "ai"){ + $qrystring = "order.".$qs[1]; + $formtarget = e_SELF."?order.".$qs[1]; $array = $aa -> getCategoryTree("", intval($qs[1]), FALSE); $validparent = implode(",", array_keys($array)); $qry = " content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' "; - $formtarget = e_SELF."?order.".$qs[1]; $order = "SUBSTRING_INDEX(content_order, '.', -1)+0"; } $content_pref = $aa -> getContentPref(intval($qs[1])); - $content_icon_path = $tp -> replaceConstants($content_pref["content_icon_path"]); - $sqlo = new db; - if(!$content_total = $sqlo -> db_Select($plugintable, "content_id, content_heading, content_author, content_parent, content_order", "content_refer != 'sa' AND ".$qry." ORDER BY ".$order." ASC, content_heading DESC ")){ + if(!$content_total = $sql2 -> db_Select($plugintable, "content_id, content_heading, content_author, content_parent, content_order", "content_refer != 'sa' AND ".$qry." ORDER BY ".$order." ASC, content_heading DESC ")){ $text = "
".CONTENT_ADMIN_ITEM_LAN_4."
"; }else{ - $text = " -
- ".$rs -> form_open("post", $formtarget, "orderform")." - - - - - - - - - "; - - while($row = $sqlo -> db_Fetch()){ - $delete_heading = str_replace("'", "\'", $row['content_heading']); - $authordetails = $aa -> getAuthor($row['content_author']); - $caticon = (isset($row['content_icon']) ? $content_icon_path.$row['content_icon'] : ""); - $deleteicon = CONTENT_ICON_DELETE; + $CONTENT_ADMIN_FORM_TARGET = $formtarget; + $text = $tp -> parseTemplate($CONTENT_ADMIN_ORDER_CONTENT_START, FALSE, $content_shortcodes); + while($row = $sql2 -> db_Fetch()){ $tmp = explode(".", $row['content_order']); if(!$tmp[1]){ $tmp[1] = "0"; } $row['content_order'] = $tmp[0]."-".$tmp[1]; - if($mode == "ci"){ - $ordercheck = $tmp[0]; - $ordercheck2 = $tmp[1]; - $qrystring = "order.".$qs[1].".".$qs[2]; - }elseif($mode == "ai"){ - $ordercheck = $tmp[1]; - $ordercheck2 = $tmp[0]; - $qrystring = "order.".$qs[1]; - } + $ccheck = ($mode=='ci' ? $tmp[0] : $tmp[1]); $cid = $row['content_id']; $corder = $row['content_order']; - if(array_key_exists($row['content_parent'], $allcats)){ - $mainparentid = $allcats[$row['content_parent']][0]; - } //up arrow - if($ordercheck != 1 && $ordercheck != 0){ + if($ccheck != 1 && $ccheck != 0){ $up = "".CONTENT_ICON_ORDER_UP." "; }else{ $up = "   "; } //down arrow - if($ordercheck != $content_total){ + if($ccheck != $content_total){ $down = "".CONTENT_ICON_ORDER_DOWN.""; }else{ $down = "   "; } - $row['content_heading'] = $tp->toHTML($row['content_heading'], TRUE, ""); + $CONTENT_ADMIN_ORDER_UPDOWN = $up.$down; - $text .= " - - - - - - - "; + //selectbox order + $sel = ""; + $CONTENT_ADMIN_ORDER_SELECT = $sel; + + $text .= $tp -> parseTemplate($CONTENT_ADMIN_ORDER_CONTENT_TABLE, FALSE, $content_shortcodes); } - $text .= " - - - - -
".CONTENT_ADMIN_MAIN_LAN_2."
".CONTENT_ADMIN_ITEM_LAN_8."".CONTENT_ADMIN_ITEM_LAN_10."".CONTENT_ADMIN_ITEM_LAN_11."".CONTENT_ADMIN_ITEM_LAN_59."".CONTENT_ADMIN_ITEM_LAN_60."
".$cid." - ".($authordetails[0] != "0" ? "".CONTENT_ICON_USER."" : "")." ".$authordetails[1]." - - ".CONTENT_ICON_LINK." - ".$row['content_heading']." (".$row['content_order'].") - ".$up." - ".$down." - - -
  - ".$rs -> form_button("submit", "update_order", CONTENT_ADMIN_ITEM_LAN_61)." -
- ".$rs -> form_close()." -
"; + $CONTENT_ADMIN_BUTTON = $rs -> form_button("submit", "update_order", CONTENT_ADMIN_ITEM_LAN_61); + $text .= $tp -> parseTemplate($CONTENT_ADMIN_ORDER_CONTENT_END, FALSE, $content_shortcodes); } $ns -> tablerender(CONTENT_ADMIN_ITEM_LAN_65, $text); return; } function show_options(){ - global $sql, $ns, $rs, $aa, $plugintable, $plugindir, $tp, $stylespacer; + global $sql2, $ns, $rs, $aa, $plugintable, $plugindir, $tp, $content_shortcodes, $stylespacer, $pref, $row, $content_pref, $content_cat_icon_path_large, $CONTENT_ADMIN_OPTIONS_START, $CONTENT_ADMIN_OPTIONS_TABLE, $CONTENT_ADMIN_OPTIONS_END; - $lan_file = $plugindir."languages/".e_LANGUAGE."/lan_content_options.php"; - include_once(file_exists($lan_file) ? $lan_file : $plugindir."languages/English/lan_content_options.php"); + include_lan($plugindir."languages/".e_LANGUAGE."/lan_content_options.php"); - $text = " -
- ".$rs -> form_open("post", e_SELF."?option", "optionsform","","", "")." - - - - - - - - - "; + $text = $tp -> parseTemplate($CONTENT_ADMIN_OPTIONS_START, FALSE, $content_shortcodes); - $content_pref = $aa -> getContentPref(0); - $content_cat_icon_path_large = $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]); - $content_cat_icon_path_small = $tp -> replaceConstants($content_pref["content_cat_icon_path_small"]); - - $text .= " - - - - - - - - - - "; + $content_pref = $aa -> getContentPref(0); - $sqlo = new db; - if($category_total = $sqlo -> db_Select($plugintable, "*", "content_parent='0' ")){ - while($row = $sqlo -> db_Fetch()){ - - $content_pref = $aa -> getContentPref($row['content_id']); - $content_cat_icon_path_large = $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]); - $content_cat_icon_path_small = $tp -> replaceConstants($content_pref["content_cat_icon_path_small"]); - $authordetails = $aa -> getAuthor($row['content_author']); - $caticon = $content_cat_icon_path_large.$row['content_icon']; - - $text .= " - - - - - - - - "; - //".$rs -> form_checkbox("content_inherit[".$row['content_id']."]", 1, (isset($content_pref['content_inherit']) ? "1" : "0"))." + if($category_total = $sql2 -> db_Select($plugintable, "*", "content_parent='0' ")){ + while($row = $sql2 -> db_Fetch()){ + $content_pref = $aa -> getContentPref($row['content_id']); + $text .= $tp -> parseTemplate($CONTENT_ADMIN_OPTIONS_TABLE, FALSE, $content_shortcodes); } } - - $text .= " - - - - -
".CONTENT_ADMIN_CAT_LAN_24."".CONTENT_ADMIN_CAT_LAN_25."".CONTENT_ADMIN_CAT_LAN_18."".CONTENT_ADMIN_CAT_LAN_19."".CONTENT_ADMIN_CAT_LAN_20."".CONTENT_ADMIN_OPT_LAN_167."
".CONTENT_ADMIN_OPT_LAN_1." - ".CONTENT_ICON_OPTIONS." -
".$row['content_id']."".($row['content_icon'] ? "" : " ")."".($authordetails[0] != "0" ? "".CONTENT_ICON_USER."" : "")." ".$authordetails[1]." - ".CONTENT_ICON_LINK." - ".$row['content_heading']." ".($row['content_subheading'] ? "[".$row['content_subheading']."]" : "")." - - ".CONTENT_ICON_OPTIONS." - - - -
- -
- ".$rs -> form_close()." -
"; - + $text .= $tp -> parseTemplate($CONTENT_ADMIN_OPTIONS_END, FALSE, $content_shortcodes); $ns -> tablerender(CONTENT_ADMIN_MENU_LAN_6, $text); } diff --git a/e107_plugins/content/templates/content_admin_template.php b/e107_plugins/content/templates/content_admin_template.php new file mode 100644 index 000000000..c3eb652bc --- /dev/null +++ b/e107_plugins/content/templates/content_admin_template.php @@ -0,0 +1,580 @@ + + ".$rs -> form_open("post", e_SELF."?option", "optionsform","","", "")." + + + + + + + + + + + + + + + + + + + "; +} +if(!isset($CONTENT_ADMIN_OPTIONS_TABLE)){ + $CONTENT_ADMIN_OPTIONS_TABLE = " + + + + + + + + "; +} +if(!isset($CONTENT_ADMIN_OPTIONS_END)){ + $CONTENT_ADMIN_OPTIONS_END = " + + + + +
".CONTENT_ADMIN_CAT_LAN_24."".CONTENT_ADMIN_CAT_LAN_25."".CONTENT_ADMIN_CAT_LAN_18."".CONTENT_ADMIN_CAT_LAN_19."".CONTENT_ADMIN_CAT_LAN_20."".CONTENT_ADMIN_OPT_LAN_167."
".CONTENT_ADMIN_OPT_LAN_1." + ".CONTENT_ICON_OPTIONS." +
{CONTENT_ID}{CONTENT_CAT_ICON}{CONTENT_AUTHOR} + {CONTENT_LINK_CATEGORY} {CONTENT_HEADING} {CONTENT_SUBHEADING} + + {CONTENT_LINK_OPTION} + + {CONTENT_INHERIT} +
+ +
+ + "; +} + + +// ##### CONTENT ERROR -------------------------------------------------- +if(!isset($CONTENT_ADMIN_ERROR)){ + $CONTENT_ADMIN_ERROR = "
".CONTENT_ADMIN_CAT_LAN_9."
"; +} + + +// ##### CONTENT MANAGER -------------------------------------------------- +if(!isset($CONTENT_ADMIN_MANAGER_START)){ + $CONTENT_ADMIN_MANAGER_START = " +
+ ".$rs -> form_open("post", e_SELF."?".$qs[0], "catform","","", "")." + + + + + + "; +} +if(!isset($CONTENT_ADMIN_MANAGER_TABLE)){ + $CONTENT_ADMIN_MANAGER_TABLE = " + + + + + "; +} +if(!isset($CONTENT_ADMIN_MANAGER_END)){ + $CONTENT_ADMIN_MANAGER_END = " +
".CONTENT_ADMIN_CAT_LAN_24."".CONTENT_ADMIN_CAT_LAN_19."".CONTENT_ADMIN_CAT_LAN_20."
{CONTENT_ID} + {CONTENT_LINK_CATEGORY} {CONTENT_MANAGER_PRE}{CONTENT_HEADING} {CONTENT_SUBHEADING} + + {CONTENT_LINK_MANAGER} +
+ ".$rs -> form_close()." +
"; +} + + +// ##### CONTENT MANAGER CATEGORY -------------------------------------------------- +if(!isset($CONTENT_ADMIN_MANAGER_CATEGORY)){ + $CONTENT_ADMIN_MANAGER_CATEGORY = " +
+ ".$rs -> form_open("post", e_SELF."?".e_QUERY, "managerform", "", "enctype='multipart/form-data'")." + + + + + + + + + + + + + + + + +
+ ".CONTENT_ADMIN_MANAGER_LAN_0."
".CONTENT_ADMIN_MANAGER_LAN_1."
+
+ {CONTENT_ADMIN_MANAGER_APPROVE} +
+ ".CONTENT_ADMIN_MANAGER_LAN_2."
".CONTENT_ADMIN_MANAGER_LAN_3."
+
+ {CONTENT_ADMIN_MANAGER_PERSONAL} +
+ ".CONTENT_ADMIN_MANAGER_LAN_4."
".CONTENT_ADMIN_MANAGER_LAN_5."
+
+ {CONTENT_ADMIN_MANAGER_CATEGORY} +
+ {CONTENT_ADMIN_BUTTON} +
+ +
"; +} + + +// ##### CONTENT CATEGORY -------------------------------------------------- +if(!isset($CONTENT_ADMIN_CATEGORY_START)){ + $CONTENT_ADMIN_CATEGORY_START = " +
+ ".$rs -> form_open("post", e_SELF."?".$qs[0], "catform","","", "")." + + + + + + + + "; +} +if(!isset($CONTENT_ADMIN_CATEGORY_TABLE)){ + $CONTENT_ADMIN_CATEGORY_TABLE = " + + + + + + + "; +} +if(!isset($CONTENT_ADMIN_CATEGORY_END)){ + $CONTENT_ADMIN_CATEGORY_END = " +
".CONTENT_ADMIN_CAT_LAN_24."".CONTENT_ADMIN_CAT_LAN_25."".CONTENT_ADMIN_CAT_LAN_18."".CONTENT_ADMIN_CAT_LAN_19."".CONTENT_ADMIN_CAT_LAN_20."
{CONTENT_ID}{CONTENT_CAT_ICON}{CONTENT_AUTHOR} + {CONTENT_LINK_CATEGORY} {CONTENT_MANAGER_PRE}{CONTENT_HEADING} {CONTENT_SUBHEADING} + + {CONTENT_ADMIN_OPTIONS} +
+ +
"; +} + + +// ##### CONTENT SUBMITTED -------------------------------------------------- +if(!isset($CONTENT_ADMIN_SUBMITTED_START)){ + $CONTENT_ADMIN_SUBMITTED_START = " +
+ ".$rs -> form_open("post", e_SELF, "submittedform","","", "")." + + + + + + + + + "; +} +if(!isset($CONTENT_ADMIN_SUBMITTED_TABLE)){ + $CONTENT_ADMIN_SUBMITTED_TABLE = " + + + + + + + + "; +} +if(!isset($CONTENT_ADMIN_SUBMITTED_END)){ + $CONTENT_ADMIN_SUBMITTED_END = " +
".CONTENT_ADMIN_ITEM_LAN_8."".CONTENT_ADMIN_ITEM_LAN_9."".CONTENT_ADMIN_ITEM_LAN_48."".CONTENT_ADMIN_ITEM_LAN_10."".CONTENT_ADMIN_ITEM_LAN_11."".CONTENT_ADMIN_ITEM_LAN_12."
{CONTENT_ID}{CONTENT_ICON}{CONTENT_ADMIN_CATEGORY}{CONTENT_AUTHOR} + {CONTENT_HEADING} {CONTENT_SUBHEADING} + + {CONTENT_ADMIN_OPTIONS} +
+ +
"; +} + + +// ##### CONTENT ORDER -------------------------------------------------- +if(!isset($CONTENT_ADMIN_ORDER_START)){ + $CONTENT_ADMIN_ORDER_START = " +
+ ".$rs -> form_open("post", e_SELF."?order", "orderform")." + + + + + + + + + + "; +} +if(!isset($CONTENT_ADMIN_ORDER_TABLE)){ + $CONTENT_ADMIN_ORDER_TABLE = " + + + + + + + + + "; +} +if(!isset($CONTENT_ADMIN_ORDER_END)){ + $CONTENT_ADMIN_ORDER_END = " + + + + +
".CONTENT_ADMIN_CAT_LAN_24."".CONTENT_ADMIN_CAT_LAN_25."".CONTENT_ADMIN_CAT_LAN_18."".CONTENT_ADMIN_CAT_LAN_19."".CONTENT_ADMIN_ITEM_LAN_58."".CONTENT_ADMIN_ITEM_LAN_59."".CONTENT_ADMIN_ITEM_LAN_60."
{CONTENT_ID}{CONTENT_CAT_ICON}{CONTENT_AUTHOR} + {CONTENT_LINK_CATEGORY} + {CONTENT_MANAGER_PRE}{CONTENT_HEADING} {CONTENT_SUBHEADING} {CONTENT_ADMIN_ORDER_AMOUNT} + + {CONTENT_ADMIN_ORDER_CAT} + {CONTENT_ADMIN_ORDER_CATALL} + + {CONTENT_ADMIN_ORDER_UPDOWN} + + {CONTENT_ADMIN_ORDER_SELECT} +
  + {CONTENT_ADMIN_BUTTON} +
+ +
"; +} + + +// ##### CONTENT ORDER CONTENT -------------------------------------------------- +if(!isset($CONTENT_ADMIN_ORDER_CONTENT_START)){ + $CONTENT_ADMIN_ORDER_CONTENT_START = " +
+ ".$rs -> form_open("post", "{CONTENT_ADMIN_FORM_TARGET}", "orderform")." + + + + + + + + + "; +} +if(!isset($CONTENT_ADMIN_ORDER_CONTENT_TABLE)){ + $CONTENT_ADMIN_ORDER_CONTENT_TABLE = " + + + + + + + "; +} +if(!isset($CONTENT_ADMIN_ORDER_CONTENT_END)){ + $CONTENT_ADMIN_ORDER_CONTENT_END = " + + + + +
".CONTENT_ADMIN_MAIN_LAN_2."
".CONTENT_ADMIN_ITEM_LAN_8."".CONTENT_ADMIN_ITEM_LAN_10."".CONTENT_ADMIN_ITEM_LAN_11."".CONTENT_ADMIN_ITEM_LAN_59."".CONTENT_ADMIN_ITEM_LAN_60."
{CONTENT_ID} + {CONTENT_AUTHOR} + + {CONTENT_LINK} {CONTENT_HEADING} ({CONTENT_ORDER}) + + {CONTENT_ADMIN_ORDER_UPDOWN} + + {CONTENT_ADMIN_ORDER_SELECT} +
  + {CONTENT_ADMIN_BUTTON} +
+ +
"; +} + + +// ##### CONTENT ITEM LIST : LETTERINDEX -------------------------------------------------- +if(!isset($CONTENT_ADMIN_CONTENT_LIST_LETTER)){ + $CONTENT_ADMIN_CONTENT_LIST_LETTER = " +
+
+ + + +
".CONTENT_ADMIN_ITEM_LAN_6."
{CONTENT_ADMIN_LETTERINDEX}
+
+
"; +} + + +// ##### CONTENT ITEM LIST -------------------------------------------------- +if(!isset($CONTENT_ADMIN_CONTENT_LIST_START)){ + $CONTENT_ADMIN_CONTENT_LIST_START = " +
+ ".$rs -> form_open("post", e_SELF."?".e_QUERY, "deletecontentform","","", "")." + + + + + + + + "; +} +if(!isset($CONTENT_ADMIN_CONTENT_LIST_TABLE)){ + $CONTENT_ADMIN_CONTENT_LIST_TABLE = " + + + + + + + "; +} +if(!isset($CONTENT_ADMIN_CONTENT_LIST_END)){ + $CONTENT_ADMIN_CONTENT_LIST_END = " +
".CONTENT_ADMIN_ITEM_LAN_8."".CONTENT_ADMIN_ITEM_LAN_9."".CONTENT_ADMIN_ITEM_LAN_10."".CONTENT_ADMIN_ITEM_LAN_11."".CONTENT_ADMIN_ITEM_LAN_12."
{CONTENT_ID}{CONTENT_ICON}{CONTENT_AUTHOR} + {CONTENT_LINK_ITEM} {CONTENT_HEADING} {CONTENT_SUBHEADING} + {CONTENT_ADMIN_OPTIONS} +
+ +
"; +} + + +// ##### CONTENT CATEGORY SELECTOR -------------------------------------------------- +if(!isset($CONTENT_ADMIN_CONTENT_CATSELECT)){ + $CONTENT_ADMIN_CONTENT_CATSELECT = " +
+ + + + + + +
".CONTENT_ADMIN_MAIN_LAN_2."
".CONTENT_ADMIN_CAT_LAN_27."{CONTENTFORM_CATEGORYSELECT}
+
"; +} + + +// ##### CONTENT CATEGORY CREATE -------------------------------------------------- + +$sc_style['CATFORM_CATEGORY']['pre'] = "".CONTENT_ADMIN_CAT_LAN_27.""; +$sc_style['CATFORM_CATEGORY']['post'] = ""; + +$sc_style['CATFORM_HEADING']['pre'] = "".CONTENT_ADMIN_CAT_LAN_2.""; +$sc_style['CATFORM_HEADING']['post'] = ""; + +$sc_style['CATFORM_SUBHEADING']['pre'] = "".CONTENT_ADMIN_CAT_LAN_3.""; +$sc_style['CATFORM_SUBHEADING']['post'] = ""; + +$sc_style['CATFORM_TEXT']['pre'] = "".CONTENT_ADMIN_CAT_LAN_4.""; +$sc_style['CATFORM_TEXT']['post'] = ""; + +$sc_style['CATFORM_DATESTART']['pre'] = "".CONTENT_ADMIN_DATE_LAN_15."".CONTENT_ADMIN_DATE_LAN_17."

"; +$sc_style['CATFORM_DATESTART']['post'] = ""; + +$sc_style['CATFORM_DATEEND']['pre'] = "".CONTENT_ADMIN_DATE_LAN_16."".CONTENT_ADMIN_DATE_LAN_18."

"; +$sc_style['CATFORM_DATEEND']['post'] = ""; + +$sc_style['CATFORM_UPLOAD']['pre'] = "".CONTENT_ADMIN_CAT_LAN_63.""; +$sc_style['CATFORM_UPLOAD']['post'] = ""; + +$sc_style['CATFORM_ICON']['pre'] = "".CONTENT_ADMIN_CAT_LAN_5.""; +$sc_style['CATFORM_ICON']['post'] = ""; + +$sc_style['CATFORM_COMMENT']['pre'] = "".CONTENT_ADMIN_CAT_LAN_14.""; +$sc_style['CATFORM_COMMENT']['post'] = ""; + +$sc_style['CATFORM_RATING']['pre'] = "".CONTENT_ADMIN_CAT_LAN_15.""; +$sc_style['CATFORM_RATING']['post'] = ""; + +$sc_style['CATFORM_PEICON']['pre'] = "".CONTENT_ADMIN_CAT_LAN_16.""; +$sc_style['CATFORM_PEICON']['post'] = ""; + +$sc_style['CATFORM_VISIBILITY']['pre'] = "".CONTENT_ADMIN_CAT_LAN_17.""; +$sc_style['CATFORM_VISIBILITY']['post'] = ""; + +if(!isset($CONTENT_ADMIN_CAT_CREATE)){ + $CONTENT_ADMIN_CAT_CREATE = " +
+ ".$rs -> form_open("post", e_SELF."?".e_QUERY, "dataform", "", "enctype='multipart/form-data'")." + + {CATFORM_CATEGORY} + {CATFORM_HEADING} + {CATFORM_SUBHEADING} + {CATFORM_TEXT} + {CATFORM_DATESTART} + {CATFORM_DATEEND} + {CATFORM_UPLOAD} + {CATFORM_ICON} + {CATFORM_COMMENT} + {CATFORM_RATING} + {CATFORM_PEICON} + {CATFORM_VISIBILITY} + +
{CONTENT_ADMIN_BUTTON}
+ +
"; +} + + +// ##### CONTENT CONTENT CREATE -------------------------------------------------- + +$sc_style['CONTENTFORM_CATEGORY']['pre'] = "".CONTENT_ADMIN_CAT_LAN_27.""; +$sc_style['CONTENTFORM_CATEGORY']['post'] = ""; + +$sc_style['CONTENTFORM_HEADING']['pre'] = "".CONTENT_ADMIN_ITEM_LAN_11.""; +$sc_style['CONTENTFORM_HEADING']['post'] = ""; + +$sc_style['CONTENTFORM_SUBHEADING']['pre'] = "".CONTENT_ADMIN_ITEM_LAN_16.""; +$sc_style['CONTENTFORM_SUBHEADING']['post'] = ""; + +$sc_style['CONTENTFORM_SUMMARY']['pre'] = "".CONTENT_ADMIN_ITEM_LAN_17.""; +$sc_style['CONTENTFORM_SUMMARY']['post'] = ""; + +$sc_style['CONTENTFORM_TEXT']['pre'] = "".CONTENT_ADMIN_ITEM_LAN_18.""; +$sc_style['CONTENTFORM_TEXT']['post'] = ""; + +$sc_style['CONTENTFORM_AUTHOR']['pre'] = "".CONTENT_ADMIN_ITEM_LAN_51."(".CONTENT_ADMIN_ITEM_LAN_71.")
"; +$sc_style['CONTENTFORM_AUTHOR']['post'] = ""; + +$sc_style['CONTENTFORM_DATESTART']['pre'] = "".CONTENT_ADMIN_DATE_LAN_15."".CONTENT_ADMIN_DATE_LAN_17."

"; +$sc_style['CONTENTFORM_DATESTART']['post'] = ""; + +$sc_style['CONTENTFORM_DATEEND']['pre'] = "".CONTENT_ADMIN_DATE_LAN_16."".CONTENT_ADMIN_DATE_LAN_18."

"; +$sc_style['CONTENTFORM_DATEEND']['post'] = ""; + +$sc_style['CONTENTFORM_UPLOAD']['pre'] = "".CONTENT_ADMIN_ITEM_LAN_104."".CONTENT_ADMIN_ITEM_LAN_112."
".CONTENT_ADMIN_ITEM_LAN_113."
"; +$sc_style['CONTENTFORM_UPLOAD']['post'] = ""; + +$sc_style['CONTENTFORM_ICON']['pre'] = "".CONTENT_ADMIN_ITEM_LAN_20."".CONTENT_ADMIN_ITEM_LAN_75."
"; +$sc_style['CONTENTFORM_ICON']['post'] = ""; + +$sc_style['CONTENTFORM_ATTACH']['pre'] = "".CONTENT_ADMIN_ITEM_LAN_24."".CONTENT_ADMIN_ITEM_LAN_76."
"; +$sc_style['CONTENTFORM_ATTACH']['post'] = ""; + +$sc_style['CONTENTFORM_IMAGES']['pre'] = "".CONTENT_ADMIN_ITEM_LAN_31."".CONTENT_ADMIN_ITEM_LAN_77."
"; +$sc_style['CONTENTFORM_IMAGES']['post'] = ""; + +$sc_style['CONTENTFORM_COMMENT']['pre'] = "".CONTENT_ADMIN_ITEM_LAN_36.""; +$sc_style['CONTENTFORM_COMMENT']['post'] = ""; + +$sc_style['CONTENTFORM_RATING']['pre'] = "".CONTENT_ADMIN_ITEM_LAN_37.""; +$sc_style['CONTENTFORM_RATING']['post'] = ""; + +$sc_style['CONTENTFORM_PEICON']['pre'] = "".CONTENT_ADMIN_ITEM_LAN_38.""; +$sc_style['CONTENTFORM_PEICON']['post'] = ""; + +$sc_style['CONTENTFORM_VISIBILITY']['pre'] = "".CONTENT_ADMIN_ITEM_LAN_39.""; +$sc_style['CONTENTFORM_VISIBILITY']['post'] = ""; + +$sc_style['CONTENTFORM_SCORE']['pre'] = "".CONTENT_ADMIN_ITEM_LAN_40.""; +$sc_style['CONTENTFORM_SCORE']['post'] = ""; + +$sc_style['CONTENTFORM_META']['pre'] = "".CONTENT_ADMIN_ITEM_LAN_53."".CONTENT_ADMIN_ITEM_LAN_70."
"; +$sc_style['CONTENTFORM_META']['post'] = ""; + +$sc_style['CONTENTFORM_LAYOUT']['pre'] = "".CONTENT_ADMIN_ITEM_LAN_92.""; +$sc_style['CONTENTFORM_LAYOUT']['post'] = ""; + +$sc_style['CONTENTFORM_CUSTOM']['pre'] = "".CONTENT_ADMIN_ITEM_LAN_54."".CONTENT_ADMIN_ITEM_LAN_84."
".CONTENT_ADMIN_ITEM_LAN_68."
"; +$sc_style['CONTENTFORM_CUSTOM']['post'] = ""; + +if(!isset($CONTENT_ADMIN_CONTENT_CREATE)){ + $CONTENT_ADMIN_CONTENT_CREATE = " +
+ ".$rs -> form_open("post", e_SELF."?".e_QUERY, "dataform", "", "enctype='multipart/form-data'")." + + {CONTENTFORM_CATEGORY} + {CONTENTFORM_HEADING} + {CONTENTFORM_SUBHEADING} + {CONTENTFORM_SUMMARY} + {CONTENTFORM_TEXT} + {CONTENTFORM_AUTHOR} + {CONTENTFORM_DATESTART} + {CONTENTFORM_DATEEND} + {CONTENTFORM_UPLOAD} + {CONTENTFORM_ICON} + {CONTENTFORM_ATTACH} + {CONTENTFORM_IMAGES} + {CONTENTFORM_COMMENT} + {CONTENTFORM_RATING} + {CONTENTFORM_PEICON} + {CONTENTFORM_VISIBILITY} + {CONTENTFORM_SCORE} + {CONTENTFORM_META} + {CONTENTFORM_LAYOUT} + {CONTENTFORM_CUSTOM} + {CONTENTFORM_PRESET} + +
{CONTENT_ADMIN_BUTTON}
+ +
"; +} + + +//custom tags +if(!isset($CONTENT_ADMIN_CONTENT_CREATE_CUSTOMSTART)){ + $CONTENT_ADMIN_CONTENT_CREATE_CUSTOMSTART = ""; +} +if(!isset($CONTENT_ADMIN_CONTENT_CREATE_CUSTOMTABLE)){ + $CONTENT_ADMIN_CONTENT_CREATE_CUSTOMTABLE = " + + + + "; +} +if(!isset($CONTENT_ADMIN_CONTENT_CREATE_CUSTOMEND)){ + $CONTENT_ADMIN_CONTENT_CREATE_CUSTOMEND = "
{CONTENTFORM_CUSTOM_KEY}{CONTENTFORM_CUSTOM_VALUE}
"; +} + + +//preset tags +if(!isset($CONTENT_ADMIN_CONTENT_CREATE_PRESET)){ + $CONTENT_ADMIN_CONTENT_CREATE_PRESET = " + + {CONTENTFORM_PRESET_KEY} + {CONTENTFORM_PRESET_VALUE} + "; +} + +?> \ No newline at end of file