PHP-GTK 1 Manual Notes Administration\n\n"; echo "

If you just want to browse the manual notes, you're better off " . "here.

\n"; if ($action != '') { list ($action, $id) = explode(' ', $action); if ($action!='edit'&& !isset($MAGIC_COOKIE)) { echo "

Authorization failed.

"; commonFooter(); exit; } switch($action) { case 'delete': $query = 'SELECT *,UNIX_TIMESTAMP(ts) AS xwhen FROM note WHERE id='.$id; if ($result = mysql_query($query)) { $row = mysql_fetch_array($result); mail($mailto, "note ".$row['id']." deleted from ".$row['sect']." by $user", stripslashes($row['note']), "From: ".$user."@php.net"); $query = 'DELETE FROM note WHERE id=' . $id; if (mysql_query($query)) { echo '

Note deleted.

'; if ($popup) { echo ''; } } } break; case 'reject': $reject_text = "If you are receiving this email is because your note posted\n"; $reject_text .= "to the on-line PHP-GTK 1 manual has been removed by one of the editors.\n\n"; $reject_text .= "Read the following paragraphs carefully, because they contain\n"; $reject_text .= "pointers to resources better suited for requesting support or\n"; $reject_text .= "reporting bugs, none of which are to be included in manual notes\n"; $reject_text .= "because there are mechanisms and groups in place to deal with\n"; $reject_text .= "those issues.\n\n"; $reject_text .= "The user contributed notes are not an appropriate place to\n"; $reject_text .= "ask questions, report bugs or suggest new features; please\n"; $reject_text .= "use the resources listed in \n"; $reject_text .= "for those purposes. This was clearly stated in the page\n"; $reject_text .= "you used to submit your note, please carefully re-read\n"; $reject_text .= "those instructions before submitting future contributions.\n\n"; $reject_text .= "Bug Submissions should be entered at \n"; $reject_text .= "Feature Requests should also be entered at \n"; $reject_text .= "Support and ways to find answers to your guestions can be found\n"; $reject_text .= "at \n\n"; $reject_text .= "Your note has been removed from the on-line manual.\n\n"; $query = 'SELECT *,UNIX_TIMESTAMP(ts) AS xwhen FROM note WHERE id='.$id; if ($result = mysql_query($query)) { $row = mysql_fetch_array($result); // email the submitter if the address looks reasonable // uses functions in include/email-validation.inc $submitter = clean_AntiSPAM($row['user']); echo "

Note ".$row['id']." by: ".$row['user']." ($submitter) "; if (is_emailable_address($submitter)) { mail($submitter,"note ".$row['id']." rejected and deleted from ".$row['sect']." by notes editor $user",$reject_text."----- Copy of your note below -----\n\n".stripslashes($row['note']),"From: ".$user."@php.net"); } // email to the list mail($mailto, "note ".$row['id']." rejected and deleted from ".$row['sect']." by $user", stripslashes($row['note']), "From: ".$user."@php.net"); $query = 'DELETE FROM note WHERE id=' . $id; if (mysql_query($query)) { echo 'rejected and deleted.

'; } if ($popup) { echo ''; } } break; case 'edit': echo "

Only people with " . make_link('http://www.php.net/cvs-php.php', 'CVS accounts') . " are able to edit the manual notes, so please don't email us asking why this doesn't work for you.

"; $query = 'SELECT *,UNIX_TIMESTAMP(ts) AS xwhen FROM note WHERE id='.$id; if ($result = mysql_query($query)) { $row = mysql_fetch_array($result); echo '
'; echo ''; echo '' . ''; echo '' . ''; echo '' . ''; echo ''; echo '' . ''; echo '' . ''; echo '' . ''; echo ''; echo "
E-mail:

Note:

Reset rating:

Your CVS username:

Your CVS password:

Remember me:

\n"; commonFooter(); exit; } else { echo "

Unable to find note for editing.

\n"; } break; case 'modify': $query = 'SELECT *,UNIX_TIMESTAMP(ts) AS xwhen FROM note WHERE id='.$id; if ($result = mysql_query($query)) { $row = mysql_fetch_array($result); } $add_url = "\n\nhttp://gtk.php.net/manual1/en/".$row['sect']."\n"; $query = "UPDATE note SET user='$nuser', note='$note'"; $rating = (int)$rating; if ($rating==-1) { $query .= ", votes=0, rating=0"; } else if ($rating > 0) { $query .= ",votes=10, rating=(10*".$rating.")"; } $query .= " WHERE id=$id"; if (mysql_query($query)) { echo "

Record modified.

"; mail($mailto, "note ".$row['id']." modified in ".$row['sect']." by $user",stripslashes($note).$add_url,"From: ".$user."@php.net"); } else { echo "

Record not modified (query failed).

"; } break; default: if (!empty($action)) { echo "

Didn't understand action '$action'.

"; } } // end of switch } // end of if($action != "") $MAGIC_COOKIE = 'temp'; include 'browse.php'; commonFooter(); ?>