TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,970
  • Latest: bynw
Stats
  • Total Posts: 196,048
  • Total Topics: 21,337
  • Online today: 230
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 178
  • Total: 179
  • Itchdog

Server Query

Started by HaxXxoR, April 16, 2006, 01:29:55 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

HaxXxoR

Yes the paths are changed, config is correct, It was a phpbox.
include('forum/SQuery/block-SQuery_tiny.php');


I still get a blank box. If i try and run it as a stand alone all i get is a blank page
http://tasty-fragism.com/forum/SQuery/block-SQuery_tiny.php

IchBin

I don't think your config is right if it doens't work as a stand alone script.

HaxXxoR

Here are the codes for the 2 files. If you can please do a look over and tell me what you think.

This is the code for my config.php

<?

// SQuery version 4.0 by Curtis Brown
// Based on code by David Cramer released to the public domain.


//########### CONFIGURATION BEGIN ############//

// Static display for Standalone and Module
// If you set this it will not display the query box, or any of your favorites, it will only show the server you put in below
//$static_ip = "67.18.175.110";
//$static_port = "16567";
//$static_game = "Battlefield 2";
   
// Static display for PHPNuke Block
// This must be set for the Block to work. Add a line for each server you want displayed in the block.
// SERVER IP, PORT, GAMETYPE
$block_servers = array (
"thewuh.servebeer.com, 27015, Cstrike:Source",
    "",
"",
"",
    "",
"",
"",
);

// Be sure to set this to your web site or the block won't work!
$websiteurl ="http://www.Tasty-Fragism.com";

// Display tips at bottom of query TRUE or FALSE
$displaytips=TRUE;
// Display IP Entry Form at Top TRUE or FALSE
$show_ip_entry_form=TRUE;

// Here you can add or change the tips



This is the code for my TinyBlock

<?
/************************************************************************/
/*  Squery 3.5 PHPNuke Block                                            */
/* =================================================                    */
/*                                                                      */
/* Copyright (c) 2004 Curtis Brown   (webmaster@squery.com)          */
/* http://www.squery.com                                                */
/*                                                                        */
/*                                                                        */
/* This Block requires that the standalone and module code be in place. */
/*                                                                           */
/* To configure:                                                          */
/* You must set your block_ip,block_port, and block_game in the         */
/* config.php file in the /SQuery/lib/ directory.                       */
/*                                                                         */
/************************************************************************/

//if (eregi("block-SQuery_tiny.php",$_SERVER['PHP_SELF'])) {
//    Header("Location: index.php");
//    die();
//}

error_reporting(0);
$libpath="/www/forum/SQuery/lib/";
// require our main library =)
require_once($libpath.'config.php');
require_once($libpath.'main.lib.php');
$libpath="/www/forum/SQuery/lib/";
//////////////////////////////////////////////////////////
function TinyqueryServer($address, $port, $protocol)
{
        global $libpath,$content;
  include_once($libpath."gsQuery.php");

  if(!$address && !$port && !$protocol) {
    echo "No parameters given\n";
    return FALSE;
  }

  $gameserver=gsQuery::createInstance($protocol, $address, $port);
  if(!$gameserver) {
    echo "Could not instantiate gsQuery class. Does the protocol you've specified exist?\n";
    return FALSE;
  }

  if(!$gameserver->query_server(TRUE, TRUE)) { // fetch everything
    // query was not succesful, dumping some debug info
    echo "<div>Error ".$gameserver->errstr."</div>\n";
    return FALSE;
  }

  return $gameserver;
}
//$content="";

echo '
<HEAD>
<meta http-equiv="Content-Language" content="en-us">
<STYLE>';

echo '
BODY {
        background: #545454;
        color: #c0c0c0;
}
BODY, TD, INPUT, A, SELECT {
        font-family: Tahoma;
        font-size: 8pt;
}
.tooltip_bg {
        background-color: #222222;
}
A.tooltip_close {
        color: #ffffff;
}
.tooltip_bg_text {
        color: #ffffff;
}
.tooltip_fg_text {
        color: #e7e7e7;
}
.tooltip_fg {
        background: #333333;
}
.color {
        color: e7e7e7;
}
.big {
        font-size: 12pt;
        font-family: Arial;
        color: #9999AA;
}
.nblock {
        font-size: 9pt;
        font-family: Arial;
        color: #000000;
}

