uid) { // Display account settings: foreach (module_list() as $name) { if (module_hook($name, "link")) { $links = module_invoke($name, "link", "menu"); foreach ($links as $link) $content .= "$link
\n"; } } if (user_access("access administration pages")) { $content .= "
\n"; $content .= "". strtr(t("administer %a"), array("%a" => variable_get("site_name", "drupal"))) ."
\n"; } $theme->box($user->name, $content, $region); } else { $output .= "
\n"; $output .= "
\n"; $output .= " ". t("Username") .":

\n"; $output .= " ". t("Password") .":

\n"; $output .= "
\n"; if (variable_get("account_register", 1)) $output .= " ". t("REGISTER") ."\n"; $output .= "

\n"; $output .= "
\n"; $theme->box(t("Log in"), $output, $region); } } function comment_controls($threshold = 1, $mode = 3, $order = 1) { global $user, $id; if ($user->uid) { $output .= form_item(t("Node rating"), node_moderation($id) ." ", t("Nodes and comments can be moderated by assigning them a score: content with a high rating is made more visible.")); } $output .= form_item(t("Comment viewing options"), comment_mode($mode) . comment_order($order) . comment_threshold($threshold) ." ", t("Select your prefered way to display the comments and click 'Update settings' to active your changes.")); if (user_access("post comment")) { $output .= form_item(t("Add a comment"), "", t("Click 'Add comment' to start a new thread in the discussion.")); } return $output; } function comment($comment, $link = 0) { $output .= "cid\">"; $output .= "
"; $output .= ""; $output .= " "; $output .= " "; $output .= " "; $output .= " "; $output .= "
". check_output($comment->subject) ."
". comment_moderation($comment) ."
". sprintf(t("by %s on %s"), format_name($comment), format_date($comment->timestamp)) ."
". check_output($comment->comment, 1) ."
$link
"; $output .= "

"; print $output; } } function theme_init() { global $user, $themes; if ($user->theme && file_exists($themes[$user->theme][0])) { include_once $themes[$user->theme][0]; } else { include_once $themes[variable_get("theme_default", key($themes))][0]; } return new Theme(); } function theme_blocks($region, $theme) { global $id, $PHP_SELF, $user; switch (strrchr($PHP_SELF, "/")) { case "/node.php": if ($region != "left") { if ($user->uid) $node = db_fetch_object(db_query("SELECT * FROM node WHERE nid = '$id'")); if ($node->status == node_status("queued")) theme_moderation_results($theme, $node, $region); } break; case "/index.php": if ($user->uid) $result = db_query("SELECT * FROM blocks b LEFT JOIN layout l ON b.name = l.block WHERE (b.status = 2 OR (b.status = 1 AND l.user = '$user->uid'))". (($region == "left" || $region == "right") ? ($region == "left" ? " AND b.region = 0" : " AND b.region = 1") : "") ." ORDER BY weight"); else $result = db_query("SELECT * FROM blocks WHERE status = 2". (($region == "left" || $region == "right") ? ($region == "left" ? " AND region = 0" : " AND region = 1") : "") ." ORDER BY weight"); while ($block = db_fetch_object($result)) { $blocks = module_invoke($block->module, "block"); if ($blocks[$block->offset]["content"]) $theme->box(t($blocks[$block->offset]["subject"]), $blocks[$block->offset]["content"], $region); } break; } } function theme_moderation_results($theme, $node, $region) { foreach (explode(",", $node->users) as $vote) { if ($vote) { $data = explode("=", $vote); $account = user_load(array("uid" => $data[0])); $output .= format_name($account) ." voted '$data[1]'.
"; } } $theme->box(t("Moderation results"), ($output ? $output : t("This node has not been moderated yet.")), $region); } ?>