From 8c672011a267d193fa47cd7cbb523e90a643ee32 Mon Sep 17 00:00:00 2001 From: Kjartan Mannes <kjartan@2.no-reply.drupal.org> Date: Mon, 21 Jan 2002 17:31:13 +0000 Subject: [PATCH] - moved user block from theme.inc to user.module. * only problem is that the admin.php link is not available until the admin enables the block. * $theme->user is obsolete, will patch the themes properly in a later patch. - moved moderation block from theme.inc to queue.module. * removed theme_moderation_results(). - updated database/database.mysql. --- database/database.mysql | 667 +++++++++++++++++++-------------------- includes/theme.inc | 72 +---- modules/queue.module | 29 ++ modules/user.module | 45 +++ modules/user/user.module | 45 +++ 5 files changed, 446 insertions(+), 412 deletions(-) diff --git a/database/database.mysql b/database/database.mysql index 959c80010e79..7acdb36ac82c 100644 --- a/database/database.mysql +++ b/database/database.mysql @@ -1,296 +1,226 @@ -# MySQL dump 7.1 +# MySQL dump 8.14 # -# Host: localhost Database: drop +# Host: localhost Database: drupal #-------------------------------------------------------- -# Server version 3.22.32 +# Server version 3.23.38 # # Table structure for table 'access' # + CREATE TABLE access ( - id tinyint(10) DEFAULT '0' NOT NULL auto_increment, - mask varchar(255) DEFAULT '' NOT NULL, - type varchar(16) DEFAULT '' NOT NULL, - reason text NOT NULL, - UNIQUE mask (mask), - PRIMARY KEY (id) -); + aid tinyint(10) NOT NULL auto_increment, + mask varchar(255) NOT NULL default '', + type varchar(255) NOT NULL default '', + status tinyint(2) NOT NULL default '0', + PRIMARY KEY (aid), + UNIQUE KEY mask (mask) +) TYPE=MyISAM; + +# +# Table structure for table 'authmap' +# + +CREATE TABLE authmap ( + aid int(10) unsigned NOT NULL auto_increment, + uid int(10) NOT NULL default '0', + authname varchar(128) NOT NULL default '', + module varchar(128) NOT NULL default '', + PRIMARY KEY (aid), + UNIQUE KEY authname (authname) +) TYPE=MyISAM; # # Table structure for table 'blocks' # + 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, - remove tinyint(1) DEFAULT '0' NOT NULL, - PRIMARY KEY (name) -); - -# -# Table structure for table 'blog' -# -CREATE TABLE blog ( - lid int(10) unsigned DEFAULT '0' NOT NULL auto_increment, - nid int(10) unsigned DEFAULT '0' NOT NULL, - body text NOT NULL, - PRIMARY KEY (lid) -); + name varchar(64) NOT NULL default '', + module varchar(64) NOT NULL default '', + delta tinyint(2) NOT NULL default '0', + status tinyint(2) NOT NULL default '0', + weight tinyint(1) NOT NULL default '0', + region tinyint(1) NOT NULL default '0', + remove tinyint(1) NOT NULL default '0', + path varchar(255) NOT NULL default '', + PRIMARY KEY (name) +) TYPE=MyISAM; # # Table structure for table 'book' # + CREATE TABLE book ( - lid int(10) unsigned DEFAULT '0' NOT NULL auto_increment, - nid int(10) unsigned DEFAULT '0' NOT NULL, - body text NOT NULL, - section int(10) DEFAULT '0' NOT NULL, - parent int(10) DEFAULT '0' NOT NULL, - weight tinyint(3) DEFAULT '0' NOT NULL, - pid int(10) DEFAULT '0' NOT NULL, - log text NOT NULL, - PRIMARY KEY (lid) -); + nid int(10) unsigned NOT NULL default '0', + parent int(10) NOT NULL default '0', + weight tinyint(3) NOT NULL default '0', + format tinyint(2) default '0', + PRIMARY KEY (nid), + KEY nid (nid) +) TYPE=MyISAM; # # Table structure for table 'boxes' # + CREATE TABLE boxes ( - bid tinyint(4) DEFAULT '0' NOT NULL auto_increment, - title varchar(64) DEFAULT '' NOT NULL, + bid tinyint(4) NOT NULL auto_increment, + title varchar(64) NOT NULL default '', body text, - info varchar(128) DEFAULT '' NOT NULL, - link varchar(128) DEFAULT '' NOT NULL, - type tinyint(2) DEFAULT '0' NOT NULL, - UNIQUE subject (title), - UNIQUE info (info), - PRIMARY KEY (bid) -); + info varchar(128) NOT NULL default '', + type tinyint(2) NOT NULL default '0', + PRIMARY KEY (bid), + UNIQUE KEY info (info), + UNIQUE KEY subject (title) +) TYPE=MyISAM; # # Table structure for table 'bundle' # + CREATE TABLE bundle ( - bid int(11) DEFAULT '0' NOT NULL auto_increment, - title varchar(255) DEFAULT '' NOT NULL, - attributes varchar(255) DEFAULT '' NOT NULL, - UNIQUE title (title), - PRIMARY KEY (bid) -); + bid int(10) NOT NULL auto_increment, + title varchar(255) NOT NULL default '', + attributes varchar(255) NOT NULL default '', + PRIMARY KEY (bid), + UNIQUE KEY title (title) +) TYPE=MyISAM; # # Table structure for table 'cache' # + CREATE TABLE cache ( - url varchar(255) DEFAULT '' NOT NULL, + cid varchar(255) NOT NULL default '', data text NOT NULL, - timestamp int(11) DEFAULT '0' NOT NULL, - PRIMARY KEY (url) -); - -# -# Table structure for table 'category' -# -CREATE TABLE category ( - cid int(10) unsigned DEFAULT '0' NOT NULL auto_increment, - name varchar(32) DEFAULT '' NOT NULL, - type varchar(16) DEFAULT '' NOT NULL, - post int(3) DEFAULT '0' NOT NULL, - dump int(3) DEFAULT '0' NOT NULL, - expire int(3) DEFAULT '0' NOT NULL, - comment int(2) unsigned DEFAULT '0' NOT NULL, - submission int(2) unsigned DEFAULT '0' NOT NULL, - promote int(2) unsigned DEFAULT '0' NOT NULL, - UNIQUE name (name), - PRIMARY KEY (cid) -); - -# -# Table structure for table 'channel' -# -CREATE TABLE channel ( - id int(11) DEFAULT '0' NOT NULL auto_increment, - site varchar(255) DEFAULT '' NOT NULL, - file varchar(255) DEFAULT '' NOT NULL, - url varchar(255) DEFAULT '' NOT NULL, - contact varchar(255) DEFAULT '', - timestamp int(11), - UNIQUE site (site), - UNIQUE file (file), - UNIQUE url (url), - PRIMARY KEY (id) -); - -# -# Table structure for table 'chatevents' -# -CREATE TABLE chatevents ( - id int(11) DEFAULT '0' NOT NULL auto_increment, - body varchar(255) DEFAULT '' NOT NULL, - timestamp int(11) DEFAULT '0' NOT NULL, - PRIMARY KEY (id) -); - -# -# Table structure for table 'chatmembers' -# -CREATE TABLE chatmembers ( - id int(11) DEFAULT '0' NOT NULL auto_increment, - nick varchar(32) DEFAULT '' NOT NULL, - timestamp int(11) DEFAULT '0' NOT NULL, - PRIMARY KEY (id) -); + expire int(11) NOT NULL default '0', + PRIMARY KEY (cid) +) TYPE=MyISAM; # # Table structure for table 'collection' # + CREATE TABLE collection ( - cid int(10) unsigned DEFAULT '0' NOT NULL auto_increment, - name varchar(32) DEFAULT '' NOT NULL, - types varchar(128) DEFAULT '' NOT NULL, - UNIQUE name (name), - PRIMARY KEY (cid) -); + cid int(10) unsigned NOT NULL auto_increment, + name varchar(32) NOT NULL default '', + types varchar(128) NOT NULL default '', + PRIMARY KEY (cid), + UNIQUE KEY name (name) +) TYPE=MyISAM; # # Table structure for table 'comments' # + CREATE TABLE comments ( - cid int(6) DEFAULT '0' NOT NULL auto_increment, - pid int(6) DEFAULT '0' NOT NULL, - lid int(6) DEFAULT '0' NOT NULL, - author int(6) DEFAULT '0' NOT NULL, - subject varchar(64) DEFAULT '' NOT NULL, + cid int(10) NOT NULL auto_increment, + pid int(10) NOT NULL default '0', + nid int(10) NOT NULL default '0', + uid int(10) NOT NULL default '0', + subject varchar(64) NOT NULL default '', comment text NOT NULL, - hostname varchar(128) DEFAULT '' NOT NULL, - timestamp int(11) DEFAULT '0' NOT NULL, - score int(6) DEFAULT '0' NOT NULL, - votes int(6) DEFAULT '0' NOT NULL, - link varchar(16) DEFAULT '' NOT NULL, - users text NOT NULL, - PRIMARY KEY (cid), - KEY lid (lid) -); + hostname varchar(128) NOT NULL default '', + timestamp int(11) NOT NULL default '0', + link varchar(16) NOT NULL default '', + PRIMARY KEY (cid), + KEY lid (nid) +) TYPE=MyISAM; # # Table structure for table 'cvs' # + CREATE TABLE cvs ( - user varchar(32) DEFAULT '' NOT NULL, + user varchar(32) NOT NULL default '', files text, - status int(2) DEFAULT '0' NOT NULL, + status int(2) NOT NULL default '0', message text, - timestamp int(11) DEFAULT '0' NOT NULL -); - -# -# Table structure for table 'diaries' -# -CREATE TABLE diaries ( - id int(5) DEFAULT '0' NOT NULL auto_increment, - author int(6) DEFAULT '0' NOT NULL, - text text, - timestamp int(11) DEFAULT '0' NOT NULL, - PRIMARY KEY (id) -); + timestamp int(11) NOT NULL default '0' +) TYPE=MyISAM; # -# Table structure for table 'diary' +# Table structure for table 'directory' # -CREATE TABLE diary ( - lid int(10) unsigned DEFAULT '0' NOT NULL auto_increment, - nid int(10) unsigned DEFAULT '0' NOT NULL, - body text NOT NULL, - PRIMARY KEY (lid) -); -# -# Table structure for table 'entry' -# -CREATE TABLE entry ( - eid int(10) unsigned DEFAULT '0' NOT NULL auto_increment, - name varchar(32) DEFAULT '' NOT NULL, - attributes varchar(255) DEFAULT '' NOT NULL, - collection varchar(32) DEFAULT '' NOT NULL, - UNIQUE name (name,collection), - PRIMARY KEY (eid) -); +CREATE TABLE directory ( + link varchar(255) NOT NULL default '', + name varchar(128) NOT NULL default '', + mail varchar(128) NOT NULL default '', + slogan text NOT NULL, + mission text NOT NULL, + timestamp int(11) NOT NULL default '0', + PRIMARY KEY (link) +) TYPE=MyISAM; # # Table structure for table 'feed' # + CREATE TABLE feed ( - fid int(11) DEFAULT '0' NOT NULL auto_increment, - title varchar(255) DEFAULT '' NOT NULL, - url varchar(255) DEFAULT '' NOT NULL, - refresh int(11), - uncache int(11), - timestamp int(11), - attributes varchar(255) DEFAULT '' NOT NULL, - link varchar(255) DEFAULT '' NOT NULL, + fid int(10) NOT NULL auto_increment, + title varchar(255) NOT NULL default '', + url varchar(255) NOT NULL default '', + refresh int(11) default NULL, + timestamp int(11) default NULL, + attributes varchar(255) NOT NULL default '', + link varchar(255) NOT NULL default '', description text NOT NULL, - UNIQUE title (title), - UNIQUE link (url), - PRIMARY KEY (fid) -); + PRIMARY KEY (fid), + UNIQUE KEY title (title), + UNIQUE KEY link (url) +) TYPE=MyISAM; # # Table structure for table 'file' # + CREATE TABLE file ( - lid int(10) unsigned DEFAULT '0' NOT NULL auto_increment, - nid int(10) unsigned DEFAULT '0' NOT NULL, - version varchar(10) DEFAULT '' NOT NULL, - url varchar(255) DEFAULT '' NOT NULL, - downloads int(10) unsigned DEFAULT '0' NOT NULL, + lid int(10) unsigned NOT NULL auto_increment, + nid int(10) unsigned NOT NULL default '0', + version varchar(10) NOT NULL default '', + url varchar(255) NOT NULL default '', + downloads int(10) unsigned NOT NULL default '0', abstract text NOT NULL, description text NOT NULL, - homepage varchar(255) DEFAULT '' NOT NULL, - PRIMARY KEY (lid) -); + homepage varchar(255) NOT NULL default '', + PRIMARY KEY (lid) +) TYPE=MyISAM; # -# Table structure for table 'forum' +# Table structure for table 'history' # -CREATE TABLE forum ( - lid int(10) unsigned DEFAULT '0' NOT NULL auto_increment, - nid int(10) unsigned DEFAULT '0' NOT NULL, - body text NOT NULL, - PRIMARY KEY (lid) -); + +CREATE TABLE history ( + uid int(10) NOT NULL default '0', + nid int(10) NOT NULL default '0', + timestamp int(11) NOT NULL default '0', + PRIMARY KEY (uid,nid) +) TYPE=MyISAM; # # Table structure for table 'item' # + CREATE TABLE item ( - iid int(11) DEFAULT '0' NOT NULL auto_increment, - fid int(11) DEFAULT '0' NOT NULL, - title varchar(255) DEFAULT '' NOT NULL, - link varchar(255) DEFAULT '' NOT NULL, - author varchar(255) DEFAULT '' NOT NULL, + iid int(10) NOT NULL auto_increment, + fid int(10) NOT NULL default '0', + title varchar(255) NOT NULL default '', + link varchar(255) NOT NULL default '', + author varchar(255) NOT NULL default '', description text NOT NULL, - timestamp int(11), - attributes varchar(255) DEFAULT '' NOT NULL, - PRIMARY KEY (iid) -); - -# -# Table structure for table 'layout' -# -CREATE TABLE layout ( - user int(11) DEFAULT '0' NOT NULL, - block varchar(64) DEFAULT '' NOT NULL -); + timestamp int(11) default NULL, + attributes varchar(255) NOT NULL default '', + PRIMARY KEY (iid) +) TYPE=MyISAM; # # Table structure for table 'locales' # + CREATE TABLE locales ( - id int(11) DEFAULT '0' NOT NULL auto_increment, - location varchar(128) DEFAULT '' NOT NULL, + lid int(10) NOT NULL auto_increment, + location varchar(128) NOT NULL default '', string text NOT NULL, da text NOT NULL, fi text NOT NULL, @@ -300,213 +230,252 @@ CREATE TABLE locales ( nl text NOT NULL, no text NOT NULL, sw text NOT NULL, - PRIMARY KEY (id) -); + PRIMARY KEY (lid) +) TYPE=MyISAM; + +# +# Table structure for table 'moderate' +# + +CREATE TABLE moderate ( + cid int(10) NOT NULL default '0', + nid int(10) NOT NULL default '0', + uid int(10) NOT NULL default '0', + score int(2) NOT NULL default '0', + timestamp int(11) NOT NULL default '0', + KEY cid (cid), + KEY nid (nid) +) TYPE=MyISAM; # # Table structure for table 'modules' # + CREATE TABLE modules ( - name varchar(64) DEFAULT '' NOT NULL, - PRIMARY KEY (name) -); + name varchar(64) NOT NULL default '', + PRIMARY KEY (name) +) TYPE=MyISAM; # # Table structure for table 'node' # + CREATE TABLE node ( - nid int(10) unsigned DEFAULT '0' NOT NULL auto_increment, - lid int(10) DEFAULT '0' NOT NULL, - type varchar(16) DEFAULT '' NOT NULL, - title varchar(128) DEFAULT '' NOT NULL, - score int(11) DEFAULT '0' NOT NULL, - votes int(11) DEFAULT '0' NOT NULL, - author int(6) DEFAULT '0' NOT NULL, - status int(4) DEFAULT '1' NOT NULL, - timestamp int(11) DEFAULT '0' NOT NULL, - comment int(2) DEFAULT '1' NOT NULL, - promote int(2) DEFAULT '1' NOT NULL, - moderate text NOT NULL, + nid int(10) unsigned NOT NULL auto_increment, + type varchar(16) NOT NULL default '', + title varchar(128) NOT NULL default '', + score int(11) NOT NULL default '0', + votes int(11) NOT NULL default '0', + uid int(10) NOT NULL default '0', + status int(4) NOT NULL default '1', + created int(11) NOT NULL default '0', + comment int(2) NOT NULL default '0', + promote int(2) NOT NULL default '0', + moderate int(2) NOT NULL default '0', users text NOT NULL, - timestamp_posted int(11) DEFAULT '0' NOT NULL, - timestamp_queued int(11) DEFAULT '0' NOT NULL, - timestamp_hidden int(11) DEFAULT '0' NOT NULL, - attributes varchar(255) DEFAULT '' NOT NULL, - KEY type (lid,type), - KEY author (author), + attributes varchar(255) NOT NULL default '', + teaser text NOT NULL, + body text NOT NULL, + changed int(11) NOT NULL default '0', + revisions text NOT NULL, + PRIMARY KEY (nid), + KEY type (type), KEY title (title,type), - PRIMARY KEY (nid), KEY promote (promote), - KEY status (status) -); + KEY status (status), + KEY uid (uid) +) TYPE=MyISAM; # # Table structure for table 'page' # + CREATE TABLE page ( - lid int(10) unsigned DEFAULT '0' NOT NULL auto_increment, - nid int(10) unsigned DEFAULT '0' NOT NULL, - link varchar(128) DEFAULT '' NOT NULL, - body text NOT NULL, - format tinyint(2) DEFAULT '0' NOT NULL, - PRIMARY KEY (lid) -); + nid int(10) unsigned NOT NULL default '0', + link varchar(128) NOT NULL default '', + format tinyint(2) NOT NULL default '0', + PRIMARY KEY (nid), + KEY nid (nid) +) TYPE=MyISAM; # # Table structure for table 'poll' # + CREATE TABLE poll ( - lid int(10) unsigned DEFAULT '0' NOT NULL auto_increment, - nid int(10) unsigned DEFAULT '0' NOT NULL, - runtime int(10) DEFAULT '0' NOT NULL, + lid int(10) unsigned NOT NULL auto_increment, + nid int(10) unsigned NOT NULL default '0', + runtime int(10) NOT NULL default '0', voters text NOT NULL, - active int(2) unsigned DEFAULT '0' NOT NULL, - PRIMARY KEY (lid) -); + active int(2) unsigned NOT NULL default '0', + PRIMARY KEY (lid) +) TYPE=MyISAM; # # Table structure for table 'poll_choices' # + CREATE TABLE poll_choices ( - chid int(10) unsigned DEFAULT '0' NOT NULL auto_increment, - nid int(10) unsigned DEFAULT '0' NOT NULL, - chtext varchar(128) DEFAULT '' NOT NULL, - chvotes int(6) DEFAULT '0' NOT NULL, - chorder int(2) DEFAULT '0' NOT NULL, - PRIMARY KEY (chid) -); + chid int(10) unsigned NOT NULL auto_increment, + nid int(10) unsigned NOT NULL default '0', + chtext varchar(128) NOT NULL default '', + chvotes int(6) NOT NULL default '0', + chorder int(2) NOT NULL default '0', + PRIMARY KEY (chid) +) TYPE=MyISAM; + +# +# Table structure for table 'project' +# + +CREATE TABLE project ( + nid int(10) unsigned NOT NULL default '0', + pid int(10) unsigned NOT NULL default '0', + pstatus tinyint(2) NOT NULL default '0', + area varchar(255) NOT NULL default '', + priority tinyint(2) NOT NULL default '0', + version varchar(255) NOT NULL default '', + assigned int(10) unsigned NOT NULL default '0', + file text, + ptype varchar(255) NOT NULL default '', + PRIMARY KEY (nid), + KEY pid (pid), + KEY assigned (assigned) +) TYPE=MyISAM; + +# +# Table structure for table 'projects' +# + +CREATE TABLE projects ( + pid int(10) unsigned NOT NULL auto_increment, + name varchar(255) NOT NULL default '', + versions varchar(255) NOT NULL default '', + developers varchar(255) NOT NULL default '', + areas varchar(255) NOT NULL default '', + mail varchar(255) NOT NULL default '', + PRIMARY KEY (pid) +) TYPE=MyISAM; # # Table structure for table 'rating' # + CREATE TABLE rating ( - user int(6) DEFAULT '0' NOT NULL, - new int(6) DEFAULT '0' NOT NULL, - old int(6) DEFAULT '0' NOT NULL, - PRIMARY KEY (user) -); + uid int(10) NOT NULL default '0', + new int(6) NOT NULL default '0', + old int(6) NOT NULL default '0', + PRIMARY KEY (uid) +) TYPE=MyISAM; # -# Table structure for table 'referer' +# Table structure for table 'referrer' # -CREATE TABLE referer ( - url varchar(255) DEFAULT '' NOT NULL, - timestamp int(11) DEFAULT '0' NOT NULL -); + +CREATE TABLE referrer ( + url varchar(255) NOT NULL default '', + timestamp int(11) NOT NULL default '0' +) TYPE=MyISAM; # # Table structure for table 'role' # + CREATE TABLE role ( - rid int(10) unsigned DEFAULT '0' NOT NULL auto_increment, - name varchar(32) DEFAULT '' NOT NULL, + rid int(10) unsigned NOT NULL auto_increment, + name varchar(32) NOT NULL default '', perm text NOT NULL, - UNIQUE name (name), - PRIMARY KEY (rid) -); + PRIMARY KEY (rid), + UNIQUE KEY name (name) +) TYPE=MyISAM; # # Table structure for table 'site' # + CREATE TABLE site ( - sid int(10) unsigned DEFAULT '0' NOT NULL auto_increment, - name varchar(128) DEFAULT '' NOT NULL, - link varchar(255) DEFAULT '' NOT NULL, + sid int(10) unsigned NOT NULL auto_increment, + name varchar(128) NOT NULL default '', + link varchar(255) NOT NULL default '', size text NOT NULL, - timestamp int(11) DEFAULT '0' NOT NULL, - feed varchar(255) DEFAULT '' NOT NULL, - UNIQUE title (name), - UNIQUE url (link), - PRIMARY KEY (sid) -); - -# -# Table structure for table 'story' -# -CREATE TABLE story ( - lid int(10) unsigned DEFAULT '0' NOT NULL auto_increment, - nid int(10) unsigned DEFAULT '0' NOT NULL, - abstract text NOT NULL, - body text NOT NULL, - PRIMARY KEY (lid) -); + timestamp int(11) NOT NULL default '0', + feed varchar(255) NOT NULL default '', + PRIMARY KEY (sid), + UNIQUE KEY title (name), + UNIQUE KEY url (link) +) TYPE=MyISAM; # # Table structure for table 'tag' # -CREATE TABLE tag ( - tid int(10) unsigned DEFAULT '0' NOT NULL auto_increment, - name varchar(32) DEFAULT '' NOT NULL, - attributes varchar(255) DEFAULT '' NOT NULL, - collections varchar(32) DEFAULT '' NOT NULL, - UNIQUE name (name,collections), - PRIMARY KEY (tid) -); -# -# Table structure for table 'topic' -# -CREATE TABLE topic ( - tid int(10) unsigned DEFAULT '0' NOT NULL auto_increment, - pid int(10) unsigned DEFAULT '0' NOT NULL, - name varchar(32) DEFAULT '' NOT NULL, - moderate text NOT NULL, - UNIQUE name (name), - PRIMARY KEY (tid) -); +CREATE TABLE tag ( + tid int(10) unsigned NOT NULL auto_increment, + name varchar(32) NOT NULL default '', + attributes varchar(255) NOT NULL default '', + collections varchar(32) NOT NULL default '', + PRIMARY KEY (tid), + UNIQUE KEY name (name,collections) +) TYPE=MyISAM; # # Table structure for table 'users' # + CREATE TABLE users ( - id int(10) unsigned DEFAULT '0' NOT NULL auto_increment, - name varchar(60) DEFAULT '' NOT NULL, - userid varchar(32) DEFAULT '' NOT NULL, - passwd varchar(20) DEFAULT '' NOT NULL, - real_email varchar(60) DEFAULT '' NOT NULL, - fake_email varchar(60) DEFAULT '' NOT NULL, - url varchar(100) DEFAULT '' NOT NULL, - nodes tinyint(2) DEFAULT '10', - mode tinyint(1) DEFAULT '0' NOT NULL, - sort tinyint(1) DEFAULT '0', - threshold tinyint(1) DEFAULT '0', - bio tinytext NOT NULL, - theme varchar(255) DEFAULT '' NOT NULL, - signature varchar(255) DEFAULT '' NOT NULL, - last_access int(10) unsigned, - last_host varchar(255), - status tinyint(4) DEFAULT '0' NOT NULL, - hash varchar(12) DEFAULT '' NOT NULL, - timezone varchar(8), - rating decimal(8,2), - language char(2) DEFAULT '' NOT NULL, - role varchar(32) DEFAULT '' NOT NULL, - PRIMARY KEY (id), - UNIQUE name (name), - UNIQUE userid (userid), - UNIQUE real_email (real_email) -); + uid int(10) unsigned NOT NULL auto_increment, + name varchar(60) NOT NULL default '', + pass varchar(32) NOT NULL default '', + mail varchar(64) default '', + homepage varchar(128) NOT NULL default '', + mode tinyint(1) NOT NULL default '0', + sort tinyint(1) default '0', + threshold tinyint(1) default '0', + theme varchar(255) NOT NULL default '', + signature varchar(255) NOT NULL default '', + timestamp int(11) NOT NULL default '0', + hostname varchar(128) NOT NULL default '', + status tinyint(4) NOT NULL default '0', + timezone varchar(8) default NULL, + rating decimal(8,2) default NULL, + language char(2) NOT NULL default '', + role varchar(32) NOT NULL default '', + sid varchar(32) NOT NULL default '', + init varchar(64) default '', + session varchar(32) NOT NULL default '', + extrafields text, + PRIMARY KEY (uid), + UNIQUE KEY name (name) +) TYPE=MyISAM; # # Table structure for table 'variable' # + CREATE TABLE variable ( - name varchar(32) DEFAULT '' NOT NULL, + name varchar(32) NOT NULL default '', value text NOT NULL, - PRIMARY KEY (name) -); + PRIMARY KEY (name) +) TYPE=MyISAM; # # Table structure for table 'watchdog' # + CREATE TABLE watchdog ( - id int(5) DEFAULT '0' NOT NULL auto_increment, - user int(6) DEFAULT '0' NOT NULL, - type varchar(16) DEFAULT '' NOT NULL, - message varchar(255) DEFAULT '' NOT NULL, - location varchar(128) DEFAULT '' NOT NULL, - hostname varchar(128) DEFAULT '' NOT NULL, - timestamp int(11) DEFAULT '0' NOT NULL, - PRIMARY KEY (id) -); + wid int(5) NOT NULL auto_increment, + uid int(10) NOT NULL default '0', + type varchar(16) NOT NULL default '', + message varchar(255) NOT NULL default '', + location varchar(128) NOT NULL default '', + hostname varchar(128) NOT NULL default '', + timestamp int(11) NOT NULL default '0', + PRIMARY KEY (wid) +) TYPE=MyISAM; + +# +# Insert some default values +# +INSERT INTO variable SET name='update_start', value='2002-01-05'; +INSERT INTO blocks SET name='User information', module='user', delta='0', status='2', weight='0', region='1', remove='0', path=''; diff --git a/includes/theme.inc b/includes/theme.inc index 5553aeafa5b1..62c790919947 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -22,44 +22,6 @@ function image($name) { } function user($region) { - global $user; - - if ($user->uid) { - // Display account settings: - - $output .= "<div style=\"width: 125;\">\n"; - - foreach (module_list() as $name) { - if (module_hook($name, "link")) { - $links = module_invoke($name, "link", "menu"); - foreach ($links as $link) { - $output .= "$link<br />\n"; - } - } - } - - if (user_access("access administration pages")) { - $output .= "<br />\n"; - $output .= "<a href=\"admin.php\">". strtr(t("administer %a"), array("%a" => variable_get("site_name", "drupal"))) ."</a><BR>\n"; - } - - $output .= "</div>"; - - $this->box($user->name, $output, $region); - } - else { - $output .= "<div align=\"center\">\n"; - $output .= " <form action=\"module.php?mod=user&op=login\" method=\"post\">\n"; - $output .= " <b>". t("Username") .":</b><br /><input name=\"edit[name]\" size=\"15\"><p />\n"; - $output .= " <b>". t("Password") .":</b><br /><input name=\"edit[pass]\" size=\"15\" TYPE=\"password\"><br />\n"; - $output .= form_checkbox(t("Remember me"), "remember_me", 1, 0); - $output .= " <input type=\"submit\" value=\"". t("Log in") ."\"><br />\n"; - if (variable_get("account_register", 1)) $output .= " <a href=\"module.php?mod=user\" title=\"". t("Create a new user account.") ."\">". t("REGISTER") ."</a>\n"; - $output .= " </form>\n"; - $output .= "</div>\n"; - - $this->box(t("Log in"), $output, $region); - } } function node($node, $main) { @@ -124,34 +86,18 @@ function theme_init() { function theme_blocks($region, &$theme) { global $id, $PHP_SELF, $REQUEST_URI, $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->moderate == 1) theme_moderation_results($theme, $node, $region); - } - default: - 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.uid = '$user->uid'))". (($region == "left" OR $region == "right") ? ($region == "left" ? " AND b.region = 0" : " AND b.region = 1") : "") ." AND (b.path = '' OR '". strrchr($REQUEST_URI, "/") ."' RLIKE b.path) ORDER BY weight"); - else $result = db_query("SELECT * FROM blocks WHERE status = 2". (($region == "left" OR $region == "right") ? ($region == "left" ? " AND region = 0" : " AND region = 1") : "") ." ORDER BY weight"); - while ($result && ($block = db_fetch_object($result))) { - $blocks = module_invoke($block->module, "block"); - if ($blocks[$block->delta]["content"]) - $theme->box(t($blocks[$block->delta]["subject"]), $blocks[$block->delta]["content"], $region); - } - break; + 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.uid = '$user->uid'))". (($region == "left" OR $region == "right") ? ($region == "left" ? " AND b.region = 0" : " AND b.region = 1") : "") ." AND (b.path = '' OR '". strrchr($REQUEST_URI, "/") ."' RLIKE b.path) ORDER BY weight"); } -} - -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]'.<br />"; + else { + $result = db_query("SELECT * FROM blocks WHERE status = 2". (($region == "left" OR $region == "right") ? ($region == "left" ? " AND region = 0" : " AND region = 1") : "") ." ORDER BY weight"); + } + while ($result && ($block = db_fetch_object($result))) { + $blocks = module_invoke($block->module, "block"); + if ($blocks[$block->delta]["content"]) { + $theme->box(t($blocks[$block->delta]["subject"]), $blocks[$block->delta]["content"], $region); } } - - $theme->box(t("Moderation results"), ($output ? $output : t("This node has not been moderated yet.")), $region); } ?> diff --git a/modules/queue.module b/modules/queue.module index 11790447e67f..c301051d1449 100644 --- a/modules/queue.module +++ b/modules/queue.module @@ -170,4 +170,33 @@ function queue_page() { } } +function queue_block() { + global $PHP_SELF; + if (strrchr($PHP_SELF, "/") == "/node.php") { + global $user, $id; + if ($user->uid) { + $node = db_fetch_object(db_query("SELECT * FROM node WHERE nid = '$id'")); + } + if ($node->moderate == 1) { + 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]'.<br />"; + } + } + + $block[0]["subject"] = t("Moderation results"); + $block[0]["content"] = $output ? $output : t("This node has not been moderated yet."); + $block[0]["info"] = t("Moderation results"); + } + } + elseif (strrchr($PHP_SELF, "/") == "/admin.php") { + $block[0]["subject"] = t("Moderation results"); + $block[0]["info"] = t("Moderation results"); + } + + return $block; +} + ?> diff --git a/modules/user.module b/modules/user.module index 24a67d17022e..899901bdaedf 100644 --- a/modules/user.module +++ b/modules/user.module @@ -454,6 +454,51 @@ function user_search($keys) { return $find; } +function user_block() { + global $user; + + if ($user->uid) { + // Display account settings: + $block[0]["subject"] = $user->name; + + $output .= "<div style=\"width: 125;\">\n"; + + foreach (module_list() as $name) { + if (module_hook($name, "link")) { + $links = module_invoke($name, "link", "menu"); + foreach ($links as $link) { + $output .= "$link<br />\n"; + } + } + } + + if (user_access("access administration pages")) { + $output .= "<br />\n"; + $output .= "<a href=\"admin.php\">". strtr(t("administer %a"), array("%a" => variable_get("site_name", "drupal"))) ."</a><BR>\n"; + } + + $output .= "</div>"; + } + else { + $block[0]["subject"] = t("Log in"); + + $output .= "<div align=\"center\">\n"; + $output .= " <form action=\"module.php?mod=user&op=login\" method=\"post\">\n"; + $output .= " <b>". t("Username") .":</b><br /><input name=\"edit[name]\" size=\"15\"><p />\n"; + $output .= " <b>". t("Password") .":</b><br /><input name=\"edit[pass]\" size=\"15\" TYPE=\"password\"><br />\n"; + $output .= form_checkbox(t("Remember me"), "remember_me", 1, 0); + $output .= " <input type=\"submit\" value=\"". t("Log in") ."\"><br />\n"; + if (variable_get("account_register", 1)) $output .= " <a href=\"module.php?mod=user\" title=\"". t("Create a new user account.") ."\">". t("REGISTER") ."</a>\n"; + $output .= " </form>\n"; + $output .= "</div>\n"; + } + $block[0]["content"] = $output; + $block[0]["info"] = t("User information"); + $block[0]["link"] = "module.php?mod=user"; + + return $block; +} + function user_link($type) { if ($type == "page") { $links[] = "<a href=\"module.php?mod=user\" title=\"". t("Create a user account, request a new password or edit your account settings.") ."\">". t("user account") ."</a>"; diff --git a/modules/user/user.module b/modules/user/user.module index 24a67d17022e..899901bdaedf 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -454,6 +454,51 @@ function user_search($keys) { return $find; } +function user_block() { + global $user; + + if ($user->uid) { + // Display account settings: + $block[0]["subject"] = $user->name; + + $output .= "<div style=\"width: 125;\">\n"; + + foreach (module_list() as $name) { + if (module_hook($name, "link")) { + $links = module_invoke($name, "link", "menu"); + foreach ($links as $link) { + $output .= "$link<br />\n"; + } + } + } + + if (user_access("access administration pages")) { + $output .= "<br />\n"; + $output .= "<a href=\"admin.php\">". strtr(t("administer %a"), array("%a" => variable_get("site_name", "drupal"))) ."</a><BR>\n"; + } + + $output .= "</div>"; + } + else { + $block[0]["subject"] = t("Log in"); + + $output .= "<div align=\"center\">\n"; + $output .= " <form action=\"module.php?mod=user&op=login\" method=\"post\">\n"; + $output .= " <b>". t("Username") .":</b><br /><input name=\"edit[name]\" size=\"15\"><p />\n"; + $output .= " <b>". t("Password") .":</b><br /><input name=\"edit[pass]\" size=\"15\" TYPE=\"password\"><br />\n"; + $output .= form_checkbox(t("Remember me"), "remember_me", 1, 0); + $output .= " <input type=\"submit\" value=\"". t("Log in") ."\"><br />\n"; + if (variable_get("account_register", 1)) $output .= " <a href=\"module.php?mod=user\" title=\"". t("Create a new user account.") ."\">". t("REGISTER") ."</a>\n"; + $output .= " </form>\n"; + $output .= "</div>\n"; + } + $block[0]["content"] = $output; + $block[0]["info"] = t("User information"); + $block[0]["link"] = "module.php?mod=user"; + + return $block; +} + function user_link($type) { if ($type == "page") { $links[] = "<a href=\"module.php?mod=user\" title=\"". t("Create a user account, request a new password or edit your account settings.") ."\">". t("user account") ."</a>"; -- GitLab