New module: Show updates to your gallery

mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2006-09-13 22:51

well, the easiest "workaround" is to clone your theme, replace all $theme.pageUrl references with hardcoded core.ShowItem .. this makes all thumbnails link to ShowItem view for that item, instead of staying in the dynamic album... then use that version of the theme for your updates album.
of course themes could have some conditional to decide which type of links to make.. don't want to overcomplicate things for themers though :-(

 
forevervirginia

Joined: 2006-09-14
Posts: 4
Posted: Thu, 2006-09-14 15:37

I've tried the URL add-on to show only updates from a specific gallery, as described in this link:

http://virtua-gallery.com/gallery2/main.php?g2_view=updates.ShowUpdates&g2_itemId=1273

However, my gallery just keeps showing the updates to ALL galleries. Is this because I'm using 2.0 instead of 2.1.2?

Here's my site for reference:

http://www.forevervirginia.com/gallery/main.php?g2_view=updates.ShowUpdates

And an example of the add-on URL which should show only items from the "Auctions & Dolls for Sale" gallery, but still shows them all:

http://www.forevervirginia.com/gallery/main.php?g2_view=updates.ShowUpdates&g2_itemId=589

Help?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2006-09-14 19:12

yes, you need some 0.3.x version of Updates module (i don't remember exactly which.. 0.3.6?) for the g2_itemId parameter to be recognized.. and that version of Updates module won't work with G2.0.x

 
catnip
catnip's picture

Joined: 2006-08-23
Posts: 17
Posted: Sun, 2006-09-17 03:04

[i]Is there any way to keep the output from the current version from breaking up the rows? For some reason some of the thumbnails get moved down to their own row, so I have rows of 3, 3, 1, 3, 3, 2, instead of just 5 rows of 3. This happens in IE,
I'm not seeing it in Firefox, and haven't check Opera yet, as it's on my other machine.

Link here: http://karma-syphon.com/forum/gallery2.php?g2_view=updates.ShowUpdates
_____________________________________________________________________________________________________
____________________________________________[img]http://karma-syphon.com/buttons/ks2.png[/img]_______________________

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sun, 2006-09-17 05:08

if you're willing to upgrade to current svn / nightly snapshot you can try the dynamic albums module. (or anyone interested in this updates module should try/compare with dynamic albums module)

 
catnip
catnip's picture

Joined: 2006-08-23
Posts: 17
Posted: Sun, 2006-09-17 05:22

does it still not take you to the real album? that's my main reason for just wanting to fix the appearance: i want users to be taken to the original album when they click the thumbnail.
[img]http://karma-syphon.com/buttons/ks2.png[/img]

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sun, 2006-09-17 15:37

see the top post in that topic, i'm planning to make a theme option for links to the album. you can also customize your theme to always jump to the album.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2006-09-17 16:12

both approach work for me.

the module view approach probably offers more (direct) customization.
while the dynamic album / album view approach is more maintainable etc.

i like the dynamic album approach where the admin can define which theme to use.
the theme could be one specially made / extended for dynamic albums, featuring more information like the "view item in its album" links etc.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sun, 2006-09-17 17:19

yes, i thought of the specialized theme too.. but then decided it would be unlikely to match the look of the site's theme even though you can make flexible display options.

 
forevervirginia

Joined: 2006-09-14
Posts: 4
Posted: Sun, 2006-09-17 19:31

I was able to successfully upgrade to the most recent version of gallery and am now using the latest updates module.

Is it correct that there is no longer an option to embed the updates results in an external page (a php page not within Gallery) without the template wrap-around?

Has anyone come up with a hack to the showupdates include to remove the template wrap around?

 
catnip
catnip's picture

Joined: 2006-08-23
Posts: 17
Posted: Sun, 2006-09-17 20:27
mindless wrote:
you can also customize your theme to always jump to the album.

how would i do that?
_____________________________________________________________________________________________________
____________________________________________[img]http://karma-syphon.com/buttons/ks2.png[/img]_______________________

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sun, 2006-09-17 20:46

forevervirginia, yeah i broke the RawUpdates view at some point (well, it uses the "useFullScreen" theme option which has minimal templating from the theme, but not none) and no one has fixed it yet.

catnip, themes updated for G2.2 use {g->url params=$theme.pageUrl arg1=...} in some cases for thumbnail links. change these to {g->url arg1="view=core.ShowItem" arg2=...} and it will always jump to the album for that item, rather than stay in the dynamic album.

 
catnip
catnip's picture

Joined: 2006-08-23
Posts: 17
Posted: Sun, 2006-09-17 21:16

ok, thanks for the quick reply! will try it tonight

[img]http://karma-syphon.com/buttons/ks2.png[/img]

 
forevervirginia

Joined: 2006-09-14
Posts: 4
Posted: Sun, 2006-09-17 22:55

mindless - thanks for the reply. I'd gladly help if I knew anything at all about it. But I'll have to be content until somebody else who does figures it out! :-)

 
forevervirginia

