Index du Forum » » Le coin des codeurs

Auteur

Script qui merdoit...
Pomme
7540       
 

  Posté : 16-11-2003 19:31

voici le script (207 lignes) que j'ai réalisé pour mon index... il est en démo ici -> http://thewebspinner.webdynamit.net/test/index.php
Mais il pose un probleme qd on clique sur "Afficher les couvertures des sorties américaines du mois" il change l'url... mais affiche la mm partie de la page alors que je voudrais l'autre...
Vous pourriez me dire d'où vient le blem ?

<?PHP

if (!IsSet($mainfile)) { !include!("mainfile.php"); }
global $pdst; $pdst="-1";

function aff_news() {
global $storyhome, $topicname, $topicimage, $topictext, $datetime, $cookie;
if (isset($cookie[3])) {
$storynum = $cookie[3];
}
else {
$storynum = $storyhome;
}
if ($op=="categories") {
mysql_query("update stories_cat set counter=counter+1 where catid='$catid'");
$xtab=news_aff("libre","where catid='$catid' order by sid DESC","","-1");
$storynum=sizeof($xtab);
} else {
$xtab=news_aff("index","where ihome!='1'",$storynum,"");
}
$story_limit=0;
while (($story_limit<$storynum) and ($story_limit<sizeof($xtab))) {
list($s_sid, $catid, $aid, $title, $time, $hometext, $bodytext, $comments, $counter, $topic, $informant, $notes) = $xtab[$story_limit];
$story_limit++;
if (!$imgtmp=theme_image("box/print.gif")) { $imgtmp="images/print.gif"; }
$printP="<a href=\"print.php?sid=$s_sid\" target=\"_blank\"><img src=\"$imgtmp\" BORDER=\"0\" ALT=\"".translate("Printer Friendly Page")."\" align=\"absmiddle\"></a> ";
if (!$imgtmp=theme_image("box/friend.gif")) { $imgtmp="images/friend.gif"; }
$sendF = "<a href=\"friend.php?op=FriendSend&sid=$s_sid\"><img src=\"$imgtmp\" BORDER=\"0\" ALT=\"".translate("Send this Story to a Friend")."\" align=\"absmiddle\"></a>";
getTopics($s_sid);
formatTimestamp($time);
$subject = stripslashes($subject);
$hometext = stripslashes($hometext);
$notes = stripslashes($notes);
$introcount = strlen($hometext);
$fullcount = strlen($bodytext);
$totalcount = $introcount + $fullcount;
if (isset($cookie[4])) { $morelinkT="&mode=$cookie[4]"; } else { $morelinkT="mode=thread"; }
if (isset($cookie[5])) { $morelinkT.="&order=$cookie[5]"; } else { $morelinkT="&order=0"; }
if (isset($cookie[6])) { $morelinkT.="&thold=$cookie[6]"; } else { $morelinkT="&thold=0"; }
if ($fullcount > 1) {
$morelink=" <a href=\"article.php?sid=$s_sid&$morelinkT\" CLASS=\"NOIR\">".translate("Read More...")."</a> | <FONT class=\"NOIR\">$totalcount ".translate("bytes more")."</font> | ";
} else {
$morelink=" ";
}
if ($comments==0) {
$morelink.="<a href=\"article.php?sid=$s_sid&$morelinkT\" CLASS=\"NOIR\">".translate("comments?")."</ a> | ";
} elseif ($comments==1) {
$morelink.="<a href=\"article.php?sid=$s_sid&$morelinkT\" CLASS=\"NOIR\">$comments ".translate("comment")."</a> | ";
} else {
$morelink.="<a href=\"article.php?sid=$s_sid&$morelinkT\" CLASS=\"NOIR\">$comments ".translate("comments")."</a> | ";
}
$morelink.="$printP $sendF";
$sid = $s_sid;
if ($catid != 0) {
$resultm = mysql_query("select title from stories_cat where catid='$catid'");
list($title1) = mysql_fetch_row($resultm);
$title = "<a href=\"index.php?op=newindex&catid=$catid\" CLASS=\"NOIR\">$title1</a> : $title";
$morelink.=" : <a href=\"index.php?op=newindex&catid=$catid\" CLASS=\"NOIR\">$title1</a>";
}
$morelink.=" ";
themeindex($aid, $informant, $datetime, $title, $counter, $topic, $hometext, $notes, $morelink, $topicname, $topicimage, $topictext);
}
}

