New Module: photowidget
floridave
Joined: 2003-12-22
Posts: 27300 |
Posted: Sun, 2010-02-14 06:47 |
I have created a new module inspired from photo widget from www.roytanck.com Adds 3 configurable blocks to show items in a flash sphere on the sidebar. I've also set up a Wiki page for it here: Attached: |
|
Posts: 56
Cool! Will check it out
Posts: 78
Looks awesome! It doesn't respect viewing rights though. Thumbnails of photographs are still viewable. The photo's themselves aren't. Is this by design?
Great work though.
My playground (using customized 3nids theme) http://www.okat.nl
Posts: 32509
@floridave:
Great work! You're doing web development now?
BTW: I just skimmed over the code. Any reason you don't use UTF-8 as character encoding in the XML you generate? G3 stores everything as UTF-8, so the XML document you generate should be UTF-8 as well.
Posts: 27300
Fixed permissions and XML encoding. re-attached above.
Thanks for the reports.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 78
Updated with new download. Don't see any changes regarding permissions. Can still see thumbnails of restricted photographs. Used ctrl+F5 so cache shouldn't be a problem.
Where does one put access/authentication code? In the controller(s), right? If so; can't find anything that looks like a permission check. Was looking for something like: access::required("view", $item);
My playground (using customized 3nids theme) http://www.okat.nl
Posts: 27300
in controllers/photowidet.php
$photos = ORM::factory("item")
becomes
$photos = ORM::factory("item")->viewable()
Perhaps I don't know much about how that viewable() function works but is should restrict the query for items that the existing user has rights to.
I only did this for the recent and popular xml generation.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 78
Version I downloaded after you applied the fix didn't contain those lines. Have downloaded again (just now) after a forced refresh (just in case) and they aren't there. Added them manually and can confirm it works. Maybe something went wrong while attaching the .zip the second time.
Btw, where did you learn the ORM::factory("item")->viewable() part? Am still trying to get a grip on Gallery 3 code and the latest I've heard about access and permissions is http://gallery.menalto.com/node/94063 where Bharat talks about Model based validation. Could not find any reference to any access/permission PHP code in http://codex.gallery2.org/Category:Gallery_3, or maybe I didnt' look/search well enough.
Thanks again. It's looking great.
My playground (using customized 3nids theme) http://www.okat.nl
Posts: 27300
I just checked the zip file attached above and I see the ->viewable() in controllers/photowidet.php so don't know why you don't.
I am a copy paste type of developer so I found:
in the dynamic album modules code.
I did not know what ->viewable was so I searched the code for: 'function viewable(' and found:
I am sure more docs will come, but I don't understand half the terminology and will not be writing it.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 2466
Like the module! Nice. Replaced the tags for now
Posts: 27300
Yes. I was thinking of that anyway and will do it in the future. The thing is you have to make 3 different forms to have the sections (more code).
Currently the user can remove the block(s) he/she does not want via the Manage sidebar admim page.
Perhaps I will make some check-boxes so that on the admin page you will have the ability to choose the 'types' of pages it shows on ( photo or album pages )
I will be investigating making the sphere an ellipse so it might look better in the narrow sidebar.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 2466
Why? just different groups
Posts: 27300
Updated module to compartmentalize the blocks for easier administration. Thanks Serge D.
Added the ability to choose the type of page the block(s) should show on either photo collections or both via check-boxes on the admin page.
Any flash experts to help out in creating a different .swf movie? To help make an ellipse so it might look better in the narrow sidebar.
I have never developed flash stuff but here is some directions if you want to help out.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 43
Dear Dave!
I enjoy your module a lot. I just found a little bug: the flash clouds stay on top of the cooliris slideshow (unless cooliris is maximised to full screen).
Cheers
h_s
Posts: 27300
I thought I fixed that. Do they stay over the top of other modal windows like the organize?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 27300
h_s,
I can't reproduce this issue. Do you have transparent mode set for the block?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 43
Dear Dave!
I tried it again with the transparent background. Works fine in Firefox 3.6, but has this overlay issue in Seamonkey 2.0.3. So, thats maybe a minor issue, because Seamonkey is not so popular as Firefox.
Thanks for your help,
h_s
Posts: 27300
I don't have that browser so you could see if changing the code in the view from transparent to opaque
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 43
Dear Dave,
did that, but it didn't change anything. However, it is not such a big issue. Thanks for your help again!!
Have a nice day
h_s
Posts: 27300
Example URL I can't seem to reproduce.
Could be a browser issue as well.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 3
I love this module, but I have also noticed that it floats on top of the full-sized image (in both Firefox 3.5 and IE 8 on XP). See, for example, this picture - click on the picture to view full size, and make sure to resize the browser window so that the module overlaps with the full-size photo. Thanks for the great work!
Posts: 27300
Setting the block to transparent on the settings page seems to work for me:
http://www.langleycom.com/gallery3/index.php/53front
In your example I see that you have to set the block to transparent.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 27300
Updated the module to remove data from the var table on deactivation.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 573
Very nice module Dave ...
Download in first post, is that the updated code?
all the best
HB - http://www.image.agentura.dk
Posts: 2
Great job on porting this to gallery3... Really nice addition. Is it possible to enable a "lightbox" function depending on if your gallery3 theme is using one?
I have it enabled on my test site and haven't been able to figure out how or if its possible...
Posts: 27300
Yes.
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 27300
@lightbox: No. Unless you are well versed at doing some flash development.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 3
Yep, that worked. The widget is perfect as far as I can tell. Thanks!
Posts: 2
@lightbox function... really wish I could work more with Flash than I can...
I was using the 3nids theme with the lightbox script for image viewing instead of the standard image page. I was hoping a change in the link value or something would allow an easier resolution but thanks for the feedback...
Still nice module just wanted to keep the image viewing the same for links etc...
My test Gallery3 installation: http://sandbox.wilsonwhirlwind.com/gallery3
Posts: 304
A request:
drop ->where("type", "=", "photo") from recent_xml() and popular_xml() to include videos as well.
As a matter of fact, it could be configurable in the admin page, along with number of items to display.
Posts: 27300
updated module to include videos as well.
Updated module admin page for quantity settings for recent and popular. Thanks for the suggestions inposure.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 27300
fixed a typo in the version for module.info causing upgrade issues.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 55
Nifty module - thanks!
Posts: 47
Hi, I really like your customized 3nids theme. Did you do this customization, or is it available in codex?
Thanks,
Alex
Posts: 10
hi guys,
i have a small problem, i used this plugin already before on my joomla 1.5 site, but now i upgraded to joomla 1.6 and now i always get the message "This widget requires Flash Player 9 or better" do i have to change any php settings or why is it not showing anymore in joomla.
if i add the code in the html window in the joomla window, joomla will rearange the code and i cant stop it from doing it...
does it not work anymore on joomla 1.6?
Posts: 27300
Are you using the 'external example' as described in http://codex.gallery2.org/Gallery3:Modules:photowidget
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 10
yes, and it was working fine with joomla1.5 now i upgradet to 1.6 and it isnt working anymore, not even the flickr sphere is working from roytanck.com
Posts: 27300
Seems to be a joomla issue then. A real url might help, but I don't think I should be troubleshooting joomla issues as well.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 10
i did a test created a empty page, outside of joomla, and inserted the code...but the only thing i got was the "flash-box" but no sphere inside.... hows that?
Posts: 27300
Works for me. http://www.langleycom.com/gallery3/test.html
do you have the module activated?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 10
yes the photowidget module is activated. do i need any other modules....?
i just used that code:
<object type="application/x-shockwave-flash"
data="http://EXAMPLE.com/gallery3/modules/photowidget/lib/photowidget.swf" width="200" height="200">
<param name="movie" value="http://EXAMPLE.com/gallery3/modules/photowidget/lib/photowidget.swf" />
<param name="bgcolor" value="#ffffff" />
<param name="AllowScriptAccess" value="always" />
<param name="flashvars" value="feed=http://www.EXAMPLE.com/gallery3/index.php/photowidget/recent_xml/" />
<p>This widget requires Flash Player 9 or better</p>
</object>
and only replaced the example with my site adress.
i cant get it to work, what am i doing wrong?
i tried diffrent browsers...
its showing yours just fine....
could it be any server setting in php.ini?
UPDATE
either i am totaly crazy and stupid or something weired is going on. i just put above mentioned code in a empty html page and uploaded it. the only thing i get is a white square of the flashplayer but no photos shown...
if i take the code and enter it in joomla sql database for that modul. it works fine, but as soon as i open this modul in joomla, all the code gets messed up by joomla again.
but why cant i view it on a empty html page? with just the code in there...
Posts: 27300
Do you get content when you visit
http://www.EXAMPLE.com/gallery3/index.php/photowidget/recent_xml
(Change EXAMPLE)
URLs would help diagnose your issue.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 10
hi dave
i get an xml feed with above link...
i got it running in joomla, i think i am just doing something wrong by creating the html page...
Posts: 158
Just tested the photowidget, and it is very nice..
Re using it at external pages other than the gallery root: how to make it show a certain album that I want, not just the recent images?
or in other words, to change that:
to the album of my choice?
Thanks,
Posts: 158
found it by trial and error.. should be:
http://sitename.com/Gallery/photowidget/xml/##.html
where the ## are the ID
Posts: 158
If a gallery has 100 images, this widget would choose something like the first 20 images to display, and each time the user open that album or any images from that album, would see the same images in the widget.. it would be nice that the widget could have some kind of random choices of images, or shuffle them or something.. what do you think?
Posts: 27300
glad you got the ID of the album sorted out.
@random: you could add another function in photowidget.php to do a random query. Look at the imageblock module to get a clue how that is done.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 158
before I give it a try, does this random query for the whole gallery? or could it be for a particular album?
Posts: 27300
The imageblock does gets a ramdom from the whole gallery, it could be changed to get items from a specific album.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 158
I noticed for two days the content of the "Popular items" doesn't change.. although the gallery had thousands of hots.. am I missing something?
Thanks,
Posts: 27300
it uses the view count for sorting.
is the XML file generated proper? example.com/gallery3/index.php/photowidget/popular_xml
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team