vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   problems after upgrading to 3.7.0 (https://vborg.vbsupport.ru/showthread.php?t=179730)

SirShaw 05-18-2008 10:36 PM

problems after upgrading to 3.7.0
 
hi all, I posted this on vbulletin.com as well but was hoping some of you modders out there may have an idea

on my site: http://www.knightsofkarbala.com I run I have a custom server script (phgstats) that shows all my servers. After i upgraded to vbulletin 3.7.0 it no longer displays. I had some help from a friend that knows php and we used the vbulletin plugin system to write the following:

Code:

ob_start();
// get data of server
function info_n($phgdir, $sh_srv, $game, $host, $port, $queryport)
{
    // create server the object
    $phgstats_n = phgstats_n::query($game[$sh_srv]);

    // get the serverinfo string
    $server = $phgstats_n->getstream($host[$sh_srv], $port[$sh_srv], $queryport[$sh_srv]);

    if ($server === true)
    {
        // get the server rules
        $srv_rules  = $phgstats_n->getrules($phgdir);
        $srv_rules['playerlist'] = $phgstats_n->getplayers();

        // full path to the map picture
        $srv_rules['map'] = $phgdir . $srv_rules['map_path'] . '/' . $srv_rules['mapname'] . '.jpg';
    $srv_rules['fullmappath'] = PHGDIR . $srv_rules['map_path'] . '/' . $srv_rules['mapname'] . '.jpg';

        if (!(file_exists($srv_rules['fullmappath'])))
        { // set default map if no picture found
            $srv_rules['map'] = $phgdir . $srv_rules['map_path'] . '/' . $srv_rules['map_default'];
        }
    }
    else
    {
        // default values if no response
        $msg = 'No Response';
        $srv_rules['playerlist'] = '';

        $srv_rules['hostname']    = $msg;
        $srv_rules['gamename']    = $msg . "<br>";
        $srv_rules['map']        = $phgdir . 'maps/no_response.jpg';
        $srv_rules['mapname']    = 'no response';
        $srv_rules['sets']        = '-';
        $srv_rules['htmlinfo']    = '<tr valign="top"><td align="left">No</td><td align="left">Response</td></tr>' . "\n";
        $srv_rules['htmldetail'] = '<tr valign="top"><td align="left">No</td><td align="left">Response</td></tr>' . "\n";
    }

    // get server adress
    $srv_rules['adress'] = $host[$sh_srv] . ':' . $port[$sh_srv];

    return $srv_rules;
}

// show the data of two or more server
function srv_list_n ($sh_srv, $srv_rules, $use_file)
{
        // html: map picture
        echo '' . "\n"
      . '<link href="http://www.knightsofkarbala.com/modules/Phgstats/includes/stylephg.css" rel="stylesheet" type="text/css" />'
        . '<td class="tableblock" align="center">'
      . '<a href="./index.php?name=Server' . $sh_srv . '">'
        . '<img height="100" width="120" src="'
        . $srv_rules['map'] . '" border="0" alt="'
        . $srv_rules['mapname'] . '" title="'
        . $srv_rules['mapname'] . '"><br></a>' . "\n";

        // html: server ip and gamename
        echo ''
        . '<br><span style="color: #FFFFFF; background-color: #000000;">' . $srv_rules['hostname'] . '</span>'
      . '<br>'
        . $srv_rules['gamename']
      . '<br>'
      . '<br>' . "\n";

        // html: server details table
        echo '<table width="170" border="0" cellpadding="3" cellspacing="0">' . "\n"
      . $srv_rules['ip'] . $srv_rules['adress']
      . $srv_rules['players'] . '<a href="../index.php?name=Server' . $sh_srv . '">' . $srv_rules['players2'] . '</a>'
        . $srv_rules['htmlinfo']
        . "\n";
        if ($srv_rules['join'] !='')
        {
        echo $srv_rules['join'] . $srv_rules['adress'] . $srv_rules['join2'] .''
        . "\n";
        }
        echo '</table>' . "\n"
        . "\n";

        echo '</td>' . "\n";


}

if(defined('SHOW_GAME_SERVERS')){

define('PHGDIR', '/home/knigh6/public_html/modules/Phgstats/');
include_once(PHGDIR . 'settings/config_n.inc.php');    // phgstats configuration
include_once(PHGDIR . 'classes/phgstats_n.class.php');  // main phgstats class
$gameserver_n_old = $gameserver_n;

for ($i = (count($gameserver_n_old) - 1), $k = 0; $i >= 0; $i--, $k++)
{
        $gameserver_n[$k] = $gameserver_n_old[$i];
}

$phgdir = ('http://www.knightsofkarbala.com/modules/Phgstats/');

echo '<center>' . "\n";


// how much server must scan
$index = count($gameserver_n);

while($index)
{
  $index--;

  list($game[$index], $host[$index], $port[$index], $queryport[$index]) = split(':', $gameserver_n[$index]);
}


{
    $sh_srv = count($host);

        // html: open table to show more server
        echo '<table class="page" border="0" width="945" cellpadding="2" cellspacing="2">' . "\n";

        // html: gameserver list data
        while ($sh_srv)
        {
            $sh_srv--;
            $srv_rules = info_n($phgdir, $sh_srv, $game, $host, $port, $queryport);
            srv_list_n($sh_srv, $srv_rules, $use_file);
            flush();
        }

        // html: close table with server info
        echo '</table>';

}

echo '</center>';   
}
$server_contents = ob_get_contents();
ob_end_clean();

the $server_contents variable is then called in the header template after my navigation buttons.

Again the problem started as soon as I upgraded to vbulletin 3.7.0 and the latest version of vbadvanced. any ideas on a fix?

ps it also hooks on the vbulletin global_start


All times are GMT. The time now is 07:57 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00934 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete