diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-06-11 20:01:13 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-06-11 20:01:13 +0000 |
commit | c56ee67e29e89f5158801ba7bbe8f574a93215b4 (patch) | |
tree | 4004e19edda73708f7af1baffeb39318b3984509 /includes/node.inc | |
parent | 8f315f4506220c50715ba81444326cc7fd936ed9 (diff) | |
download | brdo-c56ee67e29e89f5158801ba7bbe8f574a93215b4.tar.gz brdo-c56ee67e29e89f5158801ba7bbe8f574a93215b4.tar.bz2 |
- Changed field_set(), field_get() and field_merge() to use ',' and
'=' instead of ';' and ':'. It is considered to be more readable.
--> A _first_ step towards and improved index.module. Stay tuned
for more.
+ Important:
If you update from CVS - apply the queries in 2.00-to-x.xx.sql!
- Changed all 'attribute' to 'attributes'.
+ Important:
If you update from CVS - apply the queries in 2.00-to-x.xx.sql!
+ Important:
This might require to ieni-wieni small update to your custom
themes and/or node-related modules:
- themes: node_index($node->attribute) -> node_index($node)
- node modules: attribute -> attributes
Diffstat (limited to 'includes/node.inc')
-rw-r--r-- | includes/node.inc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/includes/node.inc b/includes/node.inc index 73b8f8c1c..892dde6aa 100644 --- a/includes/node.inc +++ b/includes/node.inc @@ -63,7 +63,7 @@ function node_get_comments($nid) { } function node_save($node, $filter) { - $rows = array(nid, pid, lid, cid, tid, log, type, title, score, votes, author, status, comment, promote, moderate, attribute, timestamp, timestamp_posted, timestamp_queued, timestamp_hidden); + $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); if ($node[nid] > 0) { $n = node_get_object(array("nid" => $node[nid])); @@ -211,17 +211,14 @@ function node_preview($node) { return $node; } -function node_index($string) { - return $string ? implode(" / ", node_attributes_view($string)) : " "; -} function node_attributes_edit($edit) { - return index_collection_form("section", ($edit[section] ? $edit[section] : "section:". field_get($edit[attribute], "section") .";")); + return index_collection_form("section", ($edit[section] ? $edit[section] : "section:". field_get($edit[attributes], "section") .";")); } function node_attributes_save($edit) { if ($edit[nid] && $node = node_get_array(array("nid" => $edit[nid]))) { - return field_merge($node[attribute], $edit[section]); + return field_merge($node[attributes], $edit[section]); } else { return $edit[section]; @@ -229,8 +226,8 @@ function node_attributes_save($edit) { } function node_attributes_view($string) { - foreach (explode(";", $string) as $data) { - $entry = explode(":", $data); + foreach (explode(",", $string) as $data) { + $entry = explode("=", $data); if (in_array($entry[0], array("section"))) { $array[] = "<a href=\"?$entry[0]=$entry[1]\">$entry[1]</a>"; } @@ -238,6 +235,10 @@ function node_attributes_view($string) { return $array ? $array : array(); } +function node_index($node) { + return $node->attributes ? implode(" / ", node_attributes_view($node->attributes)) : " "; +} + function node_visible($node) { global $user, $status; return ($node->status == $status[posted]) || ($node->status == $status[queued] && $user->id) || user_access($user, $node->type) || user_access($user, "node"); |