From 61d302993ee8e65dd27424be3af2ca16e909202b Mon Sep 17 00:00:00 2001 From: lia Date: Tue, 13 Mar 2007 16:51:05 +0000 Subject: [PATCH] content: LARGE update, redesign 'personal manager and submit' area, general code improvements, redesign admin options interface etc. --- e107_plugins/content/admin_content_config.php | 346 +++--- e107_plugins/content/content.php | 94 +- e107_plugins/content/content_manager.php | 158 ++- e107_plugins/content/content_shortcodes.php | 622 +++++----- e107_plugins/content/content_submit.php | 137 --- e107_plugins/content/content_update.php | 11 +- e107_plugins/content/content_update_check.php | 13 +- e107_plugins/content/e_emailprint.php | 4 +- e107_plugins/content/e_frontpage.php | 3 +- e107_plugins/content/e_latest.php | 3 +- e107_plugins/content/e_notify.php | 9 +- e107_plugins/content/e_rss.php | 2 - e107_plugins/content/e_search.php | 7 +- e107_plugins/content/e_status.php | 3 +- .../content/handlers/content_class.php | 723 ++++++------ .../handlers/content_convert_class.php | 12 +- .../content/handlers/content_db_class.php | 45 +- .../content/handlers/content_defines.php | 6 +- .../content/handlers/content_form_class.php | 1035 ++++++++++------- .../content/handlers/content_preset.php | 7 +- e107_plugins/content/help.php | 40 +- .../content/languages/English/lan_content.php | 18 +- .../languages/English/lan_content_admin.php | 78 +- .../languages/English/lan_content_help.php | 43 +- e107_plugins/content/plugin.php | 13 +- .../templates/content_admin_template.php | 97 +- .../templates/content_manager_template.php | 34 +- .../content_submit_type_template.php | 46 - .../templates/content_type_template.php | 16 +- 29 files changed, 1802 insertions(+), 1823 deletions(-) delete mode 100644 e107_plugins/content/content_submit.php delete mode 100644 e107_plugins/content/templates/content_submit_type_template.php diff --git a/e107_plugins/content/admin_content_config.php b/e107_plugins/content/admin_content_config.php index d9363881b..3072009e7 100644 --- a/e107_plugins/content/admin_content_config.php +++ b/e107_plugins/content/admin_content_config.php @@ -12,8 +12,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/content/admin_content_config.php,v $ -| $Revision: 1.5 $ -| $Date: 2007-03-01 09:32:28 $ +| $Revision: 1.6 $ +| $Date: 2007-03-13 16:51:05 $ | $Author: lisa_ $ +---------------------------------------------------------------+ */ @@ -58,8 +58,7 @@ if(e_QUERY){ $qs = explode(".", e_QUERY); } -if(isset($_POST['delete'])) -{ +if(isset($_POST['delete'])){ $tmp = array_pop(array_flip($_POST['delete'])); list($delete, $del_id) = explode("_", $tmp); } @@ -106,6 +105,7 @@ if(isset($delete) && $delete == 'cat'){ } } +//delete content item if(isset($delete) && $delete == 'content'){ if($sql -> db_Delete($plugintable, "content_id='$del_id' ")){ $e107cache->clear($plugintable); @@ -113,6 +113,7 @@ if(isset($delete) && $delete == 'content'){ } } +//delete submitted item if(isset($delete) && $delete == 'submitted'){ if($sql -> db_Delete($plugintable, "content_id='$del_id' ")){ $e107cache->clear($plugintable); @@ -122,10 +123,10 @@ if(isset($delete) && $delete == 'submitted'){ //update options if(isset($_POST['updateoptions'])){ - $content_pref = $aa -> UpdateContentPref($_POST['options_type']); - $message = CONTENT_ADMIN_CAT_LAN_22."

"; + $content_pref = $aa -> UpdateContentPref($_POST['options_type']); + $message = CONTENT_ADMIN_CAT_LAN_22."

"; if($_POST['options_type'] != "0"){ - $message .= $aa -> CreateParentMenu($_POST['options_type']); + $message .= $aa -> CreateParentMenu($_POST['options_type']); } $e107cache->clear($plugintable); } @@ -147,25 +148,38 @@ if(isset($_POST['updateinherit'])){ $tmp = $eArrayStorage->WriteArray($content_pref); $sql2 -> db_Update($plugintable, "content_pref='{$tmp}' WHERE content_id='".intval($k)."' "); } - $message = CONTENT_ADMIN_CAT_LAN_22."

"; + $message = CONTENT_ADMIN_CAT_LAN_22."

"; + $e107cache->clear($plugintable); +} + +//update the inheritance of options +if(isset($_POST['updatemanagerinherit'])){ + foreach($_POST['id'] as $k=>$v){ + //get current + $sql -> db_Select($plugintable, "content_pref", "content_id='".intval($k)."' "); + $row = $sql -> db_Fetch(); + $content_pref = $eArrayStorage->ReadArray($row['content_pref']); + //assign or remove inherit option + if(isset($_POST['content_manager_inherit']) && isset($_POST['content_manager_inherit'][$k]) ){ + $content_pref['content_manager_inherit'] = "1"; + }else{ + unset($content_pref['content_manager_inherit']); + } + //update + $tmp = $eArrayStorage->WriteArray($content_pref); + $sql2 -> db_Update($plugintable, "content_pref='{$tmp}' WHERE content_id='".intval($k)."' "); + } + $message = CONTENT_ADMIN_MANAGER_LAN_8."

"; $e107cache->clear($plugintable); } //update manager classes into preferences if(isset($_POST['update_manager'])){ - $content_pref = $aa -> UpdateContentPref($_POST['options_type']); - $message = CONTENT_ADMIN_CAT_LAN_22."

"; + $content_pref = $aa -> UpdateContentPref($_POST['options_type']); + $message = CONTENT_ADMIN_CAT_LAN_22."

"; $e107cache->clear($plugintable); } -//update page restriction classes into preferences -if(isset($_POST['update_restrict'])){ - $content_pref = $aa -> UpdateContentPref($_POST['options_type']); - $message = CONTENT_ADMIN_CAT_LAN_22."

"; - $e107cache->clear($plugintable); -} - - //pre-upload a new category icon in the create/edit category form if(isset($_POST['uploadcaticon'])){ @@ -183,15 +197,14 @@ if(isset($_POST['uploadcaticon'])){ resize_image($pathiconlarge.$icon, $pathiconsmall.$icon, '16', "copy"); rename($pathiconsmall."thumb_".$icon , $pathiconsmall.$icon); } - $message = ($icon ? CONTENT_ADMIN_CAT_LAN_58 : CONTENT_ADMIN_CAT_LAN_59); - + $message = ($icon ? CONTENT_ADMIN_CAT_LAN_58 : CONTENT_ADMIN_CAT_LAN_59); } if(isset($_POST['create_category'])){ if($_POST['cat_heading'] && $_POST['parent1'] != "none"){ $adb -> dbCategory("create"); }else{ - $message = CONTENT_ADMIN_ITEM_LAN_0; + $message = CONTENT_ADMIN_ITEM_LAN_0; } } @@ -199,25 +212,23 @@ if(isset($_POST['update_category'])){ if($_POST['cat_heading'] && $_POST['parent1'] != "none"){ $adb -> dbCategory("update"); }else{ - $message = CONTENT_ADMIN_ITEM_LAN_0; + $message = CONTENT_ADMIN_ITEM_LAN_0; } } if(isset($_POST['create_content'])){ if($_POST['content_text'] && $_POST['content_heading'] && $_POST['content_author_name'] && $_POST['parent1'] != "none"){ - //$adb -> dbContentCreate("admin"); $adb -> dbContent("create", ""); }else{ - $message = CONTENT_ADMIN_ITEM_LAN_0; + $message = CONTENT_ADMIN_ITEM_LAN_0; } } if(isset($_POST['update_content'])){ if($_POST['content_text'] && $_POST['content_heading'] && $_POST['content_author_name'] && $_POST['content_heading'] && $_POST['parent1'] != "none"){ - //$adb -> dbContentUpdate("admin"); $adb -> dbContent("update", ""); }else{ - $message = CONTENT_ADMIN_ITEM_LAN_0; + $message = CONTENT_ADMIN_ITEM_LAN_0; } } @@ -239,7 +250,8 @@ if(isset($message)){ // ##### End -------------------------------------------------------------------------------------- -if(!e_QUERY){ //show main categories +if(!e_QUERY){ + //show main categories $aform -> show_manage_content("", "", ""); require_once(e_ADMIN."footer.php"); exit; @@ -253,7 +265,8 @@ if(!e_QUERY){ //show main categories //edit content item }elseif($qs[0] == "content" && $qs[1] == "edit" && is_numeric($qs[2]) ){ $newqs = array_reverse($qs); - if($newqs[0] == "cu"){ //item; update redirect + //item; update redirect + if($newqs[0] == "cu"){ $mainparent = $aa -> getMainParent($qs[2]); $message = CONTENT_ADMIN_ITEM_LAN_2."

"; $message .= CONTENT_ADMIN_ITEM_LAN_88." ".CONTENT_ADMIN_ITEM_LAN_90."
"; @@ -270,7 +283,8 @@ if(!e_QUERY){ //show main categories //post submitted content item }elseif($qs[0] == "content" && $qs[1] == "sa" && is_numeric($qs[2]) ){ $newqs = array_reverse($qs); - if($newqs[0] == "cu"){ //item; submit post / update redirect + //item; submit post / update redirect + if($newqs[0] == "cu"){ $mainparent = $aa -> getMainParent($qs[2]); $message = CONTENT_ADMIN_ITEM_LAN_117."

"; $message .= CONTENT_ADMIN_ITEM_LAN_88." ".CONTENT_ADMIN_ITEM_LAN_90."
"; @@ -286,7 +300,8 @@ if(!e_QUERY){ //show main categories //create content item }elseif($qs[0] == "content" && $qs[1] == "create" ){ $newqs = array_reverse($qs); - if($newqs[0] == "cc"){ //item; create redirect + //item; create redirect + if($newqs[0] == "cc"){ $mainparent = $aa -> getMainParent($qs[2]); $message = CONTENT_ADMIN_ITEM_LAN_1."

"; $message .= CONTENT_ADMIN_ITEM_LAN_88." ".CONTENT_ADMIN_ITEM_LAN_90."
"; @@ -297,8 +312,6 @@ if(!e_QUERY){ //show main categories } $aform -> show_create_content("admin", $userid="", $username=""); - - //order : view categories }elseif($qs[0] == "order" && !isset($qs[1])){ $aform -> show_order(); @@ -347,42 +360,28 @@ if(!e_QUERY){ //show main categories $ns -> tablerender("", "
".$message."
"); $aform -> show_order("admin"); - - - + //show submitted content items }elseif($qs[0] == "submitted" && !isset($qs[1]) ){ $aform -> show_submitted(); - - - + //options intro page }elseif($qs[0] == "option" && !isset($qs[1]) ){ $aform -> show_options(); + //options for this top level category }elseif($qs[0] == "option" && isset($qs[1]) && (is_numeric($qs[1]) || $qs[1] == "default") ){ $aform -> show_options_cat(); - - - //category content manager : choose category }elseif($qs[0] == "manager" && !isset($qs[1]) ){ if(!getperms("0")){ header("location:".e_SELF); exit; } - //$aform -> show_admin_contentmanager(); $aform -> manager(); //category content manager : view contentmanager - }elseif($qs[0] == "manager" && isset($qs[1]) && is_numeric($qs[1]) ){ + }elseif($qs[0] == "manager" && isset($qs[1]) && (is_numeric($qs[1]) || $qs[1]=='default') ){ if(!getperms("0")){ header("location:".e_SELF); exit; } - if(isset($qs[2])){ - $message = $adb -> dbAssignAdmins("admin", intval($qs[1]), $qs[2]); - $ns -> tablerender("", "
".$message."
"); - } $aform -> manager_category(); - - - //overview all categories }elseif($qs[0] == "cat" && !isset($qs[1]) ){ $aform -> manage_cat(); @@ -390,181 +389,164 @@ if(!e_QUERY){ //show main categories //create category }elseif($qs[0] == "cat" && $qs[1] == "create" ){ $newqs = array_reverse($qs); - if($newqs[0] == "pc"){ //category; create redirect - $message = CONTENT_ADMIN_CAT_LAN_11."

"; - $message .= "

".CONTENT_ADMIN_CAT_LAN_50."

"; - $message .= " - ".CONTENT_ADMIN_CAT_LAN_44." ".CONTENT_ADMIN_CAT_LAN_43."
- ".CONTENT_ADMIN_CAT_LAN_42." ".CONTENT_ADMIN_CAT_LAN_43."
- "; - $ns -> tablerender("", "
".$message."
"); - require_once(e_ADMIN."footer.php"); - exit; + //category; create redirect + if($newqs[0] == "pc"){ + $message = CONTENT_ADMIN_CAT_LAN_11."

"; + $message .= "

".CONTENT_ADMIN_CAT_LAN_50."

"; + $message .= " + ".CONTENT_ADMIN_CAT_LAN_44." ".CONTENT_ADMIN_CAT_LAN_43."
+ ".CONTENT_ADMIN_CAT_LAN_42." ".CONTENT_ADMIN_CAT_LAN_43."
"; + $ns -> tablerender("", "
".$message."
"); + require_once(e_ADMIN."footer.php"); + exit; } $aform -> show_create_category(); //edit category }elseif($qs[0] == "cat" && $qs[1] == "edit" && is_numeric($qs[2]) ){ $newqs = array_reverse($qs); - if($newqs[0] == "pu"){ //category; update redirect - $message = CONTENT_ADMIN_CAT_LAN_12."

- ".CONTENT_ADMIN_CAT_LAN_42." ".CONTENT_ADMIN_CAT_LAN_43."
- ".CONTENT_ADMIN_CAT_LAN_53." ".CONTENT_ADMIN_CAT_LAN_43."
"; - $ns -> tablerender("", "
".$message."
"); - require_once(e_ADMIN."footer.php"); - exit; + //category; update redirect + if($newqs[0] == "pu"){ + $message = CONTENT_ADMIN_CAT_LAN_12."

+ ".CONTENT_ADMIN_CAT_LAN_42." ".CONTENT_ADMIN_CAT_LAN_43."
+ ".CONTENT_ADMIN_CAT_LAN_53." ".CONTENT_ADMIN_CAT_LAN_43."
"; + $ns -> tablerender("", "
".$message."
"); + require_once(e_ADMIN."footer.php"); + exit; } $aform -> show_create_category(); - - - - //restrict : choose category - }elseif($qs[0] == "restrict" && !isset($qs[1]) ){ - //if(!getperms("0")){ header("location:".e_SELF); exit; } - $aform -> restrict(); - - //restrict : view restrict for main parent - }elseif($qs[0] == "restrict" && isset($qs[1]) && is_numeric($qs[1]) ){ - //if(!getperms("0")){ header("location:".e_SELF); exit; } - $aform -> restrict_category(); } - } - // ##### End -------------------------------------------------------------------------------------- // ##### Display options -------------------------------------------------------------------------- function admin_content_config_adminmenu(){ - global $sql, $plugintable, $aa; + global $sql, $plugintable, $aa; - //toggle to show categories in admin right hand menu - $showadmincat = TRUE; + //toggle to show categories in admin right hand menu; default to false + $showadmincat = FALSE; - if(e_QUERY){ - $qs = explode(".", e_QUERY); - } + if(e_QUERY){ + $qs = explode(".", e_QUERY); + } - if(isset($qs[0]) && $qs[0] == "cat" && isset($qs[1]) && $qs[1] == "create"){ - $act = $qs[0].".".$qs[1]; + if(isset($qs[0]) && $qs[0] == "cat" && isset($qs[1]) && $qs[1] == "create"){ + $act = $qs[0].".".$qs[1]; - }elseif(isset($qs[0]) && $qs[0] == "content" && isset($qs[1]) && $qs[1] == "create"){ - $act = $qs[0].".".$qs[1]; + }elseif(isset($qs[0]) && $qs[0] == "content" && isset($qs[1]) && $qs[1] == "create"){ + $act = $qs[0].".".$qs[1]; - }else{ - $act = (isset($qs[0]) ? $qs[0] : ""); - } + }else{ + $act = (isset($qs[0]) ? $qs[0] : ""); + } - if($act==""){$act="content";} + if($act==""){$act="content";} - $var['content']['text'] = CONTENT_ADMIN_MENU_LAN_0; - $var['content']['link'] = e_SELF; + $var['content']['text'] = CONTENT_ADMIN_MENU_LAN_0; + $var['content']['link'] = e_SELF; - $var['content.create']['text'] = CONTENT_ADMIN_MENU_LAN_1; - $var['content.create']['link'] = e_SELF."?content.create"; + $var['content.create']['text'] = CONTENT_ADMIN_MENU_LAN_1; + $var['content.create']['link'] = e_SELF."?content.create"; - $var['cat']['text'] = CONTENT_ADMIN_MENU_LAN_2; - $var['cat']['link'] = e_SELF."?cat"; + $var['cat']['text'] = CONTENT_ADMIN_MENU_LAN_2; + $var['cat']['link'] = e_SELF."?cat"; - $var['cat.create']['text'] = CONTENT_ADMIN_MENU_LAN_3; - $var['cat.create']['link'] = e_SELF."?cat.create"; + $var['cat.create']['text'] = CONTENT_ADMIN_MENU_LAN_3; + $var['cat.create']['link'] = e_SELF."?cat.create"; - $var['order']['text'] = CONTENT_ADMIN_MENU_LAN_15; - $var['order']['link'] = e_SELF."?order"; + $var['order']['text'] = CONTENT_ADMIN_MENU_LAN_15; + $var['order']['link'] = e_SELF."?order"; - $var['option']['text'] = CONTENT_ADMIN_MENU_LAN_6; - $var['option']['link'] = e_SELF."?option"; + $var['option']['text'] = CONTENT_ADMIN_MENU_LAN_6; + $var['option']['link'] = e_SELF."?option"; - if(getperms("0")){ - $var['manager']['text'] = CONTENT_ADMIN_MENU_LAN_17; - $var['manager']['link'] = e_SELF."?manager"; - } + if(getperms("0")){ + $var['manager']['text'] = CONTENT_ADMIN_MENU_LAN_17; + $var['manager']['link'] = e_SELF."?manager"; + } - if($submittedcontents = $sql -> db_Count($plugintable, "(*)", "WHERE content_refer ='sa' ")){ - $var['submitted']['text'] = CONTENT_ADMIN_MENU_LAN_4." (".$submittedcontents.")"; - $var['submitted']['link'] = e_SELF."?submitted"; - } + if($submittedcontents = $sql -> db_Count($plugintable, "(*)", "WHERE content_refer ='sa' ")){ + $var['submitted']['text'] = CONTENT_ADMIN_MENU_LAN_4." (".$submittedcontents.")"; + $var['submitted']['link'] = e_SELF."?submitted"; + } - show_admin_menu(CONTENT_ADMIN_MENU_LAN_6, $act,$var); + show_admin_menu(CONTENT_ADMIN_MENU_LAN_6, $act,$var); - if(isset($qs[0]) && $qs[0] == "option" && isset($qs[1])){ - unset($var); - $var=array(); - $var['creation']['text'] = CONTENT_ADMIN_MENU_LAN_7; - //$var['catcreation']['text'] = CONTENT_ADMIN_MENU_LAN_23; - $var['submission']['text'] = CONTENT_ADMIN_MENU_LAN_8; - //$var['paththeme']['text'] = CONTENT_ADMIN_MENU_LAN_9; - $var['general']['text'] = CONTENT_ADMIN_MENU_LAN_10; - $var['menu']['text'] = CONTENT_ADMIN_MENU_LAN_14; + if(isset($qs[0]) && $qs[0] == "option" && isset($qs[1])){ + unset($var); + $var=array(); + $var['creation']['text'] = CONTENT_ADMIN_MENU_LAN_7; + $var['general']['text'] = CONTENT_ADMIN_MENU_LAN_10; + $var['menu']['text'] = CONTENT_ADMIN_MENU_LAN_14; - if (!is_object($sql)){ $sql = new db; } - $category_total = $sql -> db_Select($plugintable, "content_heading", "content_id='".$qs[1]."' "); - list($content_heading) = $sql -> db_Fetch(); + if (!is_object($sql)){ $sql = new db; } + $category_total = $sql -> db_Select($plugintable, "content_heading", "content_id='".$qs[1]."' "); + list($content_heading) = $sql -> db_Fetch(); - show_admin_menu(CONTENT_ADMIN_MENU_LAN_6.": ".$content_heading."", $act, $var, TRUE); + show_admin_menu(CONTENT_ADMIN_MENU_LAN_6.": ".$content_heading."", $act, $var, TRUE); + + unset($var); + $var=array(); + $var['recentpages']['text'] = CONTENT_ADMIN_MENU_LAN_11; + $var['catpages']['text'] = CONTENT_ADMIN_MENU_LAN_12; + $var['contentpages']['text'] = CONTENT_ADMIN_MENU_LAN_13; + $var['authorpage']['text'] = CONTENT_ADMIN_MENU_LAN_18; + $var['archivepage']['text'] = CONTENT_ADMIN_MENU_LAN_16; + $var['toppage']['text'] = CONTENT_ADMIN_MENU_LAN_20; + $var['scorepage']['text'] = CONTENT_ADMIN_MENU_LAN_22; + show_admin_menu(CONTENT_ADMIN_MENU_LAN_21.": ".$content_heading."", $act, $var, TRUE); + + }else{ + + if($showadmincat){ + if (!is_object($sql2)){ $sql2 = new db; } + if($category_total = $sql2 -> db_Select($plugintable, "content_id, content_heading", "content_parent='0' ")){ + while($row = $sql2 -> db_Fetch()){ unset($var); $var=array(); - $var['recentpages']['text'] = CONTENT_ADMIN_MENU_LAN_11; - $var['catpages']['text'] = CONTENT_ADMIN_MENU_LAN_12; - $var['contentpages']['text'] = CONTENT_ADMIN_MENU_LAN_13; - $var['authorpage']['text'] = CONTENT_ADMIN_MENU_LAN_18; - $var['archivepage']['text'] = CONTENT_ADMIN_MENU_LAN_16; - $var['toppage']['text'] = CONTENT_ADMIN_MENU_LAN_20; - $var['scorepage']['text'] = CONTENT_ADMIN_MENU_LAN_22; - show_admin_menu(CONTENT_ADMIN_MENU_LAN_21.": ".$content_heading."", $act, $var, TRUE); - }else{ + //get all categories from each main parent + $array = $aa -> getCategoryTree("", $row['content_id'], FALSE); + $newarray = array_merge_recursive($array); - if($showadmincat){ - if (!is_object($sql2)){ $sql2 = new db; } - if($category_total = $sql2 -> db_Select($plugintable, "content_id, content_heading", "content_parent='0' ")){ - while($row = $sql2 -> db_Fetch()){ - - unset($var); - $var=array(); - - $array = $aa -> getCategoryTree("", $row['content_id'], FALSE); //get all categories from each main parent - $newarray = array_merge_recursive($array); - - $newparent=array(); - for($a=0;$a $value){ - $var['c'.$key]['text'] = $value; - $var['c'.$key]['link'] = e_SELF."?content.".$key; - } - if( isset($qs[0]) && $qs[0] == "content" && isset($qs[1]) && $qs[1] == "create"){ - $act = ""; - }elseif( isset($qs[0]) && $qs[0] == "cat" && isset($qs[1]) && ($qs[1] == "create" || $qs[1] == "edit") ){ - $act = ""; - }elseif( isset($qs[0]) && $qs[0] == "order" ){ - $act = ""; - }elseif( isset($qs[0]) && $qs[0] == "manager" ){ - $act = ""; - }else{ - if(isset($qs[0]) && isset($qs[1]) ){ - $act = "c".$qs[1]; - }else{ - $act = "c"; - } - } - - show_admin_menu(CONTENT_ADMIN_MENU_LAN_5." : ".$row['content_heading']."", $act, $var); - } - } + $newparent=array(); + for($a=0;$a $value){ + $var['c'.$key]['text'] = $value; + $var['c'.$key]['link'] = e_SELF."?content.".$key; + } + if( isset($qs[0]) && $qs[0] == "content" && isset($qs[1]) && $qs[1] == "create"){ + $act = ""; + }elseif( isset($qs[0]) && $qs[0] == "cat" && isset($qs[1]) && ($qs[1] == "create" || $qs[1] == "edit") ){ + $act = ""; + }elseif( isset($qs[0]) && $qs[0] == "order" ){ + $act = ""; + }elseif( isset($qs[0]) && $qs[0] == "manager" ){ + $act = ""; + }else{ + if(isset($qs[0]) && isset($qs[1]) ){ + $act = "c".$qs[1]; + }else{ + $act = "c"; + } + } + show_admin_menu(CONTENT_ADMIN_MENU_LAN_5." : ".$row['content_heading']."", $act, $var); + } + } + } + } } // ##### End -------------------------------------------------------------------------------------- require_once(e_ADMIN."footer.php"); -?> +?> \ No newline at end of file diff --git a/e107_plugins/content/content.php b/e107_plugins/content/content.php index 8a877ef61..d97a2d62b 100644 --- a/e107_plugins/content/content.php +++ b/e107_plugins/content/content.php @@ -12,9 +12,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/content/content.php,v $ -| $Revision: 1.6 $ -| $Date: 2007-01-20 16:19:22 $ -| $Author: mrpete $ +| $Revision: 1.7 $ +| $Date: 2007-03-13 16:51:05 $ +| $Author: lisa_ $ +---------------------------------------------------------------+ */ @@ -33,8 +33,7 @@ require_once($plugindir."handlers/content_class.php"); $aa = new content; e107_require_once(e_HANDLER.'arraystorage_class.php'); $eArrayStorage = new ArrayData(); -$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(e_PLUGIN."content/languages/".e_LANGUAGE."/lan_content.php"); if(e_QUERY){ $qs = explode(".", e_QUERY); @@ -320,61 +319,45 @@ function show_content(){ $content_type_table_string .= $tp -> parseTemplate($CONTENT_TYPE_TABLE, FALSE, $content_shortcodes); } - $SUBMIT_LINE = FALSE; - $submit = FALSE; - $sql3 = ""; - if(!is_object($sql3)){ $sql3 = new db; } - if($sql3 -> db_Select($plugintable, "content_id, content_pref", "content_parent = '0' ".$datequery." ORDER BY content_parent")){ - while($row = $sql3 -> db_Fetch()){ + //check if user is allowed on the manager page + $personalmanagercheck = FALSE; + //get all categories + $array = $aa -> getCategoryTree("", "", TRUE); + $catarray = array_keys($array); + $qry = ""; + foreach($catarray as $catid){ + $qry .= " content_id='".$catid."' || "; + } + $qry = substr($qry,0,-3); + if($sql -> db_Select($plugintable, "content_id, content_heading, content_pref", " ".$qry." ")){ + while($row = $sql -> db_Fetch()){ if(isset($row['content_pref']) && $row['content_pref']){ $content_pref = $eArrayStorage->ReadArray($row['content_pref']); } - if($content_pref["content_submit"] && check_class($content_pref["content_submit_class"])){ - $submit = TRUE; + //if inherit is used in the manager, we need to get the preferences from the core plugin table default preferences + //and use those preferences in the permissions check. + if(isset($content_pref['content_manager_inherit']) && $content_pref['content_manager_inherit']){ + $sql2 -> db_Select("core", "*", "e107_name='$plugintable' "); + $row2 = $sql2 -> db_Fetch(); + $content_pref = $eArrayStorage->ReadArray($row2['e107_value']); + } + if( (isset($content_pref["content_manager_submit"]) && check_class($content_pref["content_manager_submit"])) || + (isset($content_pref["content_manager_approve"]) && check_class($content_pref["content_manager_approve"])) || (isset($content_pref["content_manager_personal"]) && check_class($content_pref["content_manager_personal"])) || (isset($content_pref["content_manager_category"]) && check_class($content_pref["content_manager_category"])) ){ + $personalmanagercheck = TRUE; break; } } - if($submit === TRUE){ - $content_type_table_string .= $CONTENT_TYPE_TABLE_LINE; - $content_type_table_string .= $tp -> parseTemplate($CONTENT_TYPE_TABLE_SUBMIT, FALSE, $content_shortcodes); - $SUBMIT_LINE = TRUE; - } + } + if($personalmanagercheck == TRUE){ + $content_type_table_string .= $tp -> parseTemplate($CONTENT_TYPE_TABLE_MANAGER, FALSE, $content_shortcodes); } - if(USERID){ - $personalmanagercheck = FALSE; - $array = $aa -> getCategoryTree("", "", TRUE); - $catarray = array_keys($array); - $qry = ""; - foreach($catarray as $catid){ - $qry .= " content_id='".$catid."' || "; - } - $qry = substr($qry,0,-3); - if($sql -> db_Select($plugintable, "content_id, content_heading, content_pref", " ".$qry." ")){ - while($row = $sql -> db_Fetch()){ - if(isset($row['content_pref']) && $row['content_pref']){ - $content_pref = $eArrayStorage->ReadArray($row['content_pref']); - } - if( (isset($content_pref["content_manager_approve"]) && check_class($content_pref["content_manager_approve"])) || (isset($content_pref["content_manager_personal"]) && check_class($content_pref["content_manager_personal"])) || (isset($content_pref["content_manager_category"]) && check_class($content_pref["content_manager_category"])) ){ - $personalmanagercheck = TRUE; - break; - } - } - } - if($personalmanagercheck == TRUE){ - if($SUBMIT_LINE != TRUE){ - $content_type_table_string .= $CONTENT_TYPE_TABLE_LINE; - } - $content_type_table_string .= $tp -> parseTemplate($CONTENT_TYPE_TABLE_MANAGER, FALSE, $content_shortcodes); - } - } $text = $CONTENT_TYPE_TABLE_START.$content_type_table_string.$CONTENT_TYPE_TABLE_END; } $caption = CONTENT_LAN_22; $ns -> tablerender($caption, $text); $cachecheck = CachePost($cachestr); } - // ##### CONTENT ARCHIVE ------------------------------------------ function show_content_archive(){ global $row, $ns, $plugindir, $plugintable, $sql, $aa, $rs, $e107cache, $tp, $pref, $content_pref, $cobj; @@ -487,7 +470,6 @@ function show_content_archive(){ $text .= $CONTENT_ARCHIVE_TABLE_START.$content_archive_table_string.$CONTENT_ARCHIVE_TABLE_END; } $text = $aa -> getCrumbPage("archive", $array, $mainparent).$text; - //$caption = CONTENT_LAN_84; $caption = $content_pref['content_archive_caption']; $ns->tablerender($caption, $text); $aa -> ShowNextPrev("archive", $from, $number, $contenttotal); @@ -1074,20 +1056,22 @@ function show_content_top(){ if(!is_object($sql)){ $sql = new db; } $total = $sql -> db_Select_gen($qry1); - if($sql->db_Select_gen($qry2)){ + if(!$sql->db_Select_gen($qry2)){ + $text = CONTENT_LAN_37; + }else{ while($row = $sql -> db_Fetch()){ $CONTENT_TOP_TABLE_AUTHOR = $aa -> prepareAuthor("top", $row['content_author'], $row['content_id']); $content_top_table_string .= $tp -> parseTemplate($CONTENT_TOP_TABLE, FALSE, $content_shortcodes); } $content_top_table_string = $aa -> getCrumbPage("top", $array, $mainparent).$content_top_table_string; $text = $CONTENT_TOP_TABLE_START.$content_top_table_string.$CONTENT_TOP_TABLE_END; - $caption = $content_pref['content_top_caption']; - if(isset($content_pref['content_top_caption_append_name']) && $content_pref['content_top_caption_append_name']){ - $caption .= " ".$array[intval($qs[1])][1]; - } - $ns -> tablerender($caption, $text); - $aa -> ShowNextPrev("", $from, $number, $total); } + $caption = $content_pref['content_top_caption']; + if(isset($content_pref['content_top_caption_append_name']) && $content_pref['content_top_caption_append_name']){ + $caption .= " ".$array[intval($qs[1])][1]; + } + $ns -> tablerender($caption, $text); + $aa -> ShowNextPrev("", $from, $number, $total); $cachecheck = CachePost($cachestr); unset($qry, $qry1, $qry2, $array, $validparent, $datequery); } @@ -1307,7 +1291,7 @@ function show_content_item(){ } }else{ - $CONTENT_CONTENT_TABLE_SUMMARY = (isset($content_pref["content_content_summary"]) && $content_pref["content_content_summary"] && $row['content_summary'] ? $tp -> toHTML($row['content_summary'], TRUE, "SUMMARY") : ""); + $CONTENT_CONTENT_TABLE_SUMMARY = (isset($content_pref["content_content_summary"]) && $content_pref["content_content_summary"] && $row['content_summary'] ? $tp -> toHTML($row['content_summary'], TRUE, "SUMMARY") : ""); $CONTENT_CONTENT_TABLE_SUMMARY = $tp -> replaceConstants($CONTENT_CONTENT_TABLE_SUMMARY); $lastpage = TRUE; } diff --git a/e107_plugins/content/content_manager.php b/e107_plugins/content/content_manager.php index a2e6824a5..bd7f69cf6 100644 --- a/e107_plugins/content/content_manager.php +++ b/e107_plugins/content/content_manager.php @@ -12,8 +12,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/content/content_manager.php,v $ -| $Revision: 1.3 $ -| $Date: 2007-01-13 22:33:03 $ +| $Revision: 1.4 $ +| $Date: 2007-03-13 16:51:05 $ | $Author: lisa_ $ +---------------------------------------------------------------+ */ @@ -55,30 +55,33 @@ if(e_QUERY){ // define e_pagetitle $aa -> setPageTitle(); -if(isset($_POST['delete'])){ - $tmp = array_pop(array_flip($_POST['delete'])); - list($delete, $del_id) = explode("_", $tmp); -} - //these have to be set for the tinymce wysiwyg $e_wysiwyg = "content_text"; -//include js -function headerjs(){ - echo "\n"; -} // ##### DB --------------------------------------------------------------------------------------- require_once(HEADERF); +//db : content create if(isset($_POST['create_content'])){ - if($_POST['content_text'] && $_POST['content_heading'] && $_POST['parent'] != "none"){ - $adb -> dbContent("create", "contentmanager"); - }else{ - $message = CONTENT_ADMIN_ITEM_LAN_0; + //content submit + if(isset($qs[1]) && $qs[1] == "submit"){ + if($_POST['content_text'] && $_POST['content_heading'] && $_POST['parent'] != "none" && $_POST['content_author_name'] != "" && $_POST['content_author_email'] != ""){ + $adb -> dbContent("create", "submit"); + }else{ + $message = CONTENT_ADMIN_SUBMIT_LAN_4; + } + //content create (manager) + }elseif(isset($qs[1]) && $qs[1] == "create"){ + if($_POST['content_text'] && $_POST['content_heading'] && $_POST['parent'] != "none"){ + $adb -> dbContent("create", "contentmanager"); + }else{ + $message = CONTENT_ADMIN_ITEM_LAN_0; + } } } +//db : content update if(isset($_POST['update_content'])){ if($_POST['content_text'] && $_POST['content_heading'] && $_POST['parent'] != "none"){ $adb -> dbContent("update", "contentmanager"); @@ -87,6 +90,11 @@ if(isset($_POST['update_content'])){ } } +//db : content delete +if(isset($_POST['delete'])){ + $tmp = array_pop(array_flip($_POST['delete'])); + list($delete, $del_id) = explode("_", $tmp); +} if($delete == 'content' && is_numeric($del_id)){ if($sql -> db_Delete($plugintable, "content_id='$del_id' ")){ $message = CONTENT_ADMIN_ITEM_LAN_3; @@ -94,11 +102,44 @@ if($delete == 'content' && is_numeric($del_id)){ } } +//render message if(isset($message)){ $ns -> tablerender("", "
".$message."
"); } +//db : returned messages + + //content item submitted (with direct posting) + if(isset($qs[0]) && $qs[0] == "s"){ + $message = CONTENT_ADMIN_SUBMIT_LAN_2."

