Forked from
project / drupal
45793 commits behind the upstream repository.
-
Dries Buytaert authored
- updated/improved discussion engine: it needs additional fine-tuning though but I think this is stable enough for public consumption and real-life testing. ==> a first big step towards a flexible comment engine. IMPORTANT: - Required theme updatins: UnConeD: check your $theme->controls() as I added a very, very dummy implementation - Required database updates: alter table users modify mode tinyint(1) DEFAULT '' NOT NULL; alter table comments change sid lid int(6) DEFAULT '0' NOT NULL; alter table comments add link varchar(16) DEFAULT '' NOT NULL; update comments set link = 'story';
Dries Buytaert authored- updated/improved discussion engine: it needs additional fine-tuning though but I think this is stable enough for public consumption and real-life testing. ==> a first big step towards a flexible comment engine. IMPORTANT: - Required theme updatins: UnConeD: check your $theme->controls() as I added a very, very dummy implementation - Required database updates: alter table users modify mode tinyint(1) DEFAULT '' NOT NULL; alter table comments change sid lid int(6) DEFAULT '0' NOT NULL; alter table comments add link varchar(16) DEFAULT '' NOT NULL; update comments set link = 'story';
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
index.php 784 B
<?
include "includes/common.inc";
// Security check:
if (strstr($number, " ") || strstr($date, " ")) {
watchdog("error", "main page: attempt to provide malicious input through URI");
exit();
}
// Initialize/pre-process variables:
$number = ($user->stories) ? $user->stories : 10;
$date = ($date) ? $date : time();
// Perform query:
$result = db_query("SELECT stories.*, users.userid, COUNT(comments.lid) AS comments FROM stories LEFT JOIN comments ON stories.id = comments.lid LEFT JOIN users ON stories.author = users.id WHERE stories.status = 2 AND stories.timestamp <= $date GROUP BY stories.id ORDER BY stories.timestamp DESC LIMIT $number");
// Display stories:
$theme->header();
while ($story = db_fetch_object($result)) $theme->abstract($story);
$theme->footer();
?>