New module: Show updates to your gallery

mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2006-01-16 17:03

i didn't compare the code E-Razor posted to the original 0.2.4 version.. i assume they have the same queries so it shouldn't matter which version you use.

 
id01

Joined: 2005-11-07
Posts: 62
Posted: Mon, 2006-01-16 18:58

I believe it is the same as well, but for the life of it I can not get it to work. I do not believe that the embedded enviroment will make any different neither.
Who would figure editing a simple line like that will be so difficult? I will try some other way to see if I can get it working. Thank you for your help.

This is what I have at line 51 for showupdates.inc. Does not seem to work, keep returning blank screen. It could be a prblem with my database and having lots of images already.

Quote:
$query='
SELECT [GalleryItem::id], [GalleryItem::title], [GalleryEntity::creationTimestamp]
FROM [GalleryItem] INNER JOIN [GalleryEntity]
ON [GalleryItem::id] = [GalleryEntity::id]
ORDER BY [GalleryEntity::creationTimestamp] DESC

LIMIT ' . $param['itemCount'];

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2006-01-16 23:29

do you have some public and some private items? this module appears to pick N items, then filter permissions. so if it happens to pick N items w/o permission then you see nothing.
i'll do some cleanup on this module and post an update in a bit.

 
id01

Joined: 2005-11-07
Posts: 62
Posted: Mon, 2006-01-16 23:41

I am looking at the update with site admin account, so it should display everything.
Plus just about everything are "view all version" by "everyone" so I do not believe a blank screen (as in white screen with absolutely nothing, not even a prasing error) would be that reason.
Thank you very much for your help again. I'm going to set up the lastest CVS and and intergate it to a brandnew phpnuke installation just for testing to see if I can isolates any problem.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2006-01-17 04:36

Updated module attached.. cleaned up API usage, filter permissions in query instead of post-query, gets all DataItems instead of just photos.

Edit: Version 0.2.6 added updates.UpdatesLink block

 
nzwhost

Joined: 2005-10-29
Posts: 61
Posted: Tue, 2006-01-17 09:21

Formatting appears to be broken using IE. However, looks good with Mozilla Firefox. Any ideas?

You can see what I mean here - http://www.digital-images.co.nz/gallery/?g2_view=updates.ShowUpdates

Noticed that the same issue at http://severinghaus.org/gallery/updates/.

I am using the following custom css:

/*set the total height so the float left work on all line*/
div.updates-item
{
width:200px;
padding: 10px;
background-color: #E5F2FF;
}
/*set the caption box and add scoll bars as needed to handle large text blocks*/
div.updates-caption{
width:200px;
height:35px;
overflow:auto;
overflow-y:auto;
overflow-x:visible;
text-align: center;
}
div.updates-link{
width:200px;
text-align: center;
}
div.updates-thumb{
height:200px;
}

------------------
[url]www.nzwhost.com[/url]
[url]www.digital-images.co.nz[/url]

 
nzwhost

Joined: 2005-10-29
Posts: 61
Posted: Tue, 2006-01-17 10:10

Fixed!

Added:
height: 250px;

to:
div.updates-item

In IE thumbnails of different dimensions actually increase the height of this div and mess up the formatting on subsequent lines. It becomes obvious if you have a thumbnail which is portrait in a row of landscape thumbnails.

------------------
[url]www.nzwhost.com[/url]
[url]www.digital-images.co.nz[/url]

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Wed, 2006-01-18 03:49
mindless wrote:
Updated module attached.. cleaned up API usage, filter permissions in query instead of post-query, gets all DataItems instead of just photos.

I take it this updated module requires latest G2 from CVS since I don't have the required
RequiredCoreApi and RequiredModuleApi? I have 6.7 and 2.4.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2006-01-18 17:46

yes, my starting point was the code E-Razor posted which was updated for core api 7.1, module api 3.0

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2006-01-18 19:17

Updated my post above with version 0.2.6:
fixed one typo, added updates.UpdatesLink block, avoid duplicate <title> so xhtml valiates

 
Fjelsten

Joined: 2005-10-15
Posts: 66
Posted: Wed, 2006-01-25 20:28

I updated to 2.0.2 and when I try to run it now, I get:

Quote:
Error Detail -
Error (ERROR_BAD_PARAMETER) : /home2/fjelsten/public_html/gallery/modules/core/classes/../../../modules/updates/ShowUpdates.inc
in modules/core/classes/GalleryView.class at line 158 (gallerystatus::error)
in main.php at line 262 (galleryview::loadview)
in main.php at line 87
in main.php at line 80
System Information
Gallery version 2.0.2
PHP version 4.3.10 apache
Webserver Apache/1.3.33 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.3.10 FrontPage/5.0.2.2635 mod_ssl/2.8.22 OpenSSL/0.9.7a
Database mysql 4.0.25-standard
Toolkits SquareThumb, Gd
Operating system Linux dallas3.incognitonetworks.com 2.4.21-32.ELsmp #1 SMP Fri Apr 15 21:17:59 EDT 2005 i686
Browser Opera/9.0 (Windows NT 5.1; U; en)

Can anybody help? Thanks

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2006-01-26 00:28

please post your question in the new 3rd party modules forum, with [updates] in the topic title. be sure to include what version of the module you are using, and what version of gallery you updated from.

 
Fjelsten

Joined: 2005-10-15
Posts: 66
Posted: Thu, 2006-01-26 07:24

OK, thanks. Sorry.

 
Fjelsten

Joined: 2005-10-15
Posts: 66
Posted: Thu, 2006-01-26 16:12

Mindless, could you make a 2.0.2 version for thouse of use with the release version?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2006-01-26 20:05

Fjelsten, search back in this topic for the older version that works with 2.0.x. I don't plan to backport my additions to work with 2.0.x.

 
Fjelsten

Joined: 2005-10-15
Posts: 66
Posted: Thu, 2006-01-26 20:25

I know the older version works - it just appeared like you have fixed the bugs I had reported with that version (the pre-/post-query stuff). Thanks anyway. I look forward to the release of 2.1 :-)

 
GravityArc
GravityArc's picture

Joined: 2003-02-27
Posts: 54
Posted: Tue, 2006-02-14 22:03

Is there any way to have the updates show as an album so I can have the first album in my gallery be a set of Updated items?

Thanks...

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2006-02-14 22:45

activate the linkitem module, create a linkitem with the URL for the updates view.

 
GravityArc
GravityArc's picture

Joined: 2003-02-27
Posts: 54
Posted: Tue, 2006-02-14 23:44

Cool...guess I need to update to 2.0.2 before I can use Link Items. I'll do that this weekend hopefully. :)

Thanks!

 
Eka_Mei

Joined: 2006-01-03
Posts: 132
Posted: Sat, 2006-02-18 20:39

Are there any plan on improving the update module? Like having individial album update rather then the entire gallery? Or having the ability to scrolls back and see the second page instead of only the last 50?

 
mindless
mindless's picture

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

certainly a lot more could be done with this module, but i don't think anyone is working on it.
i'll probably try to get it into cvs for G2.2, so you can file feature requests for what else you'd like to see.

 
gaida

Joined: 2004-12-25
Posts: 5
Posted: Mon, 2006-02-20 04:28

Hi Everyone,
I upgrated to the latest gallery, and installed the latest updates module 0.26.It displays the new updates with the link,but how do i link it to a Block so it appears on the sidebar?
The option doesn't seem to appear in the Matrix theme.
Any help ?

Nick

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2006-02-20 06:16

you have to put {g->block type="updates.UpdatesLink"} somewhere in your theme's tpl. i didn't add a blocks.inc file to make it appear in theme settings (but you could do that too..)

 
gaida

Joined: 2004-12-25
Posts: 5
Posted: Mon, 2006-02-20 10:19

mindless, thanks for the reply.I sort of made it work,but it looks horible and out of place.I wish you add it as a block as i don't know how to make a block.inc file.
Thanks

 
gaida

Joined: 2004-12-25
Posts: 5
Posted: Sun, 2006-02-26 04:22

Can anyone help me? I just want the Updates link to appear the same as the other items in the sidebar.
Thanks

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sun, 2006-02-26 06:52

you can add it as an item link by adding getItemLinks to module.inc.. look at other modules to see how this is done. of course, the link shows updates across the whole gallery, not updates in the current album as placing the link among the other item links might imply.

 
RwD
RwD's picture

Joined: 2005-01-09
Posts: 383
Posted: Tue, 2006-03-07 22:35

Is it possible to implement this block into a block so it could be added to any page?? 
______________________
I made a theme for G2, try it :)

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2006-03-07 22:39

look 5 posts up..

 
RwD
RwD's picture

Joined: 2005-01-09
Posts: 383
Posted: Wed, 2006-03-08 08:40

oops, missed that. I'll take a look at it, doesn't sound too difficult to do...

[edit]
I figured out I can do this:

{g->block type="imageblock.ImageBlock" blocks="recentImage|recentImage|recentImage"}

This eliminates my needs for the module in this topic, and perhaps for other people as well...
[/edit] 
______________________
I made a theme for G2, try it :)

 
TravisBickle
TravisBickle's picture

Joined: 2006-03-28
Posts: 1
Posted: Tue, 2006-03-28 19:23

I've searched the forums and I've tried editing modules.inc and theme.tpl to allow "Updates" to display in the sidebar, but to no avail.
How do I link it to a Block so it appears on the sidebar?
The module works perfectly in 2.1 but on this feature, I'm stuck.
Where do you place;
{g->block type="updates.UpdatesLink"} ?somewhere in your theme's tpl.?
and/or
{g->block type="imageblock.ImageBlock" blocks="recentImage|recentImage|recentImage"}

Thanks in advance

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2006-03-28 22:10

TravisBickle, try experimenting.. put those in theme.tpl or album.tpl/photo.tpl and see how it works.

 
Eka_Mei

Joined: 2006-01-03
Posts: 132
Posted: Thu, 2006-04-13 21:43

Still trying to make it possible to turn back in page like in the recent comment module. Any chance you think it might be possible?

 
mindless
mindless's picture

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

sure, someone has to write it.. it would be very similar to recent comments, just a different query.

 
Eka_Mei

Joined: 2006-01-03
Posts: 132
Posted: Sun, 2006-04-16 04:13

I guess I will have to study both modules very well to handle this. Look much harder then I thought.

 
tlmothy

Joined: 2005-11-10
Posts: 41
Posted: Sun, 2006-04-16 06:55

Hey mindless any chance of adding code to the module.inc so it displays an item link similar to "show a google map", or "view latest comments"? I think instead of editing the theme to add a link, why not add it to the side menu from the module. It may be helpfull for people with more than one theme being used.

Thanks
P.S I attempted to do so looking at previous modules but got lost. So I await your help.

 
mindless
mindless's picture

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

it doesn't do that now because it currently is "updates for gallery" not "updates for this album" (though with a more complex query it could be). to add an item link, add "getItemLinks" in the setCallbacks call in the constructor, add the getItemLinks function itself, then bump the module version so G2 will reregister the callbacks and start using your getItemLinks function.

 
tlmothy

Joined: 2005-11-10
Posts: 41
Posted: Mon, 2006-04-17 02:46

Well I think that is the way to go. I bet someone here could give us a hand and code it.

I believe the old G1 latest updates hack has features this module lacks. Such as viewing by multiple pages, as someone had mentioned earlier. It seems silly that these features are not included with G2.

I think that this module should also have features such as:

Latest Albums (all of G2)
Latest Pictures (all of g2)
Latest Pictures (in this album)
Latest Albums (in this album)

I think you guys would agree?

Infact lets take it even further, wouldn't it be cool to have a rectangular block above each album page displaying "latest albums here, latest pictures here" (in this album)via a few thumbnails. Would be great for albums with many sub albums / pictures. And if no sub albums are found in that page, why not disable the rectangular block not to display at all, only show latest pictures.

What do you think mindless?

 
mindless
mindless's picture

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

not sure why it is silly, someone has to write these things. guess i'd be more interested in discussing feature ideas if there are developers other than me inclined to work in it.

 
Eka_Mei

Joined: 2006-01-03
Posts: 132
Posted: Mon, 2006-04-17 05:11

I will work on it if no one else is willing. Most likely just copying a lot of code from the comment module and hope it will work with the update module. Since my experience with the Gallery system is very limited. The only module I ever been able to make is the comment block and the side bar move to top, both with some help from other even.

 
Eka_Mei

Joined: 2006-01-03
Posts: 132
Posted: Mon, 2006-04-17 08:00

done some research. If I just type in "_" into the search field and press enter. It will kinda give you a paged view of every item in the gallery ranked by the time they last submitted/updated. However it is not flexible enough, you can't see more then 20 items pre pages, and it doesn't search just in one album. Nor is there any easier way to get in without requiring the user to manually type in "_" and press enter.
I think the best way to handle this is to improve the search engine feature and let it search from just one album. so it can include both comment and item, just comment, or just item, or even give way to what type of items. "Just this album, picture only." But this seem rather difficult to code. So hacking the comment module to work with item might be an easier approach.
I personally have very little experience but I will try and do something to see what I can come up with

 
tlmothy

Joined: 2005-11-10
Posts: 41
Posted: Thu, 2006-04-20 04:27

mindless maybe silly wasn't the word, it seems like a feature such as this should of been included in G2. If I could program php I would be glad to help but unfortunately I cannot. So I rely on people who are capable.

I don't see a problem with talking about new ideas even if there is a lack of developers willing to help. At least maybe these ideas will inspire people to create them.

Thank you Eka Mei for stepping up to the plate, with that attitude I think we could accomplish a lot. I am sure if this thread had enough interest people would be glad to help out.

 
tlmothy

Joined: 2005-11-10
Posts: 41
Posted: Thu, 2006-04-20 05:01

Ideas for Update modification.

I was thinking about this a bit more today and here are a few ideas to expand on.
Mindless created a good base for adding to the updates module.

A great way to integrate updates to gallery would be to add static links to the sidebar displaying a "latest picture updates (in this album)", and "latest albums(in this album)".
This would enable the viewer to see updates per album rather than gallery as a whole.

Also: How about a block placed above selected albums displaying X number of the latest entries via a small thumbnail. This block could be enabled from settings to a desired album. In theory it should be disabled by default and the user would enable it on there selected albums. Showing thumbnails of latest updates from a user enabled album and sub album.

 
Eka_Mei

Joined: 2006-01-03
Posts: 132
Posted: Thu, 2006-04-20 05:08

Don't count on me. I hardly figure know the head and tail of c++, php so far, doesn't like me. I'll see what I can do since nobody is doing it, but definitely no promise.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2006-04-20 22:41

You two have summed it up quite nicely.. but it's not just relying on someone else capable, you have to hope for or find someone capable who is also interested in the same feature as you.. and that may just get you a hack or bit of code that you can use. If you want a feature in the product you need someone also capable and dedicated enough to put together quality code and unit tests to make it into the G2 codebase.. we'd really love for more such people to help out, send 'em our way!

 
netscan

Joined: 2005-07-16
Posts: 39
Posted: Sun, 2006-04-23 17:54

In gallery 2.1, when viewing as a guest, all of the url's that are generated have a ? tacked to the end, ie:

.../pictures/picture.jpg.html?

If logged in, the url's are correct, ie:

.../picture/picture.jpg.html

Any thoughts as to what might be causing this?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2006-04-24 03:17

the code that prevents guest users from creating a persistent session until actually needed might do this.. do you see this everywhere or just in updates module?

 
Fjelsten

Joined: 2005-10-15
Posts: 66
Posted: Tue, 2006-05-02 14:07

Mindless, I know next to nothing about Gallery coding or PHP but I know a little SQL. I would like to make the query in the Updates module just find items where I am the owner of the item.
Something like (from your ShowUpdates.inc):

SELECT
	    [GalleryEntity::id], [GalleryEntity::creationTimestamp]
	  FROM
	    [GalleryEntity], [GalleryDataItem], [GalleryAccessSubscriberMap], [GalleryUser]
	  WHERE
	    [GalleryEntity::id] = [GalleryDataItem::id]
	    AND

          [GalleryUser::id] = `6` (which is me) - "" [] '' do not help
          AND 

	    [GalleryEntity::id] = [GalleryAccessSubscriberMap::itemId]
	    AND
	    [GalleryAccessSubscriberMap::accessListId] IN (' . $aclMarkers . ')
	  ORDER BY
	    [GalleryEntity::creationTimestamp] DESC

- but that gave me an error:

Quote:
Error (ERROR_STORAGE_FAILURE)
in modules/core/classes/GalleryStorage.class at line 476 (gallerycoreapi::error)
in modules/core/classes/Gallery.class at line 223 (mysqlstorage::search)
in modules/updates/ShowUpdates.inc at line 78 (gallery::search)
in modules/core/classes/GalleryView.class at line 317 (showupdatesview::loadtemplate)
in main.php at line 386 (showupdatesview::doloadtemplate)
in main.php at line 87
in main.php at line 80
System Information
Gallery version
2.1
PHP version
4.4.2 apache
Webserver
Apache/1.3.34 (Unix) mod_layout/3.2 mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.4.2 FrontPage/5.0.2.2635 mod_ssl/2.8.25 OpenSSL/0.9.7a
Database
mysql 4.0.25-standard
Toolkits
Gd
Operating system
Linux houston.incognitonetworks.com 2.6.9-22.ELsmp #1 SMP Mon Sep 19 18:00:54 EDT 2005 x86_64
Browser
Opera/9.00 (Windows NT 5.1; U; en)

Any hints?

 
noufejt

Joined: 2006-03-23
Posts: 3
Posted: Tue, 2006-05-02 21:47

Hi, can anybody help me? I need have same "recently added photos" on the main page - it is possible? Many THX

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2006-05-02 21:55
        $query = '
          SELECT
            [GalleryEntity::id], [GalleryEntity::creationTimestamp]
          FROM
            [GalleryEntity], [GalleryItem], [GalleryDataItem], [GalleryAccessSubscriberMap]
          WHERE
            [GalleryEntity::id] = [GalleryItem::id]
            AND
            [GalleryItem::ownerId] = 6
            AND
            [GalleryEntity::id] = [GalleryDataItem::id]
            AND
            [GalleryEntity::id] = [GalleryAccessSubscriberMap::itemId]
            AND
            [GalleryAccessSubscriberMap::accessListId] IN (' . $aclMarkers . ')
          ORDER BY
            [GalleryEntity::creationTimestamp] DESC
        ';
 
Fjelsten

Joined: 2005-10-15
Posts: 66
Posted: Wed, 2006-05-03 05:59

Wicked, Mindless! Thanks a bunch.

I really hope that some G2 knowledgable person falls in love with this module and expands it. Unfortunately my technical abilities stop at HTML/CSS.