Support Forums | Demo Gallery [1.x] [2.x] | Downloads | News | Site Map ]
Nuked Gallery
  Create a FREE account or Login   As a guest, you don't have access to our FULL navigation system.
 Forum FAQForum FAQ   StatisticsStatistics   SearchSearch   UsergroupsUsergroups   FavoritesFavorites  

New integration version available for testing
Goto page Previous  1, 2
 
Post new topic   This topic is locked: you cannot edit posts or make replies.    NukedGallery.net Forum Index » phpBB Integration » phpBB3 / Gallery 2 Integration View previous topicPrinter friendly versionView next topic
Author Message
jettyrat

Moderator
Moderator


Joined: Nov 28, 2005
Posts: 1144

PostPosted: Tue Oct 14, 2008 12:35 pm    Post subject: Re: New integration version available for testing Reply with quote

Cool, that helps! Smile

I think I prefer to do the filtering as I posted before because it does not mess up the item count per page (which will look like a bug, imho) and saves resources by not having to fetch objects that will not be used.
Code: › Find:
// Subtract the albumItemIds from the childItemIds
$itemIds = array_diff($childItems, array_keys($idMap));

Replace With:
$itemIds = array();

if (sizeof($childItems))
{
   $query = 'SELECT [GalleryEntity::id] FROM [GalleryEntity] WHERE [GalleryEntity::entityType] = ? AND [GalleryEntity::id] IN (' . implode(',', $childItems) . ')';
   list ($ret, $searchResults) = $gallery->search($query, array('GalleryPhotoItem'));
   if ($ret) {
      echo 'Problem!';
   }

   while ($result = $searchResults->nextResult()) {
      $itemIds[] = $result[0];
   }
}


So, the rest is view source and resize permissions? I'll have to work through it - still a lot to wade through.
Razz
Back to top
Offline View user's profile Send private message
AdBot
   Post subject: Re: New integration version available for testing  

Back to top
PoPoutdoor

Wizard
Wizard


Joined: Jan 20, 2006
Posts: 129

PostPosted: Tue Oct 14, 2008 2:45 pm    Post subject: Re: New integration version available for testing Reply with quote

I don't know the database query way is better or not, in terms of memory usage and server loading.
I do know my mods eats up more memory and most of the time, not pretty Razz

As I said: I'm not programmer...... yet, still a long way to become one.

Just fix the preview option url, here is the changes:

g2is.html

find:

Code: ›                   <a href="{g2is_thumbs.THUMB_LINK}" rel="lightbox" title="{g2is_thumbs.LB_TITLE}"><img src="templates/subSilver/images/g2is/magnifier.gif" alt="" title="{L_G2IS_VIEWLGR}" /></a>


replace with:

Code: ›                   <!-- IF g2is_thumbs.THUMB_LINK -->
                  <a href="{g2is_thumbs.THUMB_LINK}" rel="lightbox" title="{g2is_thumbs.LB_TITLE}"><img src="templates/subSilver/images/g2is/magnifier.gif" alt="" title="{L_G2IS_VIEWLGR}" /></a>
                  <!-- ENDIF -->


g2is.php

find:

Code: ›       $index = 't';
      list ($s_hidden_data, $void) = buildOptions($id, $index, $thumbnail[$id], $urlGenerator, true);


add after:
Code: ›
      $thumb_link = '';


find:

Code: ›                list ($s_hidden_data, $options) = buildOptions($id, $index, $resizes[$id][$i], $urlGenerator);
               $size_options .= $options;
            }


add after:

Code: ›
            $thumb_link = $urlGenerator->generateUrl(array('view' => 'core.DownloadItem', 'itemId' => $resizes[$id][0]->getId()), array('forceFullUrl' => true, 'forceSessionId' => false));


find:

Code: ›          'THUMB_LINK'   => $urlGenerator->generateUrl(array('view' => 'core.DownloadItem', 'itemId' => $itemObject->getId()), array('forceFullUrl' => true, 'forceSessionId' => false)),


replace with:

Code: ›          'THUMB_LINK'   => $thumb_link,


Preview now shows the first resizes instead of original, hides if current user only have core.view permission.

BTW, Back port G2IS to phpbb2 is in full function by now, with guest view mode / user view mode in config section.
Back to top
Offline View user's profile Send private message
jettyrat

Moderator
Moderator


Joined: Nov 28, 2005
Posts: 1144

PostPosted: Tue Oct 14, 2008 5:52 pm    Post subject: Re: New integration version available for testing Reply with quote

I've been playing around with gallery permissions and I'm not sure all of this is even worth it. First, your system is flawed because it only really works on an album basis and not an individual item basis. I can set an album to view all permission and then set items within that album to view item permission and your scheme breaks down. In order to fully implement this it seems like it is going to take a lot more code and a lot more js code and I just don't think it is worth it at all.

The only permission all this seems to affect is the view item permission. Setting to anything else other than view all versions makes the items disappear from the list anyway by gallery's own permission checking.

I think it is better to keep things simple and light, the way it is. The size limit of a posted image can be controlled by phpBB anyway, so I don't see the point of worrying about the original or resized images from the image selector.
Back to top
Offline View user's profile Send private message
jettyrat

Moderator
Moderator


Joined: Nov 28, 2005
Posts: 1144

PostPosted: Tue Oct 14, 2008 8:23 pm    Post subject: Re: New integration version available for testing Reply with quote

All that is affected by all this are albums/items with "view item" permission. Items with "view all versions" don't have a problem (obviously) and any other view permission settings result in the album/item not being shown at all in the image selector.

I'm thinking a better way to handle this issue might be to note items that have limited insert options when they are shown in the image selector and then if an invalid insert option is selected, have a js alert popup that says the combination of insert options is not possible and explain the options. A few lines of js code and little changes to the php code - much simpler!
Back to top
Offline View user's profile Send private message
PoPoutdoor

Wizard
Wizard


Joined: Jan 20, 2006
Posts: 129

PostPosted: Wed Oct 15, 2008 3:39 am    Post subject: Re: New integration version available for testing Reply with quote

Current code for preview get the original url

Code: › $urlGenerator->generateUrl(array('view' => 'core.DownloadItem', 'itemId' => $itemObject->getId()), array('forceFullUrl' => true, 'forceSessionId' => false))


most likely, original sizes will be larger than the 600x600 G2IS window.
So, it is logical to change that to the smallest resizes which might be viewable in full with in the G2IS window and make preview useful.

Permission handling by test [core.viewAll] is simpler, indeed. But [core.viewSource], [core.viewResizes] also needed to test for generate correct urls.

Summary, related to permission of G2IS (without my mods) :
  1. GalleryCoreApi::fetchAlbumTree()

    return albums visible by current user, handle correctly.

  2. GalleryCoreApi::fetchChildItemIds()

    return items visible by current user, handle correctly.

  3. GalleryCoreApi::fetchThumbnailsByItemIds()

    GalleryCoreApi::fetchChildItemIds() already passed visible items, always correct.

  4. GalleryCoreApi::fetchResizesByItemIds()

    return resizes, without permission check.

  5. Original url generation.

    Code: ›       // Build options for the original image
          $index = 0;
          list ($s_hidden_data, $size_options) = buildOptions($itemObject->getId(), $index, $itemObject, $urlGenerator, true);


    return original url, without permission check.

  6. Preview url

    mentioned above.

  7. BBcode options

    no checking for valid options.

To handle mixed item permission correctly in efficient way, is out of my programing ability Razz

The mods posted so far is just my input for solving the permission issue, take your time to get the code updates which honors Gallery item view permissions.
Back to top
Offline View user's profile Send private message
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    NukedGallery.net Forum Index » phpBB Integration » phpBB3 / Gallery 2 Integration View previous topicPrinter friendly versionView next topic
Goto page Previous  1, 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours

Powered by phpBB © phpBB Group



Sponsors: Dedicated ServersDomain NamesWeb HostingDomain Name RegistrationDedicated Web HostingWeb Design New YorkCompare VoIPseo packagesSEO CompanyNew York Yellow PagesFind LocationsVOIP Phone ServiceNeckermannOnline internetSEORestaurant Locator • Get great HP coupons from CouponSnapshot • Search for great dell coupons at CouponSnapshot.com.au • Graduation DressesAndroid TabletSEO IndiaBuy Phen375fuel filterWorld Meds Direct

8th year online! 2003-2011
Legal • Use of this site consitutes agreement to the Acceptable Use Policy
Hosted by Implosion WorksSourceForge.net Logo • Theme by TonicMedia