New module: Show updates to your gallery

wayneb

Joined: 2006-06-11
Posts: 6
Posted: Fri, 2006-06-16 04:46

Thanks for the tip earlier, Mindless. My next question/request concerns posting the updates as larger images instead of the thumbnails...

The code in the ShowUpdates.tpl is:
{g->image item=$item image=$item.thumbnail class="giThumbnail"}

By messing around I ended up with:
{g->image item=$item image=$item}
which displays a full size image. Unfortunately this displays the full size or "download" size of the image. Is it possible for the module to import/use the default resize size used in the current theme (im my case 700px wide). Or set it somewhere? If so is it simply a matter of changing this line of code or something more elaborate? Thanks!

 
joemonster
joemonster's picture

Joined: 2006-04-12
Posts: 236
Posted: Sun, 2006-06-18 00:17

Hi,

i'm searching for a way to integrate the module more into my gallery without changing any other things than the module itself. I don't know if some of the things are possible but it would be really nice.

1.) show "Gallery / Updates" instead of only "Gallery" in the breadcrumb
2.) option to show newest albums instead of newest pictues (at the moment the most important point for me)
3.) use the default theme to display pictures and albums

I tried to do it myself but for the first and second point i have no idea how to do it.
To achieve point 3 i changed the ShowUpdates.inc file a little bit:

Around line 192 i changed the paging system code into

Quote:
$theme = array();
$theme['currentPage'] = $page;
$theme['totalPages'] = ceil($totalCount/$perPage);

// Paging system (Navigator)
if ($page > 1) {
$navigator['first'] = array('urlParams' => array('view' => 'updates.ShowUpdates',
'itemId' => $itemId, 'page' => 1));
$navigator['back'] = array('urlParams' => array('view' => 'updates.ShowUpdates',
'itemId' => $itemId, 'page' => $page - 1));
}
if ($page < $theme['totalPages']) {
$navigator['next'] = array('urlParams' => array('view' => 'updates.ShowUpdates',
'itemId' => $itemId, 'page' => $page + 1));
$navigator['last'] = array('urlParams' => array('view' => 'updates.ShowUpdates',
'itemId' => $itemId, 'page' => $theme['totalPages']));
}
$theme['navigator'] = $navigator;

Around line 234 i deleted the line

Quote:
$result['body'] = 'modules/updates/templates/' . ($raw ? 'Raw' : 'Show') . 'Updates.tpl';

and added

Quote:
$theme['children'] = $itemData;
$template->setVariable('theme', $theme);
$result['body'] = 'themes/sirux/templates/album.tpl';

You have to replace "sirux" with the theme you are using e.g. matrix.

For the sirux theme it works quite well. Unfortunately i encountered problems with the matrix theme because the left side was shown twice.

Now i'm searching help to achieve point 1 and 2. And i think it would we nice if point 3 works with nearly all themes.

Thanks in advance

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sun, 2006-06-18 15:35

wayneb, looks for example code using fetchResizesByItemIds.

joemonster, 2) alter the query to check for entityType = 'GalleryAlbumItem'
3) gallery 2.2 will allow arbitrary sets of items to be displayed with a theme

 
wayneb

Joined: 2006-06-11
Posts: 6
Posted: Sun, 2006-06-18 16:24

Thanks for the tip, Mindless. Have a great day!

 
joemonster
joemonster's picture

Joined: 2006-04-12
Posts: 236
Posted: Sun, 2006-06-18 16:51

Thanks Mindless, it works very well. I also had to remove the DataItem table from the query.

 
Eka_Mei

Joined: 2006-01-03
Posts: 132
Posted: Mon, 2006-06-19 14:14

Thanks for answering that mindless!

Question: Anyone know ho to display the name of the owner to each item in the display page? I am investiaging it right now, but I would appreciate if someone know the best and fastest way to handle this!

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2006-06-19 17:00

in the php code you'll need to make a map of owner ids to owner data.

 
kjpweb

Joined: 2006-06-17
Posts: 8
Posted: Thu, 2006-06-22 17:25

Hi. First thanks for providing a very much appreciated module.
It works fine on my gallery - just hitting a double snag.
resolving this seems to be possible - what I read in these
posts - just how - I don't know.
I have a gallery site for digital artists.
The structure contains User albums, topic based albums and software based albums.
The image is uploaded to users album, then linked to the topic - e.g. portraits
and to software - e.g. poser.
Practical result is - that I see updates for ALL albums, which means, that new
uploads are shown three times.
Hence my question:
a) how can I query just the user album?
b) how can I avoid duplicates? --------> To just resolve this one would be a big step for me...
c) how can I exclude an album?
d) how can I query the most viewed or highest rated?
e) and if that's possible is it coded in the module or is it
just a matter of the query URL?

Long question - but I rather be as precise as can be - and I think
some other non coders like me look for a similar solution.

Thanks

 
Eka_Mei

Joined: 2006-01-03
Posts: 132
Posted: Mon, 2006-06-26 01:08

a) Query just one album and the item underneath that album, is possible. But just the user's album is pretty much not possible. I have not invesigate how user ownership will work with this yet.

b) I'm not sure what duplication means. As long as you don't upload duplication, the update module should not display the same item twice.

c) Yes, I believe Mindless already responded to this one, try check the previous post by him.

d) Those are not implanted at the moment. Try the statistic module for most viewed item. That module is not under development at the moment though, sadly.

e) Depends, there are a couple of switches, I also made it possible to display the number of items displayed at once base on the url. however, any further query will need to be added.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2006-06-26 14:21

(Eka_Mei.. (b) above it says they upload an image and then "create link" twice into other albums, so that's where the "duplicates" come from.. I guess if the updates query only looks in one of those album trees then you won't get dups)

 
kjpweb

Joined: 2006-06-17
Posts: 8
Posted: Mon, 2006-06-26 14:49

To a) that's just what I try to achieve. There is not a permission problem - in the way (as I understood you concern) that you query the viewers permission and the select his album. No it's just to point to the general Album "User Galleries" and show the images that users have recently uploaded to everyone.

b) Mindless explained that right. I'm looking for how to query the albums, excluding linked images.

c) I didn't find a post that explains how to exclude an album.

for d and e - well was just a question with no urgency attached.

So as I suspected - perform update on a specific album and it's subalbums is possible.
The 64,000 $ Question now is - how?

Thanks for answering.

 
kjpweb

Joined: 2006-06-17
Posts: 8
Posted: Mon, 2006-07-03 12:26

Anyone? No suggestion on how to display just one album and it's subalbums?

 
Steel Rat
Steel Rat's picture

Joined: 2006-06-24
Posts: 100
Posted: Mon, 2006-07-03 17:43

Installed this into my Drupal 4.7/G2 setup, and it works great. Had to add the custom CSS by Mindless to get the different orientated thumbnails to play nice, but worked fine.

But I did notice that the link in the Gallery Nav is only visible if you're registered and logged in. Maybe I missed that in the thread, but is there a way to make that visible to guests as well? all my albums are visible to anyone.

Steel Rat
RPGMapShare.com

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2006-07-03 18:31

i'm confused.. i thought the changes Eka_Mei made does this.. just add g2_itemId={id of album} in the updates URL.
doesn't that show updates for that album and its descendents?

Edit: this^ response is for kjpweb.. Steel Rat, I see "view latest updates" in the sidebar when I visit your site as guest.

 
kjpweb

Joined: 2006-06-17
Posts: 8
Posted: Mon, 2006-07-03 19:29

Thanks Mindless,
I will give that a try. Eka_Mei hasn't made a suggestion yet on how to implement. I will let you know
on how it turns out.

 
kjpweb

Joined: 2006-06-17
Posts: 8
Posted: Mon, 2006-07-03 20:22

I'm not sure, what the syntax is.
This is the current URL:
http://virtua-gallery.com/gallery2/main.php?g2_view=updates.ShowUpdates

Where and how do I have to add g2_itemId={id of album} ?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2006-07-03 20:28
 
kjpweb

Joined: 2006-06-17
Posts: 8
Posted: Mon, 2006-07-03 20:52

That was fast! Thanks!
From what I figured - the album ID is 302.
Using the URL alteration it still shows album content of e.g. science fiction.

Here's the general structure

Topic albums
---SciFi
---Nature etc.
Software albums
---3DS Max
---Cinema 4D etc.
User Albums
---John
---Jane etc.

To avoid seeing linked images I want to show just the content updates of User albums and subalbums.
But you probably got that already.
Maybe I am overlooking something - but from what I gather - the ID for user albums is 302 and for the entire gallery 279.
And since the display does not change with either ID ( I tried a non existent ID and it showed exactly the same) this approach does not seem to work.
Is there a change I have to make in the query within ShowUpdates.inc?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2006-07-03 21:03

