[ 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/featurebox/admin_config.php,v $ 14 | $Revision: 1.2 $ 15 | $Date: 2005/06/15 03:04:40 $ 16 | $Author: mcfly_e107 $ 17 +----------------------------------------------------------------------------+ 18 */ 19 require_once ("../../class2.php"); 20 if (!getperms("P")) { 21 header("location:".e_BASE."index.php"); 22 exit; 23 } 24 25 require_once(e_ADMIN."auth.php"); 26 require_once(e_HANDLER."userclass_class.php"); 27 require_once(e_HANDLER."file_class.php"); 28 $fl = new e_file; 29 $rejecthumb = array('$.','$..','/','CVS','thumbs.db','*._$',"thumb_", 'index', 'null*'); 30 $templatelist = $fl->get_files(e_PLUGIN."featurebox/templates/","",$rejecthumb); 31 32 if (e_QUERY) { 33 list($action, $id) = explode(".", e_QUERY); 34 } 35 else 36 { 37 $action = FALSE; 38 $id = FALSE; 39 } 40 41 if(isset($_POST['createFB'])) 42 { 43 if ($_POST['fb_title'] && $_POST['fb_text']) { 44 $fb_title = $tp -> toDB($_POST['fb_title']); 45 $fb_text = $tp -> toDB($_POST['fb_text']); 46 $fb_mode = $_POST['fb_mode']; 47 $fb_class = $_POST['fb_class']; 48 $fb_rendertype = $_POST['fb_rendertype']; 49 $fb_template = $_POST['fb_template']; 50 $sql->db_Insert("featurebox", "0, '$fb_title', '$fb_text', '$fb_mode', '$fb_class', '$fb_rendertype', '$fb_template'"); 51 $message = FBLAN_15; 52 } else { 53 $message = FBLAN_17; 54 } 55 } 56 57 if(isset($_POST['updateFB'])) 58 { 59 if ($_POST['fb_title'] && $_POST['fb_text']) { 60 $fb_title = $tp -> toDB($_POST['fb_title']); 61 $fb_text = $tp -> toDB($_POST['fb_text']); 62 $fb_mode = $_POST['fb_mode']; 63 $fb_class = $_POST['fb_class']; 64 $fb_rendertype = $_POST['fb_rendertype']; 65 $fb_template = $_POST['fb_template']; 66 $sql->db_Update("featurebox", "fb_title='$fb_title', fb_text='$fb_text', fb_mode='$fb_mode', fb_class='$fb_class', fb_rendertype='$fb_rendertype', fb_template='$fb_template' WHERE fb_id=".$_POST['fb_id']); 67 $message = FBLAN_16; 68 } else { 69 $message = FBLAN_17; 70 } 71 } 72 73 if($action == "delete") { 74 $sql->db_Delete("featurebox", "fb_id=$id"); 75 $message = FBLAN_18; 76 } 77 78 if (isset($message)) { 79 $ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>"); 80 } 81 82 83 if($headline_total = $sql->db_Select("featurebox ")) 84 { 85 $nfArray = $sql -> db_getList(); 86 87 $text = "<div style='text-align:center'> 88 <table class='fborder' style='".ADMIN_WIDTH.";'> 89 <tr> 90 <td class='forumheader' style='width: 5%; text-align: center;'>ID</td> 91 <td class='forumheader' style='width: 50%;'>".FBLAN_07."</td> 92 <td class='forumheader' style='width: 10%; text-align: center;'>".FBLAN_19."</td> 93 </tr>\n"; 94 95 foreach($nfArray as $entry) 96 { 97 $text .= " 98 <tr> 99 <td class='forumheader' style='width: 5%; text-align: center;'>".$entry['fb_id']."</td> 100 <td class='forumheader' style='width: 50%;'>".$entry['fb_title']."</td> 101 <td class='forumheader' style='width: 10%; text-align: center;'> 102 <a href='".e_SELF."?edit.".$entry['fb_id']."'>".FBLAN_20."</a> - <a href='".e_SELF."?delete.".$entry['fb_id']."'>".FBLAN_21."</a> 103 </td> 104 </tr> 105 "; 106 } 107 108 109 110 $text .= "</table>\n</div>"; 111 } 112 else 113 { 114 $text = FBLAN_05; 115 } 116 $ns->tablerender(FBLAN_06, $text); 117 118 if($action == "edit") 119 { 120 if($sql->db_Select("featurebox", "*", "fb_id=$id")) 121 { 122 $row = $sql->db_Fetch(); 123 extract($row); 124 } 125 } 126 else 127 { 128 unset($fb_name, $fb_text, $fb_mode, $fb_class); 129 } 130 131 $text = "<div style='text-align:center'> 132 <form method='post' action='".e_SELF."'>\n 133 <table style='".ADMIN_WIDTH."' class='fborder'> 134 135 <tr> 136 <td style='width:50%' class='forumheader3'>".FBLAN_07."</td> 137 <td style='width:50%; text-align: left;' class='forumheader3'> 138 <input class='tbox' type='text' name='fb_title' style='width: 80%' value='$fb_title' maxlength='200' /> 139 </td> 140 </tr> 141 142 <tr> 143 <td style='width:50%' class='forumheader3'>".FBLAN_08."</td> 144 <td style='width:50%; text-align: left;' class='forumheader3'> 145 <textarea class='tbox' name='fb_text' style='width: 90%' rows='6'>$fb_text</textarea> 146 </td> 147 </tr> 148 149 <tr> 150 <td style='width:50%' class='forumheader3'>".FBLAN_09."</td> 151 <td style='width:50%; text-align: left;' class='forumheader3'> 152 ".r_userclass("fb_class", $fb_class, "public, guests, nobody, member, admin, classes")." 153 </td> 154 </tr> 155 156 <tr> 157 <td style='width:50%' class='forumheader3'>".FBLAN_12."</td> 158 <td style='width:50%; text-align: left;' class='forumheader3'> 159 <input type='radio' name='fb_mode' value='0'".(!$fb_mode ? " checked='checked'" : "")." /> ".FBLAN_13." <br /> 160 <input type='radio' name='fb_mode' value='1'".($fb_mode == 1 ? " checked='checked'" : "")." /> ".FBLAN_14." 161 </td> 162 </tr> 163 164 <tr> 165 <td style='width:50%' class='forumheader3'>".FBLAN_22."</td> 166 <td style='width:50%; text-align: left;' class='forumheader3'> 167 <input type='radio' name='fb_rendertype' value='0'".(!$fb_rendertype ? " checked='checked'" : "")." /> ".FBLAN_23." <br /> 168 <input type='radio' name='fb_rendertype' value='1'".($fb_rendertype == 1 ? " checked='checked'" : "")." /> ".FBLAN_24." 169 </td> 170 </tr> 171 172 <tr> 173 <td style='width:50%' class='forumheader3'>".FBLAN_25."<br /><span class='smalltext'>".FBLAN_26."</span></td> 174 <td style='width:50%; text-align: left;' class='forumheader3'> 175 <select class='tbox' name='fb_template'> 176 "; 177 178 foreach($templatelist as $value) 179 { 180 $file = str_replace(".php", "", $value['fname']); 181 $text .= "<option".($file == $fb_template ? " selected='selected'" : "").">$file</option>\n"; 182 } 183 184 $text .= "</select> 185 </td> 186 </tr> 187 188 <tr style='vertical-align:top'> 189 <td colspan='2' style='text-align:center' class='forumheader'> 190 <input class='button' type='submit' name='".($action == "edit" ? "updateFB" : "createFB")."' value='".($action == "edit" ? FBLAN_11 : FBLAN_10)."' /> 191 </td> 192 </tr> 193 194 </table> 195 ".($action == "edit" ? "<input type='hidden' name='fb_id' value='$fb_id' />" : "")." 196 </form> 197 </div>"; 198 199 $caption = ($action == "edit" ? FBLAN_11 : FBLAN_10); 200 201 $ns->tablerender($caption, $text); 202 203 require_once(e_ADMIN."footer.php"); 204 ?>
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 |