Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4269
Latest: Gatux
New This Month: 0
New This Week: 0
New Today: 0
Stats
Total Posts: 43594
Total Topics: 7568
Most Online Today: 128
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 51
Total: 51

Author Topic: tag cloud on search results  (Read 2927 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
5657 Views
Last post July 11, 2008, 08:37:51 am
by Hoochie Coochie Man
4 Replies
5401 Views
Last post May 20, 2010, 11:50:40 pm
by Vincent Volmer
2 Replies
3509 Views
Last post November 15, 2012, 07:46:16 pm
by ApplianceJunk
1 Replies
2686 Views
Last post September 02, 2014, 04:37:43 pm
by SMFHacks
0 Replies
2940 Views
Last post June 01, 2015, 12:49:03 am
by shuban

+- Recent Topics

December 2024 Sale! by SMFHacks
December 02, 2024, 10:30:38 pm

Denying members some admin settings by rickk
November 17, 2024, 12:02:55 pm

Weird setup by SMFHacks
November 07, 2024, 06:37:41 am

Restoring a deleted photo by Monocero
November 01, 2024, 04:23:56 am

Gallery Pro reinstalation by Lirorobert
October 14, 2024, 01:43:43 am

Move picture from main gallery to user gallery by SMFHacks
October 11, 2024, 09:11:00 pm

quoting part of message by Lirorobert
October 04, 2024, 03:21:40 pm

Does SMF Gallery support by SMFHacks
October 02, 2024, 06:14:26 am

Item count on Gallery Tab shows double by SMFHacks
September 26, 2024, 12:59:20 pm

Forum post missing when image over 4000x pixels is uploaded to gallery by Michel68
September 24, 2024, 01:37:17 pm

Powered by EzPortal