New Primary Order - Last Modified first

Locked
akame
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Mon Feb 20, 2006 6:04 pm

New Primary Order - Last Modified first

Post by akame » Fri Oct 06, 2006 10:07 am

I would like to be able to order my blog content based on the 'Last Modified' date. The data is available ('jos_content' table, 'modified' field) for every content item, so it would probably be quite easy. Would anyone else like this feature?

akame

User avatar
eyezberg
Joomla! Hero
Joomla! Hero
Posts: 2860
Joined: Thu Aug 25, 2005 5:48 pm
Location: Geneva mostly
Contact:

Re: New Primary Order - Last Modified first

Post by eyezberg » Fri Oct 06, 2006 8:29 pm

I'd like more than that: a special feed with category selections from which items should be included for last modified, emails to subscribers of topics if modified etc.. ;)
Sometimes one pays most for the things one gets for nothing.
The important thing is not to stop questioning. Curiosity has its own reason for existing. AE
http://joomla15.[URL banned].com for J! 1.5 screenshots
http://www.eyezberg.com

akame
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Mon Feb 20, 2006 6:04 pm

Re: New Primary Order - Last Modified first

Post by akame » Mon Oct 09, 2006 6:08 am

Sounds a lot more complicated. Maybe I'll go in search of the code I need to change to sort my blog via Last Modified.

akame
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Mon Feb 20, 2006 6:04 pm

Re: New Primary Order - Last Modified first

Post by akame » Tue Oct 10, 2006 10:02 am

I've found the code. For those of you who're interested, you need to make two changes:

1)
Add the menu items (here I've changed the Section Blog. You'll need to do the same for the other blog types):
file: administrator\components\com_menus\content_blog_section\content_blog_section.xml
Add the following after line 47:

Code: Select all

<option value="modified">Modified - Newest First</option>
<option value="rmodified">Modified - Oldest First</option>
2)
Modify the content output:
file: components\com_content\content.php
Add the following after line 2452:

Code: Select all

		case 'modified':
			$orderby = 'a.modified DESC';
			break;
		case 'rmodified':
			$orderby = 'a.modified ASC';
			break;
That's all folks.
Last edited by akame on Tue Oct 10, 2006 11:13 am, edited 1 time in total.


Locked

Return to “Wishlist Archives - Archived”