- Added custom PHP error handler to track down warnings and errors.
(Jeroen: let's sit back and wait until that warning bites again.) - Simplified drupal.module. We still need a feature list, anyone?3-00
parent
be8e898d23
commit
25c379fb61
|
@ -12,6 +12,15 @@ function conf_init() {
|
|||
return $file;
|
||||
}
|
||||
|
||||
function error_handler($errno, $message, $filename, $line, $variables) {
|
||||
$types = array(1 => "error", 2 => "warning", 4 => "parse error", 8 => "notice", 16 => "core error", 32 => "core warning", 64 => "compile error", 128 => "compile warning", 256 => "user error", 512 => "user warning", 1024 => "user notice");
|
||||
$entry = $types[$errno] .": $message in $filename on line $line.";
|
||||
if ($errno == 1 || $errno == 2 || $errno == 4) {
|
||||
watchdog("error", $types[$errno] .": $message in $filename on line $line.");
|
||||
print $entry;
|
||||
}
|
||||
}
|
||||
|
||||
function watchdog($type, $message) {
|
||||
global $user, $watchdog, $PHP_SELF;
|
||||
$link = ($mod) ? $mod : substr(strrchr($PHP_SELF, "/"), 1, strrchr($PHP_SELF, "/") - 4);
|
||||
|
@ -195,10 +204,22 @@ include_once "includes/theme.inc";
|
|||
include_once "includes/user.inc";
|
||||
include_once "includes/node.inc";
|
||||
|
||||
// initialize user session:
|
||||
user_init();
|
||||
|
||||
// initialize installed modules:
|
||||
module_init();
|
||||
|
||||
// initialize localization system:
|
||||
$locale = locale_init();
|
||||
|
||||
// initialize configuration variables:
|
||||
$conf = variable_init();
|
||||
|
||||
// initialize theme:
|
||||
$theme = theme_init();
|
||||
|
||||
// set error handler:
|
||||
set_error_handler("error_handler");
|
||||
|
||||
?>
|
|
@ -7,7 +7,7 @@ function theme_init() {
|
|||
include_once $themes[$user->theme][0];
|
||||
}
|
||||
else {
|
||||
include_once $themes[variable_get(theme_default, key($themes))][0];
|
||||
include_once $themes[variable_get("theme_default", key($themes))][0];
|
||||
}
|
||||
return new Theme();
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ function theme_account($theme) {
|
|||
// Display account settings:
|
||||
$content .= "<LI><A HREF=\"account.php?op=track&topic=comments\">". t("track your comments") ."</A></LI>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=track&topic=nodes\">". t("track your nodes") ."</A></LI>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=track&topic=site\">". strtr(t("track %a"), array("%a" => variable_get(site_name, "drupal"))) ."</A></LI>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=track&topic=site\">". strtr(t("track %a"), array("%a" => variable_get("site_name", "drupal"))) ."</A></LI>\n";
|
||||
$content .= "<P>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=edit&topic=user\">". t("edit your information") ."</A></LI>\n";
|
||||
$content .= "<LI><A HREF=\"account.php?op=edit&topic=site\">". t("edit your preferences") ."</A></LI>\n";
|
||||
|
@ -40,7 +40,7 @@ function theme_account($theme) {
|
|||
$content .= "<P>\n";
|
||||
|
||||
if (user_access($user)) {
|
||||
$content .= "<LI><A HREF=\"admin.php\">administer ". variable_get(site_name, "drupal") ."</A></LI>\n";
|
||||
$content .= "<LI><A HREF=\"admin.php\">administer ". variable_get("site_name", "drupal") ."</A></LI>\n";
|
||||
$content .= "<P>\n";
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
include_once "includes/common.inc";
|
||||
|
||||
if (variable_get(dev_timing, 0)) timer_start();
|
||||
if (variable_get("dev_timing", 0)) timer_start();
|
||||
|
||||
$result = db_query("SELECT nid FROM node WHERE promote = '1' AND status = '$status[posted]' AND timestamp <= ". ($date > 0 ? $date : time()) ." ". ($category ? "AND cid = '$category'" : "") ." ". ($topic ? "AND tid = '$topic'" : "") ." ORDER BY timestamp DESC LIMIT ". ($user->nodes ? $user->nodes : variable_get(default_nodes_main, 10)));
|
||||
|
||||
|
@ -12,6 +12,6 @@ while ($node = db_fetch_object($result)) {
|
|||
}
|
||||
$theme->footer();
|
||||
|
||||
if (variable_get(dev_timing, 0)) timer_print();
|
||||
if (variable_get("dev_timing", 0)) timer_print();
|
||||
|
||||
?>
|
||||
|
|
|
@ -5,28 +5,28 @@ function drupal_page() {
|
|||
|
||||
$theme->header();
|
||||
|
||||
$output = " <P>Drupal is the English pronunciation for the Dutch word 'druppel' which stands for 'drop'. Drupal is a full-featured content management/discussion engine suitable to setup a news-driven community or portal site. Drupal aims towards easy installation, excessive configuration and fine-grained maintenance capabilities. Due to its modular design drupal is flexible and easy to adapt or extend.</P>\n";
|
||||
$output .= " <P>Drupal is primarily written by Dries Buytaert (dries_at_drop.org) and build after Slash (<A HREF=\"http://slashcode.com/\">http://slashcode.com/</A>) and Scoop (<A HREF=\"http://scoop.kuro5hin.org/\">http://scoop.kuro5hin.org/</A>). The source code is available under terms of GNU General Public License (GPL).</P>\n";
|
||||
$output .= " <P>We don't have a real demo site yet but drupal is used by (and created for) <A HREF=\"http://drop.org/\">http://drop.org/</A>. Create an account, play with it for a bit, read the <A HREF=\"module.php?mod=book\">documentation</A> and spend some time getting used to it.</P>\n";
|
||||
$theme->box("Introduction", $output);
|
||||
|
||||
$output = "<LI><A HREF=\"drupal/drupal-2.00.tgz\">drupal 2.00</A> (2001/03/15 - latest version)</LI>\n";
|
||||
$output .= "<LI>drupal 1.00 (2001/01/15)</LI>\n";
|
||||
$theme->box("Download", $output);
|
||||
$output = " <P>Drupal is the English pronunciation for the Dutch word 'druppel' which stands for 'drop'. Drupal is a full-featured <I>content management/discussion engine</I> suitable to setup a news-driven community or portal site. Drupal aims towards easy installation, excessive configuration and fine-grained maintenance capabilities. Due to its modular design Drupal is flexible and easy to adapt or extend.</P>\n";
|
||||
$output .= " <P>Drupal is primarily written by Dries Buytaert (dries_at_drop.org) and build after <A HREF=\"http://slashcode.com/\">Slash</A> and <A HREF=\"http://scoop.kuro5hin.org/\">Scoop</A>. Drupal uses <A HREF=\"http://www.php.net/\">PHP</A> and <A HREF=\"http://www.mysql.com/\">MySQL</A> and is a valuable alternative for <A HREF=\"http://phpnuke.org/\">PHP-Nuke</A>, <A HREF=\"http://thatware.org/\">ThatWare</A>, <A HREF=\"http://geeklog.org/\">GeekLog</A> and so on. The source code is available under terms of GNU General Public License (GPL).</P>\n";
|
||||
$output .= " <P>We don't have a real demo site yet but Drupal is used by (and created for) <A HREF=\"http://drop.org/\">http://drop.org/</A>. Create an account, play with it for a bit, read the <A HREF=\"module.php?mod=drupal+handbook\">documentation</A> and spend some time getting used to it.</P>\n";
|
||||
$theme->box("Drupal", $output);
|
||||
|
||||
/*
|
||||
unset($output);
|
||||
$handle = opendir("drupal");
|
||||
while ($file = readdir($handle)) if (ereg(".jpg", $file) || ereg(".gif", $file)) $output .= " <LI><SMALL><A HREF=\"drupal/$file\">$file</A></SMALL></LI>\n";
|
||||
closedir($handle);
|
||||
$theme->box("Screenshots", $output);
|
||||
*/
|
||||
|
||||
$output = "<H3>Documentation</H3>\n";
|
||||
$output .= " <LI><A HREF=\"module.php?mod=book\">documentation</A></LI>\n";
|
||||
$output .= " <LI><A HREF=\"module.php?mod=wishlist\">wishlist</A></LI>\n";
|
||||
$output .= "<H3>Mailing list</H3>\n";
|
||||
$output .= " <P>The <CODE>drupal-support@drop.org</CODE> list discusses drupal development. All submissions relevant to that, such as bug reports, enhancement ideas, patches or reports that a patch fixed a bug are appropriate.</P>\n";
|
||||
$output .= " <LI>To subscribe to the <CODE>drupal-support@drop.org</CODE> mailing list, send an e-mail to <A HREF=\"mailto:drupal-support-request@drop.org\">drupal-support-request@drop.org</A> with no subject and put <B>subscribe</B> in the body of your message.</LI>\n";
|
||||
$output .= " <LI>To unsubscribe from the <CODE>drupal-support@drop.org</CODE> mailing list, send an e-mail to <A HREF=\"mailto:drupal-support-request@drop.org\">drupal-support-request@drop.org</A> and put <B>unsubscribe</B> in the body of your mail.\n";
|
||||
$output = "<H3>Download</H3>\n";
|
||||
$output .= " <LI><A HREF=\"drupal/drupal-2.00.tgz\">drupal 2.00</A> (2001/03/15 - latest version)</LI>\n";
|
||||
$output .= " <LI>drupal 1.00 (2001/01/15)</LI>\n";
|
||||
$output .= "<H3>Documentation</H3>\n";
|
||||
$output .= " <LI><A HREF=\"module.php?mod=drupal+handbook\">drupal handbook</A></LI>\n";
|
||||
$output .= "<H3>Mailing lists</H3>\n";
|
||||
$output .= " <LI><A HREF=\"module.php?mod=mailing+lists\">mailing lists</A>";
|
||||
$output .= "<H3>Development</H3>\n";
|
||||
$output .= " <LI><A HREF=\"module.php?mod=development\">drupal development</A>\n";
|
||||
$theme->box("Support and development", $output);
|
||||
|
||||
$theme->footer();
|
||||
|
|
|
@ -5,28 +5,28 @@ function drupal_page() {
|
|||
|
||||
$theme->header();
|
||||
|
||||
$output = " <P>Drupal is the English pronunciation for the Dutch word 'druppel' which stands for 'drop'. Drupal is a full-featured content management/discussion engine suitable to setup a news-driven community or portal site. Drupal aims towards easy installation, excessive configuration and fine-grained maintenance capabilities. Due to its modular design drupal is flexible and easy to adapt or extend.</P>\n";
|
||||
$output .= " <P>Drupal is primarily written by Dries Buytaert (dries_at_drop.org) and build after Slash (<A HREF=\"http://slashcode.com/\">http://slashcode.com/</A>) and Scoop (<A HREF=\"http://scoop.kuro5hin.org/\">http://scoop.kuro5hin.org/</A>). The source code is available under terms of GNU General Public License (GPL).</P>\n";
|
||||
$output .= " <P>We don't have a real demo site yet but drupal is used by (and created for) <A HREF=\"http://drop.org/\">http://drop.org/</A>. Create an account, play with it for a bit, read the <A HREF=\"module.php?mod=book\">documentation</A> and spend some time getting used to it.</P>\n";
|
||||
$theme->box("Introduction", $output);
|
||||
|
||||
$output = "<LI><A HREF=\"drupal/drupal-2.00.tgz\">drupal 2.00</A> (2001/03/15 - latest version)</LI>\n";
|
||||
$output .= "<LI>drupal 1.00 (2001/01/15)</LI>\n";
|
||||
$theme->box("Download", $output);
|
||||
$output = " <P>Drupal is the English pronunciation for the Dutch word 'druppel' which stands for 'drop'. Drupal is a full-featured <I>content management/discussion engine</I> suitable to setup a news-driven community or portal site. Drupal aims towards easy installation, excessive configuration and fine-grained maintenance capabilities. Due to its modular design Drupal is flexible and easy to adapt or extend.</P>\n";
|
||||
$output .= " <P>Drupal is primarily written by Dries Buytaert (dries_at_drop.org) and build after <A HREF=\"http://slashcode.com/\">Slash</A> and <A HREF=\"http://scoop.kuro5hin.org/\">Scoop</A>. Drupal uses <A HREF=\"http://www.php.net/\">PHP</A> and <A HREF=\"http://www.mysql.com/\">MySQL</A> and is a valuable alternative for <A HREF=\"http://phpnuke.org/\">PHP-Nuke</A>, <A HREF=\"http://thatware.org/\">ThatWare</A>, <A HREF=\"http://geeklog.org/\">GeekLog</A> and so on. The source code is available under terms of GNU General Public License (GPL).</P>\n";
|
||||
$output .= " <P>We don't have a real demo site yet but Drupal is used by (and created for) <A HREF=\"http://drop.org/\">http://drop.org/</A>. Create an account, play with it for a bit, read the <A HREF=\"module.php?mod=drupal+handbook\">documentation</A> and spend some time getting used to it.</P>\n";
|
||||
$theme->box("Drupal", $output);
|
||||
|
||||
/*
|
||||
unset($output);
|
||||
$handle = opendir("drupal");
|
||||
while ($file = readdir($handle)) if (ereg(".jpg", $file) || ereg(".gif", $file)) $output .= " <LI><SMALL><A HREF=\"drupal/$file\">$file</A></SMALL></LI>\n";
|
||||
closedir($handle);
|
||||
$theme->box("Screenshots", $output);
|
||||
*/
|
||||
|
||||
$output = "<H3>Documentation</H3>\n";
|
||||
$output .= " <LI><A HREF=\"module.php?mod=book\">documentation</A></LI>\n";
|
||||
$output .= " <LI><A HREF=\"module.php?mod=wishlist\">wishlist</A></LI>\n";
|
||||
$output .= "<H3>Mailing list</H3>\n";
|
||||
$output .= " <P>The <CODE>drupal-support@drop.org</CODE> list discusses drupal development. All submissions relevant to that, such as bug reports, enhancement ideas, patches or reports that a patch fixed a bug are appropriate.</P>\n";
|
||||
$output .= " <LI>To subscribe to the <CODE>drupal-support@drop.org</CODE> mailing list, send an e-mail to <A HREF=\"mailto:drupal-support-request@drop.org\">drupal-support-request@drop.org</A> with no subject and put <B>subscribe</B> in the body of your message.</LI>\n";
|
||||
$output .= " <LI>To unsubscribe from the <CODE>drupal-support@drop.org</CODE> mailing list, send an e-mail to <A HREF=\"mailto:drupal-support-request@drop.org\">drupal-support-request@drop.org</A> and put <B>unsubscribe</B> in the body of your mail.\n";
|
||||
$output = "<H3>Download</H3>\n";
|
||||
$output .= " <LI><A HREF=\"drupal/drupal-2.00.tgz\">drupal 2.00</A> (2001/03/15 - latest version)</LI>\n";
|
||||
$output .= " <LI>drupal 1.00 (2001/01/15)</LI>\n";
|
||||
$output .= "<H3>Documentation</H3>\n";
|
||||
$output .= " <LI><A HREF=\"module.php?mod=drupal+handbook\">drupal handbook</A></LI>\n";
|
||||
$output .= "<H3>Mailing lists</H3>\n";
|
||||
$output .= " <LI><A HREF=\"module.php?mod=mailing+lists\">mailing lists</A>";
|
||||
$output .= "<H3>Development</H3>\n";
|
||||
$output .= " <LI><A HREF=\"module.php?mod=development\">drupal development</A>\n";
|
||||
$theme->box("Support and development", $output);
|
||||
|
||||
$theme->footer();
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
# represent the mathematical calculation to be performed to
|
||||
# update a comment's value.
|
||||
$queue_votes = array("neutral (+0)" => "+ 0",
|
||||
"post it (+1)" => "+ 1",
|
||||
"dump it (-1)" => "- 1");
|
||||
"post it (+1)" => "+ 1",
|
||||
"dump it (-1)" => "- 1");
|
||||
|
||||
function queue_menu() {
|
||||
return array("<A HREF=\"module.php?mod=queue\">". t("moderation queue") ."</A> (<FONT COLOR=\"red\">". queue_count() ."</FONT>)");
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
include_once "includes/common.inc";
|
||||
|
||||
if (variable_get(dev_timing, 0)) timer_start();
|
||||
|
||||
$theme->header();
|
||||
|
||||
if ($user->id) {
|
||||
|
@ -30,4 +32,6 @@ else {
|
|||
|
||||
$theme->footer();
|
||||
|
||||
if (variable_get(dev_timing, 0)) timer_print();
|
||||
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue