[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){
|
---|
[749] | 33 | global $xoopsModule,$xoopsDB;
|
---|
[200] | 34 |
|
---|
| 35 | $mydirname = basename(dirname(dirname(__FILE__)));
|
---|
| 36 | $my_dirpath = dirname(dirname(__FILE__));
|
---|
[583] | 37 | $wp_prefix_only = preg_replace('/wordpress/','wp',$mydirname);
|
---|
[200] | 38 | $db_prefix = $xoopsDB->prefix($wp_prefix_only);
|
---|
[199] | 39 |
|
---|
[200] | 40 | $usermeta_tbl = $db_prefix . '_usermeta';
|
---|
| 41 | $meta_key_pattern = '_' . $wp_prefix_only . '_';
|
---|
| 42 |
|
---|
| 43 | $sql = "SELECT count(umeta_id) as data_count ,meta_key FROM $usermeta_tbl GROUP BY meta_key HAVING meta_key LIKE '%" . $meta_key_pattern ."%'" ;
|
---|
| 44 | $res = $xoopsDB->query($sql, 0, 0);
|
---|
| 45 |
|
---|
| 46 | if ($res === false){
|
---|
| 47 | $check_str = _AM_XP2_USER_META_NONE . "<br />\n";
|
---|
| 48 | } else {
|
---|
| 49 | $error =false;
|
---|
| 50 | $check_str = '';
|
---|
| 51 | while($row = $xoopsDB->fetchArray($res)){
|
---|
| 52 | $data_count = $row['data_count'];
|
---|
| 53 | $meta_key = $row['meta_key'];
|
---|
| 54 | if ( !preg_match('/^'.$db_prefix. '_.*/',$meta_key , $maches)){
|
---|
| 55 | $check_str .= sprintf(_AM_XP2_USER_META_ERR , $meta_key,$data_count) ."<br /> \n";
|
---|
| 56 | $error = true;
|
---|
| 57 | }
|
---|
| 58 | }
|
---|
| 59 | if (!$error)
|
---|
| 60 | $check_str = _AM_XP2_USER_META_OK ;
|
---|
| 61 | }
|
---|
| 62 | if ($is_report) {
|
---|
| 63 | echo "******** " . _AM_XP2_USER_META_KEY . "********" . "<br />\n";
|
---|
| 64 | echo $check_str . "<br />\n<br />\n";
|
---|
| 65 | } else {
|
---|
| 66 | echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XP2_USER_META_KEY . "</legend>";
|
---|
| 67 | echo "<div style='padding: 8px;'>";
|
---|
| 68 | echo $check_str;
|
---|
| 69 | echo "</div>";
|
---|
[511] | 70 | echo '</legend>';
|
---|
| 71 | echo "</fieldset><br />";
|
---|
[200] | 72 | }
|
---|
| 73 |
|
---|
| 74 | }
|
---|
| 75 |
|
---|
[160] | 76 | function get_xpress_plugin_data( $plugin_file, $markup = true, $translate = true ) {
|
---|
| 77 | // We don't need to write to the file, so just open for reading.
|
---|
| 78 | $fp = fopen($plugin_file, 'r');
|
---|
| 79 |
|
---|
| 80 | // Pull only the first 8kiB of the file in.
|
---|
| 81 | $plugin_data = fread( $fp, 8192 );
|
---|
| 82 |
|
---|
| 83 | // PHP will close file handle, but we are good citizens.
|
---|
| 84 | fclose($fp);
|
---|
| 85 |
|
---|
| 86 | preg_match( '|Plugin Name:(.*)$|mi', $plugin_data, $name );
|
---|
| 87 | preg_match( '|Plugin URI:(.*)$|mi', $plugin_data, $uri );
|
---|
| 88 | preg_match( '|Version:(.*)|i', $plugin_data, $version );
|
---|
| 89 | preg_match( '|Description:(.*)$|mi', $plugin_data, $description );
|
---|
| 90 | preg_match( '|Author:(.*)$|mi', $plugin_data, $author_name );
|
---|
| 91 | preg_match( '|Author URI:(.*)$|mi', $plugin_data, $author_uri );
|
---|
| 92 | preg_match( '|Text Domain:(.*)$|mi', $plugin_data, $text_domain );
|
---|
| 93 | preg_match( '|Domain Path:(.*)$|mi', $plugin_data, $domain_path );
|
---|
| 94 |
|
---|
| 95 | foreach ( array( 'name', 'uri', 'version', 'description', 'author_name', 'author_uri', 'text_domain', 'domain_path' ) as $field ) {
|
---|
| 96 | if ( !empty( ${$field} ) )
|
---|
| 97 | ${$field} = trim(${$field}[1]);
|
---|
| 98 | else
|
---|
| 99 | ${$field} = '';
|
---|
| 100 | }
|
---|
| 101 |
|
---|
| 102 | $plugin_data = array(
|
---|
| 103 | 'Name' => $name, 'Title' => $name, 'PluginURI' => $uri, 'Description' => $description,
|
---|
| 104 | 'Author' => $author_name, 'AuthorURI' => $author_uri, 'Version' => $version,
|
---|
| 105 | 'TextDomain' => $text_domain, 'DomainPath' => $domain_path
|
---|
| 106 | );
|
---|
| 107 | // if ( $markup || $translate )
|
---|
| 108 | // $plugin_data = _get_plugin_data_markup_translate($plugin_data, $markup, $translate);
|
---|
| 109 | return $plugin_data;
|
---|
| 110 | }
|
---|
| 111 |
|
---|
| 112 |
|
---|
| 113 | function get_xpress_active_plugin_list($before_str = '')
|
---|
| 114 | {
|
---|
[749] | 115 | global $xoopsModule,$xoopsDB;
|
---|
[160] | 116 |
|
---|
| 117 | $mydirname = basename(dirname(dirname(__FILE__)));
|
---|
| 118 | $my_dirpath = dirname(dirname(__FILE__));
|
---|
[583] | 119 | $prefix = preg_replace('/wordpress/','wp',$mydirname);
|
---|
[160] | 120 | $wp_prefix = $xoopsDB->prefix($prefix);
|
---|
| 121 |
|
---|
| 122 | $option_table = $wp_prefix . '_options';
|
---|
| 123 |
|
---|
| 124 | $sql = "SELECT option_value FROM $option_table WHERE option_name = 'active_plugins'";
|
---|
| 125 | $res = $xoopsDB->query($sql, 0, 0);
|
---|
| 126 | if ($res === false){
|
---|
| 127 | return ;
|
---|
| 128 | } else {
|
---|
| 129 | $row = $xoopsDB->fetchArray($res);
|
---|
| 130 | $active_plugins = @unserialize($row['option_value']);
|
---|
| 131 | $output = '';
|
---|
| 132 | foreach($active_plugins as $active_plugin_path){
|
---|
| 133 | $file_name = $my_dirpath . '/wp-content/plugins/' . $active_plugin_path;
|
---|
| 134 | $active_plugin = get_xpress_plugin_data($file_name);
|
---|
| 135 | $output .= $before_str . $active_plugin['Name'] . ': Version ' . $active_plugin['Version'] . ': (' .$active_plugin['PluginURI'] . ')<br />';
|
---|
| 136 | }
|
---|
| 137 |
|
---|
| 138 |
|
---|
| 139 | return $output;
|
---|
| 140 | }
|
---|
| 141 |
|
---|
| 142 |
|
---|
| 143 | }
|
---|
| 144 |
|
---|
| 145 | function xpress_active_plugin_list($is_report = false)
|
---|
| 146 | {
|
---|
| 147 | if ($is_report) {
|
---|
[183] | 148 | echo "******** " . _AM_XP2_PLUGIN . "********" . "<br />\n";
|
---|
[191] | 149 | echo get_xpress_active_plugin_list('') . "<br />\n";
|
---|
[160] | 150 | } else {
|
---|
[183] | 151 | echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XP2_PLUGIN . "</legend>";
|
---|
[160] | 152 | echo "<div style='padding: 8px;'>";
|
---|
| 153 | echo get_xpress_active_plugin_list();
|
---|
| 154 | echo "</div>";
|
---|
[511] | 155 | echo '</legend>';
|
---|
| 156 | echo "</fieldset><br />";
|
---|
[160] | 157 | }
|
---|
| 158 | }
|
---|
| 159 |
|
---|
| 160 | function xpress_sys_info($is_report = false)
|
---|
| 161 | {
|
---|
| 162 | global $xoopsModule;
|
---|
| 163 | include(dirname(__FILE__) . '/../wp-includes/version.php');
|
---|
[551] | 164 | require_once dirname(dirname( __FILE__ )).'/include/memory_limit.php' ;
|
---|
[491] | 165 |
|
---|
[160] | 166 | if ($is_report) {
|
---|
[183] | 167 | echo "******** " . _AM_XP2_SYSTEM_INFO . "********" . "<br />\n";
|
---|
[191] | 168 | echo "SERVER: ". $_SERVER['SERVER_SOFTWARE']. "<br />\n";
|
---|
| 169 | echo "PHP Version: " . phpversion() . "<br />\n";
|
---|
[395] | 170 | echo 'libxml Version: ';
|
---|
| 171 | if (defined('LIBXML_DOTTED_VERSION')) echo LIBXML_DOTTED_VERSION ; else echo "Can't detect.";
|
---|
| 172 | echo "<br />\n";;
|
---|
[191] | 173 | echo "MySQL Version: " . mysql_get_server_info() . "</text><br />";
|
---|
| 174 | echo "XOOPS Version: " . XOOPS_VERSION . "</text><br />";
|
---|
| 175 | echo "XPressME Version: " . $xoopsModule->getInfo('version') . ' ' . $xoopsModule->getInfo('codename') . "<br />\n";
|
---|
| 176 | echo "WordPress Version: " . $wp_version . "<br />\n";
|
---|
| 177 | echo "WP DB Version: " . $wp_db_version . "<br />\n";
|
---|
[160] | 178 | echo "<br />\n";
|
---|
[191] | 179 | echo "safemode: " ;
|
---|
[160] | 180 | echo ( ini_get( 'safe_mode' ) ) ? "ON" : "OFF";
|
---|
| 181 | echo "<br />\n";
|
---|
[191] | 182 | echo "register_globals: " ;
|
---|
[160] | 183 | echo ( ini_get( 'register_globals' )) ? "ON" : "OFF" ;
|
---|
| 184 | echo "<br />\n";
|
---|
[640] | 185 | echo "allow_url_fopen: " ;
|
---|
| 186 | echo ( ini_get( 'allow_url_fopen' )) ? "ON" : "OFF" ;
|
---|
| 187 | echo "<br />\n";
|
---|
[191] | 188 | echo "magic_quotes_gpc: " ;
|
---|
[160] | 189 | echo ( ini_get( 'magic_quotes_gpc' )) ? "ON" : "OFF";
|
---|
| 190 | echo "<br />\n";
|
---|
[191] | 191 | echo "XML extension: " ;
|
---|
[160] | 192 | echo ( extension_loaded( 'xml' )) ? "ON" : "OFF";
|
---|
| 193 | echo "<br />\n";
|
---|
[491] | 194 | echo "default memory_limit: " ;
|
---|
[160] | 195 | echo ini_get( 'memory_limit' );
|
---|
| 196 | echo "<br />\n";
|
---|
[551] | 197 | xpress_set_memory_limmit();
|
---|
[491] | 198 | echo "change memory_limit: " ;
|
---|
| 199 | echo ini_get( 'memory_limit' );
|
---|
| 200 | echo "<br />\n";
|
---|
| 201 |
|
---|
[191] | 202 | echo "post_max_size: " ;
|
---|
[160] | 203 | echo ini_get( 'post_max_size' );
|
---|
| 204 | echo "<br />\n";
|
---|
[191] | 205 | echo "upload_max_filesize: " ;
|
---|
[160] | 206 | echo ini_get( 'upload_max_filesize' );
|
---|
| 207 | echo "<br />\n";
|
---|
[191] | 208 | echo "display_errors: " ;
|
---|
[160] | 209 | echo ( ini_get( 'display_errors' )) ? "ON" : "OFF";
|
---|
| 210 | echo "<br />\n";
|
---|
[191] | 211 | echo "MB extension: " ;
|
---|
[160] | 212 | echo ( extension_loaded( 'mbstring' )) ? "ON" : "OFF";
|
---|
| 213 | echo "<br />\n";
|
---|
[191] | 214 | echo "mbstring.language: " ;
|
---|
[160] | 215 | echo ini_get( 'mbstring.language' );
|
---|
| 216 | echo "<br />\n";
|
---|
[191] | 217 | echo "mbstring.encoding_translation: " ;
|
---|
[160] | 218 | echo ( ini_get( 'mbstring.encoding_translation' )) ? "ON" : "OFF";
|
---|
| 219 | echo "<br />\n";
|
---|
[191] | 220 | echo "mbstring.internal_encoding: " ;
|
---|
[160] | 221 | echo ini_get( 'mbstring.internal_encoding' );
|
---|
| 222 | echo "<br />\n";
|
---|
[191] | 223 | echo "mbstring.http_input: " ;
|
---|
[160] | 224 | echo ini_get( 'mbstring.http_input' );
|
---|
| 225 | echo "<br />\n";
|
---|
[191] | 226 | echo "mbstring.http_output: " ;
|
---|
[160] | 227 | echo ini_get( 'mbstring.http_output' );
|
---|
| 228 | echo "<br />\n";
|
---|
[191] | 229 | echo "mbstring.detect_order: " ;
|
---|
[160] | 230 | echo ini_get( 'mbstring.detect_order' );
|
---|
| 231 | echo "<br />\n";
|
---|
[191] | 232 | echo "mbstring.substitute_character: " ;
|
---|
[160] | 233 | echo ini_get( 'mbstring.substitute_character' );
|
---|
| 234 | echo "<br />\n";
|
---|
[191] | 235 | echo "mbstring.func_overload: " ;
|
---|
[160] | 236 | echo ( ini_get( 'mbstring.func_overload' )) ? "ON" : "OFF";
|
---|
| 237 | echo "<br />\n";
|
---|
| 238 | echo "<br />\n";
|
---|
| 239 | } else {
|
---|
[183] | 240 | echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XP2_SYSTEM_INFO . "</legend>";
|
---|
[160] | 241 | echo "<div style='padding: 8px;'>";
|
---|
| 242 | echo "<label>" . "<strong>SERVER:</strong>" . ":</label><text>" . $_SERVER['SERVER_SOFTWARE'] . "</text><br />";
|
---|
| 243 | echo "<label>" . "<strong>PHP Version:</strong>" . ":</label><text>" . phpversion() . "</text><br />";
|
---|
[395] | 244 | echo "<label>" . "<strong>libxml Version:</strong>" . ":</label><text>";
|
---|
| 245 | if (defined('LIBXML_DOTTED_VERSION')) echo LIBXML_DOTTED_VERSION ; else echo "Can't detect.";
|
---|
| 246 | echo "</text><br />";
|
---|
[160] | 247 | echo "<label>" . "<strong>MySQL Version:</strong>" . ":</label><text>" . mysql_get_server_info() . "</text><br />";
|
---|
| 248 | echo "<label>" . "<strong>XOOPS Version:</strong>" . ":</label><text>" . XOOPS_VERSION . "</text><br />";
|
---|
| 249 | echo "<label>" . "<strong>XPressME Version:</strong>" . ":</label><text>" . $xoopsModule->getInfo('version') . ' ' . $xoopsModule->getInfo('codename') . "</text><br />";
|
---|
| 250 | echo "<label>" . "<strong>WordPress Version:</strong>" . ":</label><text>" . $wp_version . "</text><br />";
|
---|
| 251 | echo "<label>" . "<strong>WP DB Version:</strong>" . ":</label><text>" . $wp_db_version . "</text><br />";
|
---|
| 252 |
|
---|
| 253 | echo "</div>";
|
---|
| 254 | echo "<div style='padding: 8px;'>";
|
---|
| 255 | echo "<label>safemode:</label><text>";
|
---|
| 256 | echo ( ini_get( 'safe_mode' ) ) ? "ON" : "OFF";
|
---|
| 257 | echo "</text><br />";
|
---|
| 258 | echo "<label>register_globals:</label><text>";
|
---|
| 259 | echo ( ini_get( 'register_globals' )) ? "ON" : "OFF";
|
---|
| 260 | echo "</text><br />";
|
---|
[640] | 261 | echo "<label>allow_url_fopen:</label><text>";
|
---|
| 262 | echo ( ini_get( 'allow_url_fopen' )) ? "ON" : "OFF";
|
---|
| 263 | echo "</text><br />";
|
---|
[160] | 264 | echo "<label>magic_quotes_gpc:</label><text>";
|
---|
| 265 | echo ( ini_get( 'magic_quotes_gpc' )) ? "ON" : "OFF";
|
---|
| 266 | echo "</text><br />";
|
---|
| 267 | echo "<label>XML extension:</label><text>";
|
---|
| 268 | echo ( extension_loaded( 'xml' )) ? "ON" : "OFF";
|
---|
| 269 | echo "</text><br />";
|
---|
[491] | 270 | echo "<label>default memory_limit:</label><text>";
|
---|
[160] | 271 | echo ini_get( 'memory_limit' );
|
---|
| 272 | echo "</text><br />";
|
---|
[551] | 273 | xpress_set_memory_limmit();
|
---|
[491] | 274 | echo "<label>change memory_limit:</label><text>";
|
---|
| 275 | echo ini_get( 'memory_limit' );
|
---|
| 276 | echo "</text><br />";
|
---|
| 277 |
|
---|
[160] | 278 | echo "<label>post_max_size:</label><text>";
|
---|
| 279 | echo ini_get( 'post_max_size' );
|
---|
| 280 | echo "</text><br />";
|
---|
| 281 | echo "<label>upload_max_filesize:</label><text>";
|
---|
| 282 | echo ini_get( 'upload_max_filesize' );
|
---|
| 283 | echo "</text><br />";
|
---|
| 284 | echo "<label>display_errors:</label><text>";
|
---|
| 285 | echo ( ini_get( 'display_errors' )) ? "ON" : "OFF";
|
---|
| 286 | echo "</text><br />";
|
---|
| 287 | echo "<label>MB extension:</label><text>";
|
---|
| 288 | echo ( extension_loaded( 'mbstring' )) ? "ON" : "OFF";
|
---|
| 289 | echo "</text><br />";
|
---|
| 290 | echo "<label>mbstring.language:</label><text>";
|
---|
| 291 | echo ini_get( 'mbstring.language' );
|
---|
| 292 | echo "</text><br />";
|
---|
| 293 | echo "<label>mbstring.encoding_translation:</label><text>";
|
---|
| 294 | echo ( ini_get( 'mbstring.encoding_translation' )) ? "ON" : "OFF";
|
---|
| 295 | echo "</text><br />";
|
---|
| 296 | echo "<label>mbstring.internal_encoding:</label><text>";
|
---|
| 297 | echo ini_get( 'mbstring.internal_encoding' );
|
---|
| 298 | echo "</text><br />";
|
---|
| 299 | echo "<label>mbstring.http_input:</label><text>";
|
---|
| 300 | echo ini_get( 'mbstring.http_input' );
|
---|
| 301 | echo "</text><br />";
|
---|
| 302 | echo "<label>mbstring.http_output:</label><text>";
|
---|
| 303 | echo ini_get( 'mbstring.http_output' );
|
---|
| 304 | echo "</text><br />";
|
---|
| 305 | echo "<label>mbstring.detect_order:</label><text>";
|
---|
| 306 | echo ini_get( 'mbstring.detect_order' );
|
---|
| 307 | echo "</text><br />";
|
---|
| 308 | echo "<label>mbstring.substitute_character:</label><text>";
|
---|
| 309 | echo ini_get( 'mbstring.substitute_character' );
|
---|
| 310 | echo "</text><br />";
|
---|
| 311 | echo "<label>mbstring.func_overload:</label><text>";
|
---|
| 312 | echo ( ini_get( 'mbstring.func_overload' )) ? "ON" : "OFF";
|
---|
| 313 | echo "</text><br />";
|
---|
| 314 | echo "</div>";
|
---|
[511] | 315 | echo '</legend>';
|
---|
[160] | 316 | echo "</fieldset><br />";
|
---|
| 317 | }
|
---|
| 318 | }
|
---|
| 319 |
|
---|
[507] | 320 |
|
---|
| 321 | function xpress_config_report_view()
|
---|
[160] | 322 | {
|
---|
| 323 | require_once dirname(dirname( __FILE__ )).'/class/config_from_xoops.class.php' ;
|
---|
| 324 | $xoops_config = new ConfigFromXoops;
|
---|
[507] | 325 | echo 'XOOPS_ROOT_PATH: ' ;
|
---|
| 326 | if(XOOPS_ROOT_PATH !== $xoops_config->xoops_root_path)
|
---|
| 327 | echo 'ERROR ';
|
---|
| 328 | else
|
---|
| 329 | echo 'OK ';
|
---|
| 330 | echo "<br />\n";
|
---|
[160] | 331 |
|
---|
[507] | 332 | echo 'XOOPS_TRUST_PATH: ' ;
|
---|
| 333 | if(XOOPS_TRUST_PATH !== $xoops_config->xoops_trust_path)
|
---|
| 334 | echo 'ERROR ';
|
---|
| 335 | else
|
---|
| 336 | echo 'OK ';
|
---|
| 337 | echo "<br />\n";
|
---|
| 338 |
|
---|
| 339 | echo 'XOOPS_URL: ' ;
|
---|
| 340 | if(XOOPS_URL !== $xoops_config->xoops_url)
|
---|
| 341 | echo 'ERROR ';
|
---|
| 342 | else
|
---|
| 343 | echo 'OK ';
|
---|
| 344 | echo "<br />\n";
|
---|
| 345 |
|
---|
| 346 | if (defined('XOOPS_SALT')){
|
---|
| 347 | echo 'XOOPS_SALT: ' ;
|
---|
| 348 | if(XOOPS_SALT !== $xoops_config->xoops_salt)
|
---|
[160] | 349 | echo 'ERROR ';
|
---|
| 350 | else
|
---|
| 351 | echo 'OK ';
|
---|
| 352 | echo "<br />\n";
|
---|
[507] | 353 | }
|
---|
[160] | 354 |
|
---|
[507] | 355 | if (defined('XOOPS_DB_SALT')){
|
---|
| 356 | echo 'XOOPS_DB_SALT: ' ;
|
---|
| 357 | if(XOOPS_DB_SALT !== $xoops_config->xoops_db_salt)
|
---|
[160] | 358 | echo 'ERROR ';
|
---|
| 359 | else
|
---|
| 360 | echo 'OK ';
|
---|
| 361 | echo "<br />\n";
|
---|
[507] | 362 | }
|
---|
[160] | 363 |
|
---|
[507] | 364 | echo 'XOOPS_DB_HOST: ' ;
|
---|
| 365 | if(XOOPS_DB_HOST !== $xoops_config->xoops_db_host)
|
---|
| 366 | echo 'ERROR ';
|
---|
| 367 | else
|
---|
| 368 | echo 'OK ';
|
---|
| 369 | echo "<br />\n";
|
---|
[160] | 370 |
|
---|
[507] | 371 | echo 'XOOPS_DB_USER: ' ;
|
---|
| 372 | if(XOOPS_DB_USER !== $xoops_config->xoops_db_user)
|
---|
| 373 | echo 'ERROR ';
|
---|
| 374 | else
|
---|
| 375 | echo 'OK ';
|
---|
| 376 | echo "<br />\n";
|
---|
[160] | 377 |
|
---|
[507] | 378 | echo 'XOOPS_DB_PASS: ' ;
|
---|
| 379 | if(XOOPS_DB_PASS !== $xoops_config->xoops_db_pass)
|
---|
| 380 | echo 'ERROR ';
|
---|
| 381 | else
|
---|
| 382 | echo 'OK ';
|
---|
| 383 | echo "<br />\n";
|
---|
[160] | 384 |
|
---|
[507] | 385 | echo 'XOOPS_DB_NAME: ' ;
|
---|
| 386 | if(XOOPS_DB_NAME !== $xoops_config->xoops_db_name)
|
---|
| 387 | echo 'ERROR ';
|
---|
| 388 | else
|
---|
| 389 | echo 'OK ';
|
---|
| 390 | echo "<br />\n";
|
---|
[160] | 391 |
|
---|
[507] | 392 | echo 'XOOPS_DB_PREFIX: ' ;
|
---|
| 393 | if(XOOPS_DB_PREFIX !== $xoops_config->xoops_db_prefix)
|
---|
| 394 | echo 'ERROR ';
|
---|
| 395 | else
|
---|
| 396 | echo 'OK ';
|
---|
| 397 | echo "<br />\n";
|
---|
| 398 | }
|
---|
[160] | 399 |
|
---|
[507] | 400 | function xpress_config_nomal_view()
|
---|
| 401 | {
|
---|
| 402 | require_once dirname(dirname( __FILE__ )).'/class/config_from_xoops.class.php' ;
|
---|
| 403 | $xoops_config = new ConfigFromXoops;
|
---|
| 404 |
|
---|
| 405 | echo '<table width="400" cellspacing="1" cellpadding="1" border="1">';
|
---|
| 406 | echo '<tbody>';
|
---|
| 407 | echo '<tr>';
|
---|
| 408 | echo '<td>Define item</td>';
|
---|
| 409 | echo '<td>XOOPS setting value</td>';
|
---|
| 410 | echo '<td>xoops_config get value</td>';
|
---|
| 411 | echo '</tr>';
|
---|
| 412 | echo '<tr>';
|
---|
| 413 | if(XOOPS_ROOT_PATH !== $xoops_config->xoops_root_path)
|
---|
| 414 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_ROOT_PATH</span></strong></td>';
|
---|
| 415 | else
|
---|
| 416 | echo '<td>XOOPS_ROOT_PATH</td>';
|
---|
| 417 | echo '<td>' . XOOPS_ROOT_PATH . '</td>';
|
---|
| 418 | echo '<td>' . $xoops_config->xoops_root_path . '</td>';
|
---|
| 419 | echo '</tr>';
|
---|
[160] | 420 |
|
---|
[507] | 421 | echo '<tr>';
|
---|
| 422 | if(XOOPS_TRUST_PATH !== $xoops_config->xoops_trust_path)
|
---|
| 423 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_TRUST_PATH</span></strong></td>';
|
---|
| 424 | else
|
---|
| 425 | echo '<td>XOOPS_TRUST_PATH</td>';
|
---|
| 426 | echo '<td>' . XOOPS_TRUST_PATH . '</td>';
|
---|
| 427 | echo '<td>' . $xoops_config->xoops_trust_path . '</td>';
|
---|
| 428 | echo '</tr>';
|
---|
[160] | 429 |
|
---|
[507] | 430 | echo '<tr>';
|
---|
| 431 | if(XOOPS_URL !== $xoops_config->xoops_url)
|
---|
| 432 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_URL</span></strong></td>';
|
---|
| 433 | else
|
---|
| 434 | echo '<td>XOOPS_URL</td>';
|
---|
| 435 | echo '<td>' . XOOPS_URL . '</td>';
|
---|
| 436 | echo '<td>' . $xoops_config->xoops_url . '</td>';
|
---|
| 437 | echo '</tr>';
|
---|
[160] | 438 |
|
---|
[507] | 439 | if (defined('XOOPS_SALT')){
|
---|
[160] | 440 | echo '<tr>';
|
---|
[507] | 441 | if(XOOPS_SALT !== $xoops_config->xoops_salt)
|
---|
| 442 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_SALT</span></strong></td>';
|
---|
[160] | 443 | else
|
---|
[507] | 444 | echo '<td>XOOPS_SALT</td>';
|
---|
| 445 | echo '<td>' . XOOPS_SALT . '</td>';
|
---|
| 446 | echo '<td>' . $xoops_config->xoops_salt . '</td>';
|
---|
[160] | 447 | echo '</tr>';
|
---|
[507] | 448 | }
|
---|
[160] | 449 |
|
---|
[507] | 450 | if (defined('XOOPS_DB_SALT')){
|
---|
[160] | 451 | echo '<tr>';
|
---|
[507] | 452 | if(XOOPS_DB_SALT !== $xoops_config->xoops_db_salt)
|
---|
| 453 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_SALT</span></strong></td>';
|
---|
[160] | 454 | else
|
---|
[507] | 455 | echo '<td>XOOPS_DB_SALT</td>';
|
---|
| 456 | echo '<td>' . XOOPS_DB_SALT . '</td>';
|
---|
| 457 | echo '<td>' . $xoops_config->xoops_db_salt . '</td>';
|
---|
[160] | 458 | echo '</tr>';
|
---|
[507] | 459 | }
|
---|
[160] | 460 |
|
---|
[507] | 461 | echo '<tr>';
|
---|
| 462 | if(XOOPS_DB_HOST !== $xoops_config->xoops_db_host)
|
---|
| 463 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_HOST</span></strong></td>';
|
---|
| 464 | else
|
---|
| 465 | echo '<td>XOOPS_DB_HOST</td>';
|
---|
| 466 | echo '<td>' . XOOPS_DB_HOST . '</td>';
|
---|
| 467 | echo '<td>' . $xoops_config->xoops_db_host . '</td>';
|
---|
| 468 | echo '</tr>';
|
---|
[160] | 469 |
|
---|
[507] | 470 | echo '<tr>';
|
---|
| 471 | if(XOOPS_DB_USER !== $xoops_config->xoops_db_user)
|
---|
| 472 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_USER</span></strong></td>';
|
---|
| 473 | else
|
---|
| 474 | echo '<td>XOOPS_DB_USER</td>';
|
---|
| 475 | echo '<td>' . XOOPS_DB_USER . '</td>';
|
---|
| 476 | echo '<td>' . $xoops_config->xoops_db_user . '</td>';
|
---|
| 477 | echo '</tr>';
|
---|
[160] | 478 |
|
---|
[507] | 479 | echo '<tr>';
|
---|
| 480 | if(XOOPS_DB_PASS !== $xoops_config->xoops_db_pass)
|
---|
| 481 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_PASS</span></strong></td>';
|
---|
| 482 | else
|
---|
| 483 | echo '<td>XOOPS_DB_PASS</td>';
|
---|
| 484 | echo '<td>' . XOOPS_DB_PASS . '</td>';
|
---|
| 485 | echo '<td>' . $xoops_config->xoops_db_pass . '</td>';
|
---|
| 486 | echo '</tr>';
|
---|
[160] | 487 |
|
---|
[507] | 488 | echo '<tr>';
|
---|
| 489 | if(XOOPS_DB_NAME !== $xoops_config->xoops_db_name)
|
---|
| 490 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_NAME</span></strong></td>';
|
---|
| 491 | else
|
---|
| 492 | echo '<td>XOOPS_DB_NAME</td>';
|
---|
| 493 | echo '<td>' . XOOPS_DB_NAME . '</td>';
|
---|
| 494 | echo '<td>' . $xoops_config->xoops_db_name . '</td>';
|
---|
| 495 | echo '</tr>';
|
---|
[160] | 496 |
|
---|
[507] | 497 | echo '<tr>';
|
---|
| 498 | if(XOOPS_DB_PREFIX !== $xoops_config->xoops_db_prefix)
|
---|
| 499 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_PREFIX</span></strong></td>';
|
---|
| 500 | else
|
---|
| 501 | echo '<td>XOOPS_DB_PREFIX</td>';
|
---|
| 502 | echo '<td>' . XOOPS_DB_PREFIX . '</td>';
|
---|
| 503 | echo '<td>' . $xoops_config->xoops_db_prefix . '</td>';
|
---|
| 504 | echo '</tr>';
|
---|
| 505 | echo '</tbody>';
|
---|
| 506 | echo '</table>';
|
---|
| 507 | }
|
---|
| 508 | function xpress_config_from_xoops_view($is_report = false)
|
---|
| 509 | {
|
---|
[510] | 510 | global $xoopsUserIsAdmin,$xoopsUser;
|
---|
[160] | 511 |
|
---|
[735] | 512 | $user_groups = $xoopsUser->getGroups();
|
---|
[510] | 513 | $is_admin_group = in_array('1',$user_groups);
|
---|
| 514 |
|
---|
[507] | 515 | require_once dirname(dirname( __FILE__ )).'/class/config_from_xoops.class.php' ;
|
---|
| 516 | $xoops_config = new ConfigFromXoops;
|
---|
| 517 | if ($is_report) {
|
---|
| 518 | echo "******** " . _AM_XP2_XOOPS_CONFIG_INFO . "********" . "<br />\n";
|
---|
| 519 | xpress_config_report_view();
|
---|
| 520 | echo "<br />\n";
|
---|
| 521 | } else {
|
---|
| 522 | echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XP2_XOOPS_CONFIG_INFO . "</legend>";
|
---|
| 523 | echo "<div style='padding: 8px;'>";
|
---|
[510] | 524 | if ($xoopsUserIsAdmin && $is_admin_group){
|
---|
[507] | 525 | xpress_config_nomal_view();
|
---|
| 526 | } else {
|
---|
| 527 | xpress_config_report_view();
|
---|
| 528 | }
|
---|
[160] | 529 | echo "</div>";
|
---|
[511] | 530 | echo '</legend>';
|
---|
[160] | 531 | echo "</fieldset><br />";
|
---|
| 532 | }
|
---|
| 533 | }
|
---|
| 534 |
|
---|
| 535 | function xpress_state($is_report = false)
|
---|
| 536 | {
|
---|
[749] | 537 | global $xoopsModule,$xoopsDB;
|
---|
[160] | 538 | include(dirname(__FILE__) . '/../wp-includes/version.php');
|
---|
[416] | 539 | include_once(dirname(__FILE__) . '/../include/general_functions.php');
|
---|
[160] | 540 |
|
---|
| 541 |
|
---|
| 542 | $xp_prefix = $GLOBALS['xoopsModule']->getInfo('dirname');
|
---|
[583] | 543 | $xp_prefix = preg_replace('/wordpress/','wp',$xp_prefix);
|
---|
[160] | 544 |
|
---|
| 545 | $prefix = $xoopsDB->prefix($xp_prefix . '_');
|
---|
[414] | 546 |
|
---|
| 547 | $posts_tables = get_table_list($prefix,'posts');
|
---|
| 548 | $blogname = array();
|
---|
| 549 | $count_article = array();
|
---|
| 550 | $count_author = array();
|
---|
| 551 | $count_category = array();
|
---|
| 552 | $array_index = 0;
|
---|
| 553 | foreach( $posts_tables as $posts_table){
|
---|
| 554 | $sql = "SELECT COUNT(DISTINCT post_author) AS count_author, COUNT(*) AS count_article FROM ". $posts_table . " WHERE post_type = 'post' AND (post_status = 'publish' OR post_status = 'private')";
|
---|
| 555 | $result = $xoopsDB->query($sql);
|
---|
| 556 | if($myrow = $xoopsDB->fetchArray($result)){
|
---|
| 557 | $count_article[$array_index] = $myrow["count_article"];
|
---|
| 558 | $count_author[$array_index] = $myrow["count_author"];
|
---|
| 559 | } else {
|
---|
| 560 | $count_article[$array_index] = 0;
|
---|
| 561 | $count_author[$array_index] = 0;
|
---|
| 562 | }
|
---|
| 563 | $mid_prefix = get_multi_mid_prefix($prefix,'posts' , $posts_table);
|
---|
| 564 |
|
---|
| 565 | $sql = "SELECT option_value AS blogname FROM ".$prefix. $mid_prefix . "options" . " WHERE option_name = 'blogname'";
|
---|
| 566 | $result = $xoopsDB->query($sql);
|
---|
| 567 | if($myrow = $xoopsDB->fetchArray($result)){
|
---|
| 568 | $blogname[$array_index] = $myrow["blogname"];
|
---|
| 569 | } else {
|
---|
| 570 | $blogname[$array_index] = 'none name';
|
---|
| 571 | }
|
---|
| 572 |
|
---|
| 573 | if ($wp_db_version < 6124){
|
---|
| 574 |
|
---|
| 575 | $sql = "SELECT COUNT(*) AS count_category FROM ".$prefix. $mid_prefix . "categories";
|
---|
| 576 | } else {
|
---|
| 577 | $sql = "SELECT COUNT(*) AS count_category FROM ".$prefix. $mid_prefix . "term_taxonomy" . " WHERE taxonomy = 'category'";
|
---|
| 578 | }
|
---|
| 579 | $result = $xoopsDB->query($sql);
|
---|
| 580 | if($myrow = $xoopsDB->fetchArray($result)){
|
---|
| 581 | $count_category[$array_index] = $myrow["count_category"];
|
---|
| 582 | } else {
|
---|
| 583 | $count_category[$array_index] = 0;
|
---|
| 584 | }
|
---|
| 585 | $array_index++;
|
---|
[160] | 586 | }
|
---|
[414] | 587 | for ($i = 0 ; $i < $array_index ; $i++){
|
---|
| 588 | if ($is_report){
|
---|
| 589 | echo "******** " . $blogname[$i] . _AM_XP2_STATS . "********" . "<br />\n";
|
---|
| 590 | echo _AM_XP2_CATEGORIES .": ".@$count_category[$i]. "<br />\n";
|
---|
| 591 | echo _AM_XP2_ARTICLES .": ". $count_article[$i]. "<br />\n";
|
---|
| 592 | echo _AM_XP2_AUTHORS .": ". $count_author[$i]. "<br />\n";
|
---|
| 593 |
|
---|
| 594 | } else {
|
---|
| 595 | echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . $blogname[$i] . _AM_XP2_STATS . "</legend>";
|
---|
| 596 | echo "<div style='padding: 8px;'>";
|
---|
| 597 | echo "<label>" . _AM_XP2_CATEGORIES .":</label><text>".@$count_category[$i];
|
---|
| 598 | echo "</text><br />";
|
---|
| 599 | echo "<label>" . _AM_XP2_ARTICLES .":</label><text>". $count_article[$i];
|
---|
| 600 | echo "</text><br />";
|
---|
| 601 | echo "<label>" . _AM_XP2_AUTHORS .":</label><text>". $count_author[$i];
|
---|
| 602 | echo "</text>";
|
---|
| 603 | echo "</div>";
|
---|
[511] | 604 | echo '</legend>';
|
---|
[414] | 605 | echo "</fieldset>";
|
---|
| 606 | }
|
---|
[160] | 607 | }
|
---|
| 608 | }
|
---|
[518] | 609 |
|
---|
[517] | 610 | function xpress_group_role_state($is_report = false)
|
---|
| 611 | {
|
---|
[749] | 612 | global $xoopsModule,$xoopsDB;
|
---|
[517] | 613 | $xp_prefix = $GLOBALS['xoopsModule']->getInfo('dirname');
|
---|
[583] | 614 | $xp_prefix = preg_replace('/wordpress/','wp',$xp_prefix);
|
---|
[517] | 615 | $prefix = $xoopsDB->prefix($xp_prefix . '_');
|
---|
| 616 | $group_role_tables = $prefix.'group_role';
|
---|
| 617 | $sql = "SELECT groupid , name AS xoops_groupe ,group_type, role , login_all FROM ". $group_role_tables;
|
---|
| 618 | $result = $xoopsDB->query($sql);
|
---|
| 619 | if ($is_report){
|
---|
| 620 | echo "******** " . _AM_XP2_GROUP_ROLE . "********" . "<br />\n";
|
---|
| 621 | } else {
|
---|
| 622 | echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XP2_GROUP_ROLE . "</legend>";
|
---|
| 623 | echo "<div style='padding: 8px;'>";
|
---|
| 624 | echo '<table width="400" cellspacing="1" cellpadding="1" border="1">';
|
---|
| 625 | echo '<tbody>';
|
---|
| 626 | echo '<tr>';
|
---|
| 627 | echo '<td>GROUP</td>';
|
---|
| 628 | echo '<td>GROUPE TYPE</td>';
|
---|
| 629 | echo '<td>ROLE</td>';
|
---|
| 630 | echo '<td>Allways Check</td>';
|
---|
| 631 | echo '</tr>';
|
---|
| 632 | }
|
---|
| 633 | $groupe_list = '';
|
---|
| 634 | while ($myrow = $xoopsDB->fetchArray($result)){
|
---|
| 635 | $xoops_groupe = $myrow["xoops_groupe"] ;
|
---|
| 636 | $group_type = empty($myrow["group_type"]) ? "None" : $myrow["group_type"] ;
|
---|
| 637 | $role = empty($myrow["role"]) ? "inhibit register" : $myrow["role"] ;
|
---|
| 638 | $login_all = empty($myrow["login_all"]) ? 'No' : 'Yes' ;
|
---|
| 639 | if (!empty($groupe_list)) $groupe_list .= ',';
|
---|
| 640 | $groupe_list .= $myrow["groupid"];
|
---|
| 641 | if ($is_report){
|
---|
| 642 | echo $xoops_groupe . ' : ';
|
---|
| 643 | echo '(' . $group_type. ') : ';
|
---|
| 644 | echo $role;
|
---|
| 645 | echo '(' . $login_all. ') : ';
|
---|
| 646 | echo '<br />';
|
---|
| 647 | } else {
|
---|
| 648 | echo '<tr>';
|
---|
| 649 | echo '<td>' . $xoops_groupe . '</td>';
|
---|
| 650 | echo '<td>' . $group_type . '</td>';
|
---|
| 651 | echo '<td>' . $role . '</td>';
|
---|
| 652 | echo '<td>' . $login_all . '</td>';
|
---|
| 653 | echo '</tr>';
|
---|
| 654 | }
|
---|
| 655 | }
|
---|
| 656 | if ($is_report){
|
---|
| 657 | echo "<br />";
|
---|
| 658 | } else {
|
---|
| 659 | echo '</tbody>';
|
---|
| 660 | echo '</table>';
|
---|
| 661 | echo "</div>";
|
---|
| 662 | echo '</legend>';
|
---|
| 663 | echo "</fieldset><br />";
|
---|
| 664 | }
|
---|
| 665 | }
|
---|
[199] | 666 | function xpress_block_state($is_report = false)
|
---|
| 667 | {
|
---|
[491] | 668 | $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
|
---|
| 669 |
|
---|
[199] | 670 | include_once(dirname(dirname(__FILE__) ). '/class/check_blocks_class.php');
|
---|
| 671 | $xoops_block_check =& xoops_block_check::getInstance();
|
---|
[491] | 672 | $xoops_block_check->check_blocks($mydirname);
|
---|
[199] | 673 | if ($is_report){
|
---|
| 674 | echo "******** " . _AM_XP2_BLOCK_STATS . "********" . "<br />\n";
|
---|
| 675 | echo $xoops_block_check->get_message();
|
---|
| 676 | echo "<br />\n";
|
---|
| 677 | echo "<br />\n";
|
---|
| 678 | } else {
|
---|
| 679 | echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XP2_BLOCK_STATS . "</legend>";
|
---|
| 680 | echo "<div style='padding: 8px;'>";
|
---|
| 681 | echo $xoops_block_check->get_message();
|
---|
| 682 | echo "</div>";
|
---|
[511] | 683 | echo '</legend>';
|
---|
| 684 | echo "</fieldset><br />";
|
---|
[199] | 685 | }
|
---|
| 686 | }
|
---|
[511] | 687 |
|
---|
| 688 | function xpress_block_options($is_report = false)
|
---|
| 689 | {
|
---|
[749] | 690 | global $xoopsModule;
|
---|
[511] | 691 | $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
|
---|
| 692 |
|
---|
| 693 | $module_objs = & get_module_objects($mydirname);
|
---|
| 694 | $module_obj = $module_objs[0];
|
---|
[749] | 695 | $mod_id = $xoopsModule->getVar('mid', 'n');
|
---|
[511] | 696 | $blocks = & get_block_object_orber_num_bymodule_id( $mod_id );
|
---|
[749] | 697 | $infos = $xoopsModule->getInfo('blocks');
|
---|
[511] | 698 | if ($is_report){
|
---|
| 699 | echo "******** " . _AM_XP2_BLOCK_OPTIONS . "********" . "<br />\n";
|
---|
| 700 | foreach ( $blocks as $block )
|
---|
| 701 | {
|
---|
| 702 | echo $block->getVar('title') . ' : ' . $block->getVar('options') . '<br />';
|
---|
| 703 | }
|
---|
| 704 | echo "<br />\n";
|
---|
| 705 | } else {
|
---|
| 706 | echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XP2_BLOCK_OPTIONS . "</legend>";
|
---|
| 707 | echo "<div style='padding: 8px;'>";
|
---|
| 708 | echo '<table width="400" cellspacing="1" cellpadding="1" border="1">';
|
---|
| 709 | echo '<tbody>';
|
---|
| 710 | echo '<tr>';
|
---|
| 711 | echo '<td>Title</td>';
|
---|
| 712 | echo '<td>Options</td>';
|
---|
| 713 | echo '</tr>';
|
---|
| 714 | foreach ( $blocks as $block )
|
---|
| 715 | {
|
---|
| 716 | echo '<tr>';
|
---|
| 717 | echo '<td>' . $block->getVar('title') . '</td>';
|
---|
| 718 | echo '<td>' . $block->getVar('options') . '</td>';
|
---|
| 719 | echo '</tr>';
|
---|
| 720 | }
|
---|
| 721 | echo '</tbody>';
|
---|
| 722 | echo '</table>';
|
---|
| 723 | echo '</div>';
|
---|
| 724 | echo '</legend>';
|
---|
| 725 | echo "</fieldset><br />";
|
---|
| 726 | }
|
---|
| 727 |
|
---|
| 728 | }
|
---|
| 729 | //--------------------------------------------------------
|
---|
| 730 | // module handler
|
---|
| 731 | //--------------------------------------------------------
|
---|
| 732 | function &get_module_objects($module_dir)
|
---|
| 733 | {
|
---|
| 734 | $criteria = new CriteriaCompo();
|
---|
| 735 | $criteria->add( new Criteria('isactive', '1', '=') );
|
---|
| 736 | $criteria->add( new Criteria('dirname', $module_dir, '=') );
|
---|
| 737 |
|
---|
| 738 | $module_handler =& xoops_gethandler('module');
|
---|
| 739 | $objs =& $module_handler->getObjects( $criteria );
|
---|
| 740 | return $objs;
|
---|
| 741 | }
|
---|
| 742 |
|
---|
| 743 | //--------------------------------------------------------
|
---|
| 744 | // block handler
|
---|
| 745 | //--------------------------------------------------------
|
---|
| 746 | function &get_block_object_orber_num_bymodule_id( $mid )
|
---|
| 747 | {
|
---|
| 748 | $arr = array();
|
---|
| 749 | $objs =& get_block_object_bymodule_id( $mid );
|
---|
| 750 | foreach ( $objs as $obj )
|
---|
| 751 | {
|
---|
| 752 | $arr[ $obj->getVar('func_num', 'n') ] = $obj;
|
---|
| 753 | }
|
---|
| 754 | return $arr;
|
---|
| 755 | }
|
---|
| 756 |
|
---|
| 757 | function &get_block_object_bymodule_id( $mid, $asobject=true )
|
---|
| 758 | {
|
---|
| 759 | if ( defined('ICMS_VERSION_BUILD') && ICMS_VERSION_BUILD > 27 ) { /* ImpressCMS 1.2+ */
|
---|
| 760 | $block_handler =& xoops_gethandler ('block');
|
---|
| 761 | $objs =& $block_handler->getByModule( $mid, $asobject );
|
---|
| 762 | } else { /* legacy support */
|
---|
| 763 | $objs =& XoopsBlock::getByModule( $mid, $asobject ) ; /* from class/xoopsblock.php */
|
---|
| 764 | }
|
---|
| 765 | return $objs;
|
---|
| 766 | }
|
---|
| 767 |
|
---|
| 768 |
|
---|
| 769 |
|
---|
[299] | 770 | $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
|
---|
| 771 | $mydirpath = dirname( dirname( __FILE__ ) ) ;
|
---|
[308] | 772 | //require_once($mydirpath.'/wp-config.php');
|
---|
[744] | 773 |
|
---|
[170] | 774 | require_once '../../../include/cp_header.php' ;
|
---|
| 775 | //require_once '../include/gtickets.php' ;
|
---|
[308] | 776 | //define( '_MYMENU_CONSTANT_IN_MODINFO' , '_MI_XP2_NAME' ) ;
|
---|
[160] | 777 |
|
---|
[170] | 778 | // branch for altsys
|
---|
| 779 | if( defined( 'XOOPS_TRUST_PATH' ) && ! empty( $_GET['lib'] ) ) {
|
---|
| 780 |
|
---|
| 781 | // common libs (eg. altsys)
|
---|
| 782 | $lib = preg_replace( '/[^a-zA-Z0-9_-]/' , '' , $_GET['lib'] ) ;
|
---|
| 783 | $page = preg_replace( '/[^a-zA-Z0-9_-]/' , '' , @$_GET['page'] ) ;
|
---|
| 784 |
|
---|
| 785 | if( file_exists( XOOPS_TRUST_PATH.'/libs/'.$lib.'/'.$page.'.php' ) ) {
|
---|
| 786 | include XOOPS_TRUST_PATH.'/libs/'.$lib.'/'.$page.'.php' ;
|
---|
| 787 | } else if( file_exists( XOOPS_TRUST_PATH.'/libs/'.$lib.'/index.php' ) ) {
|
---|
| 788 | include XOOPS_TRUST_PATH.'/libs/'.$lib.'/index.php' ;
|
---|
| 789 | } else {
|
---|
| 790 | die( 'wrong request' ) ;
|
---|
| 791 | }
|
---|
| 792 | exit ;
|
---|
| 793 | }
|
---|
[744] | 794 | include_once $mydirpath .'/include/wp_check.php' ;
|
---|
[170] | 795 |
|
---|
[308] | 796 | // beggining of Output
|
---|
[61] | 797 | xoops_cp_header();
|
---|
[744] | 798 | if(is_wpdb_installed()){
|
---|
| 799 | include( './mymenu.php' ) ;
|
---|
[308] | 800 |
|
---|
[744] | 801 | echo "
|
---|
| 802 | <style type=\"text/css\">
|
---|
| 803 | label,text {
|
---|
| 804 | display: block;
|
---|
| 805 | float: left;
|
---|
| 806 | margin-bottom: 2px;
|
---|
| 807 | }
|
---|
| 808 | label {
|
---|
| 809 | text-align: right;
|
---|
| 810 | width: 200px;
|
---|
| 811 | padding-right: 20px;
|
---|
| 812 | }
|
---|
| 813 | br {
|
---|
| 814 | clear: left;
|
---|
| 815 | }
|
---|
| 816 | </style>
|
---|
| 817 | ";
|
---|
| 818 | if (!empty($_POST['submit_report'])) $report = true; else $report = false;
|
---|
| 819 | xpress_sys_info($report);
|
---|
| 820 | xpress_config_from_xoops_view($report);
|
---|
| 821 | xpress_active_plugin_list($report);
|
---|
| 822 | xpress_block_state($report);
|
---|
| 823 | xpress_block_options($report);
|
---|
| 824 | xpress_group_role_state($report);
|
---|
| 825 | admin_check_user_meta_prefix($report);
|
---|
| 826 | xpress_state($report);
|
---|
| 827 | echo '<form method="POST">'."\n";
|
---|
| 828 | echo '<input type="submit" name="submit_report" value="' . _AM_XP2_SYS_REPORT .' " />'.' ';
|
---|
| 829 | echo '<input type="submit" name="submit_normal" value="' . _AM_XP2_SYS_NORMAL .' " />'."<br />\n";
|
---|
| 830 | echo "</form>\n";
|
---|
| 831 | } else {
|
---|
[107] | 832 |
|
---|
[744] | 833 | include_once $mydirpath .'/include/wp_installer.php' ;
|
---|
| 834 | if (!empty($_POST['submit_install'])) {
|
---|
| 835 | $i_mess = wp_installer($mydirname);
|
---|
| 836 | foreach( $i_mess as $message ) {
|
---|
| 837 | echo $message ;
|
---|
| 838 | }
|
---|
[107] | 839 |
|
---|
[744] | 840 | } else {
|
---|
| 841 | echo '<font size="5" color="#ff0000">'. _AM_XP2_NO_WP. '</font><br /><br />';
|
---|
| 842 |
|
---|
| 843 | if (xp_permission_check($mydirname , $mydirpath)){
|
---|
| 844 | echo '<form method="POST">'."\n";
|
---|
| 845 | echo '<input type="submit" name="submit_install" value="' . _AM_XP2_WP_INSTALL .' " />'.' ';
|
---|
| 846 | echo "</form>\n";
|
---|
| 847 | } else {
|
---|
| 848 | include_once $mydirpath .'/admin/help/wp_install_help.php' ;
|
---|
| 849 | wp_install_guide();
|
---|
| 850 | echo '<form method="POST">'."\n";
|
---|
| 851 | echo '<input type="submit" name="submit_recheck" value="' . _AM_XP2_WP_RE_CHK .' " />'.' ';
|
---|
| 852 | echo "</form>\n";
|
---|
| 853 | }
|
---|
| 854 | }
|
---|
| 855 | }
|
---|
[160] | 856 | xoops_cp_footer();
|
---|
[107] | 857 |
|
---|
[61] | 858 |
|
---|
| 859 | ?> |
---|