\n";
$block1 .= "\n";
- $result = db_query("SELECT c.cid, c.pid, c.sid, c.subject, c.timestamp, s.subject AS story FROM comments c LEFT JOIN users u ON u.id = c.author LEFT JOIN stories s ON s.id = c.sid WHERE u.userid = '$uname' AND s.status = 2 AND s.timestamp > ". (time() - 1209600) ." ORDER BY cid DESC LIMIT 10");
+ $result = db_query("SELECT c.cid, c.pid, c.lid, c.subject, c.timestamp, s.subject AS story FROM comments c LEFT JOIN users u ON u.id = c.author LEFT JOIN stories s ON s.id = c.lid WHERE u.userid = '$uname' AND s.status = 2 c.link = 'story' AND s.timestamp > ". (time() - 1209600) ." ORDER BY cid DESC LIMIT 10");
while ($comment = db_fetch_object($result)) {
$block2 .= "
This page might be helpful in case you want to keep track of your recent comments in any of the current discussions. You are presented an overview of your comments in each of the stories you participated in along with the number of replies each comment got.\n
\n";
- $sresult = db_query("SELECT s.id, s.subject, COUNT(s.id) as count FROM comments c LEFT JOIN stories s ON c.sid = s.id WHERE c.author = $user->id GROUP BY s.id DESC LIMIT 5");
+ $sresult = db_query("SELECT s.id, s.subject, COUNT(s.id) as count FROM comments c LEFT JOIN stories s ON c.lid = s.id WHERE c.author = $user->id GROUP BY s.id DESC LIMIT 5");
while ($story = db_fetch_object($sresult)) {
- $output .= "
\n";
- $cresult = db_query("SELECT * FROM comments WHERE author = $user->id AND sid = $story->id");
+ $cresult = db_query("SELECT * FROM comments WHERE author = $user->id AND lid = $story->id");
while ($comment = db_fetch_object($cresult)) {
- $output .= "
This page might be helpful in case you want to keep track of the stories you contributed. You are presented an overview of your stories along with the number of replies each story got.\n
\n";
- $result = db_query("SELECT s.id, s.subject, s.timestamp, s.category, COUNT(c.cid) as count FROM stories s LEFT JOIN comments c ON c.sid = s.id WHERE s.status = 2 AND s.author = $user->id GROUP BY s.id DESC");
+ $result = db_query("SELECT s.id, s.subject, s.timestamp, s.category, COUNT(c.cid) as count FROM stories s LEFT JOIN comments c ON c.lid = s.id WHERE s.status = 2 AND s.author = $user->id GROUP BY s.id DESC");
while ($story = db_fetch_object($result)) {
$output .= "
\n";
@@ -485,13 +477,13 @@ function account_track_stories() {
function account_track_site() {
global $theme, $user, $site_name;
- $result1 = db_query("SELECT c.cid, c.pid, c.sid, c.subject, u.userid, s.subject AS story FROM comments c LEFT JOIN users u ON u.id = c.author LEFT JOIN stories s ON s.id = c.sid WHERE s.status = 2 ORDER BY cid DESC LIMIT 10");
+ $result1 = db_query("SELECT c.cid, c.pid, c.lid, c.subject, u.userid, s.subject AS story FROM comments c LEFT JOIN users u ON u.id = c.author LEFT JOIN stories s ON s.id = c.lid WHERE s.status = 2 ORDER BY cid DESC LIMIT 10");
while ($comment = db_fetch_object($result1)) {
$block1 .= "
";
+}
+
+function comment_thread_max($cid, $mode, $threshold, $level = 0, $dummy = 0) {
+ global $link, $theme, $user;
+
+ $result = db_query("SELECT c.*, u.* FROM comments c LEFT JOIN users u ON c.author = u.id WHERE link = '$link' AND c.pid = $cid ORDER BY c.timestamp, c.cid");
+
+ print "
";
- }
-
- return $output;
-}
-
function theme_new_headlines($theme, $num = 10) {
global $user;
$content = "";
$result = db_query("SELECT id, subject FROM stories WHERE status = 2 ORDER BY id DESC LIMIT $num");
- while ($story = db_fetch_object($result)) $content .= "
\n";
}
return $output;
}
function account_comments($id) {
- $result = db_query("SELECT * FROM comments WHERE author = $id ORDER BY timestamp DESC");
+ $result = db_query("SELECT * FROM comments WHERE link = 'story' AND author = $id ORDER BY timestamp DESC");
while ($comment = db_fetch_object($result)) {
- $output .= "
Drupal is the English pronunciation for the Dutch word 'druppel' which stands for 'drop'. Drupal is a full-featured content management/discussion engine suitable to setup a news-driven community or portal site. Drupal aims towards easy installation, excessive configuration and fine-grained maintenance capabilities. Due to its modular design drupal is flexible and easy to adapt or extend.
-
Drupal is primarily written by Dries Buytaert (dries_at_drop.org) and build after Slash (http://slashcode.com/) and Scoop (http://scoop.kuro5hin.org/) and source code is available under terms of GNU General Public License (GPL).
Drupal is the English pronunciation for the Dutch word 'druppel' which stands for 'drop'. Drupal is a full-featured content management/discussion engine suitable to setup a news-driven community or portal site. Drupal aims towards easy installation, excessive configuration and fine-grained maintenance capabilities. Due to its modular design drupal is flexible and easy to adapt or extend.
\n";
+ $output .= "
Drupal is primarily written by Dries Buytaert (dries_at_drop.org) and build after Slash (http://slashcode.com/) and Scoop (http://scoop.kuro5hin.org/). The source code is available under terms of GNU General Public License (GPL).
\n";
+ $output .= "
We don't have a real demo site yet but drupal is used by (and created for) http://drop.org/. Create an account, play with it for a bit, read the documentation and spend some time getting used to it.
The drupal-support@drop.org list discusses drupal development. All submissions relevant to that, such as bug reports, enhancement ideas, patches or reports that a patch fixed a bug are appropriate.
\n";
+ $output .= "
To subscribe to the drupal-support@drop.org mailing list, send an e-mail to drupal-support-request@drop.org with no subject and put subscribe in the body of your message.
\n";
+ $output .= "
To unsubscribe from the drupal-support@drop.org mailing list, send an e-mail to drupal-support-request@drop.org and put unsubscribe in the body of your mail.\n";
+ $theme->box("Support and development", $output);
- $output .= "
-
Demo
-
We don't have a real demo site yet but drupal is used by (and created for) http://drop.org/. Create an account, play with it for a bit, read the documentation and spend some time getting used to it.
The drupal-support@drop.org list discusses drupal development. All submissions relevant to that, such as bug reports, enhancement ideas, patches or reports that a patch fixed a bug are appropriate.
-
To subscribe to the drupal-support@drop.org mailing list, send an e-mail to drupal-support-request@drop.org with no subject and put subscribe in the body of your message.
-
To unsubscribe from the drupal-support@drop.org mailing list, send an e-mail to drupal-support-request@drop.org and put unsubscribe in the body of your mail.
- ";
+ print "
Drupal is the English pronunciation for the Dutch word 'druppel' which stands for 'drop'. Drupal is a full-featured content management/discussion engine suitable to setup a news-driven community or portal site. Drupal aims towards easy installation, excessive configuration and fine-grained maintenance capabilities. Due to its modular design drupal is flexible and easy to adapt or extend.
-
Drupal is primarily written by Dries Buytaert (dries_at_drop.org) and build after Slash (http://slashcode.com/) and Scoop (http://scoop.kuro5hin.org/) and source code is available under terms of GNU General Public License (GPL).
Drupal is the English pronunciation for the Dutch word 'druppel' which stands for 'drop'. Drupal is a full-featured content management/discussion engine suitable to setup a news-driven community or portal site. Drupal aims towards easy installation, excessive configuration and fine-grained maintenance capabilities. Due to its modular design drupal is flexible and easy to adapt or extend.
\n";
+ $output .= "
Drupal is primarily written by Dries Buytaert (dries_at_drop.org) and build after Slash (http://slashcode.com/) and Scoop (http://scoop.kuro5hin.org/). The source code is available under terms of GNU General Public License (GPL).
\n";
+ $output .= "
We don't have a real demo site yet but drupal is used by (and created for) http://drop.org/. Create an account, play with it for a bit, read the documentation and spend some time getting used to it.
The drupal-support@drop.org list discusses drupal development. All submissions relevant to that, such as bug reports, enhancement ideas, patches or reports that a patch fixed a bug are appropriate.
\n";
+ $output .= "
To subscribe to the drupal-support@drop.org mailing list, send an e-mail to drupal-support-request@drop.org with no subject and put subscribe in the body of your message.
\n";
+ $output .= "
To unsubscribe from the drupal-support@drop.org mailing list, send an e-mail to drupal-support-request@drop.org and put unsubscribe in the body of your mail.\n";
+ $theme->box("Support and development", $output);
- $output .= "
-
Demo
-
We don't have a real demo site yet but drupal is used by (and created for) http://drop.org/. Create an account, play with it for a bit, read the documentation and spend some time getting used to it.
The drupal-support@drop.org list discusses drupal development. All submissions relevant to that, such as bug reports, enhancement ideas, patches or reports that a patch fixed a bug are appropriate.
-
To subscribe to the drupal-support@drop.org mailing list, send an e-mail to drupal-support-request@drop.org with no subject and put subscribe in the body of your message.
-
To unsubscribe from the drupal-support@drop.org mailing list, send an e-mail to drupal-support-request@drop.org and put unsubscribe in the body of your mail.
- ";
+ print "
Comments
\n";
- $theme->header();
- $theme->box("Drupal", $output);
- $theme->footer();
+ // Display 'comment control'-box:
+ if ($user->id) $theme->controls($threshold, $mode, $order);
+
+ // Display comments:
+ comment_render($id, $cid);
}
-?>
+function drupal_page() {
+ global $cid, $comment, $id, $op, $pid, $lid, $link, $mode, $order, $subject, $theme, $threshold;
+
+ switch($op) {
+ case "Preview comment":
+ $theme->header();
+ comment_preview($pid, $id, $subject, $comment);
+ $theme->footer();
+ break;
+ case "Post comment":
+ comment_post($pid, $id, $subject, $comment);
+ break;
+ case "reply":
+ $theme->header();
+ comment_reply($pid, $id);
+ $theme->footer();
+ break;
+ case "Update":
+ comment_settings($mode, $order, $threshold);
+ $theme->header();
+ drupal_render($id, $cid);
+ $theme->footer();
+ break;
+ case "Moderate comments":
+ comment_moderate($moderate);
+ $theme->header();
+ drupal_render($id, $cid);
+ $theme->footer();
+ break;
+ default:
+ $theme->header();
+ drupal_render(0, $cid);
+ $theme->footer();
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/modules/headline.module b/modules/headline.module
index 7629594d5202..3a42b3d764de 100644
--- a/modules/headline.module
+++ b/modules/headline.module
@@ -207,7 +207,7 @@ function headline_export($uri) {
while ($story = db_fetch_object($result)) {
print "\n";
print " $story->subject\n";
- print " ". $site_url ."discussion.php?id=$story->id\n";
+ print " ". $site_url ."story.php?id=$story->id\n";
print "\n";
}
diff --git a/modules/story.module b/modules/story.module
index 4eb1534d49d2..2e0ea5b2315c 100644
--- a/modules/story.module
+++ b/modules/story.module
@@ -22,9 +22,9 @@ function story_help() {
}
function story_block() {
- $result = db_query("SELECT s.id, COUNT(s.id) AS comments, s.subject FROM stories s LEFT JOIN comments c ON s.id = c.sid WHERE s.status = 2 GROUP BY s.id ORDER BY comments DESC LIMIT 10");
+ $result = db_query("SELECT s.id, COUNT(s.id) AS comments, s.subject FROM stories s LEFT JOIN comments c ON s.id = c.lid WHERE s.status = 2 AND c.link = 'link' GROUP BY s.id ORDER BY comments DESC LIMIT 10");
while ($story = db_fetch_object($result)) {
- $content .= "
\n";
}
$blocks[0]["subject"] = "Top 10: all stories";
@@ -33,9 +33,9 @@ function story_block() {
unset($content);
- $result = db_query("SELECT s.id, COUNT(s.id) AS comments, s.subject FROM stories s LEFT JOIN comments c ON s.id = c.sid WHERE s.status = 2 AND ". time() ." - s.timestamp < 2419200 GROUP BY s.id ORDER BY comments DESC LIMIT 10");
+ $result = db_query("SELECT s.id, COUNT(s.id) AS comments, s.subject FROM stories s LEFT JOIN comments c ON s.id = c.lid WHERE s.status = 2 AND c.link = 'story' AND ". time() ." - s.timestamp < 2419200 GROUP BY s.id ORDER BY comments DESC LIMIT 10");
while ($story = db_fetch_object($result)) {
- $content .= "
\n";
}
$blocks[1]["subject"] = "Top 10: recent stories";
@@ -175,28 +175,28 @@ function story_display() {
$result = db_query("SELECT s.*, u.userid FROM stories s LEFT JOIN users u ON u.id = s.author WHERE s.status = 1 ORDER BY timestamp DESC");
$output .= "
queued stories
\n";
while ($story = db_fetch_object($result)) {
- $output .= "
\n";
}
// Scheduled stories:
$result = db_query("SELECT s.*, u.userid FROM stories s LEFT JOIN users u ON u.id = s.author WHERE s.status = 3 ORDER BY timestamp");
$output .= "
scheduled stories
\n";
while ($story = db_fetch_object($result)) {
- $output .= "
\n";
}
// Dumped stories:
$result = db_query("SELECT s.*, u.userid FROM stories s LEFT JOIN users u ON u.id = s.author WHERE s.status = 0 ORDER BY timestamp DESC LIMIT 5");
$output .= "
dumped stories
\n";
while ($story = db_fetch_object($result)) {
- $output .= "
\n";
}
// Posted stories:
$result = db_query("SELECT s.*, u.userid FROM stories s LEFT JOIN users u ON u.id = s.author WHERE s.status = 2 ORDER BY timestamp DESC LIMIT 15");
$output .= "
posted stories
\n";
while ($story = db_fetch_object($result)) {
- $output .= "
\n";
}
$output .= "\n";
diff --git a/modules/story/story.module b/modules/story/story.module
index 4eb1534d49d2..2e0ea5b2315c 100644
--- a/modules/story/story.module
+++ b/modules/story/story.module
@@ -22,9 +22,9 @@ function story_help() {
}
function story_block() {
- $result = db_query("SELECT s.id, COUNT(s.id) AS comments, s.subject FROM stories s LEFT JOIN comments c ON s.id = c.sid WHERE s.status = 2 GROUP BY s.id ORDER BY comments DESC LIMIT 10");
+ $result = db_query("SELECT s.id, COUNT(s.id) AS comments, s.subject FROM stories s LEFT JOIN comments c ON s.id = c.lid WHERE s.status = 2 AND c.link = 'link' GROUP BY s.id ORDER BY comments DESC LIMIT 10");
while ($story = db_fetch_object($result)) {
- $content .= "
\n";
}
$blocks[0]["subject"] = "Top 10: all stories";
@@ -33,9 +33,9 @@ function story_block() {
unset($content);
- $result = db_query("SELECT s.id, COUNT(s.id) AS comments, s.subject FROM stories s LEFT JOIN comments c ON s.id = c.sid WHERE s.status = 2 AND ". time() ." - s.timestamp < 2419200 GROUP BY s.id ORDER BY comments DESC LIMIT 10");
+ $result = db_query("SELECT s.id, COUNT(s.id) AS comments, s.subject FROM stories s LEFT JOIN comments c ON s.id = c.lid WHERE s.status = 2 AND c.link = 'story' AND ". time() ." - s.timestamp < 2419200 GROUP BY s.id ORDER BY comments DESC LIMIT 10");
while ($story = db_fetch_object($result)) {
- $content .= "
\n";
}
$blocks[1]["subject"] = "Top 10: recent stories";
@@ -175,28 +175,28 @@ function story_display() {
$result = db_query("SELECT s.*, u.userid FROM stories s LEFT JOIN users u ON u.id = s.author WHERE s.status = 1 ORDER BY timestamp DESC");
$output .= "
queued stories
\n";
while ($story = db_fetch_object($result)) {
- $output .= "
\n";
}
// Scheduled stories:
$result = db_query("SELECT s.*, u.userid FROM stories s LEFT JOIN users u ON u.id = s.author WHERE s.status = 3 ORDER BY timestamp");
$output .= "
scheduled stories
\n";
while ($story = db_fetch_object($result)) {
- $output .= "
\n";
}
// Dumped stories:
$result = db_query("SELECT s.*, u.userid FROM stories s LEFT JOIN users u ON u.id = s.author WHERE s.status = 0 ORDER BY timestamp DESC LIMIT 5");
$output .= "
dumped stories
\n";
while ($story = db_fetch_object($result)) {
- $output .= "
\n";
}
// Posted stories:
$result = db_query("SELECT s.*, u.userid FROM stories s LEFT JOIN users u ON u.id = s.author WHERE s.status = 2 ORDER BY timestamp DESC LIMIT 15");
$output .= "
posted stories
\n";
while ($story = db_fetch_object($result)) {
- $output .= "
\n";
// Compose and perform query:
- $query = "SELECT s.id, s.subject, u.userid, s.timestamp, COUNT(c.cid) AS comments FROM stories s LEFT JOIN users u ON s.author = u.id LEFT JOIN comments c ON s.id = c.sid WHERE s.status = 2 ";
+ $query = "SELECT s.id, s.subject, u.userid, s.timestamp, COUNT(c.cid) AS comments FROM stories s LEFT JOIN users u ON s.author = u.id LEFT JOIN comments c ON s.id = c.lid WHERE s.status = 2 ";
$query .= ($author) ? "AND u.userid = '$author' " : "";
$query .= ($terms) ? "AND (s.subject LIKE '%$terms%' OR s.abstract LIKE '%$terms%' OR s.updates LIKE '%$terms%') " : "";
$query .= ($category) ? "AND s.category = '$category' GROUP BY s.id " : "GROUP BY s.id ";
@@ -51,7 +51,7 @@
while ($entry = db_fetch_object($result)) {
$num++;
- $output .= "
$num) id\">". check_output($entry->subject) ." (". format_plural($entry->comments, "comment", comments) .") by ". format_username($entry->userid) .", posted on ". format_date($entry->timestamp) .".
\n";
+ $output .= "
$num) id\">". check_output($entry->subject) ." (". format_plural($entry->comments, "comment", comments) .") by ". format_username($entry->userid) .", posted on ". format_date($entry->timestamp) .".
\n";
}
if ($num == 0) $output .= "
Your search did not match any articles in our database: