diff options
author | James Walker <walkah@walkah.net> | 2010-07-20 17:34:58 -0700 |
---|---|---|
committer | James Walker <walkah@walkah.net> | 2010-07-20 17:34:58 -0700 |
commit | 7065450f03078fb1ac2105b75f9c7a4e052bca9c (patch) | |
tree | b0800c0552fd1f17a365d27bb878338f2b4c1ee9 /scripts/settag.php | |
parent | c5e89527d9636275d58ef438c5e12a5aad283115 (diff) |
normalizing tags for status_network
Diffstat (limited to 'scripts/settag.php')
-rw-r--r-- | scripts/settag.php | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/scripts/settag.php b/scripts/settag.php index d1b06ff10..ca260f7bf 100644 --- a/scripts/settag.php +++ b/scripts/settag.php @@ -39,11 +39,10 @@ if (count($args) < 1) { } $nickname = $args[0]; - $sn = Status_network::memGet('nickname', $nickname); if (empty($sn)) { - print "No such site.\n"; + print "No such site ($nickname).\n"; exit(-1); } @@ -54,16 +53,13 @@ if (count($args) == 1) { exit(0); } $tag = $args[1]; - $i = array_search($tag, $tags); if ($i !== false) { if (have_option('d', 'delete')) { // Delete unset($tags[$i]); - $orig = clone($sn); - $sn->tags = implode('|', $tags); - $result = $sn->update($orig); + $result = $sn->setTags($tags); if (!$result) { print "Couldn't update.\n"; exit(-1); @@ -78,9 +74,7 @@ if ($i !== false) { exit(-1); } else { $tags[] = $tag; - $orig = clone($sn); - $sn->tags = implode('|', $tags); - $result = $sn->update($orig); + $result = $sn->setTags($tags); if (!$result) { print "Couldn't update.\n"; exit(-1); |