- Timestamp:
- Mar 31, 2009, 7:00:25 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/plugins/xpressme/include/xpress_common_functions.php
r141 r145 154 154 } 155 155 } 156 function is_wordpress_style() 157 { 158 global $xpress_config; 159 160 if ($xpress_config->viewer_type == 'wordpress') return true; 161 if ($xpress_config->viewer_type == 'xoops') return false; 162 163 // user select 164 $get_style = isset($_GET["style"]) ? $_GET["style"] : ''; 165 $cookie_style = isset($_COOKIE["xpress_style"]) ? $_COOKIE["xpress_style"] : ''; 166 167 // set style 168 if (!empty($get_style)){ 169 $style = $get_style; 170 } else { 171 if (!empty($cookie_style)){ 172 $style = $cookie_style; 173 } else { 174 $style = 'x'; 175 } 176 } 177 178 // set cookie 179 if (empty($cookie_style)){ 180 setcookie("xpress_style", $style); 181 $_COOKIE["xpress_style"] = $style; 182 } else { 183 if ($style != $cookie_style) { 184 setcookie("xpress_style", $style); 185 $_COOKIE["xpress_style"] = $style; 186 } 187 } 188 if ($style == 'w') { 189 return true; 190 } else { 191 return false; 192 } 193 } 194 195 function wp_meta_add_xpress_menu() 196 { 197 global $xpress_config; 198 if ($xpress_config->viewer_type == 'user_select'){ 199 echo disp_mode_set(); 200 } 201 if (function_exists('wp_theme_switcher') ) { 202 echo '<li>' . __('Themes') . ':'; 203 wp_theme_switcher('dropdown'); 204 echo '</li>'; 205 } 206 } 207 208 function disp_mode_set(){ 209 global $xpress_config; 210 211 $select =""; 212 if ($xpress_config->viewer_type == 'user_select'){ 213 $style = isset($_GET["style"]) ? $_GET["style"] : (isset($_COOKIE["xpress_style"]) ? $_COOKIE["xpress_style"] : ""); 214 215 switch($style) { 216 case 'w': 217 $select ='<li><a href="'.get_settings('siteurl').'/?style=x" title="'. __('Switch to XOOPS mode','xpressme').'">'.__('Switch to XOOPS mode','xpressme').'</a></li>'; 218 // $select.='<img src="'. get_settings('siteurl').'/images/external.png" alt="'.__('Switch to XOOPS mode','xpressme') . '"></a></li>'; 219 break; 220 case 'x': 221 $select='<li><a href="'.get_settings('siteurl').'/?style=w" title="'.__('Switch to WordPress mode','xpressme').'">'.__('Switch to WordPress mode','xpressme').'</a></li>'; 222 break; 223 default: 224 $select='<li><a href="'.get_settings('siteurl').'/?style=w" title="'.__('Switch to WordPress mode','xpressme').'">'.__('Switch to WordPress mode','xpressme').'</a></li>'; 225 break; 226 } 227 } 228 return $select; 229 } 230 231 156 232 ?>
Note: See TracChangeset
for help on using the changeset viewer.