Jeg er ret sikker på at det er den kodestump. Hvis man fjerner linien
}
if ($loonr == $storynum OR $loonr == $kokku) {
så dukker artiklerne op når man klikker på et theme-ikon. Men så viser den hver artikel flere gange. $loonr og $kokku er relateret til den html der viser nyhederne i to kolonner, men hvordan kan jeg sgutte gennemskue. Nedenunder er hele indholdet af theme.php hvis det kan gøre det nemmere at se fidusen.
<?php
/******************************************************************/
/* Theme Name: blueweb_v3 */
/* Original Theme Name: Milo (v1.0) */
/* Copyright (c) 2003 John Grabenmeier (
http://www.jooon.de) */
/* Letzte ƒnderung: 13.7.2003 */
/******************************************************************/
/************************************************************/
/* Theme Colors Definition */
/* */
/* Define colors for your web site. $bgcolor2 is generaly */
/* used for the tables border as you can see on OpenTable() */
/* function, $bgcolor1 is for the table background and the */
/* other two bgcolor variables follows the same criteria. */
/* $texcolor1 and 2 are for tables internal texts */
/************************************************************/
global $loonr, $prefix, $dbi, $kokku;
$kokku = sql_num_rows(sql_query("select * from ".$prefix."_stories LIMIT 0, 30 ", $dbi), $dbi);
$bgcolor1 = "#efefef";
$bgcolor2 = "#7281A3";
$bgcolor3 = "#efefef";
$bgcolor4 = "#7281A3";
$textcolor1 = "#000000";
$textcolor2 = "#000000";
if ($loonr == "") {
$loonr = "0";
}
include("themes/blueweb_v3/tables.php");
/************************************************************/
/* FormatStory */
/* */
/* Here we'll format the look of the stories in our site. */
/* If you dig a little on the function you will notice that */
/* we set different stuff for anonymous, admin and users */
/* when displaying the story. */
/************************************************************/
function FormatStory($thetext, $notes, $aid, $informant) {
global $anonymous;
if ($notes != "") {
$notes = "<br><br><b>"._NOTE."</b> <i>$notes</i>\n";
} else {
$notes = "";
}
if ("$aid" == "$informant") {
echo "<font class=\"content\" color=\"#505050\">$thetext$notes</font>\n";
} else {
if($informant != "") {
$boxstuff = "<a href=\"modules.php?name=Your_Account&op=userinfo&uname=$informant\">$informant</a> ";
} else {
$boxstuff = "$anonymous ";
}
$boxstuff .= ""._WRITES." <i>\"$thetext\"</i>$notes\n";
echo "<font class=\"content\" color=\"#505050\">$boxstuff</font>\n";
}
}
/************************************************************/
/* Function themeheader() */
/* */
/* Control the header for your site. You need to define the */
/* BODY tag and in some part of the code call the blocks */
/* function for left side with: blocks(left); */
/************************************************************/
function themeheader() {
global $user, $banners, $sitename, $slogan, $cookie, $prefix;
cookiedecode($user);
$username = $cookie[1];
if ($username == "") {
$username = "Anonymous";
}
echo "<body bgcolor=\"#ffffff\" text=\"#000000\" link=\"#363636\" vlink=\"#363636\" alink=\"#d5ae83\" topmargin=\"0\" leftmargin=\"0\" rightmargin=\"0\">\n"
."\n";
echo " \n"
."<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\" align=\"center\" bgcolor=\"#293565\">\n"
."<tr height=\"80\">\n"
."<td bgcolor=\"#293565\" valign=\"middle\" class=\"title\">\n"
."<a href=\"index.php\" class=\"title\"><img src=\"themes/blueweb_v3/images/logo3.gif\" title=\"$sitename\" border=\"0\"></a><td height=\"10\"> </td></td><td weight=\"30\"></td><td align=\"middle\">";
if ($banners) {
include("banners.php");
}
echo "</td>\n"
."</table>\n"
."<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\" align=\"center\" bgcolor=\"#ffffff\">\n"
."<tr>\n"
."<td bgcolor=\"#7281A3\">\n"
."<img src=\"themes/blueweb_v3/images/tophighlight.gif\" width=\"100%\"></td>\n"
."</tr>\n"
."</table>\n"
."<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\" align=\"center\" bgcolor=\"#ffffff\" valign=\"middle\">\n"
."<tr valign=\"middle\" height=\"15\">\n"
."<td bgcolor=\"#AFB7D8\" align=\"middle\">\n"
."</td>\n"
."<td bgcolor=\"#AFB7D8\" align=\"center\">\n"
."</tr></table>\n"
."<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\" align=\"center\" bgcolor=\"#fefefe\">\n"
."<tr>\n"
."<td bgcolor=\"#000000\" colspan=\"4\"><IMG src=\"themes/blueweb_v3/images/pixel.gif\" width=\"1\" height=1 alt=\"\" border=\"0\" hspace=\"0\"></td>\n"
."</tr>\n"
."<tr valign=\"middle\" bgcolor=\"#7281A3\">\n"
."<td width=\"15%\" nowrap><font class=\"content\" color=\"#363636\">\n";
if ($username == "Anonymous") {
echo " <font color=\"#363636\" class=\"top\"> Du er ikke logget ind. [ <a href=\"modules.php?name=Your_Account\" class=\"top\">login</a> ]</font>\n";
} else {
echo "<font class=\"top\"> ".Hallo." $username! [ <a href=\"modules.php?name=Your_Account&op=logout\" class=\"top\">Logout</a> ]</font>";
}
echo "</font></td>\n"
."<td align=\"center\" height=\"20\" width=\"60%\"><font class=\"content\">\n"
." \n"
."</td>\n"
."<td align=\"right\" width=\"25%\"><font class=\"content\">\n"
."<script type=\"text/javascript\">\n\n"
."<!-- // Array ofmonth Names\n"
."var monthNames = new Array( \"Januar\",\"Februar\",\"Marts\",\"April\",\"Maj\",\"Juni\",\"Juli\",\"August\",\"September\",\"Oktober\",\"November\",\"December\");\n"
."var now = new Date();\n"
."thisYear = now.getYear();\n"
."if(thisYear < 1900) {thisYear += 1900}; // corrections if Y2K display problem\n"
."document.write(\" \" + now.getDate() + \". \" + monthNames[now.getMonth()] + \", \" + thisYear);\n"
."// -->\n\n"
."</script></font></td>\n"
."<td> </td>\n"
."</tr>\n"
."<tr>\n"
."<td bgcolor=\"#000000\" colspan=\"4\"><IMG src=\"themes/blueweb_v3/images/pixel.gif\" width=\"1\" height=\"1\" alt=\"\" border=\"0\" hspace=\"0\"></td>\n"
."</tr>\n"
."</table>\n"
."<!-- FIN DEL TITULO -->\n"
."<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" bgcolor=\"#ffffff\" align=\"center\">\n"
."<tr valign=\"top\">\n"
."<td bgcolor=\"#AFB7D8\"><img src=\"themes/blueweb_v3/images/pixel.gif\" width=\"1\" height=\"3\" border=\"0\" alt=\"\"></td>\n"
."</tr>\n"
."<tr valign=\"top\">\n"
."<td bgcolor=\"#ffffff\"><img src=\"themes/blueweb_v3/images/pixel.gif\" width=\"1\" height=\"5\" border=\"0\" alt=\"\"></td>\n"
."</tr>\n"
."</table>\n"
;
$public_msg = public_message();
echo "$public_msg<br>";
echo "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" bgcolor=\"#ffffff\" align=\"center\"><tr valign=\"top\">\n"
."<td bgcolor=\"#eeeeee\" width=\"150\" valign=\"top\">\n";
blocks(left);
echo "</td><td><img src=\"themes/blueweb_v3/images/pixel.gif\" width=\"15\" height=\"1\" border=\"0\" alt=\"\"></td><td width=\"100%\">\n";
}
/************************************************************/
/* Function themefooter() */
/* */
/* Control the footer for your site. You don't need to */
/* close BODY and HTML tags at the end. In some part call */
/* the function for right blocks with: blocks(right); */
/* Also, $index variable need to be global and is used to */
/* determine if the page your're viewing is the Homepage or */
/* and internal one. */
/************************************************************/
function themefooter() {
global $index;
if ($index == 1) {
echo "</td><td><img src=\"themes/blueweb_v3/images/pixel.gif\" width=\"15\" height=\"1\" border=\"0\" alt=\"\"></td><td valign=\"top\" width=\"150\" bgcolor=\"#eeeeee\">\n";
blocks(right);
}
echo "</td>\n"
."</tr></table>\n"
."<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\">\n"
."<tr>\n"
."<td width=\"100%\" height=\"5\"><img src=\"themes/blueweb_v3/images/bottombar.gif\" width=\"100%\" height=\"5\" border=\"0\" alt=\"\"></td>\n"
."</tr>\n"
."<tr>\n"
."<td width=\"100%\"><img src=\"themes/blueweb_v3/images/pixel.gif\" width=\"1\" height=\"1\" border=\"0\" alt=\"\"></td>\n"
."</tr><tr><td height=\"5\"> </td></tr><tr><td align=\"middle\"><a href=\"
http://www.jooon.de/themes.html\" target=\"_blank\" class=\"bottom\" title=\"Layout by jooon.de\"><img src=\"themes/blueweb_v3/images/jooon.gif\" border=\"0\" alt=\"Layout by jooon.de\"></a></td></tr>\n"
."</table>\n"
."<br>\n"
."<br>\n"
."<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\">\n"
."<tr align=\"center\">\n"
."<td width=\"100%\" colspan=\"3\">\n";
footmsg();
echo "</td>\n"
."</tr>\n"
."</table>\n";
}
/************************************************************/
/* Function themeindex() */
/* */
/* This function format the stories on the Homepage */
/************************************************************/
function themeindex ($aid, $informant, $time, $title, $counter, $topic, $thetext, $notes, $morelink, $topicname, $topicimage, $topictext) {
global $anonymous, $tipath, $cookie, $loonr, $vasak, $parem, $kokku, $storyhome, $storynum;
$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/images/topics/$topicimage")) {
$t_image = "themes/$ThemeSel/images/topics/$topicimage";
} else {
$t_image = "$tipath$topicimage";
}
$loonr = ($loonr+1);
if (isset($cookie[3])) {
$storynum = $cookie[3];
} else {
$storynum = $storyhome;
}
$ridaaa1 = round($loonr/2);
if ($notes != "") {
$notes = "<br><br><b>"._NOTE."</b> <i>$notes</i>\n";
} else {
$notes = "";
}
if ("$aid" == "$informant") {
$content = "$thetext$notes\n";
} else {
if($informant != "") {
$content = "<a href=\"modules.php?name=Your_Account&op=userinfo&uname=$informant\">$informant</a> ";
} else {
$content = "$anonymous ";
}
$content .= ""._WRITES." <i>\"$thetext\"</i>$notes\n";
}
$posted .= " "._ON." $time $timezone ($counter "._READS.")";
if (($ridaaa1*2) != $loonr) {
$tmpl_file = "themes/blueweb_v3/story_home.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
$vasak .= "$r_file";
} else {
$tmpl_file = "themes/blueweb_v3/story_home.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
$parem .= "$r_file";
}
if ($loonr == $storynum OR $loonr == $kokku) {
echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
echo "<tr>";
echo "<td width=\"49%\" valign=\"top\">";
print $vasak;
echo "</td>";
echo "<td width=\"5\" cellpadding=\"0\" cellspacing=\"0\" valign=\"top\"></td>";
echo "<td width=\"49%\" valign=\"top\">";
print $parem;
echo "</td>";
echo "</tr>";
echo "</table>";
}
}
/************************************************************/
/* Function themeindex() */
/* */
/* This function format the stories on the story page, when */
/* you click on that "Read More..." link in the home */
/************************************************************/
function themearticle ($aid, $informant, $datetime, $title, $thetext, $topic, $topicname, $topicimage, $topictext) {
global $admin, $sid, $tipath;
$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/images/topics/$topicimage")) {
$t_image = "themes/$ThemeSel/images/topics/$topicimage";
} else {
$t_image = "$tipath$topicimage";
}
$posted = ""._POSTEDON." $datetime "._BY." ";
$posted .= get_author($aid);
if ($notes != "") {
$notes = "<br><br><b>"._NOTE."</b> <i>$notes</i>\n";
} else {
$notes = "";
}
if ("$aid" == "$informant") {
$content = "$thetext$notes\n";
} else {
if($informant != "") {
$content = "<a href=\"modules.php?name=Your_Account&op=userinfo&uname=$informant\">$informant</a> ";
} else {
$content = "$anonymous ";
}
$content .= ""._WRITES." <i>\"$thetext\"</i>$notes\n";
}
$tmpl_file = "themes/blueweb_v3/story_page.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
}
/************************************************************/
/* Function themesidebox() */
/* */
/* Control look of your blocks. Just simple. */
/************************************************************/
function themesidebox($title, $content) {
echo "<table width=\"140\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n"
."<tr>\n"
."<td align=\"center\" valign=\"top\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n"
."<tr>\n"
."<td bgcolor=\"#A7B7D8\"></td>\n"
."<td colspan=\"0\" bgcolor=\"#AFB7D8\" height=\"22\" align=\"left\"><b><img src=\"images/arrow.gif\"> $title</b></td>\n"
."<td bgcolor=\"#AFB7D8\"></td>\n"
."</tr>\n"
."<tr>\n"
."<td width=\"5\"></td>\n"
."<td valign=\"top\" align=\"left\">$content</td>\n"
."<td width=\"5\"></td>\n"
."</tr>\n"
."<tr>\n"
."<td colspan=\"3\"></td>\n"
."</tr>\n"
."</table></td>\n"
."</tr>\n"
."</table><br><br>\n"
."\n\n\n";
}
?>