cvs: php-master-web / note.sql /manage user-notes.php
| From: | jim winstead | Date: | Wed, 21 Nov 2001 01:29:25 +0000 |
| Subject: | cvs: php-master-web / note.sql /manage user-notes.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-7473@lists.php.net to get a copy of this message | ||
jimw Tue Nov 20 20:29:25 2001 EDT
Modified files:
/php-master-web note.sql
/php-master-web/manage user-notes.php
Log:
no longer using 'removed' column to mark deletion
Index: php-master-web/note.sql
diff -u php-master-web/note.sql:1.1 php-master-web/note.sql:1.2
--- php-master-web/note.sql:1.1 Fri Oct 19 17:07:55 2001
+++ php-master-web/note.sql Tue Nov 20 20:29:25 2001
@@ -5,10 +5,6 @@
edit their own notes. */
/* TODO: lang should probably be linked to a languages table of some sort.
but we're not really using it yet, so maybe we don't want it at all. */
-/* TODO: the 'removed' thing is pretty lame. it would probably be okay to
- simplify the database-to-flat-file code to not bother with incremental
- updates (and perhaps just short-circuit when there are no updates at all),
- especially once voting is fully implemented. */
/* used by:
master.php.net/entry/user-note.php
@@ -27,7 +23,6 @@
votes INT NOT NULL DEFAULT '0',
rating INT NOT NULL DEFAULT '0',
updated DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
- removed INT(1) NOT NULL DEFAULT '0',
PRIMARY KEY (id),
KEY (sect)
) TYPE=MyISAM PACK_KEYS=1;
Index: php-master-web/manage/user-notes.php
diff -u php-master-web/manage/user-notes.php:1.10 php-master-web/manage/user-notes.php:1.11
--- php-master-web/manage/user-notes.php:1.10 Wed Oct 17 20:59:40 2001
+++ php-master-web/manage/user-notes.php Tue Nov 20 20:29:25 2001
@@ -82,10 +82,10 @@
if ($id) {
if ($result = mysql_query("SELECT * FROM note WHERE id=$id")) {
$row = mysql_fetch_array($result);
- if (!$row['removed'] && mysql_query("UPDATE note SET removed=1 WHERE
id=$id")) {
- $mailto = "php-notes@lists.php.net";
- // ** alerts **
- //$mailto .= get_emails_for_sect($row["sect"]);
+ if ($row['id'] && mysql_query("DELETE FROM note WHERE id=$id")) {
+ $mailto = "php-notes@lists.php.net";
+ // ** alerts **
+ //$mailto .= get_emails_for_sect($row["sect"]);
mail($mailto,"note $row[id] ".($action == "reject" ?
"rejected" : "deleted")." from $row[sect] by
$user",$row['note'],"From: $user@php.net\r\nIn-Reply-To:
<note-$id@php.net>");
if ($action == 'reject') {
$email = clean_antispam($row['user']);
@@ -121,8 +121,8 @@
if (isset($note) && $action == "edit") {
if (@mysql_query("UPDATE note SET
note='$note',user='$email',updated=NOW() WHERE id=$id")) {
$mailto = "php-notes@lists.php.net";
- // ** alerts **
- //$mailto .= get_emails_for_sect($row["sect"]);
+ // ** alerts **
+ //$mailto .= get_emails_for_sect($row["sect"]);
mail($mailto,"note $row[id] modified in $row[sect] by
$user",stripslashes($note)."\n\n--was--\n$row[note]\n\nhttp://www.php.net/manual/en/$row[sect].php","From:
$user@php.net\r\nIn-Reply-To: <note-$id@php.net>");
echo "<p>note $id edited.</p>";
}