Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4260
Latest: Verrick
New This Month: 0
New This Week: 0
New Today: 0
Stats
Total Posts: 43306
Total Topics: 7525
Most Online Today: 662
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 248
Total: 248

Author Topic: tag cloud on search results  (Read 2845 times)

0 Members and 1 Guest are viewing this topic.

Offline trifox

  • Member
  • *
  • Posts: 32
    • View Profile
    • fractalforums.com
tag cloud on search results
« on: February 23, 2015, 06:04:43 pm »
i always wanted to display keywords as folder structure, more or less it is enough to display the keywords for a search result, this makes browsing a large gallery quite interesting

its not really perfekt for inclusion, but an option for the gallery: "include tag cloud on search results" would be just perfect ;)

its just working with the keywords already obtained by search query

here you can see the adjustment in action:
http://www.fractalforums.com/index.php?action=gallery;sa=search2;key=hybrid

i inserted the following code to the gallery.template.php - right in the "template_search_results()" method, before the for-loop that outputs the results
Code: [Select]
// mod ck: build search result keywords
$keywords=array();
while($row = mysql_fetch_assoc($dbresult))
{
$keys = explode(" ", $row["keywords"]);
for($i=0;$i<sizeof($keys);$i++){
$keywords[$keys[$i]]++;
}

}
// calculate means
$max=0;
foreach ($keywords as $key => $value) {
if($value>$max)
{
$max=$value;
}
}

echo '
<tr class="catbg">
<td align="center" colspan="' . $maxrowlevel . '">Keywords</td>
</tr>
<tr  >
<td align="center" colspan="' . $maxrowlevel . '">

';
foreach ($keywords as $key => $value) {
 echo '<a href="/index.php?action=gallery;sa=search2;key='.$key.'" style="font-size: '.(100+(($value/$max)*100-25)).'%" >'.$key.'</a> ';
}
echo '</td></tr>';
mysql_data_seek($dbresult,0);
// mod ck: build search results keyword list end

 

Related Topics

  Subject / Started by Replies Last post
0 Replies
5629 Views
Last post July 11, 2008, 08:37:51 am
by Hoochie Coochie Man
4 Replies
5364 Views
Last post May 20, 2010, 11:50:40 pm
by Vincent Volmer
2 Replies
3461 Views
Last post November 15, 2012, 07:46:16 pm
by ApplianceJunk
1 Replies
2645 Views
Last post September 02, 2014, 04:37:43 pm
by SMFHacks
0 Replies
2891 Views
Last post June 01, 2015, 12:49:03 am
by shuban

+- Recent Topics

Attachment images Upsidedown or Sideways by SMFHacks
June 10, 2024, 04:00:21 pm

“Insert from Gallery” by donk
June 10, 2024, 01:26:57 pm

Pretty Urls extras by SMFHacks
May 13, 2024, 10:28:54 am

Mod question by Verrick
May 11, 2024, 02:42:50 pm

i have paid but cant download ad pro. by SMFHacks
May 02, 2024, 11:29:38 pm

Please Help! by SMFHacks
April 17, 2024, 08:04:55 am

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

Powered by EzPortal