Joined: 2006-09-14
Posts: 4
Posted: Wed, 2006-09-20 17:30

Well, I don't know why I didn't try it before, but the "image block" module is exactly what I needed. It gives me a output of thumbnails without the wrapping template that I've put into my external PHP homepage.

You can see it here: http://www.forevervirginia.com/index.php

I have 2 separate includes, the top 3 thumbnails show recent additions from the entire Gallery. The second set of 3 thumbnails shows a random set from a specific gallery album. I thought at first that you could only show 1 image at a time, but with a little googling I found out it's really easy to set it for as many items as you want. Another cool thing is you can have different combinations of criteria (random, recent, specific) for each image.

Sorry if this seems off topic but I know others that are looking for non-templated output may find this useful.

Here's some examples for reference: COPY FULL URL

Normal output of image block showing 1 recent image:
http://www.forevervirginia.com/gallery2/main.php?g2_view=imageblock.External&g2_blocks=recentImage&g2_show=title

Output showing 3 recent images (I modified the template to show these horizontally in a table):
http://www.forevervirginia.com/gallery2/main.php?g2_view=imageblock.External&g2_blocks=recentImage|recentImage|recentImage&g2_show=title

Example of output of 3 images (1 recent, 1 random, 1 most viewed):
http://www.forevervirginia.com/gallery2/main.php?g2_view=imageblock.External&g2_blocks=recentImage|randomImage|viewedImage&g2_show=title

 
travelvice
travelvice's picture

Joined: 2005-07-16
Posts: 112
Posted: Sun, 2006-10-01 01:26

Will I need to upgrade from G2.0.x to give this new version a shot?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sun, 2006-10-01 15:36

yes

 
Herr.Vorragend
Herr.Vorragend's picture

Joined: 2004-07-16
Posts: 120
Posted: Thu, 2006-10-05 12:30

Hi, nice module.

Has anyone already translate the module in german language?

If not, I will make a translation. But it is not so easy with MS Windows working. :-)

Thx

 
zorroh

Joined: 2006-01-24
Posts: 4
Posted: Tue, 2006-10-17 23:06

this module is great! :) i need album listing like here, in this module, where i must change code for that? and what exactly i must change?

 
tylers

Joined: 2006-11-10
Posts: 1
Posted: Fri, 2006-11-10 06:28
Quote:
Is there any way to keep the output from the current version from breaking up the rows? For some reason some of the thumbnails get moved down to their own row, so I have rows of 3, 3, 1, 3, 3, 2, instead of just 5 rows of 3. This happens in IE,
I'm not seeing it in Firefox, and haven't check Opera yet, as it's on my other machine.

I don't know if you fixed this problem yet, but in case you haven't, here's a fix:

Edit the templates/Header.tpl file and add the line "height: 200px;" to the div.updates-item section.

You may have to play with the height to work for your gallery. Note: this has only been tested in firefox; I don't know if it will work in other browsers.

--Tyler

 
ethan

Joined: 2006-09-01
Posts: 5
Posted: Fri, 2006-11-10 14:31

Hi, thanks for this module
it works well.

but I have another problem, it show all images
include albums those should be setup as hidden or password protected
anyone has the same issue as I am?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2006-11-22 00:36

logout and you probably won't see those. it shows items you have permission to see.. if you're logged in as admin then you have permission.

 
Steel Rat
Steel Rat's picture

Joined: 2006-06-24
Posts: 100
Posted: Sat, 2006-12-09 21:06

I added an unconditional link to add to cart for items shown on the Updates page, but it seems a different version of Updates is shown for unregistered users as opposed to registered. If I logout, I don't see the Add To Cart link, but I do when I login.

Cleaned out my cache and tried it on different computers, same results. The file I changed is in /local/ShowUpdates.tpl. Is it possible that the /local copy is only shown to registered users? Just tried experimenting with that and it's not the case. Odd. Does the RawUpdates.tpl have anything to do with this? Been cruising around my admin page for something that may control this, but not seeing it.

Steel Rat
RPGMapShare.com

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2006-12-09 23:32

what are your site admin / performance settings? maybe you have a cached guest page. modifying the updates tpl should affect everyone.

 
Steel Rat
Steel Rat's picture

Joined: 2006-06-24
Posts: 100
Posted: Sat, 2006-12-09 23:43

I ran the Template and Database cleanup options, in hopes that something was being cached, but no change. I had made other changes to the tpl as well, like using tables instead of divs, since things were overlapping depending on the size of the summary field, as a result I changed the number of colums to three. But guests see 4 columns. Very odd.

As for the performance settings, I have the defaults, No acceleration for either guests or registered users. But if I logout of my session, I instantly see the difference in the updates outbput.

Steel Rat
RPGMapShare.com

 
Steel Rat
Steel Rat's picture

Joined: 2006-06-24
Posts: 100
Posted: Sat, 2006-12-09 23:47

Something else, don't know if it's related. But guests also don't see some album thumbnails. If you go to the site link in my sig, you'll notice that the All The Maps album thumbnail doesn't show up (random highlight). And if you click that album, some of the sub-album thumbnails don't display either. But if you're logged in (registered), it all displays fine.

Steel Rat
RPGMapShare.com

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2006-12-11 01:10

i see 3 columns for updates on rpgmapshare.com..

 
FLUXrider

Joined: 2006-05-18
Posts: 49
Posted: Thu, 2006-12-14 11:27
tylers wrote:
Quote:
Is there any way to keep the output from the current version from breaking up the rows? For some reason some of the thumbnails get moved down to their own row, so I have rows of 3, 3, 1, 3, 3, 2, instead of just 5 rows of 3. This happens in IE,
I'm not seeing it in Firefox, and haven't check Opera yet, as it's on my other machine.

I don't know if you fixed this problem yet, but in case you haven't, here's a fix:

Edit the templates/Header.tpl file and add the line "height: 200px;" to the div.updates-item section.

You may have to play with the height to work for your gallery. Note: this has only been tested in firefox; I don't know if it will work in other browsers.

--Tyler

Cool . Thanks . That fixed my issue.
Great module. Better than great. Have a primary link now in a drupal site with gallery2 embedded and this one module is . Latest blog entries , latest posts , and now latest images .
Top job. Thanks to everyone involved in its development.
FLUXrider
From the love of the ride good things come

 
Steel Rat
Steel Rat's picture

Joined: 2006-06-24
Posts: 100
Posted: Fri, 2006-12-22 15:59
mindless wrote:
i see 3 columns for updates on rpgmapshare.com..

I reverted back to a previous Drupal theme, which seemed to make a difference. Not sure why.

Steel Rat
RPGMapShare.com

 
theNthDoctor

Joined: 2006-12-28
Posts: 1
Posted: Thu, 2006-12-28 21:00

GREAT MOD!!

I have a question.. I am a G2 newbie and need to figure out how to change the HTML that's being outputted. If someone helps me with this today, I'll paypal you $5 :)

I'm calling updates.ShowUpdates from an external directory... and the HTML being output is assuming the wrong directory for my G2 location. How (either cleanly or by hacking) could I change this to read the correct pathname?

Example:
/block.php calls the updates mod via readfile.
/app/gallery2/ is my G2 base dir.

But the HTML being output, assumes that G2 is located in my site root directory... meaning the script runs fine, but the HTML output has bad locations for the images and links.

$5! No joke! (Coz I'm using the mod for a client's site :) )

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2007-01-01 08:01

