Posted: Fri Apr 18, 2008 4:35 am Post subject: Re: gallery works but main page blank when logged in
done that and i'm in again.
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?
Posted: Fri Apr 18, 2008 10:36 am Post subject: Re: gallery works but main page blank when logged in
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?
Posted: Fri Apr 18, 2008 9:23 pm Post subject: Re: gallery works but main page blank when logged in
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();
$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();
Posted: Sat Apr 19, 2008 7:38 am Post subject: Re: gallery works but main page blank when logged in
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
Posted: Sat Apr 19, 2008 9:13 am Post subject: Re: gallery works but main page blank when logged in
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?
Posted: Sat Apr 19, 2008 10:45 pm Post subject: Re: gallery works but main page blank when logged in
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'],
// 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);
Posted: Sat Apr 19, 2008 11:57 pm Post subject: Re: gallery works but main page blank when logged in
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?
Posted: Sun Apr 20, 2008 1:59 pm Post subject: Re: gallery works but main page blank when logged in
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...
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