[request] Show thumbs in Search Results
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexAdd-Ons & Blocks
Author Message
greenday2k
Forum Admin


Joined: Aug 11, 2005
Posts: 484
Location: CO

PostPost subject: [request] Show thumbs in Search Results
Posted: Wed Sep 24, 2008 10:22 pm
Reply with quote

The ability to add a custom search.inc (ModuleName_search class) file to each module to centralize searchs is great, but now users are not just searching for TEXT, they also are looking for images or video, o for items (in example CDS, computer parts parts etc) where a little image (if exists)showed on results would improve usability and functionality to the search.

Also, using the main search module for coppermine only shows text when youre looking for images... Laughing (but the coppermine search feature show images in results Cool !).

IMO this can be achieved easy, adding customs templates for search results
since every search class for every module will work different, or add support for the
"results" handler to show thumbs and the ability to be templated.

_________________
www.greenday2k.net



greenday2k's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website MSN Messenger Yahoo Messenger
greenday2k
Forum Admin


Joined: Aug 11, 2005
Posts: 484
Location: CO

PostPost subject: Re: [request] Show thumbs in Search Results
Posted: Sun Oct 05, 2008 7:51 pm
Reply with quote

mmm Bump! ;D id really like to have this.
_________________
www.greenday2k.net



greenday2k's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website MSN Messenger Yahoo Messenger
DJ Maze
Developer


Joined: Apr 19, 2004
Posts: 5668
Location: http://tinyurl.com/5z8dmv

PostPost subject: Re: [request] Show thumbs in Search Results
Posted: Sun Oct 05, 2008 10:31 pm
Reply with quote

Well, you can create a hook to coppermine and return <img>?

DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Fedora 12 / 2.2.15 / 5.1.47 / 5.3.3 / CVS
Back to top
View user's profile Visit poster's website Yahoo Messenger
Phoenix
Site Admin


Joined: Apr 19, 2004
Posts: 8729
Location: Netizen

PostPost subject: Re: [request] Show thumbs in Search Results
Posted: Sun Oct 05, 2008 11:50 pm
Reply with quote

For current and older DF versions you can modify this section of search.inc
PHP:
<?php
$ccnt = $db->sql_query("SELECT p.filename, p.filepath, p.title, p.caption, p.keywords, p.user1, p.user2, p.user3, p.user4, p.pid, p.aid FROM {$CONFIG['TABLE_PICTURES']} AS p INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS a ON (p.aid = a.aid AND ".VIS_GROUPS.") WHERE MATCH(filename, p.title, caption, keywords,user1,user2,user3,user4) AGAINST ('$search*' IN BOOLEAN MODE) AND approved='1' GROUP BY pid LIMIT $first,".($limit+1),false,__FILE__,__LINE__);
$nrows = $db->sql_numrows($ccnt);

while (list($filename, $filepath, $title, $caption, $keywords, $user1, $user2, $user3, $user4, $pid, $aid) = $db->sql_fetchrow($ccnt)) {
if ($title != '') {
// do nothing.
} else if ($caption != '') {
$title = $caption;
} else if ($keywords != '') {
$title = $keywords;
} else if ($user1 != '') {
$title = $user1;
} else if ($user2 != '') {
$title = $user2;
} else if ($user3 != '') {
$title = $user3;
} else if ($user4 != '') {
$title = $user4;
} else if ($filename != '') {
$title = $filename;
} else {
$title = 'Click to view image';
}
$item['title'] = substr($title, 0, 64);
$item['url']= getlink("$cpg_dir&amp;file=displayimage&amp;album=$aid&amp;pid=$pid");
$item['short_text'] = substr(strip_tags($caption), 0, 256);
$item['image'] = $filepath.'thumb_'.$filename;
$this->add_result($item);
}
Similarly, you can already do the same for any module you have.


Phoenix's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexAdd-Ons & Blocks All times are GMT
Page 1 of 1


Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Dedicated Server & Bandwidth Sponsored by DedicatedNOW
User Info [x]

Welcome Anonymous

Nickname
Password
(Register)

Last CVS commits [x]

Languages [x]

Community [x]

Support for DragonflyCMS in a other languages:

Deutsch
Español

X-links [x]
UltraEdit Browse Happy logo Firefox MySQL PostgreSQL Valid CSS! Valid XHTML 1.0! Unicode Encoded Badge NukeBiz Resources Raven DragonflyCMS Dedicated Now InsideSupport Lampe Berger

Preview theme [x]
Each user can view the site with a different theme.
Themes marked with a * also change the forum look.


You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
This page generated in 1.8083 seconds with 19 DB Queries in 0.1374 seconds
Memory Usage: 2.89 MB
Interactive software released under GNU GPL, Code Credits, Privacy Policy