91
gstarrett
Need testers for XoopsGallery maintenance update
  • 2003/10/7 6:50

  • gstarrett

  • Friend of XOOPS

  • Posts: 174

  • Since: 2002/3/12


I've just finished rolling in a bunch of fixes from both the community and myself into the XoopsGallery module. To save other users some time, I've packaged the updated files into a fresh distribution bundle.

I would like a few testers (roughly 2-4) to try it first, to help work our any installation kinks or clarify the instructions included. If you have some time to test out the module and would like to help, send me a PM and I'll give you the URL to download it from.

Thanks to everyone who contributed their XoopsGallery patches to these forums.

Fixes included are:
* Update xoopsgallery_images and xoopscomments table on album rename
* Set of patches from SirTanksAlot
* Fix for comments disappearing with nav buttons from bugger
* Fixed Shutterfly link from darapera
* Comments working with help from core team in XOOPS 2.0.5rc+
* Remove undeclared constant from require('init.php') lines to prevent warning
* Too many other fixes, lost track!



92
gstarrett
Re: Need update query help
  • 2003/10/7 5:31

  • gstarrett

  • Friend of XOOPS

  • Posts: 174

  • Since: 2002/3/12


Alright... since no one noticed my post who could answer, I figured it out myself. If there's anything that will cause trouble down the line, please advise, but this seems to work properly.

Note that I'm not checking the return values because they will return 0 when there are no photos / comments to update.

This is from xoopsgallery/classes/AlbumDB.php, Line 89:
if (fs_is_dir("$dir/$oldName")) {
    
$success fs_rename("$dir/$oldName""$dir/$newName");
    if (!
$success) {
        return 
0;
    }
    
$xoopsgalleryimage_handler =& xoops_getmodulehandler('image');

    
// Update xoopsgallery_image.image_albumdir with new album name
    
$sql sprintf("UPDATE %s SET image_albumdir='%s' WHERE image_albumdir='%s'"$xoopsgalleryimage_handler->db->prefix('xoopsgallery_image'), $newName$oldName);
    
$result $xoopsgalleryimage_handler->db->queryF($sql);
    
    
// Update xoopscomments.com_extraparams with new album name
    
$sql sprintf("UPDATE %s SET com_exparams=REPLACE(com_exparams, 'albumName=%s&', 'albumName=%s&') WHERE com_exparams LIKE '%%albumName=%s%%' AND com_modid=%d"$xoopsgalleryimage_handler->db->prefix('xoopscomments'), $oldName$newName$oldName$GLOBALS['xoopsModule']->getVar('mid'));
    
$result $xoopsgalleryimage_handler->db->queryF($sql);
}




93
gstarrett
Need update query help
  • 2003/10/7 0:09

  • gstarrett

  • Friend of XOOPS

  • Posts: 174

  • Since: 2002/3/12


Hi all,

I've been working on getting some XoopsGallery bugs hammered out and I've got this one left: Renaming the album needs to update the xoopscomments and xoopsgallery_image table. I know what SQL I need to run, but I'm unfamiliar with the XOOPS datbase engine such that something that should be quick will likely take me all night. Can someone help?

Here's what I need to do:
if (fs_is_dir("$dir/$oldName")) {
    
$success fs_rename("$dir/$oldName""$dir/$newName");
    if (!
$success) {
        return 
0;
    }
    
// Update xoopsgallery_image.image_albumdir with new album name
    // UPDATE {xoopsprefix}_xoopsgallery_image
    //         SET image_albumdir = $newName
    //        WHERE image_albumdir = $oldName
    
    // Update xoopscomments.com_extraparams with new album name
    // UPDATE {xoopsprefix}_xoopscomments
    //        SET com_exparams = replace('albumName=$oldName&', 'albumName=$newName&', com_exparams)
    //        WHERE com_exparams LIKE '%albumName=$oldName&%'
    
}


[edit: The second query should really check that com_modid = the gallery moduleID too, just to be safe]

Thanks!



94
gstarrett
Re: XoopsGallery Fixes.. Recent Comments Link, New Pics Block showing thumbnail, etc...
  • 2003/10/6 0:40

  • gstarrett

  • Friend of XOOPS

  • Posts: 174

  • Since: 2002/3/12


Quote:

Ashundar wrote:
is there any way to take out the print service? as the program our membersuse they cant actually sell anything unless they own a registered version of the software rarther the the shareware version any help would be greatly appreciated :)


I found the way to correct this is a fix in the xoopsgallery/xoops_version.php file. At line 151, change this:
$modversion['config'][12]['valuetype'] = 'int';
$modversion['config'][12]['default'] = '--';
$modversion['config'][12]['options'] = array('--' => '--''shutterfly' => 'shutterfly');


To this:
$modversion['config'][12]['valuetype'] = 'text';
$modversion['config'][12]['default'] = 'none';
$modversion['config'][12]['options'] = array('none' => 'none''shutterfly' => 'shutterfly''shutterfly without donation' => 'shutterfly without donation');


That will allow the preference to save properly.

Note: This only affects the default for new albums. For existing albums, go to the album "properties" and change the print service to "none" in there.



95
gstarrett
Re: XoopsGallery Fixes.. Recent Comments Link, New Pics Block showing thumbnail, etc...
  • 2003/10/6 0:02

  • gstarrett

  • Friend of XOOPS

  • Posts: 174

  • Since: 2002/3/12


Yeah, the templates can seem a little counter-intuitive in some ways, but it pretty much makes sense. The system ones are RO through the GUI to prevent someone who isn't diving into the source files from ruining their XOOPS installation. At least I think that is why they are like that.

Quote:

ffabris wrote:
Anyway, thanks again! If you're ever in Bournemouth, I owe you at least several beers!

Fab

You're on... When I'm in the UK I'll look you up Some day I hope to spend some time there.



96
gstarrett
Re: XoopsGallery Fixes.. Recent Comments Link, New Pics Block showing thumbnail, etc...
  • 2003/10/5 21:12

  • gstarrett

  • Friend of XOOPS

  • Posts: 174

  • Since: 2002/3/12


Quote:

ffabris wrote:
I tried that as well, but it made no difference. I believe (but won't swear to it) that the "update module" code is not updating that particular template in the database.

It does something else odd too, in that it appears to reset one particular value to the default: the number of images that appear in the "New Images" block. I like to have that set to 4, but every time I update Gallery, it is changed back to 3 - whereas other values are exactly as I set them.

It is supposed to reset the preferences back to default values when you do an update (as of XOOPS 2.0.4?? it does that). It's also supposed to get those templates, not sure why it isn't.

Quote:
Anyway, I just decided to throw that in for the heck of it... "it doesn't hurt to ask".

Never does

Quote:
Anyway, thanks again for your help here! I appreciate you taking the time! I will now have a go at adding the description text to other pages, per your suggestions.

Fab

No problem. Just trying to 1) get this working for myself and 2) share the results and 3) help out others where I can. All for fortune and glory... yeah, right



97
gstarrett
Re: XoopsGallery Fixes.. Recent Comments Link, New Pics Block showing thumbnail, etc...
  • 2003/10/5 20:47

  • gstarrett

  • Friend of XOOPS

  • Posts: 174

  • Since: 2002/3/12


Quote:

ffabris wrote:
OK, progress... of sorts: I edited the database table row for the xoopsgallery_index.html template directly, then deleted the cached template and... [drum roll, please] the descriptions now appear!

Glad to hear it's working--doing an Update on the module should do the same thing, not sure why it didn't since I believe you said you were doing that. I have my XOOPS general preference "Update module template .html files..." set to "yes", not sure if that is the difference.

Quote:

I saw you posted elsewhere that you're working on an updated version of this module. One thing you may want to look at is problems caused when giving marformed HTML code in a description. I did that in one just now: left out a closing ". The pop-up that appears when I try to edit the description now is all messed up. That's my fault, of course, but it would be nice if there was a check for it.


