Changeset 24393
- Timestamp:
- Sep 10, 2013, 8:27:33 PM (11 years ago)
- Location:
- extensions/meta
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/meta/admin/admin.php
r22769 r24393 26 26 l10n('Personal Metadata'), 27 27 $my_base_url.'&tab=persometa'); 28 29 $MPC = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ContactForm';")); 30 if($MPC['state'] == 'active') 31 { 32 $tabsheet->add('contactmeta', 33 l10n('Contact page Metadata'), 34 $my_base_url.'&tab=contactmeta'); 35 } 36 $MAP = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'AdditionalPages';")); 37 if($MAP['state'] == 'active') 38 { 39 $tabsheet->add('AdditionalPagesmeta', 40 l10n('Additional Pages Metadata'), 41 $my_base_url.'&tab=AdditionalPagesmeta'); 42 } 43 28 44 $tabsheet->add('description', 29 45 l10n('meta_onglet_description'), … … 209 225 break; 210 226 227 case 'contactmeta': 228 229 $metacontact = explode(',', $conf['contactmeta']); 230 231 $template->assign('contactmetaT', 232 array('CMKEY' => $metacontact[0],'CMDESC' => $metacontact[1],)); 233 234 if (isset($_POST['submitcm'])) 235 { 236 $INSCM = $_POST['inser'].",".$_POST['inser2']; 237 conf_update_param('contactmeta', $INSCM); 238 $template->assign( 239 'contactmetaT', 240 array('CMKEY' => stripslashes($_POST['inser']),'CMDESC' => stripslashes($_POST['inser2']))); 241 } 242 243 break; 244 245 case 'AdditionalPagesmeta': 246 if (!defined('TITLE_AP_TABLE')) define('TITLE_AP_TABLE', $prefixeTable.'title_ap'); 247 $groups = array(); 248 $query = ' 249 select id,title 250 FROM ' . ADD_PAGES_TABLE . ' 251 ORDER BY id ASC;'; 252 $result = pwg_query($query); 253 254 while ($row = pwg_db_fetch_assoc($result)) 255 { 256 $groups[$row['id']] = $row['id'].' : '.$row['title']; 257 } 258 259 $selected = 0; 260 $options[] = l10n('Choose it page'); 261 $options['a'] = '----------------------'; 262 263 foreach($groups as $listid => $listid2) 264 { 265 $options[$listid] = $listid2; 266 } 267 $template->assign( 268 'gestionC', 269 array( 270 'OPTIONS' => $options, 271 'SELECTED' => $selected 272 )); 273 274 if (isset($_POST['submitchoixAP'])and is_numeric($_POST['APchoix']) and (!$_POST['APchoix'])==0) 275 { 276 $lire=$_POST['APchoix']; 277 $query = ' 278 select id,metaKeyap,metadesap 279 FROM ' . META_AP_TABLE . ' 280 WHERE id = \''.$lire.'\' 281 ;'; 282 $result = pwg_query($query); 283 $row = pwg_db_fetch_assoc($result); 284 $metaKeyapap=$row['metaKeyap']; 285 $metadesap=$row['metadesap']; 286 287 $query = ' 288 select id,title 289 FROM ' . ADD_PAGES_TABLE . ' 290 WHERE id = \''.$lire.'\' 291 ;'; 292 $result = pwg_query($query); 293 $row = pwg_db_fetch_assoc($result); 294 $idap=$row['id']; 295 $nameap=$row['title']; 296 297 $selected3 = 0; 298 299 $template->assign( 300 'ap_edit', 301 array( 302 'VALUE' => $idap, 303 'VALUEN' => $nameap, 304 'CONTENTMKAP' => $metaKeyapap, 305 'CONTENTMDAP' => $metadesap, 306 'SELECTED' => $selected3 307 )); 308 } 309 310 if (isset($_POST['submitinsapm'])) 311 { 312 $query = ' 313 DELETE 314 FROM ' . META_AP_TABLE . ' 315 WHERE id = \''.$_POST['invisible'].'\' 316 ;'; 317 $result = pwg_query($query); 318 $q = ' 319 INSERT INTO ' . $prefixeTable . 'meta_ap(id,metaKeyap,metadesap)VALUES ('.$_POST['invisible'].',"'.$_POST['inser'].'","'.$_POST['inser2'].'");'; 320 pwg_query($q); 321 } 322 323 break; 211 324 212 325 } -
extensions/meta/admin/admin.tpl
r22769 r24393 90 90 {/if} 91 91 {/if} 92 93 {if isset ($contactmetaT)} 94 <form method="post" > 95 <fieldset id="mainConf"> 96 {'Keywords of contact page to be completed'|@translate} :<br> 97 <input type="text" name="inser" value="{$contactmetaT.CMKEY}" size="110" maxlenght="110"> 98 <br> 99 <br> 100 {'Description of contact page to be completed'|@translate} :<br> 101 <input type="text" name="inser2" value="{$contactmetaT.CMDESC}" size="110" maxlenght="110"> 102 <br> 103 <br> 104 <p> 105 <input class="submit" type="submit" name="submitcm" value="{'Submit'|@translate}"> 106 <input class="submit" type="reset" name="reset" value="{'Reset'|@translate}"> 107 </p> 108 </form> 109 {/if} 110 111 {if isset ($gestionC)} 112 <div> 113 <form method="post" > 114 <fieldset> 115 <legend>{'Choose Additional Pages'|@translate}</legend> 116 {html_options name="APchoix" options=$gestionC.OPTIONS selected=$gestionC.SELECTED} 117 <br> 118 <br> 119 <div style="text-align:center;"> 120 <input class="submit" name="submitchoixAP" type="submit" value="{'Submit'|@translate}" /> 121 </div> 122 </fieldset> 123 </form> 124 </div> 125 {if isset ($ap_edit)} 126 <div> 127 <form method="post" > 128 <fieldset> 129 <legend>{'Add metadata for page'|@translate} {$ap_edit.VALUEN} (id : {$ap_edit.VALUE})</legend> 130 <input type="hidden" name="invisible" value="{$ap_edit.VALUE}"> 131 <br> 132 {'Keywords of Additional Pages to be completed'|@translate}<br> 133 <input type="text" name="inser" value="{$ap_edit.CONTENTMKAP}" size="110" maxlenght="110"> 134 <br> 135 <br> 136 {'Description of Additional Pages to be completed'|@translate}<br> 137 <input type="text" name="inser2" value="{$ap_edit.CONTENTMDAP}" size="110" maxlenght="110"> 138 <br> 139 <br> 140 <div style="text-align:center;"> 141 <input class="submit" name="submitinsapm" type="submit" value="{'Submit'|@translate}"/> 142 </div> 143 </fieldset> 144 </form> 145 </div> 146 {/if} 147 {/if} -
extensions/meta/language/en_UK/plugin.lang.php
r22769 r24393 42 42 $lang['List Personal Metadata'] = 'List Personal Metadata'; 43 43 44 //tab contactform meta 45 $lang['Contact page Metadata'] = 'Contact page Metadata'; 46 $lang['Keywords of contact page to be completed'] = 'Keywords of contact page to be completed'; 47 $lang['Description of contact page to be completed'] = 'Description of contact page to be completed'; 48 49 //tab Aditional page 50 $lang['Additional Pages Metadata'] = 'Additional Pages Metadata'; 51 $lang['Choose Additional Pages'] = 'Choose Additional Pages'; 52 $lang['Add metadata for page'] = 'Add metadata for page'; 53 $lang['Keywords of Additional Pages to be completed'] = 'Keywords of Additional Pages to be completed'; 54 $lang['Description of Additional Pages to be completed'] = 'Description of Additional Pages to be completed'; 44 55 ?> -
extensions/meta/language/fr_FR/plugin.lang.php
r23035 r24393 42 42 $lang['List Personal Metadata'] = 'Lister les Métadonnées Personnels'; 43 43 44 //tab contactform meta 45 $lang['Contact page Metadata'] = 'Métadonnées de la page contact'; 46 $lang['Keywords of contact page to be completed'] = 'Mots clés de la page contact à complèter'; 47 $lang['Description of contact page to be completed'] = 'Description de la page contact à complèter'; 48 49 //tab Aditional page 50 $lang['Additional Pages Metadata'] = 'Métadonnées des pages additionelles'; 51 $lang['Choose Additional Pages'] = 'Choisiser la page aditionnelle'; 52 $lang['Add metadata for page'] = 'Ajouter les Métadonnées de page'; 53 $lang['Keywords of Additional Pages to be completed'] = 'Mots clés de la page additionelle à complèter'; 54 $lang['Description of Additional Pages to be completed'] = 'Description de la page additionellet à complèter'; 55 44 56 45 57 ?> -
extensions/meta/main.inc.php
r22769 r24393 11 11 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 12 12 13 global $prefixeTable ;13 global $prefixeTable, $page; 14 14 15 15 define('meta_DIR' , basename(dirname(__FILE__))); … … 19 19 define('meta_cat_TABLE' , $prefixeTable . 'meta_cat'); 20 20 define('METAPERSO_TABLE', $prefixeTable.'metaperso'); 21 define('META_AP_TABLE', $prefixeTable.'meta_ap'); 21 22 22 23 // Plugin for admin … … 128 129 $template->append('metapersos', $items); 129 130 } 130 131 132 131 } 133 132 … … 135 134 $template->append('head_elements', $template->parse('PERSO_META', true)); 136 135 } 136 137 $MPC = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ContactForm';")); 138 if($MPC['state'] == 'active') 139 { 140 global $conf; 141 if (isset($page['section']) and $page['section'] == 'contact') 142 { 143 $metacontact = explode(',', $conf['contactmeta']); 144 $metakeyED=trigger_event('AP_render_content', $metacontact[0]); 145 $metadesED=trigger_event('AP_render_content', $metacontact[1]); 146 if (!empty($metakeyED)) 147 { 148 $template->append('related_tags', array('name' => $metakeyED)); 149 } 150 if (!empty($metadesED)) 151 { 152 $template->assign('PLUG_META', $metadesED); 153 } 154 } 155 } 156 157 $MAP = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'AdditionalPages';")); 158 if($MAP['state'] == 'active') 159 { 160 if ( !empty($page['additional_page']['id']) ) 161 {echo $page['additional_page']['id']; 162 $lire=$page['additional_page']['id']; 163 $query = ' 164 select id, metaKeyap, metadesap 165 FROM ' . META_AP_TABLE . ' 166 WHERE id = \''.$lire.'\' 167 ;'; 168 $result = pwg_query($query); 169 $row = pwg_db_fetch_assoc($result); 170 $metaKeyapap=$row['metaKeyap']; 171 $metadesapap=$row['metadesap']; 172 $metaKeyapapED=trigger_event('AP_render_content', $metaKeyapap); 173 $metadesapED=trigger_event('AP_render_content', $metadesapap); 174 } 175 if (isset($page['section']) and $page['section'] == 'additional_page') 176 { 177 if (!empty($metaKeyapapED)) 178 { 179 $template->append('related_tags', array('name' => $metaKeyapapED)); 180 } 181 if (!empty($metadesapED)) 182 { 183 $template->assign('PLUG_META', $metadesapED); 184 } 185 } 186 } 187 137 188 138 189 } … … 207 258 } 208 259 } 209 210 260 211 261 function set_meta_back() -
extensions/meta/maintain.inc.php
r22769 r24393 20 20 PRIMARY KEY (id))DEFAULT CHARSET=utf8;"; 21 21 $result = pwg_query($query); 22 22 23 if (empty($conf['contactmeta'])) 24 { 25 $query = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) VALUES ("contactmeta",",","contactmeta");'; 26 pwg_query($query); 27 } 28 29 if (!defined('META_AP_TABLE')) define('META_AP_TABLE', $prefixeTable.'meta_ap'); 30 $query = "CREATE TABLE IF NOT EXISTS ". META_AP_TABLE ." ( 31 id SMALLINT( 5 ) UNSIGNED NOT NULL , 32 metaKeyap VARCHAR( 255 ) NOT NULL , 33 metadesap VARCHAR( 255 ) NOT NULL , 34 PRIMARY KEY (id))DEFAULT CHARSET=utf8;"; 35 $result = pwg_query($query); 36 37 23 38 //Gestion MAJ2 24 39 $majm2='meta 2.1.0'; … … 124 139 function plugin_install() 125 140 { 126 global$prefixeTable;141 global $conf, $prefixeTable; 127 142 128 143 $q = 'CREATE TABLE ' . $prefixeTable . 'meta( … … 182 197 $query = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) VALUES ("'.$majm2.'",1,"MAJ meta");'; 183 198 pwg_query($query); 199 200 201 202 if (empty($conf['contactmeta'])) 203 { 204 $query = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) VALUES ("contactmeta",",","contactmeta");'; 205 pwg_query($query); 206 } 207 208 if (!defined('META_AP_TABLE')) define('META_AP_TABLE', $prefixeTable.'meta_ap'); 209 $query = "CREATE TABLE IF NOT EXISTS ". META_AP_TABLE ." ( 210 id SMALLINT( 5 ) UNSIGNED NOT NULL , 211 metaKeyap VARCHAR( 255 ) NOT NULL , 212 metadesap VARCHAR( 255 ) NOT NULL , 213 PRIMARY KEY (id))DEFAULT CHARSET=utf8;"; 214 $result = pwg_query($query); 215 216 217 184 218 } 185 219 … … 206 240 $q = 'DROP TABLE ' . $prefixeTable . 'meta_cat;'; 207 241 pwg_query($q); 242 243 $q = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE param="contactmeta" LIMIT 1;'; 244 pwg_query($q); 245 246 $q = 'DROP TABLE ' . $prefixeTable . 'meta_cat;'; 247 pwg_query($q); 208 248 } 209 249
Note: See TracChangeset
for help on using the changeset viewer.