diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/account.module | 10 | ||||
-rw-r--r-- | modules/backend.class | 5 | ||||
-rw-r--r-- | modules/ban.module | 2 | ||||
-rw-r--r-- | modules/cron.module | 13 | ||||
-rw-r--r-- | modules/diary.module | 2 | ||||
-rw-r--r-- | modules/drupal.module | 3 | ||||
-rw-r--r-- | modules/drupal/drupal.module | 3 | ||||
-rw-r--r-- | modules/faq.module | 2 | ||||
-rw-r--r-- | modules/headline.module | 10 | ||||
-rw-r--r-- | modules/module.module | 24 | ||||
-rw-r--r-- | modules/section.module | 6 |
11 files changed, 52 insertions, 28 deletions
diff --git a/modules/account.module b/modules/account.module index b4a278d2f..ddeada1c2 100644 --- a/modules/account.module +++ b/modules/account.module @@ -51,13 +51,13 @@ function account_display($order = "username") { $output .= " <TR>\n"; foreach ($show as $key=>$value) { switch($value = strtok($value, " ")) { - case "real_email": + case "real_email": $output .= " <TD>". format_email($account[$value]) ."</TD>\n"; break; case "last_access": $output .= " <TD>". format_interval(time() - $account[$value]) ." ago</TD>\n"; break; - case "status": + case "status": $output .= " <TD ALIGN=\"center\">". $stat[$account[$value]] ."</TD>\n"; break; case "permissions": @@ -69,7 +69,7 @@ function account_display($order = "username") { case "url": $output .= " <TD>". format_url($account[$value]) ."</TD>\n"; break; - case "userid": + case "userid": $output .= " <TD>". format_username($account[$value], 1) ."</TD>\n"; break; default: @@ -100,7 +100,7 @@ function account_comments($id) { return $output; } -function account_save($name, $edit) { +function account_edit_save($name, $edit) { foreach ($edit as $key=>$value) { $query .= "$key = '". addslashes($value) ."', "; } @@ -195,7 +195,7 @@ function account_admin() { account_view($name); break; case "Save account": - account_save($name, $edit); + account_edit_save($name, $edit); account_view($name); break; case "Update": diff --git a/modules/backend.class b/modules/backend.class index 04e25520d..2028c5d87 100644 --- a/modules/backend.class +++ b/modules/backend.class @@ -37,7 +37,6 @@ class backend { while ($headline = db_fetch_object($result)) { array_push($this->headlines, "<A HREF=\"$headline->link\">$headline->title</A>"); } - } else { $this->site = $site; @@ -94,9 +93,6 @@ class backend { $title = ereg_replace(".*<title>", "", $item); $title = ereg_replace("</title>.*", "", $title); - // Clean headlines: - $title = stripslashes($title); - // Count the number of stories: $number += 1; @@ -145,7 +141,6 @@ class backend { } // Add timestamp: $update = round((time() - $this->timestamp) / 60); - $content .= "<P ALIGN=\"right\">[ <A HREF=\"backend.php?op=reset&site=$this->site\"><FONT COLOR=\"$theme->hlcolor2\">reset</FONT></A> | updated $update min. ago ]</P>"; // Display box: $theme->box("$this->site", $content); diff --git a/modules/ban.module b/modules/ban.module index b14dc492e..862077a47 100644 --- a/modules/ban.module +++ b/modules/ban.module @@ -3,7 +3,7 @@ $module = array("help" => "ban_help", "admin" => "ban_admin"); -include "includes/ban.inc"; +include_once "includes/ban.inc"; function ban_help() { diff --git a/modules/cron.module b/modules/cron.module index 54d55c41b..cb3bbb1fa 100644 --- a/modules/cron.module +++ b/modules/cron.module @@ -17,6 +17,13 @@ function cron_save($edit) { } } +function cron_execute($name) { + global $repository; + watchdog("message", "cron: executed '". $name ."_cron()'"); + $repository[$name]["cron"](); + db_query("UPDATE crons SET timestamp = ". time() ." WHERE module = '$name'"); +} + function cron_display() { $intervals = array(300, 900, 1800, 3600, 7200, 10800, 21600, 43200, 86400, 172800, 259200, 604800, 1209600, 2419200); @@ -29,7 +36,7 @@ function cron_display() { $output .= " <TR><TH>module</TH><TH>period</TH><TH>last execution</TH><TH>operations</TH></TR>\n"; while ($cron = db_fetch_object($result)) { foreach ($intervals as $value) $period .= "<OPTION VALUE=\"$value\"". (($cron->scheduled == $value) ? " SELECTED" : "") .">every ". format_interval($value) ."</OPTION>\n"; - $output .= " <TR><TD>". check_output($cron->module) ."</TD><TD><SELECT NAME=\"edit[$cron->module]\">$period</SELECT></TD><TD>". format_interval(time() - $cron->timestamp) ." ago</TD><TD ALIGN=\"center\"><A HREF=\"cron.php\">execute</A></TD></TR>\n"; + $output .= " <TR><TD>". check_output($cron->module) ."</TD><TD><SELECT NAME=\"edit[$cron->module]\">$period</SELECT></TD><TD ALIGN=\"center\">". ($cron->timestamp ? format_interval(time() - $cron->timestamp) ." ago" : "never" )."</TD><TD ALIGN=\"center\"><A HREF=\"admin.php?mod=cron&op=execute&name=$cron->module\">execute</A></TD></TR>\n"; unset($period); } $output .= "</TABLE>\n"; @@ -47,6 +54,10 @@ function cron_admin() { case "help": cron_help(); break; + case "execute": + cron_execute($name); + cron_display(); + break; case "Save crons": cron_save($edit); // fall through diff --git a/modules/diary.module b/modules/diary.module index 584a51b8a..7b95f1072 100644 --- a/modules/diary.module +++ b/modules/diary.module @@ -8,7 +8,7 @@ $module = array("page" => "diary_page", "admin" => "diary_admin", "export" => "diary_export"); -include "includes/common.inc"; +include_once "includes/common.inc"; function diary_page_overview($num = 20) { global $theme, $user; diff --git a/modules/drupal.module b/modules/drupal.module index 990080f05..8ece0a6d9 100644 --- a/modules/drupal.module +++ b/modules/drupal.module @@ -50,6 +50,9 @@ function drupal_page() { break; case "Post comment": comment_post($pid, $id, $subject, $comment); + $theme->header(); + drupal_render($id, $cid); + $theme->footer(); break; case "reply": $theme->header(); diff --git a/modules/drupal/drupal.module b/modules/drupal/drupal.module index 990080f05..8ece0a6d9 100644 --- a/modules/drupal/drupal.module +++ b/modules/drupal/drupal.module @@ -50,6 +50,9 @@ function drupal_page() { break; case "Post comment": comment_post($pid, $id, $subject, $comment); + $theme->header(); + drupal_render($id, $cid); + $theme->footer(); break; case "reply": $theme->header(); diff --git a/modules/faq.module b/modules/faq.module index d4c0b1d81..811282a61 100644 --- a/modules/faq.module +++ b/modules/faq.module @@ -2,7 +2,7 @@ $module = array("page" => "faq_page"); -include "includes/common.inc"; +include_once "includes/common.inc"; function faq_page() { global $theme, $site_name, $site_email; diff --git a/modules/headline.module b/modules/headline.module index 8bb89d310..306944cea 100644 --- a/modules/headline.module +++ b/modules/headline.module @@ -7,9 +7,8 @@ $module = array("page" => "headline_page", "admin" => "headline_admin", "export" => "headline_export"); -include "includes/common.inc"; -include "modules/backend.class"; - +include_once "includes/common.inc"; +include_once "modules/backend.class"; function headline_blocks() { global $theme; @@ -37,7 +36,7 @@ function headline_blocks() { } // Print backend box to screen: - $theme->box($backend->site, "$content<P ALIGN=\"right\">[ <A HREF=\"$backend->url\">more</A> ]\n"); + $theme->box($backend->site, $content); print " </TD>\n"; if ($state % 3 == 2) print " </TR>\n"; @@ -185,8 +184,7 @@ function headline_admin() { function headline_export($uri) { global $site_name, $site_url, $HTTP_REFERER, $HTTP_USER_AGENT; - if ($uri[2] == "headlines.rdf") { - + if ($uri[1] == "headlines.rdf") { watchdog("message", "grabbed 'headlines.rdf' - referring url: $HTTP_REFERER - user agent: $HTTP_USER_AGENT"); header("Content-Type: text/plain"); diff --git a/modules/module.module b/modules/module.module index 9f905c159..4c32990f4 100644 --- a/modules/module.module +++ b/modules/module.module @@ -1,6 +1,13 @@ <? -$module = array("admin" => "module_admin"); +$module = array("help" => "module_help", + "admin" => "module_admin"); + +function module_help() { + ?> + The module administration page provide you a list of all available modules. Moreover, it allows you to "rehash" modules. Whenever you install a new module or when an existing module has been changed or updated, it requires "rehasing": when you rehash a module, the module is registered to the engine and properly initialized. + <? +} function module_admin_rehash() { global $repository; @@ -41,16 +48,23 @@ function module_admin_display() { function module_admin() { global $op, $name; + print "<SMALL><A HREF=\"admin.php?mod=module\">overview</A> | <A HREF=\"admin.php?mod=module&op=help\">help</A></SMALL><HR>\n"; + switch ($op) { - case "Rehash modules": - module_admin_rehash(); + case "help": + module_help(); break; case "rehash": module_rehash($name); + module_admin_display(); break; + case "Rehash modules": + module_admin_rehash(); + module_admin_display(); + break; + default: + module_admin_display(); } - - module_admin_display(); } ?> diff --git a/modules/section.module b/modules/section.module index 36642f418..2ee5869d9 100644 --- a/modules/section.module +++ b/modules/section.module @@ -12,8 +12,8 @@ $_section = array("status" => array(2 => "enabled: always", 1 => "enabled: custo function section_help() { ?> - <P>When submitting new stories, every story is assigned a section or category. These sections can be maintained from the administration pages.</P> - <P>For moderation purpose, you can specify a post, dump and expiration thresholds for each available section according to type and urgency level a section. Some section do not really "expire" and stay interesting and active as time passes by, whereas news-related stories are only considered "hot" over a short period of time.</P> + <P>When submitting new stories, every story is assigned a section or category. Sections can be maintained from the administration pages.</P> + <P>For moderation purpose, you can specify a post, dump and expiration thresholds for each available section according to type and urgency level of a section. This is useful considering the fact that some sections do not really "expire" and stay interesting and active as time passes by, whereas news-related stories are only considered "hot" over a short period of time.</P> <? } @@ -113,7 +113,7 @@ function section_admin() { switch($op) { case "add": - section_add($edit); + section_add(); break; case "help": section_help(); |