Автор: Uniq
Дата сообщения: 20.08.2001 11:11
		Привет. Пара новых проблем. Я думал только у меня, но зашел на ролемансер, там аналогичная проблема. В общем когда выводим календарь за год, то под таблицей с календарем на год высвечиваются новости за 9 августа (и у меня и у вас). Возможно завтра вообще будут выводится новости за 10 августа... 
  
 Второе. У меня не выводится надпись "Нет новостей на этот день". Просто пустое пространство. И когда вывожу новости за день, не выводится дата новости. 
  
 Посмотрите пожалуйста мой код, может что найдете: 
  
 
Код:  
 ################################## 
  
  
 $date_Array = explode("/",$Date);if ($date_Array[0] < 10) {$pref ="0";} else {$pref="";} 
 if ($date_Array[2] < 10) {$pref ="0";} else {$pref="";}$day1=$date_Array[2]."-".$pref.$date_Array[0]."-".$date_Array[1].""; $result = mysql_query("SELECT sid, catid, aid, title, time, hometext, bodytext, comments, counter, topic, informant, notes FROM nuke_stories WHERE (time like '%$day1%') ORDER BY time DESC");    if((!$result) OR ($result ==""))  {echo "<p><b><center>Нет новостей на этот день</b></center>"; exit();    } 
  
 while (list($s_sid, $catid, $aid, $title, $time, $hometext, $bodytext, $comments, $counter, $topic, $informant, $notes) = mysql_fetch_row($result)) { 
 if ($catid > 0) { 
     list($cattitle) = mysql_fetch_row(mysql_query("select title from $prefix"._stories."_cat where catid='$catid'")); 
 } 
 $printP = "<a href=\"print.php?sid=$s_sid\"><img src=\"images/print.gif\" border=0 Alt=\""._PRINTER."\" width=\"15\" height=\"11\"></a> "; 
 $sendF = "<a href=\"friend.php?op=FriendSend&sid=$s_sid\"><img src=\"images/friend.gif\" border=0 Alt=\""._FRIEND."\" width=\"15\" height=\"11\"></a>"; 
 getTopics($s_sid); 
 formatTimestamp($time); 
 $subject = stripslashes($subject); 
 $hometext = stripslashes($hometext); 
 $notes = stripslashes($notes); 
 $introcount = strlen($hometext); 
 $fullcount = strlen($bodytext); 
 $totalcount = $introcount + $fullcount; 
 $morelink = ""; 
 if ($fullcount > 1) { 
     $morelink .= "<a href=\"article.php?sid=$s_sid"; 
     if (isset($cookie[4])) { $morelink .= "&mode=$cookie[4]"; } else { $morelink .= "&mode=thread"; } 
     if (isset($cookie[5])) { $morelink .= "&order=$cookie[5]"; } else { $morelink .= "&order=0"; } 
     $morelink .= "\"><b>"._READMORE."</b></a> | "; } 
     $count = $comments; 
     $morelink .= "<a href=\"article.php?sid=$s_sid"; 
     if (isset($cookie[4])) { $morelink .= "&mode=$cookie[4]"; } else { $morelink .= "&mode=thread"; } 
     if (isset($cookie[5])) { $morelink .= "&order=$cookie[5]"; } else { $morelink .= "&order=0"; } 
     if (isset($cookie[6])) { $morelink .= "&thold=$cookie[6]"; } else { $morelink .= "&thold=0"; } 
     $morelink2 = "<a href=\"article.php?sid=$s_sid"; 
     if (isset($cookie[4])) { $morelink2 .= "&mode=$cookie[4]"; } else { $morelink2 .= "&mode=thread"; } 
     if (isset($cookie[5])) { $morelink2 .= "&order=$cookie[5]"; } else { $morelink2 .= "&order=0"; } 
     if (isset($cookie[6])) { $morelink2 .= "&thold=$cookie[6]"; } else { $morelink2 .= "&thold=0"; } 
     if(($count==0)) { 
 if ($catid > 0) { 
     $morelink .= "\">"._COMMENTSQ."</a> | $printP $sendF | <a href=\"categories.php?op=newindex&catid=$catid\">$cattitle</a>"; 
 } else { 
     $morelink .= "\">"._COMMENTSQ."</a> | $printP $sendF"; 
 } 
 } else { 
     if (($fullcount<1)) { 
 if(($count==1)) { 
     if ($catid > 0) { 
 $morelink .= "\"><b>"._READMORE."</b></a> | $morelink2\">$count "._COMMENT."</a> | $printP $sendF | <a href=\"categories.php?op=newindex&catid=$catid\">$cattitle</a>"; 
     } else { 
 $morelink .= "\"><b>"._READMORE."</b></a> | $morelink2\">$count "._COMMENT."</a> | $printP $sendF"; 
     } 
 } else { 
     if ($catid > 0) { 
 $morelink .= "\"><b>"._READMORE."</b></a> | $morelink2\">$count "._COMMENTS."</a> | $printP $sendF | <a href=\"categories.php?op=newindex&catid=$catid\">$cattitle</a>"; 
     } else { 
 $morelink .= "\"><b>"._READMORE."</b></a> | $morelink2\">$count "._COMMENTS."</a> | $printP $sendF"; 
     } 
 } 
     } else { 
 if(($count==1)) { 
     if ($catid > 0) { 
 $morelink .= "\">$count "._COMMENT."</a> | $printP $sendF | <a href=\"categories.php?op=newindex&catid=$catid\">$cattitle</a>"; 
     } else { 
 $morelink .= "\">$count "._COMMENT."</a> | $printP $sendF"; 
     } 
 } else { 
     if ($catid > 0) { 
 $morelink .= "\">$count "._COMMENTS."</a> | $printP $sendF | <a href=\"categories.php?op=newindex&catid=$catid\">$cattitle</a>"; 
     } else { 
 $morelink .= "\">$count "._COMMENTS."</a> | $printP $sendF"; 
     } 
 } 
     } 
 } 
 $sid = $s_sid; 
 if ($catid != 0) { 
     $resultm = mysql_query("select title from $prefix"._stories."_cat where catid='$catid'"); 
     list($title1) = mysql_fetch_row($resultm); 
     $title = "<a class =\"storycat\" href=\"categories.php?op=newindex&catid=$catid\">$title1</a>: $title"; 
 } 
 themeindex($aid, $informant, $datetime, $title, $counter, $topic, $hometext, $notes, $morelink, $topicname, $topicimage, $topictext); 
     } 
  
  
 ###############