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: 3
New This Week: 0
New Today: 0
Stats
Total Posts: 43301
Total Topics: 7525
Most Online Today: 102
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 61
Total: 61

Author Topic: SMF 2.1.4 Search  (Read 37787 times)

0 Members and 1 Guest are viewing this topic.

Offline Anmer

  • SMF Gallery Pro Customer
  • Full Member
  • *****
  • Posts: 106
    • View Profile
Re: SMF 2.1.4 Search
« Reply #15 on: September 18, 2023, 01:14:25 pm »
"If I do the same search on a Category, I don't get any results where the input criteria exists in the description. "
Do you have the search description box checked?

No.  Unchecked in both searches.

If you have phpmyadmin I would the SQL query in there and see what data is displayed.

What query?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16455
    • View Profile
Re: SMF 2.1.4 Search
« Reply #16 on: September 18, 2023, 03:34:11 pm »
The first query output of your post

Code: [Select]
SELECT
p.id_picture, p.id_cat, p.commenttotal, p.keywords, p.filesize, p.thumbfilename, p.approved, p.views,
p.id_member, m.real_name, p.date, p.mature, v.id_picture as unread, mg.online_color,
p.title, p.rating, p.totalratings, p.totallikes, (p.rating / p.totalratings ) AS ratingaverage
FROM {db_prefix}gallery_pic as p
LEFT JOIN {db_prefix}members AS m ON (m.id_member = p.id_member)
LEFT JOIN {db_prefix}gallery_usersettings AS s ON (s.id_member = m.id_member)
LEFT JOIN {db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(m.ID_GROUP = 0, m.ID_POST_GROUP, m.ID_GROUP))
LEFT JOIN {db_prefix}gallery_log_mark_view AS v ON (p.id_picture = v.id_picture AND v.id_member = 1 AND v.user_id_cat = p.USER_ID_CAT)
LEFT JOIN {db_prefix}gallery_exif_data AS e ON (e.id_picture = p.id_picture)
LEFT JOIN {db_prefix}gallery_catperm AS c ON (c.id_group IN (1,8,9) AND c.id_cat = p.id_cat)

WHERE (((s.private =0 OR s.private IS NULL ) AND (s.password = '' OR s.password IS NULL ) AND p.USER_ID_CAT !=0 AND p.approved =1) OR (p.approved =1 AND p.USER_ID_CAT =0 AND (c.view IS NULL OR c.view =1))) AND p.approved = 1 AND (p.title LIKE '%ANA%' )
GROUP BY p.id_picture ORDER BY p.id_picture DESC
LIMIT 0,126
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/

Offline Anmer

  • SMF Gallery Pro Customer
  • Full Member
  • *****
  • Posts: 106
    • View Profile
Re: SMF 2.1.4 Search
« Reply #17 on: September 19, 2023, 03:48:13 am »
Maybe I did something wrong but running the SQL against the forum db returns an error:

Code: [Select]
Error
Static analysis:

32 errors were found during analysis.

Unexpected character. (near "{" at position 298)
Unexpected character. (near "}" at position 308)
Unexpected character. (near "{" at position 337)
Unexpected character. (near "}" at position 347)
Unexpected character. (near "{" at position 403)
Unexpected character. (near "}" at position 413)
Unexpected character. (near "{" at position 482)
Unexpected character. (near "}" at position 492)
Unexpected character. (near "{" at position 590)
Unexpected character. (near "}" at position 600)
Unexpected character. (near "{" at position 726)
Unexpected character. (near "}" at position 736)
Unexpected character. (near "{" at position 804)
Unexpected character. (near "}" at position 814)
An alias was previously found. (near "}" at position 308)
Unexpected token. (near "}" at position 308)
Unexpected token. (near "gallery_pic" at position 309)
Unrecognised keyword. (near "as" at position 321)
Unexpected token. (near "p" at position 324)
An alias was previously found. (near "}" at position 347)
Unrecognised keyword. (near "AS" at position 356)
Unexpected token. (near "m" at position 359)
Unexpected token. (near "m" at position 365)
Unexpected token. (near "." at position 366)
Unexpected token. (near "id_member" at position 367)
Unexpected token. (near "=" at position 377)
Unexpected token. (near "p" at position 379)
Unexpected token. (near "." at position 380)
Unexpected token. (near "id_member" at position 381)
Unexpected token. (near ")" at position 390)
This type of clause was previously parsed. (near "LEFT JOIN" at position 393)
Unrecognised statement type. (near "LEFT JOIN" at position 393)
SQL query: Copy Documentation

