XPressME Integration Kit

Trac

Changeset 107 for trunk/admin/index.php


Ignore:
Timestamp:
Mar 15, 2009, 12:01:24 AM (15 years ago)
Author:
toemon
Message:

XOOPSモジュール管理画面にシステム情報表示メニューを追加
チケット #23 実装

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/index.php

    r61 r107  
    3131include_once('./../../../include/cp_header.php'); 
    3232xoops_cp_header(); 
    33 echo '<p>Yet Not Make XPressME index Page.</p>'; 
     33include(dirname(__FILE__) . '/../wp-includes/version.php'); 
     34 
     35echo " 
     36        <style type=\"text/css\"> 
     37        label,text { 
     38                display: block; 
     39                float: left; 
     40                margin-bottom: 2px; 
     41        } 
     42        label { 
     43                text-align: right; 
     44                width: 200px; 
     45                padding-right: 20px; 
     46        } 
     47        br { 
     48                clear: left; 
     49        } 
     50        </style> 
     51"; 
     52 
     53echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_SYSTEM_INFO . "</legend>"; 
     54echo "<div style='padding: 8px;'>"; 
     55echo "<label>" . "<strong>SERVER:</strong>" . ":</label><text>" . $_SERVER['SERVER_SOFTWARE'] . "</text><br />"; 
     56echo "<label>" . "<strong>PHP Version:</strong>" . ":</label><text>" . phpversion() . "</text><br />"; 
     57echo "<label>" . "<strong>MySQL Version:</strong>" . ":</label><text>" . mysql_get_server_info() . "</text><br />"; 
     58echo "<label>" . "<strong>XOOPS Version:</strong>" . ":</label><text>" . XOOPS_VERSION . "</text><br />"; 
     59echo "<label>" . "<strong>XPressME Version:</strong>" . ":</label><text>" . $xoopsModule->getInfo('version') . ' ' . $xoopsModule->getInfo('codename') . "</text><br />"; 
     60echo "<label>" . "<strong>WordPress Version:</strong>" . ":</label><text>" . $wp_version . "</text><br />"; 
     61echo "<label>" . "<strong>WP DB Version:</strong>" . ":</label><text>" . $wp_db_version . "</text><br />"; 
     62 
     63echo "</div>"; 
     64echo "<div style='padding: 8px;'>"; 
     65echo "<label>safemode:</label><text>"; 
     66echo ( ini_get( 'safe_mode' ) ) ? "ON" : "OFF"; 
     67echo "</text><br />"; 
     68echo "<label>register_globals:</label><text>"; 
     69echo ( ini_get( 'register_globals' )) ? "ON" : "OFF"; 
     70echo "</text><br />"; 
     71echo "<label>magic_quotes_gpc:</label><text>"; 
     72echo ( ini_get( 'magic_quotes_gpc' )) ? "ON" : "OFF"; 
     73echo "</text><br />"; 
     74echo "<label>XML extension:</label><text>"; 
     75echo ( extension_loaded( 'xml' )) ? "ON" : "OFF"; 
     76echo "</text><br />"; 
     77echo "<label>memory_limit:</label><text>"; 
     78echo  ini_get( 'memory_limit' ); 
     79echo "</text><br />"; 
     80echo "<label>post_max_size:</label><text>"; 
     81echo  ini_get( 'post_max_size' ); 
     82echo "</text><br />"; 
     83echo "<label>upload_max_filesize:</label><text>"; 
     84echo  ini_get( 'upload_max_filesize' ); 
     85echo "</text><br />"; 
     86echo "<label>display_errors:</label><text>"; 
     87echo ( ini_get( 'display_errors' )) ? "ON" : "OFF"; 
     88echo "</text><br />"; 
     89echo "<label>MB extension:</label><text>"; 
     90echo ( extension_loaded( 'mbstring' )) ? "ON" : "OFF"; 
     91echo "</text><br />"; 
     92echo "<label>mbstring.language:</label><text>"; 
     93echo  ini_get( 'mbstring.language' ); 
     94echo "</text><br />"; 
     95echo "<label>mbstring.encoding_translation:</label><text>"; 
     96echo  ( ini_get( 'mbstring.encoding_translation' )) ? "ON" : "OFF"; 
     97echo "</text><br />"; 
     98echo "<label>mbstring.internal_encoding:</label><text>"; 
     99echo  ini_get( 'mbstring.internal_encoding' ); 
     100echo "</text><br />"; 
     101echo "<label>mbstring.http_input:</label><text>"; 
     102echo  ini_get( 'mbstring.http_input' ); 
     103echo "</text><br />"; 
     104echo "<label>mbstring.http_output:</label><text>"; 
     105echo  ini_get( 'mbstring.http_output' ); 
     106echo "</text><br />"; 
     107echo "<label>mbstring.detect_order:</label><text>"; 
     108echo  ini_get( 'mbstring.detect_order' ); 
     109echo "</text><br />"; 
     110echo "<label>mbstring.substitute_character:</label><text>"; 
     111echo  ini_get( 'mbstring.substitute_character' ); 
     112echo "</text><br />"; 
     113echo "<label>mbstring.func_overload:</label><text>"; 
     114echo  ( ini_get( 'mbstring.func_overload' )) ? "ON" : "OFF"; 
     115echo "</text><br />"; 
     116echo "</div>"; 
     117echo "</fieldset><br />"; 
     118 
     119$xp_prefix = $GLOBALS['xoopsModule']->getInfo('dirname'); 
     120if ($xp_prefix == 'wordpress'){ 
     121        $xp_prefix = 'wp'; 
     122} 
     123 
     124$prefix = $xoopsDB->prefix($xp_prefix . '_'); 
     125$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')"; 
     126$result = $xoopsDB->query($sql); 
     127if($myrow = $xoopsDB->fetchArray($result)){ 
     128        $count_article = $myrow["count_article"]; 
     129        $count_author = $myrow["count_author"]; 
     130} 
     131 
     132if ($wp_db_version < 6124){ 
     133        $sql = "SELECT COUNT(*) AS count_category FROM ".$xoopsDB->prefix($xp_prefix . "_categories"); 
     134} else { 
     135        $sql = "SELECT COUNT(*) AS count_category FROM ".$xoopsDB->prefix($xp_prefix . "_term_taxonomy") . " WHERE taxonomy = 'category'"; 
     136} 
     137$result = $xoopsDB->query($sql); 
     138if($myrow = $xoopsDB->fetchArray($result)){ 
     139        $count_category = $myrow["count_category"]; 
     140} 
     141 
     142echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XPRESS_STATS . "</legend>"; 
     143echo "<div style='padding: 8px;'>"; 
     144echo "<label>" . _AM_XPRESS_CATEGORIES .":</label><text>".@$count_category; 
     145echo "</text><br />"; 
     146echo "<label>" . _AM_XPRESS_ARTICLES .":</label><text>". $count_article; 
     147echo "</text><br />"; 
     148echo "<label>" . _AM_XPRESS_AUTHORS .":</label><text>". $count_author; 
     149echo "</text>"; 
     150echo "</div>"; 
     151echo "</fieldset>"; 
    34152xoops_cp_footer(); 
    35153         
Note: See TracChangeset for help on using the changeset viewer.