[ Index ] |
|
Code source de e107 0.7.8 |
1 <?php 2 /* 3 + ----------------------------------------------------------------------------+ 4 | e107 website system 5 | 6 | ©Steve Dunstan 2001-2002 7 | http://e107.org 8 | jalist@e107.org 9 | 10 | Released under the terms and conditions of the 11 | GNU General Public License (http://gnu.org). 12 | 13 | $Source: /cvsroot/e107/e107_0.7/e107_plugins/links_page/admin_linkspage_config.php,v $ 14 | $Revision: 1.8 $ 15 | $Date: 2006/11/01 18:48:46 $ 16 | $Author: lisa_ $ 17 +----------------------------------------------------------------------------+ 18 */ 19 20 require_once ("../../class2.php"); 21 if (!getperms("P")) { 22 header("location:".e_BASE."index.php"); 23 } 24 require_once(e_PLUGIN.'links_page/link_shortcodes.php'); 25 require_once(e_PLUGIN.'links_page/link_defines.php'); 26 require_once(e_ADMIN."auth.php"); 27 require_once(e_HANDLER."userclass_class.php"); 28 require_once(e_HANDLER."form_handler.php"); 29 $rs = new form; 30 require_once(e_HANDLER."file_class.php"); 31 $fl = new e_file; 32 e107_require_once(e_HANDLER.'arraystorage_class.php'); 33 $eArrayStorage = new ArrayData(); 34 require_once(e_PLUGIN.'links_page/link_class.php'); 35 $lc = new linkclass; 36 37 $lan_file = $plugindir."languages/".e_LANGUAGE.".php"; 38 include_once(file_exists($lan_file) ? $lan_file : $plugindir."languages/English.php"); 39 40 $linkspage_pref = $lc -> getLinksPagePref(); 41 42 $deltest = array_flip($_POST); 43 44 //if (e_QUERY) { 45 // $qs = explode(".", e_QUERY); 46 //} 47 if(e_QUERY){ 48 $qs = explode(".", e_QUERY); 49 50 if(is_numeric($qs[0])){ 51 $from = array_shift($qs); 52 }else{ 53 $from = "0"; 54 } 55 } 56 if(isset($_POST['delete'])){ 57 $tmp = array_pop($tmp = array_flip($_POST['delete'])); 58 list($delete, $del_id) = explode("_", $tmp); 59 } 60 if (isset($_POST['create_category'])) { 61 $lc -> dbCategoryCreate(); 62 } 63 if (isset($_POST['update_category'])) { 64 $lc -> dbCategoryUpdate(); 65 } 66 if (isset($_POST['updateoptions'])) { 67 $linkspage_pref = $lc -> UpdateLinksPagePref(); 68 $lc -> show_message(LCLAN_ADMIN_6); 69 } 70 if (isset($_POST['add_link'])) { 71 $lc -> dbLinkCreate(); 72 } 73 //upload link icon 74 if(isset($_POST['uploadlinkicon'])){ 75 $lc -> uploadLinkIcon(); 76 } 77 //upload category icon 78 if(isset($_POST['uploadcatlinkicon'])){ 79 $lc -> uploadCatLinkIcon(); 80 } 81 //update link order 82 if (isset($_POST['update_order'])) { 83 $lc -> dbOrderUpdate($_POST['link_order']); 84 } 85 //update link category order 86 if (isset($_POST['update_category_order'])) { 87 $lc -> dbOrderCatUpdate($_POST['link_category_order']); 88 } 89 if (isset($_POST['inc'])) { 90 $lc -> dbOrderUpdateInc($_POST['inc']); 91 } 92 if (isset($_POST['dec'])) { 93 $lc -> dbOrderUpdateDec($_POST['dec']); 94 } 95 //delete link 96 if (isset($delete) && $delete == 'main') { 97 $sql->db_Select("links_page", "link_order", "link_id='".$del_id."'"); 98 $row = $sql->db_Fetch(); 99 $sql2 = new db; 100 $sql->db_Select("links_page", "link_id", "link_order>'".$row['link_order']."' && link_category='".$id."'"); 101 while ($row = $sql->db_Fetch()) { 102 $sql2->db_Update("links_page", "link_order=link_order-1 WHERE link_id='".$row['link_id']."'"); 103 } 104 if ($sql->db_Delete("links_page", "link_id='".$del_id."'")) { 105 $lc->show_message(LCLAN_ADMIN_10." #".$del_id." ".LCLAN_ADMIN_11); 106 } 107 } 108 //delete category 109 if (isset($delete) && $delete == 'category') { 110 //check if links are present for this category 111 if($sql->db_Select("links_page", "*", "link_category='$del_id' ")) { 112 $lc->show_message(LCLAN_ADMIN_12." #".$del_id." ".LAN_DELETED_FAILED."<br />".LCLAN_ADMIN_15); 113 //no? then we can safely remove this category 114 }else{ 115 if ($sql->db_Delete("links_page_cat", "link_category_id='$del_id' ")) { 116 $lc->show_message(LCLAN_ADMIN_12." #".$del_id." ".LCLAN_ADMIN_11); 117 unset($id); 118 } 119 } 120 } 121 //delete submitted link 122 if (isset($delete) && $delete == 'sn') { 123 if ($sql->db_Delete("tmp", "tmp_time='$del_id' ")) { 124 $lc->show_message(LCLAN_ADMIN_13); 125 } 126 } 127 128 129 //show link categories (cat edit) 130 if (!e_QUERY) { 131 $lc->show_categories("cat"); 132 } 133 134 //show cat edit form 135 if (isset($qs[0]) && $qs[0] == 'cat' && isset($qs[1]) && $qs[1] == 'edit' && isset($qs[2]) && is_numeric($qs[2])) { 136 $lc->show_cat_create(); 137 } 138 139 //show cat create form 140 if (isset($qs[0]) && $qs[0] == 'cat' && isset($qs[1]) && $qs[1] == 'create' && !isset($qs[2]) ) { 141 $lc->show_cat_create(); 142 } 143 144 if (isset($qs[0]) && $qs[0] == 'link') { 145 //view categories (link select cat) 146 if (!isset($qs[1])){ 147 $lc->show_categories("link"); 148 149 //view links in cat 150 }elseif (isset($qs[1]) && $qs[1] == 'view' && isset($qs[2]) && (is_numeric($qs[2]) || $qs[2] == "all") ) { 151 $lc->show_links(); 152 153 //edit link 154 }elseif (isset($qs[1]) && $qs[1] == 'edit' && isset($qs[2]) && is_numeric($qs[2])) { 155 $lc->show_link_create(); 156 157 //create link 158 }elseif (isset($qs[1]) && $qs[1] == 'create' && !isset($qs[2]) ) { 159 $lc->show_link_create(); 160 161 //post submitted 162 }elseif (isset($qs[1]) && $qs[1] == 'sn' && isset($qs[2]) && is_numeric($qs[2]) ) { 163 $lc->show_link_create(); 164 } 165 } 166 167 //view submitted links 168 if (isset($qs[0]) && $qs[0] == 'sn') { 169 $lc->show_submitted(); 170 } 171 172 //options 173 if (isset($qs[0]) && $qs[0] == 'opt') { 174 $lc->show_pref_options(); 175 } 176 177 // ##### Display options -------------------------------------------------------------------------- 178 function admin_linkspage_config_adminmenu(){ 179 global $qs, $sql; 180 if ($qs[0] == "") { 181 $act = "cat"; 182 }else{ 183 $act = $qs[0]; 184 if(isset($qs[1])){ 185 if($qs[1] == "create"){ 186 $act .= ".create"; 187 } 188 if($qs[1] == "edit"){ 189 $act .= ""; 190 } 191 if($qs[1] == "view"){ 192 $act .= ""; 193 } 194 } 195 } 196 197 $var['cat']['text'] = LCLAN_ADMINMENU_2; 198 $var['cat']['link'] = e_SELF; 199 200 $var['cat.create']['text'] = LCLAN_ADMINMENU_3; 201 $var['cat.create']['link'] = e_SELF."?cat.create"; 202 203 $var['link']['text'] = LCLAN_ADMINMENU_4; 204 $var['link']['link'] = e_SELF."?link"; 205 206 $var['link.create']['text'] = LCLAN_ADMINMENU_5; 207 $var['link.create']['link'] = e_SELF."?link.create"; 208 209 if ($tot = $sql->db_Select("tmp", "*", "tmp_ip='submitted_link' ")) { 210 $var['sn']['text'] = LCLAN_ADMINMENU_7." (".$tot.")"; 211 $var['sn']['link'] = e_SELF."?sn"; 212 } 213 214 $var['opt']['text'] = LCLAN_ADMINMENU_6; 215 $var['opt']['link'] = e_SELF."?opt"; 216 217 show_admin_menu(LCLAN_ADMINMENU_1, $act, $var); 218 219 if($qs[0] != "opt"){ 220 unset($var); 221 $var=array(); 222 if ($sql->db_Select("links_page_cat", "*")) { 223 while ($row = $sql->db_Fetch()) { 224 $var[$row['link_category_id']]['text'] = $row['link_category_name']; 225 $var[$row['link_category_id']]['link'] = e_SELF."?link.view.".$row['link_category_id']; 226 } 227 $active = ($qs[0] == 'link') ? $id : FALSE; 228 show_admin_menu(LCLAN_ADMINMENU_8, $active, $var); 229 } 230 } 231 if(isset($qs[0]) && $qs[0] == "opt"){ 232 unset($var); 233 $var=array(); 234 $var['optgeneral']['text'] = LCLAN_OPT_MENU_1; 235 $var['optmanager']['text'] = LCLAN_OPT_MENU_2; 236 $var['optcategory']['text'] = LCLAN_OPT_MENU_3; 237 $var['optlinks']['text'] = LCLAN_OPT_MENU_4; 238 $var['optrefer']['text'] = LCLAN_OPT_MENU_5; 239 $var['optrating']['text'] = LCLAN_OPT_MENU_6; 240 $var['optmenu']['text'] = LCLAN_OPT_MENU_7; 241 show_admin_menu(LCLAN_ADMINMENU_6, $qs[0], $var, TRUE); 242 } 243 } 244 245 require_once(e_ADMIN.'footer.php'); 246 exit; 247 248 // End --------------------------------------------------------------------------------------------------------- 249 250 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Apr 1 01:23:32 2007 | par Balluche grâce à PHPXref 0.7 |