find the g->url calls in the templates dir where these urls are created and add forceFullUrl=true just before the closing } of the g->url.

 
joe7rocks
joe7rocks's picture

Joined: 2004-10-07
Posts: 560
Posted: Sun, 2007-01-28 01:33

Hi.
I just tried this on my _huge_ site.

Stress Test results:
The code -as it is- is not really suitable for a g2 with this size (~3500 Users, ~450K items atm, ~1k new images a day).
With the 'vanilla' code generating an update page for root album took over 5 _minutes_.
Don't be afraid, you won't ever experience problems like these if you don't have users over several 1000s AND images over 100.000s :>

But if you experience this, you might want to consider:

  • Adding caching
  • Calling the updater only from crontab (this way number of visitors doesn't matter)
  • (Limiting the number of pages/history)
  • For Hardcore Users: Incremental upgrader

I'm just testing an experimental code according to these on my site: http://gallery.site.hu/friss/
(The result is somewhere around ~30secs compared to the starting 5+ minutes, good enough to trigger in every 10 mins or so)

linkfelhő oldal | My gallery 2 about dogs

 
Eka_Mei

Joined: 2006-01-03
Posts: 132
Posted: Sun, 2007-01-28 05:52

I have about 20,000 user on my site, but only around 15,000 items. The generation still take under 3 seconds.

What type of server do you have joe7rocks?

 
joe7rocks
joe7rocks's picture

Joined: 2004-10-07
Posts: 560
Posted: Tue, 2007-01-30 16:32
Eka_Mei wrote:
I have about 20,000 user on my site, but only around 15,000 items. The generation still take under 3 seconds.

What type of server do you have joe7rocks?

Oh, wow. :P
Do you have useralbums module enabled?
And btw: <1.0 items/user? How come? :)

Type of server: it's nothing but a usual pc.. 1GB ram, 2Ghz cpu, loaded with a bounch of hdds, etc.

My gallery 2 | linkfelhő oldal

 
Eka_Mei

Joined: 2006-01-03
Posts: 132
Posted: Tue, 2007-01-30 19:24

About 400 users have their own permission. But I think user albums have different permission right from the first place. That might be the problem.

Currently the permission system in Gallery is not exactly fast from what I gather. Which might be the underlying problem.

Type of server, 1GB ram, 3.2Ghz cpu, just a normal non-RAID harddrive.

 
travelvice
travelvice's picture

Joined: 2005-07-16
Posts: 112
Posted: Fri, 2007-04-27 09:23

I'm interested in updating from Gallery 2.0.z to 2.2.1 -- but the driving reason behind it is the use of the update module

Here I am, downloading all the add-ons I'll need for the upgrade, when I notice this module isn't supported in G2.2

Are there any module modification instructions out there that I can follow to use this 'lil guy in the latest version of the Gallery app?

//craig

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2007-04-30 16:36

G2.1.x modules work in G2.2. G2.2 also includes a module called "dynamic albums" which is similar to this module.

 
travelvice
travelvice's picture

Joined: 2005-07-16
Posts: 112
Posted: Wed, 2007-05-02 09:16

Ah-ha! I misread the columns "G2.2 only G2.1/2.2 G2.0" on the user modules page. Thank you!

 
Alexandra70

Joined: 2004-12-08
Posts: 143
Posted: Thu, 2007-07-12 11:40

Hello Mindless,

Remember the code ".updates-item { width: 200px; height: 250px; }" to align the pictures on the Updates page??

Well, since I upgraded Gallery to the new 2.2 version, I cannot access the Updates Admin page from the SITE ADMIN sidebar... The link is there, but I get a totally blank page.. no error message, just a blank page. http://www.EXAMPLE.com/gallery2/admin/?g2_subView=updates.UpdatesSiteAdmin

I removed this module.. added it again... and I get the same thing.

I found a temporary workaround... I added the ".updates-item { width: 200px; height: 250px; }" to the CACHE section of the module /gallery2/g2data/cache/module/updates/0/0/0.inc - and it aligns the pictures perfectly, but every time I run the maintenance and delete Cache, I have to manually go there and edit the 0.inc again.

