Commit 03c06a86 authored by Dries's avatar Dries
Browse files

Oops, a rather large commit:

- Changed meta.module, node.module and index.php to use comma-seperated
  lists of attributes rather then "foo=a,bar=b" lists.  This makes it a
  a lot easier to use both modules.  In addition, error handling can be
  discarded as it can't be made any simpler, really ...

  It fits rather nicely in Drupal's design so I'm getting more and more
  happy with this meta.module (but we are not 100% there yet).

- node.module, node.inc:

   + Improved the node-related admin interface so that navigating back
     and forth the administrative menus is made both easier and faster.

   + Removed some redundant database fields from the node table.  See
     2.00-to-x.xx.sql!

   + Added 2 news hooks called "node_insert" and "node_update".  Just
     like this is the case with the existing hook "node_delete" these
     new hooks will automatically get called when a node has been
     inserted or udpated.  Note that this is an optional call-back that
     only needs to be implemented when required.  With the addition of
     these two hooks, the node mechanism (version 1) is pretty well
     completed.

- watchdog.module:
   + Fixed bug whit the 'regular messages' query in the watchdog.module.

- book.module:
   + Fixed bug in book.module: the 'parent' was not set properly when
     updating a book page.
   + Made it so that older versions of a book page are automatically
     reactived upon deletion of the most recent version, i.e. when
     doing a version roll-back.

- comment.inc:
   + Undid Remco's patch to comment.inc; it does not work in some cases.


- conf.module:
   + Fine-tuned some of the options in conf.module a bit.

- marvin.theme:
   + Visual changes to make it look better on Windows browsers.  Mind
     to give some feedback on this?
   + Fixed 3 HTML typos/bugs.
   + XHTML-ified the theme at a best effort basis; I didn't carry the
     XHTML specification with me.
   + Made use of the theme_slogan variable to display the site's slogan.
   + As soon we have at least one valid XHTML theme we can wonder on how
     to integrate other XML namespaces (cfr. MathML story at drop.org).

- database.mysql:
   + Updated database.mysql so that it contains all the latest "database
     patches".