/////////////////////////////////////////////

function couvertures() {
$numfr1 = "44"; // SPM VF
$numfr2 = "17"; // USM VF
$numus1 = "56"; // ASM VO
$numus2 = "3"; // SSM VO
$numus3 = "44"; // USM VO

$numfr1ig = "ult18.jpg"; // SPM VF img
$numfr2ig = "ult20.jpg"; // USM VF img
$numus1ig = "ult16.jpg"; // ASM VO img
$numus2ig = "ult18.jpg"; // SSM VO img
$numus3ig = "ult20.jpg"; // USM VO img

///////////////////////////////////////////
$content ="<table width=\"100%\" height=\"240\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\"><tr>";
if ($couv = 'fr' ) {
$content .=
"<td><img src=\"themes/Bleu/images/pixou.gif\" width=\"43\" height=\"200\"></td>
<td width=\"33%\"><center><img src=\"images/issues/$numfr1ig\" alt=\"Derniers numéros des séries régulières, en cours de publication, publiés au mois de $mois\" border=\"1\"></center></td>
<td><img src=\"themes/Bleu/images/pixou.gif\" width=\"43\" height=\"200\"></td>
<td width=\"33%\"><center><img src=\"images/issues/$numfr2ig\" alt=\"Derniers numéros des séries régulières, en cours de publication, publiés au mois de $mois\" border=\"1\"></center></td>
<td><img src=\"themes/Bleu/images/pixou.gif\" width=\"42\" height=\"200\"></td>
</tr>
<tr>
<td width=\"11%\" height=\"29\"></td>
<td width=\"33%\" height=\"29\"><center>SMM n° $numfr1</center></td>
<td width=\"11\" height=\"29\"></td>
<td width=\"33%\" height=\"29\"><center>USM n° $numfr2</center></td>
<td width=\"11%\" height=\"29\"></td>
</tr>
</table>";
$content .="<center>[<a href=\"index.php?couv=us\" color=\"#000000\"> Afficher les couvertures des sorties américaines du mois</a>]</center>";
} elseif ($couv = 'us' ){
$content .=
"<td width=\"33%\"><center><img src=\"images/issues/$numus1ig\" alt=\"Derniers numéros des séries régulières, en cours de publication, publiés au mois de $mois\" border=\"1\"></center></td>
<td width=\"33%\"><center><img src=\"images/issues/$numus2ig\" alt=\"Derniers numéros des séries régulières, en cours de publication, publiés au mois de $mois\" border=\"1\"></center></td>
<td width=\"33%\"><center><img src=\"images/issues/$numus3ig\" alt=\"Derniers numéros des séries régulières, en cours de publication, publiés au mois de $mois\" border=\"1\"></center></td>
</tr>
<tr>
<td width=\"33%\" height=\"29\"><center>ASM #$numus1</center></td>
<td width=\"33%\" height=\"29\"><center>SSM #$numus2</center></td>
<td width=\"33%\" height=\"29\"><center>USM #$numus3</center></td>
</tr>
</table>";
$content .="<center>[<a href=\"index.php?couv=fr\"> Afficher les couvertures des sorties françaises du mois</a>]</center>";
} else {
$content .=
"<td><img src=\"themes/Bleu/images/pixou.gif\" width=\"43\" height=\"200\"></td>
<td width=\"33%\"><center><img src=\"images/issues/$numfr1ig\" alt=\"Derniers numéros des séries régulières, en cours de publication, publiés au mois de $mois\" border=\"1\"></center></td>
<td><img src=\"themes/Bleu/images/pixou.gif\" width=\"43\" height=\"200\"></td>
<td width=\"33%\"><center><img src=\"images/issues/$numfr2ig\" alt=\"Derniers numéros des séries régulières, en cours de publication, publiés au mois de $mois\" border=\"1\"></center></td>
<td><img src=\"themes/Bleu/images/pixou.gif\" width=\"42\" height=\"200\"></td>
</tr>
<tr>
<td width=\"11%\" height=\"29\"></td>
<td width=\"33%\" height=\"29\"><center>SMM n° $numfr1</center></td>
<td width=\"11\" height=\"29\"></td>
<td width=\"33%\" height=\"29\"><center>USM n° $numfr2</center></td>
<td width=\"11%\" height=\"29\"></td>
</tr>
</table>";
$content .="<center>[<a href=\"index.php?couv=us\" color=\"#000000\"> Afficher les couvertures des sorties américaines du mois</a>]</center>";
}
$bloctitre1 = "Couvertures du mois <script type=\"text/!javascript!\">\n"
."var monthNames = new Array( \"de janvier\",\"de février\",\"de mars\",\"d'avril\",\"de mai\",\"de juin\",\"de juillet\",\"d'août\",\"de septembre\",\"d'octobre\",\"de novembre\",\"de décembre\");\n"
."var now = new Date();\n"
."thisYear = now.getYear();\n"
."document.write(monthNames[now.getMonth()] + \" \" + thisYear);\n"
."</script>";
themecenterbox($bloctitre1,$content);
}
////////////////////////////////////////////////////


