Fix moderation links

Add link targets for each comment so that we can go back to the original/
new comment after posting or moderating.
pull/193/head
Michael R Sweet 20 years ago
parent 2b6f4e62be
commit 7037fa1d31
  1. 11
      www/articles.php
  2. 16
      www/comment.php
  3. 9
      www/phplib/common.php

@ -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 $".
//
?>

@ -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 $".
//
?>

@ -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 $".
//
?>

Loading…
Cancel
Save