CyberiaPC.com Community Forums Main Page
RSS Feeds: Late(st) News | Zenith Picture Gallery | Most Recent Community Topics | Tips, Tricks and Other Useful Stuff

Welcome Guest ( Log In | Register )

2 Pages V   1 2 >   Digg this topic Digg this topic   Add to my del.icio.us Add to my del.icio.us
Reply to this topicStart new topic
> Order pictures alphabetically
tommie
post Mar 6 2005, 07:56 PM
Post #1


New Member
*

Group: Members
Posts: 10
Joined: 6-March 05
Member No.: 2,374

Nothing Selected




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?
Go to the top of the page
 
+Quote Post
CharlyG
post Mar 6 2005, 10:45 PM
Post #2


Active Member
Group Icon

Group: +Zenith User
Posts: 127
Joined: 1-December 04
From: Metz, France
Member No.: 2,051

France




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....
Go to the top of the page
 
+Quote Post
tommie
post Mar 7 2005, 05:42 AM
Post #3


New Member
*

Group: Members
Posts: 10
Joined: 6-March 05
Member No.: 2,374

Nothing Selected




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?
Go to the top of the page
 
+Quote Post
usr.c
post Mar 7 2005, 11:34 AM
Post #4


Boss, my code's compiling (xkcd)
Group Icon

Group: Admins
Posts: 10,440
Joined: 19-September 01
Member No.: 1

Nothing Selected




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), Skydiving, Splitting atoms, Flying a space shuttle
"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
Go to the top of the page
 
+Quote Post
tommie
post Mar 7 2005, 01:08 PM
Post #5


New Member
*

Group: Members
Posts: 10
Joined: 6-March 05
Member No.: 2,374

Nothing Selected




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... online2long.gif
Go to the top of the page
 
+Quote Post
usr.c
post Mar 7 2005, 01:16 PM
Post #6


Boss, my code's compiling (xkcd)
Group Icon

Group: Admins
Posts: 10,440
Joined: 19-September 01
Member No.: 1

Nothing Selected




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), Skydiving, Splitting atoms, Flying a space shuttle
"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
Go to the top of the page
 
+Quote Post
usr.c
post Aug 3 2007, 07:16 PM
Post #7


Boss, my code's compiling (xkcd)
Group Icon

Group: Admins
Posts: 10,440
Joined: 19-September 01
Member No.: 1

Nothing Selected




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), Skydiving, Splitting atoms, Flying a space shuttle
"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
Go to the top of the page
 
+Quote Post
Dennis Evertse
post Dec 29 2007, 11:35 AM
Post #8


New Member
*

Group: Members
Posts: 39
Joined: 3-November 07
Member No.: 9,377

Netherlands




Is it possible to make this dynamic?

That visitor can choose between ordering by date and by title?
Go to the top of the page
 
+Quote Post
usr.c
post Dec 31 2007, 02:45 PM
Post #9


Boss, my code's compiling (xkcd)
Group Icon

Group: Admins
Posts: 10,440
Joined: 19-September 01
Member No.: 1

Nothing Selected




Yep, it's possible original.gif


--------------------


Things that I don't suck at: Photography (flickr, JPG Mag), Skydiving, Splitting atoms, Flying a space shuttle
"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
Go to the top of the page
 
+Quote Post
Dennis Evertse
post Jan 16 2008, 06:29 PM
Post #10


New Member
*

Group: Members
Posts: 39
Joined: 3-November 07
Member No.: 9,377

Netherlands




Is it hard to do/explane? blushing.gif
Go to the top of the page
 
+Quote Post
usr.c
post Jan 19 2008, 09:13 AM
Post #11


Boss, my code's compiling (xkcd)
Group Icon

Group: Admins
Posts: 10,440
Joined: 19-September 01
Member No.: 1

Nothing Selected




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), Skydiving, Splitting atoms, Flying a space shuttle
"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
Go to the top of the page
 
+Quote Post
Dennis Evertse
post Apr 21 2008, 07:18 PM
Post #12


New Member
*

Group: Members
Posts: 39
Joined: 3-November 07
Member No.: 9,377

Netherlands




I have a Better Idea, laugh.gif

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 blushing.gif blushing.gif , but this is the one I need the most so please can somebody help me? blushing.gif
Go to the top of the page
 
+Quote Post
Usher
post Apr 22 2008, 02:42 PM
Post #13


New Member
*

Group: Members
Posts: 24
Joined: 7-April 08
Member No.: 9,602

United States




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)
Attached File  Sort_type_mod.txt ( 7.51K ) Number of downloads: 78
 


--------------------
-------------------
Everyone told me I was daft to build a castle on a swamp! So I did.
~Usher
Go to the top of the page
 
+Quote Post
Dennis Evertse
post Apr 22 2008, 08:10 PM
Post #14


New Member
*

Group: Members
Posts: 39
Joined: 3-November 07
Member No.: 9,377

Netherlands




Thank You very Much, But how does this work?

Do I need to add the things witch are written between add en end add?? blushing.gif
Go to the top of the page
 
+Quote Post
Usher
post Apr 22 2008, 10:03 PM
Post #15


New Member
*

Group: Members
Posts: 24
Joined: 7-April 08
Member No.: 9,602

United States




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
Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 19th May 2013 - 01:14 PM