Skip to content
Snippets Groups Projects
Commit 75129c1f authored by Dries Buytaert's avatar Dries Buytaert
Browse files

Bugfixes:
  (1) fixed SQL bug in search.php.
  (2) fixed SQL bug in discussion.php.
  (3) fixed theme-bug in submit.php.
  (4) fixed theme-bug in discussion.php.
  (5) fixed Dries2-theme: it more or less works now though
      I still have to change the look/layout.

Important:
  (3) and (4) did fix the i-suddenly-seem-to-log-out behavior.
parent babf1a7d
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -136,7 +136,7 @@ function comments_reply($pid, $sid, $mode, $order, $thold) {
$theme->comment($item->userid, $item->subject, $item->comment, $item->timestamp, $item->url, $item->femail, $item->score, $item->cid, "reply to this comment");
}
else {
$item = db_fetch_object(db_query("SELECT stories.*, users.userid FROM stories LEFT JOIN users ON stories.author = users.id WHERE stories.status = 2 AND stories.id = $sid"));
$item = db_fetch_object(db_query("SELECT stories.*, users.userid FROM stories LEFT JOIN users ON stories.author = users.id WHERE stories.status != 0 AND stories.id = $sid"));
$theme->article($item, "");
}
......@@ -283,9 +283,9 @@ function comment_post($pid, $sid, $subject, $comment, $mode, $order, $thold) {
}
}
include "functions.inc";
include "config.inc";
include "theme.inc";
include "functions.inc";
if ($save) {
db_query("UPDATE users SET umode = '$mode', uorder = '$order', thold = '$thold' where id = '$user->id'");
......
......@@ -42,7 +42,7 @@
### Compose query:
$query = "SELECT DISTINCT s.id, s.subject, u.userid, s.timestamp FROM stories s LEFT JOIN users u ON s.author = u.id WHERE s.status = 2 ";
if ($terms != "") $query .= "AND (s.subject LIKE '%$terms%' OR s.abstract LIKE '%$terms%' OR s.comments LIKE '%$terms%') ";
if ($terms != "") $query .= "AND (s.subject LIKE '%$terms%' OR s.abstract LIKE '%$terms%' OR s.updates LIKE '%$terms%') ";
if ($category != "") $query .= "AND s.category = '$category' ";
if ($author != "") $query .= "AND u.userid = '$author' ";
if ($order == "Oldest first") $query .= " ORDER BY s.timestamp ASC";
......
<?PHP
function submit_enter() {
include "functions.inc";
include "theme.inc";
global $user, $theme;
global $user;
### Guidlines:
$output .= "<P>Got some news or some thoughts you would like to share? Fill out this form and they will automatically get whisked away to our submission queue where our moderators will frown at it, poke at it and hopefully post it. Every registered user is automatically a moderator and can vote whether or not your sumbission should be carried to the front page for discussion.</P>\n";
$output .= "<P>Note that we do not revamp or extend your submission so it is up to you to make sure your submission is well-written: if you don't care enough to be clear and complete, your submission is likely to be moderated down by our army of moderators. Try to be complete, aim for clarity, organize and structure your text, and try to carry out your statements with examples. It is also encouraged to extend your submission with arguments that flow from your unique intellectual capability and experience: offer some insight or explanation as to why you think your submission is interesting. Make sure your submission has some meat on it!</P>\n";
......@@ -59,10 +56,7 @@ function submit_enter() {
}
function submit_preview($subject, $abstract, $story, $category) {
global $user;
include "functions.inc";
include "theme.inc";
global $user, $theme;
$output .= "<FORM ACTION=\"submit.php\" METHOD=\"post\">\n";
......@@ -131,10 +125,7 @@ function submit_preview($subject, $abstract, $story, $category) {
}
function submit_submit($subject, $abstract, $article, $category) {
global $user;
include "functions.inc";
include "theme.inc";
global $user, $theme;
### Add submission to SQL table:
db_query("INSERT INTO stories (author, subject, abstract, article, category, timestamp) VALUES ('$user->id', '". addslashes($subject) ."', '". addslashes($abstract) ."', '". addslashes($article) ."', '". addslashes($category) ."', '". time() ."')");
......@@ -151,6 +142,9 @@ function submit_submit($subject, $abstract, $article, $category) {
}
}
include "functions.inc";
include "theme.inc";
switch($op) {
case "Preview submission":
submit_preview($subject, $abstract, $story, $category);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment