- rewrote the block placement stuff and updated the themes.

IMPORTANT: you have to drop 2 tables "blocks" and "layout"
             and you have to recreate them again with those
             in database/database.mysql
- integrated the documentation written by UnConeD
3-00
Dries Buytaert 2001-01-13 16:33:19 +00:00
parent f9e5aa52cc
commit 8b4c95b259
12 changed files with 241 additions and 68 deletions

View File

@ -222,23 +222,16 @@ function account_content_edit() {
if ($user->id) {
$output .= "<FORM ACTION=\"account.php\" METHOD=\"post\">\n";
$output .= "<B>Blocks:</B><BR>\n";
$output .= "<B>Blocks in side bars:</B><BR>\n";
$result = db_query("SELECT * FROM blocks WHERE status = 1 ORDER BY module");
while ($block = db_fetch_object($result)) {
$entry = db_fetch_object(db_query("SELECT * FROM layout WHERE block = '$block->name' AND user = '$user->id'"));
$options = "";
for ($weight = 0; $weight < 10; $weight++) {
$options .= "<OPTION VALUE=\"$weight\"". (($entry->weight == $weight) ? " SELECTED" : "") .">". (($weight == 0) ? "off" : $weight) ."</OPTION>\n";
}
$output .= "<SELECT NAME=\"edit[$block->name]\">\n$options</SELECT>";
$output .= "$block->name<BR>";
$output .= "<INPUT TYPE=\"checkbox\" NAME=\"edit[$block->name]\"". ($entry->user ? " CHECKED" : "") ."> $block->name<BR>\n";
}
$output .= "<I>You can more or less position your blocks by assigning them weights. The heavy blocks will sink down whereas the light blocks will be positioned at the top of the page.</I><P>\n";
$output .= "<INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"Save content settings\"><BR>\n";
$output .= "<P><I>Enable the blocks you would like to see displayed in the side bars.</I></P>\n";
$output .= "<P><INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"Save content settings\"></P>\n";
$output .= "</FORM>\n";
$theme->header();
@ -257,8 +250,8 @@ function account_content_save($edit) {
global $user;
if ($user->id) {
db_query("DELETE FROM layout WHERE user = $user->id");
foreach ($edit as $block=>$weight) {
db_query("INSERT INTO layout (user, block, weight) VALUES ('". check_input($user->id) ."', '". check_input($block) ."', '". check_input($weight) ."')");
foreach (($edit ? $edit : array()) as $block=>$weight) {
db_query("INSERT INTO layout (user, block) VALUES ('". check_input($user->id) ."', '". check_input($block) ."')");
}
}
}

View File

@ -8,6 +8,16 @@ CREATE TABLE affiliates (
PRIMARY KEY (id)
);
CREATE TABLE blocks (
name varchar(64) DEFAULT '' NOT NULL,
module varchar(64) DEFAULT '' NOT NULL,
offset tinyint(2) DEFAULT '0' NOT NULL,
status tinyint(2) DEFAULT '0' NOT NULL,
weight tinyint(1) DEFAULT '0' NOT NULL,
region tinyint(1) DEFAULT '0' NOT NULL,
PRIMARY KEY (name)
);
CREATE TABLE boxes (
id tinyint(4) DEFAULT '0' NOT NULL auto_increment,
subject varchar(64) DEFAULT '' NOT NULL,
@ -30,13 +40,6 @@ CREATE TABLE bans (
PRIMARY KEY (id)
);
CREATE TABLE blocks (
name varchar(64) DEFAULT '' NOT NULL,
module varchar(64) DEFAULT '' NOT NULL,
offset tinyint(2) DEFAULT '0' NOT NULL,
status tinyint(2) DEFAULT '0' NOT NULL,
PRIMARY KEY (name)
);
CREATE TABLE channel (
id int(11) DEFAULT '0' NOT NULL auto_increment,
@ -100,8 +103,7 @@ CREATE TABLE headlines (
CREATE TABLE layout (
user int(11) DEFAULT '0' NOT NULL,
block varchar(64) DEFAULT '' NOT NULL,
weight int(11) DEFAULT '0' NOT NULL
block varchar(64) DEFAULT '' NOT NULL
);
CREATE TABLE modules (

View File

@ -58,7 +58,7 @@ function theme_account($theme) {
}
function theme_main_blocks($theme) {
function theme_blocks($region, $theme) {
global $id, $PHP_SELF, $user;
switch (strtok($PHP_SELF, ".")) {
@ -68,26 +68,13 @@ function theme_main_blocks($theme) {
else theme_new_headlines($theme);
break;
case "/index":
theme_account($theme);
$result = db_query("SELECT * FROM blocks WHERE status = 2");
if ($user->id) $result = db_query("SELECT * FROM blocks b LEFT JOIN layout l ON b.name = l.block WHERE (b.status = 2 OR (b.status AND l.user = '$user->id'))". (($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 ORDER BY weight");
while ($block = db_fetch_object($result)) {
$blocks = module_execute($block->module, "block");
$theme->box($blocks[$block->offset]["subject"], $blocks[$block->offset]["content"]);
}
break;
default:
theme_account($theme);
}
}
function theme_user_blocks($theme) {
global $PHP_SELF, $repository, $user;
if ($user->id && strstr($PHP_SELF, "index.php")) {
$result = db_query("SELECT * FROM layout l LEFT JOIN blocks b ON l.block = b.name WHERE l.user = '$user->id' AND l.weight > 0 AND b.status = '1' ORDER BY weight");
while ($block = db_fetch_object($result)) {
$blocks = module_execute($block->module, "block");
$theme->box($blocks[$block->offset]["subject"], $blocks[$block->offset]["content"]);
}
}
}

View File

@ -1,8 +1,17 @@
<?
$module = array("cron" => "account_cron",
$module = array("help" => "account_help",
"cron" => "account_cron",
"admin" => "account_admin");
function account_help() {
?>
<P>The account-module is responsible for maintaining the user database. It automatically handles tasks like registration, authentication, access rights, password retrieval, user settings and much more.</P>
<P>The required administration can be accomplished through the "account" interface of the administration section. From here administrators can get a quick overview of all registered users and view/edit specific accounts using the links provided. Some useful operations include blocking specific accounts (e.g. a troublesome user) and giving/taking administration permissions. Note that you should only give these permissions to people you trust!</P>
<P>Check the documentation page for detailed information about user management.</P>
<?
}
function account_cron() {
// clean-up user database
}
@ -173,10 +182,15 @@ function account_view($name) {
function account_admin() {
global $op, $edit, $order, $name;
print "<SMALL><A HREF=\"admin.php?mod=account\">overview</A> | <A HREF=\"admin.php?mod=account&op=help\">help</A></SMALL><HR>\n";
switch ($op) {
case "edit":
account_edit($name);
break;
case "help":
account_help();
break;
case "view":
account_view($name);
break;

View File

@ -1,8 +1,15 @@
<?
$module = array("block" => "affiliate_block",
$module = array("help" => "affiliate_help",
"block" => "affiliate_block",
"admin" => "affiliate_admin");
function affiliate_help() {
?>
<P>This is a small module to manage related and/or affiliate sites. The module exports 2 different blocks with links to the affiliate sites.</P>
<?
}
function affiliate_block() {
global $site_url;
@ -77,6 +84,8 @@ function affiliate_admin_display() {
function affiliate_admin() {
global $op, $id, $name, $link, $contact;
print "<SMALL><A HREF=\"admin.php?mod=affiliate-site\">overview</A> | <A HREF=\"admin.php?mod=affiliate-site&op=help\">help</A></SMALL><HR>\n";
switch($op) {
case "Add affiliate":
affiliate_admin_add($name, $link, $contact);
@ -86,6 +95,9 @@ function affiliate_admin() {
affiliate_admin_del($id);
affiliate_admin_display();
break;
case "help":
affiliate_help();
break;
default:
affiliate_admin_display();
}

View File

@ -1,10 +1,33 @@
<?
$module = array("admin" => "ban_admin");
$module = array("help" => "ban_help",
"admin" => "ban_admin");
include "includes/ban.inc";
function ban_help() {
?>
<P>The ban module keeps a list of bans in four categories:</P>
<UL>
<LI>E-mail bans: this type of ban specifies which email-addresses will be rejected when registering new users. Can be used to prevent users from using a free-mail account (e.g. hotmail.com).</LI>
<LI>Profanity bans: <I>under construction</I></LI>
<LI>Hostname bans: this type of ban allows you to block certain hostnames to access to your site or to register as a new user.</LI>
<LI>Username bans: this ban will block certain usernames from registration. Typical examples include <I>admin</I>, <I>anonymous</I>, <I>root</I>, <I>webmaster</I>, etc.</LI>
</UL>
<P>The ban system allows you to use a flexible wild-card ban system. This means you can block all email addresses from a certain domain name, block every username starting with "guest", etc. To do this, you can use the following wild-card characters:</P>
<UL>
<LI>&nbsp;% : matches any number of characters, including zero characters.</LI>
<LI>&nbsp;_ : matches exactly one character.</LI>
</UL>
<P><U>Examples</U>:</P>
<UL>
<LI>E-mail address bans <CODE>%@hotmail.com</CODE>, <CODE>%@altavista.%</CODE>, <CODE>%@usa.net</CODE>, etc. Used to prevent users from using free-email accounts, which might be used to cause trouble.</LI>
<LI>Username bans <CODE>root</CODE>, <CODE>webmaster</CODE>, <CODE>admin%</CODE>, etc. Used to prevent administrator impersonators.</LI>
</UL>
<?
}
function ban_admin_new($mask, $category, $reason) {
ban_add($mask, $category, $reason, &$message);
$output .= "$message\n";
@ -97,7 +120,7 @@ function ban_admin_check() {
function ban_admin() {
global $op, $id, $mask, $category, $reason;
print "<SMALL><A HREF=\"admin.php?mod=ban&op=add\">add ban</A> | <A HREF=\"admin.php?mod=ban&op=check\">check ban</A> | <A HREF=\"admin.php?mod=ban\">overview</A></SMALL><HR>\n";
print "<SMALL><A HREF=\"admin.php?mod=ban&op=add\">add ban</A> | <A HREF=\"admin.php?mod=ban&op=check\">check ban</A> | <A HREF=\"admin.php?mod=ban\">overview</A> | <A HREF=\"admin.php?mod=ban&op=help\">help</A></SMALL><HR>\n";
switch ($op) {
case "Add ban":
@ -110,6 +133,9 @@ function ban_admin() {
case "add":
ban_admin_add();
break;
case "help":
ban_help();
break;
case "check":
ban_admin_check();
break;

View File

@ -1,8 +1,18 @@
<?
$module = array("page" => "block_page",
"help" => "block_help",
"admin" => "block_admin");
function block_help() {
?>
<P>Blocks are the boxes visible in the side bars on the left and the right-hand side of the website. They are either exported by the engine or by any of the available modules. To really get your teeth in a drupal website, you are going to have to deal with blocks and administrating blocks in a fairly sophisticated fashion. This means you are going to have to be sensitive to the way the block placement strategy works.</P>
<P>The placement of blocks is delegated to the administrator but for most blocks, i.e. those called "custom blocks", the sole force behind enabling and disabling them is the user itself.</P>
<P>An administrator can lay out and arrange the available blocks to fit in two regions: "left" and "right". Regions simply contain blocks. In addition, an administrator can assign each block (within a region) a weight to sort them vertically. The heavy blocks will sink down whereas the light blocks will be positioned at the top.</P>
<P>As mentioned above, blocks can be arranged to fit in two regions: left and right. For theme builders, each region is identified by a corresponding constant: "left" and "right".</P>
<?
}
function block_page() {
global $theme;
@ -25,7 +35,7 @@ function block_page() {
function block_admin_save($edit) {
foreach ($edit as $key=>$value) {
db_query("UPDATE blocks SET status = '$value' WHERE name = '$key'");
db_query("UPDATE blocks SET region = '$value[region]', status = '$value[status]', weight = '$value[weight]' WHERE name = '$key'");
}
}
@ -37,20 +47,33 @@ function block_admin_display() {
// Generate output:
$output .= "<FORM ACTION=\"admin.php?mod=block\" METHOD=\"post\">\n";
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR><TH>block</TH><TH>module</TH><TH>status</TH></TR>\n";
$output .= " <TR><TH>block</TH><TH>module</TH><TH>status</TH><TH>weight</TH><TH>region</TH></TR>\n";
while ($block = db_fetch_object($result)) {
$module = ($repository[$block->module]["admin"]) ? "<A HREF=\"admin.php?mod=$block->module\">$block->module</A>" : $block->module;
$status .= "<SELECT NAME=\"edit[$block->name]\">\n";
$status .= "<SELECT NAME=\"edit[$block->name][status]\">\n";
$status .= " <OPTION VALUE=\"2\"". (($block->status == 2) ? " SELECTED" : "") .">enabled: always</OPTION>\n";
$status .= " <OPTION VALUE=\"1\"". (($block->status == 1) ? " SELECTED" : "") .">enabled: custom</OPTION>\n";
$status .= " <OPTION VALUE=\"0\"". (($block->status == 0) ? " SELECTED" : "") .">disabled</OPTION>\n";
$status .= "</SELECT>\n";
$output .= " <TR><TD>". $block->name ."</TD><TD ALIGN=\"center\">$module</TD><TD>$status</TD></TR>\n";
$weight .= "<SELECT NAME=\"edit[$block->name][weight]\">\n";
for ($count = 0; $count < 10; $count++) {
$weight .= "<OPTION VALUE=\"$count\"". (($block->weight == $count) ? " SELECTED" : "") .">$count</OPTION>\n";
}
$weight .= "</SELECT>\n";
$region .= "<SELECT NAME=\"edit[$block->name][region]\">\n";
$region .= " <OPTION VALUE=\"0\"". (($block->region == 0) ? " SELECTED" : "") .">left</OPTION>\n";
$region .= " <OPTION VALUE=\"1\"". (($block->region == 1) ? " SELECTED" : "") .">right</OPTION>\n";
$region .= "</SELECT>\n";
$output .= " <TR><TD>". $block->name ."</TD><TD ALIGN=\"center\">$module</TD><TD>$status</TD><TD>$weight</TD><TD>$region</TD></TR>\n";
unset($status);
unset($weight);
unset($region);
}
$output .= "</TABLE>\n";
@ -60,16 +83,67 @@ function block_admin_display() {
print $output;
}
function block_admin_overview() {
global $site_name;
$result = db_query("SELECT * FROM blocks WHERE status > 0 AND region = 0 ORDER BY weight");
$lblocks .= "<TABLE BORDER=\"0\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
while ($block = db_fetch_object($result)) $lblocks .= " <TR><TD NOWRAP>". ($block->status == 2 ? "<B>$block->name</B>" : $block->name) ."</TD><TD>$block->weight</TD></TR>\n";
$lblocks .= "</TABLE>\n";
$result = db_query("SELECT * FROM blocks WHERE status > 0 AND region = 1 ORDER BY weight");
$rblocks .= "<TABLE BORDER=\"0\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
while ($block = db_fetch_object($result)) $rblocks .= " <TR><TD NOWRAP>". ($block->status == 2 ? "<B>$block->name</B>" : $block->name) ."</TD><TD>$block->weight</TD></TR>\n";
$rblocks .= "</TABLE>\n";
$output .= "<P><B>layout 1:</B></P>\n";
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR><TD ALIGN=\"center\" COLSPAN=\"3\">$site_name header</TD></TR>\n";
$output .= " <TR><TD>\n". ($lblocks ? $lblocks : "&nbsp;") ."</TD><TD WIDTH=\"300\">&nbsp;</TD><TD>\n". ($rblocks ? $rblocks : "&nbsp;") ."</TD></TR>\n";
$output .= " <TR><TD ALIGN=\"center\" COLSPAN=\"3\">$site_name footer</TD></TR>\n";
$output .= "</TABLE>\n";
$result = db_query("SELECT * FROM blocks WHERE status > 0 ORDER BY weight");
$blocks .= "<TABLE BORDER=\"0\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
while ($block = db_fetch_object($result)) $blocks .= " <TR><TD NOWRAP>". ($block->status == 2 ? "<B>$block->name</B>" : $block->name) ."</TD><TD>$block->weight</TD></TR>\n";
$blocks .= "</TABLE>\n";
$output .= "<P><B>layout 2:</B></P>\n";
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR><TD ALIGN=\"center\" COLSPAN=\"2\">$site_name header</TD></TR>\n";
$output .= " <TR><TD WIDTH=\"400\">&nbsp;</TD><TD>\n". ($blocks ? $blocks : "&nbsp;") ."</TD></TR>\n";
$output .= " <TR><TD ALIGN=\"center\" COLSPAN=\"2\">$site_name footer</TD></TR>\n";
$output .= "</TABLE>\n";
$output .= "<P><B>layout 3:</B></P>\n";
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR><TD ALIGN=\"center\" COLSPAN=\"2\">$site_name header</TD></TR>\n";
$output .= " <TR><TD>\n". ($blocks ? $blocks : "&nbsp;") ."</TD><TD WIDTH=\"400\">&nbsp;</TD></TR>\n";
$output .= " <TR><TD ALIGN=\"center\" COLSPAN=\"2\">$site_name footer</TD></TR>\n";
$output .= "</TABLE>\n";
print $output;
}
function block_admin() {
global $op, $edit;
print "<SMALL><A HREF=\"admin.php?mod=block\">configure</A> | <A HREF=\"admin.php?mod=block&op=overview\">overview</A> | <A HREF=\"admin.php?mod=block&op=help\">help</A></SMALL><HR>\n";
switch ($op) {
case "help":
block_help();
break;
case "overview":
block_admin_overview();
break;
case "Save blocks":
block_admin_save($edit);
break;
// fall through
default:
block_admin_display();
}
block_admin_display();
}
?>

View File

@ -1,8 +1,18 @@
<?
$module = array("page" => "block_page",
"help" => "block_help",
"admin" => "block_admin");
function block_help() {
?>
<P>Blocks are the boxes visible in the side bars on the left and the right-hand side of the website. They are either exported by the engine or by any of the available modules. To really get your teeth in a drupal website, you are going to have to deal with blocks and administrating blocks in a fairly sophisticated fashion. This means you are going to have to be sensitive to the way the block placement strategy works.</P>
<P>The placement of blocks is delegated to the administrator but for most blocks, i.e. those called "custom blocks", the sole force behind enabling and disabling them is the user itself.</P>
<P>An administrator can lay out and arrange the available blocks to fit in two regions: "left" and "right". Regions simply contain blocks. In addition, an administrator can assign each block (within a region) a weight to sort them vertically. The heavy blocks will sink down whereas the light blocks will be positioned at the top.</P>
<P>As mentioned above, blocks can be arranged to fit in two regions: left and right. For theme builders, each region is identified by a corresponding constant: "left" and "right".</P>
<?
}
function block_page() {
global $theme;
@ -25,7 +35,7 @@ function block_page() {
function block_admin_save($edit) {
foreach ($edit as $key=>$value) {
db_query("UPDATE blocks SET status = '$value' WHERE name = '$key'");
db_query("UPDATE blocks SET region = '$value[region]', status = '$value[status]', weight = '$value[weight]' WHERE name = '$key'");
}
}
@ -37,20 +47,33 @@ function block_admin_display() {
// Generate output:
$output .= "<FORM ACTION=\"admin.php?mod=block\" METHOD=\"post\">\n";
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR><TH>block</TH><TH>module</TH><TH>status</TH></TR>\n";
$output .= " <TR><TH>block</TH><TH>module</TH><TH>status</TH><TH>weight</TH><TH>region</TH></TR>\n";
while ($block = db_fetch_object($result)) {
$module = ($repository[$block->module]["admin"]) ? "<A HREF=\"admin.php?mod=$block->module\">$block->module</A>" : $block->module;
$status .= "<SELECT NAME=\"edit[$block->name]\">\n";
$status .= "<SELECT NAME=\"edit[$block->name][status]\">\n";
$status .= " <OPTION VALUE=\"2\"". (($block->status == 2) ? " SELECTED" : "") .">enabled: always</OPTION>\n";
$status .= " <OPTION VALUE=\"1\"". (($block->status == 1) ? " SELECTED" : "") .">enabled: custom</OPTION>\n";
$status .= " <OPTION VALUE=\"0\"". (($block->status == 0) ? " SELECTED" : "") .">disabled</OPTION>\n";
$status .= "</SELECT>\n";
$output .= " <TR><TD>". $block->name ."</TD><TD ALIGN=\"center\">$module</TD><TD>$status</TD></TR>\n";
$weight .= "<SELECT NAME=\"edit[$block->name][weight]\">\n";
for ($count = 0; $count < 10; $count++) {
$weight .= "<OPTION VALUE=\"$count\"". (($block->weight == $count) ? " SELECTED" : "") .">$count</OPTION>\n";
}
$weight .= "</SELECT>\n";
$region .= "<SELECT NAME=\"edit[$block->name][region]\">\n";
$region .= " <OPTION VALUE=\"0\"". (($block->region == 0) ? " SELECTED" : "") .">left</OPTION>\n";
$region .= " <OPTION VALUE=\"1\"". (($block->region == 1) ? " SELECTED" : "") .">right</OPTION>\n";
$region .= "</SELECT>\n";
$output .= " <TR><TD>". $block->name ."</TD><TD ALIGN=\"center\">$module</TD><TD>$status</TD><TD>$weight</TD><TD>$region</TD></TR>\n";
unset($status);
unset($weight);
unset($region);
}
$output .= "</TABLE>\n";
@ -60,16 +83,67 @@ function block_admin_display() {
print $output;
}
function block_admin_overview() {
global $site_name;
$result = db_query("SELECT * FROM blocks WHERE status > 0 AND region = 0 ORDER BY weight");
$lblocks .= "<TABLE BORDER=\"0\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
while ($block = db_fetch_object($result)) $lblocks .= " <TR><TD NOWRAP>". ($block->status == 2 ? "<B>$block->name</B>" : $block->name) ."</TD><TD>$block->weight</TD></TR>\n";
$lblocks .= "</TABLE>\n";
$result = db_query("SELECT * FROM blocks WHERE status > 0 AND region = 1 ORDER BY weight");
$rblocks .= "<TABLE BORDER=\"0\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
while ($block = db_fetch_object($result)) $rblocks .= " <TR><TD NOWRAP>". ($block->status == 2 ? "<B>$block->name</B>" : $block->name) ."</TD><TD>$block->weight</TD></TR>\n";
$rblocks .= "</TABLE>\n";
$output .= "<P><B>layout 1:</B></P>\n";
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR><TD ALIGN=\"center\" COLSPAN=\"3\">$site_name header</TD></TR>\n";
$output .= " <TR><TD>\n". ($lblocks ? $lblocks : "&nbsp;") ."</TD><TD WIDTH=\"300\">&nbsp;</TD><TD>\n". ($rblocks ? $rblocks : "&nbsp;") ."</TD></TR>\n";
$output .= " <TR><TD ALIGN=\"center\" COLSPAN=\"3\">$site_name footer</TD></TR>\n";
$output .= "</TABLE>\n";
$result = db_query("SELECT * FROM blocks WHERE status > 0 ORDER BY weight");
$blocks .= "<TABLE BORDER=\"0\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
while ($block = db_fetch_object($result)) $blocks .= " <TR><TD NOWRAP>". ($block->status == 2 ? "<B>$block->name</B>" : $block->name) ."</TD><TD>$block->weight</TD></TR>\n";
$blocks .= "</TABLE>\n";
$output .= "<P><B>layout 2:</B></P>\n";
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR><TD ALIGN=\"center\" COLSPAN=\"2\">$site_name header</TD></TR>\n";
$output .= " <TR><TD WIDTH=\"400\">&nbsp;</TD><TD>\n". ($blocks ? $blocks : "&nbsp;") ."</TD></TR>\n";
$output .= " <TR><TD ALIGN=\"center\" COLSPAN=\"2\">$site_name footer</TD></TR>\n";
$output .= "</TABLE>\n";
$output .= "<P><B>layout 3:</B></P>\n";
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR><TD ALIGN=\"center\" COLSPAN=\"2\">$site_name header</TD></TR>\n";
$output .= " <TR><TD>\n". ($blocks ? $blocks : "&nbsp;") ."</TD><TD WIDTH=\"400\">&nbsp;</TD></TR>\n";
$output .= " <TR><TD ALIGN=\"center\" COLSPAN=\"2\">$site_name footer</TD></TR>\n";
$output .= "</TABLE>\n";
print $output;
}
function block_admin() {
global $op, $edit;
print "<SMALL><A HREF=\"admin.php?mod=block\">configure</A> | <A HREF=\"admin.php?mod=block&op=overview\">overview</A> | <A HREF=\"admin.php?mod=block&op=help\">help</A></SMALL><HR>\n";
switch ($op) {
case "help":
block_help();
break;
case "overview":
block_admin_overview();
break;
case "Save blocks":
block_admin_save($edit);
break;
// fall through
default:
block_admin_display();
}
block_admin_display();
}
?>

View File

@ -7,7 +7,7 @@ function cron_help() {
?>
<P>Cron (which stands for chronograph) is a periodic command scheduler: it executes commands at intervals specified in seconds. It can be used to control the execution of daily, weekly and monthly jobs (or anything with a period of n seconds). Automating tasks is one of the best ways to keep a system running smoothly, and if most of your administration does not require your direct involvement, cron is an ideal solution.</P>
<P>Note that cron does not guarantee that the commands will be executed at the specified interval. However, the engine will make sure that the commands are run at the specified intervals as closely as possible.</P>
<P>Check the <A HREF="admin.php?mod=documentation">documentation</A> for more information about cron and how to setup it correctly.</P>
<P>Check the documentation page for more information about cron and how to setup it correctly.</P>
<?
}

View File

@ -90,9 +90,6 @@ function documentation() {
<P>While we in no way consider the design and implementation of the drupal engine to be finished, we feel that our own accompanying intensive experience has given us a fairly stable and well-proven design. The following provides a brief over-view of the different aspects of drupal's core engine and features.</P>
<H2>Blocks</H2>
<P>Blocks are the side-boxes of the site that provide the main interface to the engine. They can be fully customized by an administrator to suit his or her needs. (Full documentation still under construction)</P>
<H2>Cron</H2>
<P>Cron (which stands for chronograph) is a periodic command scheduler: it executes commands at intervals specified in seconds. It can be used to control the execution of daily, weekly and monthly jobs (or anything with a period of n seconds). Automating tasks is one of the best ways to keep a system running smoothly, and if most of your administration does not require your direct involvement, cron is an ideal solution.</P>

View File

@ -221,11 +221,8 @@
</TD>
<TD VALIGN="top">
<?
// Display main blocks:
theme_main_blocks($this);
// Display user-defined blocks:
theme_user_blocks($this);
theme_account($this);
theme_blocks("left", $this);
?>
</TD>
</TR>

View File

@ -282,11 +282,8 @@
</TD>
<TD VALIGN="top" WIDTH="185">
<?
// Display main blocks:
theme_main_blocks($this);
// Display user-defined blocks:
theme_user_blocks($this);
theme_account($this);
theme_blocks("all", $this);
?>
</TD>
</TR>