// Q3 Color Codes
.gsquery-black { color: black; }
.gsquery-red { color: red; }
.gsquery-yellow { color: #E6E600; }
.gsquery-darkgreen { color: #FFF200; }
.gsquery-blue { color: blue; }
.gsquery-cyan { color: cyan; }
.gsquery-pink { color: pink; }
.gsquery-white { color: darkgrey; }
.gsquery-blue-night { color:#7F7FFD; }
.gsquery-red-night { color:#D06B6B; }

// colors for FarCry
.gsquery-light-blue { color: #00FFFF; }
.gsquery-green { color: green; }
.gsquery-orange { color: #FF9600; }
.gsquery-grey { color: #000099; }

.gsquery-1 { color: #FF1924;}
.gsquery-2 { color: #A0B965;}
.gsquery-3 { color: #F5F501;}
.gsquery-4 { color: #4A54EA;}
.gsquery-5 { color: #05FFFF;}
.gsquery-6 { color: #FF02FC;}
.gsquery-7 { color: #FFFFFF;}
.gsquery-8 { color: #7B00D5;}
.gsquery-9 { color: #7B00D5;}
.gsquery-0 { color: #000000;}
.gsquery-a { color: #30DBB9;}
.gsquery-b { color: #D79244;}
.gsquery-c { color: #B461A5;}
.gsquery-d { color: #87A8D3;}
.gsquery-e { color: #BB1080;}
.gsquery-f { color: #70C2D0;}
.gsquery-g { color: #92E154;}
.gsquery-h { color: #6A0E25;}
.gsquery-i { color: #374D7F;}
.gsquery-j { color: #5CCB24;}
.gsquery-k { color: #CDB78E;}
.gsquery-l { color: #A1BDD3;}
.gsquery-m { color: #AE32A4;}
.gsquery-n { color: #577B3D;}
.gsquery-o { color: #A36C71;}
.gsquery-p { color: #259364;}
.gsquery-q { color: #A29894;}
.gsquery-r { color: #B254AA;}
.gsquery-s { color: #280176;}
.gsquery-t { color: #690B25;}
.gsquery-u { color: #332089;}
.gsquery-v { color: #07D944;}
.gsquery-w { color: #000000;}
.gsquery-x { color: #000829;}
.gsquery-y { color: #1093BF;}
.gsquery-z { color: #B08537;}
.gsquery-A { color: #4601EF;}
.gsquery-B { color: #3DDD31;}
.gsquery-C { color: #DD5835;}
.gsquery-D { color: #354C80;}
.gsquery-E { color: #69B127;}
.gsquery-F { color: #01226F;}
.gsquery-G { color: #4CB02A;}
.gsquery-H { color: #98727D;}
.gsquery-I { color: #4DBEE0;}
.gsquery-J { color: #97AE9E;}
.gsquery-K { color: #A6D77E;}
.gsquery-L { color: #AA83D6;}
.gsquery-M { color: #0BD67A;}
.gsquery-N { color: #DF910B;}
.gsquery-O { color: #BDBEEA;}
.gsquery-P { color: #00FF01;}
.gsquery-Q { color: #E744B7;}
.gsquery-R { color: #293CD6;}
.gsquery-S { color: #45EC2C;}
.gsquery-T { color: #C84F35;}
.gsquery-U { color: #8649D8;}
.gsquery-V { color: #8AC9AC;}
.gsquery-W { color: #7F00B1;}
.gsquery-X { color: #22B8B6;}
.gsquery-Y { color: #8DD600;}
.gsquery-Z { color: #AE96E2;}
.gsquery-exc { color: #000000; }
.gsquery-at { color: #B58A2E;}
.gsquery-pound { color: #000000; }
.gsquery-dollar { color: #FF1924; }
.gsquery-percent { color: #5844B3;}
.gsquery-and { color: #0000F8;}
.gsquery-star { color: #FFFFFF; }
.gsquery-lparen { color: #E417E2; }
.gsquery-rparen { color: #01FFFF; }
.gsquery-_ { color: #A42627;}
.gsquery-plus { color: #C3C2BD; }
.gsquery-lbracket { color: #B2150C;}
.gsquery-rbracket { color: #30414B; }
.gsquery-bar { color: #7ADC4B;}
.gsquery-colon { color: #CCB8AD; }
.gsquery-less { color: #00FC02;}
.gsquery-greater { color: #24B6AB;}
.gsquery-questionmark { color: #8CD746;}

.gsquery-- { color: #42433B;}
.gsquery-equal { color: #92BEA7;}
.gsquery-lsqr { color: #3FAD92;}
.gsquery-rsqr { color: #24BA94;}
.gsquery-lslash { color: #A95D77;}
.gsquery-comma { color: #7D827B;}
.gsquery-point { color: #614A82;}
.gsquery-rslash { color: #2B0163;}
.gsquery-tick { color: #F5F501;}
.gsquery-quote { color: #000000; }
.gsquery-semic { color: #E744B7; }
';
echo '</STYLE></HEAD>';
//$content.='<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>';
echo '<script language="JavaScript" src="',$libpath,'/overlib.js"><!-- overLIB (c) Erik Bosrup --></script>';

echo '<TR><TD align=center>';

$cnt = count($block_servers);

for ($i=0;$i<$cnt;$i++) {
$z = explode(",", $block_servers[$i]);
$ip=$z[0];
$port=$z[1];
$qgame=$z[2];

        foreach($gametable as $key=>$value)
        {
           if ($key==$qgame)
        {
         $enginetype=$value;
        }

}
echo '<TR>
        <TD align=center>';

        $qport=calcqport($port,$qgame);
        if ($queryfromurl) {
                include_once($libpath."gsQuery.php");
         $gameserver=gsQuery::unserializeFromURL("http://www.squery.com/sqserial/serializer.php?ip=$ip&port=$qport&protocol=$enginetype");
          if(!$gameserver) {
            echo "Could not fetch the serialized object.";
          }
        }
        else $gameserver=TinyqueryServer($ip,$qport,$enginetype);

        if ($gameserver) {

//echo '<strong class="nblock">';
//echo '<a href=\"".$websiteurl."/SQuery/index.php?name=SQuery&ip=$ip&port=$port&game=$qgame&block=0\" class=\"nblock\" target=\"_blank\">',gametitle(htmlentities($gameserver->gamename));
//echo '</a>
echo '</strong><br>
                <TABLE cellpadding=0 cellspacing=0 width="130">
                <tr><td valign=top><br>
                <table width="100%" cellspacing=0 cellpadding=0 align="center">
                <tr><td width="100%" style="padding-left: 10px; padding-right: 10px;" valign=top>
                <table cellspacing=0 cellpadding=0>';

echo '<tr><td class="row"><font class="color">Name:</font></td><td class="row">',$gameserver->htmlize($gameserver->servertitle);
echo '</td></tr>
                <tr><td class="row"><font class="color">IP:</font></td><td class="row">',$gameserver->address;
echo '</td></tr>
                <tr><td class="row"><font class="color">Port:</font></td><td class="row">',$gameserver->hostport;
echo '</td></tr>
                <tr><td class="row"><font class="color">Users:</font></td><td class="row">',$gameserver->numplayers.' / '.$gameserver->maxplayers;
echo '</td></tr>';
$gameserver->mapname=ucwords(htmlentities($gameserver->mapname));
echo '<tr><td class="row"><font class="color">Map:</font></td><td class="row">',$gameserver->mapname;
echo '</td></tr>';
$gameserver->gametype=strtoupper(htmlentities($gameserver->gametype));
echo '<tr><td class="row"><font class="color">Game:</font></td><td class="row">',$gameserver->gametype;
echo '</td></tr>';
echo '</table>';

                if ($gameserver->numplayers == $gameserver->maxplayers)
                        echo "(<font class=\"color\">This server is FULL</font>)";
                elseif ($gameserver->numplayers == 0)
                        echo "(<font class=\"color\">This server is EMPTY</font>)";
echo '</table></TABLE>';
   }
  echo '<hr>';
} // end main loop
echo '<center>';
//$content.=showCredits(showVersion());
echo "<a href=\"http://www.squery.com\" target=\"_blank\">".showVersion()."</a>";
echo '</center><br />';

?>

IchBin

You need to uncomment this section for your server to run the stand alone script.

// Static display for Standalone and Module
// If you set this it will not display the query box, or any of your favorites, it will only show the server you put in below
//$static_ip = "67.18.175.110";
//$static_port = "16567";
//$static_game = "Battlefield 2";


IF that doesn't work it might be your paths.

Like this:
$libpath="/www/forum/SQuery/lib/";

May need to be somthing like this:
$libpath="/home/username/www/forum/SQuery/lib/";

Your path depends on how your provider has your server setup.

HaxXxoR

This is starting to get annoying. I tried both of those and i still cant get the stand alone to work. All i get is a blank page. Do you know if there is a way to add it under the Downloads module and make it fit it into the portal?

COOLover

I have the same problem.
I become a blank Page, but the Code of the Blank page is:

<!-- /home/htdocs/test/SQuery/lib/../images/maps/rtcw-et/et_beach.jpg--><!-- /home/htdocs/test/SQuery/lib/../images/maps/rtcw-et/oasis.jpg--><!-- /home/htdocs/test/SQuery/lib/../images/maps/rtcw-et/oasis.jpg-->



The config is right for stand allone.
Server is Online.

Sorry for my bad English

IchBin

If you access the file directly in your browser do you see the server status?

COOLover

The access of the dir's are 777 and all file exist.
wen i test with the index.php, it is work. Only the block have problems.

You can look it:

index: http://server.scz-clan.info/test/SQuery/index.php
block: http://server.scz-clan.info/test/SQuery/block-SQuery_tiny.php

IchBin

I don't know this script well enough to tell you which setting you have wrong. But I'm pretty sure it's just something in your config. The only thing I can suggest is to change some settings and keep testing the Block script. If need be you can post your config and I'll take a look.

COOLover

Thats my Config:

<?

// SQuery version 4.0 by Curtis Brown
// Based on code by David Cramer released to the public domain.


//########### CONFIGURATION BEGIN ############//

// Static display for Standalone and Module
// If you set this it will not display the query box, or any of your favorites, it will only show the server you put in below
$static_ip = "83.142.83.10";
$static_port = "27960";
$static_game = "RTCW:ET";
   
// Static display for PHPNuke Block
// This must be set for the Block to work. Add a line for each server you want displayed in the block.
// SERVER IP, PORT, GAMETYPE
/*$block_servers = array (
"83.142.83.10,27960,RTCW:ET",
        "83.142.83.10,28000,RTCW:ET",
"83.142.83.10,28960,RTCW:ET",
"83.142.83.10,27015,Counterstrike",
);
*/

// Be sure to set this to your web site or the block won't work!
$websiteurl ="http://server.scz-clan.info/test/";

// Display tips at bottom of query TRUE or FALSE
$displaytips=FALSE;
// Display IP Entry Form at Top TRUE or FALSE
$show_ip_entry_form=TRUE;

// Here you can add or change the tips

$tipmsg = array (
"If you fire burst shots with an assault rifle, you'll greatly increase accuracy and range.",
"When you're at close range with an opponent, try to hit them with your gun instead of shooting them.",
"Listen! The sounds the enemy makes are very revealing...",
"You shouldn't make fun of nerds... you'll be working for one some day (Great Tip!)",
"Visit www.PBBans.com, The Best Anti-Cheat Punkbuster Site around!"
);
 

/* Add your favorite servers here (shows them under the form)
Use these game types:
"Americas Army"
"BField:1942"
"BField:Vietnam"
"Battlefield 2"
"Call of Duty"
"CoD:United Offensive"
"Call of Duty 2"
"Chaser"
"Chrome"
"Counterstrike"
"Cstrike:Source"
"CnC Renegade"
"Descent 3"
"DoD:Source"
"Doom3"
"Devastation"
"FarCry"
"Global Ops"
"Gore"
"Halo"
"Heretic 2"
"Half-Life"
"Half-Life 2"
"HLife:CndZero"
"HLife:Cstrike"
"HLife:DMC"
"HLife:DOD"
"HLife:N.S."
"HLife:O.F."
"HLife:TFC"
"IL-2 Sturmovik"
"IGI2"
"Jedi Knight 2"
"Jedi Knight 3"
"MOH:AA"
"MOH:BT"
"MOH:PA"
"MOH:SH"
"MTA(GTA3)"
"NASCAR SimRacer"
"NetPanzer"
"NOLF"
"NOLF 2"
"Op. Flshpnt"
"Painkiller"
"Postal 2"
"Purge Jihad"
"Quake 2"
"Quake 3"
"Quake 4"
"Quake 3:UT"
"QuakeWorld"
"Rally Masters"
"RavenShield"
"RTCW"
"RTCW:ET"
"Rune"
"Savage"
"Serious Sam"
"Serious Sam 2"
"Sin"
"SOF"
"SOF II"
"Soldat"
"ST:Elite Force"
"ST:Elite Force 2"
"SW:Battlefront"
"Tactical Ops"
"Unreal"
"Unreal 2 XMP"
"UT"
"UT2003"
"UT2004"
"VietCong"
example:  */


$favorites = array (

"[ScZ]-ET-Public,83.142.83.10,27960,RTCW:ET",
"[ScZ]-ET-War,83.142.83.10,28000,RTCW:ET",
"[ESDB],83.142.83.10,28960,RTCW:ET",
"[ScZ]-CS-Public,83.142.83.10,27015,Counterstrike",
);

//########### CONFIGURATION END ##############//
//Unsupported at this time, leave alone unless told to change it:
$queryfromurl=FALSE;

if (eregi("config.php", $_SERVER['PHP_SELF'])) {
  print_r($block_servers);
  print_r($favorites);
  echo $static_ip;
  echo $static_port;
  echo $static_game;
  echo $websiteurl;
}
?>

This website is proudly hosted on Crocweb Cloud Website Hosting.