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: 241
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 239
Total: 239

Author Topic: Error in SQL-Syntax by Sorting Pics  (Read 5956 times)

0 Members and 1 Guest are viewing this topic.

Offline diskusforum

  • Member
  • *
  • Posts: 14
    • View Profile
Error in SQL-Syntax by Sorting Pics
« on: October 16, 2012, 10:55:30 pm »
Hello,

if I start sorting the pics by rated or anything else than the default, I got this error-message:
Quote
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DESC
LIMIT 0,20' at line 8
Datei: /var/www/web44/web/Sources/Load.php(2219) : eval()'d code
Zeile: 6560

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Error in SQL-Syntax by Sorting Pics
« Reply #1 on: October 16, 2012, 11:12:42 pm »
What SMF version?
And is when you do the sorting dropdown in a category or when stetting up a category and setting the sorting order?
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 SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Error in SQL-Syntax by Sorting Pics
« Reply #2 on: October 17, 2012, 09:19:04 pm »
Fixed in SMF Gallery 4.0.9
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 diskusforum

  • Member
  • *
  • Posts: 14
    • View Profile
Re: Error in SQL-Syntax by Sorting Pics
« Reply #3 on: October 25, 2012, 11:01:01 pm »
Hello,

me again...

I installed 4.0.9a and now I'm able to sort by date, most viewn, most commended an most rated.

But there still seems to be a bug in the query for most rated!
If I start the query most rated, I got these results:
namepoints5 points4 points3 points2 points1 pointsratingsaverage
"Points"63112---134,85
"Gruppe"33413--93,67
"Kalender 2013a"53561-1134,08
"Kalender 2013b"44515--114,00

Normaly the ranking should be:
1.) "Points"
2.) "Kalender 2013a"
3.) "Kalender 2013b"
4.) "Gruppe"

Please check the query (or post the code) and fix the problem (or tell me, which php-file includes this strange query).

Thanks!

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Error in SQL-Syntax by Sorting Pics
« Reply #4 on: October 25, 2012, 11:17:57 pm »
Ratings are on the following calculation
(rating / totalratings ) AS ratingaverage



The query is themes/default/gallery.template.php

In the function template_image_listing
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 diskusforum

  • Member
  • *
  • Posts: 14
    • View Profile
Re: Error in SQL-Syntax by Sorting Pics
« Reply #5 on: October 29, 2012, 12:30:32 am »
I changed the code to
Code: [Select]
case 'mostrated': $sortby = 'rating';
break;

Now it works as it should!

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Error in SQL-Syntax by Sorting Pics
« Reply #6 on: October 29, 2012, 12:35:44 am »
That will just by overall score though and not the average
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 diskusforum

  • Member
  • *
  • Posts: 14
    • View Profile
Re: Error in SQL-Syntax by Sorting Pics
« Reply #7 on: October 30, 2012, 12:12:08 am »
Your code also don't sort by the average, or why is the ranking:
1.) 4,85
2.) 3,67
3.) 4,08
4.) 4,00

Neither by the result, nor by the average there is a logical result for the second place...

Offline Jonas1975

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
    • The Mobile Photography Blog
Re: Error in SQL-Syntax by Sorting Pics
« Reply #8 on: October 31, 2012, 04:56:52 am »
The sort by rating is not that simple.

I think the sort now is being made by Rating Average and Number of Ratings.

If you sort only by Rating Average, a new photo that it's given a 5 stars, will be immediately at the top of the Top Rated, which doesn't make sense at all against other photos that had much more ratings given.

I think the best was to sort by the number of ratings given for each classification (nš of 5 stars, nš of 4 stars, etc...). So a pic with 2 votes of 5 stars and 1 vote of 4 stars would still be ahead of one with only 1 vote of 5 stars.

 

Related Topics

  Subject / Started by Replies Last post
4 Replies
32112 Views
Last post September 02, 2008, 08:06:08 pm
by SMFHacks
2 Replies
7926 Views
Last post January 24, 2009, 09:28:41 am
by cepsi
1 Replies
4046 Views
Last post April 02, 2009, 09:06:46 pm
by SMFHacks
4 Replies
5336 Views
Last post May 09, 2009, 09:21:08 am
by SMFHacks
16 Replies
20123 Views
Last post October 03, 2017, 08:49:37 pm
by drewactual

+- 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