[ 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/newsfeed/admin_config.php,v $ 14 | $Revision: 1.9 $ 15 | $Date: 2006/06/08 04:02:47 $ 16 | $Author: e107coders $ 17 +----------------------------------------------------------------------------+ 18 */ 19 require_once ("../../class2.php"); 20 if (!getperms("E")) { 21 header("location:".e_BASE."index.php"); 22 exit; 23 } 24 25 require_once(e_ADMIN."auth.php"); 26 27 if (e_QUERY) { 28 list($action, $id) = explode(".", e_QUERY); 29 } 30 else 31 { 32 $action = FALSE; 33 $id = FALSE; 34 } 35 36 if(isset($_POST['createFeed'])) 37 { 38 if ($_POST['newsfeed_url'] && $_POST['newsfeed_name']) { 39 $name = $tp -> toDB($_POST['newsfeed_name']); 40 $description = $tp -> toDB($_POST['newsfeed_description']); 41 $imgfield = $_POST['newsfeed_image']."::".$_POST['newsfeed_showmenu']."::".$_POST['newsfeed_showmain']; 42 $sql->db_Insert("newsfeed", "0, '$name', '".$_POST['newsfeed_url']."', '', '0', '{$description}', '{$imgfield}', ".$_POST['newsfeed_active'].", ".$_POST['newsfeed_updateint']." "); 43 $message = NFLAN_23; 44 } else { 45 $message = NFLAN_24; 46 } 47 } 48 49 if(isset($_POST['updateFeed'])) 50 { 51 $name = $tp -> toDB($_POST['newsfeed_name']); 52 $description = $tp -> toDB($_POST['newsfeed_description']); 53 $imgfield = $_POST['newsfeed_image']."::".$_POST['newsfeed_showmenu']."::".$_POST['newsfeed_showmain']; 54 $sql->db_Update("newsfeed", "newsfeed_name='{$name}', newsfeed_url='".$_POST['newsfeed_url']."', newsfeed_timestamp='0', newsfeed_image='{$imgfield}', newsfeed_description='{$description}', newsfeed_active=".$_POST['newsfeed_active'].", newsfeed_updateint=".$_POST['newsfeed_updateint']." WHERE newsfeed_id=".$_POST['newsfeed_id']); 55 $message = NFLAN_25; 56 } 57 58 if($action == "delete") { 59 $sql->db_Delete("newsfeed", "newsfeed_id=$id"); 60 $message = NFLAN_40; 61 } 62 63 if (isset($message)) { 64 $ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>"); 65 } 66 67 68 if($headline_total = $sql->db_Select("newsfeed")) 69 { 70 $nfArray = $sql -> db_getList(); 71 72 $text = "<div style='text-align:center'> 73 <table class='fborder' style='".ADMIN_WIDTH.";'> 74 <tr> 75 <td class='forumheader' style='width: 5%; text-align: center;'>ID</td> 76 <td class='forumheader' style='width: 50%;'>".NFLAN_30."</td> 77 <td class='forumheader' style='width: 10%; text-align: center;'>".NFLAN_26."</td> 78 <td class='forumheader' style='width: 25%; text-align: center;'>".NFLAN_12."</td> 79 <td class='forumheader' style='width: 10%; text-align: center;'>".NFLAN_27."</td> 80 </tr>\n"; 81 82 $active = array(NFLAN_13,NFLAN_14,NFLAN_20,NFLAN_21); 83 84 foreach($nfArray as $newsfeed) 85 { 86 extract($newsfeed); 87 88 $text .= "<tr><td class='forumheader3' style='width: 5%; text-align: center;'>$newsfeed_id</td> 89 <td class='forumheader3' style='width: 50%;'><a href='$newsfeed_url' rel='external'>$newsfeed_name</a></td> 90 <td class='forumheader3' style='width: 10%; text-align: center;'>".($newsfeed_updateint ? $newsfeed_updateint : "3600")."</td> 91 <td class='forumheader3' style='width: 25%; text-align: center;'>".$active[$newsfeed_active]."</td> 92 <td class='forumheader3' style='width: 10%; text-align: center;'><a href='".e_SELF."?edit.".$newsfeed_id."'>".ADMIN_EDIT_ICON."</a> <a href='".e_SELF."?delete.".$newsfeed_id."'>".ADMIN_DELETE_ICON."</a></td> 93 </tr>\n"; 94 } 95 96 $text .= "</table>\n</div>"; 97 } 98 else 99 { 100 $text = NFLAN_41; 101 } 102 $ns->tablerender(NFLAN_07, $text); 103 104 if($action == "edit") 105 { 106 if($sql->db_Select("newsfeed", "*", "newsfeed_id=$id")) 107 { 108 $row = $sql->db_Fetch(); 109 extract($row); 110 list($newsfeed_image, $newsfeed_showmenu, $newsfeed_showmain) = explode("::", $newsfeed_image); 111 } 112 } 113 else 114 { 115 unset($newsfeed_showmenu, $newsfeed_showmain, $newsfeed_name, $newsfeed_url, $newsfeed_image, $newsfeed_description, $newsfeed_updateint, $newsfeed_active); 116 } 117 118 $text = "<div style='text-align:center'> 119 <form method='post' action='".e_SELF."'>\n 120 <table style='".ADMIN_WIDTH."' class='fborder'> 121 122 <tr> 123 <td style='width:50%' class='forumheader3'>".NFLAN_30."</td> 124 <td style='width:50%; text-align: left;' class='forumheader3'> 125 <input class='tbox' type='text' name='newsfeed_name' size='80' value='$newsfeed_name' maxlength='200' /> 126 </td> 127 </tr> 128 129 130 131 <tr> 132 <td style='width:50%' class='forumheader3'>".NFLAN_10."</td> 133 <td style='width:50%; text-align: left;' class='forumheader3'> 134 <input class='tbox' type='text' name='newsfeed_url' size='80' value='$newsfeed_url' maxlength='200' /> 135 </td> 136 </tr> 137 138 <tr> 139 <td style='width:50%' class='forumheader3'>".NFLAN_11."<br /><span class='smalltext'>".NFLAN_17."</span></td> 140 <td style='width:50%; text-align: left;' class='forumheader3'> 141 <input class='tbox' type='text' name='newsfeed_image' size='80' value='$newsfeed_image' maxlength='200' /> 142 </td> 143 </tr> 144 145 <tr> 146 <td style='width:50%' class='forumheader3'>".NFLAN_36."<br /><span class='smalltext'>".NFLAN_37."</span></td> 147 <td style='width:50%; text-align: left;' class='forumheader3'> 148 <input class='tbox' type='text' name='newsfeed_description' size='80' value='$newsfeed_description' maxlength='200' /> 149 </td> 150 </tr> 151 152 <tr> 153 <td style='width:50%' class='forumheader3'>".NFLAN_18."<br /><span class='smalltext'>".NFLAN_19."</span></td> 154 <td style='width:50%; text-align: left;' class='forumheader3'> 155 <input class='tbox' type='text' name='newsfeed_updateint' size='5' value='".($newsfeed_updateint ? $newsfeed_updateint : "3600")."' maxlength='200' /> 156 </td> 157 </tr> 158 159 <tr> 160 <td style='width:50%' class='forumheader3'>".NFLAN_12."<br /><span class='smalltext'>".NFLAN_22."</span></td> 161 <td style='width:50%; text-align: left;' class='forumheader3'> 162 163 <input type='radio' name='newsfeed_active' value='0'".(!$newsfeed_active ? " checked='checked'" : "")." /> ".NFLAN_13." <br /> 164 <input type='radio' name='newsfeed_active' value='1'".($newsfeed_active == 1 ? " checked='checked'" : "")." /> ".NFLAN_14." <br /> 165 <input type='radio' name='newsfeed_active' value='2'".($newsfeed_active == 2 ? " checked='checked'" : "")." /> ".NFLAN_20." <br /> 166 <input type='radio' name='newsfeed_active' value='3'".($newsfeed_active == 3 ? " checked='checked'" : "")." /> ".NFLAN_21." 167 </td> 168 </tr> 169 170 <tr> 171 <td style='width:50%' class='forumheader3'>".NFLAN_45."<br /><span class='smalltext'>".NFLAN_47."</span></td> 172 <td style='width:50%; text-align: left;' class='forumheader3'> 173 <input class='tbox' type='text' name='newsfeed_showmenu' size='5' value='".($newsfeed_showmenu ? $newsfeed_showmenu : "0")."' maxlength='200' /> 174 </td> 175 </tr> 176 177 <tr> 178 <td style='width:50%' class='forumheader3'>".NFLAN_46."<br /><span class='smalltext'>".NFLAN_47."</span></td> 179 <td style='width:50%; text-align: left;' class='forumheader3'> 180 <input class='tbox' type='text' name='newsfeed_showmain' size='5' value='".($newsfeed_showmain ? $newsfeed_showmain : "0")."' maxlength='200' /> 181 </td> 182 </tr> 183 184 <tr style='vertical-align:top'> 185 <td colspan='2' style='text-align:center' class='forumheader'> 186 <input class='button' type='submit' name='".($action == "edit" ? "updateFeed" : "createFeed")."' value='".($action == "edit" ? NFLAN_16 : NFLAN_15)."' /> 187 </td> 188 </tr> 189 190 </table> 191 ".($action == "edit" ? "<input type='hidden' name='newsfeed_id' value='$newsfeed_id' />" : "")." 192 </form> 193 </div>"; 194 195 $ns->tablerender(NFLAN_09, $text); 196 197 require_once(e_ADMIN."footer.php"); 198 ?>
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 |