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 Previous  1, 2
 
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: Fri Apr 18, 2008 4:35 am    Post subject: Re: gallery works but main page blank when logged in Reply with quote

done that and i'm in again.
Smile

ran resync and got this

Code: › [phpBB Debug] PHP Notice: in file /includes/acp/acp_gallery2.php on line 726: Division by zero


back now to the state where if you are logged in you cant see the main gallery page.
not logged in peeps can.
the gallery seems to be working OK otherwise.

its version 1.0.1


i guess updating while i have this problem is not a good idea?
Back to top
Offline View user's profile Send private message Visit poster's website
AdBot
   Post subject: Re: gallery works but main page blank when logged in  

Back to top
jettyrat

Moderator
Moderator


Joined: Nov 28, 2005
Posts: 1050

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

Ok, that's progress! The random images are working and guest access is working I see. I'm guessing you are running integration version 0.0.4 because that is the version that has a division at line 726. Weird thing about that is it means the export code did not find any phpbb users. The gallery2 settings acp pages are saying version 1.0.1? Do you have a phpbb database table called phpbb_gallery2?

I don't know what is going on...
Back to top
Offline View user's profile Send private message
iain

User
User


Joined: Dec 26, 2007
Posts: 30

PostPosted: Fri Apr 18, 2008 10:41 am    Post subject: Re: gallery works but main page blank when logged in Reply with quote

Gallery 2 <--> phpBB 3.0.0 Integration 0.0.4

i misscopied Embarassed its tellin me the latets is 1.0.1

I do have phpbb_gallery2
Back to top
Offline View user's profile Send private message Visit poster's website
jettyrat

Moderator
Moderator


Joined: Nov 28, 2005
Posts: 1050

PostPosted: Fri Apr 18, 2008 9:23 pm    Post subject: Re: gallery works but main page blank when logged in Reply with quote

Try this. It should at least prevent the original error message you posted and will prevent bots getting accounts. I still don't understand why the export function is failing like it is or why you can't get into gallery since we fixed your account in the externalidmap...

In g2helper.inc - replace the init function -
Find:
Code: ›    function init($user) {
      if ($user->data['username'] != 'Anonymous') {
         $this->_initAdmin();

         $this->_init_array['activeUserId'] = $user->data['user_id'];

         $ret = GalleryEmbed::isExternalIdMapped($user->data['user_id'], 'GalleryUser');
         if (empty($ret)) {
            $this->_mapGalleryLink($user->data['user_id'], $user->data['user_gallery']);

            $this->done();

            $ret = GalleryEmbed::init($this->_init_array);

            if (isset($ret)) {
               msg_handler(E_G2_ERROR, sprintf($user->lang['G2_INITUSER_FAILED'], $user->data['username']) . $user->lang['G2_ERROR'] . $ret->getAsHtml(), __FILE__, __LINE__);
            }
         }
         elseif (isset($ret) && $ret->getErrorCode() & ERROR_MISSING_OBJECT) {
            $this->_createUser($user->data['user_id'], $user->data['group_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')
            );

            $this->done();

            $ret = GalleryEmbed::init($this->_init_array);
            if (isset($ret)) {
               msg_handler(E_G2_ERROR, sprintf($user->lang['G2_INITUSER_FAILED'], $user->data['username']) . $user->lang['G2_ERROR'] . $ret->getAsHtml(), __FILE__, __LINE__);
            }
         }
         else {
            msg_handler(E_G2_ERROR, sprintf($user->lang['G2_ISEXTERNALIDMAPPED_FAILED'], $user->data['username']), __FILE__, __LINE__);
         }
      }
      else {
         $this->_init_array['activeUserId'] = 'guest';

         $ret = GalleryEmbed::init($this->_init_array);
         if (isset($ret)) {
            msg_handler(E_G2_ERROR, sprintf($user->lang['G2_INITUSER_FAILED'], 'guest') . $user->lang['G2_ERROR'] . $ret->getAsHtml(), __FILE__, __LINE__);
         }
      }
   }


Replace with:
Code: ›    function init($user) {
      // not anonymous user or bot
      if ($user->data['user_type'] != USER_IGNORE)
      {
         $this->_initAdmin();

         $this->_init_array['activeUserId'] = $user->data['user_id'];

         $ret = GalleryEmbed::isExternalIdMapped($user->data['user_id'], 'GalleryUser');
         if (empty($ret)) {
            $this->_mapGalleryLink($user->data['user_id'], $user->data['user_gallery']);

            $this->done();

            $ret = GalleryEmbed::init($this->_init_array);

            if (isset($ret)) {
               msg_handler(E_G2_ERROR, sprintf($user->lang['G2_INITUSER_FAILED'], $user->data['username']) . $user->lang['G2_ERROR'] . $ret->getAsHtml(), __FILE__, __LINE__);
            }
         }
         // 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')
               );
            }
            $this->done();

            $ret = GalleryEmbed::init($this->_init_array);
            if (isset($ret)) {
               msg_handler(E_G2_ERROR, sprintf($user->lang['G2_INITUSER_FAILED'], $user->data['username']) . $user->lang['G2_ERROR'] . $ret->getAsHtml(), __FILE__, __LINE__);
            }
         }
         else {
            msg_handler(E_G2_ERROR, sprintf($user->lang['G2_ISEXTERNALIDMAPPED_FAILED'], $user->data['username']), __FILE__, __LINE__);
         }
      }
      else {
         $this->_init_array['activeUserId'] = 'guest';

         $ret = GalleryEmbed::init($this->_init_array);
         if (isset($ret)) {
            msg_handler(E_G2_ERROR, sprintf($user->lang['G2_INITUSER_FAILED'], 'guest') . $user->lang['G2_ERROR'] . $ret->getAsHtml(), __FILE__, __LINE__);
         }
      }
   }
Back to top
Offline View user's profile Send private message
iain

User
User


Joined: Dec 26, 2007
Posts: 30

PostPosted: Sat Apr 19, 2008 4:12 am    Post subject: Re: gallery works but main page blank when logged in Reply with quote

seems its not everyone who is affected...........................
some logged in forum members can see the first page Confused
Back to top
Offline View user's profile Send private message Visit poster's website
iain

User
User


Joined: Dec 26, 2007
Posts: 30

