summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/database.inc8
-rw-r--r--includes/function.inc2
-rw-r--r--includes/hostname.conf8
-rw-r--r--includes/theme.inc21
4 files changed, 20 insertions, 19 deletions
diff --git a/includes/database.inc b/includes/database.inc
index ba708c87c..99d8391a4 100644
--- a/includes/database.inc
+++ b/includes/database.inc
@@ -7,9 +7,9 @@
* just adjust the handlers to your needs.
*/
-function db_connect($host, $name, $pass, $base) {
- mysql_pconnect($host, $name, $pass) or die(mysql_Error());
- mysql_select_db($base) or die ("unable to select database");
+function db_connect($host, $user, $pass, $name) {
+ mysql_pconnect($host, $user, $pass) or die(mysql_Error());
+ mysql_select_db($name) or die ("unable to select database");
// NOTE: we are using a persistent connection!
}
@@ -48,6 +48,6 @@ function db_result($qid, $field = 0) {
#
# Automatically connect to database:
#
-db_connect($db_host, $db_name, $db_pass, $db_base);
+db_connect($db_host, $db_user, $db_pass, $db_name);
?>
diff --git a/includes/function.inc b/includes/function.inc
index 4ebb161e8..a92d349d5 100644
--- a/includes/function.inc
+++ b/includes/function.inc
@@ -68,7 +68,7 @@ function format_interval($timestamp) {
$output .= floor($timestamp / 60) ." min ";
$timestamp = $timestamp % 60;
}
- if ($timestamp > 0) {
+ if ($timestamp >= 0) {
$output .= "$timestamp sec";
}
return $output;
diff --git a/includes/hostname.conf b/includes/hostname.conf
index 0f74e00f1..2b81c326b 100644
--- a/includes/hostname.conf
+++ b/includes/hostname.conf
@@ -3,12 +3,10 @@
#
# Database settings:
#
-
-### host: "http://localhost/":
$db_host = "localhost";
-$db_name = "name";
-$db_pass = "pass";
-$db_base = "base";
+$db_user = "username";
+$db_pass = "password";
+$db_name = "database";
#
diff --git a/includes/theme.inc b/includes/theme.inc
index 67ae4d4f9..c799a0f3c 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -27,15 +27,18 @@ function theme_account($theme) {
$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 preferences</A></LI>\n";
$content .= "<LI><A HREF=\"account.php?op=edit&topic=content\">edit site content</A></LI>\n";
- if (($user->id) && ($user->permissions == 1 || $user->id == 1)) {
- $content .= "<P>\n";
- $content .= "<LI><A HREF=\"admin.php\">administrate " . $site_name . "</A></LI>\n";
- }
$content .= "<P>\n";
- if (ksort($menu)) {
+
+ if (($user->id) && ($user->permissions == 1 || $user->id == 1)) {
+ $content .= "<LI><A HREF=\"admin.php\">administrate ". $site_name ."</A></LI>\n";
+ $content .= "<P>\n";
+ }
+
+ if ($menu && ksort($menu)) {
foreach ($menu as $link=>$url) $content .= "<LI><A HREF=\"$url\">$link</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");
@@ -127,16 +130,16 @@ function theme_related_links($theme, $story) {
$theme->box("Related links", $content);
}
-function theme_comment_moderation($id, $author, $score, $votes) {
+function theme_comment_moderation($comment) {
global $user, $comment_votes;
- if ($user->id && $user->userid != $author && !user_getHistory($user->history, "c$id")) {
- $output .= "<SELECT NAME=\"moderate[$id]\">\n";
+ if ($user->id && $user->userid != $comment->userid && !user_getHistory($user->history, "c$comment->cid")) {
+ $output .= "<SELECT NAME=\"moderate[$comment->cid]\">\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>";
+ $output .= "<TABLE BORDER=\"0\" CELLSPACING=\"1\" CELLPADDING=\"1\"><TR><TD>score:</TD><TD>". format_data($comment->score) ."</TD></TR><TR><TD>votes:</TD><TD>". format_data($comment->votes) ."</TR></TABLE>";
}
return $output;