seems to work to me. please try the URL I posted above again, with itemId 279 and 302.. I just fixed a bug in the forum software in how the URL was displayed.

 
kjpweb

Joined: 2006-06-17
Posts: 8
Posted: Mon, 2006-07-03 21:11

It works - it apparently was the & in the URL, that corrected the issue. Thank you sooo much! This thing
was bugging me for quite a while.

 
travelvice
travelvice's picture

Joined: 2005-07-16
Posts: 112
Posted: Mon, 2006-07-10 03:11

Hi there!

So what's the status of this module? I'm currently running v2.0 core 1.0.0 -- is it compatible with it? Where can I pick up the latest release of the code?

Thanks much,

//craig

 
mindless
mindless's picture

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

click documentation above, then User Contributions, find the modules section.
there is a 2.0.x version, but the 2.1.x one has some additional features.

 
antisa33

Joined: 2006-06-26
Posts: 30
Posted: Tue, 2006-07-11 13:11

The module is working fine on my G2 gallery. Thanks.
But the left link is not multilangage ?
I see it in english, how can i do to see it in french and others langages?
Thanks

 
Steel Rat
Steel Rat's picture

Joined: 2006-06-24
Posts: 100
Posted: Tue, 2006-07-11 14:27

Mindless, it seems to be kind of hit or miss. Of course I finally got the cookie and fullname settings straightened out, so perhaps one of those fixed it.

Steel Rat
RPGMapShare.com

 
HorsePunchKid
HorsePunchKid's picture

Joined: 2005-05-04
Posts: 89
Posted: Sun, 2006-07-23 01:25

Howdy, all. I'm glad to see people have been getting some use out of this module. Thank you, Alan, for providing some much-needed enhancements!

I'm trying to merge my local changes (e.g.) into the latest version (0.2.6, posted 2006-01-18 according to the README). However, I have some questions about the current behavior. In particular, it seems that the "raw" option no longer functions how I intended: Instead of simply producing an unadorned div of the updates, it's an entire HTML page. The idea was that this output could be embedded in other applications without any processing (except perhaps applying some CSS to format it).

My RSS view of the updates was based on the code I had for the "raw" view (which used "immediate" mode to avoid the extra HTML), so I'd like to figure this out before I go ahead integrating the RSS feed.

--
http://severinghaus.org/gallery/

 
kylehase
kylehase's picture

Joined: 2005-09-15
Posts: 38
Posted: Sun, 2006-07-23 12:26

First of all, great module. This is always the first thing my users check on my site.
I'm having a minor display issue in IE. Firefox looks fine but IE displays all the images in one column. As a temporary work around I've setup a custom CSS
*div.updates-item{width:150px}
Where 150 is the thumbnail width. Just thought I'd mention it for anyone else with this problem. I'm not sure if this is the best solution but it works.

 
HorsePunchKid
HorsePunchKid's picture

Joined: 2005-05-04
Posts: 89
Posted: Sun, 2006-07-23 20:12
antisa33 wrote:
I see it in english, how can i do to see it in french and others langages?

There's a guide to creating new localisations here on the Gallery wiki. It's not a trivial process, but it shouldn't be hard. As soon as I can get my new host to rebuild PHP with gettext, I can start on at least the English and Russian localisations.

In the meantime, you can always just edit the template files and change the wording where appropriate.

--
http://severinghaus.org/gallery/

 
radek.kaba

Joined: 2006-08-10
Posts: 1
Posted: Thu, 2006-08-10 01:54

Hi, I'm installing updates module 0.3.7 on Gallery 2.1.1,
and...

Quote:
Error (ERROR_BAD_PARAMETER) : xxxx/www/galeria/modules/core/classes/helpers/../../../../modules/updates/UpdatesSiteAdmin.inc

* in modules/core/classes/GalleryView.class at line 194 (gallerycoreapi::error)
* in modules/core/SiteAdmin.inc at line 145 (galleryview::loadview)
* in modules/core/classes/GalleryView.class at line 317 (siteadminview::loadtemplate)
* in main.php at line 386 (siteadminview::doloadtemplate)
* in main.php at line 87
* in main.php at line 80

Pls help.

 
Tulkin

Joined: 2006-08-14
Posts: 1
Posted: Mon, 2006-08-14 20:03

Hello. Big thanks for this module!
Can anybody tell me how to integrate this module on the bottom of the front page.(i.e. instead of "Recent image" image block on the sidebar.)
Thanks a lot.

I have installed this module( 0.2.6) successfully and was able to see updates via url: main.php?g2_view=updates.ShowUpdates

 
HorsePunchKid
HorsePunchKid's picture

Joined: 2005-05-04
Posts: 89
Posted: Mon, 2006-08-14 20:48
Tulkin wrote:
Can anybody tell me how to integrate this module on the bottom of the front page.

This is an example of the kind of thing I'd expect people to do with the "raw" output, which is now impossible (or at least quite a bit harder) with the current version that surrounds the raw output with all of the tags to make it a full (X)HTML document. I'll tally this as a vote to revert to the original behavior.

So what you could do if the raw output were working (give me a day or two to do that) is just include the raw output in some way and apply appropriate CSS to make it look right in your front page. It'd be a little roundabout, but it'd work. (Of course, it would make more sense when embedding in something outside of the Gallery2 framework.)

{php}
    $ch=curl_init('http://yoursite/main.php?g2_view=updates.RawUpdates');
    $foo=curl_exec($ch);
    curl_close($ch);
    print($foo);
{/php}

...or something like that.

--
http://severinghaus.org/gallery/

 
travelvice
travelvice's picture

Joined: 2005-07-16
Posts: 112
Posted: Tue, 2006-08-15 16:29

So I'm in Colombia, at an Internet café, slightly overwhelmed at the customization work ahead to put this module into production.

I'm using Gallery 2.0, with the corresponding Update module. Freshly installed, I have some questions right out of the gate...

I'd very much like to match the look and feel of the updates page to the pages currently in production.

Update page: http://snapshots.travelvice.com/updates/
Example page: http://snapshots.travelvice.com/view/colombia/taganga/

Idea's as to how I can properly format the page (fix top row spacing, three columns, shadowed thumbnails, etc)?

Thanks so much for your thoughts -- it's rather difficult doing this in a developing country! :)

Best,

- Craig

 
mikeage
mikeage's picture

Joined: 2005-01-23
Posts: 138
Posted: Thu, 2006-08-24 10:53

Nice work!