".CONTENT_ADMIN_SUBMIT_LAN_5; + $ns -> tablerender("", "
".$message."
"); + require_once(FOOTERF); + exit; + + //content item submitted and reviewed in due course (without direct posting) + }elseif(isset($qs[0]) && $qs[0] == "d"){ + $message = CONTENT_ADMIN_SUBMIT_LAN_3."

".CONTENT_ADMIN_SUBMIT_LAN_5; + $ns -> tablerender("", "
".$message."
"); + require_once(FOOTERF); + exit; + + //content item created (personal/category manager) + }elseif(isset($qs[0]) && $qs[0] == "c"){ + $message = CONTENT_ADMIN_ITEM_LAN_1."

".CONTENT_ADMIN_ITEM_LAN_55; + $ns -> tablerender("", "
".$message."
"); + require_once(FOOTERF); + exit; + + //content item updated (personal/category manager) + }elseif(isset($qs[0]) && $qs[0] == "u"){ + $message = CONTENT_ADMIN_ITEM_LAN_2."

".CONTENT_ADMIN_ITEM_LAN_55; + $ns -> tablerender("", "
".$message."
"); + require_once(FOOTERF); + exit; + } + if(!e_QUERY){ + //show content manager/submit options if(USERID){ $aform -> show_contentmanager("edit", USERID, USERNAME); require_once(FOOTERF); @@ -108,39 +149,86 @@ if(!e_QUERY){ } }else{ - if($qs[0] == "c"){ - $message = CONTENT_ADMIN_ITEM_LAN_1."

".CONTENT_ADMIN_ITEM_LAN_55; - $ns -> tablerender("", "
".$message."
"); - require_once(FOOTERF); - exit; + //validate permissions + if(isset($qs[1]) && ($qs[1]=='edit' || $qs[1]=='sa') ){ + //on the edit page, the query id holds the content item's id number + //we need to get the category (parent) of the content item first + //this is both on the 'edit' page as well as on the 'post submitted' page. + if(!$sql -> db_Select($plugintable, "content_id, content_parent", "content_id='".intval($qs[2])."' ")){ + //not a valid item, so redirect + header("location: ".e_SELF); exit; + }else{ + $row = $sql -> db_Fetch(); + //parent can be '0' (top level) or '0.X (subcategory) + if(strpos($row['content_parent'], ".")){ + $id = substr($row['content_parent'],2); + }else{ + $id = $row['content_parent']; + } + } - }elseif($qs[0] == "u"){ - $message = CONTENT_ADMIN_ITEM_LAN_2."

".CONTENT_ADMIN_ITEM_LAN_55; - $ns -> tablerender("", "
".$message."
"); - require_once(FOOTERF); - exit; + }else{ + //on other pages in the manager either $qs[2] or $qs[1] holds the category id number + if(isset($qs[2]) && is_numeric($qs[2]) ){ + $id = intval($qs[2]); + }elseif(isset($qs[1]) && is_numeric($qs[1]) ){ + $id = intval($qs[1]); + } + } + if(!isset($id)){ + header("location: ".e_SELF); exit; + } + + //get preferences for this category + $content_pref = $aa->getContentPref($id); + + //if inherit is used in the manager, we need to get the preferences from the core plugin table default preferences + //and use those preferences in the permissions check. + if(isset($content_pref['content_manager_inherit']) && $content_pref['content_manager_inherit']){ + $sql -> db_Select("core", "*", "e107_name='$plugintable' "); + $row = $sql -> db_Fetch(); + $content_pref = $eArrayStorage->ReadArray($row['e107_value']); + } + + //now we can check the permissions for this user + $personalmanagercheck = FALSE; + if( (isset($content_pref["content_manager_approve"]) && check_class($content_pref["content_manager_approve"])) || + (isset($content_pref["content_manager_personal"]) && check_class($content_pref["content_manager_personal"])) || + (isset($content_pref["content_manager_category"]) && check_class($content_pref["content_manager_category"])) || + (isset($content_pref["content_manager_submit"]) && check_class($content_pref["content_manager_submit"])) + ){ + $personalmanagercheck = TRUE; + //user is not allowed here, redirect to content frontpage + }else{ + header("location:".$plugindir."content.php"); exit; + } //show list of items in this category - }elseif($qs[0] == "content" && is_numeric($qs[1])){ + if(isset($qs[0]) && $qs[0] == "content" && is_numeric($qs[1])){ $aform -> show_manage_content("contentmanager", USERID, USERNAME); - //create new item - }elseif($qs[0] == "content" && $qs[1] == "create" && is_numeric($qs[2])){ + //content create (manager) + }elseif(isset($qs[0]) && $qs[0] == "content" && $qs[1] == "create" && is_numeric($qs[2])){ $aform -> show_create_content("contentmanager", USERID, USERNAME); - //edit item - }elseif($qs[0] == "content" && $qs[1] == "edit" && is_numeric($qs[2])){ + //content create (submit) + }elseif(isset($qs[0]) && $qs[0]=="content" && $qs[1] == "submit" && is_numeric($qs[2]) && !isset($qs[3])){ + $aform -> show_create_content("submit", USERID, USERNAME); + + //content edit + }elseif(isset($qs[0]) && $qs[0] == "content" && $qs[1] == "edit" && is_numeric($qs[2])){ $aform -> show_create_content("contentmanager", USERID, USERNAME); - //manage submitted - }elseif($qs[0] == "content" && $qs[1] == "submitted" && is_numeric($qs[2])){ + //display list of submitted content items + }elseif(isset($qs[0]) && $qs[0] == "content" && $qs[1] == "approve" && is_numeric($qs[2])){ //$aform -> show_submitted("contentmanager", USERID, USERNAME, $qs[2]); $aform -> show_submitted($qs[2]); - //post submitted content item - }elseif($qs[0] == "content" && $qs[1] == "sa" && is_numeric($qs[2]) ){ + //approve/post submitted content item + }elseif(isset($qs[0]) && $qs[0] == "content" && $qs[1] == "sa" && is_numeric($qs[2]) ){ $newqs = array_reverse($qs); - if($newqs[0] == "cu"){ //item; submit post / update redirect + //item; submit post / update redirect + if($newqs[0] == "cu"){ $mainparent = $aa -> getMainParent($qs[2]); $message = CONTENT_ADMIN_ITEM_LAN_117."

