Cytat
13-06-2004
- Tytuł
- Tytuł
- Tytuł
12-06-2004
- Tytuł
11-06-2004
- Tytuł
- Tytuł
- Tytuł
- Tytuł
- Tytuł
12-06-2004
- Tytuł
11-06-2004
- Tytuł
- Tytuł
. Tylko jest mały mankament a mianowicie jesli w jakimś dniu nie był dodany żaden news to pojawia się pusta data:
Cytat
13-06-2004
- Tytuł
- Tytuł
- Tytuł
12-06-2004
11-06-2004
- Tytuł
- Tytuł
- Tytuł
- Tytuł
- Tytuł
12-06-2004
11-06-2004
- Tytuł
- Tytuł
Jak zrobić żeby nie wyświetlał tych dni gdzie nie ma postów ale nadal wyświetlał 3 dni ?:
Cytat
13-06-2004
- Tytuł
- Tytuł
11-06-2004
- Tytuł
- Tytuł
- Tytuł
10-06-2004
- Tytuł
- Tytuł
- Tytuł
- Tytuł
11-06-2004
- Tytuł
- Tytuł
- Tytuł
10-06-2004
- Tytuł
- Tytuł
A oto kod:
<?php $content = \"<table width=\"100%\" border=\"0\">\"; //dzis $content .= \"<tr><td align=\"center\"><b>$today2</b></td><td align=\"right\"></td></tr>\"; $sql = \"SELECT sid, title FROM \".$prefix.\"_stories WHERE LEFT(time ,10) = '$today' ORDER BY sid DESC\"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $sid = $row['sid']; $title = $row['title']; $content .= \"<tr><td align=\"left\"><strong><big>·</big></strong> <a href=\"modules.php?name=News&file=article&sid=$sid\">$title</a></td><td align=\"right\"></td></tr>\"; } //wczoraj $content .= \"<tr><td align=\"center\"><br><b>$wczoraj2</b></td><td align=\"right\"></td></tr>\"; $sql = \"SELECT sid, title FROM \".$prefix.\"_stories WHERE LEFT(time ,10) = '$wczoraj' ORDER BY sid DESC\"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $sid = $row['sid']; $title = $row['title']; $content .= \"<tr><td align=\"left\"><strong><big>·</big></strong> <a href=\"modules.php?name=News&file=article&sid=$sid\">$title</a></td><td align=\"right\"></td></tr>\"; } //przedwczoraj $content .= \"<tr><td align=\"center\"><br><b>$przed2</b></td><td align=\"right\"></td></tr>\"; $sql = \"SELECT sid, title FROM \".$prefix.\"_stories WHERE LEFT(time ,10) = '$przed' ORDER BY sid DESC\"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $sid = $row['sid']; $title = $row['title']; $content .= \"<tr><td align=\"left\"><strong><big>·</big></strong> <a href=\"modules.php?name=News&file=article&sid=$sid\">$title</a></td><td align=\"right\"></td></tr>\"; } $content .= \"</table>\"; ?>