Changeset 9530 for extensions/adult_content
- Timestamp:
- Mar 4, 2011, 5:57:52 PM (13 years ago)
- Location:
- extensions/adult_content
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/adult_content/admin/admin.php
r4078 r9530 7 7 global $prefixeTable; 8 8 load_language('plugin.lang', $ad_c->plugin_path); 9 $conf_ad_c = explode("," , $conf['ad_c_plugin']); 10 9 11 10 12 $page['infos'] = array(); 11 13 14 if (isset($_POST['option_ad_c'])) 15 { 16 $newconf_plugin = array( 17 $_POST['menublock_for_guest'], 18 $_POST['block_on_index'], 19 ); 20 $newconf_plugin = implode ("," , $newconf_plugin); 21 $query = ' 22 UPDATE '.CONFIG_TABLE.' 23 SET value="'.$newconf_plugin.'" 24 WHERE param="ad_c_plugin" 25 LIMIT 1'; 26 pwg_query($query); 27 28 array_push($page['infos'], l10n('ad_c_msg_admin_1')); 29 } 12 30 31 load_conf_from_db(); 32 $conf_ad_c = explode("," , $conf['ad_c_plugin']); 33 34 $check='checked="checked"'; 35 if ($conf_ad_c[0]=='true') { $menublock=$check; } else { $menublock=NULL; } 36 if ($conf_ad_c[1]=='true') { $index=$check; } else { $index=NULL; } 37 $disabled='disabled="disabled"'; 38 $template->assign( 39 array( 40 'AD_C_menublock_for_guest' => $menublock, 41 'AD_C_block_on_index' => $index, 42 'AD_C_block_on_index_disabled' => $disabled, 43 ) 44 ); 45 46 $template->set_filename('plugin_admin_content', $ad_c->plugin_path.'admin/admin.tpl'); 47 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 13 48 ?> -
extensions/adult_content/charte_user.php
r6984 r9530 17 17 )); 18 18 19 if ( $_GET['etat'] == 'not_defined')19 if (isset($_GET['etat']) and $_GET['etat'] == 'not_defined') 20 20 { 21 21 $template->assign( … … 27 27 ); 28 28 } 29 elseif ( $_GET['etat'] == 'defined')29 elseif (isset($_GET['etat']) and $_GET['etat'] == 'defined') 30 30 { 31 31 $query = ' -
extensions/adult_content/class.inc.php
r6940 r9530 124 124 ///////////////////////[début du plug]//////////////////// 125 125 $this->loading_lang(); 126 global $user, $conf, $page; 127 global $template; 128 126 global $user, $conf, $page, $template; 129 127 $menu = & $menu_ref_arr[0]; 130 131 $template->assign(132 133 134 128 $conf_plugin = explode("," , $conf['ad_c_plugin']); 129 $template->assign( 130 array( 131 'AC_NAME' => AC_NAME 132 )); 135 133 136 134 137 135 //include($this->var_template()); 138 if (is_a_guest() )136 if (is_a_guest() and $conf_plugin[0]=='true') 139 137 { 140 138 … … 181 179 ///////////////////////[FIN fermer/ouvert]//////////////////// 182 180 }//fin if guest 181 elseif (is_a_guest() and $conf_plugin[0]!='true') 182 { 183 $menu->hide_block('mbAdultContent'); 184 } 183 185 elseif ($user['username'] == '18') 184 186 { … … 244 246 )); 245 247 $menu = & $menu_ref_arr[0]; 246 $block = $menu->get_block( 'mbAdultContent' ); 247 $block->set_title(l10n('ac_title_choose')); 248 $block->template = $this->get_template('choose.tpl'); 248 if (($block = $menu->get_block( 'mbAdultContent' )) != null) { 249 $block->set_title(l10n('ac_title_choose')); 250 $block->template = $this->get_template('choose.tpl'); 251 } 249 252 250 253 } … … 279 282 )); 280 283 $menu = & $menu_ref_arr[0]; 281 $block = $menu->get_block( 'mbAdultContent' ); 282 $block->set_title(l10n('ac_title_menu_statut')); 283 $block->template = $this->get_template('choose.tpl'); 284 if (($block = $menu->get_block( 'mbAdultContent' )) != null) { 285 $block->set_title(l10n('ac_title_menu_statut')); 286 $block->template = $this->get_template('choose.tpl'); 287 } 284 288 285 289 } -
extensions/adult_content/language/fr_FR/plugin.lang.php
r6984 r9530 38 38 $lang['ac_def'] = 'Voulez-vous changez votre statut ?'; 39 39 40 $lang['ad_c_menublock_for_guest'] = 'Permettre aux visiteurs non-enregistrés de sélectionner leur âge ?'; 41 $lang['ad_c_block_on_index'] = 'Afficher un encart sur la page d\'accueil ? (Nécessite le plugin PWG Stuffs)'; 42 //$lang['ad_c_block_on_index_error'] = 'PWG Stuffs dans une version supérieure à 2.1.l est nécessaire'; 43 $lang['ad_c_block_on_index_error'] = 'fonction non disponible pour l\'instant'; 44 $lang['ad_c_send'] = 'Enregistrer les changements'; 45 $lang['ad_c_msg_admin_1'] = 'Configuration du plugin mise à jour avec succès !'; 46 47 40 48 ?> -
extensions/adult_content/main.inc.php
r7269 r9530 21 21 22 22 include_once(dirname(__FILE__).'/class.inc.php'); 23 //add_event_handler('get_admin_plugin_menu_links', array(&$adult_content, 'ac_lien_menu') );23 add_event_handler('get_admin_plugin_menu_links', array(&$adult_content, 'ac_lien_menu') ); 24 24 add_event_handler('register_user', array(&$adult_content, 'on_register') ); 25 25 // Ajout une entrée dans le menubar … … 27 27 add_event_handler('blockmanager_apply', array(&$adult_content, 'placer_identification')); 28 28 //block on index 29 //add_event_handler('loc_begin_index', array(&$adult_content, 'set_block_on_index'));30 29 30 /* 31 global $conf; 32 add_event_handler('loc_begin_index', array(&$adult_content, 'set_block_on_index')); 33 */ 31 34 32 35 add_event_handler('loc_end_picture', 'comment_manage'); -
extensions/adult_content/maintain.inc.php
r6922 r9530 41 41 $data_group = mysql_fetch_array($result); 42 42 pwg_query('INSERT INTO '.USER_GROUP_TABLE.' VALUES(\''.get_userid('18').'\', \''.$data_group['id'].'\' )' ); 43 44 /////////////Config plugin 45 $q = ' 46 INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) 47 VALUES 48 ("ad_c_plugin" , "true,false" , "Plugin adult_content : menublock_for_guest, block_on_index");'; 49 pwg_query($q); 43 50 44 51 } … … 181 188 pwg_query($query); 182 189 190 //////////// Check Config 191 $query = ' 192 SELECT COUNT(*) AS result FROM '.CONFIG_TABLE.' 193 WHERE param IN (\'ad_c_plugin\') 194 ;'; 195 $data_table = mysql_fetch_array(pwg_query($query)); 196 $exist = $data_table['result']; 197 if ( $exist == 0 ) 198 { 199 $q = ' 200 INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) 201 VALUES 202 ("ad_c_plugin" , "true,false" , "Plugin adult_content : menublock_for_guest, block_on_index");'; 203 pwg_query($q); 204 } 205 else { 206 $query = ' 207 SELECT value FROM '.CONFIG_TABLE.' 208 WHERE param IN (\'ad_c_plugin\') 209 ;'; 210 $data_conf = mysql_fetch_array(pwg_query($query)); 211 $conf=explode(',', $data_conf['value']); 212 $nbr=count($conf); 213 214 if ($nbr!=2) 215 { 216 pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param IN (\'ad_c_plugin\')'); 217 pwg_query($q); 218 $q = ' 219 INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) 220 VALUES 221 ("ad_c_plugin" , "true,false" , "Plugin adult_content : menublock_for_guest, block_on_index");'; 222 pwg_query($q); 223 } 224 } 225 183 226 }//fin active 184 227 … … 236 279 pwg_query($query); 237 280 281 //////////////// Delete config 282 pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param IN (\'ad_c_plugin\')'); 238 283 }//fin uninstall 239 284
Note: See TracChangeset
for help on using the changeset viewer.