Changeset 88 for trunk/wp-content/plugins/xpressme/xpressme_class.php
- Timestamp:
- Feb 4, 2009, 5:58:57 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/plugins/xpressme/xpressme_class.php
r81 r88 13 13 var $newer_post_link_text; 14 14 var $is_author_view_count; 15 var $ groupe_role_serial;15 var $is_sql_debug; 16 16 var $groupe_role; 17 17 … … 48 48 $this->newer_post_link_text = __('to Newer Post', 'xpressme'); 49 49 $this->is_author_view_count = false; 50 $this->is_sql_debug = false; 50 51 } 51 52 … … 77 78 'old_post_link_text' => $this->old_post_link_text , 78 79 'newer_post_link_text' => $this->newer_post_link_text, 79 'is_author_view_count' => $this->is_author_view_count 80 'is_author_view_count' => $this->is_author_view_count, 81 'is_sql_debug' => $this->is_sql_debug 80 82 ); 81 83 if ($mode == 'add_new') { … … 141 143 if(empty($this->newer_post_link_text)) $this->newer_post_link_text = __('to Newer Post', 'xpressme'); 142 144 $this->is_author_view_count = stripslashes(trim($_POST['ch_is_author_view_count'])); 145 $this->is_sql_debug = stripslashes(trim($_POST['ch_is_sql_debug'])); 143 146 144 147 global $xoops_db; … … 307 310 __('NO','xpressme') 308 311 ); 312 echo $this->yes_no_radio_option('is_sql_debug', 313 __('Is SQL debugging window displayed?','xpressme'), 314 __('YES','xpressme'), 315 __('NO','xpressme') 316 ); 317 309 318 echo $this->groupe_role_option(); 310 319 // $this->is_use_xoops_upload_path_html(); … … 339 348 } 340 349 return $uploads; 350 } 351 352 // SQL DEBUG TEST 353 function is_sql_debug_permission() 354 { 355 global $current_user; 356 357 if ($this->is_sql_debug && ($current_user->user_level >= 10)) 358 return true; 359 else 360 return false; 361 } 362 363 function xpress_sql_debug($query_strings) 364 { 365 if ($this->is_sql_debug_permission()){ 366 if (empty($GLOBALS['XPress_SQL_Query'])) $GLOBALS['XPress_SQL_Query'] = ''; 367 $GLOBALS['XPress_SQL_Query'] .= $query_strings . '<br />'; 368 } 369 return $query_strings; 370 } 371 372 function displayDebugLog() 373 { 374 if ($this->is_sql_debug_permission()){ 375 $content = ''; 376 $content .= '<html><head><meta http-equiv="content-type" content="text/html; charset='._CHARSET.'" />'; 377 $content .= '<meta http-equiv="content-language" content="'._LANGCODE.'" />' ; 378 $content .= '<title>XPressME SQL DEBUG</title>' ; 379 $content .= '<link rel="stylesheet" type="text/css" media="all" href="'.getcss($GLOBALS['xoopsConfig']['theme_set']).'" />'; 380 $content .= '</head><body>'; 381 $content .= $GLOBALS['XPress_SQL_Query']; 382 $content .= '<div style="text-align:center;"><input class="formButton" value="CLOSE" type="button" onclick="javascript:window.close();" /></div></body></html>'; 383 384 echo '<script type="text/javascript"> 385 <!--// 386 xpress_debug_window = window.open("", "xpress_debug", "width=680 , height=600 ,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no"); 387 xpress_debug_window.document.clear(); 388 xpress_debug_window.focus(); 389 '; 390 $lines = preg_split("/(\r\n|\r|\n)( *)/", $content); 391 foreach ($lines as $line) { 392 echo 'xpress_debug_window.document.writeln("'.str_replace('"', '\"', $line).'");'; 393 } 394 echo ' 395 xpress_debug_window.document.close(); 396 //--> 397 </script>'; 398 } 341 399 } 342 400
Note: See TracChangeset
for help on using the changeset viewer.