SELECT p.id_picture, p.id_cat, p.commenttotal, p.keywords, p.filesize, p.thumbfilename, p.approved, p.views, p.id_member, m.real_name, p.date, p.mature, v.id_picture as unread, mg.online_color, p.title, p.rating, p.totalratings, p.totallikes, (p.rating / p.totalratings ) AS ratingaverage FROM {db_prefix}gallery_pic as p LEFT JOIN {db_prefix}members AS m ON (m.id_member = p.id_member) LEFT JOIN {db_prefix}gallery_usersettings AS s ON (s.id_member = m.id_member) LEFT JOIN {db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(m.ID_GROUP = 0, m.ID_POST_GROUP, m.ID_GROUP)) LEFT JOIN {db_prefix}gallery_log_mark_view AS v ON (p.id_picture = v.id_picture AND v.id_member = 1 AND v.user_id_cat = p.USER_ID_CAT) LEFT JOIN {db_prefix}gallery_exif_data AS e ON (e.id_picture = p.id_picture) LEFT JOIN {db_prefix}gallery_catperm AS c ON (c.id_group IN (1,8,9) AND c.id_cat = p.id_cat) WHERE (((s.private =0 OR s.private IS NULL ) AND (s.password = '' OR s.password IS NULL ) AND p.USER_ID_CAT !=0 AND p.approved =1) OR (p.approved =1 AND p.USER_ID_CAT =0 AND (c.view IS NULL OR c.view =1))) AND p.approved = 1 AND (p.title LIKE '%ANA%' ) GROUP BY p.id_picture ORDER BY p.id_picture DESC LIMIT 0,126;

MySQL said: Documentation

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '}gallery_pic as p
LEFT JOIN {db_prefix}members AS m ON (m.id_member = p.id_m...' at line 5

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16455
    • View Profile
Re: SMF 2.1.4 Search
« Reply #18 on: September 19, 2023, 07:59:18 am »
Ah forgot about db_prefix replacements try

Code: [Select]
SELECT
p.id_picture, p.id_cat, p.commenttotal, p.keywords, p.filesize, p.thumbfilename, p.approved, p.views,
p.id_member, m.real_name, p.date, p.mature, v.id_picture as unread, mg.online_color,
p.title, p.rating, p.totalratings, p.totallikes, (p.rating / p.totalratings ) AS ratingaverage
FROM smf_gallery_pic as p
LEFT JOIN smf_members AS m ON (m.id_member = p.id_member)
LEFT JOIN smf_gallery_usersettings AS s ON (s.id_member = m.id_member)
LEFT JOIN smf_membergroups AS mg ON (mg.ID_GROUP = IF(m.ID_GROUP = 0, m.ID_POST_GROUP, m.ID_GROUP))
LEFT JOIN smf_gallery_log_mark_view AS v ON (p.id_picture = v.id_picture AND v.id_member = 1 AND v.user_id_cat = p.USER_ID_CAT)
LEFT JOIN smf_gallery_exif_data AS e ON (e.id_picture = p.id_picture)
LEFT JOIN smf_gallery_catperm AS c ON (c.id_group IN (1,8,9) AND c.id_cat = p.id_cat)

WHERE (((s.private =0 OR s.private IS NULL ) AND (s.password = '' OR s.password IS NULL ) AND p.USER_ID_CAT !=0 AND p.approved =1) OR (p.approved =1 AND p.USER_ID_CAT =0 AND (c.view IS NULL OR c.view =1))) AND p.approved = 1 AND (p.title LIKE '%ANA%' )
GROUP BY p.id_picture ORDER BY p.id_picture DESC
LIMIT 0,126
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/

Offline Anmer

  • SMF Gallery Pro Customer
  • Full Member
  • *****
  • Posts: 106
    • View Profile
Re: SMF 2.1.4 Search
« Reply #19 on: September 19, 2023, 08:15:21 am »
Different error.

Is it a db path issue?

Code: [Select]
Error
SQL query: Copy Documentation


SELECT
p.id_picture, p.id_cat, p.commenttotal, p.keywords, p.filesize, p.thumbfilename, p.approved, p.views,
p.id_member, m.real_name, p.date, p.mature, v.id_picture as unread, mg.online_color,
p.title, p.rating, p.totalratings, p.totallikes, (p.rating / p.totalratings ) AS ratingaverage
FROM smf_gallery_pic as p
LEFT JOIN smf_members AS m ON (m.id_member = p.id_member)
LEFT JOIN smf_gallery_usersettings AS s ON (s.id_member = m.id_member)
LEFT JOIN smf_membergroups AS mg ON (mg.ID_GROUP = IF(m.ID_GROUP = 0, m.ID_POST_GROUP, m.ID_GROUP))
LEFT JOIN smf_gallery_log_mark_view AS v ON (p.id_picture = v.id_picture AND v.id_member = 1 AND v.user_id_cat = p.USER_ID_CAT)
LEFT JOIN smf_gallery_exif_data AS e ON (e.id_picture = p.id_picture)
LEFT JOIN smf_gallery_catperm AS c ON (c.id_group IN (1,8,9) AND c.id_cat = p.id_cat)

WHERE (((s.private =0 OR s.private IS NULL ) AND (s.password = '' OR s.password IS NULL ) AND p.USER_ID_CAT !=0 AND p.approved =1) OR (p.approved =1 AND p.USER[...]
MySQL said: Documentation

#1146 - Table 'ccfcbasi_KrystalOne.smf_gallery_pic' doesn't exist

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16455
    • View Profile
Re: SMF 2.1.4 Search
« Reply #20 on: September 19, 2023, 08:25:22 am »
Could be if your database tables have a different prefix under than smf_
You would need to replace smf_ with your forums database prefix
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/

Offline Anmer

  • SMF Gallery Pro Customer
  • Full Member
  • *****
  • Posts: 106
    • View Profile
Re: SMF 2.1.4 Search
« Reply #21 on: September 19, 2023, 11:09:26 am »
Thanks, that worked.  Prefix was "SM" not "SMF".

The SQL returned 126 rows compared to over 800 using GalleryPro search with Search Picture Description unchecked.  Sample results attached.

Not sure where we go next?

Offline Anmer

  • SMF Gallery Pro Customer
  • Full Member
  • *****
  • Posts: 106
    • View Profile
Re: SMF 2.1.4 Search
« Reply #22 on: September 19, 2023, 11:13:44 am »
Hmm, not sure about the results?  Just noticed the list displayed is incomplete.  The SQL shows:

LIMIT 0,126

If I change this to a higher number I still only get to see 126 rows but there are more available?

Edit

Resolved the limit issue and can confirm the rogue files are not included in the SQL results.

The GalleryPro search with Search Picture Description unchecked includes results that aren't in the SQL search.
« Last Edit: September 19, 2023, 11:34:35 am by Anmer »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16455
    • View Profile
Re: SMF 2.1.4 Search
« Reply #23 on: September 19, 2023, 11:50:09 am »
In the phpadmin screenshot the results look correct they all have "ana" inside the title column
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/

Offline Anmer

  • SMF Gallery Pro Customer
  • Full Member
  • *****
  • Posts: 106
    • View Profile
Re: SMF 2.1.4 Search
« Reply #24 on: September 19, 2023, 01:27:45 pm »
Yes I can confirm they're correct.  How do we fix the GalleryPro search?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16455
    • View Profile
Re: SMF 2.1.4 Search
« Reply #25 on: September 19, 2023, 01:31:26 pm »
Hmm not sure why it would be broke then... Since that is the same query...the gallery used for your logs to pull the data.
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/

Offline Anmer

  • SMF Gallery Pro Customer
  • Full Member
  • *****
  • Posts: 106
    • View Profile
Re: SMF 2.1.4 Search
« Reply #26 on: September 19, 2023, 01:47:42 pm »
I just did a GalleryPro search for "ANA" and left all options unchecked.  It retuuned over 800 results!

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16455
    • View Profile
Re: SMF 2.1.4 Search
« Reply #27 on: September 19, 2023, 01:57:34 pm »
I would need a copy of your sm_gallery tables if you can export for phpmyadmin for me to further look into this.
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/

Offline Anmer

  • SMF Gallery Pro Customer
  • Full Member
  • *****
  • Posts: 106
    • View Profile
Re: SMF 2.1.4 Search
« Reply #28 on: September 19, 2023, 02:54:57 pm »
Do you need all the sm_gallery tables?

I can count 26.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16455
    • View Profile
Re: SMF 2.1.4 Search
« Reply #29 on: September 19, 2023, 02:58:28 pm »
yes
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/

 

Related Topics

  Subject / Started by Replies Last post
0 Replies
7872 Views
Last post September 11, 2009, 06:58:59 am
by Sicarius
2 Replies
14520 Views
Last post February 06, 2014, 08:21:06 am
by Jonas1975
1 Replies
11313 Views
Last post March 20, 2015, 10:53:55 pm
by SMFHacks
6 Replies
10480 Views
Last post October 10, 2020, 01:13:00 pm
by Shades
5 Replies
9438 Views
Last post September 04, 2021, 06:33:09 pm
by SMFHacks

+- Recent Topics

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

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

Powered by EzPortal