Changeset 160 for trunk/admin
- Timestamp:
- Apr 7, 2009, 5:29:54 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/index.php
r159 r160 29 29 // ------------------------------------------------------------------------- // 30 30 //include_once 'cp_functions.php'; 31 function get_xpress_plugin_data( $plugin_file, $markup = true, $translate = true ) { 32 // We don't need to write to the file, so just open for reading. 33 $fp = fopen($plugin_file, 'r'); 34 35 // Pull only the first 8kiB of the file in. 36 $plugin_data = fread( $fp, 8192 ); 37 38 // PHP will close file handle, but we are good citizens. 39 fclose($fp); 40 41 preg_match( '|Plugin Name:(.*)$|mi', $plugin_data, $name ); 42 preg_match( '|Plugin URI:(.*)$|mi', $plugin_data, $uri ); 43 preg_match( '|Version:(.*)|i', $plugin_data, $version ); 44 preg_match( '|Description:(.*)$|mi', $plugin_data, $description ); 45 preg_match( '|Author:(.*)$|mi', $plugin_data, $author_name ); 46 preg_match( '|Author URI:(.*)$|mi', $plugin_data, $author_uri ); 47 preg_match( '|Text Domain:(.*)$|mi', $plugin_data, $text_domain ); 48 preg_match( '|Domain Path:(.*)$|mi', $plugin_data, $domain_path ); 49 50 foreach ( array( 'name', 'uri', 'version', 'description', 'author_name', 'author_uri', 'text_domain', 'domain_path' ) as $field ) { 51 if ( !empty( ${$field} ) ) 52 ${$field} = trim(${$field}[1]); 53 else 54 ${$field} = ''; 55 } 56 57 $plugin_data = array( 58 'Name' => $name, 'Title' => $name, 'PluginURI' => $uri, 'Description' => $description, 59 'Author' => $author_name, 'AuthorURI' => $author_uri, 'Version' => $version, 60 'TextDomain' => $text_domain, 'DomainPath' => $domain_path 61 ); 62 // if ( $markup || $translate ) 63 // $plugin_data = _get_plugin_data_markup_translate($plugin_data, $markup, $translate); 64 return $plugin_data; 65 } 66 67 68 function get_xpress_active_plugin_list($before_str = '') 69 { 70 global $xoopsModule; 71 $xoopsDB =& Database::getInstance(); 72 73 $mydirname = basename(dirname(dirname(__FILE__))); 74 $my_dirpath = dirname(dirname(__FILE__)); 75 $prefix = $mydirname; 76 if ($prefix == 'wordpress') $prefix ='wp'; 77 $wp_prefix = $xoopsDB->prefix($prefix); 78 79 $option_table = $wp_prefix . '_options'; 80 81 $sql = "SELECT option_value FROM $option_table WHERE option_name = 'active_plugins'"; 82 $res = $xoopsDB->query($sql, 0, 0); 83 if ($res === false){ 84 return ; 85 } else { 86 $row = $xoopsDB->fetchArray($res); 87 $active_plugins = @unserialize($row['option_value']); 88 $output = ''; 89 foreach($active_plugins as $active_plugin_path){ 90 $file_name = $my_dirpath . '/wp-content/plugins/' . $active_plugin_path; 91 $active_plugin = get_xpress_plugin_data($file_name); 92 $output .= $before_str . $active_plugin['Name'] . ': Version ' . $active_plugin['Version'] . ': (' .$active_plugin['PluginURI'] . ')<br />'; 93 } 94 95 96 return $output; 97 } 98 99 100 } 101 102 function xpress_active_plugin_list($is_report = false) 103 { 104 if ($is_report) { 105 echo "******** " . _AM_XPRESS_PLUGIN . "********" . "<br />\n"; 106 echo get_xpress_active_plugin_list(' ') . "<br />\n"; 107 } else { 108 echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XPRESS_PLUGIN . "</legend>"; 109 echo "<div style='padding: 8px;'>"; 110 echo get_xpress_active_plugin_list(); 111 echo "</div>"; 112 echo "</fieldset>"; 113 } 114 } 115 116 function xpress_sys_info($is_report = false) 117 { 118 global $xoopsModule; 119 include(dirname(__FILE__) . '/../wp-includes/version.php'); 120 121 if ($is_report) { 122 echo "******** " . _AM_SYSTEM_INFO . "********" . "<br />\n"; 123 echo ' ' . "SERVER: ". $_SERVER['SERVER_SOFTWARE']. "<br />\n"; 124 echo ' ' . "PHP Version: " . phpversion() . "<br />\n"; 125 echo ' ' . "MySQL Version: " . mysql_get_server_info() . "</text><br />"; 126 echo ' ' . "XOOPS Version: " . XOOPS_VERSION . "</text><br />"; 127 echo ' ' . "XPressME Version: " . $xoopsModule->getInfo('version') . ' ' . $xoopsModule->getInfo('codename') . "<br />\n"; 128 echo ' ' . "WordPress Version: " . $wp_version . "<br />\n"; 129 echo ' ' . "WP DB Version: " . $wp_db_version . "<br />\n"; 130 echo "<br />\n"; 131 echo ' ' . "safemode: " ; 132 echo ( ini_get( 'safe_mode' ) ) ? "ON" : "OFF"; 133 echo "<br />\n"; 134 echo ' ' . "register_globals: " ; 135 echo ( ini_get( 'register_globals' )) ? "ON" : "OFF" ; 136 echo "<br />\n"; 137 echo ' ' . "magic_quotes_gpc: " ; 138 echo ( ini_get( 'magic_quotes_gpc' )) ? "ON" : "OFF"; 139 echo "<br />\n"; 140 echo ' ' . "XML extension: " ; 141 echo ( extension_loaded( 'xml' )) ? "ON" : "OFF"; 142 echo "<br />\n"; 143 echo ' ' . "memory_limit: " ; 144 echo ini_get( 'memory_limit' ); 145 echo "<br />\n"; 146 echo ' ' . "post_max_size: " ; 147 echo ini_get( 'post_max_size' ); 148 echo "<br />\n"; 149 echo ' ' . "upload_max_filesize: " ; 150 echo ini_get( 'upload_max_filesize' ); 151 echo "<br />\n"; 152 echo ' ' . "display_errors: " ; 153 echo ( ini_get( 'display_errors' )) ? "ON" : "OFF"; 154 echo "<br />\n"; 155 echo ' ' . "MB extension: " ; 156 echo ( extension_loaded( 'mbstring' )) ? "ON" : "OFF"; 157 echo "<br />\n"; 158 echo ' ' . "mbstring.language: " ; 159 echo ini_get( 'mbstring.language' ); 160 echo "<br />\n"; 161 echo ' ' . "mbstring.encoding_translation: " ; 162 echo ( ini_get( 'mbstring.encoding_translation' )) ? "ON" : "OFF"; 163 echo "<br />\n"; 164 echo ' ' . "mbstring.internal_encoding: " ; 165 echo ini_get( 'mbstring.internal_encoding' ); 166 echo "<br />\n"; 167 echo ' ' . "mbstring.http_input: " ; 168 echo ini_get( 'mbstring.http_input' ); 169 echo "<br />\n"; 170 echo ' ' . "mbstring.http_output: " ; 171 echo ini_get( 'mbstring.http_output' ); 172 echo "<br />\n"; 173 echo ' ' . "mbstring.detect_order: " ; 174 echo ini_get( 'mbstring.detect_order' ); 175 echo "<br />\n"; 176 echo ' ' . "mbstring.substitute_character: " ; 177 echo ini_get( 'mbstring.substitute_character' ); 178 echo "<br />\n"; 179 echo ' ' . "mbstring.func_overload: " ; 180 echo ( ini_get( 'mbstring.func_overload' )) ? "ON" : "OFF"; 181 echo "<br />\n"; 182 echo "<br />\n"; 183 } else { 184 echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_SYSTEM_INFO . "</legend>"; 185 echo "<div style='padding: 8px;'>"; 186 echo "<label>" . "<strong>SERVER:</strong>" . ":</label><text>" . $_SERVER['SERVER_SOFTWARE'] . "</text><br />"; 187 echo "<label>" . "<strong>PHP Version:</strong>" . ":</label><text>" . phpversion() . "</text><br />"; 188 echo "<label>" . "<strong>MySQL Version:</strong>" . ":</label><text>" . mysql_get_server_info() . "</text><br />"; 189 echo "<label>" . "<strong>XOOPS Version:</strong>" . ":</label><text>" . XOOPS_VERSION . "</text><br />"; 190 echo "<label>" . "<strong>XPressME Version:</strong>" . ":</label><text>" . $xoopsModule->getInfo('version') . ' ' . $xoopsModule->getInfo('codename') . "</text><br />"; 191 echo "<label>" . "<strong>WordPress Version:</strong>" . ":</label><text>" . $wp_version . "</text><br />"; 192 echo "<label>" . "<strong>WP DB Version:</strong>" . ":</label><text>" . $wp_db_version . "</text><br />"; 193 194 echo "</div>"; 195 echo "<div style='padding: 8px;'>"; 196 echo "<label>safemode:</label><text>"; 197 echo ( ini_get( 'safe_mode' ) ) ? "ON" : "OFF"; 198 echo "</text><br />"; 199 echo "<label>register_globals:</label><text>"; 200 echo ( ini_get( 'register_globals' )) ? "ON" : "OFF"; 201 echo "</text><br />"; 202 echo "<label>magic_quotes_gpc:</label><text>"; 203 echo ( ini_get( 'magic_quotes_gpc' )) ? "ON" : "OFF"; 204 echo "</text><br />"; 205 echo "<label>XML extension:</label><text>"; 206 echo ( extension_loaded( 'xml' )) ? "ON" : "OFF"; 207 echo "</text><br />"; 208 echo "<label>memory_limit:</label><text>"; 209 echo ini_get( 'memory_limit' ); 210 echo "</text><br />"; 211 echo "<label>post_max_size:</label><text>"; 212 echo ini_get( 'post_max_size' ); 213 echo "</text><br />"; 214 echo "<label>upload_max_filesize:</label><text>"; 215 echo ini_get( 'upload_max_filesize' ); 216 echo "</text><br />"; 217 echo "<label>display_errors:</label><text>"; 218 echo ( ini_get( 'display_errors' )) ? "ON" : "OFF"; 219 echo "</text><br />"; 220 echo "<label>MB extension:</label><text>"; 221 echo ( extension_loaded( 'mbstring' )) ? "ON" : "OFF"; 222 echo "</text><br />"; 223 echo "<label>mbstring.language:</label><text>"; 224 echo ini_get( 'mbstring.language' ); 225 echo "</text><br />"; 226 echo "<label>mbstring.encoding_translation:</label><text>"; 227 echo ( ini_get( 'mbstring.encoding_translation' )) ? "ON" : "OFF"; 228 echo "</text><br />"; 229 echo "<label>mbstring.internal_encoding:</label><text>"; 230 echo ini_get( 'mbstring.internal_encoding' ); 231 echo "</text><br />"; 232 echo "<label>mbstring.http_input:</label><text>"; 233 echo ini_get( 'mbstring.http_input' ); 234 echo "</text><br />"; 235 echo "<label>mbstring.http_output:</label><text>"; 236 echo ini_get( 'mbstring.http_output' ); 237 echo "</text><br />"; 238 echo "<label>mbstring.detect_order:</label><text>"; 239 echo ini_get( 'mbstring.detect_order' ); 240 echo "</text><br />"; 241 echo "<label>mbstring.substitute_character:</label><text>"; 242 echo ini_get( 'mbstring.substitute_character' ); 243 echo "</text><br />"; 244 echo "<label>mbstring.func_overload:</label><text>"; 245 echo ( ini_get( 'mbstring.func_overload' )) ? "ON" : "OFF"; 246 echo "</text><br />"; 247 echo "</div>"; 248 echo "</fieldset><br />"; 249 } 250 } 251 252 function xpress_config_from_xoops_view($is_report = false) 253 { 254 require_once dirname(dirname( __FILE__ )).'/class/config_from_xoops.class.php' ; 255 $xoops_config = new ConfigFromXoops; 256 if ($is_report) { 257 echo "******** " . _AM_XOOPS_CONFIG_INFO . "********" . "<br />\n"; 258 echo ' ' . 'XOOPS_ROOT_PATH: ' ; 259 if(XOOPS_ROOT_PATH !== $xoops_config->xoops_root_path) 260 echo 'ERROR '; 261 else 262 echo 'OK '; 263 echo "<br />\n"; 264 265 echo ' ' . 'XOOPS_TRUST_PATH: ' ; 266 if(XOOPS_TRUST_PATH !== $xoops_config->xoops_trust_path) 267 echo 'ERROR '; 268 else 269 echo 'OK '; 270 echo "<br />\n"; 271 272 echo ' ' . 'XOOPS_URL: ' ; 273 if(XOOPS_URL !== $xoops_config->xoops_url) 274 echo 'ERROR '; 275 else 276 echo 'OK '; 277 echo "<br />\n"; 278 279 if (defined('XOOPS_SALT')){ 280 echo ' ' . 'XOOPS_SALT: ' ; 281 if(XOOPS_SALT !== $xoops_config->xoops_salt) 282 echo 'ERROR '; 283 else 284 echo 'OK '; 285 echo "<br />\n"; 286 } 287 288 if (defined('XOOPS_DB_SALT')){ 289 echo ' ' . 'XOOPS_DB_SALT: ' ; 290 if(XOOPS_DB_SALT !== $xoops_config->xoops_db_salt) 291 echo 'ERROR '; 292 else 293 echo 'OK '; 294 echo "<br />\n"; 295 } 296 297 echo ' ' . 'XOOPS_DB_HOST: ' ; 298 if(XOOPS_DB_HOST !== $xoops_config->xoops_db_host) 299 echo 'ERROR '; 300 else 301 echo 'OK '; 302 echo "<br />\n"; 303 304 echo ' ' . 'XOOPS_DB_USER: ' ; 305 if(XOOPS_DB_USER !== $xoops_config->xoops_db_user) 306 echo 'ERROR '; 307 else 308 echo 'OK '; 309 echo "<br />\n"; 310 311 echo ' ' . 'XOOPS_DB_PASS: ' ; 312 if(XOOPS_DB_PASS !== $xoops_config->xoops_db_pass) 313 echo 'ERROR '; 314 else 315 echo 'OK '; 316 echo "<br />\n"; 317 318 echo ' ' . 'XOOPS_DB_NAME: ' ; 319 if(XOOPS_DB_NAME !== $xoops_config->xoops_db_name) 320 echo 'ERROR '; 321 else 322 echo 'OK '; 323 echo "<br />\n"; 324 325 echo ' ' . 'XOOPS_DB_PREFIX: ' ; 326 if(XOOPS_DB_PREFIX !== $xoops_config->xoops_db_prefix) 327 echo 'ERROR '; 328 else 329 echo 'OK '; 330 echo "<br />\n"; 331 echo "<br />\n"; 332 333 } else { 334 echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XOOPS_CONFIG_INFO . "</legend>"; 335 echo "<div style='padding: 8px;'>"; 336 echo '<table width="400" cellspacing="1" cellpadding="1" border="1">'; 337 echo '<tbody>'; 338 echo '<tr>'; 339 echo '<td>Define</td>'; 340 echo '<td>XOOPS</td>'; 341 echo '<td>xoops_config</td>'; 342 echo '</tr>'; 343 echo '<tr>'; 344 if(XOOPS_ROOT_PATH !== $xoops_config->xoops_root_path) 345 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_ROOT_PATH</span></strong></td>'; 346 else 347 echo '<td>XOOPS_ROOT_PATH</td>'; 348 echo '<td>' . XOOPS_ROOT_PATH . '</td>'; 349 echo '<td>' . $xoops_config->xoops_root_path . '</td>'; 350 echo '</tr>'; 351 352 echo '<tr>'; 353 if(XOOPS_TRUST_PATH !== $xoops_config->xoops_trust_path) 354 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_TRUST_PATH</span></strong></td>'; 355 else 356 echo '<td>XOOPS_TRUST_PATH</td>'; 357 echo '<td>' . XOOPS_TRUST_PATH . '</td>'; 358 echo '<td>' . $xoops_config->xoops_trust_path . '</td>'; 359 echo '</tr>'; 360 361 echo '<tr>'; 362 if(XOOPS_URL !== $xoops_config->xoops_url) 363 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_URL</span></strong></td>'; 364 else 365 echo '<td>XOOPS_URL</td>'; 366 echo '<td>' . XOOPS_URL . '</td>'; 367 echo '<td>' . $xoops_config->xoops_url . '</td>'; 368 echo '</tr>'; 369 370 if (defined('XOOPS_SALT')){ 371 echo '<tr>'; 372 if(XOOPS_SALT !== $xoops_config->xoops_salt) 373 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_SALT</span></strong></td>'; 374 else 375 echo '<td>XOOPS_SALT</td>'; 376 echo '<td>' . XOOPS_SALT . '</td>'; 377 echo '<td>' . $xoops_config->xoops_salt . '</td>'; 378 echo '</tr>'; 379 } 380 381 if (defined('XOOPS_DB_SALT')){ 382 echo '<tr>'; 383 if(XOOPS_DB_SALT !== $xoops_config->xoops_db_salt) 384 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_SALT</span></strong></td>'; 385 else 386 echo '<td>XOOPS_DB_SALT</td>'; 387 echo '<td>' . XOOPS_DB_SALT . '</td>'; 388 echo '<td>' . $xoops_config->xoops_db_salt . '</td>'; 389 echo '</tr>'; 390 } 391 392 echo '<tr>'; 393 if(XOOPS_DB_HOST !== $xoops_config->xoops_db_host) 394 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_HOST</span></strong></td>'; 395 else 396 echo '<td>XOOPS_DB_HOST</td>'; 397 echo '<td>' . XOOPS_DB_HOST . '</td>'; 398 echo '<td>' . $xoops_config->xoops_db_host . '</td>'; 399 echo '</tr>'; 400 401 echo '<tr>'; 402 if(XOOPS_DB_USER !== $xoops_config->xoops_db_user) 403 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_USER</span></strong></td>'; 404 else 405 echo '<td>XOOPS_DB_USER</td>'; 406 echo '<td>' . XOOPS_DB_USER . '</td>'; 407 echo '<td>' . $xoops_config->xoops_db_user . '</td>'; 408 echo '</tr>'; 409 410 echo '<tr>'; 411 if(XOOPS_DB_PASS !== $xoops_config->xoops_db_pass) 412 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_PASS</span></strong></td>'; 413 else 414 echo '<td>XOOPS_DB_PASS</td>'; 415 echo '<td>' . XOOPS_DB_PASS . '</td>'; 416 echo '<td>' . $xoops_config->xoops_db_pass . '</td>'; 417 echo '</tr>'; 418 419 echo '<tr>'; 420 if(XOOPS_DB_NAME !== $xoops_config->xoops_db_name) 421 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_NAME</span></strong></td>'; 422 else 423 echo '<td>XOOPS_DB_NAME</td>'; 424 echo '<td>' . XOOPS_DB_NAME . '</td>'; 425 echo '<td>' . $xoops_config->xoops_db_name . '</td>'; 426 echo '</tr>'; 427 428 echo '<tr>'; 429 if(XOOPS_DB_PREFIX !== $xoops_config->xoops_db_prefix) 430 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_PREFIX</span></strong></td>'; 431 else 432 echo '<td>XOOPS_DB_PREFIX</td>'; 433 echo '<td>' . XOOPS_DB_PREFIX . '</td>'; 434 echo '<td>' . $xoops_config->xoops_db_prefix . '</td>'; 435 echo '</tr>'; 436 echo '</tbody>'; 437 echo '</table>'; 438 echo "</div>"; 439 echo "</fieldset><br />"; 440 } 441 } 442 443 function xpress_state($is_report = false) 444 { 445 global $xoopsModule; 446 include(dirname(__FILE__) . '/../wp-includes/version.php'); 447 448 $xoopsDB =& Database::getInstance(); 449 450 $xp_prefix = $GLOBALS['xoopsModule']->getInfo('dirname'); 451 if ($xp_prefix == 'wordpress'){ 452 $xp_prefix = 'wp'; 453 } 454 455 $prefix = $xoopsDB->prefix($xp_prefix . '_'); 456 $sql = "SELECT COUNT(DISTINCT post_author) AS count_author, COUNT(*) AS count_article FROM ".$prefix . "posts WHERE post_type = 'post' AND (post_status = 'publish' OR post_status = 'private')"; 457 $result = $xoopsDB->query($sql); 458 if($myrow = $xoopsDB->fetchArray($result)){ 459 $count_article = $myrow["count_article"]; 460 $count_author = $myrow["count_author"]; 461 } 462 463 if ($wp_db_version < 6124){ 464 $sql = "SELECT COUNT(*) AS count_category FROM ".$xoopsDB->prefix($xp_prefix . "_categories"); 465 } else { 466 $sql = "SELECT COUNT(*) AS count_category FROM ".$xoopsDB->prefix($xp_prefix . "_term_taxonomy") . " WHERE taxonomy = 'category'"; 467 } 468 $result = $xoopsDB->query($sql); 469 if($myrow = $xoopsDB->fetchArray($result)){ 470 $count_category = $myrow["count_category"]; 471 } 472 473 if ($is_report){ 474 echo "******** " . _AM_XPRESS_STATS . "********" . "<br />\n"; 475 echo ' ' . _AM_XPRESS_CATEGORIES .": ".@$count_category. "<br />\n"; 476 echo ' ' . _AM_XPRESS_ARTICLES .": ". $count_article. "<br />\n"; 477 echo ' ' . _AM_XPRESS_AUTHORS .": ". $count_author. "<br />\n"; 478 479 } else { 480 echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XPRESS_STATS . "</legend>"; 481 echo "<div style='padding: 8px;'>"; 482 echo "<label>" . _AM_XPRESS_CATEGORIES .":</label><text>".@$count_category; 483 echo "</text><br />"; 484 echo "<label>" . _AM_XPRESS_ARTICLES .":</label><text>". $count_article; 485 echo "</text><br />"; 486 echo "<label>" . _AM_XPRESS_AUTHORS .":</label><text>". $count_author; 487 echo "</text>"; 488 echo "</div>"; 489 echo "</fieldset>"; 490 } 491 } 492 31 493 include_once('./../../../include/cp_header.php'); 32 494 xoops_cp_header(); 33 include(dirname(__FILE__) . '/../wp-includes/version.php');34 495 35 496 echo " … … 51 512 "; 52 513 53 echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_SYSTEM_INFO . "</legend>"; 54 echo "<div style='padding: 8px;'>"; 55 echo "<label>" . "<strong>SERVER:</strong>" . ":</label><text>" . $_SERVER['SERVER_SOFTWARE'] . "</text><br />"; 56 echo "<label>" . "<strong>PHP Version:</strong>" . ":</label><text>" . phpversion() . "</text><br />"; 57 echo "<label>" . "<strong>MySQL Version:</strong>" . ":</label><text>" . mysql_get_server_info() . "</text><br />"; 58 echo "<label>" . "<strong>XOOPS Version:</strong>" . ":</label><text>" . XOOPS_VERSION . "</text><br />"; 59 echo "<label>" . "<strong>XPressME Version:</strong>" . ":</label><text>" . $xoopsModule->getInfo('version') . ' ' . $xoopsModule->getInfo('codename') . "</text><br />"; 60 echo "<label>" . "<strong>WordPress Version:</strong>" . ":</label><text>" . $wp_version . "</text><br />"; 61 echo "<label>" . "<strong>WP DB Version:</strong>" . ":</label><text>" . $wp_db_version . "</text><br />"; 62 63 echo "</div>"; 64 echo "<div style='padding: 8px;'>"; 65 echo "<label>safemode:</label><text>"; 66 echo ( ini_get( 'safe_mode' ) ) ? "ON" : "OFF"; 67 echo "</text><br />"; 68 echo "<label>register_globals:</label><text>"; 69 echo ( ini_get( 'register_globals' )) ? "ON" : "OFF"; 70 echo "</text><br />"; 71 echo "<label>magic_quotes_gpc:</label><text>"; 72 echo ( ini_get( 'magic_quotes_gpc' )) ? "ON" : "OFF"; 73 echo "</text><br />"; 74 echo "<label>XML extension:</label><text>"; 75 echo ( extension_loaded( 'xml' )) ? "ON" : "OFF"; 76 echo "</text><br />"; 77 echo "<label>memory_limit:</label><text>"; 78 echo ini_get( 'memory_limit' ); 79 echo "</text><br />"; 80 echo "<label>post_max_size:</label><text>"; 81 echo ini_get( 'post_max_size' ); 82 echo "</text><br />"; 83 echo "<label>upload_max_filesize:</label><text>"; 84 echo ini_get( 'upload_max_filesize' ); 85 echo "</text><br />"; 86 echo "<label>display_errors:</label><text>"; 87 echo ( ini_get( 'display_errors' )) ? "ON" : "OFF"; 88 echo "</text><br />"; 89 echo "<label>MB extension:</label><text>"; 90 echo ( extension_loaded( 'mbstring' )) ? "ON" : "OFF"; 91 echo "</text><br />"; 92 echo "<label>mbstring.language:</label><text>"; 93 echo ini_get( 'mbstring.language' ); 94 echo "</text><br />"; 95 echo "<label>mbstring.encoding_translation:</label><text>"; 96 echo ( ini_get( 'mbstring.encoding_translation' )) ? "ON" : "OFF"; 97 echo "</text><br />"; 98 echo "<label>mbstring.internal_encoding:</label><text>"; 99 echo ini_get( 'mbstring.internal_encoding' ); 100 echo "</text><br />"; 101 echo "<label>mbstring.http_input:</label><text>"; 102 echo ini_get( 'mbstring.http_input' ); 103 echo "</text><br />"; 104 echo "<label>mbstring.http_output:</label><text>"; 105 echo ini_get( 'mbstring.http_output' ); 106 echo "</text><br />"; 107 echo "<label>mbstring.detect_order:</label><text>"; 108 echo ini_get( 'mbstring.detect_order' ); 109 echo "</text><br />"; 110 echo "<label>mbstring.substitute_character:</label><text>"; 111 echo ini_get( 'mbstring.substitute_character' ); 112 echo "</text><br />"; 113 echo "<label>mbstring.func_overload:</label><text>"; 114 echo ( ini_get( 'mbstring.func_overload' )) ? "ON" : "OFF"; 115 echo "</text><br />"; 116 echo "</div>"; 117 echo "</fieldset><br />"; 118 119 require_once dirname(dirname( __FILE__ )).'/class/config_from_xoops.class.php' ; 120 $xoops_config = new ConfigFromXoops; 121 echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XOOPS_CONFIG_INFO . "</legend>"; 122 echo "<div style='padding: 8px;'>"; 123 echo '<table width="400" cellspacing="1" cellpadding="1" border="1">'; 124 echo '<tbody>'; 125 echo '<tr>'; 126 echo '<td>Define</td>'; 127 echo '<td>XOOPS</td>'; 128 echo '<td>xoops_config</td>'; 129 echo '</tr>'; 130 echo '<tr>'; 131 if(XOOPS_ROOT_PATH !== $xoops_config->xoops_root_path) 132 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_ROOT_PATH</span></strong></td>'; 133 else 134 echo '<td>XOOPS_ROOT_PATH</td>'; 135 echo '<td>' . XOOPS_ROOT_PATH . '</td>'; 136 echo '<td>' . $xoops_config->xoops_root_path . '</td>'; 137 echo '</tr>'; 138 139 echo '<tr>'; 140 if(XOOPS_TRUST_PATH !== $xoops_config->xoops_trust_path) 141 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_TRUST_PATH</span></strong></td>'; 142 else 143 echo '<td>XOOPS_TRUST_PATH</td>'; 144 echo '<td>' . XOOPS_TRUST_PATH . '</td>'; 145 echo '<td>' . $xoops_config->xoops_trust_path . '</td>'; 146 echo '</tr>'; 147 148 echo '<tr>'; 149 if(XOOPS_URL !== $xoops_config->xoops_url) 150 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_URL</span></strong></td>'; 151 else 152 echo '<td>XOOPS_URL</td>'; 153 echo '<td>' . XOOPS_URL . '</td>'; 154 echo '<td>' . $xoops_config->xoops_url . '</td>'; 155 echo '</tr>'; 156 157 if (defined('XOOPS_SALT')){ 158 echo '<tr>'; 159 if(XOOPS_SALT !== $xoops_config->xoops_salt) 160 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_SALT</span></strong></td>'; 161 else 162 echo '<td>XOOPS_SALT</td>'; 163 echo '<td>' . XOOPS_SALT . '</td>'; 164 echo '<td>' . $xoops_config->xoops_salt . '</td>'; 165 echo '</tr>'; 166 } 167 168 if (defined('XOOPS_DB_SALT')){ 169 echo '<tr>'; 170 if(XOOPS_DB_SALT !== $xoops_config->xoops_db_salt) 171 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_SALT</span></strong></td>'; 172 else 173 echo '<td>XOOPS_DB_SALT</td>'; 174 echo '<td>' . XOOPS_DB_SALT . '</td>'; 175 echo '<td>' . $xoops_config->xoops_db_salt . '</td>'; 176 echo '</tr>'; 177 } 178 179 echo '<tr>'; 180 if(XOOPS_DB_HOST !== $xoops_config->xoops_db_host) 181 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_HOST</span></strong></td>'; 182 else 183 echo '<td>XOOPS_DB_HOST</td>'; 184 echo '<td>' . XOOPS_DB_HOST . '</td>'; 185 echo '<td>' . $xoops_config->xoops_db_host . '</td>'; 186 echo '</tr>'; 187 188 echo '<tr>'; 189 if(XOOPS_DB_USER !== $xoops_config->xoops_db_user) 190 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_USER</span></strong></td>'; 191 else 192 echo '<td>XOOPS_DB_USER</td>'; 193 echo '<td>' . XOOPS_DB_USER . '</td>'; 194 echo '<td>' . $xoops_config->xoops_db_user . '</td>'; 195 echo '</tr>'; 196 197 echo '<tr>'; 198 if(XOOPS_DB_PASS !== $xoops_config->xoops_db_pass) 199 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_PASS</span></strong></td>'; 200 else 201 echo '<td>XOOPS_DB_PASS</td>'; 202 echo '<td>' . XOOPS_DB_PASS . '</td>'; 203 echo '<td>' . $xoops_config->xoops_db_pass . '</td>'; 204 echo '</tr>'; 205 206 echo '<tr>'; 207 if(XOOPS_DB_NAME !== $xoops_config->xoops_db_name) 208 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_NAME</span></strong></td>'; 209 else 210 echo '<td>XOOPS_DB_NAME</td>'; 211 echo '<td>' . XOOPS_DB_NAME . '</td>'; 212 echo '<td>' . $xoops_config->xoops_db_name . '</td>'; 213 echo '</tr>'; 214 215 echo '<tr>'; 216 if(XOOPS_DB_PREFIX !== $xoops_config->xoops_db_prefix) 217 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_PREFIX</span></strong></td>'; 218 else 219 echo '<td>XOOPS_DB_PREFIX</td>'; 220 echo '<td>' . XOOPS_DB_PREFIX . '</td>'; 221 echo '<td>' . $xoops_config->xoops_db_prefix . '</td>'; 222 echo '</tr>'; 223 echo '</tbody>'; 224 echo '</table>'; 225 echo "</div>"; 226 echo "</fieldset><br />"; 227 228 $xp_prefix = $GLOBALS['xoopsModule']->getInfo('dirname'); 229 if ($xp_prefix == 'wordpress'){ 230 $xp_prefix = 'wp'; 231 } 232 233 $prefix = $xoopsDB->prefix($xp_prefix . '_'); 234 $sql = "SELECT COUNT(DISTINCT post_author) AS count_author, COUNT(*) AS count_article FROM ".$prefix . "posts WHERE post_type = 'post' AND (post_status = 'publish' OR post_status = 'private')"; 235 $result = $xoopsDB->query($sql); 236 if($myrow = $xoopsDB->fetchArray($result)){ 237 $count_article = $myrow["count_article"]; 238 $count_author = $myrow["count_author"]; 239 } 240 241 if ($wp_db_version < 6124){ 242 $sql = "SELECT COUNT(*) AS count_category FROM ".$xoopsDB->prefix($xp_prefix . "_categories"); 243 } else { 244 $sql = "SELECT COUNT(*) AS count_category FROM ".$xoopsDB->prefix($xp_prefix . "_term_taxonomy") . " WHERE taxonomy = 'category'"; 245 } 246 $result = $xoopsDB->query($sql); 247 if($myrow = $xoopsDB->fetchArray($result)){ 248 $count_category = $myrow["count_category"]; 249 } 250 251 echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XPRESS_STATS . "</legend>"; 252 echo "<div style='padding: 8px;'>"; 253 echo "<label>" . _AM_XPRESS_CATEGORIES .":</label><text>".@$count_category; 254 echo "</text><br />"; 255 echo "<label>" . _AM_XPRESS_ARTICLES .":</label><text>". $count_article; 256 echo "</text><br />"; 257 echo "<label>" . _AM_XPRESS_AUTHORS .":</label><text>". $count_author; 258 echo "</text>"; 259 echo "</div>"; 260 echo "</fieldset>"; 514 if (!empty($_POST['submit_report'])) $report = true; else $report = false; 515 xpress_sys_info($report); 516 xpress_config_from_xoops_view($report); 517 xpress_active_plugin_list($report); 518 xpress_state($report); 519 echo '<form method="POST">'."\n"; 520 echo '<input type="submit" name="submit_report" value="' . _AM_XPRESS_SYS_REPORT .' " />'.' '; 521 echo '<input type="submit" name="submit_normal" value="' . _AM_XPRESS_SYS_NORMAL .' " />'."<br />\n"; 522 echo "</form>\n"; 523 261 524 xoops_cp_footer(); 525 262 526 263 527 ?>
Note: See TracChangeset
for help on using the changeset viewer.