"SfR Fresh" - the SfR Freeware/Shareware Archive 
/********************************************************************/
function cmEditList($topic_id=0, $level=0, $type='news'){
/**
* This function displays comments posted to a particular
* story
*
* Ex: cmEditList($id);
*/
global $myNewsConf;
$comments = 0;
if($level == 0){
$query = "select artnr, cmtnr, cmtitle, cmauthor, cmdate, commenttext from "
. $myNewsConf['db']['table']['comments'] . " where artnr = $topic_id and pid = 0 and type = '$type'"
. " order by cmdate, artnr";
} else {
$query = "select artnr, cmtnr, cmtitle, cmauthor, cmdate, commenttext from "
. $myNewsConf['db']['table']['comments'] . " where pid = $topic_id and type = '$type'"
. " order by cmdate, artnr";
}
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result)){
$sid = $row['artnr'];
$tid = $row['cmtnr'];
$title = $row['cmtitle'];
$author = $row['cmauthor'];
$timestamp = $row['cmdate'];
$comment = $row['commenttext'];
if (!$level){
if (!$comments){
print <<
Deleted the following Children
EOT;
}
} else {
if (!$comments) {
print "
\n";
}
print '
\n";
}
} //End cmEditList()
/********************************************************************/
?>
/********************************************************************/
function cmChildDelete($topic_id=0, $level=0, $type='news'){
/**
* This function displays comments posted to a particular
* story
*
* Ex: cmChildDelete($sid);
*/
global $myNewsConf;
$comments = 0;
if($level == 0){
$query = "select artnr, cmtnr, cmtitle, cmauthor, cmdate, commenttext from "
. $myNewsConf['db']['table']['comments'] . " where artnr = $topic_id and pid = 0"
. " order by cmdate, artnr";
} else {
$query = "select artnr, cmtnr, cmtitle, cmauthor, cmdate, commenttext from "
. $myNewsConf['db']['table']['comments'] . " where pid = $topic_id "
. " order by cmdate, artnr";
}
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result)){
$sid = $row['artnr'];
$tid = $row['cmtnr'];
$title = $row['cmtitle'];
$author = $row['cmauthor'];
$timestamp = $row['cmdate'];
$comment = $row['commenttext'];
if (!$level){
if (!$comments){
print <<
\n";}
cmEditList($tid, $level+1,$type);
}
if ($level && $comments) {
print "
EOT;
}
} else {
if (!$comments) {
print "
\n";
}
print '
\n";
}
} //End cmChildDelete()
/********************************************************************/
\n";}
cmChildDelete($tid, $level+1, $type);
}
if ($level && $comments) {
print "