Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43259
Total Topics: 7518
Most Online Today: 297
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 281
Total: 281

Author Topic: Not ordering images correctly if numbers present in image title.  (Read 5507 times)

0 Members and 1 Guest are viewing this topic.

Offline Menard9

  • Member
  • *
  • Posts: 12
    • View Profile
Check this out.

http://zombiedeathhouse.com/horrorforum/index.php?action=gallery;cat=19

I always set it up to order them by 'title, ascending' and this is what I get.  It gives me exactly the same problem in reverse if you try to order by 'title, descending'.  It has always done this, even with my main, really large gallery; I just didn't get around to asking about it until now.

And yes, I have upgraded and it went flawlessly.  :)

Any ideas?
« Last Edit: October 30, 2008, 10:25:56 pm by Menard9 »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Not ordering images correctly if numbers present in image title.
« Reply #1 on: November 04, 2008, 08:26:08 pm »

This is a little tricky you can try this and sees if it works.

For SMF 1.1.x

Open Gallery.template.php
Find
Code: [Select]
WHERE  p.ID_CAT = $cat AND p.approved = 1 ORDER BY $sortby $orderby
Change to
Code: [Select]
WHERE  p.ID_CAT = $cat AND p.approved = 1 ORDER BY $sortby $orderby   , LENGTH(p.title) DESC
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 Menard9

  • Member
  • *
  • Posts: 12
    • View Profile
Re: Not ordering images correctly if numbers present in image title.
« Reply #2 on: February 06, 2009, 02:39:46 am »
Okay, sorry for the late reply.  I tried this, but to no avail.  I went into FTP, DL'd the php doc., opened and edited it using 'Find Next' in Note Pad, saved and FTP'd it back and noticed no change at all.  Attached, you'll find the altered gallery.template.php doc you had me change as indicated above.

I did this just tonight, a few days after the latest upgrade, which went smoothly.  Any other guesses as to how to get things to ascend/descend correctly with numbers in the image title?

Offline willerby

  • Member
  • *
  • Posts: 29
    • View Profile
Re: Not ordering images correctly if numbers present in image title.
« Reply #3 on: February 06, 2009, 03:32:41 am »
I had this problem too as had set default to order by Title Ascending where the title was a vehicle year and chassis number. The issue is because the Title is text and not a numerical value so any code fix would need to convert the text to a number with some sort of 'Value' command (sorry don't know what that would be in php). But it wouldn't work in your case as you have text in there too.

Anyway to fix in your gallery, just rename the fields with suffix numbers 1-9 as suffixes 01-09 (the text sort just looks at the next text character and the characters 11 come before 2 but not before 02)

Thats how I fixed it

Offline Menard9

  • Member
  • *
  • Posts: 12
    • View Profile
Re: Not ordering images correctly if numbers present in image title.
« Reply #4 on: February 06, 2009, 01:01:52 pm »
Clever man!  It worked wonderfully.  Needless to say, after I read your suggestion I felt like a complete dunce.  I numbered with 001, 002, 003...etc.  That ought to keep me good through the first 999.   :)

 

Related Topics

  Subject / Started by Replies Last post
5 Replies
6630 Views
Last post September 24, 2007, 05:10:38 am
by Scy
2 Replies
6209 Views
Last post October 15, 2007, 10:00:33 pm
by ApplianceJunk
0 Replies
4422 Views
Last post December 02, 2007, 07:46:28 pm
by Lil Puppy
5 Replies
4230 Views
Last post June 09, 2012, 03:28:59 pm
by Michel68
3 Replies
4205 Views
Last post September 05, 2014, 01:20:49 pm
by SMFHacks

+- Recent Topics

No thumbnails on new uploads by SMFHacks
March 27, 2024, 02:10:41 pm

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

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

Powered by EzPortal