Changeset 3494
- Timestamp:
- Jul 2, 2009, 1:38:55 PM (15 years ago)
- Location:
- extensions/adult_content
- Files:
-
- 8 added
- 2 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/adult_content/class.inc.php
r3331 r3494 24 24 { 25 25 global $lang; 26 //include(get_language_filepath('plugin.lang.php', $this->plugin_path));27 26 load_language('plugin.lang', $this->plugin_path); 28 27 } 29 /*30 function remove_code($tlp_handle, $str_begin, $str_end)31 {32 global $template;33 34 $template->loadfile($tlp_handle);35 36 $p_beg = strpos($template->uncompiled_code[$tlp_handle], $str_begin);37 $p_end = strpos($template->uncompiled_code[$tlp_handle], $str_end) + strlen($str_end);38 $s = substr($template->uncompiled_code[$tlp_handle], $p_beg, $p_end - $p_beg);39 40 $template->uncompiled_code[$tlp_handle] =41 substr_replace($template->uncompiled_code[$tlp_handle], '', $p_beg, $p_end - $p_beg);42 43 return $s;44 }45 46 function add_before_code($tlp_handle, $insert_before, $code)47 {48 global $template;49 50 $template->loadfile($tlp_handle);51 $template->uncompiled_code[$tlp_handle] = str_replace($insert_before, $code.$insert_before, $template->uncompiled_code[$tlp_handle]);52 }53 function add_after_code($tlp_handle, $insert_after, $code)54 {55 global $template;56 57 $template->loadfile($tlp_handle);58 $template->uncompiled_code[$tlp_handle] = str_replace($insert_after, $insert_after.$code, $template->uncompiled_code[$tlp_handle]);59 }*/60 28 function var_template() 61 29 { … … 70 38 } 71 39 return $r; 72 }73 function link_charte_user($etat)74 {75 global $user, $lang;76 include($this->var_template());77 if ($etat == 'not_defined')78 {79 /*$s = $this->remove_code('menubar',$begin_ident ,$end_ident);80 $this->add_before_code('menubar','<!-- BEGIN links -->',$s);81 $this->add_after_code('menubar','<!-- END hello -->82 <ul>','<a href="'.get_root_url().'plugins/'.$this->plugin_name.'/charte_user.php?etat='.$etat.'">{lang:ac_charte_user_not}</a>');*/83 }84 elseif ($etat == 'defined')85 {86 $query = '87 SELECT group_id FROM '.USER_GROUP_TABLE.'88 WHERE user_id IN (\''.$user['id'].'\')89 ;';90 $data_group = mysql_fetch_array(pwg_query($query));91 $query = '92 SELECT name FROM '.GROUPS_TABLE.'93 WHERE id IN (\''.$data_group['group_id'].'\')94 ;';95 $data_group_n = mysql_fetch_array(pwg_query($query));96 if ($data_group_n['name'] == '+18')97 {98 $statut = $lang['ac_user_text_18'];99 }100 if ($data_group_n['name'] == '16-17')101 {102 $statut = $lang['ac_user_text_16'];103 }104 if ($data_group_n['name'] == 'nothing')105 {106 $statut = $lang['ac_user_no_s'];107 }108 109 /*$this->add_after_code('menubar','<!-- END hello -->110 <ul>',''.$statut.' <a href="'.get_root_url().'plugins/'.$this->plugin_name.'/charte_user.php?etat='.$etat.'">{lang:ac_logout}</a>');*/111 }112 113 114 40 } 115 41 … … 145 71 if ( !isset( $_COOKIE['pwg_adult_content'] ) or $_COOKIE['pwg_adult_content'] == 'open' ) 146 72 { 147 //$this->add_before_code('menubar','<!-- BEGIN links -->', $msg_opened);148 73 $template->assign(array( 'LINK' => $this->get_link_icon(duplicate_index_url(), 'closed') )); 149 74 if (($block = $menu->get_block( 'mbAdultContent' )) != null) { … … 154 79 elseif ( $_COOKIE['pwg_adult_content'] == 'closed' ) 155 80 { 156 //$this->add_before_code('menubar','<!-- BEGIN links -->', $msg_closed);157 81 $template->assign(array( 'LINK' => $this->get_link_icon(duplicate_index_url(), 'open') )); 158 82 if (($block = $menu->get_block( 'mbAdultContent' )) != null) { … … 165 89 elseif ( $_GET['ad'] == 'closed' ) 166 90 { 167 //$this->add_before_code('menubar','<!-- BEGIN links -->', $msg_closed);168 91 $template->assign(array( 'LINK' => $this->get_link_icon(duplicate_index_url(), 'open') )); 169 92 setcookie( 'pwg_adult_content', 'closed', time()+60*60*24*30, cookie_path() ); … … 175 98 elseif ( $_GET['ad'] == 'open' ) 176 99 { 177 //$this->add_before_code('menubar','<!-- BEGIN links -->', $msg_opened);178 100 $template->assign(array( 'LINK' => $this->get_link_icon(duplicate_index_url(), 'closed') )); 179 101 if (($block = $menu->get_block( 'mbAdultContent' )) != null) { … … 188 110 elseif ($user['username'] == '18') 189 111 { 190 $this->remove_code('menubar', '<dl id="mbIdentification">', '<!-- END quickconnect --> 191 192 </dd> 193 </dl>'); 194 195 $this->add_before_code('menubar','<!-- BEGIN tags -->',$msg_18); 112 $menu->hide_block('mbIdentification'); 113 $template->assign( 114 array( 115 'AC_MSG' => l10n('ac_user_text_18') 116 )); 117 if (($block = $menu->get_block( 'mbAdultContent' )) != null) { 118 $block->set_title(l10n('ac_title_menu')); 119 $block->template = $this->plugin_path.'template/'.$user['template'].'/msg.tpl'; 120 } 196 121 197 122 $_SESSION['age']="18"; … … 201 126 elseif ($user['username'] == '16') 202 127 { 203 $this->remove_code('menubar', '<dl id="mbIdentification">', '<!-- END quickconnect --> 204 205 </dd> 206 </dl>'); 207 208 $this->add_before_code('menubar','<!-- BEGIN tags -->',$msg_16); 128 $menu->hide_block('mbIdentification'); 129 $template->assign( 130 array( 131 'AC_MSG' => l10n('ac_user_text_16') 132 )); 133 if (($block = $menu->get_block( 'mbAdultContent' )) != null) { 134 $block->set_title(l10n('ac_title_menu')); 135 $block->template = $this->plugin_path.'template/'.$user['template'].'/msg.tpl'; 136 } 209 137 210 138 }//fin if 16-17 ans … … 237 165 if ( $is_grouped == 0 ) 238 166 { 239 $this->link_charte_user('not_defined'); 167 $template->assign( 168 array( 169 'AC_ETAT' => 'not_defined', 170 'AC_MSG' => l10n('ac_charte_user_not') 171 )); 172 $menu = & $menu_ref_arr[0]; 173 $block = $menu->get_block( 'mbAdultContent' ); 174 $block->set_title(l10n('ac_title_choose')); 175 $block->template = $this->plugin_path.'template/'.$user['template'].'/choose.tpl'; 176 240 177 } 241 178 else 242 179 { 243 $this->link_charte_user('defined'); 180 $query = ' 181 SELECT group_id FROM '.USER_GROUP_TABLE.' 182 WHERE user_id IN (\''.$user['id'].'\') 183 ;'; 184 $data_group = mysql_fetch_array(pwg_query($query)); 185 $query = ' 186 SELECT name FROM '.GROUPS_TABLE.' 187 WHERE id IN (\''.$data_group['group_id'].'\') 188 ;'; 189 $data_group_n = mysql_fetch_array(pwg_query($query)); 190 if ($data_group_n['name'] == '+18') 191 { 192 $statut = l10n('ac_user_text_18'); 193 } 194 if ($data_group_n['name'] == '16-17') 195 { 196 $statut = l10n('ac_user_text_16'); 197 } 198 if ($data_group_n['name'] == 'nothing') 199 { 200 $statut = l10n('ac_user_no_s'); 201 } 202 $template->assign( 203 array( 204 'AC_ETAT' => 'defined', 205 'AC_MSG' => $statut.". ".l10n('ac_charte_user_def') 206 )); 207 $menu = & $menu_ref_arr[0]; 208 $block = $menu->get_block( 'mbAdultContent' ); 209 $block->set_title(l10n('ac_title_menu_statut')); 210 $block->template = $this->plugin_path.'template/'.$user['template'].'/choose.tpl'; 211 244 212 } 245 213 } -
extensions/adult_content/include
-
Property
svn:ignore
set to
_notes
-
Property
svn:ignore
set to
-
extensions/adult_content/include/charte.css
r3331 r3494 6 6 { 7 7 padding:1em; 8 text-align:center; 8 9 } 10 #content form { 11 text-align:left; 12 } -
extensions/adult_content/include/charte.tpl
r3331 r3494 1 {html_head}<link rel="stylesheet" type="text/css" href="{$ pwg_root}plugins/{$PLUGIN_NAME}/include/charte.css">{/html_head}1 {html_head}<link rel="stylesheet" type="text/css" href="{$ROOT_URL}plugins/{$PLUGIN_NAME}/include/charte.css">{/html_head} 2 2 <div id="content"> 3 3 <div class="titrePage"> … … 9 9 10 10 <fieldset> 11 <form method="post" action="{$ pwg_root}identification.php" >11 <form method="post" action="{$ROOT_URL}identification.php" > 12 12 <input type="hidden" name="username" size="15" value="18"/> 13 13 <input type="hidden" name="password" size="15" value="adult_content"/> … … 18 18 </fieldset> 19 19 <fieldset> 20 <form method="post" action="{$ pwg_root}identification.php" id="quickconnect">20 <form method="post" action="{$ROOT_URL}identification.php" id="quickconnect"> 21 21 <input type="hidden" name="username" size="15" value="16"/> 22 22 <input type="hidden" name="password" size="15" value="adult_content"/> -
extensions/adult_content/include/charte_user.tpl
r3331 r3494 1 <link rel="stylesheet" type="text/css" href="{$pwg_root}plugins/{$PLUGIN_NAME}/include/charte.css"> 1 {html_head}<link rel="stylesheet" type="text/css" href="{$ROOT_URL}plugins/{$PLUGIN_NAME}/include/charte.css">{/html_head} 2 2 3 3 <div id="content"> 4 4 <div class="titrePage"> 5 5 <ul class="categoryActions"> 6 <li><a href="{$U_HOME}" title="{'return to homepage'|@translate}"><img src="{$ themeconf.icon_dir}/home.png" class="button" alt="{'home'|@translate}"/></a></li>6 <li><a href="{$U_HOME}" title="{'return to homepage'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/home.png" class="button" alt="{'home'|@translate}"/></a></li> 7 7 </ul> 8 8 <h2>Adult content config</h2> -
extensions/adult_content/language
-
Property
svn:ignore
set to
_notes
-
Property
svn:ignore
set to
-
extensions/adult_content/language/en_UK
-
Property
svn:ignore
set to
_notes
-
Property
svn:ignore
set to
-
extensions/adult_content/language/fr_FR
-
Property
svn:ignore
set to
_notes
-
Property
svn:ignore
set to
-
extensions/adult_content/language/fr_FR/plugin.lang.php
r3331 r3494 1 1 <?php 2 2 $lang['ac_title_menu'] = 'Attention'; 3 $lang['ac_title_menu_statut'] ='Information'; 3 4 $lang['ac_text'] = 'Cette galerie contient des images s\'addressant à des personnes matures et/ou majeurs'; 4 5 $lang['ac_lien'] = 'enlever la protection'; -
extensions/adult_content/main.inc.php
r3331 r3494 24 24 25 25 // Ajout une entrée dans le menubar 26 add_event_handler('blockmanager_register_blocks', array(&$adult_content, 'register_ac_menubar_blocks')); 26 27 add_event_handler('blockmanager_apply', array(&$adult_content, 'placer_identification')); 27 add_event_handler('blockmanager_register_blocks', array(&$adult_content, 'register_ac_menubar_blocks'));28 28 29 29
Note: See TracChangeset
for help on using the changeset viewer.