Page 1 of 1

Need some help

Posted: Sun Mar 18, 2007 1:43 pm
by SSHL
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>";
}
?>

Posted: Sun Mar 18, 2007 4:30 pm
by SimonT
I saw the php code I had done for FHL. ;)

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>";
	}
}
?>
This code should work for you. I use the RSSFeed instead of the TodayGames output. Good luck.

Posted: Sun Mar 18, 2007 8:52 pm
by THuRSDay981
Si je ne veux pas afficher la date, ni les games du Farm à l'aide de ce script, que dois-je faire? Qu'est-ce qu'il faut que je change?

Posted: Sun Mar 18, 2007 9:35 pm
by SimonT
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>"; 

Posted: Mon Mar 19, 2007 2:31 pm
by THuRSDay981
Parfait, ça efface la date... Mais est-ce qu'il pourrait y avoir un option qui enlèverait les Farm games du RSSFeed???

Posted: Mon Mar 19, 2007 2:53 pm
by THuRSDay981
Autre problème... Lorsque l'on clique sur la partie, le lien s'affiche dans la petite fenêtre au lieu de la page au complet... Comment faire pour voir le match dans le navigateur complet?

Posted: Mon Mar 19, 2007 4:03 pm
by SimonT
Ah ah ah! Apprend le PHP ( http://www.php.net ) !!

Posted: Mon Mar 19, 2007 11:10 pm
by THuRSDay981
C'est un peu lourd comme lecture ce site... Un simple Tips aurait fait l'affaire...

Posted: Fri Mar 23, 2007 2:32 pm
by THuRSDay981
THuRSDay981 wrote:Autre problème... Lorsque l'on clique sur la partie, le lien s'affiche dans la petite fenêtre au lieu de la page au complet... Comment faire pour voir le match dans le navigateur complet?
Ya vraiment personne qui veut m'aider avec mon problème?!