Hey gents,
Question for guys who are good in PHP...
What I am looking to do is take the Individual Leaders page and kind of cut it up so I am able to display portions of the stats in a block on my site. So for example in 1 block I'd have the top goal scorers listed. In one below the top point getters, and so on. I think showing this output on the frontpage helps make the website look better.
Second, I am wanting to create 2 blocks again, one which shows the current games played (outputted something like Habs 1 Flyers 0, with a link to each game so GMs can check out the game stats easily), and one which will show the upcoming games for the next day (something like Team vs Team). For the FHL Sim I used the following to display the games played..hopefully someone can create something similar?
Any help is much appreciated.
Thanks in advance guys!
Cheers.
<?php
If (@file ('mrfhl01TodayGames.html') == false) {
print "<b>No Games Today</b>";
}
else {
$lines = file ('mrfhl01TodayGames.html');
foreach ($lines as $line_num => $line) {
If (substr($lines[$line_num],1,1) == "A") {
$Array = preg_split('/ /',$lines[$line_num]);
print "<a " . $Array[1] . " " . $Array[5] . " " . $Array[6] . " " . $Array[7];
print " - " . $Array[8] . " " . $Array[9] . " " . $Array[10] . $Array[11]. $Array[12];
print "<br>";
}
If (substr($lines[$line_num],1,1) == "P") {
echo "<b>" . strip_tags(substr($lines[$line_num],11)) . "</b><p></p>"; }
echo "</a>";
}
echo "</a>";
}
?>
Need some help
-
- STHS Owner / Propriétaire du STHS
- Posts: 14776
- Joined: Sat Oct 08, 2005 4:18 pm
- Location: Montreal, Canada
- Contact:
I saw the php code I had done for FHL.
This code should work for you. I use the RSSFeed instead of the TodayGames output. Good luck.
Code: Select all
<?php
$FoundToday = 0;
If (@file ('RSSFeed.xml') == false) {
print "</td></tr></table> <span class=\"lien\">Erreur dans le Fichier</span>";
} else {
$lines = file ('RSSFeed.xml');
foreach ($lines as $line_num => $line) {
If (substr($lines[$line_num],1,7) == "pubDate") {
$FoundToday = 1;
echo "<br /><a href=\"LHN1-TodayGames.php\"><u>" . strip_tags($lines[$line_num]) . "</u></a></td></tr></table>";
}
If (substr($lines[$line_num],1,4) == "link" && $FoundToday == 1) {
echo "<a href=\"" . strip_tags($lines[$line_num]) . "\">";
}
If (substr($lines[$line_num],1,11) == "description" && $FoundToday == 1) {
echo strip_tags($lines[$line_num]) . "</u></a><br />";
}
}
If ($FoundToday != 1) {
print "</td></tr></table> <span class=\"lien\">Erreur dans le Fichier</span>";
}
}
?>
-SimonT
Forum Administrator / Administrateur du Forum
STHS Owner / Propriètaire du STHS
English V2 & V3 Manual - Manuel V2 & V3 Français
Forum Administrator / Administrateur du Forum
STHS Owner / Propriètaire du STHS
English V2 & V3 Manual - Manuel V2 & V3 Français
-
- The Passion One / Le Passionné
- Posts: 233
- Joined: Wed Jan 10, 2007 4:58 pm
- Location: Québec
- Contact:
-
- STHS Owner / Propriétaire du STHS
- Posts: 14776
- Joined: Sat Oct 08, 2005 4:18 pm
- Location: Montreal, Canada
- Contact:
Enlève cette ligne
Code: Select all
echo "<br /><a href=\"LHN1-TodayGames.php\"><u>" . strip_tags($lines[$line_num]) . "</u></a></td></tr></table>";
-SimonT
Forum Administrator / Administrateur du Forum
STHS Owner / Propriètaire du STHS
English V2 & V3 Manual - Manuel V2 & V3 Français
Forum Administrator / Administrateur du Forum
STHS Owner / Propriètaire du STHS
English V2 & V3 Manual - Manuel V2 & V3 Français
-
- The Passion One / Le Passionné
- Posts: 233
- Joined: Wed Jan 10, 2007 4:58 pm
- Location: Québec
- Contact:
-
- The Passion One / Le Passionné
- Posts: 233
- Joined: Wed Jan 10, 2007 4:58 pm
- Location: Québec
- Contact:
-
- STHS Owner / Propriétaire du STHS
- Posts: 14776
- Joined: Sat Oct 08, 2005 4:18 pm
- Location: Montreal, Canada
- Contact:
Ah ah ah! Apprend le PHP ( http://www.php.net ) !!
-SimonT
Forum Administrator / Administrateur du Forum
STHS Owner / Propriètaire du STHS
English V2 & V3 Manual - Manuel V2 & V3 Français
Forum Administrator / Administrateur du Forum
STHS Owner / Propriètaire du STHS
English V2 & V3 Manual - Manuel V2 & V3 Français
-
- The Passion One / Le Passionné
- Posts: 233
- Joined: Wed Jan 10, 2007 4:58 pm
- Location: Québec
- Contact:
-
- The Passion One / Le Passionné
- Posts: 233
- Joined: Wed Jan 10, 2007 4:58 pm
- Location: Québec
- Contact: