<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>modules/tags/pages/admin/edit_tags.twig</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -18,7 +18,7 @@
 				&lt;/fieldset&gt;
 			&lt;/form&gt;
 			&lt;br /&gt;
-			&lt;h2&gt;${ &quot;Last 25 Pages&quot; | translate }&lt;/h2&gt;
+			&lt;h2&gt;{% if GET.query %}${ &quot;Search Results&quot; | translate }{% else %}${ &quot;Last 25 Pages&quot; | translate }{% endif %}&lt;/h2&gt;
 			&lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; class=&quot;wide&quot;&gt;
 				&lt;thead&gt;
 					&lt;tr class=&quot;head&quot;&gt;</diff>
      <filename>admin/layout/pages/manage_pages.twig</filename>
    </modified>
    <modified>
      <diff>@@ -29,7 +29,7 @@
 				&lt;/fieldset&gt;
 			&lt;/form&gt;
 			&lt;br /&gt;
-			&lt;h2&gt;${ &quot;Last 25 Posts&quot; | translate }&lt;/h2&gt;
+			&lt;h2&gt;{% if GET.query %}${ &quot;Search Results&quot; | translate }{% else %}${ &quot;Last 25 Posts&quot; | translate }{% endif %}&lt;/h2&gt;
 			&lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; class=&quot;wide&quot;&gt;
 				&lt;thead&gt;
 					&lt;tr class=&quot;head&quot;&gt;</diff>
      <filename>admin/layout/pages/manage_posts.twig</filename>
    </modified>
    <modified>
      <diff>@@ -208,6 +208,12 @@ a:visited {
 	font-size: .8em;
 	color: #bcbcbc;
 }
+#content h1.sub,
+#content h2.sub,
+#content h3.sub,
+#content h4.sub {
+	color: #bcbcbc;
+}
 /* @end */
 
 /* @group Extend */
@@ -534,8 +540,7 @@ table thead tr th {
 }
 table thead tr th input {
 	position: relative;
-	top: -2px;
-	right: -2px;
+	top: -.15em;
 }
 table thead tr th.header {
 	cursor: pointer;
@@ -561,7 +566,8 @@ table tbody tr td.main {
 	background: #f9f9f9;
 	font-weight: bold;
 }
-table tbody tr td.center {
+table tbody tr td.center,
+table tbody tr th.center {
 	text-align: center;
 	vertical-align: middle;
 }
@@ -953,4 +959,7 @@ br#after_options {
 img.smiley {
 	margin: 0 0 -.3em;
 }
+.inline {
+	display: inline;
+}
 /* @end */</diff>
      <filename>admin/style.css</filename>
    </modified>
    <modified>
      <diff>@@ -27,6 +27,9 @@ $(function(){
 		return false
 	})
 
+	// Auto-expand input fields
+	$(&quot;.expand&quot;).expand()
+
 	// Checkbox toggling.
 	togglers()
 
@@ -68,14 +71,19 @@ function togglers() {
 
 	$(document.createElement(&quot;label&quot;)).attr(&quot;for&quot;, &quot;toggle&quot;).text(&quot;&lt;?php echo __(&quot;Toggle All&quot;); ?&gt;&quot;).appendTo(&quot;#toggler&quot;)
 	$(document.createElement(&quot;input&quot;)).attr({
-		&quot;class&quot;: &quot;checkbox&quot;,
 		type: &quot;checkbox&quot;,
 		name: &quot;toggle&quot;,
 		id: &quot;toggle&quot;
-	}).appendTo(&quot;#toggler, .toggler&quot;).click(function(){
+	}).prependTo(&quot;#toggler, .toggler&quot;)
+
+	$(&quot;#toggle&quot;).click(function(){
 		$(&quot;form#new_group, form#group_edit, table&quot;).find(&quot;:checkbox&quot;).not(&quot;#toggle&quot;).each(function(){
 			this.checked = document.getElementById(&quot;toggle&quot;).checked
 		})
+
+		$(this).parent().parent().find(&quot;:checkbox&quot;).not(&quot;#toggle&quot;).each(function(){
+			this.checked = document.getElementById(&quot;toggle&quot;).checked
+		})
 	})
 
 	// Some checkboxes are already checked when the page is loaded
@@ -84,7 +92,7 @@ function togglers() {
 		all_checked = this.checked
 	})
 
