summaryrefslogtreecommitdiff
path: root/includes/common.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-06-11 20:01:13 +0000
committerDries Buytaert <dries@buytaert.net>2001-06-11 20:01:13 +0000
commitc56ee67e29e89f5158801ba7bbe8f574a93215b4 (patch)
tree4004e19edda73708f7af1baffeb39318b3984509 /includes/common.inc
parent8f315f4506220c50715ba81444326cc7fd936ed9 (diff)
downloadbrdo-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/common.inc')
-rw-r--r--includes/common.inc24
1 files changed, 12 insertions, 12 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;