Quote:
Originally Posted by OUTL4W
Yeah...I guess, hence the configuration error? Will this work like it should, on vb3, once the file is uploaded to server? Then place $console wherever I want it to show up?
|
Well lets first make sure it will work on your server.
Put the following in a php file and upload to your server. The only difference is I am echo'ing out the $output and putting everything in between the php tags. If it shows with this then it isn't a server issue. If it doesn't show then we need to make sure that server can use "file_get_contents"
PHP Code:
<?php
error_reporting(E_ERROR);
$PSN_url = 'http://support.us.playstation.com/app/answers/detail/a_id/237/';
$PSNhtml = file_get_contents($PSN_url);
$PSNdom = new DOMDocument();
@$PSNdom->loadHTML($PSNhtml);
$PSNxpath = new DOMXPath($PSNdom);
//PSN Query
$PSN_query = "/html/body[@id='scea_body']/div[@id='wrap']/div[@class='boxshadow']/div[@id='main']/div[@id='search_main_box']/div[@id='rn_PageContent']/div[@id='rn_AnswerTop']/h1[@id='rn_Summary']";
$PSN_rows = $PSNxpath->query($PSN_query);
//PSN Status
foreach ($PSN_rows as $PSN_object){
$PSNstatus = $PSN_object->childNodes->item(0)->nodeValue;
}
$PSNstatus = str_replace('PSN Status:', '', $PSNstatus);
$XBOX_url = 'http://support.xbox.com/en-US/xbox-live-status';
$XBOXhtml = file_get_contents($XBOX_url);
$XBOXdom = new DOMDocument();
@$XBOXdom->loadHTML($XBOXhtml);
$XBOXxpath = new DOMXPath($XBOXdom);
//Xbox Social And Gaming
$XBOXSocialAndGaming_query = "/html/body[@id='DocumentBody']/div[@id='bodycolumn']/div[@id='BodyContent']/div[@class='liveStatusPage']/div[2]/ul[@class='core']/li[@id='SocialandGaming']/div[@class='item']/h3";
$XBOXSocialAndGaming_rows = $XBOXxpath->query($XBOXSocialAndGaming_query);
//Xbox Social And Gaming loop
foreach ($XBOXSocialAndGaming_rows as $XBOXSocialAndGaming_object){
$XBOXSocialAndGamingStatus = $XBOXSocialAndGaming_object->childNodes->item(1)->nodeValue;
}
//Xbox Live Core Services
$XBOXLiveCore_query = "/html/body[@id='DocumentBody']/div[@id='bodycolumn']/div[@id='BodyContent']/div[@class='liveStatusPage']/div[2]/ul[@class='core']/li[@id='XboxLiveCoreServices']/div[@class='item']/h3";
$XBOXLiveCore_rows = $XBOXxpath->query($XBOXLiveCore_query);
//Xbox Live Core Status
foreach ($XBOXLiveCore_rows as $XBOXLiveCore_object){
$XBOXLiveCoreStatus = $XBOXLiveCore_object->childNodes->item(1)->nodeValue;
}
$output = "
<style>
.xboxtitle {
font-weight:600;
}
.xboxstatus a{
color:#107C10;
}
.psntitle {
font-weight:600;
}
.psnstatus a{
color:#665cbe;
}
</style>
<span class='psntitle'>PSN Status:</span><span class='psnstatus'> <a href='https://support.us.playstation.com/app/answers/detail/a_id/237/'>" .
$PSNstatus . "</a></span><br /><br /><span class='xboxtitle'>XBOX Status:</span><span class='xboxstatus'><a href='http://support.xbox.com/en-US/xbox-live-status'> " . $XBOXSocialAndGamingStatus . "</a></span><br /><br /><span class='xboxtitle'>XBOX Live Core Status: </span><span class='xboxstatus'><a href='http://support.xbox.com/en-US/xbox-live-status'>" . $XBOXLiveCoreStatus . "</a></span>";
echo $output;
?>