Need some help

If you need help building your website, this is the place to hang out. If you're an HTML, PHP, Perl or web database geek, check it out. / Si vous avez besoin d'aide pour construire votre site web, c'est le forum à regarder! Si vous êtes un expert en HTML, PHP, Perl ou en base de données, c'est le forum pour vous!
Post Reply
SSHL
New in Town / Le Ptit Nouveau
Posts: 5
Joined: Sat Mar 03, 2007 11:25 am

Need some help

Post 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>";
}
?>
SimonT
STHS Owner / Propriétaire du STHS
Posts: 14755
Joined: Sat Oct 08, 2005 4:18 pm
Location: Montreal, Canada
Contact:

Post 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.
-SimonT
Forum Administrator / Administrateur du Forum
STHS Owner / Propriètaire du STHS
English V2 & V3 Manual - Manuel V2 & V3 Français
THuRSDay981
The Passion One / Le Passionné
Posts: 233
Joined: Wed Jan 10, 2007 4:58 pm
Location: Québec
Contact:

Post 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?
SimonT
STHS Owner / Propriétaire du STHS
Posts: 14755
Joined: Sat Oct 08, 2005 4:18 pm
Location: Montreal, Canada
Contact:

Post 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>"; 
-SimonT
Forum Administrator / Administrateur du Forum
STHS Owner / Propriètaire du STHS
English V2 & V3 Manual - Manuel V2 & V3 Français
THuRSDay981
The Passion One / Le Passionné
Posts: 233
Joined: Wed Jan 10, 2007 4:58 pm
Location: Québec
Contact:

Post 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???
THuRSDay981
The Passion One / Le Passionné
Posts: 233
Joined: Wed Jan 10, 2007 4:58 pm
Location: Québec
Contact:

Post 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?
SimonT
STHS Owner / Propriétaire du STHS
Posts: 14755
Joined: Sat Oct 08, 2005 4:18 pm
Location: Montreal, Canada
Contact:

Post by SimonT »

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
THuRSDay981
The Passion One / Le Passionné
Posts: 233
Joined: Wed Jan 10, 2007 4:58 pm
Location: Québec
Contact:

Post by THuRSDay981 »

C'est un peu lourd comme lecture ce site... Un simple Tips aurait fait l'affaire...
THuRSDay981
The Passion One / Le Passionné
Posts: 233
Joined: Wed Jan 10, 2007 4:58 pm
Location: Québec
Contact:

Post 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?!
Post Reply