Joined: Jul 02, 2004 Posts: 7 Location: Occupied Chicago
Posted:
Sun Jun 05, 2005 3:52 pm
I've tried and tried to get this block code to a module but lack serious knowledge. I was wondering if someone could help me out. The block slows the site down bigtime. I like the look of the block and the info it contains but would rather see it in module form. I'd appreciate anyone's help on this.
Code:
<?php
if (eregi("block-TWL.php", $PHP_SELF)) {
Header("Location: index.php");
die();
}
//Let keep those pesky little parsing errors to ourselves.
error_reporting(0);
//Added by [STAB]-Ravenstone
//Enter your clan TWL XML URL here.
$file = "http://www.teamwarfare.com/xml/viewteam_v2.asp?team=Armed+Insanity";
//Comment out this file line to see how your script reacts to TWL's XML feed being out.
class LadderInfo1 {
var $ladder;
var $ladderhtmllink;
var $ladderxmllink;
var $rank;
var $wins;
var $losses;
var $forfeits;
var $status;
var $opponentname;
var $opponenthtmllink;
var $opponentxmllink;
var $date;
var $maps;
var $sides;
class LeagueInfo1 {
var $league;
var $leaguehtmllink;
var $leaguexmllink;
var $conference;
var $division;
var $status;
var $opponentname;
var $opponenthtmllink;
var $opponentxmllink;
var $date;
var $maps;
function LeagueInfo1() {
$maps = array();
}
}
class Team1 {
var $name;
var $url;
var $email;
var $founder;
var $description;
var $ircserver;
var $channel;
var $status;
var $LadderInfo1;
var $LeagueInfo1;
//Added by [STAB]-Ravenstone to display xml data if availabe and a message if not.
Only registered users can see links on this board! Get registered or login to the forums!
if($Team1->name == NULL)
{
$content .= "<center><b> XML Service Unavailable</b></center>";
}
else
{
$content = $html;
}
//I only take credit for the code in between the comments nothing more.
//If you wrote this code and feel I am taking credit for it please email me so I can add your name to the file I have
//with the due credit it deserves
Only registered users can see links on this board! Get registered or login to the forums!
//Let keep those pesky little parsing errors to ourselves.
error_reporting(0);
//Added by [STAB]-Ravenstone
//Enter your clan TWL XML URL here.
$file = "http://www.teamwarfare.com/xml/viewteam_v2.asp?team=Armed+Insanity";
//Comment out this file line to see how your script reacts to TWL's XML feed being out.
// ALL YOUR OTHER CODE DOWN TO ...
Code:
//Added by [STAB]-Ravenstone to display xml data if availabe and a message if not.
Only registered users can see links on this board! Get registered or login to the forums!
if($Team1->name == NULL)
{
$content .= "<center><b> XML Service Unavailable</b></center>";
}
else
{
$content = $html;
}
echo $content;
//I only take credit for the code in between the comments nothing more.
//If you wrote this code and feel I am taking credit for it please email me so I can add your name to the file I have
//with the due credit it deserves
Only registered users can see links on this board! Get registered or login to the forums!
Joined: Jul 02, 2004 Posts: 7 Location: Occupied Chicago
Posted:
Sun Jun 05, 2005 9:31 pm
I activated the block so you can see it in that form.
Only registered users can see links on this board! Get registered or login to the forums!
I made an index.php file, put in the code and put the file in a folder called TWL and activated the module. There is a link in the Nav menu called TWL Standings. No output unfortunately. I'm wondering why the block can parse the XML link but not when it's a module. I've been getting the same results. I do appreciate your time gents.
Joined: Jun 08, 2005 Posts: 18 Location: Harpers Ferry, WV
Posted:
Wed Jun 08, 2005 8:28 am
Did you get this working? I modified/wrote a block for our site when we were in TWL and did not notice the block slowing down the site. Maybe there is something else doing it?
I checked your link and did not see TWL Standings anywhere and the site was very slow to load. Now, that may be on my side but then again, maybe not. The only way to be sure is to turn off some of the blocks one at a time and note the differences in loading.
Anyway, if you are active in TWL, one thing that I added to my block was to automatically import the challenges into vWar (which I notice you are using as well). If you'd like that little snippet, I'd be happy to share. It's still in the block though.
View next topic View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum