I just finished a bunch of hacking on XoopsGallery...
you can get my changes from:
http://www.shirel.com/modules/mydownloadsFollowing is the contents of the change.txt for everything that I did...
Matt's Gallery Hacks
mls-at-shirel.com
If you have any questions, email me and I'll do my best to help... I'm a php newbie,
and I know even less SQL.. But I hack my way through as best I can... btw -- Some "Bugs"
could possibly considered "features".. but I wanted different behavior...
June 1, 2003
Bug: Album Description do not show up on top level page that lists each of the albums...
Reason: Typo of smarty template
Fix: In the template file: xoopsgallery_index.html change the smarty-template name on line 27:
from: <{$album.desc}>
to: <{$album.album_desc}>
Note: Your template files (stored in the DB) will have to be refreshed for this change to go
into affect.
Bug: The sort function bombed for anything other than a random sort.
Reason: the album save() function is not reenterant.
Fix: Modified classes/album.php and sort_album.php.
The function -- SortPhotos() -- now takes a 3rd argument. This arguement defaults to false
meaning it will execute a save() in the middle of the function. When called from sort_album,
the 3rd arguent is passed as try to bypass the save since one will be done upon exiting the
function call.
Bug: New Pictures Block displays full size images instead of the thumbnail image.
Reason: B/c that's the source that was being passed... the block needed more/better info...
Fix: Modified class/image.php and blocks/xoopsgallery_blocks.php
image.php: Added new functions to the XoopsgalleryImage() class to put together a thumbnail link.
xoopsgallery_blocks.php: call the new function (getFullThumbURL) instead of the old (getFullURL)
Bug: New Picture Block would display less than the desired number of pictures if they movies/albums/etc
were a part of the list...
Reason: Only N items were pulled out of the MySQL tables...
Fix: Modified class/image.php and blocks/xoopsgallery_blocks.php
image.php: Added new functions to the XoopsgalleryImage() class.
xoopsgallery_blocks.php: pull some more entries from the table and make sure there is a
thumbnail for all the ones you are going to use...
Bug: Random Image Block would not provide a link to the image/gallery the image originated from...
Reason: b/c that's the way it was written..
Fix: modified class/image.php, blocks/xoopsgallery_blocks.php and
templates/blocks/xoopsgallery_block_rand.html
image.php: this depends upon the modification for the "New Pictures Block" hacks
xoopsgallery_blocks.php: Completely rewrote the function -- b_xoopsgallery_getRandomImage()
It now more closely resembles the b_xoopsgallery_newshow() function.
xoopsgallery_block_rand.html: This now exactly mimics the new picture block template...
* Note: make sure you refresh your template files for this block...
Bug: The Recent Comments block does not reliably link to the image/comments w/i a gallery. It
frequently throws and error about undefined object (or something similar) and returns a blank page.
Reason: The link from Recent Comments passes the albumName as albumName=XXX instead of set_albumName=XXXX.
Fix: ************* HACK *************************
This should really be fixed in the comments block code.. but I wasn't going to start my way through
that learning curve tonight... So I did the following as a major hack:
Modified session.php
Now, instead of just looking for set_albumName to be passed as a GET param, it will also look
for albumName...
NOTE: The sporatic success/failures seems to be b/c an Album object is carried around in the session
after you have visited any albums. If the last album visited happened to be the same one as the
comment went to, you were in luck and everything worked. If it was a different album, you would
end up on the wrong image.
WHEW!!!!!!! I think that's it...
ToDo: Sometime in the future, when I (or someone) has the time to figure out how to do it...
1) Count the total number of new Images added in the last week/month/??? and include in new image block.
1a) Page/Block to show list (thumbnail) of all images added in last week/month/???
2) Add block configuration options for the Random Image block... How many? Size? Show Upload Date?
2a) Add option to new image block to configure timeframe of 1/1a.
3) Add notifications when new images are added to an album.
4) Exclude "private" images from new/random blocks.