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  

gallery works but main page blank when logged in
Goto page 1, 2  Next
 
Post new topic   Reply to topic    NukedGallery.net Forum Index » phpBB Integration » phpBB3 / Gallery 2 Integration View previous topicPrinter friendly versionView next topic
Author Message
iain

User
User


Joined: Dec 26, 2007
Posts: 30

PostPosted: Tue Apr 15, 2008 11:30 pm    Post subject: gallery works but main page blank when logged in Reply with quote

hi.
Dari has just doen a fantastic job for me getting four random gallery images in my main forum page Smile looks absolutly great.
After it was finished I looked around again and delted some unused albums [members that dont use any more, bots] using the <album action s> links. After that I got a blank page if i was logged in.
Dari suggested that I resync users from my forum G2 settings.
now I am getting

Code: ›  Gallery Integration Error
File: /home/uklows/public_html/lowriderforums.com/forum/g2helper.inc
Line: 273
createUser failed for 2. Here is the error message from G2:
Error (ERROR_COLLISION)
in modules/core/classes/GalleryUser.class at line 149 (GalleryCoreApi::error)
in modules/core/classes/GalleryEmbed.class at line 344 (GalleryUser::create)
in /home/uklows/public_html/lowriderforums.com/forum/g2helper.inc at line 271 (GalleryEmbed::createUser)
in /home/uklows/public_html/lowriderforums.com/forum/g2helper.inc at line 106 (g2helper::_createUser)
in /home/uklows/public_html/lowriderforums.com/forum/includes/functions.php at line 3144 (g2helper::init)
in /home/uklows/public_html/lowriderforums.com/forum/index.php at line 125

and cant access at all..............
what have I done please?


www.lowriderforums.com
Back to top
Offline View user's profile Send private message Visit poster's website
AdBot
   Post subject: gallery works but main page blank when logged in  

Back to top
jettyrat

Moderator
Moderator


Joined: Nov 28, 2005
Posts: 1139

PostPosted: Wed Apr 16, 2008 9:54 am    Post subject: Re: gallery works but main page blank when logged in Reply with quote

Doesn't appear you've done anything wrong, but somehow you've lost the externalidmap data for yourself (presumably the phpbb admin with id 2). Are other users able to login and visit gallery without issue?

You are using version 1.0.1a, right? Here's a couple fixes from the next integration version that should help get you fixed up again if there are not other issues. Both of these edits to g2helper.php in the init function. The first will prevent bots being able to get accounts and the second should fix your collision error.

Code: › Find:
      // not anonymous user
      if ($user->data['username'] != 'Anonymous') {

Replace with:
      // not anonymous user or bot
      if ($user->data['user_type'] != USER_IGNORE)
      {

Find:
         // create new user account if current user does not have Gallery account
         elseif (isset($ret) && $ret->getErrorCode() & ERROR_MISSING_OBJECT)
         {
            $this->_createUser($user->data['user_id'], array(
               'username' => $user->data['username'],
               'hashedpassword' => $user->data['user_password'],
               'email' => $user->data['user_email'],
               'fullname' => $user->data['username'],
               'language' => $user->data['user_lang'],
               'creationtimestamp' => time(),
               'hashmethod' => 'md5')
            );

Replace with:
         // check if current user exists in Gallery and add external id map if so
         elseif (isset($ret) && $ret->getErrorCode() & ERROR_MISSING_OBJECT)
         {
            list ($ret, $userId) = GalleryCoreApi::fetchUserByUserName($user->data['username']);
            if (empty($ret))
            {
               $ret = GalleryEmbed::addExternalIdMapEntry($user->data['user_id'], $userId->getId(), 'GalleryUser');
               if (isset($ret))
               {
                  trigger_error(sprintf($user->lang['G2_ADDEXTERNALMAPENTRY_FAILED'], $user->data['username']) . $user->lang['G2_ERROR'] . $ret->getAsHtml(), E_USER_ERROR);
               }
            }
            // create new user account if current user does not have a Gallery account and no external id mapping
            elseif (isset($ret) && $ret->getErrorCode() & ERROR_MISSING_OBJECT)
            {
               $this->_createUser($user->data['user_id'], array(
                  'username' => $user->data['username'],
                  'hashedpassword' => $user->data['user_password'],
                  'email' => $user->data['user_email'],
                  'fullname' => $user->data['username'],
                  'language' => $user->data['user_lang'],
                  'creationtimestamp' => time(),
                  'hashmethod' => 'md5')
               );
            }
Back to top
Offline View user's profile Send private message
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6284
Location: Washington Township, NJ, USA

PostPosted: Wed Apr 16, 2008 10:36 am    Post subject: Re: gallery works but main page blank when logged in Reply with quote

jettyrat-
he doesn't have 1.0.1a, he's got the one prior, with g2helper.inc (i didn't do the integration for him, just the custom code to get the random photos in place and working properly).
_________________
Back to top
Offline View user's profile Send private message Visit poster's website
jettyrat

Moderator
Moderator


Joined: Nov 28, 2005
Posts: 1139

PostPosted: Wed Apr 16, 2008 11:01 am    Post subject: Re: gallery works but main page blank when logged in Reply with quote

Ah, ok, well I think the changes should be about the same anyway. Should be easy enough to find the right lines. iain, just make sure not to break the if...elseif...else flow in the init function. If you have trouble, post your init function here and I'll make the changes to it.
Back to top
Offline View user's profile Send private message
iain

User
User


Joined: Dec 26, 2007
Posts: 30

PostPosted: Wed Apr 16, 2008 4:00 pm    Post subject: Re: gallery works but main page blank when logged in Reply with quote

seems others cant get on either...................
i cant find the code i need to change or show you Embarassed

got g2helper.inc but its not in there

can I have more clues please
thanks
Back to top
Offline View user's profile Send private message Visit poster's website
jettyrat

Moderator
Moderator


Joined: Nov 28, 2005
Posts: 1139

PostPosted: Wed Apr 16, 2008 4:28 pm    Post subject: Re: gallery works but main page blank when logged in Reply with quote

The ones that can't get on have the same error msg?

Which integration version are you using? (should say in the page footer in any of the acp gallery2 settings pages)

The changes go in the init function of g2helper.inc.
Back to top
Offline View user's profile Send private message
iain

User
User


Joined: Dec 26, 2007
Posts: 30

PostPosted: Wed Apr 16, 2008 11:17 pm    Post subject: Re: gallery works but main page blank when logged in Reply with quote

Code: › Gallery Integration Error
File: /home/uklows/public_html/lowriderforums.com/forum/g2helper.inc
Line: 70
initAdmin failed. Here is the error message from G2:
Error (ERROR_MISSING_OBJECT) : 2 GalleryUser
in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 124 (GalleryCoreApi::error)
in modules/core/classes/GalleryCoreApi.class at line 2298 (GalleryEntityHelper_simple::loadEntityByExternalId)
in modules/core/classes/GalleryEmbed.class at line 215 (GalleryCoreApi::loadEntityByExternalId)
in modules/core/classes/GalleryEmbed.class at line 120 (GalleryEmbed::checkActiveUser)
in /home/uklows/public_html/lowriderforums.com/forum/g2helper.inc at line 68 (GalleryEmbed::init)
in /home/uklows/public_html/lowriderforums.com/forum/g2helper.inc at line 81 (g2helper::_initAdmin)
in /home/uklows/public_html/lowriderforums.com/forum/includes/functions.php at line 3144 (g2helper::init)
in /home/uklows/public_html/lowriderforums.com/forum/index.php at line 125


dont know if they all get the same but one mailed me this.
i cant see any pages anymore.
Dari said it was the version before the 1.0.1a. [with g2helper.inc]
Back to top
Offline View user's profile Send private message Visit poster's website
jettyrat

Moderator
Moderator


Joined: Nov 28, 2005
Posts: 1139

PostPosted: Wed Apr 16, 2008 11:56 pm    Post subject: Re: gallery works but main page blank when logged in Reply with quote

You can't see the phpbb administration control panel pages any more? I'm going to assume you actually can (or else you have bigger problems than the integration).

You need to go to phpbb->acp->gallery2 settings->config settings and set the activeAdminId to 0 (zero) and then resync the users again.
Back to top
Offline View user's profile Send private message
iain

User
User


Joined: Dec 26, 2007
Posts: 30

PostPosted: Thu Apr 17, 2008 1:56 pm    Post subject: Re: gallery works but main page blank when logged in Reply with quote

,.............. ia have bigger problems then.
no mwtter what i try to access I get that message. [or very similar]
Back to top
Offline View user's profile Send private message Visit poster's website
jettyrat

Moderator
Moderator


Joined: Nov 28, 2005
Posts: 1139

PostPosted: Thu Apr 17, 2008 3:20 pm    Post subject: Re: gallery works but main page blank when logged in Reply with quote

Hmm, ok I just clicked on your site link posted above and I see what you mean now.

Even guest access does not work on your site. I'm guessing somehow your g2_externalidmap database table is either gone or corrupt and the changes Dari made are calling g2helper.inc from the forum index page that prevents you from getting in to the forum at all.

I would suggest you comment out the changes Dari made for the time being at least so you can access the forum again and then we can start fixing some of the things we've been talking about.
Back to top
Offline View user's profile Send private message
jettyrat

Moderator
Moderator


Joined: Nov 28, 2005
Posts: 1139

PostPosted: Thu Apr 17, 2008 3:35 pm    Post subject: Re: gallery works but main page blank when logged in Reply with quote

Dari, maybe my suggestion in this post http://www.nukedgallery.net/postt3950.html [nukedgallery.net] about using g2helper to init gallery was not very well thought out. The problem with that (which I think is what iain is having) is that if the integration config gets screwed up, there is no way to get in to the forum because of calling integration code from the index page or page_header function which is called on all pages. At least some careful checking needs to be done before calling the integration code from this early point in the forum access for users (including admins).
Back to top
Offline View user's profile Send private message
jettyrat

Moderator
Moderator


Joined: Nov 28, 2005
Posts: 1139

PostPosted: Thu Apr 17, 2008 4:03 pm    Post subject: Re: gallery works but main page blank when logged in Reply with quote

On second thought, the real problem is that the g2_externalidmap table is hosed up.

Iain, if you can use phpmyadmin or something similar, go to your phpbb3 database and do this-
1. from the phpbb_users table find the user_id for your username (probably 2 if you are the first admin)

Then do this in your gallery database-
1. make sure your gallery database has a table in it called g2_externalidmap
2. delete everything in it
3. add this entry to it:
g_externalId = guest
g_entityType = GalleryUser
g_entityId = 5
4. Go to the g2_user table and find the g_id for your username. (probably 6 if you are the first admin)
5. add this entry to the g2_externalidmap table:
g_externalId = 2 (if that is your phpbb user id)
g_entityType = GalleryUser
g_entityId = 6 (if that is you gallery user id)

That should at least get things back to where you can get in again and run the configuration and export users again.
Back to top
Offline View user's profile Send private message
iain

User
User


Joined: Dec 26, 2007
Posts: 30

PostPosted: Thu Apr 17, 2008 4:33 pm    Post subject: Re: gallery works but main page blank when logged in Reply with quote

thanks
i'll have a go at that.

really dont want to loose Dari's excellent mods
Back to top
Offline View user's profile Send private message Visit poster's website
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6284
Location: Washington Township, NJ, USA

PostPosted: Thu Apr 17, 2008 6:38 pm    Post subject: Re: gallery works but main page blank when logged in Reply with quote

jettyrat wrote: › Hmm, ok I just clicked on your site link posted above and I see what you mean now.

Even guest access does not work on your site. I'm guessing somehow your g2_externalidmap database table is either gone or corrupt and the changes Dari made are calling g2helper.inc from the forum index page that prevents you from getting in to the forum at all.

I would suggest you comment out the changes Dari made for the time being at least so you can access the forum again and then we can start fixing some of the things we've been talking about.


yes it does, so it can init g2 and pull images from the imageblock module, format the urls, etc...
_________________
Back to top
Offline View user's profile Send private message Visit poster's website
jettyrat

Moderator
Moderator


Joined: Nov 28, 2005
Posts: 1139

PostPosted: Thu Apr 17, 2008 6:52 pm    Post subject: Re: gallery works but main page blank when logged in Reply with quote

Quote: › yes it does, so it can init g2 and pull images from the imageblock module, format the urls, etc...

Yeah, not blaming you....I'm the one that suggested to do it that way Smile

It's just that the side effect is if the integration config gets screwed up, the forum itself can be rendered inaccessible.
Back to top
Offline View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    NukedGallery.net Forum Index » phpBB Integration » phpBB3 / Gallery 2 Integration View previous topicPrinter friendly versionView next topic
Goto page 1, 2  Next

 
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: Web HostingDedicated ServersDomain NamesDomain Name RegistrationDedicated Web HostingSEO Search Engine OptimisationSEOWeb Design New YorkSEO Web DesignWeb hosting AustraliaCheap Web Design

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