Yes, making some progress but not sure if I'm going to go a *lot* deeper than what I needed to get mine running + other fixes others have submitted... there are a LOT of little glitches in there and I'm not sure if it would be worth the effort to iron them all out (especially since my time is so limited for tasks that require any concentration... it's very difficult to even carve this time out today). That said, I didn't even realize you could include HTML markup in the descriptions... the way to fix it would be to sanitize it and not allow HTML in there or change to XOOPS posting-style [] markup with appropriate cleansing (not sure how to do that yet either).

Guess what I'm saying is... if you want to keep the ability to have HTML markup in your descriptions, don't ask me to fix it because you might not like the fix (in this case ).



98
gstarrett
Re: xoops Gallery Print To Shutterfly 'fix'
  • 2003/10/5 20:32

  • gstarrett

  • Friend of XOOPS

  • Posts: 174

  • Since: 2002/3/12


I finally got a chance to re-apply fixes for shutterfly to my site, and noticed some things about yours vs. mine. In mine, I update the smarty template to keep the output in line and working (yours didn't work for me, not sure why).

Here's my fix, as I have in my site. It was partly my previous fix and partly yours.

view_photo.php, at line 220, change this:
if (strcmp($gallery->album->fields["print_photos"],"none")) {
        if (
strlen($adminCommands) > 0) {
            
$adminCommands .="<br>";
        }
        
$adminCommands .= "<a href=# onClick="document.sflyc4p.returl.value=document.locationdocument.sflyc4p.submit();return false">[print this photo on Shutterfly]</a>";
    }

To this:
if (strcmp($gallery->album->fields["print_photos"],"none") && !$gallery->session->offline && !$gallery->album->isMovie($id)) {
        
$photo $gallery->album->getPhoto($GLOBALS["index"]);
        
$photoPath $gallery->album->getAlbumDirURL("full");
        
$rawImage $photoPath "/" $photo->image->name "." $photo->image->type;
        
        
$thumbImage$photoPath "/";
        if (
$photo->thumbnail) {
            
$thumbImage .= $photo->image->name "." "thumb" "." $photo->image->type;
        } else if (
$photo->image->resizedName) {
            
$thumbImage .= $photo->image->name "." "sized" "." $photo->image->type;
        } else {
            
$thumbImage .= $photo->image->name "." $photo->image->type;
        }

        list(
$imageWidth$imageHeight) = $photo->image->getRawDimensions();
        if (
strlen($adminCommands) > 0) {
            
$adminCommands .="<br>";
        }
        
$adminCommands .= "<a href=# onClick="document.sflyc4p.returl.value=document.locationdocument.sflyc4p.submit();return false">[print this photo on Shutterfly]</a>";
    }


view_photo.php, at line 284, change this:
if (!empty($xoops_imageid)) {
    include 
XOOPS_ROOT_PATH.'/include/comment_view.php';
}

$breadcrumb["top"] = false;
ob_start();


To this:
if (!empty($xoops_imageid)) {
    include 
XOOPS_ROOT_PATH.'/include/comment_view.php';
}

// Shutterfly form additional information
if (!strcmp($gallery->album->fields["print_photos"],"none") || $gallery->album->isMovie($id)) {
    
// no form
    
$xoopsTpl->assign('shutterfly_form''false');
} else {
    
$xoopsTpl->assign('shutterfly_form''true');
    
    
$photo $gallery->album->getPhoto($GLOBALS["index"]);
    
$photoPath $gallery->album->getAlbumDirURL("full");
    
$rawImage $photoPath "/" $photo->image->name "." $photo->image->type;
    
$imbkprnt $gallery->album->getCaption($index);
    if (empty(
$imbkprnt)) {
        
$imbkprnt makeAlbumUrl($gallery->session->albumName$id);
    }        
    
$thumbImage$photoPath "/";
    if (
$photo->image->resizedName) {
        
$thumbImage .= $photo->image->resizedName "." $photo->image->type;
    } else {
        
$thumbImage .= $photo->image->name "." $photo->image->type;
    }
    list(
$imageWidth$imageHeight) = $photo->image->getRawDimensions();

    
$xoopsTpl->assign('rawImage'$rawImage);
    
$xoopsTpl->assign('imageHeight'$imageHeight);
    
$xoopsTpl->assign('imageWidth'$imageWidth);
    
$xoopsTpl->assign('thumbImage'$thumbImage);
    
$xoopsTpl->assign('imageCaption'$imbkprnt);
    if (
$gallery->album->fields["print_photos"] == "shutterfly without donation") {
        
$xoopsTpl->assign('gallery_pid'"C4P");
        
$xoopsTpl->assign('gallery_psid'"AFFL");
    } else {
        
$xoopsTpl->assign('gallery_pid'"C4PP");
        
$xoopsTpl->assign('gallery_psid'"GALL");
    }
}

$breadcrumb["top"] = false;
ob_start();


Then, at the very end of templates/xoopsgallery_viewphoto.html, add this:
<{if $shutterfly_form == "true"}>
    <
form name="sflyc4p" action="http://www.shutterfly.com/c4p/UpdateCart.jsp" method="post">
      <
input type=hidden name=addim value="1">
      <
input type=hidden name=protocol value="SFP,100">
      <
input type=hidden name=pid value="<{$gallery_pid}>">
      <
input type=hidden name=psid value="<{$gallery_psid}>">
      <
input type=hidden name=referid value="gallery">
      <
input type=hidden name=returl value="this-gets-set-by-javascript-in-onClick">
      <
input type=hidden name=imraw-1 value="<{$rawImage}>">
      <
input type=hidden name=imrawheight-1 value="<{$imageHeight}>">
      <
input type=hidden name=imrawwidth-1 value="<{$imageWidth}>">
      <
input type=hidden name=imthumb-1 value="<{$thumbImage}>">
      <
input type=hidden name=imbkprnta-1 value="<{$imageCaption}>">
    </
form>
<{/if}>


Be sure to update your module after changing the template.

I'll be including this in my updated XoopsGallery that I hope to bundle up sometime soon (still some more fixes to apply).

Note that I still see a problem with the return function--it returns back to the same URL but gets a permission error (could be a referrer check possibly). If anyone has info on this already it would be helpful.



99
gstarrett
Re: XoopsGallery Fixes.. Recent Comments Link, New Pics Block showing thumbnail, etc...
  • 2003/10/5 2:30

  • gstarrett

  • Friend of XOOPS

  • Posts: 174

  • Since: 2002/3/12


Sorry about that--got a little carried away. You are looking at the right place, but apparently you don't have a [edit description] link just to the right of the description (or where it would go) on your page.

Relevant lines in albums.php:
Line 164:
  
$desc editField($gallery->album"description"$edit);

Line 200:
  
$xoopsTpl->append('albums', array('image' => $image'owner_id' => $owner->uid'owner_name' => $owner->username'editlink' => $editlink'album_desc' => $desc'adminlink' => $adminlink'last_modified' => formatTimestamp($gallery->album->getLastModificationTime(), 'm'), 'num_photos' => $gallery->album->numPhotos(0), 'num_views' => $num_views'num_views_since' => $num_views_since'num_views_resetlink' => $num_views_resetlink'albumtree' => $album_tree));


Relevant line in xoopsgallery_index.html:
Line 26:
  <
td class="head"><{$lang_description}></td>
  <
td class="even"><{$album.album_desc}></td>


Note that as I drill down into the editField function there are checks in there for "can update album text"--if you have been changing permissions in XoopsGallery, I suppose you could have removed your rights from there. If the files look OK then check into that side (I only know it exists, I've never messed with the album permissions really).



100
gstarrett
Re: XoopsGallery Fixes.. Recent Comments Link, New Pics Block showing thumbnail, etc...
  • 2003/10/5 0:36

  • gstarrett

  • Friend of XOOPS

  • Posts: 174

  • Since: 2002/3/12


Quote:

ffabris wrote:
I am left with one problem which I have been unable to solve, and that is the album description. I tried the fix suggested but that did nothing. I also tried using $album.description instead of $album.album_desc in xoopsgallery_index.html, but that didn't help either.

Not only does the description not appear, I can't even find where I might be able to change it. Looking at the code in view_album.php suggests that there should be link to edit the description on the gallery page, much like the one to edit the album title, but I get no such link.


In my XoopsGallery, the descriptions seem to be working properly. You can set them on a main album from the default page and for a sub-album when looking at the entry in it's parent album via the admin drop-down list. The descriptions appear on the main page for top level albums and in normal text immediately after the name for sub-albums.

I have <{$album.album_desc}> for the smarty tag on the pages for the description.

I've also modified my XoopsGallery--looking at what you wrote, perhaps you were looking for the description to appear below the Album Name on View Album and View Photo pages (which would seem appropriate for copyright notices). You can do that by doing the following:

In both view_album.php and view_photo.php, find this one line:
$xoopsTpl->assign('album_title'$gallery->album->fields["title"]);

and copy it to 2 lines and change 2nd to description:
$xoopsTpl->assign('album_title'$gallery->album->fields["title"]);  
$xoopsTpl->assign('album_desc'$gallery->album->fields["description"]);


Then change the first 2 lines in \templates\xoopsgallery_viewalbum.html and \templates\xoopsgallery_viewphoto.html to:
<h4><{$album_title}></h4>  
<
p><{$album_desc}></p>


Hope this helps.




TopTop
« 1 ... 7 8 9 (10) 11 12 13 »



Login

Who's Online

77 user(s) are online (41 user(s) are browsing Support Forums)


Members: 0


Guests: 77


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits