Yet another large batch of updates:
- I rearranged some of the code and clean-up some of the mess. - Added "blocks" which can be user defined/controlled: check to see. The positioning of blocks is rather basic for the moment, so I'm all open for input on that.3-00
parent
8d5b4e7b86
commit
524773f6da
108
account.php
108
account.php
|
@ -1,24 +1,12 @@
|
|||
<?
|
||||
|
||||
include "includes/theme.inc";
|
||||
include "includes/common.inc";
|
||||
|
||||
function account_get_user($uname) {
|
||||
$result = db_query("SELECT * FROM users WHERE userid = '$uname'");
|
||||
return db_fetch_object($result);
|
||||
}
|
||||
|
||||
function account_login() {
|
||||
$output .= "<FORM ACTION=\"account.php\" METHOD=\"post\">\n";
|
||||
$output .= " <TABLE BORDER=\"0\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
|
||||
$output .= " <TR><TH ALIGN=\"right\">Username:</TH><TD><INPUT NAME=\"userid\"></TD></TR>\n";
|
||||
$output .= " <TR><TH ALIGN=\"right\">Password:</TH><TD><INPUT NAME=\"passwd\" TYPE=\"password\"></TD></TR>\n";
|
||||
$output .= " <TR><TD ALIGN=\"right\" COLSPAN=\"2\"><INPUT NAME=\"op\" TYPE=\"submit\" VALUE=\"Login\"></TD></TR>\n";
|
||||
$output .= " </TABLE>\n";
|
||||
$output .= "</FORM>\n";
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
function account_email() {
|
||||
$output .= "<P>Lost your password? Fill out your username and e-mail address, and your password will be mailed to you.</P>\n";
|
||||
$output .= "<FORM ACTION=\"account.php\" METHOD=\"post\">\n";
|
||||
|
@ -36,7 +24,7 @@ function account_create($user = "", $error = "") {
|
|||
global $theme;
|
||||
|
||||
if ($error) $output .= "<B><FONT COLOR=\"red\">Failed to register.</FONT>$error</B>\n";
|
||||
else $output .= "<P>Registering allows you to comment on stories, to moderate comments and pending stories, to maintain an online diary, to customize the look and feel of the site and generally helps you interact with the site more efficiently.</P><P>To create an account, simply fill out this form an click the `Create account' button below. An e-mail will then be sent to you with instructions on how to validate your account.</P>\n";
|
||||
else $output .= "<P>Registering allows you to comment on stories, to moderate comments and pending stories, to customize the look and feel of the site and generally helps you interact with the site more efficiently.</P><P>To create an account, simply fill out this form an click the `Create account' button below. An e-mail will then be sent to you with instructions on how to validate your account.</P>\n";
|
||||
|
||||
$output .= "<FORM ACTION=\"account.php\" METHOD=\"post\">\n";
|
||||
$output .= "<P>\n";
|
||||
|
@ -119,15 +107,15 @@ function account_user_edit() {
|
|||
}
|
||||
else {
|
||||
$theme->header();
|
||||
$theme->box("Login", account_login());
|
||||
$theme->box("Create user account", account_create());
|
||||
$theme->box("E-mail password", account_email());
|
||||
$theme->box("Create new account", account_create());
|
||||
$theme->footer();
|
||||
}
|
||||
}
|
||||
|
||||
function account_user_save($edit) {
|
||||
global $user;
|
||||
|
||||
if ($user->id) {
|
||||
$data[name] = $edit[name];
|
||||
$data[fake_email] = $edit[fake_email];
|
||||
|
@ -141,7 +129,7 @@ function account_user_save($edit) {
|
|||
}
|
||||
}
|
||||
|
||||
function account_page_edit() {
|
||||
function account_site_edit() {
|
||||
global $theme, $themes, $user;
|
||||
|
||||
if ($user->id) {
|
||||
|
@ -164,7 +152,12 @@ function account_page_edit() {
|
|||
$output .= "<SELECT NAME=\"edit[timezone]\">\n$options2</SELECT><BR>\n";
|
||||
$output .= "<I>Select what time you currently have and your timezone settings will be set appropriate.</I><P>\n";
|
||||
$output .= "<B>Maximum number of stories:</B><BR>\n";
|
||||
$output .= "<INPUT NAME=\"edit[stories]\" MAXLENGTH=\"3\" SIZE=\"3\" VALUE=\"$user->stories\"><P>\n";
|
||||
|
||||
for ($stories = 10; $stories <= 30; $stories += 5) {
|
||||
$options3 .= "<OPTION VALUE=\"$stories\"". (($user->stories == $stories) ? " SELECTED" : "") .">$stories</OPTION>\n";
|
||||
}
|
||||
|
||||
$output .= "<SELECT NAME=\"edit[stories]\">\n$options3</SELECT><BR>\n";
|
||||
$output .= "<I>The maximum number of stories that will be displayed on the main page.</I><P>\n";
|
||||
$options = "<OPTION VALUE=\"nested\"". ($user->mode == "nested" ? " SELECTED" : "") .">Nested</OPTION>";
|
||||
$options .= "<OPTION VALUE=\"flat\"". ($user->mode == "flat" ? " SELECTED" : "") .">Flat</OPTION>";
|
||||
|
@ -186,7 +179,9 @@ function account_page_edit() {
|
|||
$output .= "<B>Comment threshold:</B><BR>\n";
|
||||
$output .= "<SELECT NAME=\"edit[threshold]\">$options</SELECT><BR>\n";
|
||||
$output .= "<I>Comments that scored less than this setting will be ignored. Anonymous comments start at 0, comments of people logged on start at 1 and moderators can add and subtract points.</I><P>\n";
|
||||
$output .= "<INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"Save page settings\"><BR>\n";
|
||||
|
||||
|
||||
$output .= "<INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"Save site settings\"><BR>\n";
|
||||
$output .= "</FORM>\n";
|
||||
|
||||
$theme->header();
|
||||
|
@ -195,15 +190,15 @@ function account_page_edit() {
|
|||
}
|
||||
else {
|
||||
$theme->header();
|
||||
$theme->box("Login", account_login());
|
||||
$theme->box("Create user account", account_create());
|
||||
$theme->box("E-mail password", account_email());
|
||||
$theme->box("E-mail password", account_create());
|
||||
$theme->footer();
|
||||
}
|
||||
}
|
||||
|
||||
function account_page_save($edit) {
|
||||
function account_site_save($edit) {
|
||||
global $user;
|
||||
|
||||
if ($user->id) {
|
||||
$data[theme] = $edit[theme];
|
||||
$data[timezone] = $edit[timezone];
|
||||
|
@ -215,6 +210,53 @@ function account_page_save($edit) {
|
|||
}
|
||||
}
|
||||
|
||||
function account_block_edit() {
|
||||
global $theme, $user;
|
||||
|
||||
if ($user->id) {
|
||||
$output .= "<FORM ACTION=\"account.php\" METHOD=\"post\">\n";
|
||||
|
||||
$output .= "<B>Blocks:</B><BR>\n";
|
||||
|
||||
$result = db_query("SELECT * FROM blocks WHERE status = 1");
|
||||
while ($block = db_fetch_object($result)) {
|
||||
$entry = db_fetch_object(db_query("SELECT * FROM layout WHERE block = '$block->name' AND user = '$user->id'"));
|
||||
|
||||
$options = "";
|
||||
for ($weight = 0; $weight < 10; $weight++) {
|
||||
$options .= "<OPTION VALUE=\"$weight\"". (($entry->weight == $weight) ? " SELECTED" : "") .">". (($weight == 0) ? "off" : $weight) ."</OPTION>\n";
|
||||
}
|
||||
|
||||
$output .= "<SELECT NAME=\"edit[$block->name]\">\n$options</SELECT>";
|
||||
$output .= "$block->name<BR>";
|
||||
}
|
||||
|
||||
$output .= "<I>You can more or less position your blocks by assigning them weights. The heavy blocks sink down whereas the light blocks will be positioned on top.</I><P>\n";
|
||||
$output .= "<INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"Save block settings\"><BR>\n";
|
||||
$output .= "</FORM>\n";
|
||||
|
||||
$theme->header();
|
||||
$theme->box("Edit your blocks", $output);
|
||||
$theme->footer();
|
||||
}
|
||||
else {
|
||||
$theme->header();
|
||||
$theme->box("Create user account", account_create());
|
||||
$theme->box("E-mail password", account_email());
|
||||
$theme->footer();
|
||||
}
|
||||
}
|
||||
|
||||
function account_block_save($edit) {
|
||||
global $user;
|
||||
if ($user->id) {
|
||||
db_query("DELETE FROM layout WHERE user = $user->id");
|
||||
foreach ($edit as $block=>$weight) {
|
||||
db_query("INSERT INTO layout (user, block, weight) VALUES ('". check_input($user->id) ."', '". check_input($block) ."', '". check_input($weight) ."')");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function account_user($uname) {
|
||||
global $user, $theme;
|
||||
|
||||
|
@ -268,9 +310,8 @@ function account_user($uname) {
|
|||
else {
|
||||
### Display login form:
|
||||
$theme->header();
|
||||
$theme->box("Login", account_login());
|
||||
$theme->box("Create user account", account_create());
|
||||
$theme->box("E-mail password", account_email());
|
||||
$theme->box("Create new account", account_create());
|
||||
$theme->footer();
|
||||
}
|
||||
}
|
||||
|
@ -333,7 +374,7 @@ function account_create_submit($userid, $email) {
|
|||
|
||||
if ($rval = account_validate($new)) {
|
||||
$theme->header();
|
||||
$theme->box("Create new account", account_create($new, $rval));
|
||||
$theme->box("Create user account", account_create($new, $rval));
|
||||
$theme->footer();
|
||||
}
|
||||
else {
|
||||
|
@ -351,7 +392,7 @@ function account_create_submit($userid, $email) {
|
|||
mail($new[real_email], "Account details for $site_name", $message, "From: noreply");
|
||||
|
||||
$theme->header();
|
||||
$theme->box("Create new account", "Congratulations! Your member account has been sucessfully created and further instructions on how to activate your account have been sent to your e-mail address.");
|
||||
$theme->box("Create user account", "Congratulations! Your member account has been sucessfully created and further instructions on how to activate your account have been sent to your e-mail address.");
|
||||
$theme->footer();
|
||||
}
|
||||
}
|
||||
|
@ -514,10 +555,14 @@ switch ($op) {
|
|||
account_user_save($edit);
|
||||
account_user($user->userid);
|
||||
break;
|
||||
case "Save page settings":
|
||||
account_page_save($edit);
|
||||
case "Save site settings":
|
||||
account_site_save($edit);
|
||||
header("Location: account.php?op=info");
|
||||
break;
|
||||
case "Save block settings":
|
||||
account_block_save($edit);
|
||||
account_user($user->userid);
|
||||
break;
|
||||
case "logout":
|
||||
account_session_close();
|
||||
header("Location: account.php?op=info");
|
||||
|
@ -551,8 +596,11 @@ switch ($op) {
|
|||
case "user":
|
||||
account_user_edit();
|
||||
break;
|
||||
case "page":
|
||||
account_page_edit();
|
||||
case "site":
|
||||
account_site_edit();
|
||||
break;
|
||||
case "block":
|
||||
account_block_edit();
|
||||
break;
|
||||
default:
|
||||
header("Location: module.php?mod=diary&op=add&name=$user->userid");
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
// validate user permission:
|
||||
if (!$user->id || ($user->permissions != 1 && $user->id > 1)) exit();
|
||||
|
||||
include_once "includes/theme.inc";
|
||||
include_once "includes/cron.inc";
|
||||
include "includes/common.inc";
|
||||
|
||||
function admin_page($mod) {
|
||||
global $repository, $menu, $modules;
|
||||
|
|
2
cron.php
2
cron.php
|
@ -1,6 +1,6 @@
|
|||
<?
|
||||
|
||||
include "includes/theme.inc";
|
||||
include "includes/common.inc";
|
||||
|
||||
function cron_run($cron) {
|
||||
global $repository;
|
||||
|
|
|
@ -272,7 +272,7 @@ function comment_post($pid, $sid, $subject, $comment) {
|
|||
}
|
||||
}
|
||||
|
||||
include "includes/theme.inc";
|
||||
include "includes/common.inc";
|
||||
include "includes/comment.inc";
|
||||
|
||||
### Security check:
|
||||
|
@ -313,4 +313,4 @@ switch($op) {
|
|||
$theme->footer();
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
|
@ -39,7 +39,7 @@ function error_httpd() {
|
|||
print "</PRE>\n";
|
||||
}
|
||||
|
||||
include "includes/theme.inc";
|
||||
include "includes/common.inc";
|
||||
|
||||
switch ($op) {
|
||||
case "flood":
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
<?
|
||||
|
||||
include_once "includes/". getenv("HTTP_HOST") .".conf";
|
||||
include_once "includes/database.inc";
|
||||
include_once "includes/watchdog.inc";
|
||||
include_once "includes/function.inc";
|
||||
include_once "includes/droplet.inc";
|
||||
include_once "includes/module.inc";
|
||||
include_once "includes/theme.inc";
|
||||
include_once "includes/user.inc";
|
||||
|
||||
global $user;
|
||||
|
||||
$theme = load_theme();
|
||||
|
||||
?>
|
|
@ -1,16 +1,154 @@
|
|||
<?
|
||||
|
||||
include_once "includes/". getenv("HTTP_HOST") .".conf";
|
||||
include_once "includes/database.inc";
|
||||
include_once "includes/watchdog.inc";
|
||||
include_once "includes/function.inc";
|
||||
include_once "includes/droplet.inc";
|
||||
include_once "includes/module.inc";
|
||||
include_once "includes/widget.inc";
|
||||
include_once "includes/user.inc";
|
||||
function theme_account($theme) {
|
||||
global $user, $site_name;
|
||||
|
||||
if ($user->id) {
|
||||
|
||||
global $user;
|
||||
function submission_number() {
|
||||
$result = db_query("SELECT COUNT(id) FROM stories WHERE status = 1");
|
||||
return ($result) ? db_result($result, 0) : 0;
|
||||
}
|
||||
|
||||
$theme = load_theme();
|
||||
### Display account settings:
|
||||
$content .= "<LI><A HREF=\"account.php?op=track&topic=comments\">track your comments</A></LI>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=track&topic=stories\">track your stories</A></LI>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=track&topic=site\">track $site_name</A></LI>\n";
|
||||
$content .= "<P>\n";
|
||||
$content .= "<LI><A HREF=\"submission.php\">submission queue</A> (<FONT COLOR=\"red\">". submission_number() ."</FONT>)</LI>\n";
|
||||
$content .= "<P>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=edit&topic=diary\">edit your diary</A></LI>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=edit&topic=user\">edit your information</A></LI>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=edit&topic=site\">edit your settings</A></LI>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=edit&topic=block\">edit your blocks</A></LI>\n";
|
||||
$content .= "<P>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=view&topic=diary\">view your diary</A></LI>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=view&topic=info\">view your information</A></LI>\n";
|
||||
$content .= "<P>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=logout\">logout</A></LI>\n";
|
||||
|
||||
$theme->box("$user->userid's configuration", "$content");
|
||||
}
|
||||
else {
|
||||
$output .= "<CENTER>\n";
|
||||
$output .= " <FORM ACTION=\"account.php?op=Login\" METHOD=\"post\">\n";
|
||||
$output .= " <P><B>Username:</B><BR><INPUT NAME=\"userid\" SIZE=\"15\"></P>\n";
|
||||
$output .= " <P><B>Password:</B><BR><INPUT NAME=\"passwd\" SIZE=\"15\" TYPE=\"password\"></P>\n";
|
||||
$output .= " <P><INPUT NAME=\"op\" TYPE=\"submit\" VALUE=\"Login\"></P>\n";
|
||||
$output .= " <P><A HREF=\"account.php\">REGISTER</A></P>\n";
|
||||
$output .= " </FORM>\n";
|
||||
$output .= "</CENTER>\n";
|
||||
|
||||
$theme->box("Login", $output);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function theme_main_blocks($theme) {
|
||||
global $PHP_SELF, $user, $id;
|
||||
|
||||
switch (strtok($PHP_SELF, ".")) {
|
||||
case "/discussion":
|
||||
if ($user->id) $story = db_fetch_object(db_query("SELECT * FROM stories WHERE id = '$id'"));
|
||||
if ($story->status == 1) theme_moderation_results($theme, $story);
|
||||
else theme_new_headlines($theme);
|
||||
break;
|
||||
default:
|
||||
theme_account($theme);
|
||||
}
|
||||
}
|
||||
|
||||
function theme_user_blocks($theme) {
|
||||
global $PHP_SELF, $repository, $user;
|
||||
if ($user->id && strstr($PHP_SELF, "index.php")) {
|
||||
$result = db_query("SELECT * FROM layout l LEFT JOIN blocks b ON l.block = b.name WHERE l.user = '$user->id' AND l.weight > 0 AND b.status = '1' ORDER BY weight DESC");
|
||||
while ($block = db_fetch_object($result)) {
|
||||
$blocks = module_execute($block->module, "block");
|
||||
$theme->box($blocks[$block->offset]["subject"], $blocks[$block->offset]["content"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function theme_morelink($theme, $story) {
|
||||
return ($story->article) ? "[ <A HREF=\"discussion.php?id=$story->id\"><FONT COLOR=\"$theme->hlcolor2\"><B>read more</B></FONT></A> | ". strlen($story->article) ." bytes | <A HREF=\"discussion.php?id=$story->id\"><FONT COLOR=\"$theme->hlcolor2\">". format_plural($story->comments, "comment", "comments") ."</FONT></A> ]" : "[ <A HREF=\"discussion.php?id=$story->id\"><FONT COLOR=\"$theme->hlcolor2\">". format_plural($story->comments, "comment", "comments") ."</FONT></A> ]";
|
||||
}
|
||||
|
||||
function theme_moderation_results($theme, $story) {
|
||||
global $user;
|
||||
|
||||
if ($user->id && $story->id && $vote = user_getHistory($user->history, "s$story->id")) {
|
||||
$output .= "<P><B>You voted `$vote'.</B></P>\n";
|
||||
$output .= "<P>\n";
|
||||
$output .= "<B>Other people voted:</B><BR>\n";
|
||||
|
||||
$result = db_query("SELECT * FROM users WHERE id != $user->id AND history LIKE '%s$story->id%'");
|
||||
while ($account = db_fetch_object($result)) {
|
||||
$output .= "". format_username($account->userid) ." voted `". user_getHistory($account->history, "s$story->id") ."'.<BR>";
|
||||
}
|
||||
|
||||
$theme->box("Moderation results", $output);
|
||||
}
|
||||
}
|
||||
|
||||
function theme_related_links($theme, $story) {
|
||||
### Parse story for <A HREF="">-tags:
|
||||
$text = stripslashes("$story->abstract $story->updates $story->article");
|
||||
while ($text = stristr($text, "<A HREF=")) {
|
||||
$link = substr($text, 0, strpos(strtolower($text), "</a>") + 4);
|
||||
$text = stristr($text, "</A>");
|
||||
if (!stristr($link, "mailto:")) $content .= "<LI>$link</LI>";
|
||||
}
|
||||
|
||||
### Stories in the same category:
|
||||
$content .= " <LI>More about <A HREF=\"search.php?category=". urlencode($story->category) ."\">$story->category</A>.</LI>";
|
||||
|
||||
### Stories from the same author:
|
||||
if ($story->userid) $content .= " <LI>Also by <A HREF=\"search.php?author=". urlencode($story->userid) ."\">$story->userid</A>.</LI>";
|
||||
|
||||
$theme->box("Related links", $content);
|
||||
}
|
||||
|
||||
function theme_old_headlines($theme, $num = 10) {
|
||||
global $user;
|
||||
|
||||
if ($user->stories) $result = db_query("SELECT id, subject, timestamp FROM stories WHERE status = 2 ORDER BY timestamp DESC LIMIT $user->stories, $num");
|
||||
else $result = db_query("SELECT id, subject, timestamp FROM stories WHERE status = 2 ORDER BY timestamp DESC LIMIT $num, $num");
|
||||
|
||||
while ($story = db_fetch_object($result)) {
|
||||
if ($time != date("F jS", $story->timestamp)) {
|
||||
$content .= "<P><B>". date("l, M jS", $story->timestamp) ."</B></P>\n";
|
||||
$time = date("F jS", $story->timestamp);
|
||||
}
|
||||
$content .= "<LI><A HREF=\"discussion.php?id=$story->id\">$story->subject</A></LI>\n";
|
||||
}
|
||||
$content .= "<P ALIGN=\"right\">[ <A HREF=\"search.php\"><FONT COLOR=\"$theme->hlcolor2\">more</FONT></A> ]</P>";
|
||||
|
||||
$theme->box("Older headlines", $content);
|
||||
}
|
||||
|
||||
function theme_comment_moderation($id, $author, $score, $votes) {
|
||||
global $user, $comment_votes;
|
||||
|
||||
if ($user->id && $user->userid != $author && !user_getHistory($user->history, "c$id")) {
|
||||
$output .= "<SELECT NAME=\"moderate[$id]\">\n";
|
||||
foreach ($comment_votes as $key=>$value) $output .= " <OPTION VALUE=\"$value\">$key</OPTION>\n";
|
||||
$output .= "</SELECT>\n";
|
||||
}
|
||||
else {
|
||||
$output .= "<TABLE BORDER=\"0\" CELLSPACING=\"1\" CELLPADDING=\"0\"><TR><TD>score:</TD><TD>". format_data($score) ."</TD></TR><TR><TD>votes:</TD><TD>". format_data($votes) ."</TR></TABLE>";
|
||||
}
|
||||
|
||||
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 .= "<LI><A HREF=\"discussion.php?id=$story->id\">$story->subject</A></LI>\n";
|
||||
$content .= "<P ALIGN=\"right\">[ <A HREF=\"search.php\"><FONT COLOR=\"$theme->hlcolor2\">more</FONT></A> ]</P>";
|
||||
$theme->box("Latest headlines", $content);
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,19 +1,72 @@
|
|||
<?
|
||||
|
||||
function display_module_blocks() {
|
||||
global $repository, $theme;
|
||||
function display_account($theme) {
|
||||
global $user, $site_name;
|
||||
|
||||
if ($user->id) {
|
||||
|
||||
function display_block($name, $module) {
|
||||
global $theme;
|
||||
|
||||
if ($blocks = module_execute($name, "block")) {
|
||||
foreach ($blocks as $id=>$block) {
|
||||
$theme->box($block["subject"], $block["content"]);
|
||||
}
|
||||
function submission_number() {
|
||||
$result = db_query("SELECT COUNT(id) FROM stories WHERE status = 1");
|
||||
return ($result) ? db_result($result, 0) : 0;
|
||||
}
|
||||
|
||||
### Display account settings:
|
||||
$content .= "<LI><A HREF=\"account.php?op=track&topic=comments\">track your comments</A></LI>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=track&topic=stories\">track your stories</A></LI>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=track&topic=site\">track $site_name</A></LI>\n";
|
||||
$content .= "<P>\n";
|
||||
$content .= "<LI><A HREF=\"submission.php\">submission queue</A> (<FONT COLOR=\"red\">". submission_number() ."</FONT>)</LI>\n";
|
||||
$content .= "<P>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=edit&topic=diary\">edit your diary</A></LI>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=edit&topic=user\">edit your information</A></LI>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=edit&topic=site\">edit your settings</A></LI>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=edit&topic=block\">edit your blocks</A></LI>\n";
|
||||
$content .= "<P>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=view&topic=diary\">view your diary</A></LI>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=view&topic=info\">view your information</A></LI>\n";
|
||||
$content .= "<P>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=logout\">logout</A></LI>\n";
|
||||
|
||||
$theme->box("$user->userid's configuration", "$content");
|
||||
}
|
||||
else {
|
||||
$output .= "<CENTER>\n";
|
||||
$output .= " <FORM ACTION=\"account.php?op=Login\" METHOD=\"post\">\n";
|
||||
$output .= " <P><B>Username:</B><BR><INPUT NAME=\"userid\" SIZE=\"15\"></P>\n";
|
||||
$output .= " <P><B>Password:</B><BR><INPUT NAME=\"passwd\" SIZE=\"15\" TYPE=\"password\"></P>\n";
|
||||
$output .= " <P><INPUT NAME=\"op\" TYPE=\"submit\" VALUE=\"Login\"></P>\n";
|
||||
$output .= " <P><A HREF=\"account.php\">REGISTER</A></P>\n";
|
||||
$output .= " </FORM>\n";
|
||||
$output .= "</CENTER>\n";
|
||||
|
||||
$theme->box("Login", $output);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function display_main_blocks($theme) {
|
||||
global $PHP_SELF, $user, $id;
|
||||
|
||||
switch (strtok($PHP_SELF, ".")) {
|
||||
case "/discussion":
|
||||
if ($user->id) $story = db_fetch_object(db_query("SELECT * FROM stories WHERE id = '$id'"));
|
||||
if ($story->status == 1) display_moderation_results($theme, $story);
|
||||
else display_new_headlines($theme);
|
||||
break;
|
||||
default:
|
||||
display_account($theme);
|
||||
}
|
||||
}
|
||||
|
||||
function display_user_blocks($theme) {
|
||||
global $repository, $user;
|
||||
if ($user->id) {
|
||||
$result = db_query("SELECT * FROM layout l LEFT JOIN blocks b ON l.block = b.name WHERE l.user = '$user->id' AND l.weight > 0 AND b.status = '1' ORDER BY weight DESC");
|
||||
while ($block = db_fetch_object($result)) {
|
||||
$blocks = module_execute($block->module, "block");
|
||||
$theme->box($blocks[$block->offset]["subject"], $blocks[$block->offset]["content"]);
|
||||
}
|
||||
}
|
||||
|
||||
module_iterate("display_block");
|
||||
}
|
||||
|
||||
function display_morelink($theme, $story) {
|
||||
|
@ -98,34 +151,4 @@ function display_new_headlines($theme, $num = 10) {
|
|||
$theme->box("Latest headlines", $content);
|
||||
}
|
||||
|
||||
function display_account($theme) {
|
||||
global $user, $site_name;
|
||||
|
||||
if ($user->id) {
|
||||
|
||||
function submission_number() {
|
||||
$result = db_query("SELECT COUNT(id) FROM stories WHERE status = 1");
|
||||
return ($result) ? db_result($result, 0) : 0;
|
||||
}
|
||||
|
||||
### Display account settings:
|
||||
$content .= "<LI><A HREF=\"account.php?op=track&topic=comments\">track your comments</A></LI>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=track&topic=stories\">track your stories</A></LI>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=track&topic=site\">track $site_name</A></LI>\n";
|
||||
$content .= "<P>\n";
|
||||
$content .= "<LI><A HREF=\"submission.php\">submission queue</A> (<FONT COLOR=\"red\">". submission_number() ."</FONT>)</LI>\n";
|
||||
$content .= "<P>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=edit&topic=diary\">edit your diary</A></LI>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=edit&topic=user\">edit your information</A></LI>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=edit&topic=site\">edit your settings</A></LI>\n";
|
||||
$content .= "<P>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=view&topic=diary\">view your diary</A></LI>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=view&topic=info\">view your information</A></LI>\n";
|
||||
$content .= "<P>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=logout\">logout</A></LI>\n";
|
||||
|
||||
$theme->box("$user->userid's account", "$content", "NOWRAP");
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?
|
||||
|
||||
include "includes/theme.inc";
|
||||
include "includes/common.inc";
|
||||
|
||||
### Security check:
|
||||
if (strstr($number, " ") || strstr($date, " ")) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?
|
||||
|
||||
include_once "includes/theme.inc";
|
||||
include_once "includes/common.inc";
|
||||
module_execute($mod, "page");
|
||||
|
||||
?>
|
||||
|
|
|
@ -5,7 +5,7 @@ $module = array("page" => "backend_page",
|
|||
"block" => "backend_block",
|
||||
"admin" => "backend_admin");
|
||||
|
||||
include "includes/theme.inc";
|
||||
include "includes/common.inc";
|
||||
include "modules/backend.class";
|
||||
|
||||
function backend_page() {
|
||||
|
|
|
@ -4,8 +4,7 @@ $module = array("page" => "diary_page",
|
|||
"block" => "diary_block",
|
||||
"admin" => "diary_admin");
|
||||
|
||||
|
||||
include "includes/theme.inc";
|
||||
include "includes/common.inc";
|
||||
|
||||
function diary_page_overview($num = 20) {
|
||||
global $theme, $user;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
$module = array("page" => "faq_page");
|
||||
|
||||
include "includes/theme.inc";
|
||||
include "includes/common.inc";
|
||||
|
||||
function faq_page() {
|
||||
global $theme;
|
||||
|
|
|
@ -4,7 +4,6 @@ $module = array("page" => "wishlist_page");
|
|||
|
||||
function wishlist_page() {
|
||||
?>
|
||||
|
||||
<H1>Whislist</H1>
|
||||
<SMALL><I>$Id$</I></SMALL>
|
||||
|
||||
|
@ -74,5 +73,4 @@ function wishlist_page() {
|
|||
<?
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
?>
|
|
@ -1,5 +1,5 @@
|
|||
<?
|
||||
include "includes/theme.inc";
|
||||
include "includes/common.inc";
|
||||
|
||||
$theme->header();
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?
|
||||
|
||||
include "includes/submission.inc";
|
||||
include "includes/theme.inc";
|
||||
include "includes/common.inc";
|
||||
|
||||
function submission_displayMain() {
|
||||
global $PHP_SELF, $theme, $user;
|
||||
|
|
|
@ -139,7 +139,7 @@ function submit_submit($subject, $abstract, $article, $category) {
|
|||
$theme->footer();
|
||||
}
|
||||
|
||||
include "includes/theme.inc";
|
||||
include "includes/common.inc";
|
||||
|
||||
switch($op) {
|
||||
case "Preview submission":
|
||||
|
|
|
@ -1,24 +1,21 @@
|
|||
<?
|
||||
|
||||
class Theme {
|
||||
### color set #1:
|
||||
// color set #1:
|
||||
var $bgcolor1 = "#EAEAEA"; // background color
|
||||
var $fgcolor1 = "#404040"; // table body color
|
||||
var $hlcolor1 = "#666699"; // high-light color
|
||||
|
||||
### color set #2:
|
||||
// color set #2:
|
||||
var $bgcolor2 = "#666699";
|
||||
var $fgcolor2 = "#666699";
|
||||
var $hlcolor2 = "#666699";
|
||||
|
||||
### color set #3:
|
||||
// color set #3:
|
||||
var $bgcolor3 = "#EFEFEF";
|
||||
var $fgcolor3 = "yellow";
|
||||
var $hlcolor3 = "yellow";
|
||||
|
||||
######
|
||||
# Syntax.......: header($title);
|
||||
# Description..: a function to draw the page header.
|
||||
function header($title) {
|
||||
global $site_name;
|
||||
?>
|
||||
|
@ -53,10 +50,6 @@
|
|||
<?
|
||||
}
|
||||
|
||||
######
|
||||
# Syntax.......: abstract(...);
|
||||
# Description..: a function to draw an abstract story box, that is the
|
||||
# boxes displayed on the main page.
|
||||
function abstract($story) {
|
||||
print "\n<!-- story: \"$story->subject\" -->\n";
|
||||
print "<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"2\" WIDTH=\"100%\">\n";
|
||||
|
@ -75,16 +68,11 @@
|
|||
print " </TD>\n";
|
||||
print " </TR>\n";
|
||||
print " <TR><TD COLSPAN=\"2\"> </TD></TR>\n";
|
||||
print " <TR><TD COLSPAN=\"2\">". display_morelink($this, $story) ."</TD></TR>\n";
|
||||
print " <TR><TD COLSPAN=\"2\">". theme_morelink($this, $story) ."</TD></TR>\n";
|
||||
print "</TABLE>\n";
|
||||
print "<BR><BR>\n\n";
|
||||
}
|
||||
|
||||
######
|
||||
# Syntax.......: article(...);
|
||||
# Description..: a function to dispay a complete article (without user
|
||||
# comments). It's what you get when you followed for
|
||||
# instance one of read-more links on the main page.
|
||||
function article($story, $reply) {
|
||||
print "\n<!-- story: \"$story->subject\" -->\n";
|
||||
print "<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"2\" WIDTH=\"100%\">\n";
|
||||
|
@ -109,9 +97,6 @@
|
|||
print "<BR><BR>\n\n";
|
||||
}
|
||||
|
||||
######
|
||||
# Syntax.......: commentControl(...);
|
||||
# Description..: this function is used to theme the comment control box.
|
||||
function commentControl($sid, $title, $threshold, $mode, $order) {
|
||||
global $user;
|
||||
|
||||
|
@ -167,13 +152,10 @@
|
|||
<?
|
||||
}
|
||||
|
||||
######
|
||||
# Syntax.......: comment(...);
|
||||
# Description..: this function is used to theme user comments.
|
||||
function comment($comment, $link, $thread = "") {
|
||||
print "<A NAME=\"$comment->cid\">\n";
|
||||
|
||||
### Create comment header:
|
||||
// Create comment header:
|
||||
print "<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\" BGCOLOR=\"#000000\" WIDTH=\"100%\">\n";
|
||||
print " <TR BGCOLOR=\"#000000\">\n";
|
||||
print " <TD>\n";
|
||||
|
@ -183,22 +165,22 @@
|
|||
print " <TABLE BORDER=\"0\" CELLPADDING=\"2\" CELLSPACING=\"1\" WIDTH=\"100%\">\n";
|
||||
print " <TR>\n";
|
||||
|
||||
### Subject:
|
||||
// Subject:
|
||||
print " <TD ALIGN=\"right\" WIDTH=\"5%\"><B>Subject:</FONT></TD>\n";
|
||||
print " <TD WIDTH=\"80%\"><B><FONT COLOR=\"$this->hlcolor1\">". check_output($comment->subject) ."</FONT></B></TD>\n";
|
||||
|
||||
### Moderation:
|
||||
// Moderation:
|
||||
print " <TD ALIGN=\"right\" ROWSPAN=\"3\" VALIGN=\"middle\" WIDTH=\"15%\">\n";
|
||||
display_comment_moderation($comment->cid, $comment->userid, $comment->score, $comment->votes);
|
||||
theme_comment_moderation($comment->cid, $comment->userid, $comment->score, $comment->votes);
|
||||
print " </TD>\n";
|
||||
print " </TR>\n";
|
||||
|
||||
### Author:
|
||||
// Author:
|
||||
print " <TR>\n";
|
||||
print " <TD ALIGN=\"right\" VALIGN=\"top\">Author:</TD><TD>". format_username($comment->userid) ."</TD>\n";
|
||||
print " </TR>\n";
|
||||
|
||||
### Date
|
||||
// Date
|
||||
print " <TR>\n";
|
||||
print " <TD ALIGN=\"right\">Date:</TD><TD>". format_date($comment->timestamp) ."</TD>\n";
|
||||
print " </TR>\n";
|
||||
|
@ -207,13 +189,13 @@
|
|||
print " </TD>\n";
|
||||
print " </TR>\n";
|
||||
|
||||
### Print body of comment:
|
||||
// Print body of comment:
|
||||
if ($comment->comment) print " <TR><TD BGCOLOR=\"#FFFFFF\">". check_output($comment->comment, 1) ."</TD></TR>\n";
|
||||
|
||||
### Print thread (if any):
|
||||
// Print thread (if any):
|
||||
if ($thread) print " <TR><TD BGCOLOR=\"$this->bgcolor1\">$thread</TD></TR>\n";
|
||||
|
||||
### Print bottom link(s):
|
||||
// Print bottom link(s):
|
||||
print " <TR><TD ALIGN=\"right\" BGCOLOR=\"$this->bgcolor1\">[ $link ]</TD></TR>\n";
|
||||
print " </TABLE>\n";
|
||||
print " </TD>\n";
|
||||
|
@ -222,17 +204,14 @@
|
|||
print "<BR>\n\n";
|
||||
}
|
||||
|
||||
######
|
||||
# Syntax.......: box($subject, $body, $options = "");
|
||||
# Description..: a function to draw a box/block.
|
||||
function box($subject, $content, $options = "") {
|
||||
print "\n<!-- box: \"$subject\" -->\n";
|
||||
print "<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\" BGCOLOR=\"#000000\" WIDTH=\"100%\">\n";
|
||||
print " <TR>\n";
|
||||
print " <TD $wrap>\n";
|
||||
print " <TD>\n";
|
||||
print " <TABLE BORDER=\"0\" CELLPADDING=\"5\" CELLSPACING=\"1\" WIDTH=\"100%\">\n";
|
||||
print " <TR><TD ALIGN=\"center\" BGCOLOR=\"$this->bgcolor1\" WIDTH=\"100%\"><FONT COLOR=\"$this->fgcolor1\"><B>$subject</B></FONT></TD></TR>\n";
|
||||
print " <TR><TD BGCOLOR=\"#FFFFFF\" $options>$content</TD></TR>\n";
|
||||
print " <TR><TD ALIGN=\"center\" BGCOLOR=\"$this->bgcolor1\" NOWRAP><FONT COLOR=\"$this->fgcolor1\"><B>$subject</B></FONT></TD></TR>\n";
|
||||
print " <TR><TD BGCOLOR=\"#FFFFFF\">$content</TD></TR>\n";
|
||||
print " </TABLE>\n";
|
||||
print " </TD>\n";
|
||||
print " </TR>\n";
|
||||
|
@ -240,73 +219,17 @@
|
|||
print "<BR>\n\n";
|
||||
}
|
||||
|
||||
######
|
||||
# Syntax.......: footer();
|
||||
# Description..: a function to draw the page footer.
|
||||
function footer() {
|
||||
?>
|
||||
</TD>
|
||||
<TD VALIGN="top">
|
||||
<?
|
||||
global $PHP_SELF;
|
||||
// Display main blocks:
|
||||
theme_main_blocks($this);
|
||||
|
||||
if (strstr($PHP_SELF, "index.php")) {
|
||||
global $user, $date;
|
||||
|
||||
### Display account:
|
||||
display_account($this);
|
||||
|
||||
### Display old headlines:
|
||||
display_old_headlines($this);
|
||||
|
||||
### Display module blocks:
|
||||
display_module_blocks();
|
||||
}
|
||||
elseif (strstr($PHP_SELF, "account.php")) {
|
||||
### Display account:
|
||||
display_account($this);
|
||||
}
|
||||
elseif (strstr($PHP_SELF, "module.php")) {
|
||||
### Display account:
|
||||
display_account($this);
|
||||
}
|
||||
elseif (strstr($PHP_SELF, "submission.php")) {
|
||||
### Display account:
|
||||
display_account($this);
|
||||
}
|
||||
elseif (strstr($PHP_SELF, "submit.php")) {
|
||||
### Display new headlines:
|
||||
display_new_headlines($this);
|
||||
}
|
||||
elseif (strstr($PHP_SELF, "discussion.php")) {
|
||||
global $id;
|
||||
|
||||
if ($id && $story = id2story($id)) {
|
||||
if ($story->status == 2) {
|
||||
### Display new headlines:
|
||||
display_new_headlines($this);
|
||||
}
|
||||
else {
|
||||
### Display results of moderation:
|
||||
display_moderation_results($this, $story);
|
||||
}
|
||||
}
|
||||
else {
|
||||
### Display account:
|
||||
display_account($this);
|
||||
|
||||
### Display new headlines:
|
||||
display_new_headlines($this);
|
||||
}
|
||||
}
|
||||
else {
|
||||
### Display account:
|
||||
display_account($this);
|
||||
|
||||
### Display new headlines:
|
||||
display_new_headlines($this);
|
||||
}
|
||||
?>
|
||||
// Display user-defined blocks:
|
||||
theme_user_blocks($this);
|
||||
?>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
|
@ -321,4 +244,4 @@
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
|
@ -7,26 +7,23 @@
|
|||
var $clc0 = "#c8c8d0";
|
||||
var $cl00 = "#000000";
|
||||
|
||||
### color set #1:
|
||||
// color set #1:
|
||||
var $brcolor1 = "#000000"; // border color
|
||||
var $bgcolor1 = "#B5BECE";
|
||||
var $fgcolor1 = "#000000"; // table body color
|
||||
var $hlcolor1 = "#000000"; // high-light color
|
||||
var $categorycolor = "#202020";
|
||||
|
||||
### color set #2:
|
||||
// color set #2:
|
||||
var $bgcolor2 = "#EEEEEE";
|
||||
var $fgcolor2 = "#000000";
|
||||
var $hlcolor2 = "#000000";
|
||||
|
||||
### color set #3:
|
||||
// color set #3:
|
||||
var $bgcolor3 = "#D7D7D7";
|
||||
var $fgcolor3 = "#000000";
|
||||
var $hlcolor3 = "yellow";
|
||||
|
||||
######
|
||||
# Syntax.......: header($title);
|
||||
# Description..: a function to draw the page header.
|
||||
function header($title) {
|
||||
global $site_name;
|
||||
srand((double)microtime()*1000000);
|
||||
|
@ -73,10 +70,6 @@
|
|||
<?
|
||||
}
|
||||
|
||||
######
|
||||
# Syntax.......: abstract(...);
|
||||
# Description..: a function to draw an abstract story box, that is the
|
||||
# boxes displayed on the main page.
|
||||
function abstract($story) {
|
||||
$timestamp = format_date($story->timestamp);
|
||||
|
||||
|
@ -108,16 +101,11 @@
|
|||
?>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="<? echo $this->bgcolor3; ?>"><TD BGCOLOR="<? echo $this->bgcolor3 ?>" ALIGN="right" COLSPAN="2"><? echo display_morelink($this, $story) ?></TD></TR>
|
||||
<TR BGCOLOR="<? echo $this->bgcolor3; ?>"><TD BGCOLOR="<? echo $this->bgcolor3 ?>" ALIGN="right" COLSPAN="2"><? echo theme_morelink($this, $story) ?></TD></TR>
|
||||
</TABLE></TD></TR></TABLE><BR>
|
||||
<?
|
||||
}
|
||||
|
||||
######
|
||||
# Syntax.......: article(...);
|
||||
# Description..: a function to dispay a complete article (without user
|
||||
# comments). It's what you get when you followed for
|
||||
# instance one of read-more links on the main page.
|
||||
function article($story, $reply) {
|
||||
$timestamp = format_date($story->timestamp);
|
||||
|
||||
|
@ -152,9 +140,6 @@
|
|||
<?
|
||||
}
|
||||
|
||||
######
|
||||
# Syntax.......: commentControl(...);
|
||||
# Description..: this function is used to theme the comment control box.
|
||||
function commentControl($sid, $title, $threshold, $mode, $order) {
|
||||
global $user;
|
||||
$query = mysql_query("SELECT sid FROM comments WHERE sid = $sid");
|
||||
|
@ -215,9 +200,6 @@
|
|||
<?
|
||||
}
|
||||
|
||||
######
|
||||
# Syntax.......: comment(...);
|
||||
# Description..: this function is used to theme user comments.
|
||||
function comment($comment, $link, $thread = "") {
|
||||
print "<A NAME=\"$comment->cid\"></A>\n";
|
||||
|
||||
|
@ -228,29 +210,29 @@
|
|||
<TR><TD>
|
||||
<?
|
||||
|
||||
### Create comment header:
|
||||
// Create comment header:
|
||||
echo "<TABLE BORDER=\"0\" CELLPADDING=\"4\" CELLSPACING=\"1\" WIDTH=\"100%\">";
|
||||
echo " <TR BGCOLOR=\"$this->bgcolor1\">";
|
||||
echo " <TD BGCOLOR=\"$this->bgcolor1\">";
|
||||
echo " <TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"1\"WIDTH=\"100%\">";
|
||||
|
||||
### Subject:
|
||||
// Subject:
|
||||
echo " <TR>";
|
||||
echo " <TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"5%\"><FONT COLOR=\"$this->hlcolor1\"><B>Subject:</B></FONT></TD><TD WIDTH=\"80%\">";
|
||||
echo " <B><FONT COLOR=\"$this->fgcolor1\">" . check_output($comment->subject) . "</FONT></B>";
|
||||
echo " </TD>";
|
||||
|
||||
### Moderation:
|
||||
// Moderation:
|
||||
echo " <TD ALIGN=\"right\" ROWSPAN=\"3\" VALIGN=\"middle\" WIDTH=\"15%\">";
|
||||
display_comment_moderation($comment->cid, $comment->userid, $comment->score, $comment->votes);
|
||||
theme_comment_moderation($comment->cid, $comment->userid, $comment->score, $comment->votes);
|
||||
echo " </TD>";
|
||||
echo " </TR>";
|
||||
|
||||
### Author:
|
||||
// Author:
|
||||
echo " <TR>";
|
||||
echo " <TD ALIGN=\"right\" VALIGN=\"top\">Author:</TD><TD><B>" . format_username($comment->userid) . "</B> ";
|
||||
if ($comment->userid != $anonymous) {
|
||||
### Display extra information line:
|
||||
// Display extra information line:
|
||||
if ($comment->fake_email) $info .= format_email($comment->fake_email);
|
||||
if (eregi("http://",$comment->url)) $info .= " | " . format_url($comment->url);
|
||||
if ($info) echo "<BR>[ $info ]";
|
||||
|
@ -258,38 +240,34 @@
|
|||
echo " </TD>";
|
||||
echo " </TR>";
|
||||
|
||||
### Date
|
||||
// Date
|
||||
echo " <TR><TD ALIGN=\"right\">Date:</TD><TD>". format_date($comment->timestamp) ."</TD></TR>";
|
||||
|
||||
echo " </TABLE>";
|
||||
echo " </TD>";
|
||||
echo " </TR>";
|
||||
|
||||
### Print body of comment:
|
||||
// Print body of comment:
|
||||
if ($comment) echo " <TR><TD BGCOLOR=\"$this->bgcolor2\">". check_output($comment->comment, 1) ."</TD></TR>";
|
||||
|
||||
### Print thread (if any):
|
||||
// Print thread (if any):
|
||||
if ($thread) echo " <TR><TD BGCOLOR=\"$this->bgcolor3\">$thread</TD></TR>";
|
||||
|
||||
### Print bottom link(s):
|
||||
// Print bottom link(s):
|
||||
echo " <TR><TD ALIGN=\"right\" BGCOLOR=\"$this->bgcolor3\">[ $link ]</TD></TR>";
|
||||
echo " </TABLE>";
|
||||
?></TD></TR></TABLE><BR><?
|
||||
}
|
||||
|
||||
|
||||
######
|
||||
# Syntax.......: box($title, $body);
|
||||
# Description..: a function to draw a box/block.
|
||||
function box($subject, $content, $options = "") {
|
||||
function box($subject, $content) {
|
||||
?>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" BGCOLOR="<? echo $this->brcolor1; ?>" WIDTH="100%">
|
||||
<TR><TD>
|
||||
<?
|
||||
|
||||
print "<TABLE BORDER=\"0\" CELLPADDING=\"3\" CELLSPACING=\"1\" WIDTH=\"100%\">";
|
||||
print " <TR><TD ALIGN=\"center\" BGCOLOR=\"$this->bgcolor1\"><FONT COLOR=\"$this->fgcolor1\"><B>$subject</B></FONT></TD></TR>";
|
||||
print " <TR><TD BGCOLOR=\"$this->bgcolor2\" $options>$content</TD></TR>";
|
||||
print " <TR><TD ALIGN=\"center\" BGCOLOR=\"$this->bgcolor1\" NOWRAP><FONT COLOR=\"$this->fgcolor1\"><B>$subject</B></FONT></TD></TR>";
|
||||
print " <TR><TD BGCOLOR=\"$this->bgcolor2\">$content</TD></TR>";
|
||||
print "</TABLE>";
|
||||
|
||||
?>
|
||||
|
@ -299,77 +277,16 @@
|
|||
|
||||
}
|
||||
|
||||
######
|
||||
# Syntax.......: footer();
|
||||
# Description..: a function to draw the page footer.
|
||||
function footer() {
|
||||
?>
|
||||
</TD>
|
||||
<TD VALIGN="top" WIDTH="185">
|
||||
<?
|
||||
global $PHP_SELF, $user;
|
||||
|
||||
if (strstr($PHP_SELF, "index.php")) {
|
||||
global $user, $date;
|
||||
|
||||
### Display account:
|
||||
display_account($this);
|
||||
|
||||
### Display calendar:
|
||||
$this->box("Browse archives", droplet_get("calendar"));
|
||||
|
||||
### Display calendar:
|
||||
display_old_headlines($this);
|
||||
}
|
||||
elseif (strstr($PHP_SELF, "account.php")) {
|
||||
### Display account:
|
||||
display_account($this);
|
||||
}
|
||||
elseif (strstr($PHP_SELF, "submission.php")) {
|
||||
### Display account:
|
||||
display_account($this);
|
||||
}
|
||||
elseif (strstr($PHP_SELF, "submit.php")) {
|
||||
### Display account:
|
||||
display_account($this);
|
||||
|
||||
### Display new headlines:
|
||||
display_new_headlines($this);
|
||||
}
|
||||
elseif (strstr($PHP_SELF, "discussion.php")) {
|
||||
global $id;
|
||||
|
||||
if ($id && $story = id2story($id)) {
|
||||
if ($story->status == 2) {
|
||||
### Display account:
|
||||
display_account($this);
|
||||
|
||||
### Display related links:
|
||||
display_related_links($this, $story);
|
||||
|
||||
### Display new headlines:
|
||||
display_new_headlines($this);
|
||||
}
|
||||
else {
|
||||
### Display results of moderation:
|
||||
display_moderation_results($this, $story);
|
||||
}
|
||||
}
|
||||
else {
|
||||
### Display account:
|
||||
display_account($this);
|
||||
|
||||
### Display new headlines:
|
||||
display_new_headlines($this);
|
||||
}
|
||||
}
|
||||
else {
|
||||
### Display account:
|
||||
display_account($this);
|
||||
|
||||
### Display new headlines:
|
||||
display_new_headlines($this);
|
||||
}
|
||||
<?
|
||||
// Display main blocks:
|
||||
theme_main_blocks($this);
|
||||
|
||||
// Display user-defined blocks:
|
||||
theme_user_blocks($this);
|
||||
?>
|
||||
</TD>
|
||||
</TR>
|
||||
|
|
Loading…
Reference in New Issue