PostPosted: Sat Apr 19, 2008 7:38 am    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: 289
createUser failed for 3501. Here is the error message from G2:
Error (ERROR_BAD_PARAMETER)
in modules/core/classes/GalleryEmbed.class at line 334 (GalleryCoreApi::error)
in /home/uklows/public_html/lowriderforums.com/forum/g2helper.inc at line 287 (GalleryEmbed::createUser)
in /home/uklows/public_html/lowriderforums.com/forum/g2helper.inc at line 122 (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/includes/functions.php at line 3031
in ??? at line 0
in /home/uklows/public_html/lowriderforums.com/forum/includes/functions.php at line 2301
in /home/uklows/public_html/lowriderforums.com/forum/ucp.php at line 81


by way of a test I registered a new account to see if I could see the gallery.
got this when I activated the account.
now cant get in again Rolling Eyes
Back to top
Offline View user's profile Send private message Visit poster's website
iain

User
User


Joined: Dec 26, 2007
Posts: 30

PostPosted: Sat Apr 19, 2008 9:13 am    Post subject: Re: gallery works but main page blank when logged in Reply with quote

strange........... an hour later and i can access?

does seem to be unstable at the moment.
some people can access and see all.
some cant see their own albums but can see other things.
some can see everything they should.


also I think a couple of other people registered since i got it back up the first time but before i tried to reg as a new member and got the above message.

i am an update behind with the phpbb3 and with your integration. I dont have copies of what Dari added but I have downloaded a full copy of the forum and gallery files. Have forum db copy and will take gallery db copy now.
should I redo the whole thing with latest updated downloads?
Back to top
Offline View user's profile Send private message Visit poster's website
jettyrat

Moderator
Moderator


Joined: Nov 28, 2005
Posts: 1050

PostPosted: Sat Apr 19, 2008 10:45 pm    Post subject: Re: gallery works but main page blank when logged in Reply with quote

Well, I would recommend updating because 0.0.4 has some holes in it with groups and admin permission settings from the phpbb acp. Also, the config settings are done a lot differently with 1.0.1 and eliminates a lot of db calls.

I played around for an hour or so with the random image thing like Dari did for you and something like this seems to work fine in testing, although it hasn't been heavily tested obviously. This uses the prosilver style and getImageBlock has a lot of additional options not supported by this approach, for anyone else following this thread, but it's a basic implementation...

Code: › Open styles/prosilver/overall_header.html
Find:
       <!-- IF S_BOARD_DISABLED and S_USER_LOGGED_IN and (U_MCP or U_ACP) -->
      <div id="message" class="rules">
         <div class="inner"><span class="corners-top"><span></span></span>
            <strong>{L_INFORMATION}:</strong> {L_BOARD_DISABLED}
         <span class="corners-bottom"><span></span></span></div>
      </div>
      <!-- ENDIF -->

Replace With:
       <!-- IF S_BOARD_DISABLED and S_USER_LOGGED_IN and (U_MCP or U_ACP) -->
      <div id="message" class="rules">
         <div class="inner"><span class="corners-top"><span></span></span>
            <strong>{L_INFORMATION}:</strong> {L_BOARD_DISABLED}
         <span class="corners-bottom"><span></span></span></div>
      </div>
       <!-- ELSEIF not S_GALLERY2 -->
      <div class="navbar">
         <div class="inner"><span class="corners-top"><span></span></span>
            <div style="text-align: center;">{G2_IMAGES}</div>
         <span class="corners-bottom"><span></span></span></div>
      </div>
      <!-- ENDIF -->

Open includes/functions.php
Find:
   // The following assigns all _common_ variables that may be used at any point in a template.
   $template->assign_vars(array(
      'SITENAME'                  => $config['sitename'],

Replace With:
   if (!empty($config['g2i_fullPath']) && !empty($config['g2i_embedUri']) && !empty($config['g2i_g2Uri']) && !empty($config['g2i_activeAdminId']))
   {
      require_once($phpbb_root_path . 'g2helper.' . $phpEx);
      $g2h = new g2helper();
      $g2_images = trim(str_replace(array('<div class="one-image">', '</div>'), array('', ''), $g2h->fetchImageBlock($user)));

   }
   else
   {
      $g2_images = $user->lang['OBTAIN_SETTINGS_FAILED'];
   }

   // The following assigns all _common_ variables that may be used at any point in a template.
   $template->assign_vars(array(
      'G2_IMAGES'                  => $g2_images,
      'SITENAME'                  => $config['sitename'],

Open g2helper.php
Find:
}

?>

Before, Add:
   function fetchImageBlock($user)
   {
      $this->init($user);

      list ($ret, $g2_images) = GalleryEmbed::getImageBlock(array('blocks' => 'randomImage|randomImage|randomImage|randomImage', 'show' => 'none'));
      if (isset($ret))
      {
         trigger_error('getImageBlock error' . $user->lang['G2_ERROR'] . $ret->getAsHtml(), E_USER_ERROR);
      }

      $this->done();

      return $g2_images;
   }
Back to top
Offline View user's profile Send private message
iain

User
User


Joined: Dec 26, 2007
Posts: 30

PostPosted: Sat Apr 19, 2008 11:57 pm    Post subject: Re: gallery works but main page blank when logged in Reply with quote

so if I add the code above to a "basic" integrated board/forum that is what Dari did for me ?

I did get some odd messages when i originally installed/integrated but it all seemed to work ok.
if I start from scratch with the latest updated downloads will the result still pick up on the existing db's
or
is it best just to install the updates to what I have?

thanks for all the help from you both.
Back to top
Offline View user's profile Send private message Visit poster's website
jettyrat

Moderator
Moderator


Joined: Nov 28, 2005
Posts: 1050

PostPosted: Sun Apr 20, 2008 1:59 pm    Post subject: Re: gallery works but main page blank when logged in Reply with quote

I don't know what Dari did. The code above will only work for version 1.0.1.

Make sure you have backups of everything.

If you want to upgrade, I would go through the 0.0.4 integration and undo everything, then run the phpb upgrade and install the 1.0.1 mods. There is no easy way to do it. You should be able to upgrade gallery at any time. There are no mods to gallery except the nukedgallery icon at the bottom of the gallery pages.

I'm still not sure what your actual problem is, but maybe this is worth a try. You can always go back to the backups. Post any error messages along the way...
Back to top
Offline View user's profile Send private message
iain

User
User


Joined: Dec 26, 2007
Posts: 30

PostPosted: Sun Apr 20, 2008 5:37 pm    Post subject: Re: gallery works but main page blank when logged in Reply with quote

thanks.
will do this when I have time on a mirror board I think to start with.

Dari. will your mods work with 1.0.1 ?
Back to top
Offline View user's profile Send private message Visit poster's website
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 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: Web HostingDedicated ServersDomain NamesDomain Name RegistrationDedicated Web HostingSearch Engine OptimisationSEOWeb Design New YorkSEO Web DesignWeb hosting AustraliaSEO

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