Commit 92326261 authored by Dries's avatar Dries

- Commited Marco's new comment module and forum module!!!
parent 7b155e52
......@@ -62,24 +62,6 @@ function node($node, $main) {
print $output;
}
function comment_controls($threshold = 1, $mode = 3, $order = 1) {
return form_item(t("Comment viewing options"), comment_mode($mode) . comment_order($order) . comment_threshold($threshold) ." <input type=\"submit\" name=\"op\" value=\"". t("Update settings") ."\" />", t("Select your prefered way to display the comments and click 'Update settings' to active your changes."));
}
function comment($comment, $link = 0) {
$output = "<a name=\"$comment->cid\"></a>";
$output .= "<div style=\"border: 1px solid; padding: 10px;\">";
$output .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
$output .= " <tr><td><div style=\"font-size: 110%; font-weight: bold;\">". check_output($comment->subject) ."</div></td><td align=\"right\" rowspan=\"2\" valign=\"top\">". comment_moderation($comment) ."</td></tr>";
$output .= " <tr><td><div style=\"margin-left: 10px; padding-bottom: 10px; font-size: 90%;\">". t("by %a on %b", array("%a" => format_name($comment), "%b" => format_date($comment->timestamp))) ."</div></td></tr>";
$output .= " <tr><td colspan=\"2\">". check_output($comment->comment, 1) ."</td></tr>";
$output .= " <tr><td align=\"right\" colspan=\"2\">$link</td></tr>";
$output .= "</table>";
$output .= "</div><br />";
print $output;
}
function box($subject, $content, $region = "main") {
$output = "<b>". check_output($subject) ."</b><br />". check_output($content) ."<p />";
print $output;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -50,7 +50,8 @@
"2002-08-10" => "update_35",
"2002-08-16" => "update_36",
"2002-08-19" => "update_37",
"2002-08-26" => "update_38"
"2002-08-26" => "update_38",
"2002-09-15" => "update_39"
);
// Update functions
......@@ -537,6 +538,49 @@ function update_38() {
update_sql("ALTER TABLE watchdog CHANGE message message text NOT NULL default '';");
}
function update_39() {
update_sql("DROP TABLE moderate");
update_sql("ALTER TABLE comments ADD score MEDIUMINT NOT NULL;");
update_sql("ALTER TABLE comments ADD status TINYINT UNSIGNED NOT NULL;");
update_sql("ALTER TABLE comments ADD users MEDIUMTEXT;");
update_sql("CREATE TABLE moderation_votes (
mid INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
vote VARCHAR(255),
weight TINYINT NOT NULL
);");
update_sql("CREATE TABLE moderation_roles (
rid INT UNSIGNED NOT NULL,
mid INT UNSIGNED NOT NULL,
value TINYINT NOT NULL
);");
update_sql("ALTER TABLE moderation_roles ADD INDEX (rid);");
update_sql("ALTER TABLE moderation_roles ADD INDEX (mid);");
update_sql("CREATE TABLE moderation_filters (
fid INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
filter VARCHAR(255) NOT NULL,
minimum SMALLINT NOT NULL
);");
update_sql("DELETE FROM moderation_votes;");
update_sql("INSERT INTO moderation_votes VALUES (1, '+1', 0);");
update_sql("INSERT INTO moderation_votes VALUES (2, '-1', 1);");
update_sql("DELETE FROM moderation_roles;");
update_sql("INSERT INTO moderation_roles VALUES (2, 1, 1);");
update_sql("INSERT INTO moderation_roles VALUES (2, 2, -1);");
update_sql("CREATE TABLE forum (
nid int unsigned not null primary key,
icon varchar(255) not null,
shadow int unsigned not null
);");
}
function update_upgrade3() {
update_sql("INSERT INTO system VALUES ('archive.module','archive','module','',1);");
update_sql("INSERT INTO system VALUES ('block.module','block','module','',1);");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment