[61] | 1 | <?php
|
---|
| 2 | // $Id: xoops_version.php,v 1.8 2005/06/03 01:35:02 phppp Exp $
|
---|
| 3 | // ------------------------------------------------------------------------ //
|
---|
| 4 | // XOOPS - PHP Content Management System //
|
---|
| 5 | // Copyright (c) 2000 XOOPS.org //
|
---|
| 6 | // <http://www.xoops.org/> //
|
---|
| 7 | // ------------------------------------------------------------------------ //
|
---|
| 8 | // This program is free software; you can redistribute it and/or modify //
|
---|
| 9 | // it under the terms of the GNU General Public License as published by //
|
---|
| 10 | // the Free Software Foundation; either version 2 of the License, or //
|
---|
| 11 | // (at your option) any later version. //
|
---|
| 12 | // //
|
---|
| 13 | // You may not change or alter any portion of this comment or credits //
|
---|
| 14 | // of supporting developers from this source code or any supporting //
|
---|
| 15 | // source code which is considered copyrighted (c) material of the //
|
---|
| 16 | // original comment or credit authors. //
|
---|
| 17 | // //
|
---|
| 18 | // This program is distributed in the hope that it will be useful, //
|
---|
| 19 | // but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
---|
| 20 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
---|
| 21 | // GNU General Public License for more details. //
|
---|
| 22 | // //
|
---|
| 23 | // You should have received a copy of the GNU General Public License //
|
---|
| 24 | // along with this program; if not, write to the Free Software //
|
---|
| 25 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
|
---|
| 26 | // ------------------------------------------------------------------------ //
|
---|
| 27 | // Author: phppp (D.J.) //
|
---|
| 28 | // URL: http://xoopsforge.com, http://xoops.org.cn //
|
---|
| 29 | // ------------------------------------------------------------------------- //
|
---|
| 30 | //include_once 'cp_functions.php';
|
---|
[199] | 31 |
|
---|
| 32 |
|
---|
[160] | 33 | function get_xpress_plugin_data( $plugin_file, $markup = true, $translate = true ) {
|
---|
| 34 | // We don't need to write to the file, so just open for reading.
|
---|
| 35 | $fp = fopen($plugin_file, 'r');
|
---|
| 36 |
|
---|
| 37 | // Pull only the first 8kiB of the file in.
|
---|
| 38 | $plugin_data = fread( $fp, 8192 );
|
---|
| 39 |
|
---|
| 40 | // PHP will close file handle, but we are good citizens.
|
---|
| 41 | fclose($fp);
|
---|
| 42 |
|
---|
| 43 | preg_match( '|Plugin Name:(.*)$|mi', $plugin_data, $name );
|
---|
| 44 | preg_match( '|Plugin URI:(.*)$|mi', $plugin_data, $uri );
|
---|
| 45 | preg_match( '|Version:(.*)|i', $plugin_data, $version );
|
---|
| 46 | preg_match( '|Description:(.*)$|mi', $plugin_data, $description );
|
---|
| 47 | preg_match( '|Author:(.*)$|mi', $plugin_data, $author_name );
|
---|
| 48 | preg_match( '|Author URI:(.*)$|mi', $plugin_data, $author_uri );
|
---|
| 49 | preg_match( '|Text Domain:(.*)$|mi', $plugin_data, $text_domain );
|
---|
| 50 | preg_match( '|Domain Path:(.*)$|mi', $plugin_data, $domain_path );
|
---|
| 51 |
|
---|
| 52 | foreach ( array( 'name', 'uri', 'version', 'description', 'author_name', 'author_uri', 'text_domain', 'domain_path' ) as $field ) {
|
---|
| 53 | if ( !empty( ${$field} ) )
|
---|
| 54 | ${$field} = trim(${$field}[1]);
|
---|
| 55 | else
|
---|
| 56 | ${$field} = '';
|
---|
| 57 | }
|
---|
| 58 |
|
---|
| 59 | $plugin_data = array(
|
---|
| 60 | 'Name' => $name, 'Title' => $name, 'PluginURI' => $uri, 'Description' => $description,
|
---|
| 61 | 'Author' => $author_name, 'AuthorURI' => $author_uri, 'Version' => $version,
|
---|
| 62 | 'TextDomain' => $text_domain, 'DomainPath' => $domain_path
|
---|
| 63 | );
|
---|
| 64 | // if ( $markup || $translate )
|
---|
| 65 | // $plugin_data = _get_plugin_data_markup_translate($plugin_data, $markup, $translate);
|
---|
| 66 | return $plugin_data;
|
---|
| 67 | }
|
---|
| 68 |
|
---|
| 69 |
|
---|
| 70 | function get_xpress_active_plugin_list($before_str = '')
|
---|
| 71 | {
|
---|
| 72 | global $xoopsModule;
|
---|
| 73 | $xoopsDB =& Database::getInstance();
|
---|
| 74 |
|
---|
| 75 | $mydirname = basename(dirname(dirname(__FILE__)));
|
---|
| 76 | $my_dirpath = dirname(dirname(__FILE__));
|
---|
| 77 | $prefix = $mydirname;
|
---|
| 78 | if ($prefix == 'wordpress') $prefix ='wp';
|
---|
| 79 | $wp_prefix = $xoopsDB->prefix($prefix);
|
---|
| 80 |
|
---|
| 81 | $option_table = $wp_prefix . '_options';
|
---|
| 82 |
|
---|
| 83 | $sql = "SELECT option_value FROM $option_table WHERE option_name = 'active_plugins'";
|
---|
| 84 | $res = $xoopsDB->query($sql, 0, 0);
|
---|
| 85 | if ($res === false){
|
---|
| 86 | return ;
|
---|
| 87 | } else {
|
---|
| 88 | $row = $xoopsDB->fetchArray($res);
|
---|
| 89 | $active_plugins = @unserialize($row['option_value']);
|
---|
| 90 | $output = '';
|
---|
| 91 | foreach($active_plugins as $active_plugin_path){
|
---|
| 92 | $file_name = $my_dirpath . '/wp-content/plugins/' . $active_plugin_path;
|
---|
| 93 | $active_plugin = get_xpress_plugin_data($file_name);
|
---|
| 94 | $output .= $before_str . $active_plugin['Name'] . ': Version ' . $active_plugin['Version'] . ': (' .$active_plugin['PluginURI'] . ')<br />';
|
---|
| 95 | }
|
---|
| 96 |
|
---|
| 97 |
|
---|
| 98 | return $output;
|
---|
| 99 | }
|
---|
| 100 |
|
---|
| 101 |
|
---|
| 102 | }
|
---|
| 103 |
|
---|
| 104 | function xpress_active_plugin_list($is_report = false)
|
---|
| 105 | {
|
---|
| 106 | if ($is_report) {
|
---|
[183] | 107 | echo "******** " . _AM_XP2_PLUGIN . "********" . "<br />\n";
|
---|
[191] | 108 | echo get_xpress_active_plugin_list('') . "<br />\n";
|
---|
[160] | 109 | } else {
|
---|
[183] | 110 | echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XP2_PLUGIN . "</legend>";
|
---|
[160] | 111 | echo "<div style='padding: 8px;'>";
|
---|
| 112 | echo get_xpress_active_plugin_list();
|
---|
| 113 | echo "</div>";
|
---|
| 114 | echo "</fieldset>";
|
---|
| 115 | }
|
---|
| 116 | }
|
---|
| 117 |
|
---|
| 118 | function xpress_sys_info($is_report = false)
|
---|
| 119 | {
|
---|
| 120 | global $xoopsModule;
|
---|
| 121 | include(dirname(__FILE__) . '/../wp-includes/version.php');
|
---|
| 122 |
|
---|
| 123 | if ($is_report) {
|
---|
[183] | 124 | echo "******** " . _AM_XP2_SYSTEM_INFO . "********" . "<br />\n";
|
---|
[191] | 125 | echo "SERVER: ". $_SERVER['SERVER_SOFTWARE']. "<br />\n";
|
---|
| 126 | echo "PHP Version: " . phpversion() . "<br />\n";
|
---|
| 127 | echo "MySQL Version: " . mysql_get_server_info() . "</text><br />";
|
---|
| 128 | echo "XOOPS Version: " . XOOPS_VERSION . "</text><br />";
|
---|
| 129 | echo "XPressME Version: " . $xoopsModule->getInfo('version') . ' ' . $xoopsModule->getInfo('codename') . "<br />\n";
|
---|
| 130 | echo "WordPress Version: " . $wp_version . "<br />\n";
|
---|
| 131 | echo "WP DB Version: " . $wp_db_version . "<br />\n";
|
---|
[160] | 132 | echo "<br />\n";
|
---|
[191] | 133 | echo "safemode: " ;
|
---|
[160] | 134 | echo ( ini_get( 'safe_mode' ) ) ? "ON" : "OFF";
|
---|
| 135 | echo "<br />\n";
|
---|
[191] | 136 | echo "register_globals: " ;
|
---|
[160] | 137 | echo ( ini_get( 'register_globals' )) ? "ON" : "OFF" ;
|
---|
| 138 | echo "<br />\n";
|
---|
[191] | 139 | echo "magic_quotes_gpc: " ;
|
---|
[160] | 140 | echo ( ini_get( 'magic_quotes_gpc' )) ? "ON" : "OFF";
|
---|
| 141 | echo "<br />\n";
|
---|
[191] | 142 | echo "XML extension: " ;
|
---|
[160] | 143 | echo ( extension_loaded( 'xml' )) ? "ON" : "OFF";
|
---|
| 144 | echo "<br />\n";
|
---|
[191] | 145 | echo "memory_limit: " ;
|
---|
[160] | 146 | echo ini_get( 'memory_limit' );
|
---|
| 147 | echo "<br />\n";
|
---|
[191] | 148 | echo "post_max_size: " ;
|
---|
[160] | 149 | echo ini_get( 'post_max_size' );
|
---|
| 150 | echo "<br />\n";
|
---|
[191] | 151 | echo "upload_max_filesize: " ;
|
---|
[160] | 152 | echo ini_get( 'upload_max_filesize' );
|
---|
| 153 | echo "<br />\n";
|
---|
[191] | 154 | echo "display_errors: " ;
|
---|
[160] | 155 | echo ( ini_get( 'display_errors' )) ? "ON" : "OFF";
|
---|
| 156 | echo "<br />\n";
|
---|
[191] | 157 | echo "MB extension: " ;
|
---|
[160] | 158 | echo ( extension_loaded( 'mbstring' )) ? "ON" : "OFF";
|
---|
| 159 | echo "<br />\n";
|
---|
[191] | 160 | echo "mbstring.language: " ;
|
---|
[160] | 161 | echo ini_get( 'mbstring.language' );
|
---|
| 162 | echo "<br />\n";
|
---|
[191] | 163 | echo "mbstring.encoding_translation: " ;
|
---|
[160] | 164 | echo ( ini_get( 'mbstring.encoding_translation' )) ? "ON" : "OFF";
|
---|
| 165 | echo "<br />\n";
|
---|
[191] | 166 | echo "mbstring.internal_encoding: " ;
|
---|
[160] | 167 | echo ini_get( 'mbstring.internal_encoding' );
|
---|
| 168 | echo "<br />\n";
|
---|
[191] | 169 | echo "mbstring.http_input: " ;
|
---|
[160] | 170 | echo ini_get( 'mbstring.http_input' );
|
---|
| 171 | echo "<br />\n";
|
---|
[191] | 172 | echo "mbstring.http_output: " ;
|
---|
[160] | 173 | echo ini_get( 'mbstring.http_output' );
|
---|
| 174 | echo "<br />\n";
|
---|
[191] | 175 | echo "mbstring.detect_order: " ;
|
---|
[160] | 176 | echo ini_get( 'mbstring.detect_order' );
|
---|
| 177 | echo "<br />\n";
|
---|
[191] | 178 | echo "mbstring.substitute_character: " ;
|
---|
[160] | 179 | echo ini_get( 'mbstring.substitute_character' );
|
---|
| 180 | echo "<br />\n";
|
---|
[191] | 181 | echo "mbstring.func_overload: " ;
|
---|
[160] | 182 | echo ( ini_get( 'mbstring.func_overload' )) ? "ON" : "OFF";
|
---|
| 183 | echo "<br />\n";
|
---|
| 184 | echo "<br />\n";
|
---|
| 185 | } else {
|
---|
[183] | 186 | echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XP2_SYSTEM_INFO . "</legend>";
|
---|
[160] | 187 | echo "<div style='padding: 8px;'>";
|
---|
| 188 | echo "<label>" . "<strong>SERVER:</strong>" . ":</label><text>" . $_SERVER['SERVER_SOFTWARE'] . "</text><br />";
|
---|
| 189 | echo "<label>" . "<strong>PHP Version:</strong>" . ":</label><text>" . phpversion() . "</text><br />";
|
---|
| 190 | echo "<label>" . "<strong>MySQL Version:</strong>" . ":</label><text>" . mysql_get_server_info() . "</text><br />";
|
---|
| 191 | echo "<label>" . "<strong>XOOPS Version:</strong>" . ":</label><text>" . XOOPS_VERSION . "</text><br />";
|
---|
| 192 | echo "<label>" . "<strong>XPressME Version:</strong>" . ":</label><text>" . $xoopsModule->getInfo('version') . ' ' . $xoopsModule->getInfo('codename') . "</text><br />";
|
---|
| 193 | echo "<label>" . "<strong>WordPress Version:</strong>" . ":</label><text>" . $wp_version . "</text><br />";
|
---|
| 194 | echo "<label>" . "<strong>WP DB Version:</strong>" . ":</label><text>" . $wp_db_version . "</text><br />";
|
---|
| 195 |
|
---|
| 196 | echo "</div>";
|
---|
| 197 | echo "<div style='padding: 8px;'>";
|
---|
| 198 | echo "<label>safemode:</label><text>";
|
---|
| 199 | echo ( ini_get( 'safe_mode' ) ) ? "ON" : "OFF";
|
---|
| 200 | echo "</text><br />";
|
---|
| 201 | echo "<label>register_globals:</label><text>";
|
---|
| 202 | echo ( ini_get( 'register_globals' )) ? "ON" : "OFF";
|
---|
| 203 | echo "</text><br />";
|
---|
| 204 | echo "<label>magic_quotes_gpc:</label><text>";
|
---|
| 205 | echo ( ini_get( 'magic_quotes_gpc' )) ? "ON" : "OFF";
|
---|
| 206 | echo "</text><br />";
|
---|
| 207 | echo "<label>XML extension:</label><text>";
|
---|
| 208 | echo ( extension_loaded( 'xml' )) ? "ON" : "OFF";
|
---|
| 209 | echo "</text><br />";
|
---|
| 210 | echo "<label>memory_limit:</label><text>";
|
---|
| 211 | echo ini_get( 'memory_limit' );
|
---|
| 212 | echo "</text><br />";
|
---|
| 213 | echo "<label>post_max_size:</label><text>";
|
---|
| 214 | echo ini_get( 'post_max_size' );
|
---|
| 215 | echo "</text><br />";
|
---|
| 216 | echo "<label>upload_max_filesize:</label><text>";
|
---|
| 217 | echo ini_get( 'upload_max_filesize' );
|
---|
| 218 | echo "</text><br />";
|
---|
| 219 | echo "<label>display_errors:</label><text>";
|
---|
| 220 | echo ( ini_get( 'display_errors' )) ? "ON" : "OFF";
|
---|
| 221 | echo "</text><br />";
|
---|
| 222 | echo "<label>MB extension:</label><text>";
|
---|
| 223 | echo ( extension_loaded( 'mbstring' )) ? "ON" : "OFF";
|
---|
| 224 | echo "</text><br />";
|
---|
| 225 | echo "<label>mbstring.language:</label><text>";
|
---|
| 226 | echo ini_get( 'mbstring.language' );
|
---|
| 227 | echo "</text><br />";
|
---|
| 228 | echo "<label>mbstring.encoding_translation:</label><text>";
|
---|
| 229 | echo ( ini_get( 'mbstring.encoding_translation' )) ? "ON" : "OFF";
|
---|
| 230 | echo "</text><br />";
|
---|
| 231 | echo "<label>mbstring.internal_encoding:</label><text>";
|
---|
| 232 | echo ini_get( 'mbstring.internal_encoding' );
|
---|
| 233 | echo "</text><br />";
|
---|
| 234 | echo "<label>mbstring.http_input:</label><text>";
|
---|
| 235 | echo ini_get( 'mbstring.http_input' );
|
---|
| 236 | echo "</text><br />";
|
---|
| 237 | echo "<label>mbstring.http_output:</label><text>";
|
---|
| 238 | echo ini_get( 'mbstring.http_output' );
|
---|
| 239 | echo "</text><br />";
|
---|
| 240 | echo "<label>mbstring.detect_order:</label><text>";
|
---|
| 241 | echo ini_get( 'mbstring.detect_order' );
|
---|
| 242 | echo "</text><br />";
|
---|
| 243 | echo "<label>mbstring.substitute_character:</label><text>";
|
---|
| 244 | echo ini_get( 'mbstring.substitute_character' );
|
---|
| 245 | echo "</text><br />";
|
---|
| 246 | echo "<label>mbstring.func_overload:</label><text>";
|
---|
| 247 | echo ( ini_get( 'mbstring.func_overload' )) ? "ON" : "OFF";
|
---|
| 248 | echo "</text><br />";
|
---|
| 249 | echo "</div>";
|
---|
| 250 | echo "</fieldset><br />";
|
---|
| 251 | }
|
---|
| 252 | }
|
---|
| 253 |
|
---|
| 254 | function xpress_config_from_xoops_view($is_report = false)
|
---|
| 255 | {
|
---|
| 256 | require_once dirname(dirname( __FILE__ )).'/class/config_from_xoops.class.php' ;
|
---|
| 257 | $xoops_config = new ConfigFromXoops;
|
---|
| 258 | if ($is_report) {
|
---|
[183] | 259 | echo "******** " . _AM_XP2_XOOPS_CONFIG_INFO . "********" . "<br />\n";
|
---|
[191] | 260 | echo 'XOOPS_ROOT_PATH: ' ;
|
---|
[160] | 261 | if(XOOPS_ROOT_PATH !== $xoops_config->xoops_root_path)
|
---|
| 262 | echo 'ERROR ';
|
---|
| 263 | else
|
---|
| 264 | echo 'OK ';
|
---|
| 265 | echo "<br />\n";
|
---|
| 266 |
|
---|
[191] | 267 | echo 'XOOPS_TRUST_PATH: ' ;
|
---|
[160] | 268 | if(XOOPS_TRUST_PATH !== $xoops_config->xoops_trust_path)
|
---|
| 269 | echo 'ERROR ';
|
---|
| 270 | else
|
---|
| 271 | echo 'OK ';
|
---|
| 272 | echo "<br />\n";
|
---|
| 273 |
|
---|
[191] | 274 | echo 'XOOPS_URL: ' ;
|
---|
[160] | 275 | if(XOOPS_URL !== $xoops_config->xoops_url)
|
---|
| 276 | echo 'ERROR ';
|
---|
| 277 | else
|
---|
| 278 | echo 'OK ';
|
---|
| 279 | echo "<br />\n";
|
---|
| 280 |
|
---|
| 281 | if (defined('XOOPS_SALT')){
|
---|
[191] | 282 | echo 'XOOPS_SALT: ' ;
|
---|
[160] | 283 | if(XOOPS_SALT !== $xoops_config->xoops_salt)
|
---|
| 284 | echo 'ERROR ';
|
---|
| 285 | else
|
---|
| 286 | echo 'OK ';
|
---|
| 287 | echo "<br />\n";
|
---|
| 288 | }
|
---|
| 289 |
|
---|
| 290 | if (defined('XOOPS_DB_SALT')){
|
---|
[191] | 291 | echo 'XOOPS_DB_SALT: ' ;
|
---|
[160] | 292 | if(XOOPS_DB_SALT !== $xoops_config->xoops_db_salt)
|
---|
| 293 | echo 'ERROR ';
|
---|
| 294 | else
|
---|
| 295 | echo 'OK ';
|
---|
| 296 | echo "<br />\n";
|
---|
| 297 | }
|
---|
| 298 |
|
---|
[191] | 299 | echo 'XOOPS_DB_HOST: ' ;
|
---|
[160] | 300 | if(XOOPS_DB_HOST !== $xoops_config->xoops_db_host)
|
---|
| 301 | echo 'ERROR ';
|
---|
| 302 | else
|
---|
| 303 | echo 'OK ';
|
---|
| 304 | echo "<br />\n";
|
---|
| 305 |
|
---|
[191] | 306 | echo 'XOOPS_DB_USER: ' ;
|
---|
[160] | 307 | if(XOOPS_DB_USER !== $xoops_config->xoops_db_user)
|
---|
| 308 | echo 'ERROR ';
|
---|
| 309 | else
|
---|
| 310 | echo 'OK ';
|
---|
| 311 | echo "<br />\n";
|
---|
| 312 |
|
---|
[191] | 313 | echo 'XOOPS_DB_PASS: ' ;
|
---|
[160] | 314 | if(XOOPS_DB_PASS !== $xoops_config->xoops_db_pass)
|
---|
| 315 | echo 'ERROR ';
|
---|
| 316 | else
|
---|
| 317 | echo 'OK ';
|
---|
| 318 | echo "<br />\n";
|
---|
| 319 |
|
---|
[191] | 320 | echo 'XOOPS_DB_NAME: ' ;
|
---|
[160] | 321 | if(XOOPS_DB_NAME !== $xoops_config->xoops_db_name)
|
---|
| 322 | echo 'ERROR ';
|
---|
| 323 | else
|
---|
| 324 | echo 'OK ';
|
---|
| 325 | echo "<br />\n";
|
---|
| 326 |
|
---|
[191] | 327 | echo 'XOOPS_DB_PREFIX: ' ;
|
---|
[160] | 328 | if(XOOPS_DB_PREFIX !== $xoops_config->xoops_db_prefix)
|
---|
| 329 | echo 'ERROR ';
|
---|
| 330 | else
|
---|
| 331 | echo 'OK ';
|
---|
| 332 | echo "<br />\n";
|
---|
| 333 | echo "<br />\n";
|
---|
| 334 |
|
---|
| 335 | } else {
|
---|
[183] | 336 | echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XP2_XOOPS_CONFIG_INFO . "</legend>";
|
---|
[160] | 337 | echo "<div style='padding: 8px;'>";
|
---|
| 338 | echo '<table width="400" cellspacing="1" cellpadding="1" border="1">';
|
---|
| 339 | echo '<tbody>';
|
---|
| 340 | echo '<tr>';
|
---|
| 341 | echo '<td>Define</td>';
|
---|
| 342 | echo '<td>XOOPS</td>';
|
---|
| 343 | echo '<td>xoops_config</td>';
|
---|
| 344 | echo '</tr>';
|
---|
| 345 | echo '<tr>';
|
---|
| 346 | if(XOOPS_ROOT_PATH !== $xoops_config->xoops_root_path)
|
---|
| 347 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_ROOT_PATH</span></strong></td>';
|
---|
| 348 | else
|
---|
| 349 | echo '<td>XOOPS_ROOT_PATH</td>';
|
---|
| 350 | echo '<td>' . XOOPS_ROOT_PATH . '</td>';
|
---|
| 351 | echo '<td>' . $xoops_config->xoops_root_path . '</td>';
|
---|
| 352 | echo '</tr>';
|
---|
| 353 |
|
---|
| 354 | echo '<tr>';
|
---|
| 355 | if(XOOPS_TRUST_PATH !== $xoops_config->xoops_trust_path)
|
---|
| 356 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_TRUST_PATH</span></strong></td>';
|
---|
| 357 | else
|
---|
| 358 | echo '<td>XOOPS_TRUST_PATH</td>';
|
---|
| 359 | echo '<td>' . XOOPS_TRUST_PATH . '</td>';
|
---|
| 360 | echo '<td>' . $xoops_config->xoops_trust_path . '</td>';
|
---|
| 361 | echo '</tr>';
|
---|
| 362 |
|
---|
| 363 | echo '<tr>';
|
---|
| 364 | if(XOOPS_URL !== $xoops_config->xoops_url)
|
---|
| 365 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_URL</span></strong></td>';
|
---|
| 366 | else
|
---|
| 367 | echo '<td>XOOPS_URL</td>';
|
---|
| 368 | echo '<td>' . XOOPS_URL . '</td>';
|
---|
| 369 | echo '<td>' . $xoops_config->xoops_url . '</td>';
|
---|
| 370 | echo '</tr>';
|
---|
| 371 |
|
---|
| 372 | if (defined('XOOPS_SALT')){
|
---|
| 373 | echo '<tr>';
|
---|
| 374 | if(XOOPS_SALT !== $xoops_config->xoops_salt)
|
---|
| 375 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_SALT</span></strong></td>';
|
---|
| 376 | else
|
---|
| 377 | echo '<td>XOOPS_SALT</td>';
|
---|
| 378 | echo '<td>' . XOOPS_SALT . '</td>';
|
---|
| 379 | echo '<td>' . $xoops_config->xoops_salt . '</td>';
|
---|
| 380 | echo '</tr>';
|
---|
| 381 | }
|
---|
| 382 |
|
---|
| 383 | if (defined('XOOPS_DB_SALT')){
|
---|
| 384 | echo '<tr>';
|
---|
| 385 | if(XOOPS_DB_SALT !== $xoops_config->xoops_db_salt)
|
---|
| 386 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_SALT</span></strong></td>';
|
---|
| 387 | else
|
---|
| 388 | echo '<td>XOOPS_DB_SALT</td>';
|
---|
| 389 | echo '<td>' . XOOPS_DB_SALT . '</td>';
|
---|
| 390 | echo '<td>' . $xoops_config->xoops_db_salt . '</td>';
|
---|
| 391 | echo '</tr>';
|
---|
| 392 | }
|
---|
| 393 |
|
---|
| 394 | echo '<tr>';
|
---|
| 395 | if(XOOPS_DB_HOST !== $xoops_config->xoops_db_host)
|
---|
| 396 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_HOST</span></strong></td>';
|
---|
| 397 | else
|
---|
| 398 | echo '<td>XOOPS_DB_HOST</td>';
|
---|
| 399 | echo '<td>' . XOOPS_DB_HOST . '</td>';
|
---|
| 400 | echo '<td>' . $xoops_config->xoops_db_host . '</td>';
|
---|
| 401 | echo '</tr>';
|
---|
| 402 |
|
---|
| 403 | echo '<tr>';
|
---|
| 404 | if(XOOPS_DB_USER !== $xoops_config->xoops_db_user)
|
---|
| 405 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_USER</span></strong></td>';
|
---|
| 406 | else
|
---|
| 407 | echo '<td>XOOPS_DB_USER</td>';
|
---|
| 408 | echo '<td>' . XOOPS_DB_USER . '</td>';
|
---|
| 409 | echo '<td>' . $xoops_config->xoops_db_user . '</td>';
|
---|
| 410 | echo '</tr>';
|
---|
| 411 |
|
---|
| 412 | echo '<tr>';
|
---|
| 413 | if(XOOPS_DB_PASS !== $xoops_config->xoops_db_pass)
|
---|
| 414 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_PASS</span></strong></td>';
|
---|
| 415 | else
|
---|
| 416 | echo '<td>XOOPS_DB_PASS</td>';
|
---|
| 417 | echo '<td>' . XOOPS_DB_PASS . '</td>';
|
---|
| 418 | echo '<td>' . $xoops_config->xoops_db_pass . '</td>';
|
---|
| 419 | echo '</tr>';
|
---|
| 420 |
|
---|
| 421 | echo '<tr>';
|
---|
| 422 | if(XOOPS_DB_NAME !== $xoops_config->xoops_db_name)
|
---|
| 423 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_NAME</span></strong></td>';
|
---|
| 424 | else
|
---|
| 425 | echo '<td>XOOPS_DB_NAME</td>';
|
---|
| 426 | echo '<td>' . XOOPS_DB_NAME . '</td>';
|
---|
| 427 | echo '<td>' . $xoops_config->xoops_db_name . '</td>';
|
---|
| 428 | echo '</tr>';
|
---|
| 429 |
|
---|
| 430 | echo '<tr>';
|
---|
| 431 | if(XOOPS_DB_PREFIX !== $xoops_config->xoops_db_prefix)
|
---|
| 432 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_PREFIX</span></strong></td>';
|
---|
| 433 | else
|
---|
| 434 | echo '<td>XOOPS_DB_PREFIX</td>';
|
---|
| 435 | echo '<td>' . XOOPS_DB_PREFIX . '</td>';
|
---|
| 436 | echo '<td>' . $xoops_config->xoops_db_prefix . '</td>';
|
---|
| 437 | echo '</tr>';
|
---|
| 438 | echo '</tbody>';
|
---|
| 439 | echo '</table>';
|
---|
| 440 | echo "</div>";
|
---|
| 441 | echo "</fieldset><br />";
|
---|
| 442 | }
|
---|
| 443 | }
|
---|
| 444 |
|
---|
| 445 | function xpress_state($is_report = false)
|
---|
| 446 | {
|
---|
| 447 | global $xoopsModule;
|
---|
| 448 | include(dirname(__FILE__) . '/../wp-includes/version.php');
|
---|
| 449 |
|
---|
| 450 | $xoopsDB =& Database::getInstance();
|
---|
| 451 |
|
---|
| 452 | $xp_prefix = $GLOBALS['xoopsModule']->getInfo('dirname');
|
---|
| 453 | if ($xp_prefix == 'wordpress'){
|
---|
| 454 | $xp_prefix = 'wp';
|
---|
| 455 | }
|
---|
| 456 |
|
---|
| 457 | $prefix = $xoopsDB->prefix($xp_prefix . '_');
|
---|
| 458 | $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')";
|
---|
| 459 | $result = $xoopsDB->query($sql);
|
---|
| 460 | if($myrow = $xoopsDB->fetchArray($result)){
|
---|
| 461 | $count_article = $myrow["count_article"];
|
---|
| 462 | $count_author = $myrow["count_author"];
|
---|
| 463 | }
|
---|
| 464 |
|
---|
| 465 | if ($wp_db_version < 6124){
|
---|
| 466 | $sql = "SELECT COUNT(*) AS count_category FROM ".$xoopsDB->prefix($xp_prefix . "_categories");
|
---|
| 467 | } else {
|
---|
| 468 | $sql = "SELECT COUNT(*) AS count_category FROM ".$xoopsDB->prefix($xp_prefix . "_term_taxonomy") . " WHERE taxonomy = 'category'";
|
---|
| 469 | }
|
---|
| 470 | $result = $xoopsDB->query($sql);
|
---|
| 471 | if($myrow = $xoopsDB->fetchArray($result)){
|
---|
| 472 | $count_category = $myrow["count_category"];
|
---|
| 473 | }
|
---|
| 474 |
|
---|
| 475 | if ($is_report){
|
---|
[183] | 476 | echo "******** " . _AM_XP2_STATS . "********" . "<br />\n";
|
---|
[191] | 477 | echo _AM_XP2_CATEGORIES .": ".@$count_category. "<br />\n";
|
---|
| 478 | echo _AM_XP2_ARTICLES .": ". $count_article. "<br />\n";
|
---|
| 479 | echo _AM_XP2_AUTHORS .": ". $count_author. "<br />\n";
|
---|
[160] | 480 |
|
---|
| 481 | } else {
|
---|
[183] | 482 | echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XP2_STATS . "</legend>";
|
---|
[160] | 483 | echo "<div style='padding: 8px;'>";
|
---|
[183] | 484 | echo "<label>" . _AM_XP2_CATEGORIES .":</label><text>".@$count_category;
|
---|
[160] | 485 | echo "</text><br />";
|
---|
[183] | 486 | echo "<label>" . _AM_XP2_ARTICLES .":</label><text>". $count_article;
|
---|
[160] | 487 | echo "</text><br />";
|
---|
[183] | 488 | echo "<label>" . _AM_XP2_AUTHORS .":</label><text>". $count_author;
|
---|
[160] | 489 | echo "</text>";
|
---|
| 490 | echo "</div>";
|
---|
| 491 | echo "</fieldset>";
|
---|
| 492 | }
|
---|
| 493 | }
|
---|
[199] | 494 | function xpress_block_state($is_report = false)
|
---|
| 495 | {
|
---|
| 496 | require_once dirname(dirname( __FILE__ )).'/class/config_from_xoops.class.php' ;
|
---|
| 497 | $xoops_config = new ConfigFromXoops;
|
---|
| 498 |
|
---|
| 499 | include_once(dirname(dirname(__FILE__) ). '/class/check_blocks_class.php');
|
---|
| 500 | $xoops_block_check =& xoops_block_check::getInstance();
|
---|
| 501 | $xoops_block_check->check_blocks($xoops_config->module_name);
|
---|
| 502 | if ($is_report){
|
---|
| 503 | echo "******** " . _AM_XP2_BLOCK_STATS . "********" . "<br />\n";
|
---|
| 504 | echo $xoops_block_check->get_message();
|
---|
| 505 | echo "<br />\n";
|
---|
| 506 | echo "<br />\n";
|
---|
| 507 | } else {
|
---|
| 508 | echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XP2_BLOCK_STATS . "</legend>";
|
---|
| 509 | echo "<div style='padding: 8px;'>";
|
---|
| 510 | echo $xoops_block_check->get_message();
|
---|
| 511 | echo "</div>";
|
---|
| 512 | echo "</fieldset>";
|
---|
| 513 | }
|
---|
| 514 | }
|
---|
| 515 |
|
---|
| 516 |
|
---|
[170] | 517 | require_once '../../../include/cp_header.php' ;
|
---|
| 518 | //require_once '../include/gtickets.php' ;
|
---|
| 519 | //define( '_MYMENU_CONSTANT_IN_MODINFO' , '_MI_TELLAFRIEND_MODNAME' ) ;
|
---|
[160] | 520 |
|
---|
[170] | 521 | // branch for altsys
|
---|
| 522 | if( defined( 'XOOPS_TRUST_PATH' ) && ! empty( $_GET['lib'] ) ) {
|
---|
| 523 | $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
|
---|
| 524 | $mydirpath = dirname( dirname( __FILE__ ) ) ;
|
---|
| 525 |
|
---|
| 526 | // common libs (eg. altsys)
|
---|
| 527 | $lib = preg_replace( '/[^a-zA-Z0-9_-]/' , '' , $_GET['lib'] ) ;
|
---|
| 528 | $page = preg_replace( '/[^a-zA-Z0-9_-]/' , '' , @$_GET['page'] ) ;
|
---|
| 529 |
|
---|
| 530 | if( file_exists( XOOPS_TRUST_PATH.'/libs/'.$lib.'/'.$page.'.php' ) ) {
|
---|
| 531 | include XOOPS_TRUST_PATH.'/libs/'.$lib.'/'.$page.'.php' ;
|
---|
| 532 | } else if( file_exists( XOOPS_TRUST_PATH.'/libs/'.$lib.'/index.php' ) ) {
|
---|
| 533 | include XOOPS_TRUST_PATH.'/libs/'.$lib.'/index.php' ;
|
---|
| 534 | } else {
|
---|
| 535 | die( 'wrong request' ) ;
|
---|
| 536 | }
|
---|
| 537 | exit ;
|
---|
| 538 | }
|
---|
| 539 |
|
---|
| 540 | //include_once('./menu.php');
|
---|
| 541 | //include_once('./../../../include/cp_header.php');
|
---|
[61] | 542 | xoops_cp_header();
|
---|
[170] | 543 | include( './mymenu.php' ) ;
|
---|
[107] | 544 | echo "
|
---|
| 545 | <style type=\"text/css\">
|
---|
| 546 | label,text {
|
---|
| 547 | display: block;
|
---|
| 548 | float: left;
|
---|
| 549 | margin-bottom: 2px;
|
---|
| 550 | }
|
---|
| 551 | label {
|
---|
| 552 | text-align: right;
|
---|
| 553 | width: 200px;
|
---|
| 554 | padding-right: 20px;
|
---|
| 555 | }
|
---|
| 556 | br {
|
---|
| 557 | clear: left;
|
---|
| 558 | }
|
---|
| 559 | </style>
|
---|
| 560 | ";
|
---|
| 561 |
|
---|
[160] | 562 | if (!empty($_POST['submit_report'])) $report = true; else $report = false;
|
---|
| 563 | xpress_sys_info($report);
|
---|
| 564 | xpress_config_from_xoops_view($report);
|
---|
| 565 | xpress_active_plugin_list($report);
|
---|
[199] | 566 | xpress_block_state($report);
|
---|
[160] | 567 | xpress_state($report);
|
---|
| 568 | echo '<form method="POST">'."\n";
|
---|
[183] | 569 | echo '<input type="submit" name="submit_report" value="' . _AM_XP2_SYS_REPORT .' " />'.' ';
|
---|
| 570 | echo '<input type="submit" name="submit_normal" value="' . _AM_XP2_SYS_NORMAL .' " />'."<br />\n";
|
---|
[160] | 571 | echo "</form>\n";
|
---|
[107] | 572 |
|
---|
[160] | 573 | xoops_cp_footer();
|
---|
[107] | 574 |
|
---|
[61] | 575 |
|
---|
| 576 | ?> |
---|