View Full Version : how to display Recently Updated Albums in random order
Marcel Lee
09-23-2009, 04:49 AM
How can I make it so that the Recently Updated Albums list, the one on the "album.php" page, is displayed in random order as opposed to the newest-to-oldest default?
Lynne
09-23-2009, 02:32 PM
Where is this "recently updated list" - I'm not sure where you are talking about.
Marcel Lee
09-23-2009, 04:08 PM
It's on the "album.php" page that I assume comes with every 3.8 version of vBulletin.
You can view it on the vBulletin.com Community Forum (here (http://www.vbulletin.com/forum/album.php)) if you're a member.
Lynne
09-23-2009, 05:23 PM
Ah yes.. I've got a mod installed and that doesn't show for me.
Anyway, it's done in includes/class_groupmessage.php in the function filter_sort_field. It looks like there is a hook to affect that area called album_sort_field. So, you can play with that if you want to change what it is sorted on. The DESC and ASC are options that are passed, I think in album.php around line 1789:
$collection = $collection_factory->create('album', false, $vbulletin->GPC['pagenumber'], $perpage);
You could pass a fifth paramenter, the default is DESC (which is why they didn't pass it since that is what they want).
Marcel Lee
09-24-2009, 02:22 AM
Thanks for the help, but can you be more specific on what it is I have to do?
I've opened both the "includes/class_groupmessage.php" and album.php" files and I see the lines you're referring to, including the code you put in quotes, but I need you to tell me exactly what I have to do (add/edit) because I'm a novice when it comes to hooks and such. I'm not even sure what you mean by "pass".
I'm also wondering, am I supposed to make these changes by editing the php files and uploading them back to the server or is there a way to do this via the admin control panel?
By the way, just so you know more specifically, what I want to do is make it so that the aforementioned picture album list appears in a different (random) order at every page view or refresh.
Lynne
09-24-2009, 03:32 AM
I can't be more specific because I've never done what you want to do. I only know that those are the areas you need to look at and change.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.