Customizing sub-albums
the_menace
Joined: 2004-02-16
Posts: 39 |
Posted: Fri, 2004-03-12 20:08 |
We decided that were going to do sub-albums for our gallery and separate albums into categories. I have one problem though. I want the sub-albums layout to look like the gallery home page. - Menace |
|
Posts: 36
Bump
Have the same question.
Posts: 1
Too many users confuse the "sub-albums" as single images.
See my gallery page at:
http://cheema.com/gallery/
and then sample album with sub-albums:
http://cheema.com/gallery/baby/
I would like to visually indicate to the users that these pictures for sub-albums have more to them then just one picture. Sorta like what I can do for the albums on the main page.
Posts: 3
I have searched extensively for a way to do this. I am in the process of setting up Gallery to display 7000+ photos which will be divided into sub-albums (and albums will contain either sub-albums OR photos, but not both). In my opinion, it's too confusing to see an album with sub-albums displayed like photos except for with a different border. There needs to be a better way to distinguish this difference, and it would be ideal if the sub-albums could be displayed exactly in the same manner as the the main Gallery page.
From what I could find on the forums, this topic was discussed once before:
Nested Albums Description Position
However, this solution doesn't work with Gallery 1.4 since it seems the 2 column mod isn't supported anymore. Just to check, I downloaded the files from the above thread and after updating a changed variable name (changing isAlbumName to getAlbumName), the two column mod is, unfortunately, displayed in the same way as any other normal album with images.
Can anyone please help us with this? Thanks in advance for your time.
Posts: 3
The thread I linked to above talked about using a 2 column mod. Is that really necessary for this kind of application (hence the new thread)? The HTML already exists to create the front page of Gallery in the two column table format, so couldn't that be applied to a list of sub-albums just the same?
I'm new at this, so could someone please tell me where this code for the main Gallery album is at? I'm guessing it would need to be modified slightly to accommodate sub-albums, and I think (correct me if I'm wrong) it could be implemented in this way:
This should be easy to decide since Gallery already knows how many sub-albums and images an album has. Within this If/Else statement the code would call one of two files. One file would be subalbum_table.php which would be the modified main Gallery page code, and the other would be image_table.php which would display photos.
Any suggestions or hints in the right direction would be greatly appreciated. Thanks!
Posts: 27300
This mod allows albums that only contain sub-albums to look like the main (albums.php) page. If the album contains an image it defaults to the default behavior.
I tested it a bit but I am sure there is a bug or 2: I welcome feedback and I will try to address them.
Open view_albums.php and find
<!-- image grid table -->
above that putfurther down find
and above that put:
Then save this as album_2column_table.inc in your gallery directory
See the behavior
Edit Nov 6: I edited the code to only check if the album does not have a image. This fixes a permissions and hidden albums issue.
Dave
Posts: 2
I tried it, and it is almost perfect.
One thing that I don't like is, that sub-albums are shown next to each other:
http://www.nosbibulis.com/gallery/view_album.php?set_albumName=Travelbum
and not above each other.....
greets
Posts: 27300
mmm,
Go into the album and change the properties to one column and you will have them like you wish. Presently you have the properties set to 3 columns.
Dave
Posts: 3236
What exactly is wrong with using one of the image backgrounds for sub-albums?
For pictures, I have the single pixel frame around them. For sub-albums, I use the "shadow" thing. You could also use the "poleroid" and "poleroids" or one of the other ones that looks like a book... or even make your own.
Posts: 8
Another solution instead drawing a new frame would be to make a watermark-image, so you 'd have to upload the highlighted image a second time, watermark it with big letters like "Sub-Album" across the picture (and maybe an extra frame), remake the thumbnail, highlight the pic and hide it...
Posts: 8
To see what I meant:
http://www.alpengallery.at.tf/view_album.php?set_albumName=Norditalien
If anyone is interested in this frame or the watermark-image, let me know. (For an unknown reason yet the border is displayed wrong on my IE, but without problems on my Mozilla...)
Posts: 30
I am trying to get the simple effect that fryfrog suggests, that is to have the sprial notebook frame used for every album or sub-album. However the notebook only appears on the main page. And regardless of what I set in the CONFIG.PHP for the other levels:
$gallery->app->default["album_frame"] = "notebook";
$gallery->app->default["thumb_frame"] = "notebook";
$gallery->app->default["image_frame"] = "notebook";
...all I ever see is the drop-shadowed effect for all sub-albums, and the single line border for images. Can there be something wrong with my setup/configuration? FWIW I do not see any CSS applied when running the Configuration Wizard - just plain text.
I tried the "two-colum" code discussed in this thread. It ran, but made no change in the appearances.
Posts: 27300
you have to change existing sub-albums for the frame you wish: FAQ Gallery:c.34 Note the word default. config.php changes will work for future (new) albums.
Do you have a url that I can check the 2 column mod? Did you have only subalbums and no images in the sub-album to get the 2 column effect?
Dave
Posts: 69
First, thanks to all the people who help out on this board. A good program is one thing, but good support is what really makes the difference.
I have been testing out various modifications for my site which uses the latest free version of Gallery (1.4.4 I think) and Nuke (7.4). I plugged this code in to make it so that the subalbums looked like the main page, and found that while it worked nicely with the standalone, I get the following error when using it with nuke:
Warning: main(album_2column_table.inc): failed to open stream: No such file or directory in /home/mystavas/public_html/nuke/modules/gallery/view_album.php on line 676
Warning: main(): Failed opening 'album_2column_table.inc' for inclusion (include_path='') in /home/mystavas/public_html/nuke/modules/gallery/view_album.php on line 676
Here is my site for reference (test site anyway):
http://www.mystavash.net/nuke/modules.php?op=modload&name=gallery&file=index&include=albums.php
Thanks again.
Anisa.FAQ Gallery:c.35
Posts: 27300
mystavash,
I am no *nuke expert so I asked one JadeDragon
and she suggested to use the full url for the include or the root path.
so try
or:
include(/home/YOURSITE/public_html/gallery/album_2column_table.inc'); }
Nuke adds some extra stuff that I have yet to learn.
Nice to see some of my customizations if practice.
Dave
Posts: 69
:D
I don't know much about php, but it's always a little bit of a thrill to see something work!
When I tried putting in the http address, I got this error:
Warning: main(): stream does not support seeking in /home/mystavas/public_html/nuke/modules/gallery/view_album.php on line 676
So I tried the other suggestion, and it works beautifully now, nuke and standalone. Thank you (and Jade Dragon ) for your help!
Anisa.
Posts: 5
Dave,
I implemented your sub-album mod to look like the main gallery page and it worked great. One hitch I found is if I am hiding a sub-album it defaults back to the orginal setting with description below the thumbnail. Thoughts?
Posts: 27300
TuBaG,
I can't reproduce your issue, if you go to http://langleycom.com/g1/album10 it is a album that only has sub-albums. http://langleycom.com/g1/album12 is a hidden sub-album of http://langleycom.com/g1/album10 .
Am I missing somthing? If you can tell me how to reproduce I will try.
This is on my 1.4.5 test gallery but the code has not changed that much, that I can see, that would stop the mod from working.
Dave
Posts: 5
Quick question, I now have my sub-albums looking like the gallery page, but I want to change the maximum displayable sub-albums to more then the 10 given. Is there anyway I can change this for the sub-albums page?
Also, like the gallery page, I would like the language selection to be available at the top?
Any ideas? It would be very much appreciated.
sj
Posts: 27300
sunnyjpop,
For changing rows:
http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&p=67334#67334
as for the language selection :
not tested---->
in view_albums.php find:
and add:
includeLayout('ml_pulldown.inc');
If that does not work start another thread to keep this on topic.
Dave
Posts: 5
Got it! Works perfectly (probably shouldn't be BUT) i had just figured it out when I saw your post (about the language bar.) The rows work super.
Thanks!
sj
Posts: 27300
I got a PM from a user and I can't recall his/her name....They had a similar issue if the sub-album(s) had permissions set to have one or more sub-album only viewable if the user is logged in.
I was able to reproduce that issue and have changed the code to check if the album has an image. If it has a image then use the regular display, of not then use the 2 column mod.
I have updated the code here
This is the change:
Open view_albums.php and find
<!-- image grid table -->
above that putPosts: 16
Dave,
Great mod. I was actually working on rel'ing up the old 2col mod up to the newest release when I found your mod.
I actually worked on combining my mod with yours with great success.
I've allowed for the nested subalbum view on the right hand side, and made the text/admin portion of the albums look like how they look at the top most gallery. I also allowed the mod to be turned on and off from the configuration wizard (probably not really necessary since if the mod is installed, it would probably be used anyway), but I just do that as a standard for all my mods.
You can see it in action here. http://www.instrumentofchoice.net/gallerydev/
You can view the subalbum listing working within a subalbum by viewing the Travel album.
You can view screenshots of the admin screen and config wizard in the Gallery Mods > 2 Column Mod album.
Included below are the code changes I made. I've excluded the config wizard changes for now.
Anyone, please test and feedback (bugs, comments, etc.) would be greatly appreciated. In the mean time, I'm working on rel'ing up my other older mods seen at http://www.instrumentofchoice.net/gallery including a "VIEW ALL" link, a cleaner text based navigation (removing the images from the breadcrums and page 1, 2, 3 etc..), and applying a pbase-based CSS.
New version of album_2column_table.inc
New file adminAlbumCommands_2col.inc placed in the layout folder
Posts: 27300
rsramirez,
great work! I implemented it on my test site and then found these issues when trying to validate the html:
<table cellpadding="0" cellspacing="0" width="100%" border="0" align="center" class="mod_title">
I added above
<td align="left" valign="top" class="albumdesc">
a little further down
I added below:
echo "</div>";
I don't know if those are from my customizations or not.... but just letting you know what I did.
It still will not validate all but even the original code does not validate well with the forms in tables.
Dave
Posts: 4
Hi there,
Well I tried the mod and it seemd to work great... however when I made some mistakes in my gallery and I had to reorder some albums, that didn't work anymore, nor could I set a highlight album for the main page anymore, it would by default now choose the top album for that.
I changed back to my old files and now it all works great again... but I would still like to use this feature here but only if I can get it to be able to both set the highlight album for the main page AND be able to reorder albums. This is because I want to set the highlighted album to be the most recent pictures per catagory (letter in this case) and on the other hand I do need to be able to keep all albums in alphabetical order or date order (depending on the level).
Anybody with great knowledge who can help me out on this one? Otherwise it wors fine as far as I have found out...
Your help is much appreciated!
If you want to see the work in progress... www.concertvisions.com/index.php
Greetz,
Ed
Posts: 27300
photodude,
try this attached file and rename it adminAlbumCommands_2col.inc and place it in the layout folder.
Dave
Posts: 104
Dave, I would like to change the "<!-- start of table check -->" to check for albums to decide whether to use 2-col or regular, but do not know what to substitute for "if (!$numPhotos"....or if this is possible.
(1 hour or so later....What I would like to do is test for albums, if no albums do the regular...if albums present, even if phots are also, do the 2-col)
I want to do this as I want to have images for the main albums which will not be contained in any of the subalbums. I would create a hidden image in the first level down to use for the main album.
If I do this as currently set up, the subalbums will not use 2-col (actually the 'rsramirez' is 1 to x columns). To do what I want, I would have to create a hidden subalbum and a hidden photo..not a big deal, just an add'l step....either way I will need to ensure that I don't mix "apples & oranges".
Thanks
Posts: 104
As I mentioned in the above post, the rsramirez mod, which I am using, is not just 2-col, but actually is x-col by y-rows based on the settings of row/col set for images which is set in either the default in config. wizard "layout" or in "admin options-properties".
The problem is that the row/col selected holds for both sub-albums and images, unless you manually adjust for each.
Is it possible modify the subalbum code to fix it (set it) for a specific row/col whenever there are only sub-albums (therefore using the 2-col code/layout) and revert to the image "layout" for the images.
For example, I like the "album" look for my subalbums, but not 2(or more)-col, but the same 1-col by 8-row layout as my main album page. The images I want set at 4-col by 2-rows. I can do this by adjusting each time I create albums/load images, but having it "hard coded" would make life simpler. Examples at my in-progress site: http://john.schwaller.org/gallery
Nevermind...
I added default row/col as follows to the code:
Thanks....JOHN
Posts: 4
Thanks so much for this, it's exactly what I was looking for. It works great.
Posts: 28
Menace, just sent you an email....
-Q
Posts: 16
great code!
Thanks you very much.
This code sould also be placed in the documentation.
Christopher
Posts: 4
Okay I just upgraded my gallery ( www.weasleynetwork.org/gallery ) to 1.5 and I put the changes required for this modification back in exactly as I did before. But now I can't edit the albums on the albums-only pages the use the album_2column_table.inc format. Instead of displaying the 1.5 (album actions) drop down menu options. The album-only pages that use the album_2column_table.inc format display the old (edit album) drop down menu option and they don't work. Is there any way to fix the code so it displays the right (working) drop down menu in 1.5? I like the way it displays, but I still need to be able to re-order albums and change the highlight and stuff like that.
Posts: 15
I'm just now moving my gallery from v1.4.4 to v1.5.1 and was looking for an updated 2 column mod such as this. I finally got it working and wanted to note here for everyone else who's looking to do this on v1.5.x.
For starters, I used rsramirez's code from this thread. I tried to use floridave's but the Admin Album Commands integrated into the code made it more difficult to modify. I did however add in the changes to rsramirez's code that floridave recommended further down.
In addition, for v1.5.x, do NOT use the separate adminAlbumCommands_2col.inc include file given in this thread; instead use adminAlbumCommands.inc that is already included with gallery (and called from gallery.php). This include file is not specific to the number of columns in use so it'll work no matter how many columns you have. In the rsramirez code simply search for the line
include(dirname(__FILE__) . '/layout/adminAlbumCommands_2col.inc');
and replace it with
include(dirname(__FILE__) . '/layout/adminAlbumCommands.inc');
Any other changes I made were simply cosmetic and didn't impact the working code in any way.
Hope this helps save y'all some time...
~Cherie
Posts: 4
Thanks Cherie, works great. Except now I can't re-set the highlight image unless I temporarily put a picture in the album, but that's something I can work around.
Rhonda Weasley
Weasley Network Gallery
Posts: 1
If any needs it - I have got it to work with Gallery 1.5.6. I followed the above and made some additional changes to get it to work. The attached zip file contains the original view_album.php (view_album_org.php) and a version with the modification I did (view_album.php). Furthermore it contains the album_2column_table.inc with my modifications, which includes an additional modification that allows re-setting the highlight image without having to temporarily put a picture in the album.
This is my 2007 Christmas/Season's Greetings Gift to you all.
BR,
Karsten
Posts: 2
thx a lot for you mod. it works great. there are just 2 problems
1) the albums are listed like on the main page. but still on two pages. i like to have all albums on one page. is this possible?
2) as far as i know its not possible to upload an image in the subfolder to show a higlight on the main page. is it possible to hide "no higlights"
thx
Posts: 2
ok 2) i could solve by set 1 album as highlight and later hide it.