"; $message .= CONTENT_ADMIN_ITEM_LAN_88." ".CONTENT_ADMIN_ITEM_LAN_90."
"; diff --git a/e107_plugins/content/content_shortcodes.php b/e107_plugins/content/content_shortcodes.php index 82e4f79af..73fba6060 100644 --- a/e107_plugins/content/content_shortcodes.php +++ b/e107_plugins/content/content_shortcodes.php @@ -16,7 +16,7 @@ return $contenttotal." ".($contenttotal == 1 ? CONTENT_LAN_53 : CONTENT_LAN_54); SC_END SC_BEGIN CONTENT_TYPE_TABLE_HEADING -global $CONTENT_TYPE_TABLE_HEADING, $contenttotal, $row, $tp; +global $contenttotal, $row, $tp; $row['content_heading'] = $tp -> toHTML($row['content_heading'], TRUE, "emotes_off, no_make_clickable"); return ($contenttotal != "0" ? "".$row['content_heading']."" : $row['content_heading'] ); SC_END @@ -35,65 +35,40 @@ SC_END SC_BEGIN CONTENT_TYPE_TABLE_SUBHEADING -global $CONTENT_TYPE_TABLE_SUBHEADING, $contenttotal, $row, $tp; +global $row, $tp; $row['content_subheading'] = $tp -> toHTML($row['content_subheading'], TRUE, "emotes_off, no_make_clickable"); return ($row['content_subheading'] ? $row['content_subheading'] : ""); SC_END SC_BEGIN CONTENT_TYPE_TABLE_ICON -global $CONTENT_TYPE_TABLE_ICON, $contenttotal, $row, $aa, $content_cat_icon_path_large, $content_pref; -if($contenttotal != "0"){ - $CONTENT_TYPE_TABLE_ICON = $aa -> getIcon("catlarge", $row['content_icon'], $content_cat_icon_path_large, "cat.".$row['content_id'], "", $content_pref["content_blank_caticon"]); -}else{ - $CONTENT_TYPE_TABLE_ICON = $aa -> getIcon("catlarge", $row['content_icon'], $content_cat_icon_path_large, "", "", $content_pref["content_blank_caticon"]); -} -return $CONTENT_TYPE_TABLE_ICON; -SC_END - -// CONTENT_TYPE_TABLE_SUBMIT ------------------------------------------------ -SC_BEGIN CONTENT_TYPE_TABLE_SUBMIT_ICON -global $CONTENT_TYPE_TABLE_SUBMIT_ICON, $plugindir; -return "".CONTENT_ICON_SUBMIT.""; -SC_END - -SC_BEGIN CONTENT_TYPE_TABLE_SUBMIT_HEADING -global $CONTENT_TYPE_TABLE_SUBMIT_HEADING, $plugindir; -return "".CONTENT_LAN_65.""; -SC_END - -SC_BEGIN CONTENT_TYPE_TABLE_SUBMIT_SUBHEADING -global $CONTENT_TYPE_TABLE_SUBMIT_SUBHEADING; -return CONTENT_LAN_66; +global $row, $aa, $content_cat_icon_path_large, $content_pref; +$qry = "cat.".$row['content_id']; +return $aa -> getIcon("catlarge", $row['content_icon'], $content_cat_icon_path_large, $qry, "", $content_pref["content_blank_caticon"]); SC_END // CONTENT_TYPE_TABLE_MANAGER ------------------------------------------------ SC_BEGIN CONTENT_TYPE_TABLE_MANAGER_ICON -global $CONTENT_TYPE_TABLE_MANAGER_ICON, $plugindir; +global $plugindir; return "".CONTENT_ICON_CONTENTMANAGER.""; SC_END SC_BEGIN CONTENT_TYPE_TABLE_MANAGER_HEADING -global $CONTENT_TYPE_TABLE_MANAGER_HEADING, $plugindir; +global $plugindir; return "".CONTENT_LAN_67.""; SC_END -SC_BEGIN CONTENT_TYPE_TABLE_MANAGER_SUBHEADING -global $CONTENT_TYPE_TABLE_MANAGER_SUBHEADING; -return CONTENT_LAN_68; -SC_END - // CONTENT_TOP_TABLE ------------------------------------------------ SC_BEGIN CONTENT_TOP_TABLE_HEADING -global $CONTENT_TOP_TABLE_HEADING, $row, $qs; +global $row; return "".$row['content_heading'].""; SC_END SC_BEGIN CONTENT_TOP_TABLE_ICON -global $CONTENT_TOP_TABLE_ICON, $aa, $row, $content_pref, $content_icon_path, $qs, $mainparent; +global $aa, $row, $content_pref, $content_icon_path; if($content_pref["content_top_icon"]){ -$width = (isset($content_pref["content_upload_icon_size"]) && $content_pref["content_upload_icon_size"] ? $content_pref["content_upload_icon_size"] : "100"); -$width = (isset($content_pref["content_top_icon_width"]) && $content_pref["content_top_icon_width"] ? $content_pref["content_top_icon_width"] : $width); -return $aa -> getIcon("item", $row['content_icon'], $content_icon_path, "content.".$row['content_id'], $width, $content_pref["content_blank_icon"]); + $width = (isset($content_pref["content_upload_icon_size"]) && $content_pref["content_upload_icon_size"] ? $content_pref["content_upload_icon_size"] : "100"); + $width = (isset($content_pref["content_top_icon_width"]) && $content_pref["content_top_icon_width"] ? $content_pref["content_top_icon_width"] : $width); + return $aa -> getIcon("item", $row['content_icon'], $content_icon_path, "content.".$row['content_id'], $width, $content_pref["content_blank_icon"]); } SC_END @@ -103,7 +78,7 @@ return $CONTENT_TOP_TABLE_AUTHOR; SC_END SC_BEGIN CONTENT_TOP_TABLE_RATING -global $CONTENT_TOP_TABLE_RATING, $row, $imode; +global $row, $imode; $row['rate_avg'] = round($row['rate_avg'], 1); $row['rate_avg'] = (strlen($row['rate_avg'])>1 ? $row['rate_avg'] : $row['rate_avg'].".0"); $tmp = explode(".", $row['rate_avg']); @@ -123,16 +98,16 @@ SC_END // CONTENT_SCORE_TABLE ------------------------------------------------ SC_BEGIN CONTENT_SCORE_TABLE_HEADING -global $CONTENT_SCORE_TABLE_HEADING, $row, $qs; +global $row; return "".$row['content_heading'].""; SC_END SC_BEGIN CONTENT_SCORE_TABLE_ICON -global $CONTENT_SCORE_TABLE_ICON, $aa, $row, $content_pref, $content_icon_path, $qs, $mainparent; +global $aa, $row, $content_pref, $content_icon_path; if(isset($content_pref["content_score_icon"]) && $content_pref["content_score_icon"]){ -$width = (isset($content_pref["content_upload_icon_size"]) && $content_pref["content_upload_icon_size"] ? $content_pref["content_upload_icon_size"] : "100"); -$width = (isset($content_pref["content_score_icon_width"]) && $content_pref["content_score_icon_width"] ? $content_pref["content_score_icon_width"] : $width); -return $aa -> getIcon("item", $row['content_icon'], $content_icon_path, "content.".$row['content_id'], $width, $content_pref["content_blank_icon"]); + $width = (isset($content_pref["content_upload_icon_size"]) && $content_pref["content_upload_icon_size"] ? $content_pref["content_upload_icon_size"] : "100"); + $width = (isset($content_pref["content_score_icon_width"]) && $content_pref["content_score_icon_width"] ? $content_pref["content_score_icon_width"] : $width); + return $aa -> getIcon("item", $row['content_icon'], $content_icon_path, "content.".$row['content_id'], $width, $content_pref["content_blank_icon"]); } SC_END @@ -142,7 +117,7 @@ return $CONTENT_SCORE_TABLE_AUTHOR; SC_END SC_BEGIN CONTENT_SCORE_TABLE_SCORE -global $CONTENT_SCORE_TABLE_SCORE, $row; +global $row; $score = $row['content_score']; $height = "height:8px;"; $img = ""; @@ -157,86 +132,76 @@ $img .= "".$row['content_heading'].""; -SC_END - -SC_BEGIN CONTENT_SUBMIT_TYPE_TABLE_SUBHEADING -global $CONTENT_SUBMIT_TYPE_TABLE_SUBHEADING, $row; -return ($row['content_subheading'] ? $row['content_subheading'] : ""); -SC_END - -SC_BEGIN CONTENT_SUBMIT_TYPE_TABLE_ICON -global $CONTENT_SUBMIT_TYPE_TABLE_ICON, $aa, $row, $content_cat_icon_path_large, $content_pref; -return $aa -> getIcon("catlarge", $row['content_icon'], $content_cat_icon_path_large, "content.submit.".$row['content_id'], "", $content_pref["content_blank_caticon"]); -SC_END - // CONTENT_CONTENT_TABLEMANAGER ------------------------------------------------ SC_BEGIN CONTENT_CONTENTMANAGER_CATEGORY -global $CONTENT_CONTENTMANAGER_CATEGORY, $row, $content_pref; -if( (isset($content_pref["content_manager_personal"]) && check_class($content_pref["content_manager_personal"])) || (isset($content_pref["content_manager_category"]) && check_class($content_pref["content_manager_category"])) || (isset($content_pref["content_manager_approve"]) && check_class($content_pref["content_manager_approve"])) ){ +global $row, $content_pref; return "".$row['content_heading'].""; -} +SC_END + +SC_BEGIN CONTENT_CONTENTMANAGER_CATEGORY_SUBHEADING +global $row, $tp; +return $tp->toHTML($row['content_subheading'], TRUE); SC_END SC_BEGIN CONTENT_CONTENTMANAGER_ICONNEW -global $CONTENT_CONTENTMANAGER_ICONNEW, $row, $content_pref; -if( (isset($content_pref["content_manager_personal"]) && check_class($content_pref["content_manager_personal"])) || (isset($content_pref["content_manager_category"]) && check_class($content_pref["content_manager_category"])) ){ -return "".CONTENT_ICON_NEW.""; -//return ""; +global $row, $content_pref; +if( (isset($content_pref["content_manager_personal"]) && check_class($content_pref["content_manager_personal"])) || (isset($content_pref["content_manager_category"]) && check_class($content_pref["content_manager_category"])) || (isset($content_pref["content_manager_submit"]) && check_class($content_pref["content_manager_submit"])) ){ + + //if(getperms('0')){ + // return "".CONTENT_MANAGER_LAN_1." | ".CONTENT_MANAGER_LAN_4.""; + //} + + if( (isset($content_pref["content_manager_personal"]) && check_class($content_pref["content_manager_personal"])) || (isset($content_pref["content_manager_category"]) && check_class($content_pref["content_manager_category"])) ){ + return "".CONTENT_MANAGER_LAN_1.""; + }elseif( isset($content_pref["content_manager_submit"]) && check_class($content_pref["content_manager_submit"]) ){ + return "".CONTENT_MANAGER_LAN_4.""; + } } SC_END SC_BEGIN CONTENT_CONTENTMANAGER_ICONEDIT -global $CONTENT_CONTENTMANAGER_ICONEDIT, $row, $content_pref; +global $row, $content_pref; if( (isset($content_pref["content_manager_personal"]) && check_class($content_pref["content_manager_personal"])) || (isset($content_pref["content_manager_category"]) && check_class($content_pref["content_manager_category"])) ){ -return "".CONTENT_ICON_EDIT.""; -//return ""; + return "".CONTENT_MANAGER_LAN_2.""; } SC_END SC_BEGIN CONTENT_CONTENTMANAGER_ICONSUBM -global $CONTENT_CONTENTMANAGER_ICONSUBM, $row, $content_pref, $plugintable; +global $row, $content_pref, $plugintable; if(isset($content_pref["content_manager_approve"]) && check_class($content_pref["content_manager_approve"])){ if(!is_object($sqls)){ $sqls = new db; } $num = $sqls -> db_Count($plugintable, "(*)", "WHERE content_refer = 'sa' AND content_parent='".intval($row['content_id'])."' "); - if($num>0){ - return "".CONTENT_ICON_SUBMIT_SMALL.""; - } + return "".CONTENT_MANAGER_LAN_3." (".$num.")"; } SC_END // CONTENT_AUTHOR_TABLE ------------------------------------------------ SC_BEGIN CONTENT_AUTHOR_TABLE_NAME -global $CONTENT_AUTHOR_TABLE_NAME, $authordetails, $i, $qs, $row; +global $authordetails, $i, $row; $name = ($authordetails[$i][1] == "" ? "... ".CONTENT_LAN_29." ..." : $authordetails[$i][1]); -$authorlink = "".$name.""; -return $authorlink; +return "".$name.""; SC_END SC_BEGIN CONTENT_AUTHOR_TABLE_ICON -global $CONTENT_AUTHOR_TABLE_ICON, $qs, $row; +global $row; return "".CONTENT_ICON_AUTHORLIST.""; SC_END SC_BEGIN CONTENT_AUTHOR_TABLE_TOTAL -global $CONTENT_AUTHOR_TABLE_TOTAL, $totalcontent, $mainparent, $content_pref; +global $totalcontent, $content_pref; if($content_pref["content_author_amount"]){ -$CONTENT_AUTHOR_TABLE_TOTAL = $totalcontent." ".($totalcontent==1 ? CONTENT_LAN_53 : CONTENT_LAN_54); -return $CONTENT_AUTHOR_TABLE_TOTAL; + return $totalcontent." ".($totalcontent==1 ? CONTENT_LAN_53 : CONTENT_LAN_54); } SC_END SC_BEGIN CONTENT_AUTHOR_TABLE_LASTITEM -global $CONTENT_AUTHOR_TABLE_LASTITEM, $gen, $row, $mainparent, $content_pref; +global $gen, $row, $content_pref; if($content_pref["content_author_lastitem"]){ if(!is_object($gen)){ $gen = new convert; } -$CONTENT_AUTHOR_TABLE_LASTITEM = preg_replace("# -.*#", "", $gen -> convert_date($row['content_datestamp'], "short")); -$CONTENT_AUTHOR_TABLE_LASTITEM .= " : ".$row['content_heading'].""; -return $CONTENT_AUTHOR_TABLE_LASTITEM; + $CONTENT_AUTHOR_TABLE_LASTITEM = preg_replace("# -.*#", "", $gen -> convert_date($row['content_datestamp'], "short")); + $CONTENT_AUTHOR_TABLE_LASTITEM .= " : ".$row['content_heading'].""; + return $CONTENT_AUTHOR_TABLE_LASTITEM; } SC_END @@ -244,56 +209,51 @@ SC_END SC_BEGIN CONTENT_CAT_TABLE_INFO_PRE global $CONTENT_CAT_TABLE_INFO_PRE; if($CONTENT_CAT_TABLE_INFO_PRE === TRUE){ -$CONTENT_CAT_TABLE_INFO_PRE = " "; -return $CONTENT_CAT_TABLE_INFO_PRE; + $CONTENT_CAT_TABLE_INFO_PRE = " "; + return $CONTENT_CAT_TABLE_INFO_PRE; } SC_END SC_BEGIN CONTENT_CAT_TABLE_INFO_POST global $CONTENT_CAT_TABLE_INFO_POST; if($CONTENT_CAT_TABLE_INFO_POST === TRUE){ -$CONTENT_CAT_TABLE_INFO_POST = " "; -return $CONTENT_CAT_TABLE_INFO_POST; + $CONTENT_CAT_TABLE_INFO_POST = " "; + return $CONTENT_CAT_TABLE_INFO_POST; } SC_END SC_BEGIN CONTENT_CAT_TABLE_ICON -global $CONTENT_CAT_TABLE_ICON, $aa, $totalitems, $row, $content_pref, $qs, $content_cat_icon_path_large, $mainparent; +global $aa, $row, $content_pref, $content_cat_icon_path_large; if(isset($content_pref["content_catall_icon"]) && $content_pref["content_catall_icon"]){ - //$qry = ($totalitems > 0 ? "cat.".$row['content_id'] : ""); $qry = "cat.".$row['content_id']; return $aa -> getIcon("catlarge", $row['content_icon'], $content_cat_icon_path_large, $qry, "", $content_pref["content_blank_caticon"]); } SC_END SC_BEGIN CONTENT_CAT_TABLE_HEADING -global $CONTENT_CAT_TABLE_HEADING, $row, $totalitems, $tp; -//return ($totalitems > 0 ? "".$tp -> toHTML($row['content_heading'], TRUE, "")."" : $tp -> toHTML($row['content_heading'], TRUE, "") ); +global $row, $tp; return "".$tp -> toHTML($row['content_heading'], TRUE, "").""; SC_END SC_BEGIN CONTENT_CAT_TABLE_AMOUNT -global $CONTENT_CAT_TABLE_AMOUNT, $aa, $row, $totalitems, $mainparent, $content_pref; +global $row, $totalitems, $content_pref; if(isset($content_pref["content_catall_amount"]) && $content_pref["content_catall_amount"]){ -$n = $totalitems; -$CONTENT_CAT_TABLE_AMOUNT = $n." ".($n == "1" ? CONTENT_LAN_53 : CONTENT_LAN_54); -return $CONTENT_CAT_TABLE_AMOUNT; + return $totalitems." ".($totalitems == "1" ? CONTENT_LAN_53 : CONTENT_LAN_54); } SC_END SC_BEGIN CONTENT_CAT_TABLE_SUBHEADING -global $CONTENT_CAT_TABLE_SUBHEADING, $row, $tp, $mainparent, $content_pref; +global $row, $tp, $content_pref; if(isset($content_pref["content_catall_subheading"]) && $content_pref["content_catall_subheading"]){ -return ($row['content_subheading'] ? $tp -> toHTML($row['content_subheading'], TRUE, "") : ""); + return ($row['content_subheading'] ? $tp -> toHTML($row['content_subheading'], TRUE, "") : ""); } SC_END SC_BEGIN CONTENT_CAT_TABLE_DATE -global $CONTENT_CAT_TABLE_DATE, $gen, $row, $mainparent, $content_pref, $gen; +global $gen, $row, $content_pref; if(isset($content_pref["content_catall_date"]) && $content_pref["content_catall_date"]){ -if(!is_object($gen)){ $gen = new convert; } -$datestamp = preg_replace("# -.*#", "", $gen -> convert_date($row['content_datestamp'], "long")); -$DATE = ($datestamp != "" ? $datestamp : ""); -return $DATE; + if(!is_object($gen)){ $gen = new convert; } + $datestamp = preg_replace("# -.*#", "", $gen -> convert_date($row['content_datestamp'], "long")); + return ($datestamp != "" ? $datestamp : ""); } SC_END @@ -303,34 +263,33 @@ return $CONTENT_CAT_TABLE_AUTHORDETAILS; SC_END SC_BEGIN CONTENT_CAT_TABLE_EPICONS -global $CONTENT_CAT_TABLE_EPICONS, $row, $tp, $mainparent, $content_pref; +global $row, $tp, $content_pref; $EPICONS = ""; if($row['content_pe'] && isset($content_pref["content_catall_peicon"]) && $content_pref["content_catall_peicon"]){ $EPICONS = $tp -> parseTemplate("{EMAIL_ITEM=".CONTENT_LAN_69." ".CONTENT_LAN_72."^plugin:content.".$row['content_id']."}"); $EPICONS .= " ".$tp -> parseTemplate("{PRINT_ITEM=".CONTENT_LAN_70." ".CONTENT_LAN_72."^plugin:content.".$row['content_id']."}"); $EPICONS .= " ".$tp -> parseTemplate("{PDF=".CONTENT_LAN_76." ".CONTENT_LAN_71."^plugin:content.".$row['content_id']."}"); -return $EPICONS; + return $EPICONS; } SC_END SC_BEGIN CONTENT_CAT_TABLE_COMMENT -global $CONTENT_CAT_TABLE_COMMENT, $row, $qs, $comment_total, $mainparent, $content_pref, $plugintable; +global $row, $comment_total, $content_pref, $plugintable; if($row['content_comment'] && isset($content_pref["content_catall_comment"]) && $content_pref["content_catall_comment"]){ -$sqlc = new db; -$comment_total = $sqlc -> db_Select("comments", "*", "comment_item_id='".$row['content_id']."' AND comment_type='".$plugintable."' AND comment_pid='0' "); -return "".CONTENT_LAN_57." ".$comment_total.""; + $sqlc = new db; + $comment_total = $sqlc -> db_Select("comments", "*", "comment_item_id='".$row['content_id']."' AND comment_type='".$plugintable."' AND comment_pid='0' "); + return "".CONTENT_LAN_57." ".$comment_total.""; } SC_END SC_BEGIN CONTENT_CAT_TABLE_TEXT -global $CONTENT_CAT_TABLE_TEXT, $row, $tp, $mainparent, $content_pref; +global $row, $tp, $content_pref; if($row['content_text'] && isset($content_pref["content_catall_text"]) && $content_pref["content_catall_text"] && ($content_pref["content_catall_text_char"] > 0 || $content_pref["content_catall_text_char"] == 'all')){ if($content_pref["content_catall_text_char"] == 'all'){ $CONTENT_CAT_TABLE_TEXT = $row['content_text']; }else{ $rowtext = preg_replace("/\[newpage.*?]/si", " ", $row['content_text']); $rowtext = $tp->toHTML($rowtext, TRUE, "nobreak"); - $rowtext = strip_tags($rowtext); $words = explode(" ", $rowtext); $CONTENT_CAT_TABLE_TEXT = implode(" ", array_slice($words, 0, $content_pref["content_catall_text_char"])); @@ -340,63 +299,58 @@ if($row['content_text'] && isset($content_pref["content_catall_text"]) && $conte $CONTENT_CAT_TABLE_TEXT .= " ".$content_pref["content_catall_text_post"]; } } -return $CONTENT_CAT_TABLE_TEXT; + return $CONTENT_CAT_TABLE_TEXT; } SC_END SC_BEGIN CONTENT_CAT_TABLE_RATING -global $CONTENT_CAT_TABLE_RATING, $row, $rater, $mainparent, $content_pref, $plugintable; -$RATING = ""; +global $row, $rater, $content_pref, $plugintable; if($row['content_rate'] && isset($content_pref["content_catall_rating"]) && $content_pref["content_catall_rating"]){ -return $rater->composerating($plugintable, $row['content_id'], $enter=TRUE, $userid=FALSE); + return $rater->composerating($plugintable, $row['content_id'], $enter=TRUE, $userid=FALSE); } -return $RATING; SC_END // CONTENT_CAT_LIST_TABLE ------------------------------------------------ SC_BEGIN CONTENT_CAT_LIST_TABLE_INFO_PRE global $CONTENT_CAT_LIST_TABLE_INFO_PRE; if($CONTENT_CAT_LIST_TABLE_INFO_PRE === TRUE){ -$CONTENT_CAT_LIST_TABLE_INFO_PRE = " "; -return $CONTENT_CAT_LIST_TABLE_INFO_PRE; + $CONTENT_CAT_LIST_TABLE_INFO_PRE = " "; + return $CONTENT_CAT_LIST_TABLE_INFO_PRE; } SC_END SC_BEGIN CONTENT_CAT_LIST_TABLE_INFO_POST global $CONTENT_CAT_LIST_TABLE_INFO_POST; if($CONTENT_CAT_LIST_TABLE_INFO_POST === TRUE){ -$CONTENT_CAT_LIST_TABLE_INFO_POST = " "; -return $CONTENT_CAT_LIST_TABLE_INFO_POST; + $CONTENT_CAT_LIST_TABLE_INFO_POST = " "; + return $CONTENT_CAT_LIST_TABLE_INFO_POST; } SC_END SC_BEGIN CONTENT_CAT_LIST_TABLE_ICON -global $CONTENT_CAT_LIST_TABLE_ICON, $aa, $row, $qs, $content_pref, $content_cat_icon_path_large, $mainparent; +global $aa, $row, $content_pref, $content_cat_icon_path_large; if(isset($content_pref["content_cat_icon"]) && $content_pref["content_cat_icon"]){ -return $aa -> getIcon("catlarge", $row['content_icon'], $content_cat_icon_path_large, "", "", $content_pref["content_blank_caticon"]);; + return $aa -> getIcon("catlarge", $row['content_icon'], $content_cat_icon_path_large, "", "", $content_pref["content_blank_caticon"]); } SC_END SC_BEGIN CONTENT_CAT_LIST_TABLE_HEADING -global $CONTENT_CAT_LIST_TABLE_HEADING, $tp, $row, $totalparent, $tp; -//return ($totalparent > 0 ? "".$tp -> toHTML($row['content_heading'], TRUE, "")."" : $tp -> toHTML($row['content_heading'], TRUE, "") ); +global $tp, $row; return "".$tp -> toHTML($row['content_heading'], TRUE, "").""; SC_END SC_BEGIN CONTENT_CAT_LIST_TABLE_SUMMARY -global $CONTENT_CAT_LIST_TABLE_SUMMARY, $tp, $row, $mainparent; +global $tp, $row; return ($row['content_summary'] ? $tp -> toHTML($row['content_summary'], TRUE, "") : ""); SC_END SC_BEGIN CONTENT_CAT_LIST_TABLE_TEXT -global $CONTENT_CAT_LIST_TABLE_TEXT, $tp, $row, $mainparent, $content_pref; +global $tp, $row, $content_pref; if($row['content_text'] && isset($content_pref["content_cat_text"]) && $content_pref["content_cat_text"] && ($content_pref["content_cat_text_char"] > 0 || $content_pref["content_cat_text_char"] == 'all')){ if($content_pref["content_cat_text_char"] == 'all'){ - //$CONTENT_CAT_LIST_TABLE_TEXT = $row['content_text']; $CONTENT_CAT_LIST_TABLE_TEXT = $tp->toHTML($row['content_text'], TRUE, "constants"); }else{ $rowtext = preg_replace("/\[newpage.*?]/si", " ", $row['content_text']); $rowtext = $tp->toHTML($rowtext, TRUE, "nobreak, constants"); - $rowtext = strip_tags($rowtext); $words = explode(" ", $rowtext); $CONTENT_CAT_LIST_TABLE_TEXT = implode(" ", array_slice($words, 0, $content_pref["content_cat_text_char"])); @@ -406,32 +360,30 @@ if($row['content_text'] && isset($content_pref["content_cat_text"]) && $content_ $CONTENT_CAT_LIST_TABLE_TEXT .= " ".$content_pref["content_cat_text_post"]; } } -return $CONTENT_CAT_LIST_TABLE_TEXT; + return $CONTENT_CAT_LIST_TABLE_TEXT; } SC_END SC_BEGIN CONTENT_CAT_LIST_TABLE_AMOUNT -global $CONTENT_CAT_LIST_TABLE_AMOUNT, $aa, $row, $mainparent, $content_pref, $totalparent; +global $row, $content_pref, $totalparent; if(isset($content_pref["content_cat_amount"]) && $content_pref["content_cat_amount"]){ -$n = $totalparent; -$n = $n." ".($n == "1" ? CONTENT_LAN_53 : CONTENT_LAN_54); -return $n; + return $totalparent." ".($totalparent == "1" ? CONTENT_LAN_53 : CONTENT_LAN_54); } SC_END SC_BEGIN CONTENT_CAT_LIST_TABLE_SUBHEADING -global $CONTENT_CAT_LIST_TABLE_SUBHEADING, $tp, $row, $mainparent, $content_pref; +global $tp, $row, $content_pref; if(isset($content_pref["content_cat_subheading"]) && $content_pref["content_cat_subheading"]){ -return ($row['content_subheading'] ? $tp -> toHTML($row['content_subheading'], TRUE, "") : ""); + return ($row['content_subheading'] ? $tp -> toHTML($row['content_subheading'], TRUE, "") : ""); } SC_END SC_BEGIN CONTENT_CAT_LIST_TABLE_DATE -global $CONTENT_CAT_LIST_TABLE_DATE, $row, $gen, $mainparent, $content_pref, $gen; +global $row, $gen, $content_pref; if(isset($content_pref["content_cat_date"]) && $content_pref["content_cat_date"]){ -if(!is_object($gen)){ $gen = new convert; } -$datestamp = preg_replace("# -.*#", "", $gen -> convert_date($row['content_datestamp'], "long")); -return ($datestamp != "" ? $datestamp : ""); + if(!is_object($gen)){ $gen = new convert; } + $datestamp = preg_replace("# -.*#", "", $gen -> convert_date($row['content_datestamp'], "long")); + return ($datestamp != "" ? $datestamp : ""); } SC_END @@ -441,60 +393,55 @@ return $CONTENT_CAT_LIST_TABLE_AUTHORDETAILS; SC_END SC_BEGIN CONTENT_CAT_LIST_TABLE_EPICONS -global $CONTENT_CAT_LIST_TABLE_EPICONS, $row, $tp, $qs, $mainparent, $content_pref; +global $row, $tp, $qs, $content_pref; $EPICONS = ""; if( (isset($content_pref["content_cat_peicon"]) && $content_pref["content_cat_peicon"] && $row['content_pe']) || (isset($content_pref["content_cat_peicon_all"]) && $content_pref["content_cat_peicon_all"])){ $EPICONS = $tp -> parseTemplate("{EMAIL_ITEM=".CONTENT_LAN_69." ".CONTENT_LAN_72."^plugin:content.$qs[1]}"); $EPICONS .= " ".$tp -> parseTemplate("{PRINT_ITEM=".CONTENT_LAN_70." ".CONTENT_LAN_72."^plugin:content.$qs[1]}"); $EPICONS .= " ".$tp -> parseTemplate("{PDF=".CONTENT_LAN_76." ".CONTENT_LAN_71."^plugin:content.$qs[1]}"); -return $EPICONS; + return $EPICONS; } SC_END SC_BEGIN CONTENT_CAT_LIST_TABLE_COMMENT -global $CONTENT_CAT_LIST_TABLE_COMMENT, $qs, $row, $comment_total, $mainparent, $content_pref, $sql, $plugintable; +global $qs, $row, $comment_total, $content_pref, $sql, $plugintable; if($row['content_comment'] && isset($content_pref["content_cat_comment"]) && $content_pref["content_cat_comment"]){ $comment_total = $sql -> db_Count("comments", "(*)", "WHERE comment_item_id='".intval($qs[1])."' AND comment_type='".$plugintable."' AND comment_pid='0' "); - return "".CONTENT_LAN_57." ".$comment_total.""; + return "".CONTENT_LAN_57." ".$comment_total.""; } SC_END SC_BEGIN CONTENT_CAT_LIST_TABLE_RATING -global $CONTENT_CAT_LIST_TABLE_RATING, $row, $rater, $content_pref, $mainparent, $plugintable; -$RATING = ""; +global $row, $rater, $content_pref, $plugintable; if( (isset($content_pref["content_cat_rating_all"]) && $content_pref["content_cat_rating_all"]) || (isset($content_pref["content_cat_rating"]) && $content_pref["content_cat_rating"] && $row['content_rate'])){ return $rater->composerating($plugintable, $row['content_id'], $enter=TRUE, $userid=FALSE); } -return $RATING; SC_END // CONTENT_CAT_LISTSUB ------------------------------------------------ SC_BEGIN CONTENT_CAT_LISTSUB_TABLE_ICON -global $CONTENT_CAT_LISTSUB_TABLE_ICON, $aa, $row, $content_pref, $qs, $mainparent, $content_cat_icon_path_small; +global $aa, $row, $content_pref, $content_cat_icon_path_small; if(isset($content_pref["content_catsub_icon"]) && $content_pref["content_catsub_icon"]){ -return $aa -> getIcon("catsmall", $row['content_icon'], $content_cat_icon_path_small, "cat.".$row['content_id'], "", $content_pref["content_blank_caticon"]); + return $aa -> getIcon("catsmall", $row['content_icon'], $content_cat_icon_path_small, "cat.".$row['content_id'], "", $content_pref["content_blank_caticon"]); } SC_END SC_BEGIN CONTENT_CAT_LISTSUB_TABLE_HEADING -global $CONTENT_CAT_LISTSUB_TABLE_HEADING, $tp, $row, $totalsubcat, $tp; -//return ($totalsubcat > 0 ? "".$tp -> toHTML($row['content_heading'], TRUE, "")."" : $tp -> toHTML($row['content_heading'], TRUE, "") ); +global $tp, $row; return "".$tp -> toHTML($row['content_heading'], TRUE, "").""; SC_END SC_BEGIN CONTENT_CAT_LISTSUB_TABLE_AMOUNT -global $CONTENT_CAT_LISTSUB_TABLE_AMOUNT, $aa, $row, $content_pref, $mainparent, $totalsubcat; +global $row, $content_pref, $totalsubcat; if(isset($content_pref["content_catsub_amount"]) && $content_pref["content_catsub_amount"]){ -$n = $totalsubcat; -$n = $n." ".($n == "1" ? CONTENT_LAN_53 : CONTENT_LAN_54); -return $n; + return $totalsubcat." ".($totalsubcat == "1" ? CONTENT_LAN_53 : CONTENT_LAN_54); } SC_END SC_BEGIN CONTENT_CAT_LISTSUB_TABLE_SUBHEADING -global $CONTENT_CAT_LISTSUB_TABLE_SUBHEADING, $row, $tp, $content_pref, $mainparent; +global $row, $tp, $content_pref; if(isset($content_pref["content_catsub_subheading"]) && $content_pref["content_catsub_subheading"]){ -return ($row['content_subheading'] ? $tp -> toHTML($row['content_subheading'], TRUE, "") : ""); + return ($row['content_subheading'] ? $tp -> toHTML($row['content_subheading'], TRUE, "") : ""); } SC_END @@ -516,23 +463,23 @@ SC_END // CONTENT_SEARCHRESULT_TABLE ------------------------------------------------ SC_BEGIN CONTENT_SEARCHRESULT_TABLE_ICON -global $CONTENT_SEARCHRESULT_TABLE_ICON, $aa, $row, $content_icon_path, $qs, $content_pref, $mainparent; +global $aa, $row, $content_icon_path, $content_pref; $width = (isset($content_pref["content_upload_icon_size"]) && $content_pref["content_upload_icon_size"] ? $content_pref["content_upload_icon_size"] : "100"); return $aa -> getIcon("item", $row['content_icon'], $content_icon_path, "content.".$row['content_id'], $width, $content_pref["content_blank_icon"]); SC_END SC_BEGIN CONTENT_SEARCHRESULT_TABLE_HEADING -global $CONTENT_SEARCHRESULT_TABLE_HEADING, $row, $qs, $tp; +global $row, $tp; return ($row['content_heading'] ? "".$tp -> toHTML($row['content_heading'], TRUE, "")."" : ""); SC_END SC_BEGIN CONTENT_SEARCHRESULT_TABLE_SUBHEADING -global $CONTENT_SEARCHRESULT_TABLE_SUBHEADING, $row, $tp; +global $row, $tp; return ($row['content_subheading'] ? $tp -> toHTML($row['content_subheading'], TRUE, "") : ""); SC_END SC_BEGIN CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS -global $CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS, $qs, $aa, $row; +global $aa, $row; $authordetails = $aa -> getAuthor($row['content_author']); $CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS = $authordetails[1]; if(USER){ @@ -549,13 +496,13 @@ return $CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS; SC_END SC_BEGIN CONTENT_SEARCHRESULT_TABLE_DATE -global $CONTENT_SEARCHRESULT_TABLE_DATE, $gen, $row; +global $gen, $row; $datestamp = preg_replace("# -.*#", "", $gen -> convert_date($row['content_datestamp'], "short")); return $datestamp; SC_END SC_BEGIN CONTENT_SEARCHRESULT_TABLE_TEXT -global $CONTENT_SEARCHRESULT_TABLE_TEXT, $row, $tp; +global $row, $tp; return ($row['content_text'] ? $tp -> toHTML($row['content_text'], TRUE, "") : ""); SC_END @@ -563,33 +510,33 @@ SC_END SC_BEGIN CONTENT_RECENT_TABLE_INFOPRE global $CONTENT_RECENT_TABLE_INFOPRE; if($CONTENT_RECENT_TABLE_INFOPRE === TRUE){ -$CONTENT_RECENT_TABLE_INFOPRE = " "; -return $CONTENT_RECENT_TABLE_INFOPRE; + $CONTENT_RECENT_TABLE_INFOPRE = " "; + return $CONTENT_RECENT_TABLE_INFOPRE; } SC_END SC_BEGIN CONTENT_RECENT_TABLE_INFOPOST global $CONTENT_RECENT_TABLE_INFOPOST; if($CONTENT_RECENT_TABLE_INFOPOST === TRUE){ -$CONTENT_RECENT_TABLE_INFOPOST = " "; -return $CONTENT_RECENT_TABLE_INFOPOST; + $CONTENT_RECENT_TABLE_INFOPOST = " "; + return $CONTENT_RECENT_TABLE_INFOPOST; } SC_END SC_BEGIN CONTENT_RECENT_TABLE_ICON -global $CONTENT_RECENT_TABLE_ICON, $aa, $row, $content_icon_path, $content_pref, $mainparent; +global $aa, $row, $content_icon_path, $content_pref; if(isset($content_pref["content_list_icon"]) && $content_pref["content_list_icon"]){ -$width = (isset($content_pref["content_upload_icon_size"]) && $content_pref["content_upload_icon_size"] ? $content_pref["content_upload_icon_size"] : "100"); -return $aa -> getIcon("item", $row['content_icon'], $content_icon_path, "content.".$row['content_id'], $width, $content_pref["content_blank_icon"]); + $width = (isset($content_pref["content_upload_icon_size"]) && $content_pref["content_upload_icon_size"] ? $content_pref["content_upload_icon_size"] : "100"); + return $aa -> getIcon("item", $row['content_icon'], $content_icon_path, "content.".$row['content_id'], $width, $content_pref["content_blank_icon"]); } SC_END SC_BEGIN CONTENT_RECENT_TABLE_HEADING -global $CONTENT_RECENT_TABLE_HEADING, $row, $tp; +global $row, $tp; return ($row['content_heading'] ? "".$tp->toHTML($row['content_heading'], TRUE, "")."" : ""); SC_END SC_BEGIN CONTENT_RECENT_TABLE_SUBHEADING -global $CONTENT_RECENT_TABLE_SUBHEADING, $tp, $content_pref, $qs, $row, $mainparent; +global $tp, $content_pref, $qs, $row; if (isset($content_pref["content_list_subheading"]) && $content_pref["content_list_subheading"] && $row['content_subheading'] && $content_pref["content_list_subheading_char"] && $content_pref["content_list_subheading_char"] != "" && $content_pref["content_list_subheading_char"] != "0"){ if(strlen($row['content_subheading']) > $content_pref["content_list_subheading_char"]) { $row['content_subheading'] = substr($row['content_subheading'], 0, $content_pref["content_list_subheading_char"]).$content_pref["content_list_subheading_post"]; @@ -602,7 +549,7 @@ return $tp->toHTML($CONTENT_RECENT_TABLE_SUBHEADING, TRUE, ""); SC_END SC_BEGIN CONTENT_RECENT_TABLE_SUMMARY -global $CONTENT_RECENT_TABLE_SUMMARY, $content_pref, $tp, $qs, $row, $mainparent; +global $content_pref, $tp, $row; if (isset($content_pref["content_list_summary"]) && $content_pref["content_list_summary"]){ if($row['content_summary'] && $content_pref["content_list_summary_char"] && $content_pref["content_list_summary_char"] != "" && $content_pref["content_list_summary_char"] != "0"){ if(strlen($row['content_summary']) > $content_pref["content_list_summary_char"]) { @@ -612,15 +559,14 @@ if (isset($content_pref["content_list_summary"]) && $content_pref["content_list_ }else{ $CONTENT_RECENT_TABLE_SUMMARY = ($row['content_summary'] ? $row['content_summary'] : ""); } -return $tp->toHTML($CONTENT_RECENT_TABLE_SUMMARY, TRUE, ""); + return $tp->toHTML($CONTENT_RECENT_TABLE_SUMMARY, TRUE, ""); } SC_END SC_BEGIN CONTENT_RECENT_TABLE_TEXT -global $CONTENT_RECENT_TABLE_TEXT, $content_pref, $qs, $row, $mainparent, $tp; +global $content_pref, $row, $tp; if(isset($content_pref["content_list_text"]) && $content_pref["content_list_text"] && $content_pref["content_list_text_char"] > 0){ $rowtext = preg_replace("/\[newpage.*?]/si", " ", $row['content_text']); - //$rowtext = str_replace ("
", " ", $rowtext); $rowtext = $tp->toHTML($rowtext, TRUE, "nobreak"); $rowtext = strip_tags($rowtext); $words = explode(" ", $rowtext); @@ -637,15 +583,15 @@ return $CONTENT_RECENT_TABLE_TEXT; SC_END SC_BEGIN CONTENT_RECENT_TABLE_DATE -global $CONTENT_RECENT_TABLE_DATE, $content_pref, $qs, $row, $mainparent; +global $content_pref, $row; if(isset($content_pref["content_list_date"]) && $content_pref["content_list_date"]){ -$datestyle = ($content_pref["content_list_datestyle"] ? $content_pref["content_list_datestyle"] : "%d %b %Y"); -return strftime($datestyle, $row['content_datestamp']); + $datestyle = ($content_pref["content_list_datestyle"] ? $content_pref["content_list_datestyle"] : "%d %b %Y"); + return strftime($datestyle, $row['content_datestamp']); } SC_END SC_BEGIN CONTENT_RECENT_TABLE_EPICONS -global $CONTENT_RECENT_TABLE_EPICONS, $tp, $content_pref, $qs, $row, $mainparent; +global $tp, $content_pref, $row; $CONTENT_RECENT_TABLE_EPICONS = ""; if(isset($content_pref["content_list_peicon"]) && $content_pref["content_list_peicon"]){ if($row['content_pe'] || isset($content_pref["content_list_peicon_all"]) && $content_pref["content_list_peicon_all"]){ @@ -663,14 +609,14 @@ return $CONTENT_RECENT_TABLE_AUTHORDETAILS; SC_END SC_BEGIN CONTENT_RECENT_TABLE_EDITICON -global $CONTENT_RECENT_TABLE_EDITICON, $content_pref, $qs, $row, $mainparent, $plugindir; +global $content_pref, $row, $plugindir; if(ADMIN && getperms("P") && isset($content_pref["content_list_editicon"]) && $content_pref["content_list_editicon"]){ -return $CONTENT_RECENT_TABLE_EDITICON = "".CONTENT_ICON_EDIT.""; + return $CONTENT_RECENT_TABLE_EDITICON = "".CONTENT_ICON_EDIT.""; } SC_END SC_BEGIN CONTENT_RECENT_TABLE_REFER -global $CONTENT_RECENT_TABLE_REFER, $content_pref, $qs, $row, $mainparent; +global $content_pref, $row; if($content_pref["content_log"] && $content_pref["content_list_refer"]){ $refercounttmp = explode("^", $row['content_refer']); $CONTENT_RECENT_TABLE_REFER = ($refercounttmp[0] ? $refercounttmp[0] : "0"); @@ -681,7 +627,7 @@ if($content_pref["content_log"] && $content_pref["content_list_refer"]){ SC_END SC_BEGIN CONTENT_RECENT_TABLE_RATING -global $CONTENT_RECENT_TABLE_RATING, $rater, $row, $qs, $content_pref, $plugintable, $mainparent; +global $rater, $row, $content_pref, $plugintable; if($content_pref["content_list_rating"]){ if($content_pref["content_list_rating_all"] || $row['content_rate']){ return $rater->composerating($plugintable, $row['content_id'], $enter=FALSE, $userid=FALSE); @@ -690,30 +636,30 @@ if($content_pref["content_list_rating"]){ SC_END SC_BEGIN CONTENT_RECENT_TABLE_PARENT -global $CONTENT_RECENT_TABLE_PARENT, $content_pref, $mainparent, $row, $array, $aa; +global $content_pref, $row, $array, $aa; if(isset($content_pref["content_list_parent"]) && $content_pref["content_list_parent"]){ -return $aa -> getCrumbItem($row['content_parent'], $array); + return $aa -> getCrumbItem($row['content_parent'], $array); } SC_END // CONTENT_ARCHIVE_TABLE ------------------------------------------------ SC_BEGIN CONTENT_ARCHIVE_TABLE_LETTERS -global $CONTENT_ARCHIVE_TABLE_LETTERS, $content_pref, $mainparent; +global $content_pref; if($content_pref["content_archive_letterindex"]){ -return $CONTENT_ARCHIVE_TABLE_LETTERS; + return $CONTENT_ARCHIVE_TABLE_LETTERS; } SC_END SC_BEGIN CONTENT_ARCHIVE_TABLE_HEADING -global $CONTENT_ARCHIVE_TABLE_HEADING, $row, $qs; +global $row; return "".$row['content_heading'].""; SC_END SC_BEGIN CONTENT_ARCHIVE_TABLE_DATE -global $CONTENT_ARCHIVE_TABLE_DATE, $row, $content_pref, $qs, $mainparent; +global $row, $content_pref; if(isset($content_pref["content_archive_date"]) && $content_pref["content_archive_date"]){ -$datestyle = ($content_pref["content_archive_datestyle"] ? $content_pref["content_archive_datestyle"] : "%d %b %Y"); -return strftime($datestyle, $row['content_datestamp']); + $datestyle = ($content_pref["content_archive_datestyle"] ? $content_pref["content_archive_datestyle"] : "%d %b %Y"); + return strftime($datestyle, $row['content_datestamp']); } SC_END @@ -726,85 +672,82 @@ SC_END SC_BEGIN CONTENT_CONTENT_TABLE_INFO_PRE global $CONTENT_CONTENT_TABLE_INFO_PRE; if($CONTENT_CONTENT_TABLE_INFO_PRE === TRUE){ -$CONTENT_CONTENT_TABLE_INFO_PRE = " "; -return $CONTENT_CONTENT_TABLE_INFO_PRE; + $CONTENT_CONTENT_TABLE_INFO_PRE = " "; + return $CONTENT_CONTENT_TABLE_INFO_PRE; } SC_END SC_BEGIN CONTENT_CONTENT_TABLE_INFO_POST global $CONTENT_CONTENT_TABLE_INFO_POST; if($CONTENT_CONTENT_TABLE_INFO_POST === TRUE){ -$CONTENT_CONTENT_TABLE_INFO_POST = " "; -return $CONTENT_CONTENT_TABLE_INFO_POST; + $CONTENT_CONTENT_TABLE_INFO_POST = " "; + return $CONTENT_CONTENT_TABLE_INFO_POST; } SC_END SC_BEGIN CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA global $CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA; if($CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA === TRUE){ -$CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA = " "; -return $CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA; + $CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA = " "; + return $CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA; } SC_END SC_BEGIN CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA global $CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA; if($CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA === TRUE){ -$CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA = " "; -return $CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA; + $CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA = " "; + return $CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA; } SC_END SC_BEGIN CONTENT_CONTENT_TABLE_PARENT -global $CONTENT_CONTENT_TABLE_PARENT, $aa, $array, $row, $content_pref, $mainparent; +global $aa, $array, $row, $content_pref; if(isset($content_pref["content_content_parent"]) && $content_pref["content_content_parent"]){ -return $aa -> getCrumbItem($row['content_parent'], $array); + return $aa -> getCrumbItem($row['content_parent'], $array); } SC_END SC_BEGIN CONTENT_CONTENT_TABLE_ICON -global $CONTENT_CONTENT_TABLE_ICON, $qs, $row, $aa, $content_pref, $content_icon_path, $mainparent; +global $row, $aa, $content_pref, $content_icon_path; if(isset($content_pref["content_content_icon"]) && $content_pref["content_content_icon"]){ -$width = (isset($content_pref["content_upload_icon_size"]) && $content_pref["content_upload_icon_size"] ? $content_pref["content_upload_icon_size"] : "100"); -return $aa -> getIcon("item", $row['content_icon'], $content_icon_path, "", $width, $content_pref["content_blank_icon"]); + $width = (isset($content_pref["content_upload_icon_size"]) && $content_pref["content_upload_icon_size"] ? $content_pref["content_upload_icon_size"] : "100"); + return $aa -> getIcon("item", $row['content_icon'], $content_icon_path, "", $width, $content_pref["content_blank_icon"]); } SC_END SC_BEGIN CONTENT_CONTENT_TABLE_HEADING -global $CONTENT_CONTENT_TABLE_HEADING, $row, $tp; -$CONTENT_CONTENT_TABLE_HEADING = ($row['content_heading'] ? $tp -> toHTML($row['content_heading'], TRUE, "") : ""); -return $CONTENT_CONTENT_TABLE_HEADING; +global $row, $tp; +return ($row['content_heading'] ? $tp -> toHTML($row['content_heading'], TRUE, "") : ""); SC_END SC_BEGIN CONTENT_CONTENT_TABLE_REFER -global $CONTENT_CONTENT_TABLE_REFER, $sql, $qs, $content_pref, $plugintable, $mainparent; +global $sql, $qs, $content_pref, $plugintable; if(isset($content_pref["content_content_refer"]) && $content_pref["content_content_refer"]){ $sql -> db_Select($plugintable, "content_refer", "content_id='".intval($qs[1])."' "); list($content_refer) = $sql -> db_Fetch(); $refercounttmp = explode("^", $content_refer); - $CONTENT_CONTENT_TABLE_REFER = ($refercounttmp[0] ? $refercounttmp[0] : ""); -return $CONTENT_CONTENT_TABLE_REFER; + return ($refercounttmp[0] ? $refercounttmp[0] : ""); } SC_END SC_BEGIN CONTENT_CONTENT_TABLE_SUBHEADING -global $CONTENT_CONTENT_TABLE_SUBHEADING, $row, $tp, $content_pref, $qs, $mainparent; -$CONTENT_CONTENT_TABLE_SUBHEADING = ($content_pref["content_content_subheading"] && $row['content_subheading'] ? $tp -> toHTML($row['content_subheading'], TRUE, "") : ""); -return $CONTENT_CONTENT_TABLE_SUBHEADING; +global $row, $tp, $content_pref; +return ($content_pref["content_content_subheading"] && $row['content_subheading'] ? $tp -> toHTML($row['content_subheading'], TRUE, "") : ""); SC_END SC_BEGIN CONTENT_CONTENT_TABLE_COMMENT -global $CONTENT_CONTENT_TABLE_COMMENT, $cobj, $qs, $content_pref, $mainparent, $row, $plugintable; +global $cobj, $qs, $content_pref, $row, $plugintable; if((isset($content_pref["content_content_comment"]) && $content_pref["content_content_comment"] && $row['content_comment']) || $content_pref["content_content_comment_all"] ){ -return $cobj -> count_comments($plugintable, $qs[1]); + return $cobj -> count_comments($plugintable, $qs[1]); } SC_END SC_BEGIN CONTENT_CONTENT_TABLE_DATE -global $CONTENT_CONTENT_TABLE_DATE, $gen, $row, $qs, $content_pref, $mainparent; +global $gen, $row, $content_pref; if(isset($content_pref["content_content_date"]) && $content_pref["content_content_date"]){ $gen = new convert; $datestamp = preg_replace("# -.*#", "", $gen -> convert_date($row['content_datestamp'], "long")); $CONTENT_CONTENT_TABLE_DATE = ($datestamp != "" ? $datestamp : ""); -return $CONTENT_CONTENT_TABLE_DATE; + return $CONTENT_CONTENT_TABLE_DATE; } SC_END @@ -814,59 +757,57 @@ return $CONTENT_CONTENT_TABLE_AUTHORDETAILS; SC_END SC_BEGIN CONTENT_CONTENT_TABLE_EPICONS -global $CONTENT_CONTENT_TABLE_EPICONS, $content_pref, $qs, $row, $tp, $mainparent; +global $content_pref, $row, $tp; $CONTENT_CONTENT_TABLE_EPICONS = ""; if(($content_pref["content_content_peicon"] && $row['content_pe']) || $content_pref["content_content_peicon_all"]){ $CONTENT_CONTENT_TABLE_EPICONS = $tp -> parseTemplate("{EMAIL_ITEM=".CONTENT_LAN_69." ".CONTENT_LAN_71."^plugin:content.".$row['content_id']."}"); $CONTENT_CONTENT_TABLE_EPICONS .= " ".$tp -> parseTemplate("{PRINT_ITEM=".CONTENT_LAN_70." ".CONTENT_LAN_71."^plugin:content.".$row['content_id']."}"); $CONTENT_CONTENT_TABLE_EPICONS .= " ".$tp -> parseTemplate("{PDF=".CONTENT_LAN_76." ".CONTENT_LAN_71."^plugin:content.".$row['content_id']."}"); -return $CONTENT_CONTENT_TABLE_EPICONS; + return $CONTENT_CONTENT_TABLE_EPICONS; } SC_END SC_BEGIN CONTENT_CONTENT_TABLE_EDITICON -global $CONTENT_CONTENT_TABLE_EDITICON, $content_pref, $qs, $row, $plugindir, $mainparent; +global $content_pref, $row, $plugindir; if(ADMIN && getperms("P") && isset($content_pref["content_content_editicon"])){ - $CONTENT_CONTENT_TABLE_EDITICON = "".CONTENT_ICON_EDIT.""; -return $CONTENT_CONTENT_TABLE_EDITICON; + return "".CONTENT_ICON_EDIT.""; } SC_END SC_BEGIN CONTENT_CONTENT_TABLE_RATING -global $CONTENT_CONTENT_TABLE_RATING, $content_pref, $qs, $row, $rater, $plugintable, $mainparent; +global $content_pref, $row, $rater, $plugintable; if(($content_pref["content_content_rating"] && $row['content_rate']) || $content_pref["content_content_rating_all"] ){ -return $rater->composerating($plugintable, $row['content_id'], $enter=TRUE, $userid=FALSE); + return $rater->composerating($plugintable, $row['content_id'], $enter=TRUE, $userid=FALSE); } SC_END SC_BEGIN CONTENT_CONTENT_TABLE_FILE -global $CONTENT_CONTENT_TABLE_FILE, $row, $content_file_path, $content_pref, $mainparent; +global $row, $content_file_path, $content_pref; if($content_pref["content_content_attach"]){ -$filestmp = explode("[file]", $row['content_file']); -foreach($filestmp as $key => $value) { - if($value == "") { - unset($filestmp[$key]); + $filestmp = explode("[file]", $row['content_file']); + foreach($filestmp as $key => $value) { + if($value == "") { + unset($filestmp[$key]); + } } -} -$files = array_values($filestmp); -$content_files_popup_name = str_replace("'", "", $row['content_heading']); -$file = ""; -$filesexisting = "0"; -for($i=0;$i".CONTENT_ICON_FILE." "; - }else{ - $file .= " "; + $files = array_values($filestmp); + $content_files_popup_name = str_replace("'", "", $row['content_heading']); + $file = ""; + $filesexisting = "0"; + for($i=0;$i".CONTENT_ICON_FILE." "; + }else{ + $file .= " "; + } } -} -$CONTENT_CONTENT_TABLE_FILE = ($filesexisting == "0" ? "" : CONTENT_LAN_41." ".($filesexisting == 1 ? CONTENT_LAN_42 : CONTENT_LAN_43)." ".$file." "); -return $CONTENT_CONTENT_TABLE_FILE; + return ($filesexisting == "0" ? "" : CONTENT_LAN_41." ".($filesexisting == 1 ? CONTENT_LAN_42 : CONTENT_LAN_43)." ".$file." "); } SC_END SC_BEGIN CONTENT_CONTENT_TABLE_SCORE -global $CONTENT_CONTENT_TABLE_SCORE, $row; +global $row; $score = $row['content_score']; if($score){ $height = "height:8px;"; @@ -894,38 +835,38 @@ return $CONTENT_CONTENT_TABLE_TEXT; SC_END SC_BEGIN CONTENT_CONTENT_TABLE_IMAGES -global $CONTENT_CONTENT_TABLE_IMAGES, $row, $content_image_path, $aa, $tp, $authordetails, $content_pref, $mainparent; +global $row, $content_image_path, $aa, $tp, $authordetails, $content_pref; if($content_pref["content_content_images"]){ -$authordetails = $aa -> getAuthor($row['content_author']); -$imagestmp = explode("[img]", $row['content_image']); -foreach($imagestmp as $key => $value) { - if($value == "") { - unset($imagestmp[$key]); + $authordetails = $aa -> getAuthor($row['content_author']); + $imagestmp = explode("[img]", $row['content_image']); + foreach($imagestmp as $key => $value) { + if($value == "") { + unset($imagestmp[$key]); + } } -} -$images = array_values($imagestmp); -$content_image_popup_name = $row['content_heading']; -$CONTENT_CONTENT_TABLE_IMAGES = ""; -require_once(e_HANDLER."popup_handler.php"); -$pp = new popup; -$gen = new convert; -$datestamp = preg_replace("# -.*#", "", $gen -> convert_date($row['content_datestamp'], "long")); -for($i=0;$i convert_date($row['content_datestamp'], "long")); + for($i=0;$i toHTML($row['content_subheading'], TRUE); - $popupname = $tp -> toHTML($content_image_popup_name, TRUE); - $author = $tp -> toHTML($authordetails[1], TRUE); - $oTitle = $popupname." ".($i+1); - $oText = $popupname." ".($i+1)."
".$subheading."
".$author." (".$datestamp.")"; - $CONTENT_CONTENT_TABLE_IMAGES .= $pp -> popup($oSrc, $oSrcThumb, $oIconWidth, $oMaxWidth, $oTitle, $oText); -} -return $CONTENT_CONTENT_TABLE_IMAGES; + $oIconWidth = (isset($content_pref["content_upload_image_size_thumb"]) && $content_pref["content_upload_image_size_thumb"] ? $content_pref["content_upload_image_size_thumb"] : "100"); + + $oMaxWidth = (isset($content_pref["content_upload_image_size"]) && $content_pref["content_upload_image_size"] ? $content_pref["content_upload_image_size"] : "500"); + + $subheading = $tp -> toHTML($row['content_subheading'], TRUE); + $popupname = $tp -> toHTML($content_image_popup_name, TRUE); + $author = $tp -> toHTML($authordetails[1], TRUE); + $oTitle = $popupname." ".($i+1); + $oText = $popupname." ".($i+1)."
".$subheading."
".$author." (".$datestamp.")"; + $CONTENT_CONTENT_TABLE_IMAGES .= $pp -> popup($oSrc, $oSrcThumb, $oIconWidth, $oMaxWidth, $oTitle, $oText); + } + return $CONTENT_CONTENT_TABLE_IMAGES; } SC_END @@ -956,36 +897,36 @@ SC_END //content images (from uploaded area) used in the print page SC_BEGIN CONTENT_PRINT_IMAGES -global $CONTENT_PRINT_IMAGES, $row, $content_image_path, $tp, $content_pref, $mainparent; +global $row, $content_image_path, $tp, $content_pref; if($content_pref["content_content_images"]){ -$imagestmp = explode("[img]", $row['content_image']); -foreach($imagestmp as $key => $value) { - if($value == "") { - unset($imagestmp[$key]); + $imagestmp = explode("[img]", $row['content_image']); + foreach($imagestmp as $key => $value) { + if($value == "") { + unset($imagestmp[$key]); + } } -} -$images = array_values($imagestmp); -$CONTENT_PRINT_IMAGES = ""; -for($i=0;$i

