1
irongaijin
PHP in a custom block help
  • 2006/8/24 17:33

  • irongaijin

  • Just popping in

  • Posts: 11

  • Since: 2006/8/24


I run a website for a WoW guild and found a neat little php script for adding a server status update on the web page.

WoW Server Status, 3.4

I want to put this in a custom block but I'm having trouble with it showing up correctly.

Following the instructions on the site I've tried making the custom block PHP and entering:

include("wowserverstatus.php");

But the block doesn't even show up.

Then I tried to call the script as an image in any type of webpage (HTML,PHP, etc) with the following code:

<img alt="WoW Server Status" src="wowserverstatus.php" />

It shows the block and the alt text but no image. I'm really new to php and I'm sure it's operator error but I can't figure out what I'm doing wrong. Can anyone help? Thanks!

XOOPS Version:
XOOPS 2.0.13.2

PHP Version:
4.4.2

MySQL Version:
5.0.15

Server Software:
Servage.net Cluster (Enhanced Apache)

2
Quest
Re: PHP in a custom block help
  • 2006/8/24 17:56

  • Quest

  • Friend of XOOPS

  • Posts: 1034

  • Since: 2005/11/19


WoW! Pardin the pun. I took a look at the site you linked to and I can see many reasons why you may not be getting anything. I would definately double and triple check the installation instructions and procedures to ensure you have it uploaded and configured properly and run any test they mention eg;
Quote:
If you are going to use the image output you need to make sure you have the GD library installed on your server. To test this, upload the file gd_php.php and run it. It must say "yes" for GD Support and PNG Create Support. If it doesn't, you need to install the GD Library - or you can only output server status in text/HTML.


Also make sure you have the right version for your location.

Sorry couldn't be more help.


Quest

3
irongaijin
Re: PHP in a custom block help
  • 2006/8/24 17:59

  • irongaijin

  • Just popping in

  • Posts: 11

  • Since: 2006/8/24


All the config checks out okay... I just have it locked down so that only registered users have access to anything. That was a request from the guild members. GD is the library I'm using since I had troubles with the version of imagemagick from my webhost.

4
Quest
Re: PHP in a custom block help
  • 2006/8/24 18:21

  • Quest

  • Friend of XOOPS

  • Posts: 1034

  • Since: 2005/11/19


Try putting <?php and the close ?> like this.

<?php
include("wowserverstatus.php");
?>

Then save the block as a php file.

Quest

5
irongaijin
Re: PHP in a custom block help
  • 2006/8/24 18:35

  • irongaijin

  • Just popping in

  • Posts: 11

  • Since: 2006/8/24


I had tried that once already but went ahead and c/p the same code from your post but I don't even see a block when I go back to the mainpage. It's set to visible in all pages, content php script.

I assume that if the problem is in the wowserverstatus.php it would not show up at all? Or should it still show an empty block?

6
Quest
Re: PHP in a custom block help
  • 2006/8/24 18:44

  • Quest

  • Friend of XOOPS

  • Posts: 1034

  • Since: 2005/11/19


Hmmm, good question. I would think it would still at least show the Block Title. Check to make sure you have group permissions set for the groups you want to see the block in in the admin/system/groups. Even though you have it set to visible, since it is a custom block you will still have to set the group permissions. Webmaster should have it automatically but one never knows sometimes.

Quest

7
Will_H
Re: PHP in a custom block help
  • 2006/8/24 18:49

  • Will_H

  • Friend of XOOPS

  • Posts: 1786

  • Since: 2004/10/10


Well there are a couple ways to do this.
<!---Start Easy Way--->

You can use the myIframe module to pull the script

This module also comes with a block that you can show the script thorugh, or you can just use the module output.

<!---End Easy way--->

You have to get the script running first. So create a file called whatever.php paste in the script and drop it in your public_html (or wherever).

Then navigate to ithttp://www.yoursite.com/whatever.php

If it works go ahead and use the myIframe module to pull it into your XOOPS framework.

Get it Here

8
irongaijin
Re: PHP in a custom block help
  • 2006/8/24 19:11

  • irongaijin

  • Just popping in

  • Posts: 11

  • Since: 2006/8/24


Quest,

I went ahead and checked the group permissions and even added the block to anonymous. Still no dice.

Biteronboard,

Definitely verified that the php works, and it will look great on the site. I will look into the myIframe and let you know my results.

Thanks all.

9
n01un0
Re: PHP in a custom block help
  • 2006/8/24 19:21

  • n01un0

  • Quite a regular

  • Posts: 253

  • Since: 2005/10/9


Couldnt you just use a "custom" block and input the following?

<center><iframe id="external" style="width:190px;height:250px" src="http://www.yoursite.com/yourphpfile.php" scrolling="auto" border=0 marginwidth="1" marginheight="1" align="center" frameborder="0"></iframe><font face=arial size=1></center>


Obviously you could tweak any of the settings of the iframe needed. This is what I use for left or right blocks. To display a whole page within a center block, I would suggest MyIframe 1.4 from herve as Biteronboard suggested. I use this method for some external php scripts like webcalendar and gpix.

Just my 2 cents thats only worth 1

10
Will_H
Re: PHP in a custom block help
  • 2006/8/24 19:29

  • Will_H

  • Friend of XOOPS

  • Posts: 1786

  • Since: 2004/10/10


Well yeah he could do it that way. MyIframe just guarantees that it will work cross browser, plus its a hell of alot simpler.

Login

Who's Online

107 user(s) are online (51 user(s) are browsing Support Forums)


Members: 0


Guests: 107


more...

Donat-O-Meter

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

Latest GitHub Commits