summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/comment.inc4
-rw-r--r--includes/node.inc17
2 files changed, 10 insertions, 11 deletions
diff --git a/includes/comment.inc b/includes/comment.inc
index 9b0bd3219..cf49b49e6 100644
--- a/includes/comment.inc
+++ b/includes/comment.inc
@@ -71,7 +71,7 @@ function comment_form($edit) {
$form .= form_submit(t("Preview comment"));
$form .= form_submit(t("Post comment"));
}
-
+
return form($REQUEST_URL, $form);
}
@@ -230,7 +230,7 @@ function comment_thread_min($cid, $threshold) {
while ($comment = db_fetch_object($result)) {
print "<UL>";
- print " <LI>". comment_view($comment) ."</LI>\n";
+ print comment_view($comment);
comment_thread_min($comment->cid, $threshold);
print "</UL>";
}
diff --git a/includes/node.inc b/includes/node.inc
index 056268c63..73e4526ab 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, 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) {
$n = node_get_object(array("nid" => $node[nid]));
@@ -82,7 +82,8 @@ function node_save($node, $filter) {
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 ($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];
}
@@ -123,9 +124,6 @@ function node_save($node, $filter) {
if ($result && $lid = db_insert_id()) {
$result = db_query("UPDATE node SET lid = '$lid' WHERE nid = '$nid'");
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]'");
}
else {
@@ -142,6 +140,8 @@ function node_save($node, $filter) {
}
}
+ if ($nid) module_invoke($filter[type], "insert", node_get_object(array(nid => $nid)));
+
return $nid;
}
}
@@ -222,10 +222,9 @@ function node_attributes_save($type, $edit) {
}
function node_attributes_view($string) {
- foreach (explode(",", $string) as $data) {
- $entry = explode("=", $data);
- if ($entry[0] && $entry[1]) {
- $array[] = "<a href=\"?$entry[0]=$entry[1]\">$entry[1]</a>";
+ foreach (explode(",", $string) as $attribute) {
+ if ($attribute = trim($attribute)) {
+ $array[] = "<a href=\"?meta=". urlencode($attribute) ."\">$attribute</a>";
}
}
return $array ? $array : array();