actually, they are different -- array_add checks for uniqueness

git-svn-id: file:///home/shish/svn/shimmie2/trunk@232 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2007-07-06 04:47:01 +00:00
parent 7638c8de70
commit cec93d8a4d
2 changed files with 8 additions and 2 deletions

View file

@ -283,6 +283,12 @@ function array_remove($array, $to_remove) {
return $a2;
}
function array_add($array, $element) {
$array[] = $element;
$array = array_unique($array);
return $array;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
* Event API *

View file

@ -136,7 +136,7 @@ class TagListTheme extends Themelet {
}
else {
$tags = array_remove($tags, "-$tag");
$tags = array_push($tags, $tag);
$tags = array_add($tags, $tag);
return "<a href='".$this->tag_link(join(' ', $tags))."' title='Add' rel='nofollow'>A</a>";
}
}
@ -147,7 +147,7 @@ class TagListTheme extends Themelet {
}
else {
$tags = array_remove($tags, $tag);
$tags = array_push($tags, "-$tag");
$tags = array_add($tags, "-$tag");
return "<a href='".$this->tag_link(join(' ', $tags))."' title='Subtract' rel='nofollow'>S</a>";
}
}