Hi all-
Using the new dynamic album functionality in G2.2 I've thrown together this new module, attached below. If I work out a few things pretty soon I'll try to include it in 2.2.
Here's what the attached module does:
- Dynamic album views for recent items, most viewed items and random items (yes, an album picked at random!)
- Site admin to pick a theme and theme settings for these views, a description for each view, and the total number of items for each (size of zero to disable a view).
- URL rewrite rule for each
Planned changes:
- DONE: Optional parameter to restrict the query to any subtree (album + all subalbums) of the gallery
- DONE: Site admin default for whether just data items or all items (albums, link items, ..) are included; optional query parameter to change the default
- DONE: Display link to each view in site admin so you can add the link in your site
- DONE: Site admin options for "view updates" or "view popular" item links.. these would show up in every album and show the selected view for that album + subalbums
- Update at least matrix theme with a few more settings to control the display.. the existing "updates" module has settings like "show title", "show date", etc. Using a dynamic album you only get options like this if the theme has those options.
- Update at least matrix theme with "jump to album" links.. clicking thumbnails will browse the dynamic album, but sometimes people will want to jump to the album where that item is located to see other related items. ideas for the wording of this link are welcome.
Please share other ideas on how to make this module useful. We'll see how much I can get to before 2.2 feature freeze.
oh, the links to the views (without URL rewrite) are:
main.php?g2_view=dynalbum.UpdatesAlbum
main.php?g2_view=dynalbum.PopularAlbum
main.php?g2_view=dynalbum.RandomAlbum
This module works only with current svn / nightly snapshot.
Edit: updated module attached, I marked the things I've added with DONE above.
Posts: 238
This is great! Kind of like iPhoto's smart albums. This along with Keyword albums is gonna make v2.2 great!
Posts: 27300
Cool stuff!
I would like to see a link to the dynamic album from the configuration page.
New icons for the icon packs are required as well.
Dave
____________________________________________________
Blog with G2 || Gallery Frames / Mods || G1 Test Gallery
Posts: 8601
links in site admin is in my list above.
icons? if someone makes them I can add them..
Posts: 1023
Thanks mindless,
you fullfilled my - even not yet dreamed - dreams ...
CU
Lutz
Gallery version = 2.2-svn core 1.1.16
PHP version = 5.1.6 apache2handler
Webserver = Apache/2.2.3 (Win32) DAV/2 PHP/5.1.6 mod_ssl/2.2.3 OpenSSL/0.9.8c
Database = mysql 5.1.11 beta-log,
Theme=PGlightbox,
Gallery-URL=http://lf-photodesign.de
Posts: 8601
New version of the module attached above.
Posts: 1023
mindless, the "Album Descriptions" are gone with this build of the module for "random" and "popular" - still visible for "recent" ...
Gallery version = 2.2-svn core 1.1.16
PHP version = 5.1.6 apache2handler
Webserver = Apache/2.2.3 (Win32) DAV/2 PHP/5.1.6 mod_ssl/2.2.3 OpenSSL/0.9.8c
Database = mysql 5.1.11 beta-log,
Theme=PGlightbox,
Gallery-URL=http://lf-photodesign.de
Posts: 27300
Ask and yee shall receive.
Dave
____________________________________________________
Blog with G2 || Gallery Frames / Mods || G1 Test Gallery
Posts: 27300
oops. forgot the other "set". The above was for Pauls icons.
these are for KSicons
____________________________________________________
Blog with G2 || Gallery Frames / Mods || G1 Test Gallery
Posts: 1023
floridave, cool
Gallery version = 2.2-svn core 1.1.16
PHP version = 5.1.6 apache2handler
Webserver = Apache/2.2.3 (Win32) DAV/2 PHP/5.1.6 mod_ssl/2.2.3 OpenSSL/0.9.8c
Database = mysql 5.1.11 beta-log,
Theme=PGlightbox,
Gallery-URL=http://lf-photodesign.de
Posts: 1023
mindless,
could it be that the dynamic albums don't check some permissions set?
On my theme - in normal albums - there are icons visible below the thumb for "add to Cart/Purchase", "Add Comment", "View Comment" and "Show Exif".
These are triggered in album.tpl by eg.
(Same for the
The dynamic albums only show the EXIF icon ...
Removing the check for the "isset ($theme.permission...)" they get visible in the dynamic albums too ...
Any idea what happens?
Should I remove the permission check as workaround?
EDIT: even the Lightbox suddenly becomes active after changing
Thanks,
Lutz
Gallery version = 2.2-svn core 1.1.16
PHP version = 5.1.6 apache2handler
Webserver = Apache/2.2.3 (Win32) DAV/2 PHP/5.1.6 mod_ssl/2.2.3 OpenSSL/0.9.8c
Database = mysql 5.1.11 beta-log,
Theme=PGlightbox,
Gallery-URL=http://lf-photodesign.de
Posts: 8601
Indeed. fixed for next rev, thanks.
Thanks! I'll get these added. Feel free to add some more..
$theme.permissions won't have anything for a dynamic album, in album view.. it is not a real gallery item and thus has no permissions.
Posts: 1023
mindless,
is there a way to check for dynamic albums?
Gallery version = 2.2-svn core 1.1.16
PHP version = 5.1.6 apache2handler
Webserver = Apache/2.2.3 (Win32) DAV/2 PHP/5.1.6 mod_ssl/2.2.3 OpenSSL/0.9.8c
Database = mysql 5.1.11 beta-log,
Theme=PGlightbox,
Gallery-URL=http://lf-photodesign.de
Posts: 27300
Is the best way to look for the blank icons (after one activates all modules) or is there a list that needs to be done?
Posts: 8601
floridave:
I have KSIcons active in my dev G2 and I see these missing in site admin: captcha, permalinks, squarethumb, sitemap, getid3, multilang, rating, itemadd. For paularmstrong it looks like just itemadd.
LFrank:
hm, let's see.. {if $theme.pageUrl.view != 'core.ShowItem'} might work?
but you mentioned these are things shown below thumbnails? shouldn't they check permissions for the item of that thumbnail, not permissions of the containing album?
Posts: 1023
mindless,
I'll try ... yes - but that was the only thing coming into my mind ...
EDIT: it works putting it into an additional "|| ($theme.pageUrl.view != 'core.ShowItem'))"
Gallery version = 2.2-svn core 1.1.16
PHP version = 5.1.6 apache2handler
Webserver = Apache/2.2.3 (Win32) DAV/2 PHP/5.1.6 mod_ssl/2.2.3 OpenSSL/0.9.8c
Database = mysql 5.1.11 beta-log,
Theme=PGlightbox,
Gallery-URL=http://lf-photodesign.de
Posts: 8601
Updated module attached above.. queries for a subtree of the gallery now work.
Posts: 8601
any comments on querying creationTimestamp vs originationTimestamp? Updates Album now queries creationTimestamp, so you see items recently added to the gallery even if the picture was taken long ago.
Posts: 1023
creationTimestamp is very much appreciated
Gallery version = 2.2-svn core 1.1.16
PHP version = 5.1.6 apache2handler
Webserver = Apache/2.2.3 (Win32) DAV/2 PHP/5.1.6 mod_ssl/2.2.3 OpenSSL/0.9.8c
Database = mysql 5.1.11 beta-log,
Theme=PGlightbox,
Gallery-URL=http://lf-photodesign.de
Posts: 27300
How much trouble would it be to implement both? I know that we should not add to much as it just confuses the end user. So there is a limit to the features we should add.
What if the photos (non digital) where scanned they would have a creation date that is correct but a origination that is incorrect. I suppose the creation date could be corrected. Or is it the other way around ( see the confusion )
I think either way you implement it, somebody would like it the other way. If we implement both then the end user is confused and the guy that wants a minimalist install will complain.
Posts: 8601
creationTimestamp is when the item was added to the gallery.. this cannot be changed.
originationTimestamp can be autoset from EXIF data; also is editable in 'edit item' / General tab.
Options:
- a 4th view in this module for originationTimestamp query, with all the associated options in site admin
- a selector for "Updates Album" in site admin to use one or the other
Posts: 46
I think thats the better option - firstly it gives the admin more possibilities and secondly it makes more sense than the selector b/c the administration it's the same like of the other three views.
Posts: 8601
Roi, but what do you suggest we name this view to avoid confusion between the two?
Posts: 8601
Yay, the module is now unit tested and added into svn / nightly snapshots.
Apologies to anyone who already tried a version attached above.. I renamed the dir from "dynalbum" to "dynamicalbum" so you'll lose any settings you had in moving to the svn version. Just uninstall and delete the old one.
Posts: 1023
cool...
mindless, may I ask another thing - you've mentioned that the $theme.permission isn't the correct way to check the permissions for an thumb/photo.
I checked the other themes but find only theme-permissions used in the templates. Is there a $ItemId.permission.xxx or $ChildId.permission.xxx I could use better?
Thanks,
Lutz
Gallery version = 2.2-svn core 1.1.16
PHP version = 5.1.6 apache2handler
Webserver = Apache/2.2.3 (Win32) DAV/2 PHP/5.1.6 mod_ssl/2.2.3 OpenSSL/0.9.8c
Database = mysql 5.1.11 beta-log,
Theme=PGlightbox,
Gallery-URL=http://lf-photodesign.de
Posts: 46
In the latest nightly I only found three views so I suppose you're still searching for a name for the fourth. ;)
I would name the album like they are sorted to prevent confusion. Suggestions:
Btw, is it difficult to add a fifth view where items are filtered by one user ID?
Posts: 8601
LFrank, I guess we didn't need permissions data in the tpls to build the existing themes.. it isn't there. You could add it in your theme.inc. Something like:
Roi, not sure about "Archives" as that implied old stuff.. more common the view will be used to see what new stuff is there.
View filtered by user could go here or in members module.. I don't plan to add it.
Posts: 1023
Thanks mindless, I assume I implemeted (or at least tried to) something completely (don't know the exact word in english) 'superflueous' (überflüssig)
Gallery version = 2.2-svn core 1.1.16
PHP version = 5.1.6 apache2handler
Webserver = Apache/2.2.3 (Win32) DAV/2 PHP/5.1.6 mod_ssl/2.2.3 OpenSSL/0.9.8c
Database = mysql 5.1.11 beta-log,
Theme=PGlightbox,
Gallery-URL=http://lf-photodesign.de
Posts: 1023
mindless,
I've implemented an option to stay within the dynamic albums from within the ThumbNavigator (in PGlightbox)- this works perfect with
normal albums, updates album, popular album, rating and key album BUT NOT with random albums ...
can you tell a difference, why the code below isn't working just for this type?
You might check on my site i.e. http://localmail.dynip.com/GALLERY2/updates/ or ... /random/
Thanks,
lutz
Gallery version = 2.2-svn core 1.1.16
PHP version = 5.1.6 apache2handler
Webserver = Apache/2.2.3 (Win32) DAV/2 PHP/5.1.6 mod_ssl/2.2.3 OpenSSL/0.9.8c
Database = mysql 5.1.11 beta-log,
Theme=PGlightbox,
Gallery-URL=http://lf-photodesign.de
Posts: 8601
i don't really know how that works.. is there an http request to the server when you click a thumbnail? for what URL.
the problem likely comes from the fact that the contents are random on every request (ie, just hit reload in the album and you get something different), so a URL that looks for a particular itemId in this album may not find it.. the new random set may not have that one.
Posts: 1023
mindless, the URL sent to the server when you click the thumbnail is first the lightbox and then the classical link if you click the link within the lightbox. You can click directly the rightmost "View Photopage" Icon below the Thumb, too. The URL used to link to the photo page are the 'normal' links created by the dynamic album http://localmail.dynip.com/GALLERY2/random/?g2_itemId=109800&g2_enterAlbum=0. The Photo displays OK in the photo.tpl.
Only the Thumbnavigation is "blank" - BUT ONLY for the random album ... Icons created by <a href="{g->url params=$theme.pageUrl arg1="itemId=`$peer.id`"}" ...
can I check for the random albums to prevent the thumbnavigation from being displayed?
EDIT just checked - random wasn't working with the old thumbnavigator too - looks really like the "random" nature preventing being able to see "peers" ;) Only way would be to see new random ones generated ...
Gallery version = 2.2-svn core 1.1.16
PHP version = 5.1.6 apache2handler
Webserver = Apache/2.2.3 (Win32) DAV/2 PHP/5.1.6 mod_ssl/2.2.3 OpenSSL/0.9.8c
Database = mysql 5.1.11 beta-log,
Theme=PGlightbox,
Gallery-URL=http://lf-photodesign.de
Posts: 24
Hi there !
I'm curious about how the PopularAlbumsView() is implemented as I have a php file which walks a gallery tree and spits out an xml file listing a specific Albums data contents which I can call using this syntax
http://anyurl/gallery/rbxml.php?g2_itemId=135
Currently I do a call to GalleryCoreAPi::loadEntitiesById($id) passing in the g2_itemId for the album. Then I load the child entities of the album using GalleryCoreApi::fetchChildItemIds($entity);
What i'd like to do instead is to instead populate my xml stream from entities from the results of dynamicalbum.PopularAlbum. Any thoughts on the best way to accomplish this ?
best regards
Robbie
Posts: 8601
search for buildItemQuery in dynamicalbum/UpdatesAlbum.inc
Posts: 24
Thanks for that, I'll go take a looksee in an hour or so.
Posts: 5
hi mindless,
there's a bug in "next page"
when you click "view lastest updates" from a sub album
the first page is correct, but when you click the next page
it show the entire album's lastest updates, not the sub album
looks like it didn't pass throgh the g2_albumId in pagination
popular and random should havd the same problem
Posts: 39
Is there anyway for Dynamic Albums to also obey the 'Prevent this album from being displayed in the Image Block' found in the album properties?
Thanks for your thoughts.
Mike
-----
Gallery version = 2.2-svn core 1.1.20
PHP version = 4.4.2 apache
Webserver = Apache/1.3.36 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.4.2 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.27 OpenSSL/0.9.7a
Database = mysqlt 4.0.27-standard, lock.system=flock
Toolkits = ArchiveUpload, Exif, Getid3, LinkItemToolkit, Thumbnail, Gd, ImageMagick
Acceleration = none, none
Operating system = Linux 2.4.21-32.0.1.ELsmp #1 SMP Wed May 25 14:26:33 EDT 2005 i686
Default theme = matrix
Posts: 70
Are there any plans to add to this module for top rated pics?
This would be great, but maybe in another module I haven't come across yet.
Thanks..
Posts: 70
just thought of another question, Is there an easy way to use this plugin as a block or code to stick in a table?
So if I wanted an area on the front page that had the 4 newest pics uploaded?
--edit--
I know you can do this with image block, but i wanted to seperate my random pics from my recent, in their own table on the front page
Posts: 1023
curbob:: top ratinghs - the rating module already allows this with the "rating/5" - It uses the same technology in the back I assume
Gallery version = 2.2-svn core 1.1.22
PHP version = 5.1.6 apache2handler
Webserver = Apache/2.2.3 (Win32) DAV/2 PHP/5.1.6 mod_ssl/2.2.3 OpenSSL/0.9.8d
Database = mysql 5.1.11 beta-log,
Theme=PGlightbox,
Gallery-URL=http://lf-photodesign.de
Posts: 8601
ethan, using which theme to display the dynamic album? I wasn't able to recreate this problem with matrix theme.
way2real, no that is not possible. The imageblock setting only applies to "real" albums.
Posts: 39
Thanks, mindless. As a work around, I was wondering... can the creation date (or whatever makes an album 'Most Recent') be pushed back so it no longer shows in the dynamic 'Updates Album'?
Posts: 8601
there is no way in the application to change a creation date.. you can of course write code to do this, or modify your database directly and then clear the db cache in site admin / maintenance.
Posts: 114
Thanks for creating this.
Cant wait to try it out for 2.2 when its ready!
Posts: 12
Well I managed to show recent items as first page but I don't know how to change the title and header of site to something else than "Recent Updates", maybe the title of site( the main album)?
take care guys
Posts: 46
I second that, I wrote similar before -> http://gallery.menalto.com/node/59199
There is already a vote for this -> http://gallery.menalto.com/sfvote/vote/1633898 (as a popular site that uses such a system, I've mentioned deviantart.com)
So curbob, vote!
Posts: 27300
You can configure the description of the three dynamic albums in the configuration.
To change the title you will need to edit the .inc files eg: modules/dynamicalbum/PopularAlbum.inc
$this->_title = $gallery->i18n('Most Viewed Items');
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 5
I use Matrix theme also, sine I just upgrade to last svn version
the problem solved, thanks
but there's another problem
"random" displays files in password protected album
my setting problem?
Posts: 8601
if you're logged in as an admin, you can see all items so they may show up in the random view.
Posts: 5
sure, i loggout as a guest
Posts: 344
How do you edit the updatesalbum so it matches the style of your theme (in this case, I'm using SIRIUX)?
Posts: 4342
Mindless,
Would you consider adding a fourth type of dynamic album - users' favourites? I've written a module to do this that works with Dynamic Albums but I think it would be better all together. I'm happy to send you the code for the extra bits (there's really not much to it) but will you tie them together?