Topic Title: Profiles disappearing?

Forum Index » phpBB3 / Gallery 2 Integration » Profiles disappearing?
Topic URL: http://www.nukedgallery.net/postt3836.html

AuthorMessage
Post Title: Profiles disappearing?
foogrrl
Joined: Nov 25, 2007
Posts: 2

Posted: Wed Jan 09, 2008 2:28 am
Okay, I *think* I've done everything right (famous last words, I know), but I'm having one remaining issue. I've attempted to search, but it seems to be an unusually painful process on this forum, and I can't seem to find anything that applies to my issue.

If I go to the member list in phpBB3 and click on a name to bring up a profile, I get nothing - just a single, blank page.

I can get profiles back if I set the "Gallery profile links" option in Link settings to "No," or if I comment out the section of code added to memberlist.php before $template->assign_vars(show_profile($member)); in integration_mods.txt.

I've even reverted back to the original copy of this file (profiles come back) and then reapplied the mods, to make sure I'd done it properly. If I haven't, I've done it wrong twice. :I

Everything else seems fine, but this is making me batty. Any suggestions? Help is greatly appreciated!

AuthorMessage
Post Title: Re: Profiles disappearing?
TwoStroker
Joined: Dec 28, 2007
Posts: 7

Posted: Wed Jan 09, 2008 2:36 pm
I have the same issue.

AuthorMessage
Post Title: Re: Profiles disappearing?
jettyrat
Joined: Nov 28, 2005
Posts: 1144

Posted: Wed Jan 09, 2008 3:04 pm
Mine works fine for users with albums and for those that don't have albums. I have reworked that code a little, but I think it was just to clean it up and get rid of one extra db call. Try this and see if it makes a difference. Also, double check the mods to styles/xxxsilver/template/memberlist_view.html
Code: › #
#-----[ OPEN ]------------------------------------------
#
memberlist.php

#
#-----[ FIND ]------------------------------------------
#
      $template->assign_vars(show_profile($member));

#
#-----[ BEFORE, ADD ]------------------------------------------
#
      // Grab Gallery link permission
      $sql = 'SELECT link, allLinks, allLinksAlbums, allLinksLimit FROM ' . GALLERY2_TABLE;
      $row = $db->sql_fetchrow($db->sql_query_limit($sql, 1));
      $member['link'] = (!empty($row['link'])) ? true : false;
      $member['allLinks'] = (!empty($row['allLinks'])) ? true : false;

      $member['gallery_totalcount'] = $member['gallery_count'] = 0;

      // Fetch all gallery items for this user if allowed and they exist
      if (!empty($member['allLinks']))
      {
         require($phpbb_root_path . 'g2helper.inc');
         $g2h = new g2helper($db);
         list($member['gallery_totalcount'], $itemLinks) = $g2h->mapAllGalleryLinks($member['user_id'], $row['allLinksAlbums'], $row['allLinksLimit']);
         $member['gallery_count'] = (count($itemLinks) > 0) ? count($itemLinks) : 0;
         if (!empty($member['gallery_count']))
         {
            foreach($itemLinks as $id => $url)
            {
               $template->assign_block_vars('gallery', array(
                  'ITEM_LINK' => append_sid("{$phpbb_root_path}gallery2.$phpEx", "g2_view=core.ShowItem&g2_itemId=$id"),
                  'ITEM_THUMB' => $url)
               );
            }
         }
      }

AuthorMessage
Post Title: Re: Profiles disappearing?
foogrrl
Joined: Nov 25, 2007
Posts: 2

Posted: Thu Jan 10, 2008 12:04 am
No change, unfortunately. And pretty sure it's not the Prosilver mods, as it's happening with subsilver2 and a third theme as well.

AuthorMessage
Post Title: Re: Profiles disappearing?
jettyrat
Joined: Nov 28, 2005
Posts: 1144

Posted: Thu Jan 10, 2008 10:12 am
You are using version 0.0.4, right?

It does this for all users or just ones with albums?

I can't reproduce it, so I don't know what I'm looking for...

AuthorMessage
Post Title: Re: Profiles disappearing?
IngerK
Joined: Jan 19, 2006
Posts: 120
Location: Oslo, Norway
Posted: Fri Jan 11, 2008 3:01 pm
I have one user with this problem. I dont know if it has anything to do with G2, the other profiles seems to be fine.

AuthorMessage
Post Title: Re: Profiles disappearing?
jettyrat
Joined: Nov 28, 2005
Posts: 1144

Posted: Fri Jan 11, 2008 3:47 pm
Does this user have a G2 album? Are there photos in the album? If I could reproduce it on my machine, I could look into it...

AuthorMessage
Post Title: Re: Profiles disappearing?
IngerK
Joined: Jan 19, 2006
Posts: 120
Location: Oslo, Norway
Posted: Fri Jan 11, 2008 4:32 pm
The user has an empty album. I tried to make empty albums to other users, but their profiles seems to be OK...
If you like, you can have access to my testforum, just mail me.
I have User Blog Mod [lithiumstudios.org] installed as well, so there are several possibilities.

