Commit 73077e87 authored by Dries's avatar Dries
Browse files

A lot of (non-visual) updates!

parent 44af9b9b
This diff is collapsed.
This diff is collapsed.
......@@ -87,8 +87,8 @@ function adminMain() {
print "<BR><BR>";
}
include "backend.class.php";
include "theme.inc";
include "includes/backend.inc";
include "includes/theme.inc";
$theme->header();
......
<?
include "theme.inc";
include "includes/theme.inc";
function diary_overview($num = 20) {
global $theme, $user;
......
<?
function discussion_score($comment) {
$value = ($comments->votes) ? $comment->score / $comment->votes : ($comments->score) ? $comments->score : 0;
$value = ($comment->votes) ? ($comment->score / $comment->votes) : (($comment->score) ? $comment->score : 0);
return (strpos($value, ".")) ? substr($value ."00", 0, 4) : $value .".00";
}
......@@ -35,7 +35,7 @@ function discussion_kids($cid, $mode, $level = 0, $dummy = 0) {
$comments++;
$link = "<A HREF=\"discussion.php?op=reply&sid=$comment->sid&pid=$comment->cid\"><FONT COLOR=\"$theme->hlcolor2\">reply to this comment</FONT></A>";
$theme->comment($comment->userid, stripslashes($comment->subject), stripslashes($comment->comment), $comment->timestamp, stripslashes($comment->url), stripslashes($comment->femail), discussion_score($comment), $comment->cid, $link);
$theme->comment($comment->userid, stripslashes($comment->subject), stripslashes($comment->comment), $comment->timestamp, stripslashes($comment->url), stripslashes($comment->femail), discussion_score($comment), $comment->votes, $comment->cid, $link);
discussion_kids($comment->cid, $mode, $level + 1, $dummy + 1);
}
......@@ -45,7 +45,7 @@ function discussion_kids($cid, $mode, $level = 0, $dummy = 0) {
while ($comment = db_fetch_object($result)) {
if ($comment->score >= $thold) {
$link = "<A HREF=\"discussion.php?op=reply&sid=$comment->sid&pid=$comment->cid\"><FONT COLOR=\"$theme->hlcolor2\">reply to this comment</FONT></A>";
$theme->comment($comment->userid, check_output($comment->subject), check_output($comment->comment), $comment->timestamp, $comment->url, $comment->femail, discussion_score($comment), $comment->cid, $link);
$theme->comment($comment->userid, check_output($comment->subject), check_output($comment->comment), $comment->timestamp, $comment->url, $comment->femail, discussion_score($comment), $comment->votes, $comment->cid, $link);
}
discussion_kids($comment->cid, $mode);
}
......@@ -151,10 +151,10 @@ function discussion_display($sid, $pid, $cid, $level = 0) {
### Display the comments:
if (empty($mode) || $mode == "threaded") {
$thread = discussion_childs($comment->cid);
$theme->comment($comment->userid, check_output($comment->subject), check_output($comment->comment), $comment->timestamp, $comment->url, $comment->femail, $comment->score, $comment->cid, $link, $thread);
$theme->comment($comment->userid, check_output($comment->subject), check_output($comment->comment), $comment->timestamp, $comment->url, $comment->femail, discussion_score($comment), $comment->votes, $comment->cid, $link, $thread);
}
else {
$theme->comment($comment->userid, check_output($comment->subject), check_output($comment->comment), $comment->timestamp, $comment->url, $comment->femail, $comment->score, $comment->cid, $link);
$theme->comment($comment->userid, check_output($comment->subject), check_output($comment->comment), $comment->timestamp, $comment->url, $comment->femail, discussion_score($comment), $comment->votes, $comment->cid, $link);
discussion_kids($comment->cid, $mode, $level);
}
}
......@@ -170,7 +170,7 @@ function discussion_reply($pid, $sid) {
### Extract parent-information/data:
if ($pid) {
$item = db_fetch_object(db_query("SELECT comments.*, users.userid FROM comments LEFT JOIN users ON comments.author = users.id WHERE comments.cid = $pid"));
$theme->comment($item->userid, check_output(stripslashes($item->subject)), check_output(stripslashes($item->comment)), $item->timestamp, stripslashes($item->url), stripslashes($item->femail), $item->score, $item->cid, "reply to this comment");
$theme->comment($item->userid, check_output(stripslashes($item->subject)), check_output(stripslashes($item->comment)), $item->timestamp, stripslashes($item->url), stripslashes($item->femail), discussion_score($comment), $comment->votes, $item->cid, "reply to this comment");
}
else {
$item = db_fetch_object(db_query("SELECT stories.*, users.userid FROM stories LEFT JOIN users ON stories.author = users.id WHERE stories.status != 0 AND stories.id = $sid"));
......@@ -221,8 +221,8 @@ function comment_preview($pid, $sid, $subject, $comment) {
global $anonymous, $user, $theme;
### Preview comment:
if ($user) $theme->comment("", check_output(stripslashes($subject)), check_output(stripslashes($comment)), time(), "", "", "na", "", "reply to this comment");
else $theme->comment($user->userid, check_output(stripslashes($subject)), check_output(stripslashes($comment)), time(), stripslashes($user->url), stripslashes($user->femail), "na", "", "reply to this comment");
if ($user) $theme->comment("", check_output(stripslashes($subject)), check_output(stripslashes($comment)), time(), "", "", "na", "", "", "reply to this comment");
else $theme->comment($user->userid, check_output(stripslashes($subject)), check_output(stripslashes($comment)), time(), stripslashes($user->url), stripslashes($user->femail), "na", "", "", "reply to this comment");
### Build reply form:
$output .= "<FORM ACTION=\"discussion.php\" METHOD=\"post\">\n";
......@@ -302,7 +302,7 @@ function comment_post($pid, $sid, $subject, $comment) {
}
}
include "theme.inc";
include "includes/theme.inc";
switch($op) {
case "Preview comment":
......
......@@ -35,8 +35,9 @@
$message = "unknown error";
}
include "database.inc";
include "log.inc";
include "includes/database.inc";
include "includes/log.inc";
watchdog(3, "message: `$message' - requested url: $REDIRECT_URL - referring url: $HTTP_REFERER");
?>
......
<?
include "theme.inc";
include "includes/theme.inc";
$output = "
<DL>
......@@ -45,6 +45,9 @@
<DT><B>Can I syndicate content from this site?</B></DT>
<DD>--- under construction ---<P></DD>
<DT><B>I found a bug or encountered a problem, what do I do?</B></DT>
<DD>Write us a bugreport or send us a patch! Writing a good bug report takes patience, but doing it right the first time saves time for us and for you. It is most helpful when a good description of the problem is included in the bug report. That is, a good example of all the things you did that led to the problem and the problem itself exactly described. The best reports are those that include a full example showing how to reproduce the bug or problem.<P></DD>
<DT><B>Is the source code of this site available?</B></DT>
<DD>This site is powered by <A HREF=\"http://www.fsf.org/\">Free Software</A>; including <A HREF=\"http://www.apache.org/\">Apache</A>, <A HREF=\"http://www.php.net/\">PHP</A>, <A HREF=\"http://www.mysql.com/\">MySQL</A> and <A HREF=\"http://www.linux.com/\">Linux</A>, and is inspired by several <A HREF=\"http://www.fsf.org/\">Free Software</A> projects. Therefor we have decided to make the software engine of this site available under terms of GPL.<P>However, the sources are <B>not</B> available yet at this time, but will be released as soon we have a first, well-rounded source tree that has proven to be stable. If you can't wait or in case you have big plans (like `total domination') with the engine, don't hesitate to contact us and we might grant you CVS access.<P></DD>
......
<?
include "theme.inc";
include "includes/theme.inc";
### Initialize/pre-process variables:
$number = ($user->storynum) ? $user->storynum : 10;
......
<?
include "theme.inc";
include "includes/theme.inc";
$theme->header();
......
<?
include "submission.inc";
include "theme.inc";
include "includes/submission.inc";
include "includes/theme.inc";
function submission_displayMain() {
global $PHP_SELF, $theme, $user;
include "config.inc";
### Perform query:
$result = db_query("SELECT s.*, u.userid FROM stories s LEFT JOIN users u ON s.author = u.id WHERE s.status = 1 ORDER BY s.id");
......@@ -25,14 +23,12 @@ function submission_displayMain() {
}
function submission_displayItem($id) {
global $PHP_SELF, $theme, $user;
global $PHP_SELF, $theme, $user, $submission_votes;
if ($vote = user_getHistory($user->history, "s$id")) {
header("Location: discussion.php?id=$id");
}
else {
include "config.inc";
$result = db_query("SELECT s.*, u.userid FROM stories s LEFT JOIN users u ON s.author = u.id WHERE s.id = $id");
$submission = db_fetch_object($result);
......
......@@ -146,7 +146,7 @@ function submit_submit($subject, $abstract, $article, $category) {
watchdog(1, "added new submission with subject `$subject'.");
}
include "theme.inc";
include "includes/theme.inc";
switch($op) {
case "Preview submission":
......
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