parent d388033e
...@@ -24,7 +24,7 @@ function account_email() { ...@@ -24,7 +24,7 @@ function account_email() {
function account_create($error = "") { function account_create($error = "") {
global $theme; global $theme;
if ($error) { if ($error) {
$output .= "<P><FONT COLOR=\"red\">". t("Failed to create account") .": ". check_output($error) .".</FONT></P>\n"; $output .= "<P><FONT COLOR=\"red\">". t("Failed to create account") .": ". check_output($error) .".</FONT></P>\n";
watchdog("account", "failed to create account: $error."); watchdog("account", "failed to create account: $error.");
......
# MySQL dump 7.1
#
# Host: localhost Database: drop
#--------------------------------------------------------
# Server version 3.22.32
#
# Table structure for table 'access'
#
DROP TABLE IF EXISTS access; DROP TABLE IF EXISTS access;
CREATE TABLE access ( CREATE TABLE access (
id tinyint(10) DEFAULT '0' NOT NULL auto_increment, id tinyint(10) DEFAULT '0' NOT NULL auto_increment,
...@@ -17,9 +9,6 @@ CREATE TABLE access ( ...@@ -17,9 +9,6 @@ CREATE TABLE access (
PRIMARY KEY (id) PRIMARY KEY (id)
); );
#
# Table structure for table 'blocks'
#
DROP TABLE IF EXISTS blocks; DROP TABLE IF EXISTS blocks;
CREATE TABLE blocks ( CREATE TABLE blocks (
name varchar(64) DEFAULT '' NOT NULL, name varchar(64) DEFAULT '' NOT NULL,
...@@ -32,9 +21,6 @@ CREATE TABLE blocks ( ...@@ -32,9 +21,6 @@ CREATE TABLE blocks (
PRIMARY KEY (name) PRIMARY KEY (name)
); );
#
# Table structure for table 'book'
#
DROP TABLE IF EXISTS book; DROP TABLE IF EXISTS book;
CREATE TABLE book ( CREATE TABLE book (
lid int(10) unsigned DEFAULT '0' NOT NULL auto_increment, lid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
...@@ -43,12 +29,11 @@ CREATE TABLE book ( ...@@ -43,12 +29,11 @@ CREATE TABLE book (
section int(10) DEFAULT '0' NOT NULL, section int(10) DEFAULT '0' NOT NULL,
parent int(10) DEFAULT '0' NOT NULL, parent int(10) DEFAULT '0' NOT NULL,
weight tinyint(3) 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) PRIMARY KEY (lid)
); );
#
# Table structure for table 'boxes'
#
DROP TABLE IF EXISTS boxes; DROP TABLE IF EXISTS boxes;
CREATE TABLE boxes ( CREATE TABLE boxes (
id tinyint(4) DEFAULT '0' NOT NULL auto_increment, id tinyint(4) DEFAULT '0' NOT NULL auto_increment,
...@@ -62,9 +47,15 @@ CREATE TABLE boxes ( ...@@ -62,9 +47,15 @@ CREATE TABLE boxes (
PRIMARY KEY (id) PRIMARY KEY (id)
); );
# DROP TABLE IF EXISTS bundle;
# Table structure for table 'category' 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)
);
DROP TABLE IF EXISTS category; DROP TABLE IF EXISTS category;
CREATE TABLE category ( CREATE TABLE category (
cid int(10) unsigned DEFAULT '0' NOT NULL auto_increment, cid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
...@@ -80,9 +71,6 @@ CREATE TABLE category ( ...@@ -80,9 +71,6 @@ CREATE TABLE category (
PRIMARY KEY (cid) PRIMARY KEY (cid)
); );
#
# Table structure for table 'channel'
#
DROP TABLE IF EXISTS channel; DROP TABLE IF EXISTS channel;
CREATE TABLE channel ( CREATE TABLE channel (
id int(11) DEFAULT '0' NOT NULL auto_increment, id int(11) DEFAULT '0' NOT NULL auto_increment,
...@@ -97,9 +85,15 @@ CREATE TABLE channel ( ...@@ -97,9 +85,15 @@ CREATE TABLE channel (
PRIMARY KEY (id) PRIMARY KEY (id)
); );
# DROP TABLE IF EXISTS collection;
# Table structure for table 'comments' 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)
);
DROP TABLE IF EXISTS comments; DROP TABLE IF EXISTS comments;
CREATE TABLE comments ( CREATE TABLE comments (
cid int(6) DEFAULT '0' NOT NULL auto_increment, cid int(6) DEFAULT '0' NOT NULL auto_increment,
...@@ -118,9 +112,6 @@ CREATE TABLE comments ( ...@@ -118,9 +112,6 @@ CREATE TABLE comments (
KEY lid (lid) KEY lid (lid)
); );
#
# Table structure for table 'cvs'
#
DROP TABLE IF EXISTS cvs; DROP TABLE IF EXISTS cvs;
CREATE TABLE cvs ( CREATE TABLE cvs (
user varchar(32) DEFAULT '' NOT NULL, user varchar(32) DEFAULT '' NOT NULL,
...@@ -130,9 +121,6 @@ CREATE TABLE cvs ( ...@@ -130,9 +121,6 @@ CREATE TABLE cvs (
timestamp int(11) DEFAULT '0' NOT NULL timestamp int(11) DEFAULT '0' NOT NULL
); );
#
# Table structure for table 'diaries'
#
DROP TABLE IF EXISTS diaries; DROP TABLE IF EXISTS diaries;
CREATE TABLE diaries ( CREATE TABLE diaries (
id int(5) DEFAULT '0' NOT NULL auto_increment, id int(5) DEFAULT '0' NOT NULL auto_increment,
...@@ -142,9 +130,51 @@ CREATE TABLE diaries ( ...@@ -142,9 +130,51 @@ CREATE TABLE diaries (
PRIMARY KEY (id) PRIMARY KEY (id)
); );
# DROP TABLE IF EXISTS diary;
# Table structure for table 'forum' 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)
);
DROP TABLE IF EXISTS 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)
);
DROP TABLE IF EXISTS feed;
CREATE TABLE feed (
fid int(11) DEFAULT '0' NOT NULL auto_increment,
title varchar(255) DEFAULT '' NOT NULL,
link varchar(255) DEFAULT '' NOT NULL,
refresh int(11),
uncache int(11),
timestamp int(11),
attributes varchar(255) DEFAULT '' NOT NULL,
UNIQUE title (title),
UNIQUE link (link),
PRIMARY KEY (fid)
);
DROP TABLE IF EXISTS 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,
abstract text NOT NULL,
description text NOT NULL,
homepage varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (lid)
);
DROP TABLE IF EXISTS forum; DROP TABLE IF EXISTS forum;
CREATE TABLE forum ( CREATE TABLE forum (
lid int(10) unsigned DEFAULT '0' NOT NULL auto_increment, lid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
...@@ -153,31 +183,25 @@ CREATE TABLE forum ( ...@@ -153,31 +183,25 @@ CREATE TABLE forum (
PRIMARY KEY (lid) PRIMARY KEY (lid)
); );
# DROP TABLE IF EXISTS item;
# Table structure for table 'headlines' CREATE TABLE item (
# iid int(11) DEFAULT '0' NOT NULL auto_increment,
DROP TABLE IF EXISTS headlines; fid int(11) DEFAULT '0' NOT NULL,
CREATE TABLE headlines (
id int(11) DEFAULT '0' NOT NULL,
title varchar(255) DEFAULT '' NOT NULL, title varchar(255) DEFAULT '' NOT NULL,
link varchar(255) DEFAULT '' NOT NULL, link varchar(255) DEFAULT '' NOT NULL,
number int(3) DEFAULT '0' NOT NULL, author varchar(255) DEFAULT '' NOT NULL,
UNIQUE title (title), description text NOT NULL,
UNIQUE link (link) timestamp int(11),
attributes varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (iid)
); );
#
# Table structure for table 'layout'
#
DROP TABLE IF EXISTS layout; DROP TABLE IF EXISTS layout;
CREATE TABLE layout ( CREATE TABLE layout (
user int(11) DEFAULT '0' NOT NULL, user int(11) DEFAULT '0' NOT NULL,
block varchar(64) DEFAULT '' NOT NULL block varchar(64) DEFAULT '' NOT NULL
); );
#
# Table structure for table 'locales'
#
DROP TABLE IF EXISTS locales; DROP TABLE IF EXISTS locales;
CREATE TABLE locales ( CREATE TABLE locales (
id int(11) DEFAULT '0' NOT NULL auto_increment, id int(11) DEFAULT '0' NOT NULL auto_increment,
...@@ -194,24 +218,16 @@ CREATE TABLE locales ( ...@@ -194,24 +218,16 @@ CREATE TABLE locales (
PRIMARY KEY (id) PRIMARY KEY (id)
); );
#
# Table structure for table 'modules'
#
DROP TABLE IF EXISTS modules; DROP TABLE IF EXISTS modules;
CREATE TABLE modules ( CREATE TABLE modules (
name varchar(64) DEFAULT '' NOT NULL, name varchar(64) DEFAULT '' NOT NULL,
PRIMARY KEY (name) PRIMARY KEY (name)
); );
#
# Table structure for table 'node'
#
DROP TABLE IF EXISTS node; DROP TABLE IF EXISTS node;
CREATE TABLE node ( CREATE TABLE node (
nid int(10) unsigned DEFAULT '0' NOT NULL auto_increment, nid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
lid int(10) DEFAULT '0' NOT NULL, lid int(10) DEFAULT '0' NOT NULL,
pid int(10) DEFAULT '0' NOT NULL,
log text NOT NULL,
type varchar(16) DEFAULT '' NOT NULL, type varchar(16) DEFAULT '' NOT NULL,
title varchar(128) DEFAULT '' NOT NULL, title varchar(128) DEFAULT '' NOT NULL,
score int(11) DEFAULT '0' NOT NULL, score int(11) DEFAULT '0' NOT NULL,
...@@ -219,12 +235,14 @@ CREATE TABLE node ( ...@@ -219,12 +235,14 @@ CREATE TABLE node (
author int(6) DEFAULT '0' NOT NULL, author int(6) DEFAULT '0' NOT NULL,
status int(4) DEFAULT '1' NOT NULL, status int(4) DEFAULT '1' NOT NULL,
timestamp int(11) DEFAULT '0' NOT NULL, timestamp int(11) DEFAULT '0' NOT NULL,
cid int(10) unsigned DEFAULT '0' NOT NULL,
tid int(10) unsigned DEFAULT '0' NOT NULL,
comment int(2) DEFAULT '1' NOT NULL, comment int(2) DEFAULT '1' NOT NULL,
promote int(2) DEFAULT '1' NOT NULL, promote int(2) DEFAULT '1' NOT NULL,
moderate text NOT NULL, moderate text NOT NULL,
users text NOT NULL, 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 type (lid,type),
KEY author (author), KEY author (author),
KEY title (title,type), KEY title (title,type),
...@@ -233,9 +251,6 @@ CREATE TABLE node ( ...@@ -233,9 +251,6 @@ CREATE TABLE node (
KEY status (status) KEY status (status)
); );
#
# Table structure for table 'page'
#
DROP TABLE IF EXISTS page; DROP TABLE IF EXISTS page;
CREATE TABLE page ( CREATE TABLE page (
lid int(10) unsigned DEFAULT '0' NOT NULL auto_increment, lid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
...@@ -245,9 +260,7 @@ CREATE TABLE page ( ...@@ -245,9 +260,7 @@ CREATE TABLE page (
PRIMARY KEY (lid) PRIMARY KEY (lid)
); );
# DROP TABLE IF EXISTS poll;
# Table structure for table 'poll'
#
CREATE TABLE poll ( CREATE TABLE poll (
lid int(10) unsigned DEFAULT '0' NOT NULL auto_increment, lid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
nid int(10) unsigned DEFAULT '0' NOT NULL, nid int(10) unsigned DEFAULT '0' NOT NULL,
...@@ -257,9 +270,7 @@ CREATE TABLE poll ( ...@@ -257,9 +270,7 @@ CREATE TABLE poll (
PRIMARY KEY (lid) PRIMARY KEY (lid)
); );
# DROP TABLE IF EXISTS poll_choices;
# Table structure for table 'poll_choices'
#
CREATE TABLE poll_choices ( CREATE TABLE poll_choices (
chid int(10) unsigned DEFAULT '0' NOT NULL auto_increment, chid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
nid int(10) unsigned DEFAULT '0' NOT NULL, nid int(10) unsigned DEFAULT '0' NOT NULL,
...@@ -269,9 +280,6 @@ CREATE TABLE poll_choices ( ...@@ -269,9 +280,6 @@ CREATE TABLE poll_choices (
PRIMARY KEY (chid) PRIMARY KEY (chid)
); );
#
# Table structure for table 'rating'
#
DROP TABLE IF EXISTS rating; DROP TABLE IF EXISTS rating;
CREATE TABLE rating ( CREATE TABLE rating (
user int(6) DEFAULT '0' NOT NULL, user int(6) DEFAULT '0' NOT NULL,
...@@ -280,9 +288,6 @@ CREATE TABLE rating ( ...@@ -280,9 +288,6 @@ CREATE TABLE rating (
PRIMARY KEY (user) PRIMARY KEY (user)
); );
#
# Table structure for table 'story'
#
DROP TABLE IF EXISTS story; DROP TABLE IF EXISTS story;
CREATE TABLE story ( CREATE TABLE story (
lid int(10) unsigned DEFAULT '0' NOT NULL auto_increment, lid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
...@@ -292,36 +297,16 @@ CREATE TABLE story ( ...@@ -292,36 +297,16 @@ CREATE TABLE story (
PRIMARY KEY (lid) PRIMARY KEY (lid)
); );
# DROP TABLE IF EXISTS tag;
# Table structure for table 'testac' CREATE TABLE tag (
# tid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
DROP TABLE IF EXISTS testac; name varchar(32) DEFAULT '' NOT NULL,
CREATE TABLE testac ( attributes varchar(255) DEFAULT '' NOT NULL,
object_id int(11), collections varchar(32) DEFAULT '' NOT NULL,
object_title varchar(64) UNIQUE name (name,collections),
); PRIMARY KEY (tid)
#
# Table structure for table 'testad'
#
DROP TABLE IF EXISTS testad;
CREATE TABLE testad (
object_id int(11),
object_title varchar(64)
);
#
# Table structure for table 'testae'
#
DROP TABLE IF EXISTS testae;
CREATE TABLE testae (
object_id int(11),
object_title varchar(64)
); );
#
# Table structure for table 'topic'
#
DROP TABLE IF EXISTS topic; DROP TABLE IF EXISTS topic;
CREATE TABLE topic ( CREATE TABLE topic (
tid int(10) unsigned DEFAULT '0' NOT NULL auto_increment, tid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
...@@ -332,9 +317,6 @@ CREATE TABLE topic ( ...@@ -332,9 +317,6 @@ CREATE TABLE topic (
PRIMARY KEY (tid) PRIMARY KEY (tid)
); );
#
# Table structure for table 'users'
#
DROP TABLE IF EXISTS users; DROP TABLE IF EXISTS users;
CREATE TABLE users ( CREATE TABLE users (
id int(10) unsigned DEFAULT '0' NOT NULL auto_increment, id int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
...@@ -362,9 +344,6 @@ CREATE TABLE users ( ...@@ -362,9 +344,6 @@ CREATE TABLE users (
PRIMARY KEY (id) PRIMARY KEY (id)
); );
#
# Table structure for table 'variable'
#
DROP TABLE IF EXISTS variable; DROP TABLE IF EXISTS variable;
CREATE TABLE variable ( CREATE TABLE variable (
name varchar(32) DEFAULT '' NOT NULL, name varchar(32) DEFAULT '' NOT NULL,
...@@ -372,15 +351,11 @@ CREATE TABLE variable ( ...@@ -372,15 +351,11 @@ CREATE TABLE variable (
PRIMARY KEY (name) PRIMARY KEY (name)
); );
#
# Table structure for table 'watchdog'
#
DROP TABLE IF EXISTS watchdog; DROP TABLE IF EXISTS watchdog;
CREATE TABLE watchdog ( CREATE TABLE watchdog (
id int(5) DEFAULT '0' NOT NULL auto_increment, id int(5) DEFAULT '0' NOT NULL auto_increment,
user int(6) DEFAULT '0' NOT NULL, user int(6) DEFAULT '0' NOT NULL,
type varchar(16) DEFAULT '' NOT NULL, type varchar(16) DEFAULT '' NOT NULL,
link varchar(16) DEFAULT '' NOT NULL,
message varchar(255) DEFAULT '' NOT NULL, message varchar(255) DEFAULT '' NOT NULL,
location varchar(128) DEFAULT '' NOT NULL, location varchar(128) DEFAULT '' NOT NULL,
hostname varchar(128) DEFAULT '' NOT NULL, hostname varchar(128) DEFAULT '' NOT NULL,
......
...@@ -71,7 +71,7 @@ function comment_form($edit) { ...@@ -71,7 +71,7 @@ function comment_form($edit) {
$form .= form_submit(t("Preview comment")); $form .= form_submit(t("Preview comment"));
$form .= form_submit(t("Post comment")); $form .= form_submit(t("Post comment"));
} }
return form($REQUEST_URL, $form); return form($REQUEST_URL, $form);
} }
...@@ -230,7 +230,7 @@ function comment_thread_min($cid, $threshold) { ...@@ -230,7 +230,7 @@ function comment_thread_min($cid, $threshold) {
while ($comment = db_fetch_object($result)) { while ($comment = db_fetch_object($result)) {
print "<UL>"; print "<UL>";
print " <LI>". comment_view($comment) ."</LI>\n"; print comment_view($comment);
comment_thread_min($comment->cid, $threshold); comment_thread_min($comment->cid, $threshold);
print "</UL>"; print "</UL>";
} }
......
...@@ -63,7 +63,7 @@ function node_get_comments($nid) { ...@@ -63,7 +63,7 @@ function node_get_comments($nid) {
} }
function node_save($node, $filter) { function node_save($node, $filter) {
$rows = array(nid, pid, lid, cid, tid, log, type, title, score, votes, author, status, comment, promote, moderate, attributes, timestamp, timestamp_posted, timestamp_queued, timestamp_hidden); $rows = array(nid, lid, cid, tid, type, title, score, votes, author, status, comment, promote, moderate, attributes, timestamp, timestamp_posted, timestamp_queued, timestamp_hidden);
if ($node[nid] > 0) { if ($node[nid] > 0) {
$n = node_get_object(array("nid" => $node[nid])); $n = node_get_object(array("nid" => $node[nid]));
...@@ -82,7 +82,8 @@ function node_save($node, $filter) { ...@@ -82,7 +82,8 @@ function node_save($node, $filter) {
if ($u1) db_query("UPDATE node SET ". implode(", ", $u1) ." WHERE nid = '$node[nid]'"); if ($u1) db_query("UPDATE node SET ". implode(", ", $u1) ." WHERE nid = '$node[nid]'");
if ($u2) db_query("UPDATE $n->type SET ". implode(", ", $u2) ." WHERE nid = '$node[nid]'"); if ($u2) db_query("UPDATE $n->type SET ". implode(", ", $u2) ." WHERE nid = '$node[nid]'");
if ($n->pid && ($node[status] == node_status("posted"))) db_query("UPDATE node SET status = '". node_status("expired") ."' WHERE nid = '$n->pid'");
if ($node[nid]) module_invoke($n->type, "update", node_get_object(array(nid => $n->nid)));
return $node[nid]; return $node[nid];
} }
...@@ -123,9 +124,6 @@ function node_save($node, $filter) { ...@@ -123,9 +124,6 @@ function node_save($node, $filter) {
if ($result && $lid = db_insert_id()) { if ($result && $lid = db_insert_id()) {
$result = db_query("UPDATE node SET lid = '$lid' WHERE nid = '$nid'"); $result = db_query("UPDATE node SET lid = '$lid' WHERE nid = '$nid'");
if ($result) { if ($result) {
if (($node[pid]) && ($node[status] == node_status("posted"))) {
db_query("UPDATE node SET status = '". node_status(expired) ."' WHERE nid = '$node[pid]'");
}
watchdog("special", "node: added $filter[type] '$node[title]'"); watchdog("special", "node: added $filter[type] '$node[title]'");
} }
else { else {
...@@ -142,6 +140,8 @@ function node_save($node, $filter) { ...@@ -142,6 +140,8 @@ function node_save($node, $filter) {
} }
} }
if ($nid) module_invoke($filter[type], "insert", node_get_object(array(nid => $nid)));
return $nid; return $nid;
} }
} }
...@@ -222,10 +222,9 @@ function node_attributes_save($type, $edit) { ...@@ -222,10 +222,9 @@ function node_attributes_save($type, $edit) {
} }
function node_attributes_view($string) { function node_attributes_view($string) {
foreach (explode(",", $string) as $data) { foreach (explode(",", $string) as $attribute) {
$entry = explode("=", $data); if ($attribute = trim($attribute)) {
if ($entry[0] && $entry[1]) { $array[] = "<a href=\"?meta=". urlencode($attribute) ."\">$attribute</a>";
$array[] = "<a href=\"?$entry[0]=$entry[1]\">$entry[1]</a>";
} }
} }
return $array ? $array : array(); return $array ? $array : array();
......
...@@ -4,13 +4,7 @@ ...@@ -4,13 +4,7 @@
page_header(); page_header();
foreach(explode("&", $QUERY_STRING) as $attribute) { $result = db_query("SELECT nid, type FROM node WHERE ". ($meta ? "attributes LIKE '%". check_input($meta) ."%' AND " : "") ." promote = '1' AND status = '". node_status("posted") ."' AND timestamp <= '". ($date > 0 ? check_input($date) : time()) ."' ORDER BY timestamp DESC LIMIT ". ($user->nodes ? $user->nodes : variable_get(default_nodes_main, 10)));
if ($attribute) $query .= "attributes LIKE '%". check_input($attribute) ."%' AND ";
}
$query = !$date ? $query : "";
$result = db_query("SELECT nid, type FROM node WHERE $query promote = '1' AND status = '". node_status("posted") ."' AND timestamp <= '". ($date > 0 ? check_input($date) : time()) ."' ORDER BY timestamp DESC LIMIT ". ($user->nodes ? $user->nodes : variable_get(default_nodes_main, 10)));
$theme->header(); $theme->header();
while ($node = db_fetch_object($result)) { while ($node = db_fetch_object($result)) {
......
...@@ -169,36 +169,36 @@ function account_save($edit, &$name) { ...@@ -169,36 +169,36 @@ function account_save($edit, &$name) {
} }
} }
db_query("UPDATE users SET $query access = '' WHERE userid = '$name'"); db_query("UPDATE users SET $query access = '' WHERE userid = '$name'");
if ($edit[access]) {