Author Topic: [Mod] Create Sort Order for each category from Admin Panel  (Read 92895 times)

0 Members and 1 Guest are viewing this topic.

Offline Sopur

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
    • Bilder des Harassenlaufs in Basel
Re: [Mod] Create Sort Order for each category from Admin Panel
« Reply #45 on: November 19, 2005, 09:22:22 PM »
Ich hab's jetzt so einigermassen geschafft, ich denke, es funktioniert.
Was ich aber jetzt für ein Problem habe: jedes mal, wenn ich irgendeine Kategorie bearbeite oder erstelle bringt es mir die Reihenfolge der Kategorien durcheinander. Was kann man dagegen tun?
Vielen Dank für Eure Hilfe!
M
F
G
Sopur

Offline fatro

  • Pre-Newbie
  • Posts: 9
    • View Profile
Re: [Mod] Create Sort Order for each category from Admin Panel
« Reply #46 on: July 15, 2006, 03:41:22 PM »
hello guys!

I already install this mod, It's worked fine but I found some problem.
It's only sort the thumbnails! when I navigate with "Previous" or "Next" button,
It's still using the default Sort order set at the Admin Panel - Settings Page

What should I do to fix that up??

thanx in advance
fatro
Fatro using 4images Vesion 1.7.4 :mrgreen:

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Create Sort Order for each category from Admin Panel
« Reply #47 on: July 15, 2006, 07:08:03 PM »
Not tested.
in details.php find:
Code: [Select]
          ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ASC";
Replace with:
Code: [Select]
          ORDER BY ".$cat_cache[$image_row['cat_id']]['sort_field']." ".$cat_cache[$image_row['cat_id']]['sort_order']." , image_id ASC";
« Last Edit: July 15, 2006, 11:03:02 PM by V@no »
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline fatro

  • Pre-Newbie
  • Posts: 9
    • View Profile
Re: [Mod] Create Sort Order for each category from Admin Panel
« Reply #48 on: July 15, 2006, 10:31:31 PM »
Thank alot V@no..

There are about 3 lines of
[qcode]ORDER BY ".$config['image_order']." ".$config['image_sort'];[/qcode]
with no
[qcode].", image_id ASC"[/qcode]
behind

so, I replace your code to all 3. It's give me
Quote
DB Error: Bad SQL Query: SELECT image_id, cat_id, image_name, image_media_file, image_thumb_file FROM 4images_images WHERE image_active = 1 AND cat_id = 1 ORDER BY DESC , image_id ASC
You have an error in your SQL syntax near 'DESC , image_id ASC' at line 4

Above the "details.php" page (I use v.1.7.1)

Do you have any idea what is wrong?.. again, thank in advance :roll:
Fatro using 4images Vesion 1.7.4 :mrgreen:

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Create Sort Order for each category from Admin Panel
« Reply #49 on: July 15, 2006, 11:02:47 PM »
I use v.1.7.1
That why we are trying to encourage people add 4images version they are using into their profile signature, so we dont have to waste our time either ask for it or answer for a wrong version.

the line you should look for is below
Code: [Select]
if (!$in_mode || empty($sql)) {

Replace it with:
Code: [Select]
         ORDER BY ".$cat_cache[$image_row['cat_id']]['sort_field']." ".$cat_cache[$image_row['cat_id']]['sort_order'];
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline fatro

  • Pre-Newbie
  • Posts: 9
    • View Profile
Re: [Mod] Create Sort Order for each category from Admin Panel
« Reply #50 on: July 15, 2006, 11:54:55 PM »
Thank a Lot V@no  :mrgreen:

That why we are trying to encourage people add 4images version they are using into their profile signature, so we dont have to waste our time either ask for it or answer for a wrong version.
I'm newbie here, sorry for that  :oops:

I'm looking forward to change to 1.7.2 but I think with many plugins I have. It'll be very messy :?
Fatro using 4images Vesion 1.7.4 :mrgreen:

Offline cronk005

  • Newbie
  • *
  • Posts: 44
    • View Profile
    • Travelingtheworldaround
Re: [Mod] Create Sort Order for each category from Admin Panel
« Reply #51 on: September 04, 2006, 01:53:59 AM »
Hi There==

I did all instructions as indicated in the original post, however, I get the following error.

DB Error: Bad SQL Query: SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_name, u.user_name FROM (4images_images i, 4images_categories c) LEFT JOIN 4images_users u ON (u.user_id = i.user_id) WHERE i.image_active = 1 AND i.cat_id = 18 AND c.cat_id = i.cat_id ORDER BY image_name ASC image_date DESC LIMIT 20, 20
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 'image_date DESC LIMIT 20, 20' at line 5

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/traveli/public_html/galleries/includes/db_mysql.php on line 116


I am using 1.7.2

Any thoughts--

DEC

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Create Sort Order for each category from Admin Panel
« Reply #52 on: September 04, 2006, 03:57:09 AM »
Step 3 sais to replace the whole line, but you seems to added something else...
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline cronk005

  • Newbie
  • *
  • Posts: 44
    • View Profile
    • Travelingtheworldaround
Re: [Mod] Create Sort Order for each category from Admin Panel
« Reply #53 on: September 04, 2006, 05:16:08 AM »
OK. I figured that out. My mistake. Now.... perhaps another mistake. The category will sort correct (based on the new parameters that I set), however, once I click on the first image for example, it then will show you next and previous image links based on the date, which is the system default. Did I miss something that I should have changed?

DECronk

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Create Sort Order for each category from Admin Panel
« Reply #54 on: September 04, 2006, 05:35:23 AM »
I guess this mod is not full...
in details.php find:
Code: [Select]
            AND cat_id IN ($cat_id_sql)
            ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort'];
Replace with:
Code: [Select]
            AND cat_id IN ($cat_id_sql)
            ORDER BY ".$cat_cache[$cat_id]['sort_field']." ".$cat_cache[$cat_id]['sort_order'].", image_id ".$cat_cache[$cat_id]['sort_order'];
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline cronk005

  • Newbie
  • *
  • Posts: 44
    • View Profile
    • Travelingtheworldaround
Re: [Mod] Create Sort Order for each category from Admin Panel
« Reply #55 on: September 04, 2006, 06:13:59 AM »
Thanks v@no... I changed that one and it at first did not work. But then there is another line right below it which is similar that I changed to read something just like the above and it worked perfectly.. thanks for leading me in the right direction.

dec

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Create Sort Order for each category from Admin Panel
« Reply #56 on: September 04, 2006, 02:11:18 PM »
there only one instance of these lines, so you shouldnt look for simular, but for exact match ;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.806
  • I ♥ 4I
    • View Profile
Re: [Mod] Create Sort Order for each category from Admin Panel
« Reply #57 on: November 28, 2011, 02:17:05 PM »
Works with 4images 1.7.10

Addons:
- More informations

Install SQL:
- DB Install