I really dont know my G2-integration any more, as you know... 0.0.4++

Edit: Yes, it has something to do with user with empty albums. Not all users with empty album has albumlink in memberlist, but users with empty album with albumlink in memberlist seems to be problem. My board is modified a lot, so it could be difficult to track the problem...

AuthorMessage
Post Title: Re: Profiles disappearing?
IngerK
Joined: Jan 19, 2006
Posts: 120
Location: Oslo, Norway
Posted: Fri Jan 11, 2008 5:30 pm
User with no album: ikh

Admin user add an album and set the owner to ikh. ikh's profile is OK. Link not visible in memberlist.
ikh visits Gallery2 (and link is now visible in memberlist) -> ikh's profile is now "blank".

Add images to ikh's album -> ikh's profile is visible again.

AuthorMessage
Post Title: Re: Profiles disappearing?
IngerK
Joined: Jan 19, 2006
Posts: 120
Location: Oslo, Norway
Posted: Fri Jan 11, 2008 5:46 pm
But if I set "Gallery show all item links limit:" to 0 in Link settings, the profile is visible!

AuthorMessage
Post Title: Re: Profiles disappearing?
jettyrat
Joined: Nov 28, 2005
Posts: 1144

Posted: Fri Jan 11, 2008 5:50 pm
Thanks a lot! You are good at tracking down these problems! I was wondering if it had something to do with empty albums, but haven't had time to test it. Maybe I can figure it out this weekend.

foogrrl, TwoStroker - Are your problems for users with empty albums as well?

AuthorMessage
Post Title: Re: Profiles disappearing?
jettyrat
Joined: Nov 28, 2005
Posts: 1144

Posted: Fri Jan 11, 2008 5:56 pm
It's probably an easy code fix. I suspect the fact that there are no album items is making things hang up.

AuthorMessage
Post Title: Re: Profiles disappearing?
TwoStroker
Joined: Dec 28, 2007
Posts: 7

Posted: Sun Jan 13, 2008 1:05 am
So far I only have problems with users with albums. All albums are currently empty. I'll add some pics to see if profiles reappear.

AuthorMessage
Post Title: Re: Profiles disappearing?
jettyrat
Joined: Nov 28, 2005
Posts: 1144

Posted: Mon Jan 14, 2008 9:33 pm
In g2helper.inc, the mapAllGalleryLinks function, replace this line -
Code: › if ((count($descendentCounts) < 1) || (isset($ret) && $ret->getErrorCode() & ERROR_STORAGE_FAILURE)) {


with this one -
Code: › if (($descendentCounts[$itemIds[0]] < 1) || (isset($ret) && $ret->getErrorCode() & ERROR_STORAGE_FAILURE)) {

AuthorMessage
Post Title: Re: Profiles disappearing?
IngerK
Joined: Jan 19, 2006
Posts: 120
Location: Oslo, Norway
Posted: Mon Jan 14, 2008 9:37 pm
Thank you! Seems to work here! Very Happy

AuthorMessage
Post Title: Re: Profiles disappearing?
jettyrat
Joined: Nov 28, 2005
Posts: 1144

Posted: Tue Jan 15, 2008 10:37 am
The above fix works, but throws an 'undefined index error' for users with no albums if you have all error reporting turned on. This is a better fix -

g2helper.inc, mapAllGalleryLinks function, replace this
Code: ›          list ($ret, $descendentCounts) = GalleryCoreApi::fetchDescendentCounts($itemIds, $entityId->getId());
         if ((count($descendentCounts) < 1) || (isset($ret) && $ret->getErrorCode() & ERROR_STORAGE_FAILURE)) {
            /*
            * User has no items to display!
            */
            $this->done();
            return NULL;
         }    
         elseif (isset($ret)) {
            msg_handler(E_G2_ERROR, sprintf($user->lang['G2_FETCHDESCENDCOUNTS_FAILED'], $entityId->getId()) . $user->lang['G2_ERROR'] . $ret->getAsHtml(), __FILE__, __LINE__);
         }

With this
Code: ›          if (sizeof($itemIds) == 0) {
            /*
            * User has no album items to display!
            */
            $this->done();
            return array(null, null);
         }
         else {
            list ($ret, $descendentCounts) = GalleryCoreApi::fetchDescendentCounts($itemIds, $entityId->getId());
            if (($descendentCounts[$itemIds[0]] < 1) || (isset($ret) && $ret->getErrorCode() & ERROR_STORAGE_FAILURE)) {
               /*
               * User has no descendent items to display!
               */
               $this->done();
               return array(null, null);
            }
            elseif (isset($ret)) {
               msg_handler(E_G2_ERROR, sprintf($user->lang['G2_FETCHDESCENDCOUNTS_FAILED'], $entityId->getId()) . $user->lang['G2_ERROR'] . $ret->getAsHtml(), __FILE__, __LINE__);
            }
         }

All times are GMT - 5 Hours
Powered by PHPNuke and phpBB2 © 2006 phpBB Group