Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43295
Total Topics: 7523
Most Online Today: 186
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 200
Total: 200

Author Topic: Finding related Gallery items based on description is title search fails  (Read 2957 times)

0 Members and 1 Guest are viewing this topic.

Offline shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
Hello,

The current code used to find related gallery items is located below. Curious if we can add an argument where if the results show up as nothing, it does a search for within the picture descriptions instead.

Code: [Select]
function Gallery_FindRelated($title, $score = false)
{
global $db_prefix;

$result = db_query("SELECT ID_PICTURE, MATCH(title) AGAINST('$title') AS score
FROM {$db_prefix}gallery_title_cache
WHERE MATCH(title) AGAINST('$title')
ORDER BY MATCH(title) AGAINST('$title') DESC", __FILE__, __LINE__);

$data = array();

while ($row = mysql_fetch_assoc($result))
{
if ($score == false)
$data[] = $row['ID_PICTURE'];
else
$data[] = array($row['ID_PICTURE'], $row['score']);
}

return $data;
}

Is that possible?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Finding related Gallery items based on description is title search fails
« Reply #1 on: November 28, 2016, 04:50:30 pm »
Wouldn't be easy. Only titles are stored in fulltext tables in gallery_title_cache database table. A similar one would need to be done with descriptions. But could cause issues with larger gallery sites since it has to do search against all the descriptions.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/
Like Like x 1 View List

Offline shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
Re: Finding related Gallery items based on description is title search fails
« Reply #2 on: November 28, 2016, 05:05:04 pm »
I figured shortly after I posted, thanks for confirming

 

Related Topics

  Subject / Started by Replies Last post
4 Replies
8329 Views
Last post December 13, 2008, 07:50:18 pm
by SMFHacks
2 Replies
4406 Views
Last post September 14, 2011, 01:42:43 pm
by frustrated
13 Replies
8492 Views
Last post November 15, 2012, 08:18:06 pm
by tekgik
2 Replies
14469 Views
Last post February 06, 2014, 08:21:06 am
by Jonas1975
6 Replies
4596 Views
Last post September 22, 2014, 02:38:43 pm
by shuban

+- Recent Topics

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

No thumbnails on new uploads by Tonyvic
March 29, 2024, 06:26:18 am

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

Powered by EzPortal