Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-18-2008, 10:36 PM
SirShaw SirShaw is offline
 
Join Date: Mar 2002
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:36 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.06408 seconds
  • Memory Usage 2,219KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_threadedmode.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete