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

- fixed bug in backend.inc
  (check http://www.drop.org/backend.php)
- update theme.inc to use widget.inc
- small enhancements to function.inc
parent e1130946
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
...@@ -110,7 +110,7 @@ function rdf2sql($timout = 10) { ...@@ -110,7 +110,7 @@ function rdf2sql($timout = 10) {
$number += 1; $number += 1;
### Insert item in database: ### Insert item in database:
$result = db_query("INSERT INTO headlines (id, title, link, number) VALUES('$this->id', '". stripslashes($title) ."', '". stripslashes($link) ."', '$number')"); $result = db_query("INSERT INTO headlines (id, title, link, number) VALUES('". check_input($this->id) ."', '". check_input($title) ."', '". check_input($link) ."', '". check_input($number) ."')");
} }
### Mark channels as being updated: ### Mark channels as being updated:
...@@ -195,7 +195,7 @@ function displayHeadlines($timout = 1800) { ...@@ -195,7 +195,7 @@ function displayHeadlines($timout = 1800) {
# #
function add() { function add() {
### Add channel: ### Add channel:
$result = db_query("INSERT INTO channel (site, file, url, contact, timestamp) VALUES ('$this->site', '$this->file', '$this->url', '$this->contact', 42)"); $result = db_query("INSERT INTO channel (site, file, url, contact, timestamp) VALUES ('". check_input($this->site) ."', '". check_input($this->file) ."', '". check_input($this->url) ."', '". check_input($this->contact) ."', 42)");
} }
......
...@@ -15,7 +15,6 @@ function load_theme() { ...@@ -15,7 +15,6 @@ function load_theme() {
else { else {
include $themes[key($themes)][0]; include $themes[key($themes)][0];
} }
return new Theme(); return new Theme();
} }
...@@ -41,13 +40,16 @@ function discussion_num_replies($id, $count = 0) { ...@@ -41,13 +40,16 @@ function discussion_num_replies($id, $count = 0) {
function discussion_num_filtered($sid, $pid) { function discussion_num_filtered($sid, $pid) {
global $user; global $user;
$threshold = ($user->id) ? $user->threshold : "0"; $threshold = ($user->id) ? $user->threshold : "0";
$pid = ($pid) ? $pid : 0;
$result = db_query("SELECT COUNT(cid) FROM comments WHERE sid = $sid AND pid = $pid AND (votes != 0 AND score / votes < $threshold)"); $result = db_query("SELECT COUNT(cid) FROM comments WHERE sid = $sid AND pid = $pid AND (votes != 0 AND score / votes < $threshold)");
return ($result) ? db_result($result, 0) : 0; return ($result) ? db_result($result, 0) : 0;
} }
function format_plural($count, $one, $more) { function format_plural($count, $singular, $plural) {
return ($count == 1) ? "$count $one" : "$count $more"; return ($count == 1) ? "$count $singular" : "$count $plural";
} }
function format_date($timestamp, $type = "medium") { function format_date($timestamp, $type = "medium") {
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
include "includes/database.inc"; include "includes/database.inc";
include "includes/watchdog.inc"; include "includes/watchdog.inc";
include "includes/function.inc"; include "includes/function.inc";
include "includes/template.inc"; include "includes/widget.inc";
include "includes/user.inc"; include "includes/user.inc";
global $user; global $user;
$theme = load_theme(); $theme = load_theme();
?> ?>
\ No newline at end of file
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