-	$(&quot;:checkbox&quot;).click(function(){
+	$(&quot;:checkbox:not(#toggle)&quot;).click(function(){
 		var action_all_checked = true
 
 		$(&quot;form#new_group, form#group_edit, table&quot;).find(&quot;:checkbox&quot;).not(&quot;#toggle&quot;).each(function(){
@@ -92,6 +100,11 @@ function togglers() {
 			action_all_checked = this.checked
 		})
 
+		$(&quot;#toggle&quot;).parent().parent().find(&quot;:checkbox&quot;).not(&quot;#toggle&quot;).each(function(){
+			if (!action_all_checked) return
+			action_all_checked = this.checked
+		})
+
 		document.getElementById(&quot;toggle&quot;).checked = action_all_checked
 	})
 </diff>
      <filename>includes/admin.js.php</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,7 @@
 	switch($_POST['action']) {
 		case &quot;edit_post&quot;:
 			if (!isset($_POST['id']))
-				error(__(&quot;Unspecified ID&quot;), __(&quot;Please specify an ID of the post you would like to edit.&quot;));
+				error(__(&quot;No ID Specified&quot;), __(&quot;Please specify an ID of the post you would like to edit.&quot;));
 
 			$post = new Post($_POST['id'], array(&quot;filter&quot; =&gt; false, &quot;drafts&quot; =&gt; true));
 </diff>
      <filename>includes/ajax.php</filename>
    </modified>
    <modified>
      <diff>@@ -228,7 +228,7 @@ function twig_urlencode_filter($url, $raw=false)
 	return urlencode($url);
 }
 
-function twig_join_filter($value, $glue=', ')
+function twig_join_filter($value, $glue='')
 {
 	return implode($glue, $value);
 }</diff>
      <filename>includes/class/Twig/runtime.php</filename>
    </modified>
    <modified>
      <diff>@@ -48,6 +48,9 @@
 
 			global $posts;
 
+			if (empty($_GET['query']))
+				return Flash::warning(__(&quot;Please enter a search term.&quot;));
+
 			list($where, $params) = keywords(urldecode($_GET['query']), &quot;xml LIKE :query&quot;);
 
 			$posts = new Paginator(Post::find(array(&quot;placeholders&quot; =&gt; true,</diff>
      <filename>includes/controller/Main.php</filename>
    </modified>
    <modified>
      <diff>@@ -238,7 +238,7 @@ msgid &quot;Title&quot;
 msgstr &quot;&quot;
 
 #: includes/ajax.php:8
-msgid &quot;Unspecified ID&quot;
+msgid &quot;No ID Specified&quot;
 msgstr &quot;&quot;
 
 #: admin/layout/pages/import.twig:118</diff>
      <filename>includes/locale/en_US.pot</filename>
    </modified>
    <modified>
      <diff>@@ -149,6 +149,7 @@
 			if (!Visitor::current()-&gt;group()-&gt;can(&quot;edit_comment&quot;, &quot;delete_comment&quot;, true))
 				show_403(__(&quot;Access Denied&quot;), __(&quot;You do not have sufficient privileges to manage any comments.&quot;, &quot;comments&quot;));
 
+			fallback($_GET['query'], &quot;&quot;);
 			list($where, $params) = keywords(urldecode($_GET['query']), &quot;body LIKE :query&quot;);
 
 			$where[] = &quot;status = 'spam'&quot;;
@@ -310,6 +311,7 @@
 			if (!Comment::any_editable() and !Comment::any_deletable())
 				show_403(__(&quot;Access Denied&quot;), __(&quot;You do not have sufficient privileges to manage any comments.&quot;, &quot;comments&quot;));
 
+			fallback($_GET['query'], &quot;&quot;);
 			list($where, $params) = keywords(urldecode($_GET['query']), &quot;body LIKE :query&quot;);
 
 			$where[] = &quot;status != 'spam'&quot;;</diff>
      <filename>modules/comments/comments.php</filename>
    </modified>
    <modified>
      <diff>@@ -38,7 +38,7 @@
 					&lt;/button&gt;
 				&lt;/div&gt;
 {% endif %}
-				&lt;h2&gt;${ &quot;Last 25 Comments&quot; | translate(&quot;comments&quot;) }&lt;/h2&gt;
+				&lt;h2&gt;{% if GET.query %}${ &quot;Search Results&quot; | translate }{% else %}${ &quot;Last 25 Comments&quot; | translate(&quot;comments&quot;) }{% endif %}&lt;/h2&gt;
 				&lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; class=&quot;wide&quot;&gt;
 					&lt;thead&gt;
 						&lt;tr class=&quot;head&quot;&gt;</diff>
      <filename>modules/comments/pages/admin/manage_comments.twig</filename>
    </modified>
    <modified>
      <diff>@@ -34,7 +34,7 @@
 						&lt;img src=&quot;images/icons/delete.png&quot; alt=&quot;delete&quot; /&gt; ${ &quot;delete&quot; | translate(&quot;comments&quot;) }
 					&lt;/button&gt;
 				&lt;/div&gt;
-				&lt;h2&gt;${ &quot;Last 25 Spam&quot; | translate(&quot;comments&quot;) }&lt;/h2&gt;
+				&lt;h2&gt;{% if GET.query %}${ &quot;Search Results&quot; | translate }{% else %}${ &quot;Last 25 Spam&quot; | translate(&quot;comments&quot;) }{% endif %}&lt;/h2&gt;
 				&lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; class=&quot;wide&quot;&gt;
 					&lt;thead&gt;
 						&lt;tr class=&quot;head&quot;&gt;</diff>
      <filename>modules/comments/pages/admin/manage_spam.twig</filename>
    </modified>
    <modified>
      <diff>@@ -23,10 +23,12 @@
 .tag_cloud {
 	text-align: center;
 }
-.tag_cloud span {
+.tag_cloud span,
+.post_tags a.tag {
 	display: inline-block;
 }
-.tag_cloud span a.tag {
+.tag_cloud span a.tag,
+.post_tags a.tag {
 	display: block;
 	line-height: 2.5em;
 	padding: 0 .75em;
@@ -34,6 +36,7 @@
 	text-decoration: none;
 	font-weight: bold;
 	color: #777;
+	text-align: center;
 }
 .tag_cloud span .controls {
 	opacity: 0;
@@ -42,4 +45,41 @@
 	background: #f9f9f9;
 	-webkit-border-bottom-right-radius: .5em;
 	-webkit-border-bottom-left-radius: .5em;
+}
+
+.post_tags {
+	list-style: none;
+}
+.post_tags li {
+	display: block;
+	margin-bottom: .5em;
+	padding: .75em;
+}
+.post_tags input,
+.post_tags h3 {
+	margin: 0 .5em 0 .25em;
+}
+.post_tags li.odd {
+	background: #fafafa;
+}
+.post_tags li a.tag,
+.post_tags li a.edit_tag {
+	margin: -.85em 0;
+}
+.post_tags li a.tag {
+	display: inline-block;
+	padding: 0 .75em;
+	background: #e5e5e5;
+	-webkit-border-radius: .5em;
+}
+.post_tags li a.edit_tag {
+	display: inline-block;
+	position: relative;
+	bottom: -.2em;
+	padding: .5em .75em .4em;
+	background: #f0f0f0;
+	-webkit-border-radius: .5em;
+}
+.post_tags li a.edit_tag:hover {
+	background: #f5f5f5;
 }
\ No newline at end of file</diff>
      <filename>modules/tags/admin.css</filename>
    </modified>
    <modified>
      <diff>@@ -3,14 +3,15 @@
 {% block title %}${ &quot;Manage Tags&quot; | translate(&quot;tags&quot;) }{% endblock %}
 
 {% block content %}
-			&lt;h1&gt;${ &quot;Manage Tags&quot; | translate(&quot;tags&quot;) } &lt;span class=&quot;sub right&quot;&gt;${ &quot;(hover for controls)&quot; | translate }&lt;/span&gt;&lt;/h1&gt;
+			&lt;h1&gt;${ &quot;Manage Tags&quot; | translate(&quot;tags&quot;) }&lt;/h1&gt;
+			&lt;h2&gt;${ &quot;All Tags&quot; | translate(&quot;tags&quot;) } &lt;span class=&quot;sub right&quot;&gt;${ &quot;(hover for controls)&quot; | translate }&lt;/span&gt;&lt;/h2&gt;
 			&lt;div class=&quot;tag_cloud&quot;&gt;
 				{% for tag in tag_cloud %}
 				&lt;span class=&quot;tag_wrap&quot;&gt;
 					&lt;a class=&quot;tag&quot; href=&quot;$tag.url&quot; style=&quot;font-size: $tag.size%&quot; title=&quot;$tag.title&quot;&gt;$tag.name&lt;/a&gt;
 					&lt;div class=&quot;controls&quot;&gt;
 						&lt;a class=&quot;edit_tag&quot; href=&quot;{% admin &quot;rename_tag&amp;name=&quot;~ tag.clean %}&quot;&gt;&lt;img src=&quot;images/icons/edit.png&quot; alt=&quot;edit&quot; /&gt;&lt;/a&gt;
-						&lt;a class=&quot;delete_tag&quot; href=&quot;{% admin &quot;delete_tag&amp;name=&quot;~ tag.clean %}&quot;&gt;&lt;img src=&quot;images/icons/delete.png&quot; alt=&quot;edit&quot; /&gt;&lt;/a&gt;
+						&lt;a class=&quot;delete_tag&quot; href=&quot;{% admin &quot;delete_tag&amp;name=&quot;~ (tag.name | urlencode) ~&quot;&amp;clean=&quot;~ tag.clean %}&quot;&gt;&lt;img src=&quot;images/icons/delete.png&quot; alt=&quot;edit&quot; /&gt;&lt;/a&gt;
 					&lt;/div&gt;
 				&lt;/span&gt;
 				{% else %}
@@ -18,4 +19,55 @@
 				&lt;br /&gt;
 				{% endfor %}
 			&lt;/div&gt;
+			&lt;hr /&gt;
+			&lt;br /&gt;
+			&lt;h2&gt;${ &quot;Post Tags&quot; | translate(&quot;tags&quot;) }&lt;/h2&gt;
+			&lt;br /&gt;
+			&lt;div class=&quot;left pad margin-right&quot;&gt;
+				&lt;form class=&quot;detail&quot; action=&quot;index.php&quot; method=&quot;get&quot; accept-charset=&quot;utf-8&quot;&gt;
+					&lt;fieldset&gt;
+						&lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;manage_tags&quot; /&gt;
+						&lt;h3&gt;
+							${ &quot;Search&amp;hellip;&quot; | translate }
+							&lt;a href=&quot;{% admin &quot;help&amp;id=filtering_results&quot; %}&quot; class=&quot;help emblem&quot;&gt;&lt;img src=&quot;images/icons/help.png&quot; alt=&quot;help&quot; /&gt;&lt;/a&gt;
+						&lt;/h3&gt;
+						&lt;input class=&quot;text&quot; type=&quot;text&quot; name=&quot;query&quot; value=&quot;${ GET.query | escape }&quot; id=&quot;query&quot; /&gt; &lt;button type=&quot;submit&quot; class=&quot;inline&quot;&gt;${ &quot;Search &amp;rarr;&quot; | translate }&lt;/button&gt;
+					&lt;/fieldset&gt;
+				&lt;/form&gt;
+			&lt;/div&gt;
+			&lt;form class=&quot;detail&quot; action=&quot;{% admin &quot;bulk_tag&quot; %}&quot; method=&quot;post&quot; accept-charset=&quot;utf-8&quot;&gt;
+				&lt;fieldset&gt;
+					&lt;div class=&quot;left pad&quot;&gt;
+						&lt;h3&gt;${ &quot;Tag Selected:&quot; | translate(&quot;tags&quot;) }&lt;/h3&gt;
+						&lt;input type=&quot;text&quot; name=&quot;name&quot; value=&quot;&quot; id=&quot;name&quot; /&gt;
+						&lt;button type=&quot;submit&quot; class=&quot;inline&quot;&gt;${ &quot;Tag &amp;rarr;&quot; | translate(&quot;tags&quot;) }&lt;/button&gt;
+						&lt;input type=&quot;hidden&quot; name=&quot;hash&quot; value=&quot;$site.secure_hashkey&quot; id=&quot;hash&quot; /&gt;
+					&lt;/div&gt;
+					&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
+					&lt;br /&gt;
+					&lt;h2&gt;{% if GET.query %}${ &quot;Search Results&quot; | translate }{% else %}${ &quot;Last 25 Posts&quot; | translate }{% endif %}&lt;/h2&gt;
+					&lt;ul class=&quot;post_tags&quot;&gt;
+						&lt;li class=&quot;odd js_enabled toggler&quot;&gt;
+							&lt;h3 class=&quot;inline sub&quot;&gt;${ &quot;Toggle All&quot; | translate }&lt;/h3&gt;
+						&lt;/li&gt;
+					{% for post in posts.paginated %}
+						&lt;li class=&quot;{% if loop.index | odd %}even{% else %}odd{% endif %}&quot;&gt;
+							&lt;input type=&quot;checkbox&quot; name=&quot;post[$loop.index0]&quot; value=&quot;$post.id&quot; id=&quot;post_checkbox_$post.id&quot; /&gt;
+							&lt;h3 class=&quot;inline&quot;&gt;&lt;a href=&quot;$post.url&quot;&gt;${ post.title | truncate | fallback((post.feather | capitalize) ~ &quot; #&quot; ~ post.id) }&lt;/a&gt;&lt;/h3&gt;
+							{% for tag in post.tags.info %}
+							&lt;a class=&quot;tag&quot; href=&quot;$tag.url&quot;&gt;$tag.name&lt;/a&gt;
+							{% endfor %}
+							&lt;a class=&quot;edit_tag&quot; href=&quot;{% admin &quot;edit_tags&amp;id=&quot;~ post.id %}&quot;&gt;&lt;img src=&quot;images/icons/edit.png&quot; alt=&quot;edit&quot; /&gt;&lt;/a&gt;
+						&lt;/li&gt;
+					{% else %}
+						&lt;li&gt;
+							&lt;span class=&quot;sub&quot;&gt;${ &quot;(none)&quot; | translate }&lt;/span&gt;
+						&lt;/li&gt;
+					{% endfor %}
+					&lt;/ul&gt;
+				&lt;/fieldset&gt;
+			&lt;/form&gt;
+			&lt;br /&gt;
+			$posts.next_link
+			$posts.prev_link
 {% endblock %}
\ No newline at end of file</diff>
      <filename>modules/tags/pages/admin/manage_tags.twig</filename>
    </modified>
    <modified>
      <diff>@@ -149,13 +149,13 @@
 				return $navs;
 
 			$navs[&quot;manage_tags&quot;] = array(&quot;title&quot; =&gt; __(&quot;Tags&quot;, &quot;tags&quot;),
-			                             &quot;selected&quot; =&gt; array(&quot;bulk_tags&quot;, &quot;rename_tag&quot;, &quot;delete_tag&quot;));
+			                             &quot;selected&quot; =&gt; array(&quot;rename_tag&quot;, &quot;delete_tag&quot;, &quot;edit_tags&quot;));
 
 			return $navs;
 		}
 
 		static function manage_nav_pages($pages) {
-			array_push($pages, &quot;manage_tags&quot;, &quot;bulk_tags&quot;, &quot;rename_tag&quot;, &quot;delete_tag&quot;);
+			array_push($pages, &quot;manage_tags&quot;, &quot;rename_tag&quot;, &quot;delete_tag&quot;, &quot;edit_tags&quot;);
 			return $pages;
 		}
 
@@ -200,6 +200,23 @@
 				                   &quot;url&quot; =&gt; url(&quot;tag/&quot;.$tag2clean[$tag].&quot;/&quot;));
 
 			$admin-&gt;context[&quot;tag_cloud&quot;] = $context;
+
+			if (!Post::any_editable() and !Post::any_deletable())
+				return;
+
+			fallback($_GET['query'], &quot;&quot;);
+			list($where, $params) = keywords(urldecode($_GET['query']), &quot;xml LIKE :query&quot;);
+
+			$visitor = Visitor::current();
+			if (!$visitor-&gt;group()-&gt;can(&quot;view_draft&quot;, &quot;edit_draft&quot;, &quot;edit_post&quot;, &quot;delete_draft&quot;, &quot;delete_post&quot;)) {
+				$where[] = &quot;user_id = :visitor_id&quot;;
+				$params[':visitor_id'] = $visitor-&gt;id;
+			}
+
+			$admin-&gt;context[&quot;posts&quot;] = new Paginator(Post::find(array(&quot;placeholders&quot; =&gt; true,
+			                                                         &quot;drafts&quot; =&gt; true,
+			                                                         &quot;where&quot; =&gt; $where,
+			                                                         &quot;params&quot; =&gt; $params)), 25);
 		}
 
 		public function admin_rename_tag($admin) {
@@ -229,7 +246,33 @@
 					return $admin-&gt;context[&quot;tag&quot;] = array(&quot;name&quot; =&gt; $tag, &quot;clean&quot; =&gt; $tag2clean[$tag]);
 		}
 
+		public function admin_edit_tags($admin) {
+			$sql = SQL::current();
+
+			if (!isset($_GET['id']))
+				error(__(&quot;No ID Specified&quot;), __(&quot;Please specify the ID of the post whose tags you would like to edit.&quot;, &quot;tags&quot;));
+
+			$admin-&gt;context[&quot;post&quot;] = new Post($_GET['id']);
+		}
+
+		public function admin_update_tags($admin) {
+			$sql = SQL::current();
+
+			if (!isset($_POST['hash']) or $_POST['hash'] != Config::current()-&gt;secure_hashkey)
+				show_403(__(&quot;Access Denied&quot;), __(&quot;Invalid security key.&quot;));
+
+			if (!isset($_POST['id']))
+				error(__(&quot;No ID Specified&quot;), __(&quot;Please specify the ID of the post whose tags you would like to edit.&quot;, &quot;tags&quot;));
+
+			$this-&gt;update_post(new Post($_POST['id']));
+
+			Flash::notice(__(&quot;Tags updated.&quot;, &quot;tags&quot;), &quot;/admin/?action=manage_tags&quot;);
+		}
+
 		public function admin_update_tag($admin) {
+			if (!isset($_POST['hash']) or $_POST['hash'] != Config::current()-&gt;secure_hashkey)
+				show_403(__(&quot;Access Denied&quot;), __(&quot;Invalid security key.&quot;));
+
 			$sql = SQL::current();
 
 			$tags = array();
@@ -256,24 +299,51 @@
 		public function admin_delete_tag($admin) {
 			$sql = SQL::current();
 
-			$tags = array();
-			$clean = array();
 			foreach($sql-&gt;select(&quot;tags&quot;,
 				                 &quot;*&quot;,
 				                 &quot;clean LIKE :tag&quot;,
 				                 null,
-				                 array(&quot;:tag&quot; =&gt; &quot;%{{&quot;.$_GET['name'].&quot;}}%&quot;))-&gt;fetchAll() as $tag)
+				                 array(&quot;:tag&quot; =&gt; &quot;%{{&quot;.$_GET['name'].&quot;}}%&quot;))-&gt;fetchAll() as $tag)  {
+				$names = array();
+				foreach (explode(&quot;}},{{&quot;, substr(substr($tag[&quot;tags&quot;], 0, -2), 2)) as $name)
+					if ($name != $_GET['name'])
+						$names[] = &quot;{{&quot;.$name.&quot;}}&quot;;
+
+				$cleans = array();
+				foreach (explode(&quot;}},{{&quot;, substr(substr($tag[&quot;clean&quot;], 0, -2), 2)) as $clean)
+					if ($clean != $_GET['clean'])
+						$cleans[] = &quot;{{&quot;.$clean.&quot;}}&quot;;
+
 				$sql-&gt;update(&quot;tags&quot;,
 				             &quot;id = :id&quot;,
 				             array(&quot;tags&quot; =&gt; &quot;:tags&quot;,
 				                   &quot;clean&quot; =&gt; &quot;:clean&quot;),
 				             array(&quot;:id&quot; =&gt; $tag[&quot;id&quot;],
-				                   &quot;:tags&quot; =&gt; preg_replace(&quot;/\{\{{$_GET['name']}\}\},?/&quot;, &quot;&quot;, $tag[&quot;tags&quot;]),
-				                   &quot;:clean&quot; =&gt; preg_replace(&quot;/\{\{{$_GET['name']}\}\},?/&quot;, &quot;&quot;, $tag[&quot;clean&quot;])));
+				                   &quot;:tags&quot; =&gt; join(&quot;,&quot;, $names),
+				                   &quot;:clean&quot; =&gt; join(&quot;,&quot;, $cleans)));
+			}
 
 			Flash::notice(__(&quot;Tag deleted.&quot;, &quot;tags&quot;), &quot;/admin/?action=manage_tags&quot;);
 		}
 
+		public function admin_bulk_tag($admin) {
+			if (!isset($_POST['hash']) or $_POST['hash'] != Config::current()-&gt;secure_hashkey)
+				show_403(__(&quot;Access Denied&quot;), __(&quot;Invalid security key.&quot;));
+
+			if (empty($_POST['name']) or empty($_POST['post']))
+				redirect(&quot;/admin/?action=manage_tags&quot;);
+
+			$sql = SQL::current();
+
+			foreach ($_POST['post'] as $post_id) {
+				$post = new Post($post_id);
+				$_POST['tags'] = join(&quot;, &quot;, $post-&gt;tags[&quot;unlinked&quot;]).&quot;, &quot;.$_POST['name'];
+				$this-&gt;update_post($post);
+			}
+
+			Flash::notice(__(&quot;Posts tagged.&quot;, &quot;tags&quot;), &quot;/admin/?action=manage_tags&quot;);
+		}
+
 		public function check_route_tag() {
 			global $posts;
 
@@ -430,11 +500,22 @@
 		}
 
 		public function filter_post($post) {
-			if (!isset($post-&gt;unclean_tags))
-				$post-&gt;tags = array(&quot;unlinked&quot; =&gt; array(), &quot;linked&quot; =&gt; array());
-			else
-				$post-&gt;tags = array(&quot;unlinked&quot; =&gt; self::unlinked_tags($post-&gt;unclean_tags),
-				                    &quot;linked&quot;   =&gt; self::linked_tags($post-&gt;unclean_tags, $post-&gt;clean_tags));
+			if (empty($post-&gt;unclean_tags)) {
+				$post-&gt;tags = array(&quot;info&quot; =&gt; array(), &quot;unlinked&quot; =&gt; array(), &quot;linked&quot; =&gt; array());
+				return;
+			}
+
+			list($tags, $clean, $tag2clean) = $this-&gt;parseTags(array($post-&gt;unclean_tags), array($post-&gt;clean_tags));
+
+			$post-&gt;tags = array();
+
+			foreach ($tags as $tag =&gt; $count)
+				$post-&gt;tags[&quot;info&quot;][] = array(&quot;name&quot; =&gt; $tag,
+			                                  &quot;clean&quot; =&gt; $tag2clean[$tag],
+			                                  &quot;url&quot; =&gt; url(&quot;tag/&quot;.$tag2clean[$tag].&quot;/&quot;));
+
+			$post-&gt;tags[&quot;unlinked&quot;] = self::unlinked_tags($post-&gt;unclean_tags);
+			$post-&gt;tags[&quot;linked&quot;]   = self::linked_tags($post-&gt;unclean_tags, $post-&gt;clean_tags);
 		}
 
 		public function sort_tags_name_asc($a, $b) {</diff>
      <filename>modules/tags/tags.php</filename>
    </modified>
    <modified>
      <diff>@@ -27,7 +27,7 @@
 							{% endif %}
 							{% if post.tags.linked | length &gt; 0 %}
 							|
-							${ &quot;Tags&quot; | translate }: ${ post.tags.linked | join }
+							${ &quot;Tags&quot; | translate }: ${ post.tags.linked | join(&quot;, &quot;) }
 							{% endif %}
 						&lt;/span&gt;
 {% if visitor.group.can(&quot;edit_post&quot;, &quot;delete_post&quot;) %}</diff>
      <filename>themes/stardust/content/post.twig</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>0e91f8164067b11245d1cc918aab3325352f9ea2</id>
    </parent>
  </parents>
  <author>
    <name>Alex Suraci</name>
    <email>i.am@toogeneric.com</email>
  </author>
  <url>http://github.com/vito/chyrp/commit/4e3143b9f0a2f79b46f8610c0b76a55b25c1291f</url>
  <id>4e3143b9f0a2f79b46f8610c0b76a55b25c1291f</id>
  <committed-date>2008-08-29T22:14:49-07:00</committed-date>
  <authored-date>2008-08-29T22:14:49-07:00</authored-date>
  <message>Added bulk tag managing and bulk post tagging. [#125 state:resolved]</message>
  <tree>ae7ef3e7cd5e79e6fa4a6fcb18e4b8ef5837b572</tree>
  <committer>
    <name>Alex Suraci</name>
    <email>i.am@toogeneric.com</email>
  </committer>
</commit>
