1
QuickSlick
FatalQuery Server Query module RC1

I use this module to monitor my friends CS server, does anybody know if its possible to show the Mappicture in the block on the frontpage of your site.

In the "standard" module, the picture is only shown choose the module index site, but i would like to have the picture under the Server info on the frontpage in my block !

Perhaps its very simple - perhaps it cant be done !

Does anybody know ?

Your u know perhaps u even can put the playerlist under the map picture !

( Fatal Query )

2
pdaddict
Re: FatalQuery Server Query module RC1
  • 2005/1/31 0:16

  • pdaddict

  • Friend of XOOPS

  • Posts: 106

  • Since: 2003/4/6 1


I think the image is possible, but the playerlist is probably a no. Can't remember much of it's code, I'll check it out after I had some sleep.

3
QuickSlick
Re: FatalQuery Server Query module RC1

Sounds Great pdaddict

Quote:

pdaddict wrote:
I think the image is possible, but the playerlist is probably a no. Can't remember much of it's code, I'll check it out after I had some sleep.

4
pdaddict
Re: FatalQuery Server Query module RC1
  • 2005/1/31 11:57

  • pdaddict

  • Friend of XOOPS

  • Posts: 106

  • Since: 2003/4/6 1


In blocks/fatalquery.php, add
$pics_dir '/modules/fatalquery/'.$xoopsModuleConfig['map_pic_dir']."/";
        
$pic $server_var['map']."".$xoopsModuleConfig['mappic_ext'];
        
$server_var['map_pic'] = (is_file(XOOPS_ROOT_PATH.$pic_path.$pic)) ? XOOPS_URL.$pic_path.$pic XOOPS_URL.$pic_path.$xoopsModuleConfig['default_pic_name'].$xoopsModuleConfig['mappic_ext'] ;


after
if($server->mMap() == '0'){
            
$server_var['map'] ='';
        }else{
            
$server_var['map'] = shorten($server->mMap());
        }


And add , inside the foreach in the block's template, where you want the pic


The playerlist is possible too, but requires a lot more editing

5
QuickSlick
Re: FatalQuery Server Query module RC1

It dosent seem to be working...

Im sure i did what u told me to do, but thats a no go...

It looks like it cant find the picture !

Any ideas ?

my website

6
pdaddict
Re: FatalQuery Server Query module RC1
  • 2005/1/31 15:33

  • pdaddict

  • Friend of XOOPS

  • Posts: 106

  • Since: 2003/4/6 1


This one works ...

$pics_dir '/modules/fatalquery/'.getmoduleoption('map_pic_dir');
        
$pic $server_var['map']."".getmoduleoption('mappic_ext');
        
$server_var['map_pic'] = ($server_var['map'] && is_file(XOOPS_ROOT_PATH.$pics_dir.$pic)) ? XOOPS_URL.$pics_dir.$pic XOOPS_URL.$pics_dir.getmoduleoption('default_pic_name').getmoduleoption('mappic_ext') ;


after

if($server->mMap() == '0'){
            
$server_var['map'] ='';
        }else{
            
$server_var['map'] = shorten($server->mMap());
        }


and

function getmoduleoption($option$repmodule='fatalquery')
{
    global 
$xoopsModuleConfig$xoopsModule;
    static 
$tbloptions= Array();
    if(
is_array($tbloptions) && array_key_exists($option,$tbloptions)) {
        return 
$tbloptions[$option];
    }

    
$retval=false;
    if (isset(
$xoopsModuleConfig) && (is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $repmodule && $xoopsModule->getVar('isactive')))
    {
        if(isset(
$xoopsModuleConfig[$option])) {
            
$retval$xoopsModuleConfig[$option];
        }

    } else {
        
$module_handler =& xoops_gethandler('module');
        
$module =& $module_handler->getByDirname($repmodule);
        
$config_handler =& xoops_gethandler('config');
        if (
$module) {
            
$moduleConfig =& $config_handler->getConfigsByCat(0$module->getVar('mid'));
            if(isset(
$moduleConfig[$option])) {
                
$retval$moduleConfig[$option];
            }
        }
    }
    
$tbloptions[$option]=$retval;
    return 
$retval;
}


at the end of the file, before ?>

7
QuickSlick
Re: FatalQuery Server Query module RC1

Quote:
$server_var['map_pic'] = ($server_var['map'] && is_file(XOOPS_ROOT_PATH.$pics_dir.$pic)) ? XOOPS_URL.$pics_dir.$pic : XOOPS_URL.$pics_dir.getmoduleoption('default_pic_name').getmoduleoption('mappic_ext') ;


I'm not very good with php and so on, but i love my XOOPS Website, thats why i need good Support - just like what you are doing now pdaddict.

But since im not a "geek" u have to help me, should i chance anything in the line i quotet

8
pdaddict
Re: FatalQuery Server Query module RC1
  • 2005/1/31 22:45

  • pdaddict

  • Friend of XOOPS

  • Posts: 106

  • Since: 2003/4/6 1


you missed this line
$pics_dir '/modules/fatalquery/'.getmoduleoption('map_pic_dir');

9
QuickSlick
Re: FatalQuery Server Query module RC1

No, i added all the text u told me to.

What i was thinking was, should i change anything in any of the linies i add.

E.X XOOPS_ROOT_PATH <--- is that http://www.svedbollen.dk or ?

E.X XOOPS_URL <--- something else ?

The error i get now, seems to be caused by it dont know where to find the picture ! To code seems correct, but now where its pointing, if u know what i mean !

10
pdaddict
Re: FatalQuery Server Query module RC1
  • 2005/2/1 14:59

  • pdaddict

  • Friend of XOOPS

  • Posts: 106

  • Since: 2003/4/6 1


It works when I test locally. Overwrite your block-file with this one

Login

Who's Online

305 user(s) are online (236 user(s) are browsing Support Forums)


Members: 0


Guests: 305


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits