Update of /cvsroot/openfirst/news
In directory sc8-pr-cvs1:/tmp/cvs-serv17466
Modified Files:
comments.php
Log Message:
Removed error in which the query uses StoryID in the where claus. I removed this and it seems to work. I would ask Greg to overlook these features as it seems to be behaving strangely.
Index: comments.php
===================================================================
RCS file: /cvsroot/openfirst/news/comments.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** comments.php 23 Nov 2003 19:58:49 -0000 1.3
--- comments.php 6 Dec 2003 18:08:21 -0000 1.4
***************
*** 44,50 ****
if(function_exists("latest_posts")){
//forum integration
! $q=ofirst_dbquery("SELECT Website FROM ofirst_news_comments WHERE StoryID='$id'");
! if(ofirst_dbnum_rows($q)!=0){
! $redirect=ofirst_dbfetch_object($q);
header("Location: ".$redirect->Website);
} else {
--- 44,50 ----
if(function_exists("latest_posts")){
//forum integration
! $forum_query = ofirst_dbquery("SELECT Website FROM ofirst_news_comments WHERE ID='$id'");
! if(ofirst_dbnum_rows($forum_query) != 0){
! $redirect = ofirst_dbfetch_object($forum_query);
header("Location: ".$redirect->Website);
} else {
***************
*** 54,58 ****
$query=ofirst_dbquery("SELECT ID FROM ofirst_forumposts WHERE forum='".newsforum."' AND ReplyTo=0 AND Title='".$newspost->title."' AND Author='".$newspost->poster."' AND Message='".addslashes($newspost->news)."'");
$news=ofirst_dbfetch_object($query);
! ofirst_dbquery("INSERT INTO ofirst_news_comments (StoryID,Author,Website,Comment,Date) values ('$id','".$newspost->poster."','".$basepath."/forum/thread.php?id=".$news->ID."','Discussion moved to forum','".date("Y-m-d H:i:s")."');");
header("Location: ".$basepath."/forum/thread.php?id=".$news->ID);
}
--- 54,58 ----
$query=ofirst_dbquery("SELECT ID FROM ofirst_forumposts WHERE forum='".newsforum."' AND ReplyTo=0 AND Title='".$newspost->title."' AND Author='".$newspost->poster."' AND Message='".addslashes($newspost->news)."'");
$news=ofirst_dbfetch_object($query);
! ofirst_dbquery("INSERT INTO ofirst_news_comments (ID,Author,Website,Comment,Date) values ('$id','".$newspost->poster."','".$basepath."/forum/thread.php?id=".$news->ID."','Discussion moved to forum','".date("Y-m-d H:i:s")."');");
header("Location: ".$basepath."/forum/thread.php?id=".$news->ID);
}
***************
*** 65,76 ****
<tr><th colspan='2'>
<?php
! $q=ofirst_dbquery("SELECT title FROM ofirst_news WHERE ID='$id'");
! if(ofirst_dbnum_rows($q)!=0){
! $post=ofirst_dbfetch_object($q);
echo("Discussion: ".$post->title);
echo("</th></tr>");
! $q=ofirst_dbquery("SELECT * FROM ofirst_news_comments WHERE StoryID='$id'");
! if(ofirst_dbnum_rows($q)!=0){
! while($post=ofirst_dbfetch_object($q)){
echo("<tr valign='top'><td class='sub' width='200'>");
if($post->EMail!=""){
--- 65,76 ----
<tr><th colspan='2'>
<?php
! $comment_query = ofirst_dbquery("SELECT title FROM ofirst_news WHERE ID='$id'");
! if(ofirst_dbnum_rows($comment_query) != 0){
! $post=ofirst_dbfetch_object($comment_query);
echo("Discussion: ".$post->title);
echo("</th></tr>");
! $discussion_query = ofirst_dbquery("SELECT * FROM ofirst_news_comments WHERE ID = '$id'");
! if(ofirst_dbnum_rows($discussion_query) !=0 ){
! while($post = ofirst_dbfetch_object($discussion_query)){
echo("<tr valign='top'><td class='sub' width='200'>");
if($post->EMail!=""){
|