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