<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>Tags Suggest</title>
		<link>http://org.wikidot.com/forum/t-65829/tags-suggest</link>
		<description>Posts in the discussion thread &quot;Tags Suggest&quot;</description>
				<copyright></copyright>
		<lastBuildDate>Sat, 11 Apr 2026 22:54:01 +0000</lastBuildDate>
		
					<item>
				<guid>http://org.wikidot.com/forum/t-65829#post-187449</guid>
				<title>Tags Suggest</title>
				<link>http://org.wikidot.com/forum/t-65829/tags-suggest#post-187449</link>
				<description></description>
				<pubDate>Mon, 09 Jun 2008 11:24:51 +0000</pubDate>
								<wikidot:authorUserId>106332</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Hi all,<br /> I'm trying to implement some new features in wikidot v1<br /> one of these is &quot;tags suggest&quot;. this feature works as usersearch do. while you type a tag in the form PageTagsModule, it &quot;suggest&quot; you what similar tags you have already used in other pages.</p> <p>this is the main function (a poor copy&amp;past&amp;modify from PageLookupQModule&#8230;.):</p> <div class="code"> <pre><code>class TagsLookupQModule extends QuickModule { public function process($data){ // does not use data $search = $_GET['q']; $siteId = $_GET['s']; if(!is_numeric($siteId)) return; if($search == null || strlen($search) ==0) return; $search1 = pg_escape_string(preg_quote($search)); $search2 = pg_escape_string($search); Database::init(); $q1 = &quot;SELECT tag, tag_id FROM page_tag WHERE &quot; . &quot;tag ~* '^$search1' AND tag != '$search2' AND site_id = '$siteId'&quot;; $q1 .= &quot;ORDER BY tag LIMIT 20&quot;; $q2 = &quot;SELECT tag, user_id FROM page_tag WHERE &quot; . &quot;tag = '$search2' AND site_id ='$siteId'&quot;; $db = Database::connection(); $result1 = $db-&gt;query($q1); $result1 = $result1-&gt;fetchAll(); $result2 = $db-&gt;query($q2); $result2 = $result2-&gt;fetchAll(); if($result1 == null &amp;&amp; $result2 != null) $result = $result2; if($result2 == null &amp;&amp; $result1 != null) $result = $result1; if($result1 != null &amp;&amp; $result2 != null){ $result = array_merge($result2, $result1); } return array('tags' =&gt; $result); } }</code></pre></div> <p>now I need to modify PageTagsModule.js in order to allow search operation.<br /> anyone can help me? I think this feature would be very usefull for everyone.</p> <p>thanks,<br /> Gio</p> 
				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>