Any ideas why I get a blank page for the Updates Admin area??

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2007-07-13 21:32

sorry, no idea.. I use the dynamicalbum module now, not updates module.

 
Alexandra70

Joined: 2004-12-08
Posts: 143
Posted: Sat, 2007-07-14 04:41

Yes I tried it, but I don't like the fact that it doesn't say when the pics were added. The Updates Module displays this under pictures "Added: 12-July-2007".

Any way to add that to Dynamic??

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2007-07-14 15:20

with dynamicalbums you can pick any theme and any theme settings for the display.. so pick a theme and modify it to show the create date. i don't know of any themes that show this date now.

 
Rebellion
Rebellion's picture

Joined: 2006-11-24
Posts: 16
Posted: Sun, 2007-07-15 13:01

This module is incompatible with 2.2.2. I installed it and now it originally gave me an Incompatible symbol next to the module telling what was wrong, but now it's just a blank screen. Also the incompatible left no option for removal.

Is there someone out there that can help me resolve this?

http://slovakia.homeip.net

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sun, 2007-07-15 15:28

make sure you downloaded version 0.3.7. click downloads above, then user contributed modules. there is a link for the g2.1/g2.2 version of the module on that page.

 
zi94sm65

Joined: 2006-07-25
Posts: 38
Posted: Sat, 2007-07-21 12:41

For anybody that might be interested, i had the same problem Alexandra70 had with not being able to access the Updates Admin page from the SITE ADMIN sidebar and getting a totally blank page after upgrading to 2.2.X version. I found the problem line in the file UpdatesSiteAdmin.inc

I changed the code (around line 124 in my file) but look for:

Quote:
list ($ret, $blocks) = $view->loadAvailableBlocks();

and change it to:

Quote:
list ($ret, $blocks) = GalleryCoreApi::loadAvailableBlocks();

that got it working again for me....

 
rob2701

Joined: 2007-07-21
Posts: 10
Posted: Sat, 2007-07-21 13:22

Hi, thanks for this module, it's a great addition.
Small issues with HTML vaildation (warnings):

I get lots of warning on the updates page about "discarding newline in URI reference"

<div class="gbBlock">
<div id="gsContent" class="gcBorder1">
<div class="gbBlock gcBackground1">
<h2> Gallery Updates </h2>
</div>
<div id="updates" class="gbBlock">
<div class="updates-item">
<div class="updates-thumb">
<a href=" /component/option,com_gallery2/Itemid,49/lang,en/?g2_itemId=4720&amp;
">
<img src="/gallery2/index.php?g2_view=core.DownloadItem&amp;g2_itemId=4722&amp;g2_serialNumber=2" width="140" height="105" class="giThumbnail" alt="in de klas" longdesc="in de klas"/>
/</a>
</div>

<div class="updates-caption">
<div class="updates-link">
<a href=" /component/option,com_gallery2/Itemid,49/lang,en/?g2_itemId=4720&amp;
">in de klas/</a>
</div>
<div class="updates-date">
<label> Added: </label>
20-07-2007
</div>
</div>
</div>

Can anyone give me an indication on where I can fix this?
Thanks in advance!

 
zi94sm65

Joined: 2006-07-25
Posts: 38
Posted: Sun, 2007-07-22 17:43

You might try opening up the source code in a text editor that can show invisibles like carriage returns and newlines and then going through the code and looking at all the URL references for extra carriage returns or newlines. I read that the "discarding newline in URI reference" validation notice has a Cause: The URL given in the tag is containing newline or carriage return.This is a notice, not a real HTML error. Solution: Remove the newline in the URL.

Not positive doing this will solve the validation errors/notices but it might help.

 
rob2701

Joined: 2007-07-21
Posts: 10
Posted: Sun, 2007-07-22 21:10

Thanks, getting the new lines out of the URLs in [ShowUpdates.tpl] means I went down from 118 validation warnings to 18...
One step closer to the revered green checkmark :-)

Thanks again for the pointer!

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2007-07-24 20:39

zi94sm65, thanks for posting that fix! When I get a chance I'll put up a new version with that.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2007-07-26 19:47

Here is the version for Gallery 2.2.x