• [Mod] Let visitors to chose how to sort images(date,name,..) 5 0 5 1
Currently:  

Author Topic: [Mod] Let visitors to chose how to sort images(date,name,..)  (Read 181516 times)

0 Members and 1 Guest are viewing this topic.

Offline bibabobu

  • Sr. Member
  • ****
  • Posts: 311
  • Technische und künstlerische Gravuren
    • View Profile
    • Technische und künstlerische Gravuren für die gesamte Metall-, Kunststoff- und Papierindustrie
Re: [Mod] Let visitors to chose how to sort images(date,name,..)
« Reply #60 on: June 02, 2005, 12:58:41 AM »
Sorry i was working on it and tried different codes.

Now it is working.

BUT i want to have a menu selection :!:

Do you have me an advice :?:


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] Let visitors to chose how to sort images(date,name,..)
« Reply #61 on: June 02, 2005, 01:15:25 AM »
I might, but I dont understand what exactly are u trying to do...please be more describtive.
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 bibabobu

  • Sr. Member
  • ****
  • Posts: 311
  • Technische und künstlerische Gravuren
    • View Profile
    • Technische und künstlerische Gravuren für die gesamte Metall-, Kunststoff- und Papierindustrie
Re: [Mod] Let visitors to chose how to sort images(date,name,..)
« Reply #62 on: June 02, 2005, 10:11:09 AM »
at V@no

ok i try to explain better. my english isn't the best.

Now you can see on my url www.industrie-gravuren.de/galerie that i have radio buttons to choose the sort direction ASC or DESC.
Instead of these buttons i would like to have a selection like the category or pics per page select.

I hope i could explain enough for you to understand me.

EDIT: I HAVE SEEN YOU HAVE WHAT I WANT TO HAVE ON YOUR URL.  The sort selecting for ASC/DESC.

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] Let visitors to chose how to sort images(date,name,..)
« Reply #63 on: June 02, 2005, 02:39:23 PM »
oh, I see...I didnt realize the default is radio buttons and not dropdown..
In Step 1.2 replace
Code: [Select]
foreach ($image_sort_optionlist as $key => $val) {
 $imgsort_dropdown .= "<INPUT type=\"radio\" name=\"imagessort\" value=\"$key\"";
 if ($config['image_sort'] == $key) {
     $imgsort_dropdown .= " checked";
 }
 $imgsort_dropdown .= ">".$val."\n";
 }
with:
Code: [Select]
$imgsort_dropdown .= "\n<select name=\"imagessort\" class=\"setperpageselect\">\n";
 foreach ($image_sort_optionlist as $key => $val) {
   $imgsort_dropdown .= "<option value=\"$key\"";
   if ($config['image_sort'] == $key) {
     $imgsort_dropdown .= " selected=\"selected\"";
   }
   $imgsort_dropdown .= ">".$val."</option>\n";
 }
 $imgsort_dropdown .= "</select>\n";
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 bibabobu

  • Sr. Member
  • ****
  • Posts: 311
  • Technische und künstlerische Gravuren
    • View Profile
    • Technische und künstlerische Gravuren für die gesamte Metall-, Kunststoff- und Papierindustrie
Re: [Mod] Let visitors to chose how to sort images(date,name,..)
« Reply #64 on: June 02, 2005, 04:16:18 PM »
Thanks v@no

Now it looks like i would have it.

 :) :D

Offline bibabobu

  • Sr. Member
  • ****
  • Posts: 311
  • Technische und künstlerische Gravuren
    • View Profile
    • Technische und künstlerische Gravuren für die gesamte Metall-, Kunststoff- und Papierindustrie
Re: [Mod] Let visitors to chose how to sort images(date,name,..)
« Reply #65 on: June 02, 2005, 09:22:54 PM »
at V@no

sorry, i have one more question.
i have seen on your page that you only have one "GO" Button for the two selections "sort by" and "pics per page".

This would be very kind if you could tell me the code for it, because i only have little space in the row. so it would be very good only to have one button for these selections.
And how do I become the whole line to center vertical?

