Fix moderation links

Add link targets for each comment so that we can go back to the original/
new comment after posting or moderating.
This commit is contained in:
Michael R Sweet 2004-05-19 03:26:36 +00:00
parent 2b6f4e62be
commit 7037fa1d31
3 changed files with 13 additions and 23 deletions

View File

@ -1,6 +1,6 @@
<?php
//
// "$Id: articles.php,v 1.6 2004/05/19 02:57:18 mike Exp $"
// "$Id: articles.php,v 1.7 2004/05/19 03:26:36 mike Exp $"
//
// Web form for the article table...
//
@ -14,13 +14,6 @@ include_once "phplib/html.php";
include_once "phplib/common.php";
//
// Maximum number of articles per page...
//
$PAGE_MAX = 10;
// Get command-line options...
//
// Usage: article.php [operation] [options]
@ -716,6 +709,6 @@ switch ($op)
//
// End of "$Id: articles.php,v 1.6 2004/05/19 02:57:18 mike Exp $".
// End of "$Id: articles.php,v 1.7 2004/05/19 03:26:36 mike Exp $".
//
?>

View File

@ -1,6 +1,6 @@
<?php
//
// "$Id: comment.php,v 1.3 2004/05/19 00:57:33 mike Exp $"
// "$Id: comment.php,v 1.4 2004/05/19 03:26:36 mike Exp $"
//
// Comment and moderation interface for PHP pages...
//
@ -168,10 +168,11 @@ else
$create_date = time();
db_query("INSERT INTO comment VALUES(NULL,$refer_id,2,'$file',"
."'$contents',$create_date,'$create_user')");
$id = db_insert_id();
}
$location = str_replace("_", "?", $path);
header("Location: $location");
header("Location: $location#_USER_COMMENT_$id");
}
else
{
@ -349,18 +350,13 @@ else
db_free($result);
}
if ($LOGIN_USER)
header("Location: $PHP_SELF");
else
{
$location = str_replace("_", "?", $path);
header("Location: $location");
}
$location = str_replace("_", "?", $path);
header("Location: $location#_USER_COMMENT_$id");
break;
}
}
//
// End of "$Id: comment.php,v 1.3 2004/05/19 00:57:33 mike Exp $".
// End of "$Id: comment.php,v 1.4 2004/05/19 03:26:36 mike Exp $".
//
?>

View File

@ -1,6 +1,6 @@
<?
//
// "$Id: common.php,v 1.6 2004/05/19 00:57:33 mike Exp $"
// "$Id: common.php,v 1.7 2004/05/19 03:26:36 mike Exp $"
//
// Common utility functions for PHP pages...
//
@ -601,11 +601,12 @@ show_comments($url, // I - URL for comment
$num_comments ++;
$create_date = date("M d, Y", $row['create_date']);
$create_date = date("H:i M d, Y", $row['create_date']);
$create_user = sanitize_email($row['create_user']);
$contents = sanitize_text($row['contents']);
print("<h$heading>From $create_user on $create_date (score=$row[status])</h$heading>\n"
print("<h$heading><a name='_USER_COMMENT_$row[id]'>From</a> "
."$create_user, $create_date (score=$row[status])</h$heading>\n"
."<p><tt>$contents</tt></p>\n");
html_start_links();
@ -635,6 +636,6 @@ show_comments($url, // I - URL for comment
//
// End of "$Id: common.php,v 1.6 2004/05/19 00:57:33 mike Exp $".
// End of "$Id: common.php,v 1.7 2004/05/19 03:26:36 mike Exp $".
//
?>