![]() ![]() |
Mar 6 2005, 07:56 PM
Post
#1
|
|
|
New Member ![]() Group: Members Posts: 10 Joined: 6-March 05 Member No.: 2,374 ![]() |
Hi,
Is it possible to change the order in which the pictures are shown in the gallery?? In which file is that info/data stored so I can manually change it? |
|
|
|
Mar 6 2005, 10:45 PM
Post
#2
|
|
|
Active Member Group: +Zenith User Posts: 127 Joined: 1-December 04 From: Metz, France Member No.: 2,051 ![]() |
yes !
look in display.php order is by date if you wish a classification alphabetically, replaces "date" by "title". ex. : CODE $statement = "SELECT pid, file_name, ROUND(file_size/1024) AS fsize, file_type, title, keywords, DATE_FORMAT(date, '%M %e, %Y') AS d, pic_width, pic_height, keywords, approved, category, counter FROM {$config['table_prefix']}pictures WHERE category='$searchquery' AND approved='1' ORDER BY date DESC"; change : CODE $statement = "SELECT pid, file_name, ROUND(file_size/1024) AS fsize, file_type, title, keywords, DATE_FORMAT(date, '%M %e, %Y') AS d, pic_width, pic_height, keywords, approved, category, counter FROM {$config['table_prefix']}pictures WHERE category='$searchquery' AND approved='1' ORDER BY title DESC"; if it is well what you seek to do.... |
|
|
|
Mar 7 2005, 05:42 AM
Post
#3
|
|
|
New Member ![]() Group: Members Posts: 10 Joined: 6-March 05 Member No.: 2,374 ![]() |
Thanks, but if I have uploaded a lot op pictures, and I want to add 1 picture somewhere in the middle of a gallery, how do I do that? Where does Zenith Picture Gallery store the upload dates?
|
|
|
|
Mar 7 2005, 11:34 AM
Post
#4
|
|
![]() Boss, my code's compiling (xkcd) Group: Admins Posts: 10,440 Joined: 19-September 01 Member No.: 1 ![]() |
Hi tommie,
As CharlyG pointed out, dates are stored in the table 'pictures' in a column of type 'datetime'. If you want to display the result differently then all you can do is sort on a different column. If you want to insert a picture somewhere in the middle of a category, then you can change its date in 'pictures'. -------------------- ![]() ![]() Things that I don't suck at: Photography (flickr, JPG Mag), "Don't bail; the best gold is at the bottom of barrels of crap!" -Randy Pausch I have people-skills goddamnit! What is wrong with you people!!! | www.skyrill.com |
|
|
|
Mar 7 2005, 01:08 PM
Post
#5
|
|
|
New Member ![]() Group: Members Posts: 10 Joined: 6-March 05 Member No.: 2,374 ![]() |
Tnx!
Well I think you kinda noticed... I'm a newbie with scripts... So the dates are in a table in mysql? How do I edit that? And with what kind of program? Please explain... |
|
|
|
Mar 7 2005, 01:16 PM
Post
#6
|
|
![]() Boss, my code's compiling (xkcd) Group: Admins Posts: 10,440 Joined: 19-September 01 Member No.: 1 ![]() |
I'm sure your host provides some way to edit your databases. Otherwise, give phpMyAdmin a try: http://www.phpmyadmin.net/home_page/
-------------------- ![]() ![]() Things that I don't suck at: Photography (flickr, JPG Mag), "Don't bail; the best gold is at the bottom of barrels of crap!" -Randy Pausch I have people-skills goddamnit! What is wrong with you people!!! | www.skyrill.com |
|
|
|
Aug 3 2007, 07:16 PM
Post
#7
|
|
![]() Boss, my code's compiling (xkcd) Group: Admins Posts: 10,440 Joined: 19-September 01 Member No.: 1 ![]() |
In v0.9.4, look in functions/f_global.php for
CODE $statement .= "cid=category AND {$config['table_prefix']}categories.cshow=1 ORDER BY date DESC LIMIT {$config['lastadded_perpage']}"; and replace it with CODE $statement .= "cid=category AND {$config['table_prefix']}categories.cshow=1 ORDER BY date DESC, title DESC LIMIT {$config['lastadded_perpage']}"; Then look in display.php for CODE $statement .= "ORDER BY date DESC, pid DESC"; and replace it with CODE $statement .= "ORDER BY title ASC, pid DESC"; Then for CODE $statement .= "ORDER BY date DESC"; and replace it with CODE $statement .= "ORDER BY title ASC"; That's it. -------------------- ![]() ![]() Things that I don't suck at: Photography (flickr, JPG Mag), "Don't bail; the best gold is at the bottom of barrels of crap!" -Randy Pausch I have people-skills goddamnit! What is wrong with you people!!! | www.skyrill.com |
|
|
|
Dec 29 2007, 11:35 AM
Post
#8
|
|
|
New Member ![]() Group: Members Posts: 39 Joined: 3-November 07 Member No.: 9,377 ![]() |
Is it possible to make this dynamic?
That visitor can choose between ordering by date and by title? |
|
|
|
Dec 31 2007, 02:45 PM
Post
#9
|
|
![]() Boss, my code's compiling (xkcd) Group: Admins Posts: 10,440 Joined: 19-September 01 Member No.: 1 ![]() |
Yep, it's possible
-------------------- ![]() ![]() Things that I don't suck at: Photography (flickr, JPG Mag), "Don't bail; the best gold is at the bottom of barrels of crap!" -Randy Pausch I have people-skills goddamnit! What is wrong with you people!!! | www.skyrill.com |
|
|
|
Jan 16 2008, 06:29 PM
Post
#10
|
|
|
New Member ![]() Group: Members Posts: 39 Joined: 3-November 07 Member No.: 9,377 ![]() |
Is it hard to do/explane?
|
|
|
|
Jan 19 2008, 09:13 AM
Post
#11
|
|
![]() Boss, my code's compiling (xkcd) Group: Admins Posts: 10,440 Joined: 19-September 01 Member No.: 1 ![]() |
I can't promise a date, but as soon as I get some free time I'll go through all the feature requests including this one and post the mod for them if no one has already done that.
-------------------- ![]() ![]() Things that I don't suck at: Photography (flickr, JPG Mag), "Don't bail; the best gold is at the bottom of barrels of crap!" -Randy Pausch I have people-skills goddamnit! What is wrong with you people!!! | www.skyrill.com |
|
|
|
Apr 21 2008, 07:18 PM
Post
#12
|
|
|
New Member ![]() Group: Members Posts: 39 Joined: 3-November 07 Member No.: 9,377 ![]() |
I have a Better Idea,
in the CP, there is a permissions tag under the categories. you can choose there if you want to show the categories to all. I would love to be able to choose form there if you want the categories Ordered by Date or by name. I'm asking a lot of mod's, my apologies |
|
|
|
Apr 22 2008, 02:42 PM
Post
#13
|
|
![]() New Member ![]() Group: Members Posts: 24 Joined: 7-April 08 Member No.: 9,602 ![]() |
I think I've got what you're looking for here. I have created a mod that will allow you to select the default sort field (and second field) from the admincp. See the attached file for what was changed. I would recommend first sort order by Picture Title to achieve alphabetical arrangement. Note that you can also sort by number of views, so popular files show up first.
Cheers! ~Usher
Attached File(s)
-------------------- -------------------
Everyone told me I was daft to build a castle on a swamp! So I did. ~Usher |
|
|
|
Apr 22 2008, 08:10 PM
Post
#14
|
|
|
New Member ![]() Group: Members Posts: 39 Joined: 3-November 07 Member No.: 9,377 ![]() |
Thank You very Much, But how does this work?
Do I need to add the things witch are written between add en end add?? |
|
|
|
Apr 22 2008, 10:03 PM
Post
#15
|
|
![]() New Member ![]() Group: Members Posts: 24 Joined: 7-April 08 Member No.: 9,602 ![]() |
That is correct, you should read the txt file as follows:
diff statement (old file) (new file) <- Get what file you need to edit from here Lines leading into change ... + Add the code that follows the plus signs ... Lines following the change Next file to change ------------------------- Use the lines leading up to the change as words to search for in the text file, so that you put the new code in the correct locations, and make sure that you put the code in exactly as it appears. I would recommend backing up both your database and the files that will change before making these changes, just as a precaution. Good luck! I'm going to see if I can find a good way to have the end user able to sort.....might not get to it today though. -------------------- -------------------
Everyone told me I was daft to build a castle on a swamp! So I did. ~Usher |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 18th May 2013 - 10:23 PM |