xoops forums

chaoos

Just popping in
Posted on: 2015/9/10 12:21
chaoos
chaoos (Show more)
Just popping in
Posts: 76
Since: 2005/3/9 1
#1

MyAlbum - sort categories

I need a hack.
I want to sort the list of categories by dateD.
I want to sort categories, no photo in the category. Does anyone help me please?

Mamba

Moderator
Posted on: 2015/9/11 8:11
Mamba
Mamba (Show more)
Moderator
Posts: 10372
Since: 2004/4/23
#2

Re: MyAlbum - sort categories

Try to sort by "cid" instead of "date".

I guess, you'll need to find the right places in the code and replace them there.
Please support XOOPS & DONATE
Use 2.5.8 | Debug | Requests | Bugs

chaoos

Just popping in
Posted on: 2015/9/11 14:14
chaoos
chaoos (Show more)
Just popping in
Posts: 76
Since: 2005/3/9 1
#3

Re: MyAlbum - sort categories

I have examined the front of the module, but sorting categories ... I have not found.

Mamba

Moderator
Posted on: 2015/9/11 23:19
Mamba
Mamba (Show more)
Moderator
Posts: 10372
Since: 2004/4/23
#4

Re: MyAlbum - sort categories

The sorting is deep in the code in /viewcat.php.

It creates a "criteria" around line 133, sets the sorting based on the $orderby you select, and sorts the photo table "myalbum_photos".

To use Category, you would have to replace the "date" in PHP code with "cid" field that is for the Category.

Also adjust the /include/photo_orders.php

Unfortunately, I don't have the time to help more with that.
Please support XOOPS & DONATE
Use 2.5.8 | Debug | Requests | Bugs

chaoos

Just popping in
Posted on: 2015/9/12 9:44
chaoos
chaoos (Show more)
Just popping in
Posts: 76
Since: 2005/3/9 1
#5

Re: MyAlbum - sort categories

All this I have tried. But it's not working. :(

Mamba

Moderator
Posted on: 2015/9/12 10:44
Mamba
Mamba (Show more)
Moderator
Posts: 10372
Since: 2004/4/23
#6

Re: MyAlbum - sort categories

Please publish in detail what have you tried, incl. the code changes.

Maybe somebody will be able to help you and pinpoint you in the right direction...
Please support XOOPS & DONATE
Use 2.5.8 | Debug | Requests | Bugs

timgno

Module Developer
Posted on: 2015/9/12 14:57
timgno
timgno (Show more)
Module Developer
Posts: 1503
Since: 2007/6/21
#7

Re: MyAlbum - sort categories

In the photo.php file, at line 150 there is cid, you can change by replacing or deleting the file photo_orders.php inserting a control in xoops_version.php to cid, date and other

chaoos

Just popping in
Posted on: 2015/9/14 5:03
chaoos
chaoos (Show more)
Just popping in
Posts: 76
Since: 2005/3/9 1
#8

Re: MyAlbum - sort categories

Mamba, I need to sort categories - the latest on top. Module Settings solves only sort pictures in the categories. And the entire code is centered brand image sort.
I do not know where to look for code editing sort categories. I examined it all. I think that the necessary amendments be made to the index.php, but do not know how.

Timgno - photo.php affect only photo detail page. I do not know exactly what else can I do there.

Friends, I am not proficient programmer as you. It's hard to realize your tips. I would very helpful, if you had your tips to test and put me here modified parts of the code.

But I try to be productive.

Bleekk

Theme Designer
Posted on: 2015/9/14 5:15
Bleekk
Bleekk (Show more)
Theme Designer
Posts: 884
Since: 2002/12/14
#9

Re: MyAlbum - sort categories

myalbum does not store the date for categories.
You can't order the categories by any date.

How does it order the categories now? By title?

chaoos

Just popping in
Posted on: 2015/9/14 7:01
chaoos
chaoos (Show more)
Just popping in
Posts: 76
Since: 2005/3/9 1
#10

Re: MyAlbum - sort categories

The new category is always at the end. The principle of sort category in code I have not found.
I know it is necessary to add new code. I was just hoping someone will be able to do ...