From d90262f965c85c86d36944ff31754abf850512a7 Mon Sep 17 00:00:00 2001 From: ben Date: Fri, 4 Apr 2008 13:23:02 +0000 Subject: Added tags to the blog plugin git-svn-id: https://code.elgg.org/elgg/trunk@401 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/blog/actions/add.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'mod/blog/actions') diff --git a/mod/blog/actions/add.php b/mod/blog/actions/add.php index 21c871e16..f51bbedac 100644 --- a/mod/blog/actions/add.php +++ b/mod/blog/actions/add.php @@ -23,6 +23,9 @@ $_SESSION['blogbody'] = $body; $_SESSION['blogtags'] = $tags; + // Convert string of tags into a preformatted array + $tagarray = string_to_tag_array($tags); + // Make sure the title / description aren't blank if (empty($title) || empty($body)) { register_error(elgg_echo("blog:blank")); @@ -47,10 +50,9 @@ register_error(elgg_echo("blog:error")); forward("mod/blog/add.php"); } - // Now let's add tags. We can pass an array directly to setMetaData! - // Not very painful. - if (is_array($tags) && sizeof($tags) > 0) { - $blog->tags = $tags; + // Now let's add tags. We can pass an array directly to the object property! Easy. + if (is_array($tagarray)) { + $blog->tags = $tagarray; } // Success message system_message(elgg_echo("blog:posted")); -- cgit v1.2.3