I made one changes for my own use, which you might want to merge in. I removed the full image block display. As soon as I turned on any piece of information ("caption" in the module's vocab), I got all the blocks that I display on an image page (EXIF, etc). Perhaps this should be a configurable option?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2006-08-24 14:38

can you describe your configuration and what you see in more detail.. can't figure out what you mean.

 
travelvice
travelvice's picture

Joined: 2005-07-16
Posts: 112
Posted: Fri, 2006-09-01 00:13

Is there an simple way to match the look of the /updates/ page with the theme of the site?

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Fri, 2006-09-01 00:23

CSS

 
travelvice
travelvice's picture

Joined: 2005-07-16
Posts: 112
Posted: Fri, 2006-09-01 00:54

Hi icpix,

I was thinking more along the lines properly formating the page (fix top row spacing, three columns, shadowed thumbnails, etc).

Update page: http://snapshots.travelvice.com/updates/
Example page: http://snapshots.travelvice.com/view/colombia/taganga/

Also, anyone figure out how to append a little text to the breadcrumb?

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Fri, 2006-09-01 01:26

travelvice----

So was I... when you've worked out why the div statements
that refer to classes are all wrong (5secs glimpse with
viewsource) you'll be able to come back and say: CSS ;~)

As for the 'figuring out' I could question your ability
with the search facility of this site... for instance
in the Customisation section (for your customisation Qs)
several lines down: http://gallery.menalto.com/node/53751
(actually I eyeballed it rather than used the search).

It's 2:30am here, I've had a very long day...g'nite.

----best wishes, Robert

 
travelvice
travelvice's picture

Joined: 2005-07-16
Posts: 112
Posted: Fri, 2006-09-01 01:43

Thanks for the thoughts Robert,

Modifying the presentation of the page (rows and columns + shadow effects for the thumbnails) is done (for a Gallery novice such as myself) within the Admin panel (adjusting the specifics of the theme).

This is where I'm left scratching my head.

Thanks!

//craig

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Fri, 2006-09-01 02:57

I'm running Updates 0.3.7 which works fine however, in Site Admin panel when clicking on Updates I get the below error.
Any hints??
Fatal error: Call to undefined function: loadavailableblocks() in /var/www/localhost/htdocs/gallery2/modules/updates/UpdatesSiteAdmin.inc on line 124


Gallery version = 2.2-svn core 1.1.15
PHP version = 4.4.3-pl1-gentoo apache
Webserver = Apache/1.3.37 (Unix) (Gentoo) mod_gzip/1.3.26.1a PHP/4.4.3-pl1-gentoo mod_ssl/2.8.28 OpenSSL/0.9.7j
Database = mysql 4.0.27, lock.system=flock
Toolkits = Exif, Ffmpeg, NetPBM, ArchiveUpload, Thumbnail, Gd, mplayer, Dcraw, ImageMagick
Acceleration = full/900, full/900
Operating system = Linux digi-archive 2.6.17-gentoo-r7 #1 SMP Wed Aug 30 19:24:06 PDT 2006 i686
Default theme = PGtheme
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2006-09-01 03:01

that code has moved in current svn, so the module must be updated. sorry, don't recall offhand where it moved to.

travelvice, another option (involving some coding) is changing this module into a dynamic album view instead of its own custom view. when this module was created it had to be its own view, but current svn would allow a theme to render the set of recent items..

 
travelvice
travelvice's picture

Joined: 2005-07-16
Posts: 112
Posted: Fri, 2006-09-01 15:35
Quote:
travelvice, another option (involving some coding) is changing this module into a dynamic album view instead of its own custom view. when this module was created it had to be its own view, but current svn would allow a theme to render the set of recent items..

Alright, I'm game! How do we do this?

Currently running 2.0.0

 
LadySaiyajin

Joined: 2002-12-25
Posts: 1
Posted: Fri, 2006-09-01 17:02

Ok... I feel stupid... how do you set up an RSS feed for the latest updates album? T_T

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2006-09-02 18:54

travelvice, keyablum and rating modules each have an example of a dynamic album view.

LadySaiyajin, this module does do any rss.. not sure what the rss module offers.

 
travelvice
travelvice's picture

Joined: 2005-07-16
Posts: 112
Posted: Sat, 2006-09-02 21:39
mindless wrote:
travelvice, keyablum and rating modules each have an example of a dynamic album view.

Thanks for the suggestion mindless. I know you're a busy guy, but this is a little hard for me to wrap my head around in an Internet cafe in Ecuador! Do you have a suggestion as to how I can begin this process?

Best,

//craig

 
travelvice
travelvice's picture

Joined: 2005-07-16
Posts: 112
Posted: Thu, 2006-09-07 21:04

hummm... I suppose it would help to understand how a dynamic album view is different than a traditional module. ?

Still have no idea where to start on this one.

Have others not had this same problem with thumbnail frames and row/column alignment with this module?

Best,

//craig

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2006-09-08 18:16

modules/keyalbum/KeywordAlbum.inc and modules/rating/RatingAlbum.inc are the two dynamic album views. A "dynamic album view" means the view provides the set of items to show, but the theme actually displays it like an album.

 
travelvice
travelvice's picture

Joined: 2005-07-16
Posts: 112
Posted: Tue, 2006-09-12 22:18
mindless wrote:
modules/keyalbum/KeywordAlbum.inc and modules/rating/RatingAlbum.inc are the two dynamic album views.

Now it'll be more complicated than just swaping out the code with that found in the KeywordAlbum.inc file, won't it?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2006-09-12 23:40

i'm considering totally reworking this module to use dynamic albums. hopefully i'll find some time to work on it.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2006-09-13 15:52

there are pros/cons of the dynamic album approach.. feedback welcome on how to put together a module that will be useful to most people.

Module view (what the module has now):
- Shown by the default theme, so header/footer and any color scheme should match the site.
- Thumbnail display done entirely by the updates module; this has pros (can optionally display various fields like title, date, album links) and cons (have to use this floating div display)
- Clicking thumbnails jumps to the album where that item is located

Dynamic album:
- Shown by theme/parameters of your choice, so you can configure the display to your liking
- You only get control over what fields to show (title, date, etc) if the theme you choose has such options. Won't have option for album links.
- Clicking thumbnails browses the dynamic album, doesn't jump to album where the item is located

 
joe7rocks
joe7rocks's picture

Joined: 2004-10-07
Posts: 560
Posted: Wed, 2006-09-13 20:24
mindless wrote:
..
- Clicking thumbnails browses the dynamic album, doesn't jump to album where the item is located

I feel this one a big con. Could we give a simple workaround for this?