diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/common.inc | 24 | ||||
-rw-r--r-- | includes/node.inc | 17 | ||||
-rw-r--r-- | includes/theme.inc | 4 |
3 files changed, 23 insertions, 22 deletions
diff --git a/includes/common.inc b/includes/common.inc index a60ca3236..1702ccb32 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -197,8 +197,8 @@ function form_submit($value) { } function field_get($string, $name) { - foreach (explode(";", $string) as $data) { - $entry = explode(":", $data); + foreach (explode(",", $string) as $data) { + $entry = explode("=", $data); if ($entry[0] == $name) return $entry[1]; } } @@ -206,30 +206,30 @@ function field_get($string, $name) { function field_set($string, $name, $value) { if (!$value) { // remove entry: - foreach (explode(";", $string) as $data) { - $entry = explode(":", $data); - if ($entry[0] != $name) $rval .= "$entry[0]:$entry[1];"; + foreach (explode(",", $string) as $data) { + $entry = explode("=", $data); + if ($entry[0] != $name) $rval .= "$entry[0]=$entry[1],"; } } - else if (strstr($string, "$name:")) { + else if (strstr($string, "$name=")) { // found: update exsisting entry: - foreach (explode(";", $string) as $data) { - $entry = explode(":", $data); + foreach (explode(",", $string) as $data) { + $entry = explode("=", $data); if ($entry[0] == $name) $entry[1] = $value; - $rval .= "$entry[0]:$entry[1];"; + $rval .= "$entry[0]=$entry[1],"; } } else { // not found: - $rval = "$string$name:$value;"; + $rval = "$string$name=$value,"; } return $rval; } function field_merge($a, $b) { - foreach (explode(";", $b) as $data) { - $entry = explode(":", $data); + foreach (explode(",", $b) as $data) { + $entry = explode("=", $data); $a = field_set($a, $entry[0], $entry[1]); } return $a; 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"); diff --git a/includes/theme.inc b/includes/theme.inc index d37b73cd9..fc34e68b3 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -113,9 +113,9 @@ function theme_blocks($region, $theme) { } function theme_moderation_results($theme, $node) { - foreach (explode(";", $node->users) as $vote) { + foreach (explode(",", $node->users) as $vote) { if ($vote) { - $data = explode(":", $vote); + $data = explode("=", $vote); $output .= format_username($data[0]) ." voted '$data[1]'.<BR>"; } } |