"; } - $CONTENT_PRINT_IMAGES .= "

"; } -} -return $CONTENT_PRINT_IMAGES; + return $CONTENT_PRINT_IMAGES; } SC_END @@ -994,37 +935,37 @@ SC_END //content images (from uploaded area) used in the pdf creation SC_BEGIN CONTENT_PDF_IMAGES -global $CONTENT_PDF_IMAGES, $row, $content_image_path, $tp, $content_pref, $mainparent; +global $row, $content_image_path, $tp, $content_pref; if($content_pref["content_content_images"]){ -$imagestmp = explode("[img]", $row['content_image']); -foreach($imagestmp as $key => $value) { - if($value == "") { - unset($imagestmp[$key]); + $imagestmp = explode("[img]", $row['content_image']); + foreach($imagestmp as $key => $value) { + if($value == "") { + unset($imagestmp[$key]); + } } -} -$images = array_values($imagestmp); -$CONTENT_PDF_IMAGES = ""; -for($i=0;$i"; } - $thumb = $oSrc; - $CONTENT_PDF_IMAGES .= ""; } -} -return $CONTENT_PDF_IMAGES; + return $CONTENT_PDF_IMAGES; } SC_END @@ -1038,8 +979,8 @@ 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"]); +$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_small.$row['content_icon']; return ($row['content_icon'] ? "" : " "); SC_END @@ -1113,19 +1054,34 @@ if($row['content_parent'] == "0"){ return $class; SC_END +SC_BEGIN CONTENT_MANAGER_INHERIT +global $row, $content_pref; +return ""; +SC_END + +SC_BEGIN CONTENT_ADMIN_MANAGER_SUBMIT +global $row, $content_pref; +return r_userclass("content_manager_submit", $content_pref["content_manager_submit"], 'off', "public,guest,nobody,member,admin,classes"); +SC_END + SC_BEGIN CONTENT_ADMIN_MANAGER_APPROVE -global $row; +global $row, $content_pref; 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"); +global $row, $content_pref; +return r_userclass("content_manager_personal", $content_pref["content_manager_personal"], 'off', "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"); +global $row, $content_pref; +return r_userclass("content_manager_category", $content_pref["content_manager_category"], 'off', "nobody,member,admin,classes"); +SC_END + +SC_BEGIN CONTENT_ADMIN_MANAGER_OPTIONS +global $CONTENT_ADMIN_MANAGER_OPTIONS; +return $CONTENT_ADMIN_MANAGER_OPTIONS; SC_END SC_BEGIN CONTENT_ORDER @@ -1150,7 +1106,7 @@ SC_END SC_BEGIN CONTENT_ADMIN_SPACER global $CONTENT_ADMIN_SPACER; -return ($CONTENT_ADMIN_SPACER ? " " : ""); +return ($parm==true || $CONTENT_ADMIN_SPACER ? " " : ""); SC_END SC_BEGIN CONTENT_ADMIN_FORM_TARGET diff --git a/e107_plugins/content/content_submit.php b/e107_plugins/content/content_submit.php deleted file mode 100644 index 350e3f0bf..000000000 --- a/e107_plugins/content/content_submit.php +++ /dev/null @@ -1,137 +0,0 @@ - setPageTitle(); - -require_once(HEADERF); - -if(isset($_POST['create_content'])){ - if($_POST['content_text'] && $_POST['content_heading'] && $_POST['parent'] != "none" && $_POST['content_author_name'] != "" && $_POST['content_author_email'] != ""){ - $adb -> dbContent("create", "submit"); - }else{ - $message = CONTENT_ADMIN_SUBMIT_LAN_4; - } -} - -if(isset($qs[0]) && $qs[0] == "s"){ - $message = CONTENT_ADMIN_SUBMIT_LAN_2."

".CONTENT_ADMIN_SUBMIT_LAN_5; - $ns -> tablerender("", "
".$message."
"); - require_once(FOOTERF); - exit; -} -if(isset($qs[0]) && $qs[0] == "d"){ - $message = CONTENT_ADMIN_SUBMIT_LAN_3."

".CONTENT_ADMIN_SUBMIT_LAN_5; - $ns -> tablerender("", "
".$message."
"); - require_once(FOOTERF); - exit; -} - -if(isset($message)){ - $ns -> tablerender("", "
".$message."
"); -} - -if(!isset($qs[0])){ - if(!$sql -> db_Select($plugintable, "content_id, content_heading, content_subheading, content_icon, content_pref", "content_parent = '0' AND content_class REGEXP '".e_CLASS_REGEXP."' ORDER BY content_heading")){ - $text .= "
".CONTENT_ADMIN_SUBMIT_LAN_0."
"; - }else{ - if(!isset($CONTENT_SUBMIT_TYPE_TABLE)){ - if(is_readable(e_THEME.$pref['sitetheme']."/content/content_submit_type_template.php")){ - require_once(e_THEME.$pref['sitetheme']."/content/content_submit_type_template.php"); - }else{ - require_once(e_PLUGIN."content/templates/content_submit_type_template.php"); - } - } - $sql2 = ""; - $content_submit_type_table_string = ""; - $count = "0"; - while($row = $sql -> db_Fetch()){ - if(!is_object($sql2)){ $sql2 = new db; } - - $content_pref = $eArrayStorage->ReadArray($row['content_pref']); - $content_pref["content_cat_icon_path_large"] = ($content_pref["content_cat_icon_path_large"] ? $content_pref["content_cat_icon_path_large"] : "{e_PLUGIN}content/images/cat/48/" ); - $content_pref["content_cat_icon_path_small"] = ($content_pref["content_cat_icon_path_small"] ? $content_pref["content_cat_icon_path_small"] : "{e_PLUGIN}content/images/cat/16/" ); - $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"]); - if($content_pref["content_submit"] && check_class($content_pref["content_submit_class"])){ - $content_submit_type_table_string .= $tp -> parseTemplate($CONTENT_SUBMIT_TYPE_TABLE, FALSE, $content_shortcodes); - $count = $count + 1; - } - } - if($count == "0"){ - $text .= "
".CONTENT_ADMIN_SUBMIT_LAN_0."
"; - }else{ - $text = $CONTENT_SUBMIT_TYPE_TABLE_START.$content_submit_type_table_string.$CONTENT_SUBMIT_TYPE_TABLE_END; - } - } - $caption = CONTENT_ADMIN_SUBMIT_LAN_1; - $ns -> tablerender($caption, $text); -} - -if(isset($qs[0]) && $qs[0]=="content" && $qs[1] == "submit" && is_numeric($qs[2]) && !isset($qs[3])){ - //check if valid categories exist for this main parent - $array = $aa -> getCategoryTree("", intval($qs[2]), TRUE); - $validparent = implode(",", array_keys($array)); - $qry = " content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' "; - $sql2 = new db; - //$contenttotal = $sql2 -> db_Count($plugintable, "(*)", "WHERE ".$qry." ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' " ); - $aform -> show_create_content("submit"); -} - -require_once(FOOTERF); - -?> diff --git a/e107_plugins/content/content_update.php b/e107_plugins/content/content_update.php index d936ad4ba..83b720414 100644 --- a/e107_plugins/content/content_update.php +++ b/e107_plugins/content/content_update.php @@ -11,9 +11,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/content/content_update.php,v $ -| $Revision: 1.2 $ -| $Date: 2006-12-31 14:46:30 $ -| $Author: e107coders $ +| $Revision: 1.3 $ +| $Date: 2007-03-13 16:51:05 $ +| $Author: lisa_ $ +----------------------------------------------------------------------------+ */ if (!defined('e107_INIT')) { exit; } @@ -32,8 +32,7 @@ $aa = new content; require_once($plugindir."handlers/content_convert_class.php"); $ac = new content_convert; -$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(e_PLUGIN."content/languages/".e_LANGUAGE."/lan_content_admin.php"); if($sql->db_Select("plugin", "plugin_version", "plugin_path = 'content'")) { @@ -365,4 +364,4 @@ function set_content_version() return $text; } -?> +?> \ No newline at end of file diff --git a/e107_plugins/content/content_update_check.php b/e107_plugins/content/content_update_check.php index 95c2cb559..17b13787c 100644 --- a/e107_plugins/content/content_update_check.php +++ b/e107_plugins/content/content_update_check.php @@ -11,9 +11,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/content/content_update_check.php,v $ -| $Revision: 1.1.1.1 $ -| $Date: 2006-12-02 04:34:56 $ -| $Author: mcfly_e107 $ +| $Revision: 1.2 $ +| $Date: 2007-03-13 16:51:05 $ +| $Author: lisa_ $ +----------------------------------------------------------------------------+ */ @@ -52,7 +52,7 @@ function update_content_07($type='') if($newcontent == 0 && !$exists){ return FALSE; //needed } - + //if parent value is old style, return FALSE = needed if($newcontent > 0){ if($thiscount = $sql -> db_Select("pcontent", "*", "ORDER BY content_id ", "mode=no_where" )){ @@ -79,7 +79,4 @@ function update_content_07($type='') } } - - -?> - \ No newline at end of file +?> \ No newline at end of file diff --git a/e107_plugins/content/e_emailprint.php b/e107_plugins/content/e_emailprint.php index e12464738..6159cf6c9 100644 --- a/e107_plugins/content/e_emailprint.php +++ b/e107_plugins/content/e_emailprint.php @@ -12,9 +12,7 @@ function print_item($id) $aa = new content; require_once(e_PLUGIN."content/content_shortcodes.php"); - - $lan_file = e_PLUGIN."content/languages/".e_LANGUAGE."/lan_content.php"; - include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."content/languages/English/lan_content.php"); + include_lan(e_PLUGIN."content/languages/".e_LANGUAGE."/lan_content.php"); if(!is_object($sql)){ $sql = new db; } $sql -> db_Select($plugintable, "content_id, content_heading, content_subheading, content_text, content_author, content_image, content_parent, content_datestamp, content_class", "content_id='".intval($id)."' "); diff --git a/e107_plugins/content/e_frontpage.php b/e107_plugins/content/e_frontpage.php index 62cea44ad..dddb7e321 100644 --- a/e107_plugins/content/e_frontpage.php +++ b/e107_plugins/content/e_frontpage.php @@ -2,8 +2,7 @@ if (!defined('e107_INIT')) { exit; } -@include_once(e_PLUGIN.'content/languages/'.e_LANGUAGE.'/lan_content_frontpage.php'); -@include_once(e_PLUGIN.'content/languages/English/lan_content_frontpage.php'); +include_lan(e_PLUGIN."content/languages/".e_LANGUAGE."/lan_content_frontpage.php"); $sql2 = new db; if ($sql2 -> db_Select("pcontent", "content_id, content_heading", "LEFT(content_parent,1)='0'")) { diff --git a/e107_plugins/content/e_latest.php b/e107_plugins/content/e_latest.php index 3d7b67842..c17a4fc04 100644 --- a/e107_plugins/content/e_latest.php +++ b/e107_plugins/content/e_latest.php @@ -1,8 +1,7 @@ db_Count($plugintable, '(*)', "WHERE content_refer='sa' "); diff --git a/e107_plugins/content/e_notify.php b/e107_plugins/content/e_notify.php index 7ac5c1722..518a76794 100644 --- a/e107_plugins/content/e_notify.php +++ b/e107_plugins/content/e_notify.php @@ -11,14 +11,13 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/content/e_notify.php,v $ -| $Revision: 1.1.1.1 $ -| $Date: 2006-12-02 04:34:56 $ -| $Author: mcfly_e107 $ +| $Revision: 1.2 $ +| $Date: 2007-03-13 16:51:05 $ +| $Author: lisa_ $ +----------------------------------------------------------------------------+ */ -$lan_file = e_PLUGIN."content/languages/".e_LANGUAGE."/lan_content.php"; -include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."content/languages/English/lan_content.php"); +include_lan(e_PLUGIN."content/languages/".e_LANGUAGE."/lan_content.php"); $config_category = CONTENT_NOTIFY_LAN_1; $config_events = array('content' => CONTENT_NOTIFY_LAN_2); diff --git a/e107_plugins/content/e_rss.php b/e107_plugins/content/e_rss.php index 9f6d74fd4..abccdd5f3 100644 --- a/e107_plugins/content/e_rss.php +++ b/e107_plugins/content/e_rss.php @@ -2,8 +2,6 @@ if (!defined('e107_INIT')) { exit; } - - require_once(e_PLUGIN."content/handlers/content_class.php"); $aa = new content; diff --git a/e107_plugins/content/e_search.php b/e107_plugins/content/e_search.php index 4145f3247..46788d1b6 100644 --- a/e107_plugins/content/e_search.php +++ b/e107_plugins/content/e_search.php @@ -1,11 +1,8 @@ e_PLUGIN.'content/search/search_parser.php', 'qtype' => CONT_SCH_LAN_1, 'refpage' => 'content.php', 'advanced' => e_PLUGIN.'content/search/search_advanced.php'); ?> \ No newline at end of file diff --git a/e107_plugins/content/e_status.php b/e107_plugins/content/e_status.php index e3869c5f8..66a1a5848 100644 --- a/e107_plugins/content/e_status.php +++ b/e107_plugins/content/e_status.php @@ -1,8 +1,7 @@ db_Count("pcontent", "(*)", "WHERE LEFT(content_parent,1) != '0' AND content_refer != 'sa'"); diff --git a/e107_plugins/content/handlers/content_class.php b/e107_plugins/content/handlers/content_class.php index 3990e6f42..d85fdd092 100644 --- a/e107_plugins/content/handlers/content_class.php +++ b/e107_plugins/content/handlers/content_class.php @@ -12,8 +12,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/content/handlers/content_class.php,v $ -| $Revision: 1.9 $ -| $Date: 2007-03-01 09:35:17 $ +| $Revision: 1.10 $ +| $Date: 2007-03-13 16:51:05 $ | $Author: lisa_ $ +---------------------------------------------------------------+ */ @@ -35,337 +35,346 @@ class content{ global $tp; //ADMIN CREATE FORM - $content_pref['content_admin_subheading'] = "1"; //should subheading be available - $content_pref['content_admin_summary'] = "1"; //should summary be available - $content_pref['content_admin_startdate'] = "1"; //should start date be available - $content_pref['content_admin_enddate'] = "1"; //should end date be available - $content_pref['content_admin_icon'] = "0"; //should icon be available to add when creating an item - $content_pref['content_admin_attach'] = "0"; //should file be available to add when creating an item - $content_pref['content_admin_images'] = "0"; //should image be available to add when creating an item - $content_pref['content_admin_comment'] = "1"; //should comment be available to add when creating an item - $content_pref['content_admin_rating'] = "1"; //should rating be available to add when creating an item - $content_pref['content_admin_score'] = "1"; //should score be available to add when creating an item - $content_pref['content_admin_pe'] = "1"; //should printemailicons be available to add when creating an item - $content_pref['content_admin_visibility'] = "1"; //should visibility be available to add when creating an item - $content_pref['content_admin_meta'] = "0"; //should metatags be available to add when creating an item - $content_pref['content_admin_custom_number'] = "0"; //how many customtags should be available to add when creating an item - $content_pref['content_admin_images_number'] = "0"; //how many images should be available to add when creating an item - $content_pref['content_admin_files_number'] = "0"; //how many files should be available to add when creating an item - $content_pref['content_admin_layout'] = "0"; //should the option for choosing a layout template be shown - $content_pref['content_admin_customtags'] = "0"; //should options for adding additional data be shown - $content_pref['content_admin_presettags'] = "0"; //should preset data tags be shown + $cp['content_admin_subheading'] = '1'; //should subheading be available + $cp['content_admin_summary'] = '1'; //should summary be available + $cp['content_admin_startdate'] = '1'; //should start date be available + $cp['content_admin_enddate'] = '1'; //should end date be available + $cp['content_admin_icon'] = ''; //should icon be available to add when creating an item + $cp['content_admin_attach'] = ''; //should file be available to add when creating an item + $cp['content_admin_images'] = ''; //should image be available to add when creating an item + $cp['content_admin_comment'] = '1'; //should comment be available to add when creating an item + $cp['content_admin_rating'] = '1'; //should rating be available to add when creating an item + $cp['content_admin_score'] = '1'; //should score be available to add when creating an item + $cp['content_admin_pe'] = '1'; //should printemailicons be available to add when creating an item + $cp['content_admin_visibility'] = '1'; //should visibility be available to add when creating an item + $cp['content_admin_meta'] = ''; //should metatags be available to add when creating an item + $cp['content_admin_custom_number'] = ''; //how many customtags should be available to add when creating an item + $cp['content_admin_images_number'] = '2'; //how many images should be available to add when creating an item + $cp['content_admin_files_number'] = '1'; //how many files should be available to add when creating an item + $cp['content_admin_layout'] = ''; //should the option for choosing a layout template be shown + $cp['content_admin_customtags'] = ''; //should options for adding additional data be shown + $cp['content_admin_presettags'] = ''; //should preset data tags be shown //ADMIN CREATE CATEGORY FORM - $content_pref['content_admincat_subheading'] = '1'; //should subheading be available - $content_pref['content_admincat_startdate'] = '1'; //should startdate be available - $content_pref['content_admincat_enddate'] = '1'; //should enddate be available - $content_pref['content_admincat_uploadicon'] = '1'; //should uploadicon be available - $content_pref['content_admincat_selecticon'] = '1'; //should selecticon be available - $content_pref['content_admincat_comment'] = '1'; //should comment be available - $content_pref['content_admincat_rating'] = '1'; //should rating be available - $content_pref['content_admincat_pe'] = '1'; //should print email icons be available - $content_pref['content_admincat_visibility'] = '1'; //should visibility be available - - //SUBMIT FORM - $content_pref['content_submit'] = "0"; //should users be able to submit an item - $content_pref['content_submit_class'] = "0"; //define which userclass is able to submit an item - $content_pref['content_submit_directpost'] ="0"; //should submission be direclty posted as an item, or have them validated by admins - $content_pref['content_submit_subheading'] = '1'; //should subheading be available - $content_pref['content_submit_summary'] = '1'; //should summary be available - $content_pref['content_submit_startdate'] = '1'; //should startdate be available - $content_pref['content_submit_enddate'] = '1'; //should enddate be available - $content_pref['content_submit_icon'] = "0"; //should icon be available to add when submitting an item - $content_pref['content_submit_attach'] = "0"; //should file be available to add when submitting an item - $content_pref['content_submit_images'] = "0"; //should image be available to add when submitting an item - $content_pref['content_submit_comment'] = "0"; //should comment be available to add when submitting an item - $content_pref['content_submit_rating'] = "0"; //should rating be available to add when submitting an item - $content_pref['content_submit_score'] = "0"; //should score be available to add when submitting an item - $content_pref['content_submit_pe'] = "0"; //should printemailicons be available to add when submitting an item - $content_pref['content_submit_visibility'] = "0"; //should visibility be available to add when submitting an item - $content_pref['content_submit_meta'] = "0"; //should metatags be available to add when submitting an item - $content_pref['content_submit_custom_number'] = "0"; //how many customtags should be available to add when submitting an item - $content_pref['content_submit_images_number'] = "0"; //how many images should be available to add when submitting an item - $content_pref['content_submit_files_number'] = "0"; //how many files should be available to add when submitting an item - $content_pref['content_submit_layout'] = "0"; //should the option for choosing a layout template be shown - $content_pref['content_submit_customtags'] = "0"; //should options for adding additional data be shown - $content_pref['content_submit_presettags'] = "0"; //should preset data tags be shown + $cp['content_admincat_subheading'] = '1'; //should subheading be available + $cp['content_admincat_startdate'] = '1'; //should startdate be available + $cp['content_admincat_enddate'] = '1'; //should enddate be available + $cp['content_admincat_uploadicon'] = '1'; //should uploadicon be available + $cp['content_admincat_selecticon'] = '1'; //should selecticon be available + $cp['content_admincat_comment'] = '1'; //should comment be available + $cp['content_admincat_rating'] = '1'; //should rating be available + $cp['content_admincat_pe'] = '1'; //should print email icons be available + $cp['content_admincat_visibility'] = '1'; //should visibility be available //PATH THEME CSS - $content_pref['content_cat_icon_path_large'] = "{e_PLUGIN}content/images/cat/48/"; //default path to large categry icons - $content_pref['content_cat_icon_path_small'] = "{e_PLUGIN}content/images/cat/16/"; //default path to small category icons + $cp['content_cat_icon_path_large'] = '{e_PLUGIN}content/images/cat/48/'; //default path to large categry icons + $cp['content_cat_icon_path_small'] = '{e_PLUGIN}content/images/cat/16/'; //default path to small category icons - $content_pref['content_icon_path'] = "{e_PLUGIN}content/images/icon/"; //default path to item icons - $content_pref['content_icon_path_tmp'] = "{e_PLUGIN}content/images/icon/tmp/"; //default tmp path to item icons + $cp['content_icon_path'] = '{e_PLUGIN}content/images/icon/'; //default path to item icons + $cp['content_icon_path_tmp'] = '{e_PLUGIN}content/images/icon/tmp/'; //default tmp path to item icons - $content_pref['content_image_path'] = "{e_PLUGIN}content/images/image/"; //default path to item images - $content_pref['content_image_path_tmp'] = "{e_PLUGIN}content/images/image/tmp/"; //default tmp path to item images + $cp['content_image_path'] = '{e_PLUGIN}content/images/image/'; //default path to item images + $cp['content_image_path_tmp'] = '{e_PLUGIN}content/images/image/tmp/'; //default tmp path to item images - $content_pref['content_file_path'] = "{e_PLUGIN}content/images/file/"; //default path to item file attachments - $content_pref['content_file_path_tmp'] = "{e_PLUGIN}content/images/file/tmp/"; //default tmp path to item file attachments + $cp['content_file_path'] = '{e_PLUGIN}content/images/file/'; //default path to item file attachments + $cp['content_file_path_tmp'] = '{e_PLUGIN}content/images/file/tmp/'; //default tmp path to item file attachments - $content_pref['content_theme'] = "{e_PLUGIN}content/templates/default/"; //choose theme for main parent - $content_pref['content_layout'] = "content_content_template.php"; //choose default layout scheme + $cp['content_theme'] = '{e_PLUGIN}content/templates/default/'; //choose theme for main parent + $cp['content_layout'] = 'content_content_template.php'; //choose default layout scheme //GENERAL - $content_pref['content_log'] = "0"; //activate log - $content_pref['content_blank_icon'] = "0"; //use blank icon if no icon present - $content_pref['content_blank_caticon'] = "0"; //use blank caticon if no caticon present - $content_pref['content_breadcrumb_catall'] = "0"; //show breadcrumb on all categories page - $content_pref['content_breadcrumb_cat'] = "0"; //show breadcrumb on single category page - $content_pref['content_breadcrumb_authorall'] = "0"; //show breadcrumb on all author page - $content_pref['content_breadcrumb_author'] = "0"; //show breadcrumb on single author page - $content_pref['content_breadcrumb_recent'] = "0"; //show breadcrumb on recent page - $content_pref['content_breadcrumb_item'] = "0"; //show breadcrumb on content item page - $content_pref['content_breadcrumb_top'] = "0"; //show breadcrumb on top rated page - $content_pref['content_breadcrumb_archive'] = "0"; //show breadcrumb on archive page - $content_pref['content_breadcrumb_seperator{$id}'] = ">"; //seperator character between breadcrumb - $content_pref['content_breadcrumb_rendertype'] = "2"; //how to render the breadcrumb - $content_pref['content_navigator_catall'] = "0"; //show navigator on all categories page - $content_pref['content_navigator_cat'] = "0"; //show navigator on single category page - $content_pref['content_navigator_authorall'] = "0"; //show navigator on all author page - $content_pref['content_navigator_author'] = "0"; //show navigator on single author page - $content_pref['content_navigator_recent'] = "0"; //show navigator on recent page - $content_pref['content_navigator_item'] = "0"; //show navigator on content item page - $content_pref['content_navigator_top'] = "0"; //show navigator on top rated page - $content_pref['content_navigator_archive'] = "0"; //show navigator on archive page - $content_pref['content_search_catall'] = "0"; //show search keyword on all categories page - $content_pref['content_search_cat'] = "0"; //show search keyword on single category page - $content_pref['content_search_authorall'] = "0"; //show search keyword on all author page - $content_pref['content_search_author'] = "0"; //show search keyword on single author page - $content_pref['content_search_recent'] = "0"; //show search keyword on recent page - $content_pref['content_search_item'] = "0"; //show search keyword on content item page - $content_pref['content_search_top'] = "0"; //show search keyword on top rated page - $content_pref['content_search_archive'] = "0"; //show search keyword on archive page - $content_pref['content_ordering_catall'] = "0"; //show ordering on all categories page - $content_pref['content_ordering_cat'] = "0"; //show ordering on single category page - $content_pref['content_ordering_authorall'] = "0"; //show ordering on all author page - $content_pref['content_ordering_author'] = "0"; //show ordering on single author page - $content_pref['content_ordering_recent'] = "0"; //show ordering on recent page - $content_pref['content_ordering_item'] = "0"; //show ordering on content item page - $content_pref['content_ordering_top'] = "0"; //show ordering on top rated page - $content_pref['content_ordering_archive'] = "0"; //show ordering on archive page - $content_pref['content_searchmenu_rendertype'] = "1"; //rendertype for searchmenu (1=echo, 2=in separate menu) - $content_pref['content_nextprev'] = "1"; //use nextprev buttons - $content_pref['content_nextprev_number'] = "10"; //how many items on a page - $content_pref['content_defaultorder'] = "orderddate"; //default sort and order method + $cp['content_log'] = ''; //activate log + $cp['content_blank_icon'] = ''; //use blank icon if no icon present + $cp['content_blank_caticon'] = ''; //use blank caticon if no caticon present + $cp['content_breadcrumb_catall'] = ''; //show breadcrumb on all categories page + $cp['content_breadcrumb_cat'] = ''; //show breadcrumb on single category page + $cp['content_breadcrumb_authorall'] = ''; //show breadcrumb on all author page + $cp['content_breadcrumb_author'] = ''; //show breadcrumb on single author page + $cp['content_breadcrumb_recent'] = ''; //show breadcrumb on recent page + $cp['content_breadcrumb_item'] = ''; //show breadcrumb on content item page + $cp['content_breadcrumb_top'] = ''; //show breadcrumb on top rated page + $cp['content_breadcrumb_archive'] = ''; //show breadcrumb on archive page + $cp['content_breadcrumb_seperator'] = '>'; //seperator character between breadcrumb + $cp['content_breadcrumb_rendertype'] = '2'; //how to render the breadcrumb + $cp['content_navigator_catall'] = ''; //show navigator on all categories page + $cp['content_navigator_cat'] = ''; //show navigator on single category page + $cp['content_navigator_authorall'] = ''; //show navigator on all author page + $cp['content_navigator_author'] = ''; //show navigator on single author page + $cp['content_navigator_recent'] = ''; //show navigator on recent page + $cp['content_navigator_item'] = ''; //show navigator on content item page + $cp['content_navigator_top'] = ''; //show navigator on top rated page + $cp['content_navigator_archive'] = ''; //show navigator on archive page + $cp['content_search_catall'] = ''; //show search keyword on all categories page + $cp['content_search_cat'] = ''; //show search keyword on single category page + $cp['content_search_authorall'] = ''; //show search keyword on all author page + $cp['content_search_author'] = ''; //show search keyword on single author page + $cp['content_search_recent'] = ''; //show search keyword on recent page + $cp['content_search_item'] = ''; //show search keyword on content item page + $cp['content_search_top'] = ''; //show search keyword on top rated page + $cp['content_search_archive'] = ''; //show search keyword on archive page + $cp['content_ordering_catall'] = ''; //show ordering on all categories page + $cp['content_ordering_cat'] = ''; //show ordering on single category page + $cp['content_ordering_authorall'] = ''; //show ordering on all author page + $cp['content_ordering_author'] = ''; //show ordering on single author page + $cp['content_ordering_recent'] = ''; //show ordering on recent page + $cp['content_ordering_item'] = ''; //show ordering on content item page + $cp['content_ordering_top'] = ''; //show ordering on top rated page + $cp['content_ordering_archive'] = ''; //show ordering on archive page + $cp['content_searchmenu_rendertype'] = '1'; //rendertype for searchmenu (1=echo, 2=in separate menu) + $cp['content_nextprev'] = '1'; //use nextprev buttons + $cp['content_nextprev_number'] = '10'; //how many items on a page + $cp['content_defaultorder'] = 'orderddate'; //default sort and order method //upload icon/image size handling - $content_pref['content_upload_image_size'] = "500"; //resize size of uploaded image - $content_pref['content_upload_image_size_thumb'] = "100"; //resize size of created thumb on uploaded image - $content_pref['content_upload_icon_size'] = "100"; //resize size of uploaded icon + $cp['content_upload_image_size'] = '500'; //resize size of uploaded image + $cp['content_upload_image_size_thumb'] = '100'; //resize size of created thumb on uploaded image + $cp['content_upload_icon_size'] = '100'; //resize size of uploaded icon //CONTENT ITEM PREVIEW - $content_pref['content_list_icon'] = "0"; //show icon - $content_pref['content_list_subheading'] = "1"; //show subheading - $content_pref['content_list_summary'] = "1"; //show summary - $content_pref['content_list_text'] = "0"; //show (part of) text - $content_pref['content_list_date'] = "0"; //show date - $content_pref['content_list_authorname'] = "0"; //show authorname - $content_pref['content_list_authorprofile'] = "0"; //show link to author profile - $content_pref['content_list_authoremail'] = "0"; //show authoremail - $content_pref['content_list_authoricon'] = "0"; //show link to author list - $content_pref['content_list_rating'] = "1"; //show rating system - $content_pref['content_list_peicon'] = "1"; //show printemailicons - $content_pref['content_list_parent'] = "0"; //show parent cat - $content_pref['content_list_refer'] = "0"; //show refer count - $content_pref['content_list_subheading_char'] = "100"; //how many subheading characters - $content_pref['content_list_subheading_post'] = "[...]"; //use a postfix for too long subheadings - $content_pref['content_list_summary_char'] = "100"; //how many summary characters - $content_pref['content_list_summary_post'] = "[...]"; //use a postfix for too long summary - $content_pref['content_list_text_char'] = "60"; //how many text words - $content_pref['content_list_text_post'] = CONTENT_LAN_16; //use a postfix for too long text - $content_pref['content_list_text_link'] = "1"; //show link to content item on postfix - $content_pref['content_list_authoremail_nonmember'] = "0"; //show email non member author - $content_pref['content_list_peicon_all'] = "0"; //override printemail icons - $content_pref['content_list_rating_all'] = "0"; //override rating system - $content_pref['content_list_editicon'] = "0"; //show link to admin edit item - $content_pref['content_list_datestyle'] = "%d %b %Y"; //choose datestyle for given date - $content_pref['content_list_caption'] = CONTENT_LAN_23; //caption for recent list - $content_pref['content_list_caption_append_name'] = '1'; //append category heading to caption + $cp['content_list_icon'] = '1'; //show icon + $cp['content_list_subheading'] = '1'; //show subheading + $cp['content_list_summary'] = '1'; //show summary + $cp['content_list_text'] = ''; //show (part of) text + $cp['content_list_date'] = ''; //show date + $cp['content_list_authorname'] = ''; //show authorname + $cp['content_list_authorprofile'] = ''; //show link to author profile + $cp['content_list_authoremail'] = ''; //show authoremail + $cp['content_list_authoricon'] = ''; //show link to author list + $cp['content_list_rating'] = '1'; //show rating system + $cp['content_list_peicon'] = '1'; //show printemailicons + $cp['content_list_parent'] = ''; //show parent cat + $cp['content_list_refer'] = ''; //show refer count + $cp['content_list_subheading_char'] = '100'; //how many subheading characters + $cp['content_list_subheading_post'] = '[...]'; //use a postfix for too long subheadings + $cp['content_list_summary_char'] = '100'; //how many summary characters + $cp['content_list_summary_post'] = '[...]'; //use a postfix for too long summary + $cp['content_list_text_char'] = '60'; //how many text words + $cp['content_list_text_post'] = CONTENT_LAN_16; //use a postfix for too long text + $cp['content_list_text_link'] = '1'; //show link to content item on postfix + $cp['content_list_authoremail_nonmember'] = ''; //show email non member author + $cp['content_list_peicon_all'] = ''; //override printemail icons + $cp['content_list_rating_all'] = ''; //override rating system + $cp['content_list_editicon'] = ''; //show link to admin edit item + $cp['content_list_datestyle'] = '%d %b %Y'; //choose datestyle for given date + $cp['content_list_caption'] = CONTENT_LAN_23; //caption for recent list + $cp['content_list_caption_append_name'] = '1'; //append category heading to caption //CATEGORY PAGES //sections of content category in 'view all categories page' - $content_pref['content_catall_icon'] = "1"; //show icon - $content_pref['content_catall_subheading'] = "1"; //show subheading - $content_pref['content_catall_text'] = "0"; //show text - $content_pref['content_catall_date'] = "0"; //show date - $content_pref['content_catall_rating'] = "1"; //show rating - $content_pref['content_catall_authorname'] = "0"; //show author name - $content_pref['content_catall_authoremail'] = "0"; //show author email - $content_pref['content_catall_authorprofile'] = "0"; //show link to author profile - $content_pref['content_catall_authoricon'] = "0"; //show link to author list - $content_pref['content_catall_peicon'] = "1"; //show pe icons - $content_pref['content_catall_comment'] = "1"; //show amount of comments - $content_pref['content_catall_amount'] = "0"; //show amount of items - $content_pref['content_catall_text_char'] = "65"; //define amount of words of text to display - $content_pref['content_catall_text_post'] = CONTENT_LAN_16; //define postfix is text is too long - $content_pref['content_catall_text_link'] = "1"; //define if link to category should be added on postfix - $content_pref['content_catall_caption'] = CONTENT_LAN_25; //caption for all categories page + $cp['content_catall_icon'] = '1'; //show icon + $cp['content_catall_subheading'] = '1'; //show subheading + $cp['content_catall_text'] = ''; //show text + $cp['content_catall_date'] = ''; //show date + $cp['content_catall_rating'] = '1'; //show rating + $cp['content_catall_authorname'] = ''; //show author name + $cp['content_catall_authoremail'] = ''; //show author email + $cp['content_catall_authorprofile'] = ''; //show link to author profile + $cp['content_catall_authoricon'] = ''; //show link to author list + $cp['content_catall_peicon'] = '1'; //show pe icons + $cp['content_catall_comment'] = '1'; //show amount of comments + $cp['content_catall_amount'] = ''; //show amount of items + $cp['content_catall_text_char'] = '65'; //define amount of words of text to display + $cp['content_catall_text_post'] = CONTENT_LAN_16; //define postfix is text is too long + $cp['content_catall_text_link'] = '1'; //define if link to category should be added on postfix + $cp['content_catall_caption'] = CONTENT_LAN_25; //caption for all categories page //sections of content category in 'view category' page - $content_pref['content_cat_icon'] = "1"; //show icon - $content_pref['content_cat_subheading'] = "1"; //show subheading - $content_pref['content_cat_text'] = "0"; //show text - $content_pref['content_cat_date'] = "0"; //show date - $content_pref['content_cat_authorname'] = "0"; //show author name - $content_pref['content_cat_authoremail'] = "0"; //show author email - $content_pref['content_cat_authorprofile'] = "0"; //show link to author profile - $content_pref['content_cat_authoricon'] = "0"; //show link to author list - $content_pref['content_cat_rating'] = "1"; //show rating - $content_pref['content_cat_peicon'] = "1"; //show pe icons - $content_pref['content_cat_comment'] = "1"; //show amount of comments - $content_pref['content_cat_amount'] = "1"; //show amount of items - $content_pref['content_cat_caption'] = CONTENT_LAN_26; //caption for single category page - $content_pref['content_cat_caption_append_name'] = '1'; //append category heading to caption - $content_pref['content_cat_sub_caption'] = CONTENT_LAN_28; //caption for subcategories - $content_pref['content_cat_item_caption'] = CONTENT_LAN_31; //caption for items in category + $cp['content_cat_icon'] = '1'; //show icon + $cp['content_cat_subheading'] = '1'; //show subheading + $cp['content_cat_text'] = ''; //show text + $cp['content_cat_date'] = ''; //show date + $cp['content_cat_authorname'] = ''; //show author name + $cp['content_cat_authoremail'] = ''; //show author email + $cp['content_cat_authorprofile'] = ''; //show link to author profile + $cp['content_cat_authoricon'] = ''; //show link to author list + $cp['content_cat_rating'] = '1'; //show rating + $cp['content_cat_peicon'] = '1'; //show pe icons + $cp['content_cat_comment'] = '1'; //show amount of comments + $cp['content_cat_amount'] = '1'; //show amount of items + $cp['content_cat_caption'] = CONTENT_LAN_26; //caption for single category page + $cp['content_cat_caption_append_name'] = '1'; //append category heading to caption + $cp['content_cat_sub_caption'] = CONTENT_LAN_28; //caption for subcategories + $cp['content_cat_item_caption'] = CONTENT_LAN_31; //caption for items in category //sections of subcategories in 'view category page' - $content_pref['content_catsub_icon'] = "1"; //show icon - $content_pref['content_catsub_subheading'] = "1"; //show subheading - $content_pref['content_catsub_amount'] = "1"; //show amount of items - $content_pref['content_cat_showparent'] = "1"; //show parent item in category page - $content_pref['content_cat_showparentsub'] = "1"; //show subcategories in category page - $content_pref['content_cat_listtype'] = "0"; //also show items from subategories - $content_pref['content_cat_menuorder'] = "1"; //order of parent and child items - $content_pref['content_cat_rendertype'] = "2"; //render method of the menus - $content_pref['content_cat_text_char'] = "65"; //define amount of words of text to display - $content_pref['content_cat_text_post'] = CONTENT_LAN_16; //define postfix is text is too long - $content_pref['content_cat_text_link'] = "1"; //define if link to category should be added on postfix - $content_pref['content_cat_authoremail_nonmember'] = "0"; //define if the email of a non-member will be displayed - $content_pref['content_cat_peicon_all'] = "0"; //override printemail icons - $content_pref['content_cat_rating_all'] = "0"; //override rating system + $cp['content_catsub_icon'] = '1'; //show icon + $cp['content_catsub_subheading'] = '1'; //show subheading + $cp['content_catsub_amount'] = '1'; //show amount of items + $cp['content_cat_showparent'] = '1'; //show parent item in category page + $cp['content_cat_showparentsub'] = '1'; //show subcategories in category page + $cp['content_cat_listtype'] = ''; //also show items from subategories + $cp['content_cat_menuorder'] = '1'; //order of parent and child items + $cp['content_cat_rendertype'] = '2'; //render method of the menus + $cp['content_cat_text_char'] = '65'; //define amount of words of text to display + $cp['content_cat_text_post'] = CONTENT_LAN_16; //define postfix is text is too long + $cp['content_cat_text_link'] = '1'; //define if link to category should be added on postfix + $cp['content_cat_authoremail_nonmember'] = ''; //define if the email of a non-member will be displayed + $cp['content_cat_peicon_all'] = ''; //override printemail icons + $cp['content_cat_rating_all'] = ''; //override rating system //CONTENT PAGE - $content_pref['content_content_icon'] = "0"; //show icon - $content_pref['content_content_subheading'] = "1"; //show subheading - $content_pref['content_content_summary'] = "1"; //show summary - $content_pref['content_content_date'] = "0"; //show date - $content_pref['content_content_authorname'] = "1"; //show authorname - $content_pref['content_content_authorprofile'] = "0"; //show link to author profile - $content_pref['content_content_authoremail'] = "0"; //show suthoremail - $content_pref['content_content_authoricon'] = "0"; //show link to author list - $content_pref['content_content_parent'] = "0"; //show parent category - $content_pref['content_content_rating'] = "1"; //show rating system - $content_pref['content_content_peicon'] = "1"; //show printemailicons - $content_pref['content_content_refer'] = "0"; //show refer count - $content_pref['content_content_comment'] = "0"; //show amount of comments - $content_pref['content_content_authoremail_nonmember'] = "0"; //show email non member - $content_pref['content_content_peicon_all'] = "0"; //override printemail icons - $content_pref['content_content_rating_all'] = "0"; //override rating system - $content_pref['content_content_comment_all'] = "0"; //override comment system - $content_pref['content_content_editicon'] = "0"; //show link in content page to admin edit item - $content_pref['content_content_customtags'] = "0"; //should additional data be shown - $content_pref['content_content_presettags'] = "0"; //should preset data tags be shown - $content_pref['content_content_attach'] = "0"; //show attachments - $content_pref['content_content_images'] = "0"; //show images - $content_pref['content_content_pagenames_rendertype'] = "0"; //rendertype for articleindex on multipage content items - $content_pref['content_content_multipage_preset'] = "0"; //render custom/preset in multipage item first/last page + $cp['content_content_icon'] = ''; //show icon + $cp['content_content_subheading'] = '1'; //show subheading + $cp['content_content_summary'] = '1'; //show summary + $cp['content_content_date'] = '1'; //show date + $cp['content_content_authorname'] = '1'; //show authorname + $cp['content_content_authorprofile'] = ''; //show link to author profile + $cp['content_content_authoremail'] = ''; //show suthoremail + $cp['content_content_authoricon'] = ''; //show link to author list + $cp['content_content_parent'] = ''; //show parent category + $cp['content_content_rating'] = '1'; //show rating system + $cp['content_content_peicon'] = '1'; //show printemailicons + $cp['content_content_refer'] = ''; //show refer count + $cp['content_content_comment'] = '1'; //show amount of comments + $cp['content_content_authoremail_nonmember'] = ''; //show email non member + $cp['content_content_peicon_all'] = ''; //override printemail icons + $cp['content_content_rating_all'] = ''; //override rating system + $cp['content_content_comment_all'] = ''; //override comment system + $cp['content_content_editicon'] = ''; //show link in content page to admin edit item + $cp['content_content_customtags'] = ''; //should additional data be shown + $cp['content_content_presettags'] = ''; //should preset data tags be shown + $cp['content_content_attach'] = ''; //show attachments + $cp['content_content_images'] = ''; //show images + $cp['content_content_pagenames_rendertype'] = ''; //rendertype for articleindex on multipage content items + $cp['content_content_multipage_preset'] = ''; //render custom/preset in multipage item first/last page + $cp['content_content_pagenames_nextprev_prevhead'] = '< {PAGETITLE}'; //link to next page in multipage item + $cp['content_content_pagenames_nextprev_nexthead'] = '{PAGETITLE} >'; //link to prev page in multipage item //AUTHOR PAGE - $content_pref['content_author_lastitem'] = "0"; //show last item reference - $content_pref['content_author_amount'] = "1"; //show amount of items from this author - $content_pref['content_author_nextprev'] = "1"; //use next prev buttons - $content_pref['content_author_nextprev_number'] = "20"; //amount of items per page - $content_pref['content_author_index_caption'] = CONTENT_LAN_32; //caption for author index page - $content_pref['content_author_caption'] = CONTENT_LAN_32; //caption for single author page - $content_pref['content_author_caption_append_name'] = '1'; //append author name to caption + $cp['content_author_lastitem'] = ''; //show last item reference + $cp['content_author_amount'] = '1'; //show amount of items from this author + $cp['content_author_nextprev'] = '1'; //use next prev buttons + $cp['content_author_nextprev_number'] = '20'; //amount of items per page + $cp['content_author_index_caption'] = CONTENT_LAN_32; //caption for author index page + $cp['content_author_caption'] = CONTENT_LAN_32; //caption for single author page + $cp['content_author_caption_append_name'] = '1'; //append author name to caption //ARCHIVE PAGE - $content_pref['content_archive_nextprev'] = "1"; //archive : choose to show next/prev links - $content_pref['content_archive_nextprev_number'] = "30"; //archive : choose amount to use in next/prev - $content_pref['content_archive_letterindex'] = "0"; //archive : letter index - $content_pref['content_archive_datestyle'] = "%d %b %Y"; //archive : choose datestyle for given date - $content_pref['content_archive_date'] = "1"; //archive : section: show date - $content_pref['content_archive_authorname'] = "0"; //archive : section: show authorname - $content_pref['content_archive_authorprofile'] = "0"; //archive : section: show link to author profile - $content_pref['content_archive_authoricon'] = "0"; //archive : section: show link to author list - $content_pref['content_archive_authoremail'] = "0"; //archive : section: show author email - $content_pref['content_archive_authoremail_nonmember'] = "0"; //archive : show link to email of non-member author - $content_pref['content_archive_caption'] = CONTENT_LAN_84; //caption for archive page + $cp['content_archive_nextprev'] = '1'; //archive : choose to show next/prev links + $cp['content_archive_nextprev_number'] = '30'; //archive : choose amount to use in next/prev + $cp['content_archive_letterindex'] = '1'; //archive : letter index + $cp['content_archive_datestyle'] = '%d %b %Y'; //archive : choose datestyle for given date + $cp['content_archive_date'] = '1'; //archive : section: show date + $cp['content_archive_authorname'] = ''; //archive : section: show authorname + $cp['content_archive_authorprofile'] = ''; //archive : section: show link to author profile + $cp['content_archive_authoricon'] = ''; //archive : section: show link to author list + $cp['content_archive_authoremail'] = ''; //archive : section: show author email + $cp['content_archive_authoremail_nonmember'] = ''; //archive : show link to email of non-member author + $cp['content_archive_caption'] = CONTENT_LAN_84; //caption for archive page //TOP RATED PAGE - $content_pref['content_top_icon'] = "0"; //top : section: show icon - $content_pref['content_top_authorname'] = "0"; //top : section: show authorname - $content_pref['content_top_authorprofile'] = "0"; //top : section: show link to author profile - $content_pref['content_top_authoricon'] = "0"; //top : section: show link to author list - $content_pref['content_top_authoremail'] = "0"; //top : section: show author email - $content_pref['content_top_authoremail_nonmember'] = "0"; //top : show link to email of non-member author - $content_pref['content_top_icon_width'] = ''; //use this size for icon - $content_pref['content_top_caption'] = CONTENT_LAN_38; //caption for top rated page - $content_pref['content_top_caption_append_name'] = '1'; //append category heading to caption + $cp['content_top_icon'] = ''; //top : section: show icon + $cp['content_top_authorname'] = ''; //top : section: show authorname + $cp['content_top_authorprofile'] = ''; //top : section: show link to author profile + $cp['content_top_authoricon'] = ''; //top : section: show link to author list + $cp['content_top_authoremail'] = ''; //top : section: show author email + $cp['content_top_authoremail_nonmember'] = ''; //top : show link to email of non-member author + $cp['content_top_icon_width'] = ''; //use this size for icon + $cp['content_top_caption'] = CONTENT_LAN_38; //caption for top rated page + $cp['content_top_caption_append_name'] = '1'; //append category heading to caption //TOP SCORE PAGE - $content_pref['content_score_icon'] = "0"; //score : section: show icon - $content_pref['content_score_authorname'] = "0"; //score : section: show authorname - $content_pref['content_score_authorprofile'] = "0"; //score : section: show link to author profile - $content_pref['content_score_authoricon'] = "0"; //score : section: show link to author list - $content_pref['content_score_authoremail'] = "0"; //score : section: show author email - $content_pref['content_score_authoremail_nonmember'] = "0"; //score : show link to email of non-member author - $content_pref['content_score_icon_width'] = ''; //use this size for icon - $content_pref['content_score_caption'] = CONTENT_LAN_87; //caption for top score page - $content_pref['content_score_caption_append_name'] = '1'; //append category heading to caption + $cp['content_score_icon'] = ''; //score : section: show icon + $cp['content_score_authorname'] = ''; //score : section: show authorname + $cp['content_score_authorprofile'] = ''; //score : section: show link to author profile + $cp['content_score_authoricon'] = ''; //score : section: show link to author list + $cp['content_score_authoremail'] = ''; //score : section: show author email + $cp['content_score_authoremail_nonmember'] = ''; //score : show link to email of non-member author + $cp['content_score_icon_width'] = ''; //use this size for icon + $cp['content_score_caption'] = CONTENT_LAN_87; //caption for top score page + $cp['content_score_caption_append_name'] = '1'; //append category heading to caption //MENU OPTIONS - $content_pref['content_menu_caption'] = CONTENT_MENU_LAN_0; //caption of menu - $content_pref['content_menu_search'] = "0"; //show search keyword - $content_pref['content_menu_sort'] = "0"; //show sorting methods - $content_pref["content_menu_visibilitycheck"] = '0'; //show menu only on content pages of this top level category? - $content_pref['content_menu_links'] = "1"; //show content links - $content_pref['content_menu_links_dropdown'] = "0"; //rendertype of content links (in dropdown or as normal links) - $content_pref['content_menu_links_icon'] = "0"; //define icon for content links (only with normallinks) - $content_pref['content_menu_links_caption'] = CONTENT_MENU_LAN_4; //define caption for link list (only is normallinks is selected) - $content_pref['content_menu_viewallcat'] = "1"; //menu: view link to all categories - $content_pref['content_menu_viewallauthor'] = "1"; //menu: view link to all authors - $content_pref['content_menu_viewallitems'] = "1"; //menu: view link to all items (archive) - $content_pref['content_menu_viewtoprated'] = "0"; //menu: view link to top rated items - $content_pref['content_menu_viewtopscore'] = "0"; //menu: view link to top score items - $content_pref['content_menu_viewrecent'] = "1"; //menu: view link to recent items - $content_pref['content_menu_viewsubmit'] = "0"; //view link to submit content item (only if it is allowed) - $content_pref['content_menu_viewicon'] = "0"; //choose icon to display for links - $content_pref['content_menu_cat'] = "1"; //view categories - $content_pref['content_menu_cat_main'] = "1"; //show main parent in the category list - $content_pref['content_menu_cat_number'] = "1"; //show number of items in category - $content_pref['content_menu_cat_icon'] = "0"; //choose icon to display for categories - $content_pref['content_menu_cat_icon_default'] = "0"; //choose default icon is no icon present (only if category_icon is selected) - $content_pref['content_menu_cat_caption'] = CONTENT_MENU_LAN_3; //define caption for category list - $content_pref['content_menu_cat_dropdown'] = "0"; //rendertype of categories (in dropdown or as normal links) - $content_pref['content_menu_recent'] = "1"; //view recent list - $content_pref['content_menu_recent_caption'] = CONTENT_MENU_LAN_2; //caption of recent list - $content_pref['content_menu_recent_number'] = "5"; //number of recent items to show - $content_pref['content_menu_recent_date'] = "0"; //show date in recent list - $content_pref['content_menu_recent_datestyle'] = "%d %b %Y"; //choose datestyle for given date - $content_pref['content_menu_recent_author'] = "0"; //show author in recent list - $content_pref['content_menu_recent_subheading'] = "0"; //show subheading in recent list - $content_pref['content_menu_recent_subheading_char'] = "80"; //number of characters of subheading to show - $content_pref['content_menu_recent_subheading_post'] = "[...]"; //postfix for too long subheadings - $content_pref['content_menu_recent_icon'] = "0"; //choose icon to display for recent items - $content_pref['content_menu_recent_icon_width'] = "50"; //specify width of icon (only if content_icon is set) + $cp['content_menu_caption'] = CONTENT_MENU_LAN_0; //caption of menu + $cp['content_menu_search'] = ''; //show search keyword + $cp['content_menu_sort'] = ''; //show sorting methods + $cp['content_menu_visibilitycheck'] = ''; //show menu only on content pages of this top level category? + $cp['content_menu_links'] = '1'; //show content links + $cp['content_menu_links_dropdown'] = ''; //rendertype of content links (in dropdown or as normal links) + $cp['content_menu_links_icon'] = ''; //define icon for content links (only with normallinks) + $cp['content_menu_links_caption'] = CONTENT_MENU_LAN_4; //define caption for link list (only is normallinks is selected) + $cp['content_menu_viewallcat'] = '1'; //menu: view link to all categories + $cp['content_menu_viewallauthor'] = '1'; //menu: view link to all authors + $cp['content_menu_viewallitems'] = '1'; //menu: view link to all items (archive) + $cp['content_menu_viewtoprated'] = ''; //menu: view link to top rated items + $cp['content_menu_viewtopscore'] = ''; //menu: view link to top score items + $cp['content_menu_viewrecent'] = '1'; //menu: view link to recent items + $cp['content_menu_viewsubmit'] = '1'; //view link to submit content item (only if it is allowed) + $cp['content_menu_viewicon'] = ''; //choose icon to display for links + $cp['content_menu_cat'] = '1'; //view categories + $cp['content_menu_cat_main'] = '1'; //show main parent in the category list + $cp['content_menu_cat_number'] = '1'; //show number of items in category + $cp['content_menu_cat_icon'] = ''; //choose icon to display for categories + $cp['content_menu_cat_icon_default'] = ''; //choose default icon is no icon present (only if category_icon is selected) + $cp['content_menu_cat_caption'] = CONTENT_MENU_LAN_3; //define caption for category list + $cp['content_menu_cat_dropdown'] = ''; //rendertype of categories (in dropdown or as normal links) + $cp['content_menu_recent'] = '1'; //view recent list + $cp['content_menu_recent_caption'] = CONTENT_MENU_LAN_2; //caption of recent list + $cp['content_menu_recent_number'] = '5'; //number of recent items to show + $cp['content_menu_recent_date'] = ''; //show date in recent list + $cp['content_menu_recent_datestyle'] = '%d %b %Y'; //choose datestyle for given date + $cp['content_menu_recent_author'] = ''; //show author in recent list + $cp['content_menu_recent_subheading'] = ''; //show subheading in recent list + $cp['content_menu_recent_subheading_char'] = '80'; //number of characters of subheading to show + $cp['content_menu_recent_subheading_post'] = '[...]'; //postfix for too long subheadings + $cp['content_menu_recent_icon'] = ''; //choose icon to display for recent items + $cp['content_menu_recent_icon_width'] = '50'; //specify width of icon (only if content_icon is set) - $content_pref['content_inherit'] = '0'; //inherit options from default preferences + $cp['content_inherit'] = ''; //inherit options from default preferences //CONTENT MANAGER - $content_pref['content_manager_approve'] = '0'; //class for managers who can approve submitted items - $content_pref['content_manager_personal'] = '0'; //class for managers who can manage personal items - $content_pref['content_manager_category'] = '0'; //class for managers who can manage all items in a category + $cp['content_manager_submit'] = '255'; //class for managers who can submit items in a category + $cp['content_manager_approve'] = '255'; //class for managers who can approve submitted items + $cp['content_manager_personal'] = '255'; //class for managers who can manage personal items + $cp['content_manager_category'] = '255'; //class for managers who can manage all items in a category + $cp['content_manager_inherit'] = ''; //inherit options from default (manager) preferences - //PAGE RESTRICTION (NOT YET IN USE) - $content_pref['content_restrict_managecontent'] = '0'; - $content_pref['content_restrict_createcontent'] = '0'; - $content_pref['content_restrict_managecat'] = '0'; - $content_pref['content_restrict_createcat'] = '0'; - $content_pref['content_restrict_order'] = '0'; - $content_pref['content_restrict_options'] = '0'; - $content_pref['content_restrict_adminmanager'] = '0'; - $content_pref['content_restrict_restrict'] = '0'; - $content_pref['content_restrict_recent'] = '0'; - $content_pref['content_restrict_allcat'] = '0'; - $content_pref['content_restrict_onecat'] = '0'; - $content_pref['content_restrict_contentitem'] = '0'; - $content_pref['content_restrict_author'] = '0'; - $content_pref['content_restrict_archive'] = '0'; - $content_pref['content_restrict_toprated'] = '0'; - $content_pref['content_restrict_topscore'] = '0'; - $content_pref['content_restrict_submit'] = '0'; - $content_pref['content_restrict_frontmanager'] = '0'; + //manager : submit options + $cp['content_manager_submit_directpost'] =''; //should submission be direclty posted as an item, or have them validated by admins + $cp['content_manager_submit_subheading'] = ''; //should subheading be available + $cp['content_manager_submit_summary'] = ''; //should summary be available + $cp['content_manager_submit_startdate'] = ''; //should startdate be available + $cp['content_manager_submit_enddate'] = ''; //should enddate be available + $cp['content_manager_submit_icon'] = ''; //should icon be available to add when submitting an item + $cp['content_manager_submit_attach'] = ''; //should file be available to add when submitting an item + $cp['content_manager_submit_images'] = ''; //should image be available to add when submitting an item + $cp['content_manager_submit_comment'] = ''; //should comment be available to add when submitting an item + $cp['content_manager_submit_rating'] = ''; //should rating be available to add when submitting an item + $cp['content_manager_submit_score'] = ''; //should score be available to add when submitting an item + $cp['content_manager_submit_pe'] = ''; //should printemailicons be available to add when submitting an item + $cp['content_manager_submit_visibility'] = ''; //should visibility be available to add when submitting an item + $cp['content_manager_submit_meta'] = ''; //should metatags be available to add when submitting an item + $cp['content_manager_submit_layout'] = ''; //should the option for choosing a layout template be shown + $cp['content_manager_submit_customtags'] = ''; //should options for adding additional data be shown + $cp['content_manager_submit_presettags'] = ''; //should preset data tags be shown + $cp['content_manager_submit_custom_number'] = ''; //how many customtags should be available to add when submitting an item + $cp['content_manager_submit_images_number'] = ''; //how many images should be available to add when submitting an item + $cp['content_manager_submit_files_number'] = ''; //how many files should be available to add when submitting an item + + //manager : manager options + $cp['content_manager_manager_subheading'] = ''; + $cp['content_manager_manager_summary'] = ''; + $cp['content_manager_manager_startdate'] = ''; + $cp['content_manager_manager_enddate'] = ''; + $cp['content_manager_manager_icon'] = ''; + $cp['content_manager_manager_attach'] = ''; + $cp['content_manager_manager_images'] = ''; + $cp['content_manager_manager_comment'] = ''; + $cp['content_manager_manager_rating'] = ''; + $cp['content_manager_manager_score'] = ''; + $cp['content_manager_manager_pe'] = ''; + $cp['content_manager_manager_visibility'] = ''; + $cp['content_manager_manager_meta'] = ''; + $cp['content_manager_manager_layout'] = ''; + $cp['content_manager_manager_customtags'] = ''; + $cp['content_manager_manager_presettags'] = ''; + $cp['content_manager_manager_custom_number'] = ''; + $cp['content_manager_manager_images_number'] = '2'; + $cp['content_manager_manager_files_number'] = '1'; + + foreach($cp as $k => $v){ + if( !empty($v) ){ + $content_pref[$k] = $tp->toDB($v); + } + } return $content_pref; } @@ -377,9 +386,8 @@ class content{ $plugintable = "pcontent"; -//echo "get content pref : ".$id."
"; - - if($id && $id!="0"){ //if $id; use prefs from content table + //if $id; use prefs from content table + if($id && $id!="0"){ $id = intval($id); $num_rows = $sql -> db_Select($plugintable, "content_pref", "content_id='$id' "); $row = $sql -> db_Fetch(); @@ -416,7 +424,7 @@ class content{ } $content_pref = $eArrayStorage->ReadArray($row['content_pref']); - if(e_PAGE == "admin_content_config.php" && isset($qs[0]) && $qs[0] == 'option'){ + if(e_PAGE == "admin_content_config.php" && isset($qs[0]) && ($qs[0] == 'option' || $qs[0] == 'manager') ){ }else{ //check inheritance, if set, get core prefs (default prefs) if(isset($content_pref['content_inherit']) && $content_pref['content_inherit']!=''){ @@ -426,7 +434,8 @@ class content{ } } - }else{ //if not $id; use prefs from default core table + //if not $id; use prefs from default core table + }else{ $num_rows = $sql -> db_Select("core", "*", "e107_name='$plugintable' "); if ($num_rows == 0) { $content_pref = $this -> ContentDefaultPrefs(); @@ -450,9 +459,35 @@ class content{ if($id == "0"){ $num_rows = $sql -> db_Select("core", "*", "e107_name='$plugintable' "); if ($num_rows == 0) { - $sql -> db_Insert("core", "'$plugintable', '' "); - }else{ - $row = $sql -> db_Fetch(); + $content_pref = $this -> ContentDefaultPrefs(); + $tmp = $eArrayStorage->WriteArray($content_pref); + $sql -> db_Insert("core", "'$plugintable', '{$tmp}' "); + $sql -> db_Select("core", "*", "e107_name='$plugintable' "); + } + $row = $sql -> db_Fetch(); + $current = $eArrayStorage->ReadArray($row['e107_value']); + + //if we are updating options + if(isset($qs[0]) && $qs[0] == 'option' ){ + //only retain the manager prefs from the existing set from getting overwritten + foreach($current as $k => $v){ + if( strpos($k, "content_manager_") === 0 ){ + $content_pref[$k] = $tp->toDB($v); + } + } + + //prepare custom tags: use the posted values + $cp = $_POST['content_custom_preset_key']; + + //if we are updating manager + }elseif(isset($qs[0]) && $qs[0] == 'manager'){ + //if this is a top level category we need to retain all existing options + if($currentparent=='0'){ + $content_pref = $current; + } + + //prepare custom tags: use the existing content_pref values + $cp = $content_pref['content_custom_preset_key']; } //prepare custom tags: use the posted value @@ -470,7 +505,7 @@ class content{ if(isset($qs[0]) && $qs[0] == 'option' ){ //only use the manager prefs from the existing set foreach($current as $k => $v){ - if( strpos($k, "content_manager_") === 0 || strpos($k, "content_restrict_") === 0 ){ + if( strpos($k, "content_manager_") === 0 ){ $content_pref[$k] = $tp->toDB($v); } } @@ -479,7 +514,7 @@ class content{ $cp = $_POST['content_custom_preset_key']; //if we are updating manager - }elseif(isset($qs[0]) && ($qs[0] == 'manager' || $qs[0] == 'restrict')){ + }elseif(isset($qs[0]) && $qs[0] == 'manager'){ //if this is a top level category we need to keep all existing options if($currentparent=='0'){ $content_pref = $current; @@ -574,8 +609,6 @@ class content{ return $agc; } - - function getCrumbItem($id, $arr){ //$id : content_parent of item //$arr : array of all categories @@ -778,19 +811,6 @@ class content{ } } - }elseif(e_PAGE == "content_submit.php"){ - //submit page : view categories - if(!e_QUERY){ - $page = CONTENT_PAGETITLE_LAN_0." / ".CONTENT_PAGETITLE_LAN_7; - }else{ - $page = CONTENT_PAGETITLE_LAN_0; - - //submit page : submit item - if($qs[0] == "content" && $qs[1] == "submit" && is_numeric($qs[2]) ){ - $page = " / ".CONTENT_PAGETITLE_LAN_8; - } - } - }elseif(e_PAGE == "content_manager.php"){ //manager page : view categories if(!e_QUERY){ @@ -798,7 +818,7 @@ class content{ }else{ $page = CONTENT_PAGETITLE_LAN_0." / ".CONTENT_PAGETITLE_LAN_9; - //manager page : view items + //manager page : list items if($qs[0] == "content" && is_numeric($qs[1]) ){ $page .= " / ".CONTENT_PAGETITLE_LAN_10; @@ -806,14 +826,25 @@ class content{ }elseif($qs[0] == "content" && $qs[1] == "edit" && is_numeric($qs[2]) ){ $page .= " / ".CONTENT_PAGETITLE_LAN_11; - //manager page : create new item + //manager page : create new item (manager) }elseif($qs[0] == "content" && $qs[1] == "create" && is_numeric($qs[2]) ){ $page .= " / ".CONTENT_PAGETITLE_LAN_12; + + //manager page : create new item (submit) + }elseif($qs[0] == "content" && $qs[1] == "submit" && is_numeric($qs[2]) ){ + $page .= " / ".CONTENT_PAGETITLE_LAN_8; + + //manager page : approve submitted items (list items) + }elseif($qs[0] == "content" && $qs[1] == "approve" && is_numeric($qs[2]) ){ + $page .= " / ".CONTENT_PAGETITLE_LAN_16; + + //manager page : post submitted item (edit item) + }elseif($qs[0] == "content" && $qs[1] == "sa" && is_numeric($qs[2]) ){ + $page .= " / ".CONTENT_PAGETITLE_LAN_17; } } } define("e_PAGETITLE", $page); - } @@ -1092,31 +1123,6 @@ class content{ return $authorinfo; } - - /* - //admin - function popupHelp($text, $image="", $width="320", $title=""){ - //$image : full path to the image you want to show on screen (uses a default doc image) - //$width : the width of the popup (uses a default width of 500) - //$title : the window title of the popup (uses a default title of ...) - //$text : the help text to show into the popup - - global $imode; - - if(!$image || !file_exists($image)){ - $image = e_IMAGE."packs/".$imode."/admin_images/docs_16.png"; - } - if(!$width){ $width = "320"; } - if(!$title){ $title = "content management help area"; } - - $popup = ""; - - return $popup; - } - */ - - - //search by keyword function showOptionsSearch($mode, $searchtypeid=""){ global $plugindir, $plugintable, $qs, $rs; @@ -1141,8 +1147,6 @@ class content{ return $CONTENT_SEARCH_TABLE_KEYWORD; } - - //redirection links in dropdown function showOptionsSelect($mode, $searchtypeid=""){ global $plugindir, $plugintable, $rs, $qs, $content_pref; @@ -1208,8 +1212,8 @@ class content{ if($mode == "page" || ($mode == "menu" && $content_pref["content_menu_viewrecent"])){ $CONTENT_SEARCH_TABLE_SELECT .= $rs -> form_option(CONTENT_LAN_61, 0, $plugindir."content.php?recent.".$mainparent); } - if( ($mode == "page" || ($mode == "menu" && $content_pref["content_menu_viewsubmit"]) && $content_pref["content_submit"] && check_class($content_pref["content_submit_class"]) ) ){ - $CONTENT_SEARCH_TABLE_SELECT .= $rs -> form_option(CONTENT_LAN_75, 0, $plugindir."content_submit.php"); + if($mode == "page" || ($mode == "menu" && $content_pref["content_menu_viewsubmit"])){ + $CONTENT_SEARCH_TABLE_SELECT .= $rs -> form_option(CONTENT_LAN_75, 0, $plugindir."content_manager.php"); } $CONTENT_SEARCH_TABLE_SELECT .= $rs -> form_option(" ", "0", "none"); } @@ -1221,8 +1225,6 @@ class content{ return $CONTENT_SEARCH_TABLE_SELECT; } - - //ordering in dropdown function showOptionsOrder($mode, $ordertypeid=""){ global $plugindir, $rs, $qs; @@ -1274,8 +1276,7 @@ class content{ return $text; } - - + //function to create the php menu file function CreateParentMenu($parentid){ global $plugintable, $plugindir, $tp, $datequery; @@ -1413,8 +1414,8 @@ class content{ $data .= " if(\$content_pref[\"content_menu_viewrecent\"]){\n"; $data .= " \$text .= \$linksicon.\" \".CONTENT_LAN_61.\"
\";\n"; $data .= " }\n"; - $data .= " if( \$content_pref[\"content_menu_viewsubmit\"] && \$content_pref[\"content_submit\"] && check_class(\$content_pref[\"content_submit_class\"]) ){\n"; - $data .= " \$text .= \$linksicon.\" \".CONTENT_LAN_75.\"
\";\n"; + $data .= " if(\$content_pref[\"content_menu_viewsubmit\"]){\n"; + $data .= " \$text .= \$linksicon.\" \".CONTENT_LAN_75.\"
\";\n"; $data .= " }\n"; $data .= " \$text .= \"
\";\n"; $data .= "}\n"; diff --git a/e107_plugins/content/handlers/content_convert_class.php b/e107_plugins/content/handlers/content_convert_class.php index ad13dc1d3..72e483a47 100644 --- a/e107_plugins/content/handlers/content_convert_class.php +++ b/e107_plugins/content/handlers/content_convert_class.php @@ -12,9 +12,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/content/handlers/content_convert_class.php,v $ -| $Revision: 1.1.1.1 $ -| $Date: 2006-12-02 04:34:59 $ -| $Author: mcfly_e107 $ +| $Revision: 1.2 $ +| $Date: 2007-03-13 16:51:05 $ +| $Author: lisa_ $ +---------------------------------------------------------------+ */ @@ -24,10 +24,8 @@ $plugindir = e_PLUGIN."content/"; $plugintable = "pcontent"; //name of the table used in this plugin (never remove this, as it's being used throughout the plugin !!) $datequery = " AND content_datestamp < ".time()." AND (content_enddate=0 || content_enddate>".time().") "; -$lan_file = $plugindir.'languages/'.e_LANGUAGE.'/lan_content.php'; -include_once(file_exists($lan_file) ? $lan_file : $plugindir.'languages/English/lan_content.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'); +include_lan(e_PLUGIN."content/languages/".e_LANGUAGE."/lan_content.php"); +include_lan(e_PLUGIN."content/languages/".e_LANGUAGE."/lan_content_admin.php"); require_once($plugindir."handlers/content_class.php"); $aa = new content; diff --git a/e107_plugins/content/handlers/content_db_class.php b/e107_plugins/content/handlers/content_db_class.php index f43f1a74e..09e8e96df 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.5 $ -| $Date: 2007-01-14 14:18:09 $ +| $Revision: 1.6 $ +| $Date: 2007-03-13 16:51:05 $ | $Author: lisa_ $ +---------------------------------------------------------------+ */ @@ -283,7 +283,9 @@ class contentdb{ if($mode == "create"){ if($type == "submit"){ - $refer = ($content_pref["content_submit_directpost"] ? "" : "sa"); + $refer = ($content_pref["content_manager_submit_directpost"] ? "" : "sa"); + }elseif($type == "contentmanager"){ + $refer = ($content_pref["content_manager_manager_directpost"] ? "" : "sa"); }else{ $refer = ""; } @@ -300,7 +302,7 @@ class contentdb{ }elseif($type == "contentmanager"){ js_location(e_SELF."?c"); }elseif($type == "submit"){ - if($content_pref["content_submit_directpost"]){ + if($content_pref["content_manager_submit_directpost"]){ js_location(e_SELF."?s"); }else{ js_location(e_SELF."?d"); @@ -422,39 +424,6 @@ class contentdb{ } } - - function dbAssignAdmins($mode, $id, $value){ - global $plugintable, $qs, $sql, $eArrayStorage; - - if($mode == "admin"){ - $id = intval($id); - $sql -> db_Select($plugintable, "content_pref", "content_id = '".intval($id)."' "); - $row = $sql -> db_Fetch(); - - //get current preferences - $content_pref = $eArrayStorage->ReadArray($row['content_pref']); - - //assign new preferences - if($value == "clear"){ - $content_pref["content_manager_allowed"] = ""; - }else{ - $content_pref["content_manager_allowed"] = $value; - } - - //create new array of preferences - $tmp = $eArrayStorage->WriteArray($content_pref); - - $sql -> db_Update($plugintable, "content_pref = '{$tmp}' WHERE content_id = '".intval($id)."' "); - - $message = CONTENT_ADMIN_CAT_LAN_34; - return $message; - }else{ - return FALSE; - } - } - - - function dbDelete($mode, $cat, $del_id){ global $plugintable, $sql, $_POST, $e107cache; @@ -476,8 +445,6 @@ class contentdb{ return FALSE; } } - - function dbSetOrder($mode, $type, $order){ global $plugintable, $sql, $aa, $qs, $_POST, $e107cache; diff --git a/e107_plugins/content/handlers/content_defines.php b/e107_plugins/content/handlers/content_defines.php index ce2b7ee4e..66716500a 100644 --- a/e107_plugins/content/handlers/content_defines.php +++ b/e107_plugins/content/handlers/content_defines.php @@ -4,10 +4,8 @@ if (!defined('e107_INIT')) { exit; } global $plugindir, $imode; $plugindir = e_PLUGIN."content/"; $imagedir = e_IMAGE."packs/".$imode."/admin_images/"; -$lan_file = e_PLUGIN.'content/languages/'.e_LANGUAGE.'/lan_content_admin.php'; -include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN.'content/languages/English/lan_content_admin.php'); -$lan_file = e_PLUGIN.'content/languages/'.e_LANGUAGE.'/lan_content.php'; -include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN.'content/languages/English/lan_content.php'); +include_lan(e_PLUGIN."content/languages/".e_LANGUAGE."/lan_content.php"); +include_lan(e_PLUGIN."content/languages/".e_LANGUAGE."/lan_content_admin.php"); if (!defined('CONTENT_ICON_EDIT')) { define("CONTENT_ICON_EDIT", "".CONTENT_ICON_LAN_0.""); } if (!defined('CONTENT_ICON_LINK')) { define("CONTENT_ICON_LINK", "".CONTENT_ICON_LAN_15.""); } diff --git a/e107_plugins/content/handlers/content_form_class.php b/e107_plugins/content/handlers/content_form_class.php index 799746761..3a4a49930 100644 --- a/e107_plugins/content/handlers/content_form_class.php +++ b/e107_plugins/content/handlers/content_form_class.php @@ -12,8 +12,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/content/handlers/content_form_class.php,v $ -| $Revision: 1.8 $ -| $Date: 2007-03-01 09:32:28 $ +| $Revision: 1.9 $ +| $Date: 2007-03-13 16:51:05 $ | $Author: lisa_ $ +---------------------------------------------------------------+ */ @@ -30,14 +30,13 @@ if (!defined('ADMIN_WIDTH')) { define("ADMIN_WIDTH", "width:98%;"); } $stylespacer = "style='border:0; height:20px;'"; -//only used in admin pages, for normal rows (+ in content_submit.php creation form) +//only used in admin pages, for normal rows (+ in content_manager.php creation form) $TOPIC_ROW_NOEXPAND = " {TOPIC_TOPIC} {TOPIC_FIELD} - -"; -//only used in admin pages, for expanding rows (+ in content_submit.php creation form) +"; +//only used in admin pages, for expanding rows (+ in content_manager.php creation form) $TOPIC_ROW = " {TOPIC_TOPIC} @@ -57,166 +56,166 @@ $TOPIC_ROW_SPACER = ""; class contentform{ function ContentItemPreview(){ - global $ns, $sql, $aa, $qs, $tp, $mainparent; + global $ns, $sql, $aa, $qs, $tp, $mainparent; - $TRPRE = ""; - $TRPOST = ""; - $TDPRE1 = ""; - $TDPRE2 = ""; - $TDPOST = ""; - $CONTENT_CONTENT_PREVIEW = " - - {CONTENT_CONTENT_PREVIEW_CATEGORY} - {CONTENT_CONTENT_PREVIEW_HEADING} - {CONTENT_CONTENT_PREVIEW_SUBHEADING} - {CONTENT_CONTENT_PREVIEW_SUMMARY} - {CONTENT_CONTENT_PREVIEW_TEXT} - {CONTENT_CONTENT_PREVIEW_AUTHORNAME} - {CONTENT_CONTENT_PREVIEW_AUTHOREMAIL} - {CONTENT_CONTENT_PREVIEW_STARTDATE} - {CONTENT_CONTENT_PREVIEW_ENDDATE} - {CONTENT_CONTENT_PREVIEW_COMMENT} - {CONTENT_CONTENT_PREVIEW_RATE} - {CONTENT_CONTENT_PREVIEW_PE} - {CONTENT_CONTENT_PREVIEW_CLASS} - {CONTENT_CONTENT_PREVIEW_SCORE} - {CONTENT_CONTENT_PREVIEW_META} - {CONTENT_CONTENT_PREVIEW_LAYOUT} - {CONTENT_CONTENT_PREVIEW_CUSTOM} + $TRPRE = ""; + $TRPOST = ""; + $TDPRE1 = ""; + $CONTENT_CONTENT_PREVIEW = " +
"; + $TDPRE2 = ""; + $TDPOST = "
+ {CONTENT_CONTENT_PREVIEW_CATEGORY} + {CONTENT_CONTENT_PREVIEW_HEADING} + {CONTENT_CONTENT_PREVIEW_SUBHEADING} + {CONTENT_CONTENT_PREVIEW_SUMMARY} + {CONTENT_CONTENT_PREVIEW_TEXT} + {CONTENT_CONTENT_PREVIEW_AUTHORNAME} + {CONTENT_CONTENT_PREVIEW_AUTHOREMAIL} + {CONTENT_CONTENT_PREVIEW_STARTDATE} + {CONTENT_CONTENT_PREVIEW_ENDDATE} + {CONTENT_CONTENT_PREVIEW_COMMENT} + {CONTENT_CONTENT_PREVIEW_RATE} + {CONTENT_CONTENT_PREVIEW_PE} + {CONTENT_CONTENT_PREVIEW_CLASS} + {CONTENT_CONTENT_PREVIEW_SCORE} + {CONTENT_CONTENT_PREVIEW_META} + {CONTENT_CONTENT_PREVIEW_LAYOUT} + {CONTENT_CONTENT_PREVIEW_CUSTOM} - {CONTENT_CONTENT_PREVIEW_PARENT} - {CONTENT_CONTENT_PREVIEW_ICON} - {CONTENT_CONTENT_PREVIEW_ATTACH} - {CONTENT_CONTENT_PREVIEW_IMAGES} - {CONTENT_CONTENT_PREVIEW_PAGENAMES} -
\n"; + {CONTENT_CONTENT_PREVIEW_PARENT} + {CONTENT_CONTENT_PREVIEW_ICON} + {CONTENT_CONTENT_PREVIEW_ATTACH} + {CONTENT_CONTENT_PREVIEW_IMAGES} + {CONTENT_CONTENT_PREVIEW_PAGENAMES} + \n"; - $tmp = explode(".",$_POST['parent1']); - $_POST['parent1'] = $tmp[1]; - $mainparent = $aa -> getMainParent( $_POST['parent1'] ); - $content_pref = $aa -> getContentPref($mainparent); - $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_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_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"]); + $tmp = explode(".",$_POST['parent1']); + $_POST['parent1'] = $tmp[1]; + $mainparent = $aa -> getMainParent( $_POST['parent1'] ); + $content_pref = $aa -> getContentPref($mainparent); + $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_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_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($sql -> db_Select("pcontent", "content_heading", " content_id='".$_POST['parent1']."' ")){ - $row = $sql -> db_Fetch(); - $PARENT = $row['content_heading']; - } - $content_heading = $tp -> post_toHTML($_POST['content_heading']); - $content_subheading = $tp -> post_toHTML($_POST['content_subheading']); - $content_summary = $tp -> post_toHTML($_POST['content_summary']); - $content_text = $_POST['content_text']; - if(e_WYSIWYG){ - $content_text = $tp->createConstants($content_text); // convert e107_images/ to {e_IMAGE} etc. - } + if($sql -> db_Select("pcontent", "content_heading", " content_id='".$_POST['parent1']."' ")){ + $row = $sql -> db_Fetch(); + $PARENT = $row['content_heading']; + } + $content_heading = $tp -> post_toHTML($_POST['content_heading']); + $content_subheading = $tp -> post_toHTML($_POST['content_subheading']); + $content_summary = $tp -> post_toHTML($_POST['content_summary']); + $content_text = $_POST['content_text']; + if(e_WYSIWYG){ + $content_text = $tp->createConstants($content_text); // convert e107_images/ to {e_IMAGE} etc. + } - //the problem with tiny_mce is it's storing e_HTTP with an image path, while it should only use the {e_xxx} variables - //this small check resolves this, and stores the paths correctly - if(strstr($content_text,e_HTTP."{e_")){ - $content_text = str_replace(e_HTTP."{e_", "{e_", $content_text); - } - $content_text = $tp->post_toHTML($content_text,TRUE); + //the problem with tiny_mce is it's storing e_HTTP with an image path, while it should only use the {e_xxx} variables + //this small check resolves this, and stores the paths correctly + if(strstr($content_text,e_HTTP."{e_")){ + $content_text = str_replace(e_HTTP."{e_", "{e_", $content_text); + } + $content_text = $tp->post_toHTML($content_text,TRUE); - $CONTENT_CONTENT_PREVIEW_CATEGORY = ($_POST['parent1'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_57.$TDPOST.$TDPRE2.$PARENT.$TDPOST.$TRPOST : ""); - $CONTENT_CONTENT_PREVIEW_HEADING = ($content_heading ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_11.$TDPOST.$TDPRE2.$content_heading.$TDPOST.$TRPOST : ""); - $CONTENT_CONTENT_PREVIEW_SUBHEADING = ($content_subheading ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_16.$TDPOST.$TDPRE2.$content_subheading.$TDPOST.$TRPOST : ""); - $CONTENT_CONTENT_PREVIEW_SUMMARY = ($content_summary ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_17.$TDPOST.$TDPRE2.$content_summary.$TDPOST.$TRPOST : ""); - $CONTENT_CONTENT_PREVIEW_TEXT = ($content_text ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_18.$TDPOST.$TDPRE2.$content_text.$TDPOST.$TRPOST : ""); - $CONTENT_CONTENT_PREVIEW_AUTHORNAME = ($_POST['content_author_name'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_10." ".CONTENT_ADMIN_ITEM_LAN_14.$TDPOST.$TDPRE2.$_POST['content_author_name'].$TDPOST.$TRPOST : ""); - $CONTENT_CONTENT_PREVIEW_AUTHOREMAIL = ($_POST['content_author_email'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_10." ".CONTENT_ADMIN_ITEM_LAN_15.$TDPOST.$TDPRE2.$_POST['content_author_email'].$TDPOST.$TRPOST : ""); - $CONTENT_CONTENT_PREVIEW_COMMENT = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_36.$TDPOST.$TDPRE2.($_POST['content_comment'] ? CONTENT_ADMIN_ITEM_LAN_85 : CONTENT_ADMIN_ITEM_LAN_86).$TDPOST.$TRPOST; - $CONTENT_CONTENT_PREVIEW_RATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_37.$TDPOST.$TDPRE2.($_POST['content_rate'] ? CONTENT_ADMIN_ITEM_LAN_85 : CONTENT_ADMIN_ITEM_LAN_86).$TDPOST.$TRPOST; - $CONTENT_CONTENT_PREVIEW_PE = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_38.$TDPOST.$TDPRE2.($_POST['content_pe'] ? CONTENT_ADMIN_ITEM_LAN_85 : CONTENT_ADMIN_ITEM_LAN_86).$TDPOST.$TRPOST; - $CONTENT_CONTENT_PREVIEW_CLASS = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_39.$TDPOST.$TDPRE2.r_userclass_name($_POST['content_class']).$TDPOST.$TRPOST; - $CONTENT_CONTENT_PREVIEW_SCORE = ($_POST['content_score'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_40.$TDPOST.$TDPRE2.($_POST['content_score']!="none" ? $_POST['content_score']."/100" : CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_40." ".CONTENT_ADMIN_ITEM_LAN_119).$TDPOST.$TRPOST : ""); - $CONTENT_CONTENT_PREVIEW_META = ($_POST['content_meta'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_53.$TDPOST.$TDPRE2.($_POST['content_meta']!="" ? $_POST['content_meta'] : CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_53." ".CONTENT_ADMIN_ITEM_LAN_119).$TDPOST.$TRPOST : ""); - $CONTENT_CONTENT_PREVIEW_LAYOUT = ($_POST['content_layout'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_92.$TDPOST.$TDPRE2.($_POST['content_layout'] == "none" || $_POST['content_layout'] =="content_content_template.php" ? CONTENT_ADMIN_ITEM_LAN_120 : substr($_POST['content_layout'],25 ,-4)).$TDPOST.$TRPOST : ""); + $CONTENT_CONTENT_PREVIEW_CATEGORY = ($_POST['parent1'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_57.$TDPOST.$TDPRE2.$PARENT.$TDPOST.$TRPOST : ""); + $CONTENT_CONTENT_PREVIEW_HEADING = ($content_heading ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_11.$TDPOST.$TDPRE2.$content_heading.$TDPOST.$TRPOST : ""); + $CONTENT_CONTENT_PREVIEW_SUBHEADING = ($content_subheading ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_16.$TDPOST.$TDPRE2.$content_subheading.$TDPOST.$TRPOST : ""); + $CONTENT_CONTENT_PREVIEW_SUMMARY = ($content_summary ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_17.$TDPOST.$TDPRE2.$content_summary.$TDPOST.$TRPOST : ""); + $CONTENT_CONTENT_PREVIEW_TEXT = ($content_text ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_18.$TDPOST.$TDPRE2.$content_text.$TDPOST.$TRPOST : ""); + $CONTENT_CONTENT_PREVIEW_AUTHORNAME = ($_POST['content_author_name'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_10." ".CONTENT_ADMIN_ITEM_LAN_14.$TDPOST.$TDPRE2.$_POST['content_author_name'].$TDPOST.$TRPOST : ""); + $CONTENT_CONTENT_PREVIEW_AUTHOREMAIL = ($_POST['content_author_email'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_10." ".CONTENT_ADMIN_ITEM_LAN_15.$TDPOST.$TDPRE2.$_POST['content_author_email'].$TDPOST.$TRPOST : ""); + $CONTENT_CONTENT_PREVIEW_COMMENT = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_36.$TDPOST.$TDPRE2.($_POST['content_comment'] ? CONTENT_ADMIN_ITEM_LAN_85 : CONTENT_ADMIN_ITEM_LAN_86).$TDPOST.$TRPOST; + $CONTENT_CONTENT_PREVIEW_RATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_37.$TDPOST.$TDPRE2.($_POST['content_rate'] ? CONTENT_ADMIN_ITEM_LAN_85 : CONTENT_ADMIN_ITEM_LAN_86).$TDPOST.$TRPOST; + $CONTENT_CONTENT_PREVIEW_PE = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_38.$TDPOST.$TDPRE2.($_POST['content_pe'] ? CONTENT_ADMIN_ITEM_LAN_85 : CONTENT_ADMIN_ITEM_LAN_86).$TDPOST.$TRPOST; + $CONTENT_CONTENT_PREVIEW_CLASS = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_39.$TDPOST.$TDPRE2.r_userclass_name($_POST['content_class']).$TDPOST.$TRPOST; + $CONTENT_CONTENT_PREVIEW_SCORE = ($_POST['content_score'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_40.$TDPOST.$TDPRE2.($_POST['content_score']!="none" ? $_POST['content_score']."/100" : CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_40." ".CONTENT_ADMIN_ITEM_LAN_119).$TDPOST.$TRPOST : ""); + $CONTENT_CONTENT_PREVIEW_META = ($_POST['content_meta'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_53.$TDPOST.$TDPRE2.($_POST['content_meta']!="" ? $_POST['content_meta'] : CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_53." ".CONTENT_ADMIN_ITEM_LAN_119).$TDPOST.$TRPOST : ""); + $CONTENT_CONTENT_PREVIEW_LAYOUT = ($_POST['content_layout'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_92.$TDPOST.$TDPRE2.($_POST['content_layout'] == "none" || $_POST['content_layout'] =="content_content_template.php" ? CONTENT_ADMIN_ITEM_LAN_120 : substr($_POST['content_layout'],25 ,-4)).$TDPOST.$TRPOST : ""); - //start date - if($_POST['ne_day'] != "none" && $_POST['ne_month'] != "none" && $_POST['ne_year'] != "none"){ - $CONTENT_CONTENT_PREVIEW_STARTDATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_DATE_LAN_15.$TDPOST.$TDPRE2.$_POST['ne_day']." ".$months[($_POST['ne_month']-1)]." ".$_POST['ne_year'].$TDPOST.$TRPOST; - }else{ - $CONTENT_CONTENT_PREVIEW_STARTDATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_DATE_LAN_15.$TDPOST.$TDPRE2.strftime("%d %b %Y", time()).$TDPOST.$TRPOST; - } - //end date - if($_POST['end_day'] != "none" && $_POST['end_month'] != "none" && $_POST['end_year'] != "none"){ - $CONTENT_CONTENT_PREVIEW_ENDDATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_DATE_LAN_16.$TDPOST.$TDPRE2.$_POST['end_day']." ".$months[($_POST['end_month']-1)]." ".$_POST['end_year'].$TDPOST.$TRPOST; - }else{ - $CONTENT_CONTENT_PREVIEW_ENDDATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_DATE_LAN_16.$TDPOST.$TDPRE2.CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_DATE_LAN_16." ".CONTENT_ADMIN_ITEM_LAN_119.$TDPOST.$TRPOST; - } - $CONTENT_CONTENT_PREVIEW_CUSTOM = ""; - - //custom tags - for($i=0;$i<$content_pref["content_admin_custom_number"];$i++){ - if($_POST["content_custom_key_{$i}"] != "" && $_POST["content_custom_value_{$i}"] != ""){ - $CONTENT_CONTENT_PREVIEW_CUSTOM .= $TRPRE.$TDPRE1.$_POST["content_custom_key_{$i}"].$TDPOST.$TDPRE2.$_POST["content_custom_value_{$i}"].$TDPOST.$TRPOST; - } - } - //custom preset tags - foreach($_POST['content_custom_preset_key'] as $k => $v){ - if($k != "" && $v != ""){ - $CONTENT_CONTENT_PREVIEW_CUSTOM .= $TRPRE.$TDPRE1.$k.$TDPOST.$TDPRE2.$v.$TDPOST.$TRPOST; - } - } - - //icon - if($_POST['content_icon'] && file_exists($content_tmppath_icon.$_POST['content_icon'])){ - $ICON = ""; - }elseif($_POST['content_icon'] && file_exists($content_icon_path.$_POST['content_icon'])){ - $ICON = ""; - }else{ - $ICON = CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_114." ".CONTENT_ADMIN_ITEM_LAN_119; - } - $CONTENT_CONTENT_PREVIEW_ICON = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_114.$TDPOST.$TDPRE2.$ICON.$TDPOST.$TRPOST; + //start date + if($_POST['ne_day'] != "none" && $_POST['ne_month'] != "none" && $_POST['ne_year'] != "none"){ + $CONTENT_CONTENT_PREVIEW_STARTDATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_DATE_LAN_15.$TDPOST.$TDPRE2.$_POST['ne_day']." ".$months[($_POST['ne_month']-1)]." ".$_POST['ne_year'].$TDPOST.$TRPOST; + }else{ + $CONTENT_CONTENT_PREVIEW_STARTDATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_DATE_LAN_15.$TDPOST.$TDPRE2.strftime("%d %b %Y", time()).$TDPOST.$TRPOST; + } + //end date + if($_POST['end_day'] != "none" && $_POST['end_month'] != "none" && $_POST['end_year'] != "none"){ + $CONTENT_CONTENT_PREVIEW_ENDDATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_DATE_LAN_16.$TDPOST.$TDPRE2.$_POST['end_day']." ".$months[($_POST['end_month']-1)]." ".$_POST['end_year'].$TDPOST.$TRPOST; + }else{ + $CONTENT_CONTENT_PREVIEW_ENDDATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_DATE_LAN_16.$TDPOST.$TDPRE2.CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_DATE_LAN_16." ".CONTENT_ADMIN_ITEM_LAN_119.$TDPOST.$TRPOST; + } + $CONTENT_CONTENT_PREVIEW_CUSTOM = ""; + + //custom tags + for($i=0;$i<$content_pref["content_admin_custom_number"];$i++){ + if($_POST["content_custom_key_{$i}"] != "" && $_POST["content_custom_value_{$i}"] != ""){ + $CONTENT_CONTENT_PREVIEW_CUSTOM .= $TRPRE.$TDPRE1.$_POST["content_custom_key_{$i}"].$TDPOST.$TDPRE2.$_POST["content_custom_value_{$i}"].$TDPOST.$TRPOST; + } + } + //custom preset tags + foreach($_POST['content_custom_preset_key'] as $k => $v){ + if($k != "" && $v != ""){ + $CONTENT_CONTENT_PREVIEW_CUSTOM .= $TRPRE.$TDPRE1.$k.$TDPOST.$TDPRE2.$v.$TDPOST.$TRPOST; + } + } + + //icon + if($_POST['content_icon'] && file_exists($content_tmppath_icon.$_POST['content_icon'])){ + $ICON = ""; + }elseif($_POST['content_icon'] && file_exists($content_icon_path.$_POST['content_icon'])){ + $ICON = ""; + }else{ + $ICON = CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_114." ".CONTENT_ADMIN_ITEM_LAN_119; + } + $CONTENT_CONTENT_PREVIEW_ICON = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_114.$TDPOST.$TDPRE2.$ICON.$TDPOST.$TRPOST; - //images and attachments - $file = FALSE; - $image = FALSE; - $ATTACH = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_24.$TDPOST.$TDPRE2; - $IMAGES = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_31.$TDPOST.$TDPRE2; - foreach($_POST as $k => $v){ - if(strpos($k, "content_files") === 0){ - if($v && file_exists($content_tmppath_file.$v)){ - $ATTACH .= CONTENT_ICON_FILE." ".$v."
"; - $file = TRUE; - }elseif($v && file_exists($content_file_path.$v)){ - $ATTACH .= CONTENT_ICON_FILE." ".$v."
"; - $file = TRUE; - } - } - if(strpos($k, "content_images") === 0){ - if($v && file_exists($content_tmppath_image.$v)){ - $IMAGES .= " "; - $image = TRUE; - }elseif($v && file_exists($content_image_path.$v)){ - $IMAGES .= " "; - $image = TRUE; - } + //images and attachments + $file = FALSE; + $image = FALSE; + $ATTACH = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_24.$TDPOST.$TDPRE2; + $IMAGES = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_31.$TDPOST.$TDPRE2; + foreach($_POST as $k => $v){ + if(strpos($k, "content_files") === 0){ + if($v && file_exists($content_tmppath_file.$v)){ + $ATTACH .= CONTENT_ICON_FILE." ".$v."
"; + $file = TRUE; + }elseif($v && file_exists($content_file_path.$v)){ + $ATTACH .= CONTENT_ICON_FILE." ".$v."
"; + $file = TRUE; } } - if($file !== TRUE){ - $ATTACH .= CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_24." ".CONTENT_ADMIN_ITEM_LAN_119; + if(strpos($k, "content_images") === 0){ + if($v && file_exists($content_tmppath_image.$v)){ + $IMAGES .= " "; + $image = TRUE; + }elseif($v && file_exists($content_image_path.$v)){ + $IMAGES .= " "; + $image = TRUE; + } } - if($image !== TRUE){ - $IMAGES .= CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_31." ".CONTENT_ADMIN_ITEM_LAN_119; - } - $CONTENT_CONTENT_PREVIEW_ATTACH = $ATTACH.$TDPOST.$TRPOST; - $CONTENT_CONTENT_PREVIEW_IMAGES = $IMAGES.$TDPOST.$TRPOST; + } + if($file !== TRUE){ + $ATTACH .= CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_24." ".CONTENT_ADMIN_ITEM_LAN_119; + } + if($image !== TRUE){ + $IMAGES .= CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_31." ".CONTENT_ADMIN_ITEM_LAN_119; + } + $CONTENT_CONTENT_PREVIEW_ATTACH = $ATTACH.$TDPOST.$TRPOST; + $CONTENT_CONTENT_PREVIEW_IMAGES = $IMAGES.$TDPOST.$TRPOST; - $caption = CONTENT_ADMIN_ITEM_LAN_46." ".$_POST['content_heading']; - $preview = preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_CONTENT_PREVIEW); - $ns -> tablerender($caption, $preview); + $caption = CONTENT_ADMIN_ITEM_LAN_46." ".$_POST['content_heading']; + $preview = preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_CONTENT_PREVIEW); + $ns -> tablerender($caption, $preview); } function show_create_content($mode, $userid="", $username=""){ @@ -224,57 +223,150 @@ class contentform{ $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]) ){ - //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; - } + //admin + if(e_PAGE=='admin_content_config.php'){ - /* - 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} - "; + //first show the 'choose category' option selectbox (as preferences need to be loaded from the selected category) + if( $qs[1] == "create" && !isset($qs[2]) ){ + 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_ROW = " - - {TOPIC_TOPIC} - - {TOPIC_HEADING} -
-
{TOPIC_HELP}

- {TOPIC_FIELD} -
- - "; + //we need to retrieve preferences from the top level category from this item/category as well + $mainparent = $aa -> getMainParent( (isset($qs[3]) && is_numeric($qs[3]) ? $qs[3] : intval($qs[2])) ); + $content_pref = $aa -> getContentPref($mainparent); + + //top level category chosen, so continue to display create form - $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(e_PAGE=='content_manager.php'){ + + //##### submit (content.submit.X) (X = category id) + if(isset($qs[0]) && $qs[0]=='content' && isset($qs[1]) && $qs[1]=='submit' && isset($qs[2]) && is_numeric($qs[2])){ + + //we need to retrieve preferences from this category, and check if user is allowed here + $manager_pref = $aa -> getContentPref( intval($qs[2]) ); + + //if inherit is used in the manager, we need to get the preferences from the core plugin table default preferences + //and use those preferences in the permissions check. + if(isset($manager_pref['content_manager_inherit']) && $manager_pref['content_manager_inherit']){ + $sql -> db_Select("core", "*", "e107_name='$plugintable' "); + $row = $sql -> db_Fetch(); + $manager_pref = $eArrayStorage->ReadArray($row['e107_value']); + } + + //user is allowed + if( isset($manager_pref["content_manager_submit"]) && check_class($manager_pref["content_manager_submit"]) ){ + //user is not allowed + }else{ + header("location: ".e_SELF); exit; + } + } + + //##### manager create (content.create.X) + if(isset($qs[0]) && $qs[0]=='content' && isset($qs[1]) && $qs[1]=='create' && isset($qs[2]) && is_numeric($qs[2])){ + + //we need to retrieve preferences from this category, and check if user is allowed here + $manager_pref = $aa -> getContentPref( intval($qs[2]) ); + + //if inherit is used in the manager, we need to get the preferences from the core plugin table default preferences + //and use those preferences in the permissions check. + if(isset($manager_pref['content_manager_inherit']) && $manager_pref['content_manager_inherit']){ + $sql -> db_Select("core", "*", "e107_name='$plugintable' "); + $row = $sql -> db_Fetch(); + $manager_pref = $eArrayStorage->ReadArray($row['e107_value']); + } + + //user is allowed + if( (isset($manager_pref["content_manager_personal"]) && check_class($manager_pref["content_manager_personal"])) || + (isset($manager_pref["content_manager_category"]) && check_class($manager_pref["content_manager_category"])) ){ + //user is not allowed + }else{ + header("location: ".e_SELF); exit; + } + } + + //##### manager edit (content.edit.X) + if(isset($qs[0]) && $qs[0]=='content' && isset($qs[1]) && ($qs[1]=='edit' || $qs[1]=='sa') && isset($qs[2]) && is_numeric($qs[2])){ + + //we need to get the category (parent) of the content item first + if(!$sql -> db_Select($plugintable, "content_id, content_parent", "content_id='".intval($qs[2])."' ")){ + //not a valid item, so redirect + //header("location: ".e_SELF); exit; + }else{ + $row = $sql -> db_Fetch(); + //parent can be '0' (top level) or '0.X (subcategory) + if(strpos($row['content_parent'], ".")){ + $ipar = substr($row['content_parent'],2); + }else{ + $ipar = $row['content_parent']; + } + } + + //we need to retrieve preferences from the category this item belongs to, and check if user is allowed here + if(!isset($ipar) && !is_numeric($ipar)){ + //not a valid category, so redirect + //header("location: ".e_SELF); exit; + }else{ + $manager_pref = $aa -> getContentPref( intval($ipar) ); + + //if inherit is used in the manager, we need to get the preferences from the core plugin table default preferences + //and use those preferences in the permissions check. + if(isset($manager_pref['content_manager_inherit']) && $manager_pref['content_manager_inherit']){ + $sql -> db_Select("core", "*", "e107_name='$plugintable' "); + $row = $sql -> db_Fetch(); + $manager_pref = $eArrayStorage->ReadArray($row['e107_value']); + } + + } + + if($qs[1]=='edit'){ + //user is allowed + if( (isset($manager_pref["content_manager_personal"]) && check_class($manager_pref["content_manager_personal"])) || + (isset($manager_pref["content_manager_category"]) && check_class($manager_pref["content_manager_category"])) ){ + + //assign author query to make sure this item to edit is from this user + $userquery = ''; + //if personal manager, we need to assign the author query + if( isset($manager_pref["content_manager_personal"]) && check_class($manager_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."' ) "; + } + } + //if category manager, no author query is needed + if( isset($manager_pref["content_manager_category"]) && check_class($manager_pref["content_manager_category"]) ){ + $userquery = ""; + } + + //user is not allowed + }else{ + header("location: ".e_SELF); exit; + } + }elseif($qs[1]=='sa'){ + //user is allowed + if( (isset($manager_pref["content_manager_approve"]) && check_class($manager_pref["content_manager_approve"])) ){ + + //user is not allowed + }else{ + header("location: ".e_SELF); exit; + } + } + } + + //we need to retrieve preferences from the top level category from this item/category as well + $mainparent = $aa -> getMainParent( intval($qs[2]) ); + $content_pref = $aa -> getContentPref($mainparent); + } + } - $content_pref = $aa -> getContentPref($mainparent); - + //general variables (from the top level category preferences) $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/"); @@ -287,139 +379,95 @@ class contentform{ $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{ - $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; - } - } - - }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. + $checksubheading = (isset($manager_pref["content_manager_submit_subheading"]) ? $manager_pref["content_manager_submit_subheading"] : ""); + $checksummary = (isset($manager_pref["content_manager_submit_summary"]) ? $manager_pref["content_manager_submit_summary"] : ""); + $checkstartdate = (isset($manager_pref["content_manager_submit_startdate"]) ? $manager_pref["content_manager_submit_startdate"] : ""); + $checkenddate = (isset($manager_pref["content_manager_submit_enddate"]) ? $manager_pref["content_manager_submit_enddate"] : ""); + $checkicon = (isset($manager_pref["content_manager_submit_icon"]) ? $manager_pref["content_manager_submit_icon"] : ""); + $checkattach = (isset($manager_pref["content_manager_submit_attach"]) ? $manager_pref["content_manager_submit_attach"] : ""); + $checkattachnumber = (isset($manager_pref["content_manager_submit_files_number"]) ? $manager_pref["content_manager_submit_files_number"] : ""); + $checkimages = (isset($manager_pref["content_manager_submit_images"]) ? $manager_pref["content_manager_submit_images"] : ""); + $checkimagesnumber = (isset($manager_pref["content_manager_submit_images_number"]) ? $manager_pref["content_manager_submit_images_number"] : ""); + $checkcomment = (isset($manager_pref["content_manager_submit_comment"]) ? $manager_pref["content_manager_submit_comment"] : ""); + $checkrating = (isset($manager_pref["content_manager_submit_rating"]) ? $manager_pref["content_manager_submit_rating"] : ""); + $checkscore = (isset($manager_pref["content_manager_submit_score"]) ? $manager_pref["content_manager_submit_score"] : ""); + $checkpe = (isset($manager_pref["content_manager_submit_pe"]) ? $manager_pref["content_manager_submit_pe"] : ""); + $checkvisibility = (isset($manager_pref["content_manager_submit_visibility"]) ? $manager_pref["content_manager_submit_visibility"] : ""); + $checkmeta = (isset($manager_pref["content_manager_submit_meta"]) ? $manager_pref["content_manager_submit_meta"] : ""); + $checkcustom = (isset($manager_pref["content_manager_submit_customtags"]) ? $manager_pref["content_manager_submit_customtags"] : ""); + $checkcustomnumber = (isset($manager_pref["content_manager_submit_custom_number"]) ? $manager_pref["content_manager_submit_custom_number"] : ""); + $checklayout = (isset($manager_pref["content_manager_submit_layout"]) ? $manager_pref["content_manager_submit_layout"] : ""); + $checkpreset = (isset($manager_pref["content_manager_submit_presettags"]) ? $manager_pref["content_manager_submit_presettags"] : ""); + + //get preferences for managers page + }elseif($mode=='contentmanager'){ + $checksubheading = (isset($manager_pref["content_manager_manager_subheading"]) ? $manager_pref["content_manager_manager_subheading"] : ""); + $checksummary = (isset($manager_pref["content_manager_manager_summary"]) ? $manager_pref["content_manager_manager_summary"] : ""); + $checkstartdate = (isset($manager_pref["content_manager_manager_startdate"]) ? $manager_pref["content_manager_manager_startdate"] : ""); + $checkenddate = (isset($manager_pref["content_manager_manager_enddate"]) ? $manager_pref["content_manager_manager_enddate"] : ""); + $checkicon = (isset($manager_pref["content_manager_manager_icon"]) ? $manager_pref["content_manager_manager_icon"] : ""); + $checkattach = (isset($manager_pref["content_manager_manager_attach"]) ? $manager_pref["content_manager_manager_attach"] : ""); + $checkattachnumber = (isset($manager_pref["content_manager_manager_files_number"]) ? $manager_pref["content_manager_manager_files_number"] : ""); + $checkimages = (isset($manager_pref["content_manager_manager_images"]) ? $manager_pref["content_manager_manager_images"] : ""); + $checkimagesnumber = (isset($manager_pref["content_manager_manager_images_number"]) ? $manager_pref["content_manager_manager_images_number"] : ""); + $checkcomment = (isset($manager_pref["content_manager_manager_comment"]) ? $manager_pref["content_manager_manager_comment"] : ""); + $checkrating = (isset($manager_pref["content_manager_manager_rating"]) ? $manager_pref["content_manager_manager_rating"] : ""); + $checkscore = (isset($manager_pref["content_manager_manager_score"]) ? $manager_pref["content_manager_manager_score"] : ""); + $checkpe = (isset($manager_pref["content_manager_manager_pe"]) ? $manager_pref["content_manager_manager_pe"] : ""); + $checkvisibility = (isset($manager_pref["content_manager_manager_visibility"]) ? $manager_pref["content_manager_manager_visibility"] : ""); + $checkmeta = (isset($manager_pref["content_manager_manager_meta"]) ? $manager_pref["content_manager_manager_meta"] : ""); + $checkcustom = (isset($manager_pref["content_manager_manager_customtags"]) ? $manager_pref["content_manager_manager_customtags"] : ""); + $checkcustomnumber = (isset($manager_pref["content_manager_manager_custom_number"]) ? $manager_pref["content_manager_manager_custom_number"] : ""); + $checklayout = (isset($manager_pref["content_manager_manager_layout"]) ? $manager_pref["content_manager_manager_layout"] : ""); + $checkpreset = (isset($manager_pref["content_manager_manager_presettags"]) ? $manager_pref["content_manager_manager_presettags"] : ""); + + //get preferences for admin area; posted submitted item. (approve submitted) }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"] : "")); + //show all preferences from the manager-submit options. + //if manager-submit prefs are not set, check if admin create prefs are set and use those (from the top level category prefs) + $checksubheading = (isset($manager_pref["content_manager_submit_subheading"]) ? $manager_pref["content_manager_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"] : "")); + $checksummary = (isset($manager_pref["content_manager_submit_summary"]) ? $manager_pref["content_manager_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"] : "")); + $checkstartdate = (isset($manager_pref["content_manager_submit_startdate"]) ? $manager_pref["content_manager_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"] : "")); + $checkenddate = (isset($manager_pref["content_manager_submit_enddate"]) ? $manager_pref["content_manager_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"] : "")); + $checkicon = (isset($manager_pref["content_manager_submit_icon"]) ? $manager_pref["content_manager_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"] : "")); + $checkattach = (isset($manager_pref["content_manager_submit_attach"]) ? $manager_pref["content_manager_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"] : "")); + $checkattachnumber = (isset($manager_pref["content_manager_submit_files_number"]) ? $manager_pref["content_manager_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"] : "")); + $checkimages = (isset($manager_pref["content_manager_submit_images"]) ? $manager_pref["content_manager_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"] : "")); + $checkimagesnumber = (isset($manager_pref["content_manager_submit_images_number"]) ? $manager_pref["content_manager_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"] : "")); + $checkcomment = (isset($manager_pref["content_manager_submit_comment"]) ? $manager_pref["content_manager_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"] : "")); + $checkrating = (isset($manager_pref["content_manager_submit_rating"]) ? $manager_pref["content_manager_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"] : "")); + $checkscore = (isset($manager_pref["content_manager_submit_score"]) ? $manager_pref["content_manager_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"] : "")); + $checkpe = (isset($manager_pref["content_manager_submit_pe"]) ? $manager_pref["content_manager_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"] : "")); + $checkvisibility = (isset($manager_pref["content_manager_submit_visibility"]) ? $manager_pref["content_manager_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"] : "")); + $checkmeta = (isset($manager_pref["content_manager_submit_meta"]) ? $manager_pref["content_manager_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"] : "")); + $checkcustom = (isset($manager_pref["content_manager_submit_customtags"]) ? $manager_pref["content_manager_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"] : "")); + $checkcustomnumber = (isset($manager_pref["content_manager_submit_custom_number"]) && $manager_pref["content_manager_submit_custom_number"] != "0" ? $content_pref["content_manager_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"] : "")); + $checklayout = (isset($manager_pref["content_manager_submit_layout"]) ? $manager_pref["content_manager_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"] : "")); + $checkpreset = (isset($manager_pref["content_manager_submit_presettags"]) ? $manager_pref["content_manager_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"] : ""); @@ -440,13 +488,11 @@ class contentform{ $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); - } + //parse author info + $authordetails = $aa -> getAuthor(USERID); + + //retrieve record if we are editing the item 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"){ @@ -466,10 +512,10 @@ class contentform{ } } + //show preview if(isset($_POST['preview_content'])){ $this -> ContentItemPreview(); } - //re-prepare the posted fields for the form (after preview) if( isset($_POST['preview_content']) || isset($message) ){ @@ -519,6 +565,7 @@ class contentform{ } } + //prepare date variables if(isset($row['content_datestamp']) && $row['content_datestamp'] != "0" && $row['content_datestamp'] != ""){ $startdate = getdate($row['content_datestamp']); $ne_day = $startdate['mday']; @@ -639,7 +686,7 @@ class contentform{ $hidden .= $rs -> form_hidden("content_layout", $row['content_layout']); } - //category + //category field (we only need to show the 'category selector' dropdownbox on the admin create page) $CONTENTFORM_CATEGORY = ''; if($mode == "contentmanager"){ if($qs[1] == "edit"){ @@ -649,11 +696,13 @@ class contentform{ } }else{ if($mode == "submit"){ - $parent = "submit"; + $hidden .= $rs -> form_hidden("parent1", intval($qs[2])); + }elseif($mode=='sa' && e_PAGE=='content_manager.php'){ + $hidden .= $rs -> form_hidden("parent1", $row['content_parent']); }else{ $parent = (isset($qs[3]) && is_numeric($qs[3]) ? $qs[3] : (isset($row['content_parent']) ? $row['content_parent'] : "") ); + $CONTENTFORM_CATEGORY = $aa -> ShowOption($parent, "createcontent"); } - $CONTENTFORM_CATEGORY = $aa -> ShowOption($parent, "createcontent"); } //author @@ -666,11 +715,13 @@ class contentform{ $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='';}\""); + //prepare file lists $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); + //retrieve the custom/preset data tags if(!(isset($_POST['preview_content']) || isset($message))){ if(isset($row['content_pref']) && $row['content_pref']){ $custom = $eArrayStorage->ReadArray($row['content_pref']); @@ -686,9 +737,10 @@ class contentform{ 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"){ + if(substr($k,0,15) == "content_custom_" && substr($k,0,22) != "content_custom_preset_" && $k != "content_custom_presettags"){ $key = substr($k,15); $key = $tp -> post_toForm($key); @@ -745,9 +797,9 @@ class contentform{ } $button = ($hidden ? $hidden : ""); - if($qs[1] == "edit" || $qs[1] == "sa" || isset($_POST['editp']) ){ + if($qs[1] == "edit" || $qs[1] == "sa" ){ if($qs[1] == "sa"){ - $button = $rs -> form_hidden("content_refer", $row['content_refer']); + $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)); @@ -830,7 +882,7 @@ class contentform{ function show_manage_content($mode, $userid="", $username=""){ - global $qs, $sql, $ns, $rs, $aa, $plugintable, $plugindir, $tp, $content_shortcodes, $eArrayStorage; + global $qs, $sql, $sql2, $ns, $rs, $aa, $plugintable, $plugindir, $tp, $content_shortcodes, $eArrayStorage; if($mode != "contentmanager"){ //category parent @@ -858,6 +910,14 @@ class contentform{ $rowpcm = $sql -> db_Fetch(); $curpref = $eArrayStorage->ReadArray($rowpcm['content_pref']); + //if inherit is used in the manager, we need to get the preferences from the core plugin table default preferences + //and use those preferences in the permissions check. + if(isset($curpref['content_manager_inherit']) && $curpref['content_manager_inherit']){ + $sql2 -> db_Select("core", "*", "e107_name='$plugintable' "); + $row2 = $sql2 -> db_Fetch(); + $curpref = $eArrayStorage->ReadArray($row2['e107_value']); + } + //only show personal items if( isset($curpref["content_manager_personal"]) && check_class($curpref["content_manager_personal"]) ){ $l = strlen($userid)+1; @@ -965,15 +1025,44 @@ class contentform{ - //show_submitted("contentmanager", USERID, USERNAME, $qs[2]); function show_submitted($cat=''){ - 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; + global $qs, $rs, $ns, $aa, $plugintable, $tp, $content_shortcodes, $eArrayStorage, $row, $CONTENT_ADMIN_SUBMITTED_START, $CONTENT_ADMIN_SUBMITTED_TABLE, $CONTENT_ADMIN_SUBMITTED_END, $CONTENT_ICON, $CONTENT_ADMIN_OPTIONS, $CONTENT_ADMIN_CATEGORY; + + if(!is_object($sql)){ $sql = new db; } $catqry = ''; + //if cat is not set, we are coming from admin, so continue + //if cat is set, cat holds the category id, and we need to do some validation if($cat && is_numeric($cat)){ - $catqry = " AND content_parent='".intval($cat)."' "; + + //we need to check if the user is allowed to approve submitted content items within this category + //so first we need to get the preferences from the category + if(!$sql -> db_Select($plugintable, "content_pref", "content_id = '".intval($cat)."' ")){ + //not a valid category, so redirect + header("location:".e_SELF); exit; + }else{ + $row = $sql -> db_Fetch(); + $content_pref = $eArrayStorage->ReadArray($row['content_pref']); + + //if inherit is used in the manager, we need to get the preferences from the core plugin table default preferences + //and use those preferences in the permissions check. + if(isset($content_pref['content_manager_inherit']) && $content_pref['content_manager_inherit']){ + $sql -> db_Select("core", "*", "e107_name='$plugintable' "); + $row = $sql -> db_Fetch(); + $content_pref = $eArrayStorage->ReadArray($row['e107_value']); + } + + //check permission to approve submitted content items + if( isset($content_pref["content_manager_approve"]) && check_class($content_pref["content_manager_approve"]) ){ + //user is allowed, so assign cat query + $catqry = " AND content_parent='".intval($cat)."' "; + }else{ + //user is not allowed, so redirect + header("location:".e_SELF); exit; + } + } } - if(!is_object($sql)){ $sql = new db; } + if(!$content_total = $sql -> db_Select($plugintable, "content_id, content_heading, content_subheading, content_author, content_icon, content_parent", "content_refer = 'sa' ".$catqry." ")){ $text .= "
".CONTENT_ADMIN_ITEM_LAN_50."
"; }else{ @@ -992,7 +1081,7 @@ class contentform{ $icon = $tp -> replaceConstants($iconpath).$row['content_icon']; $CONTENT_ICON = ($row['content_icon'] ? "" : " "); } - $delete_heading = str_replace("'", "\'", $row['content_heading']); + $delete_heading = str_replace("'", "\'", $row['content_heading']); $delid = $row['content_id']; $CONTENT_ADMIN_OPTIONS = " @@ -1054,11 +1143,9 @@ class contentform{ if(!is_object($sql)){ $sql = new db; } foreach($array as $catid){ - if(!$category_total = $sql -> db_Select($plugintable, "*", "content_id='".intval($catid)."' ")){ - $text .= "
".CONTENT_ADMIN_CAT_LAN_9."
"; - }else{ + if($category_total = $sql -> db_Select($plugintable, "*", "content_id='".intval($catid)."' ")){ $row = $sql -> db_Fetch(); - $content_pref = $aa -> getContentPref($catarray[$catid][0]); + $content_pref = $aa -> getContentPref($catid); $CONTENT_ADMIN_SPACER = ($row['content_parent']==0 ? TRUE : FALSE); $text .= $tp -> parseTemplate($CONTENT_ADMIN_MANAGER_TABLE, FALSE, $content_shortcodes); } @@ -1071,23 +1158,183 @@ class contentform{ function manager_category(){ - global $plugintable, $qs, $sql, $ns, $rs, $aa, $eArrayStorage, $tp, $content_shortcodes, $CONTENT_ADMIN_MANAGER_CATEGORY, $CONTENT_ADMIN_BUTTON; + global $plugintable, $qs, $sql, $ns, $rs, $aa, $eArrayStorage, $tp, $content_shortcodes, $CONTENT_ADMIN_MANAGER_CATEGORY, $CONTENT_ADMIN_BUTTON, $CONTENT_ADMIN_MANAGER_OPTIONS, $content_pref; - if( !getperms("0") || !is_numeric($qs[1]) ){ js_location(e_SELF); } + if( !getperms("0") && ($qs[1]!='default' || !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])."' ")){ - js_location(e_SELF."?manager"); + if($qs[1] == "default"){ + $caption = CONTENT_ADMIN_OPT_LAN_0." : ".CONTENT_ADMIN_OPT_LAN_1; + $content_pref = $aa -> getContentPref('0'); + }elseif(is_numeric($qs[1])){ + if(!is_object($sql)){ $sql = new db; } + if(!$sql -> db_Select($plugintable, "content_id, content_heading, content_pref", "content_id='".intval($qs[1])."' ")){ + header("location:".e_SELF."?manager"); exit; + }else{ + $row = $sql -> db_Fetch(); + $caption = CONTENT_ADMIN_CAT_LAN_30." : ".$row['content_heading']; + $content_pref = $eArrayStorage->ReadArray($row['content_pref']); + } }else{ - $row = $sql -> db_Fetch(); - $caption = CONTENT_ADMIN_CAT_LAN_30." : ".$row['content_heading']; + header("location:".e_SELF."?option"); exit; } - $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])); + $CONTENT_ADMIN_MANAGER_OPTIONS = $this->manager_category_options($content_pref); $text = $tp -> parseTemplate($CONTENT_ADMIN_MANAGER_CATEGORY, FALSE, $content_shortcodes); $ns -> tablerender($caption, $text); } + function manager_category_options($content_pref){ + global $ns, $rs; + + //define some variables + $CONTENT_ADMIN_MANAGER_ROW_TITLE = "{TOPIC_CAPTION}"; + $CONTENT_ADMIN_MANAGER_ROW_NOEXPAND = " + + {TOPIC_TOPIC} + {TOPIC_FIELD} + "; + + $text = " + "; + + $TOPIC_CAPTION = CONTENT_ADMIN_OPT_LAN_MENU_4; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_ADMIN_MANAGER_ROW_TITLE); + + //content_manager_submit_directpost_ + $TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_11; + $TOPIC_FIELD = " + ".$rs -> form_radio("content_manager_submit_directpost", "1", ($content_pref['content_manager_submit_directpost'] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30." + ".$rs -> form_radio("content_manager_submit_directpost", "0", ($content_pref['content_manager_submit_directpost'] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_ADMIN_MANAGER_ROW_NOEXPAND); + + //content_manager_submit_sections + $TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_SECTION_1; + $TOPIC_FIELD = "
+ ".$rs -> form_checkbox("content_manager_submit_subheading", 1, (isset($content_pref['content_manager_submit_subheading']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_32."
+ ".$rs -> form_checkbox("content_manager_submit_summary", 1, (isset($content_pref['content_manager_submit_summary']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_38."
+ ".$rs -> form_checkbox("content_manager_submit_startdate", 1, (isset($content_pref['content_manager_submit_startdate']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_33."
+ ".$rs -> form_checkbox("content_manager_submit_enddate", 1, (isset($content_pref['content_manager_submit_enddate']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_34."
+ ".$rs -> form_checkbox("content_manager_submit_icon", 1, (isset($content_pref['content_manager_submit_icon']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_27."
+ ".$rs -> form_checkbox("content_manager_submit_attach", 1, (isset($content_pref['content_manager_submit_attach']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_2."
+ ".$rs -> form_checkbox("content_manager_submit_images", 1, (isset($content_pref['content_manager_submit_images']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_3."
+ ".$rs -> form_checkbox("content_manager_submit_comment", 1, (isset($content_pref['content_manager_submit_comment']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_4."
+
+ ".$rs -> form_checkbox("content_manager_submit_rating", 1, (isset($content_pref['content_manager_submit_rating']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_5."
+ ".$rs -> form_checkbox("content_manager_submit_score", 1, (isset($content_pref['content_manager_submit_score']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_6."
+ ".$rs -> form_checkbox("content_manager_submit_pe", 1, (isset($content_pref['content_manager_submit_pe']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_20."
+ ".$rs -> form_checkbox("content_manager_submit_visibility", 1, (isset($content_pref['content_manager_submit_visibility']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_7."
+ ".$rs -> form_checkbox("content_manager_submit_meta", 1, (isset($content_pref['content_manager_submit_meta']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_8."
+ ".$rs -> form_checkbox("content_manager_submit_layout", 1, (isset($content_pref['content_manager_submit_layout']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_9."
+ ".$rs -> form_checkbox("content_manager_submit_customtags", 1, (isset($content_pref['content_manager_submit_customtags']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_10."
+ ".$rs -> form_checkbox("content_manager_submit_presettags", 1, (isset($content_pref['content_manager_submit_presettags']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_11."
+
"; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_ADMIN_MANAGER_ROW_NOEXPAND); + + //content_manager_submit_custom_number_ + $TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_5; + $TOPIC_FIELD = " + ".$rs -> form_select_open("content_manager_submit_custom_number"); + for($i=0;$i<11;$i++){ + $TOPIC_FIELD .= $rs -> form_option($i, ($content_pref['content_manager_submit_custom_number'] == $i ? "1" : "0"), $i); + } + $TOPIC_FIELD .= $rs -> form_select_close(); + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_ADMIN_MANAGER_ROW_NOEXPAND); + + //content_manager_submit_images_number_ + $TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_3; + $TOPIC_FIELD = " + ".$rs -> form_select_open("content_manager_submit_images_number"); + for($i=1;$i<16;$i++){ + $k=$i*2; + $TOPIC_FIELD .= $rs -> form_option($k, ($content_pref['content_manager_submit_images_number'] == $k ? "1" : "0"), $k); + } + $TOPIC_FIELD .= $rs -> form_select_close(); + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_ADMIN_MANAGER_ROW_NOEXPAND); + + //content_manager_submit_files_number_ + $TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_4; + $TOPIC_FIELD = " + ".$rs -> form_select_open("content_manager_submit_files_number"); + for($i=1;$i<6;$i++){ + $TOPIC_FIELD .= $rs -> form_option($i, ($content_pref['content_manager_submit_files_number'] == $i ? "1" : "0"), $i); + } + $TOPIC_FIELD .= $rs -> form_select_close(); + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_ADMIN_MANAGER_ROW_NOEXPAND); + + $text .= " + "; + + $text .= " +

+ "; + + $TOPIC_CAPTION = CONTENT_ADMIN_OPT_LAN_MENU_23; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_ADMIN_MANAGER_ROW_TITLE); + + //content_manager_manager_sections + $TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_SECTION_1; + $TOPIC_FIELD = "
+ ".$rs -> form_checkbox("content_manager_manager_subheading", 1, (isset($content_pref['content_manager_manager_subheading']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_32."
+ ".$rs -> form_checkbox("content_manager_manager_summary", 1, (isset($content_pref['content_manager_manager_summary']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_38."
+ ".$rs -> form_checkbox("content_manager_manager_startdate", 1, (isset($content_pref['content_manager_manager_startdate']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_33."
+ ".$rs -> form_checkbox("content_manager_manager_enddate", 1, (isset($content_pref['content_manager_manager_enddate']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_34."
+ ".$rs -> form_checkbox("content_manager_manager_icon", 1, (isset($content_pref['content_manager_manager_icon']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_27."
+ ".$rs -> form_checkbox("content_manager_manager_attach", 1, (isset($content_pref['content_manager_manager_attach']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_2."
+ ".$rs -> form_checkbox("content_manager_manager_images", 1, (isset($content_pref['content_manager_manager_images']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_3."
+ ".$rs -> form_checkbox("content_manager_manager_comment", 1, (isset($content_pref['content_manager_manager_comment']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_4."
+
+ ".$rs -> form_checkbox("content_manager_manager_rating", 1, (isset($content_pref['content_manager_manager_rating']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_5."
+ ".$rs -> form_checkbox("content_manager_manager_score", 1, (isset($content_pref['content_manager_manager_score']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_6."
+ ".$rs -> form_checkbox("content_manager_manager_pe", 1, (isset($content_pref['content_manager_manager_pe']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_20."
+ ".$rs -> form_checkbox("content_manager_manager_visibility", 1, (isset($content_pref['content_manager_manager_visibility']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_7."
+ ".$rs -> form_checkbox("content_manager_manager_meta", 1, (isset($content_pref['content_manager_manager_meta']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_8."
+ ".$rs -> form_checkbox("content_manager_manager_layout", 1, (isset($content_pref['content_manager_manager_layout']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_9."
+ ".$rs -> form_checkbox("content_manager_manager_customtags", 1, (isset($content_pref['content_manager_manager_customtags']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_10."
+ ".$rs -> form_checkbox("content_manager_manager_presettags", 1, (isset($content_pref['content_manager_manager_presettags']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_11."
+
"; + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_ADMIN_MANAGER_ROW_NOEXPAND); + + //content_manager_manager_custom_number_ + $TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_5; + $TOPIC_FIELD = " + ".$rs -> form_select_open("content_manager_manager_custom_number"); + for($i=0;$i<11;$i++){ + $TOPIC_FIELD .= $rs -> form_option($i, ($content_pref['content_manager_manager_custom_number'] == $i ? "1" : "0"), $i); + } + $TOPIC_FIELD .= $rs -> form_select_close(); + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_ADMIN_MANAGER_ROW_NOEXPAND); + + //content_manager_manager_images_number_ + $TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_3; + $TOPIC_FIELD = " + ".$rs -> form_select_open("content_manager_manager_images_number"); + for($i=1;$i<16;$i++){ + $k=$i*2; + $TOPIC_FIELD .= $rs -> form_option($k, ($content_pref['content_manager_manager_images_number'] == $k ? "1" : "0"), $k); + } + $TOPIC_FIELD .= $rs -> form_select_close(); + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_ADMIN_MANAGER_ROW_NOEXPAND); + + //content_manager_manager_files_number_ + $TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_4; + $TOPIC_FIELD = " + ".$rs -> form_select_open("content_manager_manager_files_number"); + for($i=1;$i<6;$i++){ + $TOPIC_FIELD .= $rs -> form_option($i, ($content_pref['content_manager_manager_files_number'] == $i ? "1" : "0"), $i); + } + $TOPIC_FIELD .= $rs -> form_select_close(); + $text .= preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_ADMIN_MANAGER_ROW_NOEXPAND); + + $text .= " + "; + + + return $text; + } + + + + function show_create_category(){ 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; @@ -1293,8 +1540,9 @@ class contentform{ function show_contentmanager($mode, $userid="", $username=""){ - global $content_shortcodes, $row, $tp, $sql, $ns, $rs, $plugintable, $plugindir, $aa, $eArrayStorage; + global $content_shortcodes, $row, $tp, $sql, $sql2, $ns, $rs, $plugintable, $plugindir, $aa, $eArrayStorage; global $CONTENT_CONTENTMANAGER_CATEGORY, $CONTENT_CONTENTMANAGER_TABLE, $CONTENT_CONTENTMANAGER_TABLE_START, $CONTENT_CONTENTMANAGER_TABLE_END, $content_pref, $pref; + $personalmanagercheck = FALSE; if(!isset($CONTENT_CONTENTMANAGER_TABLE)){ @@ -1308,10 +1556,26 @@ class contentform{ $catarray = array_keys($array); $content_contentmanager_table_string = ""; foreach($catarray as $catid){ - if($sql -> db_Select($plugintable, "content_id, content_heading, content_pref", " content_id='".intval($catid)."' ")){ + if($sql -> db_Select($plugintable, "content_id, content_heading, content_subheading, content_text, content_pref", " content_id='".intval($catid)."' ")){ $row = $sql -> db_Fetch(); + + //get preferences for this category $content_pref = $eArrayStorage->ReadArray($row['content_pref']); - if( (isset($content_pref["content_manager_approve"]) && check_class($content_pref["content_manager_approve"])) || (isset($content_pref["content_manager_personal"]) && check_class($content_pref["content_manager_personal"])) || (isset($content_pref["content_manager_category"]) && check_class($content_pref["content_manager_category"])) ){ + + //if inherit is used in the manager, we need to get the preferences from the core plugin table default preferences + //and use those preferences in the permissions check. + if(isset($content_pref['content_manager_inherit']) && $content_pref['content_manager_inherit']){ + $sql2 -> db_Select("core", "*", "e107_name='$plugintable' "); + $row2 = $sql2 -> db_Fetch(); + $content_pref = $eArrayStorage->ReadArray($row2['e107_value']); + } + + //now we can check the permissions for this user + if( (isset($content_pref["content_manager_approve"]) && check_class($content_pref["content_manager_approve"])) || + (isset($content_pref["content_manager_personal"]) && check_class($content_pref["content_manager_personal"])) || + (isset($content_pref["content_manager_category"]) && check_class($content_pref["content_manager_category"])) || + (isset($content_pref["content_manager_submit"]) && check_class($content_pref["content_manager_submit"])) + ){ $personalmanagercheck = TRUE; $content_contentmanager_table_string .= $tp -> parseTemplate($CONTENT_CONTENTMANAGER_TABLE, FALSE, $content_shortcodes); } @@ -1330,8 +1594,6 @@ class contentform{ function show_order(){ 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, $CONTENT_ADMIN_SPACER; - //if(!getperms("0")){ header("location:".e_SELF); exit; } - $catarray = $aa -> getCategoryTree("", "", FALSE); $array = array_keys($catarray); @@ -1514,8 +1776,7 @@ class contentform{ }else{ header("location:".e_SELF."?option"); exit; } - //check prefs two times to insure they are shown, if none present, the first inserts them, the second retrieves them - //$content_pref = $aa -> getContentPref($id); + $content_pref = $aa -> getContentPref($id); //define some variables @@ -1527,8 +1788,7 @@ class contentform{ {TOPIC_TOPIC} {TOPIC_FIELD} - - "; + "; $TOPIC_ROW = " @@ -1697,88 +1957,6 @@ class contentform{ $text .= $TOPIC_TABLE_END; - $text .= " -