Merci beaucoup.

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] Let visitors to chose how to sort images(date,name,..)
« Reply #66 on: June 03, 2005, 01:58:41 AM »
not sure if it will work, but try insert {imgsort_dropdown_form} into setperpage_dropdown_form.html template
or if it doesnt work, then insert {setperpage_dropdown} into imgsort_dropdown_form.html template (u'll need remove "go" button from setperpage_dropdown_form.html template)
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 bibabobu

  • Sr. Member
  • ****
  • Posts: 311
  • Technische und künstlerische Gravuren
    • View Profile
    • Technische und künstlerische Gravuren für die gesamte Metall-, Kunststoff- und Papierindustrie
Re: [Mod] Let visitors to chose how to sort images(date,name,..)
« Reply #67 on: June 03, 2005, 11:19:19 AM »
I removed the go button.
but now it is only changing the pics per page and i cannot recognize any sortation of images.

Could you give me the code of your imagesort_dropdown_form.html  and  setperpage_dropdown_form.html and also the page_header.php and lang/.../main.php

On your url its working perfect, but not for me.

Offline Vincent

  • 4images Moderator
  • Addicted member
  • *****
  • Posts: 1.195
    • View Profile
    • www.foto-kocher.com
Re: [Mod] Let visitors to chose how to sort images(date,name,..)
« Reply #68 on: July 25, 2005, 07:31:50 PM »
Thanks a lot it works!
but if i sort my country Picture and start the flashshow the flashshow will take the default i belive because i did not use cockies!

sincerly
vincent
Beati pauperi spiritus

4images 1.7 // My Installed Mods


Offline Nasser

  • Full Member
  • ***
  • Posts: 105
    • View Profile
Re: [Mod] Let visitors to chose how to sort images(date,name,..)
« Reply #69 on: October 31, 2005, 06:18:38 PM »
I added this MOD
the dropdown menu of sorting images is shown in the main categore not in the sub categories in each
is it woking like that ?

Offline Joss

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • All about digital photography
Re: [Mod] Let visitors to chose how to sort images(date,name,..)
« Reply #70 on: January 29, 2006, 01:45:59 AM »
Thanks for the MOD, V@no!

I use this MOD, but a problem that default sorting for new photos should be by date. I've made the following changes, but for certain, it is possible to write a smaller size  code (I haven't experience in PHP). :)

File: search.php

Code: [Select]
  $sql = "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".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
          FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
          LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
          WHERE i.image_active = 1
          $sql_where_query
          AND c.cat_id = i.cat_id AND i.cat_id IN ($cat_id_sql)
          ORDER BY ".$config['image_order']." ".$config['image_sort']."
          LIMIT $offset, $perpage";

change to

Code: [Select]
  if ($search_new_images == 1) {
  $sql = "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".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
      FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
  LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
          WHERE i.image_active = 1
          $sql_where_query
      AND c.cat_id = i.cat_id AND i.cat_id IN ($cat_id_sql)
  ORDER BY ".image_date." ".DESC."
          LIMIT $offset, $perpage";
  } else {
  $sql = "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".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
      FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
  LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
          WHERE i.image_active = 1
          $sql_where_query
      AND c.cat_id = i.cat_id AND i.cat_id IN ($cat_id_sql)
  ORDER BY ".$config['image_order']." ".$config['image_sort']."
          LIMIT $offset, $perpage";
  }
Digital Photo Gallery: http://gallery.imagemaster.ru

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] Let visitors to chose how to sort images(date,name,..)
« Reply #71 on: January 29, 2006, 05:48:11 AM »
And the simpliest way is to add above the original code block you've showed this:
Code: [Select]
  if ($search_new_images == 1)
  {
    $config['image_order'] = "image_date";
    $config['image_sort'] = "DESC";
  }
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 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] Let visitors to chose how to sort images(date,name,..)
« Reply #72 on: March 18, 2006, 12:16:40 AM »
Edit search.html template
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 mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [Mod] Let visitors to chose how to sort images(date,name,..)
« Reply #73 on: March 18, 2006, 10:29:13 PM »
@ Ivan,

dass die Auswahlleiste in der Erweiterten Suche angezeigt wird macht absolut Sinn ! Denn wenn ich Bilder zu einem bestimmten Keyword suche, dann kann ich hier gleich vorgeben (z.B. Anzahl der Postkarten) wonach das Suchergebnis sortiert werden soll. Beim Upload ... da hast du Recht ... macht die Sortierungsleiste nicht unbedingt Sinn.

mawenzi
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline darvid

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
    • KNOWTEBOOK.COM - Community for webdeveloper
Re: [Mod] Let visitors to chose how to sort images(date,name,..)
« Reply #74 on: April 29, 2006, 09:16:41 PM »
Hey,

what if i want to sort the pictures in the categories by random?

Any ideas, or did i miss a thread??

Thanks in advance,

c-bass
/* KNOWTEBOOK - BoostYourself community for webdeveloper
/* http://www.knowtebook.com

Integration von Wordpress Blog, PHPBB Forum und 4Images Bildergalerie:
http://www.sebastianscheuer.de/aktuell/integration-von-wordpress-blog-phpbb-forum-und-4images-bildergallerie/
DEMO: http://www.pilotenbilder.de/