diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-04-04 13:23:02 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-04-04 13:23:02 +0000 |
commit | d90262f965c85c86d36944ff31754abf850512a7 (patch) | |
tree | 2b1519ccc6332635cce183d241ea891ba0d6a7aa /mod | |
parent | 52cac1b8f3d7ead701dbf8d30fddb015cba69f85 (diff) | |
download | elgg-d90262f965c85c86d36944ff31754abf850512a7.tar.gz elgg-d90262f965c85c86d36944ff31754abf850512a7.tar.bz2 |
Added tags to the blog plugin
git-svn-id: https://code.elgg.org/elgg/trunk@401 36083f99-b078-4883-b0ff-0f9b5a30f544
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>
|