Changeset 9406 for extensions/meta/admin/admin.php
- Timestamp:
- Feb 28, 2011, 8:14:42 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/meta/admin/admin.php
r7539 r9406 23 23 l10n('meta_onglet_gestion'), 24 24 $my_base_url.'&tab=gestion'); 25 $tabsheet->add('categorie',26 l10n('meta_onglet_categorie'),27 $my_base_url.'&tab=categorie');28 $tabsheet->add('image',29 l10n('meta_onglet_image'),30 $my_base_url.'&tab=image');31 25 $tabsheet->add('description', 32 26 l10n('meta_onglet_description'), … … 109 103 break; 110 104 111 // Onglet gestion des meta categorie112 case 'categorie':113 114 //charge la liste des catégories115 $groups = array();116 $query = '117 select id,name118 FROM ' . CATEGORIES_TABLE . '119 ORDER BY id ASC;';120 $result = pwg_query($query);121 122 while ($row = mysql_fetch_array($result))123 {124 $groups[$row['id']] = $row['id'].' : '.$row['name'];125 }126 127 $selected = 0;128 $options[] = l10n('meta_select3');129 $options['a'] = '----------------------';130 131 foreach($groups as $listid => $listid2)132 {133 $options[$listid] = $listid2;134 }135 $template->assign(136 'gestionB',137 array(138 'OPTIONS' => $options,139 'SELECTED' => $selected140 ));141 142 143 //edit de categorie144 if (isset($_POST['submitchoixcat'])and is_numeric($_POST['metacat']) and (!$_POST['metacat'])==0 and !is_adviser())145 {146 $lire=$_POST['metacat'];147 $query = '148 select id,name,comment149 FROM ' . CATEGORIES_TABLE . '150 WHERE id = \''.$lire.'\'151 ;';152 $result = pwg_query($query);153 154 $row = mysql_fetch_array($result);155 $idcat=$row['id'];156 $chnamecat=$row['name'];157 $chdescat=$row['comment'];158 $query = '159 select id,metaKeycat,metadescat160 FROM ' . meta_cat_TABLE . '161 WHERE id = \''.$lire.'\'162 ;';163 $result = pwg_query($query);164 $row = mysql_fetch_array($result);165 $idmetaKeycat=$row['id'];166 $chvalcat=$row['metaKeycat'];167 $chvalcatdes=$row['metadescat'];168 169 $selected3 = 0;170 171 $template->assign(172 'cat_edit',173 array(174 'DESC' => $chdescat,175 'VALUE' => $idcat,176 'VALUEN' => $chnamecat,177 'CONTENT' => $chvalcat,178 'CONTENT2' => $chvalcatdes,179 'SELECTED' => $selected3180 ));181 }182 183 //insértion de meta de cat dans la table meta_cat184 if (isset($_POST['submitinscat']) and !is_adviser())185 {186 $query = '187 DELETE188 FROM ' . meta_cat_TABLE . '189 WHERE id = \''.$_POST['invisible'].'\'190 ;';191 $result = pwg_query($query);192 $q = '193 INSERT INTO ' . $prefixeTable . 'meta_cat(id,metaKeycat,metadescat)VALUES ('.$_POST['invisible'].',"'.$_POST['inser'].'","'.$_POST['inser2'].'");';194 pwg_query($q);195 }196 197 break;198 199 // Onglet gestion des meta keywords images200 case 'image':201 202 //charge la liste des images203 $groups = array();204 $query = '205 select id,name206 FROM ' . IMAGES_TABLE . '207 ORDER BY id ASC;';208 $result = pwg_query($query);209 210 while ($row = mysql_fetch_array($result))211 {212 $groups[$row['id']] = $row['id'].' : '.$row['name'];213 }214 215 $selected = 0;216 $options[] = l10n('meta_selecti3');217 $options['a'] = '----------------------';218 219 foreach($groups as $listid => $listid2)220 {221 $options[$listid] = $listid2;222 }223 $template->assign(224 'gestionC',225 array(226 'OPTIONS' => $options,227 'SELECTED' => $selected228 ));229 230 //edit de la meta l'image231 if (isset($_POST['submitchoiximg'])and is_numeric($_POST['metaimg']) and (!$_POST['metaimg'])==0 and !is_adviser())232 {233 $lire=$_POST['metaimg'];234 $query = '235 select id,name,comment,path236 FROM ' . IMAGES_TABLE . '237 WHERE id = \''.$lire.'\'238 ;';239 $result = pwg_query($query);240 241 $row = mysql_fetch_array($result);242 $idimg=$row['id'];243 $chnameimg=$row['name'];244 $chdescimg=$row['comment'];245 $rootimg=$row['path'];246 247 $query = '248 select id,metaKeyimg,metadesimg249 FROM ' . meta_img_TABLE . '250 WHERE id = \''.$lire.'\'251 ;';252 $result = pwg_query($query);253 $row = mysql_fetch_array($result);254 $idmetaKeyimg=$row['id'];255 $chvalimg=$row['metaKeyimg'];256 $chvalimgdes=$row['metadesimg'];257 258 $selected3 = 0;259 260 $template->assign(261 'img_edit',262 array(263 'RIMG' => $rootimg,264 'DESC' => $chdescimg,265 'VALUE' => $idimg,266 'VALUEN' => $chnameimg,267 'CONTENT' => $chvalimg,268 'CONTENT2' => $chvalimgdes,269 'SELECTED' => $selected3270 ));271 }272 273 //insértion de meta img dans la table img274 if (isset($_POST['submitinsimg']) and !is_adviser())275 {276 $query = '277 DELETE278 FROM ' . meta_img_TABLE . '279 WHERE id = \''.$_POST['invisible'].'\'280 ;';281 $result = pwg_query($query);282 $q = '283 INSERT INTO ' . $prefixeTable . 'meta_img(id,metaKeyimg,metadesimg)VALUES ('.$_POST['invisible'].',"'.$_POST['inser'].'","'.$_POST['inser2'].'");';284 pwg_query($q);285 }286 287 break;288 289 105 // Onglet description 290 106 case 'description':
Note: See TracChangeset
for help on using the changeset viewer.