Joomla + Gallery2 and a list of the X newest / latest albums

mattyb

Joined: 2005-07-04
Posts: 82
Posted: Fri, 2006-05-19 10:41

Well I dont know if this is the proper place for this topic, but it seemed like the best. I was looking for a method of displaying the X most recent albums within my site. I searched and searched all over this forum and could come up with exactly what I wanted. I started brainstorming and along with the few things I got here I was able to come up with a way to show the most recent albums posted to my site. In my case I used 100 as the magic number. I thought that somebody here on gallerys website might find this useful so here are the direstions on how to do what I did. If you would like to see it in action, you can go to my site at http://www.tbopa.com and in the main menu you can see the option 100 Newest Albums. Click that to see the 100 latest albums added to my site.

If that is what you are looking for here is how I did it.

I am assuming that you are using joomla and gallery, and of course the bridge. I am sure that a similar method could be used on another CMS that has a gallery bridge but I am not familiar with any other CMS besides joomla and mambo.

First I took the image block module from http://opensource.4theweb.nl/. I had already done a little modification to eliminate the space between the thumbnail and the title by addidng <div>, but if you want you can use the original and just make the changes ill explain here, or you can use my copy I'll post below. I found through this forum a way of increasing the number of links within the image block module by adding |recentAlbum after the recent album in the code. You can repeat this as many times as you like to add the next recent album below the one already showing. I unzipped the mod_gallery2_image_fixed_2.1.zip file and then opened the file mod_gallery2_image.xml in wordpad. I then added 99 |recentAlbumafter the one that was already there. I changed the name near the top to Gallery2 Image block 100 , and also changed the file name withn in the code to mod_gallery2_image_100 . I then saved this to a new folder titled mod_gallery2_image_100as mod_gallery2_image_100.xml. Mine looks like this, just with a whole lot more |recentAlbum.

<?xml version="1.0" encoding="iso-8859-1"?>
<mosinstall type="module" version="4.5.2">
<name>Gallery2 Image block 100</name>
<author>Michiel Bijland</author>
<creationDate>27-10-2005</creationDate>
<copyright>4 The Web</copyright>
<license>This module is released under the GNU/GPL License</license>
<authorEmail></authorEmail>
<authorUrl>http://www.4theweb.nl</authorUrl>
<version>2.5</version>
<description>This module displays a picture from Gallery 2. </description>
<files>
<filename module="mod_gallery2_image_100">mod_gallery2_image_100.php</filename>
</files>
<params>
<param name="align" type="list" default="center" label="Alignment" description="Should it be left, right or in the middle.">
<option value="left">left</option>
<option value="center">center</option>
<option value="right">right</option>
</param>
<param name="block" type="list" default="randomImage" label="Block type" description="What kind of picture you want to show. NOTE: If you select \'Specific Picture\' also Fill in Item id!">
<option value="randomImage">Random Image</option>
<option value="recentImage">Last Added Image</option>
<option value="viewedImage">Most Viewed Image</option>
<option value="recentAlbum|recentAlbum|recentAlbum|recentAlbum|recentAlbum|recentAlbum">last Added Album</option>
<option value="viewedAlbum">Most Viewed Album</option>
<option value="randomAlbum">Random Album</option>

I then copied mod_gallery2_image.php to the folder mod_gallery2_image_100 and renamed it to mod_gallery2_image_100.php. I then zipped this folder up and installed it into joomla using the installer.

Next you need to download your joomla template folder. Change the name of the folder to something else. If it was called supertemplate an example could be supertemplate2. open up the xml file within the template folder and near the top change the name of the file from the old to the new.

Then open up the index.php file and search in the code for your mosMainBody. My particular template is fixed width of 820 pixel with a left and right module surrounding the main body. I got rid of the right module and changed the left module to a position that was not in use like say user8. I then adjusted the size of the tables so that the main body was only 200 and the user8 position was 620. it will look something like this.

<td><table width="820" border="0" cellspacing="5" cellpadding="0">
<tr>
<td width="620" align="left" valign="top"><?php mosLoadModules ( 'user8' ); ?></td>
<td width="200" align="left" valign="top"><?php mosMainBody(); ?></td>

this gives the illusion that you are loading the list in the main content area when in actuallity it is the left most module. Save this file and then reupload the new folder to you templates folder on your site.

then go to your joomla backend and creat a new content item. I classified it as a blog but any section should work. If you have some sort of summary page set up you might have to create a new section with only this content assigned to it to keep it from appearing any where else but the page we are creating. I wrote a short description of what was showing up on the page i.e. 100 most recent albums.

Then you need to open you main menu and create a new link to the content you just created. Then go to your template manager->site templates and click the bubble of the template you just uploaded. Then click assign. In the pages of your site click the menu item you just created and click save.

Then go to your installer menu->modules and install the mod_gallery2_image_100 you created earlier. Configure the module and dont forget to assign it to position user8 or whatever position you set up the template to use. Save that and open your site. You should have a link to the content in your menu and when you open it up it should look like the main content is a list of your X most recent albums.

You can configure the content and module to display whatever info you want, i.e. titles headers, views, owners, whatever is in the to get the look you want.

I dont think I left anything out but If I did and you cant figure it out please feel free to ask and I will help as soon as I can. Also if you found this useful please let me know as I am a slow typer and it took a while to type this up. I would hate to know that this was for naught.

Also If anyone knows how to modify how the module displays the albums so that we (I) can get the list in rows and columns, it would be greatly appreciated. Sorry about being so long winded.

Mattyb

AttachmentSize
mod_gallery2_image_100.zip2.94 KB
 
MrGibbage

Joined: 2005-12-06
Posts: 16
Posted: Sat, 2006-05-27 01:22

Could it be modified to show the last N immages uploaded rather than albums? Also very cool if it could use micro thumbs instead of the full size thumbs. Just a thought. Still, nice hack Worked great on my system.

 
mattyb

Joined: 2005-07-04
Posts: 82
Posted: Sat, 2006-05-27 07:51

yeah you could. do everything the same escept of adding |recentalbum look in the file for the one labeled |recentitem or something like that. I didnt look to see what it actually was but if you open the file it will be fairly obvious. Then when creating the image bl;ock for joomla rather than selecting the recent album you select recent image. Hope that helps.

 
mattyb

Joined: 2005-07-04
Posts: 82
Posted: Sat, 2006-05-27 07:52

i just seen its in the code above recentimage

 
DivaShane

Joined: 2006-10-14
Posts: 3
Posted: Sat, 2006-10-14 21:48

I am trying to use this to place updates in the mainbody section of my Joomla install. I have it working ok, but I am wanting a tabled format:
<table width = 100%>
<tr>
<td>(Image)</td>
<td> (Album Title & Date / Description) </td>
</tr>
</table>

That of course is not exact, but you get what I mean. Any ideas on where/what I need to modify to get this to work?

 
psytus

Joined: 2007-11-08
Posts: 7
Posted: Tue, 2008-03-11 15:51

Hello, I'm searching a module to just show the latest album in a text style. Just like an overview of the latest thread of an forum.

 
relmone

Joined: 2008-01-07
Posts: 8
Posted: Wed, 2008-07-09 04:52

I am having an issue with the Most Recent Gallery hack. Basically, the first Gallery is being repeated 5 times instead of the Top 5 Galleries being displayed. See Screenshot. Any ideas?

[img]http://www.paintballphotography.com/1.png[/img]