f unction accueil() {
// Titre des blocks
$blocktitre1 = " <font class=\"option\"><b>Edito</b></font>";
// Blocks
echo "<table width=\"98%\" align=\"center\" border=\"0\" cellpadding=\"1\" cellspacing=\"0\" bgcolor=\"#006699\">\n"
."<tr>"
."<td> <table width=\"100%\" height=\"13\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" bgcolor=\"#EEEEFB\">\n"
."<tr> \n"
."<td align=\"left\">$blocktitre1</td>\n"
."</tr>\n"
."</table></td></tr></table>\n";

echo "<table width=\"97%\" align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n"
."<tr> \n"
."<td colspan=\"2\" bgcolor=\"#F7F7FD\"><br>
<font color=\"#006699\">></font> Bienvenue sur Spider-Man: Webspinner !<br> <br>
Réalisé dans une optique de renouvellement des sites actuellement
disponibles sur l'Araignée Humaine, Spider-Man: The Webspinner se veut
être un site complet, pratique et évolutif.<br>
</td>\n"
."</tr>\n"
."</table>\n";

echo "<table width=\"98%\" align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n"
."<tr>\n"
."<td width=\"68%\" valign=\"top\" bgcolor=\"#F7F7FD\">
Pourquoi un site sur Spider-Man ? Tout simplement pour rassembler les fans francophones
du tisseur sur un même lieu de discussion et de connaissance.<br>
Notre but ? Réaliser, sur la toile, une encyclopédie francophone complète
de l'univers de l'Araignée Humaine.<br><br>
Merci de nous indiquer tout bug que vous rencontriez afin de le corriger pour la prochaine mise à jour. Si vous avez apprécié ce travail et souhaitez nous aider, alors [contactez nous] !
</td>\n";
echo "<td width=\"32%\"><BR>\n";
$content = "";
lnlbox();
echo "</td>\n"
."</tr>\n"
."</table>\n";
}
////////////////////////////////////// ////////////

function blocs() {
// Blocks
echo "<table width=\"98%\" align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td valign=\"top\">\n";
echo "<font class=\"content\"><tr>";

echo "<td width=\"68%\" valign=\"top\" align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
couvertures();
echo "<td width=\"32%\" valign=\"top\" align=\"left\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
pollNewest1();
echo "</td></tr></font>\n";
echo "</td></tr></table><br>";
}
//////// /////////////////////////////////////

!include!("header.php" ;);
OpenTitre();
echo "ACCUEIL";
CloseTitre();
accueil();
blocs();
Op enTitre();
echo "NEWS";
CloseTitre();
aff_news();
!include!("foo ter.php");
?>



Cet article provient de NPDS

http://www.npds.org/viewtopic.php?topic=8618&forum=5