News:

Wondering if this will always be free?  See why free is better.

Main Menu

How would I add a linkable URL below this...

Started by MoreBloodWine, May 18, 2011, 10:48:00 AM

Previous topic - Next topic

MoreBloodWine

How would I add a linkable URL below the else if statement (down image) ?

I tried an echo but that didnt work...

Ended up getting this in an error_log file.

[18-May-2011 10:45:25] PHP Parse error:  syntax error, unexpected T_ELSE in /removed/xbox-live-status.php on line 19

Anyway, here's the code I'm trying to modify... Ty.
<?php   
global 
$sourcedir;

if (file_exists('/removed/SSI.php') && !defined('SMF'))
require_once('/removed/SSI.php');
    elseif (!
defined('SMF'))
     die('This script wasn\'t able to connect to SMF...');
     
if (($temp cache_get_data('xbox_status'300)) == null)
{
require_once($sourcedir '/Subs-Package.php');
$request = @fetch_web_data('http://support.xbox.com/en-gb/Pages/xbox-live/xbox-live-status.aspx');

if ($request !== false && preg_match('~<img src="/SiteAssets/XboxSupportV2/images/xbox-live-down.gif" width="24" height="24" alt="Service Alert" />~smi'$request$matches))
$temp 'http://www.eojmarket.com/xbox_and_psn_network_status/xbox-down.png';
else if ($request !== false && preg_match('~<img src="/SiteAssets/XboxSupportV2/images/xbox-live-running.gif" width="24" height="24" alt="Service Alert" />~smi'$request$matches))
$temp 'http://www.eojmarket.com/xbox_and_psn_network_status/xbox-up.png';
else
$temp 'http://www.eojmarket.com/xbox_and_psn_network_status/xbox-unable.png';

cache_put_data('xbox_status'$temp300);
}

$imgPng imageCreateFromPng($temp);
imageAlphaBlending($imgPngtrue);
imageSaveAlpha($imgPngtrue);
header("Content-type: image/png");
imagePng($imgPng);
?>
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


NanoSector

My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

MoreBloodWine

Nibogo's the original author of the code, not me but I use spaces myself sometimes, without error.

Any way ty for that and back on topic.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


NanoSector

Quote from: MoreBloodWine on May 18, 2011, 10:56:31 AM
Nibogo's the original author of the code, not me but I use spaces myself sometimes, without error.

Any way ty for that and back on topic.
Well, the PHP site page I linked to shows that it is not correct if you use a space in an elseif:

<?php

/* Incorrect Method: */
if($a $b):
    echo 
$a." is greater than ".$b;
else if(
$a == $b): // Will not compile.
    
echo "The above line causes a parse error.";
endif;


/* Correct Method: */
if($a $b):
    echo 
$a." is greater than ".$b;
elseif(
$a == $b): // Note the combination of the words.
    
echo $a." equals ".$b;
else:
    echo 
$a." is neither greater than or equal to ".$b;
endif;

?>
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

MoreBloodWine

Well, even removing the space and then still trying to add an echo below the middle else doesnt work. It just breaks the file from showing an image.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


Advertisement: