diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/blog/actions/add.php | 10 | ||||
-rw-r--r-- | mod/blog/views/default/object/blog.php | 2 |
2 files changed, 7 insertions, 5 deletions
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"));
diff --git a/mod/blog/views/default/object/blog.php b/mod/blog/views/default/object/blog.php index d64495f9d..b136267d7 100644 --- a/mod/blog/views/default/object/blog.php +++ b/mod/blog/views/default/object/blog.php @@ -40,7 +40,7 @@ <p>
<?php
- echo $vars['entity']->tags;
+ echo elgg_view('output/tags', array('tags' => $vars['entity']->tags));
?>
</p>
|