Home | Support Forums | Your Account | Gallery [2] | 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  

Problems with upgrading phpbb Integration

 
Post new topic   Reply to topic    NukedGallery.net Forum Index » phpBB Issues » phpBB2 / Gallery 2 Integration View previous topicPrinter friendly versionView next topic
Author Message
gondee

Novice
Novice


Joined: Apr 15, 2006
Posts: 20

PostPosted: Fri Jan 11, 2008 1:15 am    Post subject: Problems with upgrading phpbb Integration Reply with quote

I've upgraded my gallery to version 2.2.4 and I'm upgrading the integration with phpbb to the newest version 0.5.10. Unfortunately, I'm having quite a few problems as I have a heavily modded board, and I'm hoping you can help me.

First off, this is the error I'm getting every time I look at my profile:

Code: › Parse error: syntax error, unexpected T_IF in /home/xxx/public_html/forum/includes/bbcode.php on line 1


Any idea what might cause that? I've double checked this line of code and it is installed properly:
Code: ›
#
#-----[ FIND ]------------------------------------------
#
   $text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);

#
#-----[ AFTER, ADD ]------------------------------------------
#
   global $phpEx;
   $g2img_baseurl = str_replace(array('.', '?'), array('\.', '\?'), $_SERVER['HTTP_HOST'] . substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/') + 1) . 'gallery2.' . $phpEx . '?g2_view=core.DownloadItem');
   $text = preg_replace('#\[img\]((http|https)://)(' . $g2img_baseurl . '\&amp\;g2_itemId=[0-9]+)\[/img\]#sie', "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);


I have a feeling this is one of those errors that's brought up in bbcode.php due to an error somewhere else in another file...

I'm running into problems with the BBcode section of the installation because I've already got a BBcode assigned to the value
Code: › 'L_BBCODE_G_HELP' = $lang['bbcode_g_help'],


What does this portion of the code do? Is this the part that lets you use a BBcode to post pictures directly from Gallery 2? If so, can that part be left out (or give me another value to assign to my bbcode other than g_help.

Also, I've got a problem with this line of code in the installation:

Code: ›

admin/admin_db_utilities.php

#
#-----[ FIND ]------------------------------------------
#
         $tables = array('auth_access', 'banlist', 'categories', 'config', 'disallow', 'forums', 'forum_prune', 'groups', 'posts', 'posts_text', 'privmsgs', 'privmsgs_text', 'ranks', 'search_results', 'search_wordlist', 'search_wordmatch', 'sessions', 'smilies', 'themes', 'themes_name', 'topics', 'topics_watch', 'user_group', 'users', 'vote_desc', 'vote_results', 'vote_voters', 'words', 'confirm', 'sessions_keys');

I cannot find that line of text anywhere in the file at all.

Additionally, I'm running the Xtreme Styles mod, which completely replaces template.php with another file. Is this section of the code critical or can it be left out?

Code: ›
#
#-----[ FIND ]------------------------------------------
#
            if (!$do_not_echo)
            {
               $code_lines[$i] = 'echo \'' . $code_lines[$i] . '\' . "\\n";';
            }

#
#-----[ REPLACE WITH ]------------------------------------------
#
            if (!$do_not_echo)
            {
               if ( defined('UTF8_TRANSLATE') )
               {
                  $code_lines[$i] = 'echo utf8_encode(\'' . $code_lines[$i] . '\' . "\\n");';
               }
               else
               {
                  $code_lines[$i] = 'echo \'' . $code_lines[$i] . '\' . "\\n";';
               }
            }



I'm pretty stumped here, there's so many issues I need to figure out , primarily is just what can be left out just to get the integration working again.
Back to top
Hidden View user's profile Send private message
AdBot
   Post subject: Problems with upgrading phpbb Integration  

Back to top
jettyrat

Moderator
Moderator


Joined: Nov 28, 2005
Posts: 1040

PostPosted: Fri Jan 11, 2008 10:36 am    Post subject: Re: Problems with upgrading phpbb Integration Reply with quote

First of all, version 0.5.11 has been sent to Dari, but he hasn't released it in over a month now...

Quote: › Parse error: syntax error, unexpected T_IF

Means there is probably a missing quotation mark or semicolon somewhere, possibly not in bbcode.php since it says line 1.

Code: › 'L_BBCODE_G_HELP' = $lang['bbcode_g_help'],

That is the help message when hovering over the g2Img button. You can change it to anything, but you will have to change all instances of it in the integration. If you are using it already, you are probably also using the 'G' button code already and will have to change it as well.

Code: › $tables = array('auth_access', 'banlist', 'categories', 'config', 'disallow', 'forums', 'forum_prune', 'groups', 'posts', 'posts_text', 'privmsgs', 'privmsgs_text', 'ranks', 'search_results', 'search_wordlist', 'search_wordmatch', 'sessions', 'smilies', 'themes', 'themes_name', 'topics', 'topics_watch', 'user_group', 'users', 'vote_desc', 'vote_results', 'vote_voters', 'words', 'confirm', 'sessions_keys');

Is in the first few lines of code after 'Begin program proper' after all the functions.

The last one you don't need unless you running a language that needs utf-8 characters.
Back to top
Offline View user's profile Send private message
gondee

Novice
Novice


Joined: Apr 15, 2006
Posts: 20

PostPosted: Fri Jan 11, 2008 10:20 pm    Post subject: Re: Problems with upgrading phpbb Integration Reply with quote

<sigh> Yeah, I can't find that code in admin_db_utilities.php at all. I think it might have been removed with another hack. My board is working fine without it, so that makes me think I removed it for another hack. How critical is that piece?

So if the UTF-8 stuff isn't required, can this piece be left out as well?
Code: › #
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php

#
#-----[ FIND ]------------------------------------------
#
$template->assign_vars(array(

#
#-----[ BEFORE, ADD ]------------------------------------------
#
if ( defined('UTF8_TRANSLATE') )
{
   $lang['ENCODING'] = 'utf-8';
}

Code: ›
#
#-----[ FIND ]------------------------------------------
#
header ('Pragma: no-cache');

#
#-----[ AFTER, ADD ]------------------------------------------
#
header ('Content-Type: text/html; charset=' . $lang['ENCODING']);

My template.php is nothing like the old one - I know you guys can't prepare for every single hack out there (nor would I expect you to), so that's why I'd like to know if the UTF code can be left out.

I cannot for the life of me figure out where the problems are with bbcode.php, and which piece of the code is the one screwing with it. It would be nice if along with the package Dari had included an "upgrades" section you could do if you had previously installed an older package. There is probably some leftover code from the older package that might be screwing something up, so I'm gonna have to "reupload" a clean, working version of my board with the old integration installed, go reverso through the old install instructions (if I still have them) and start from scratch that way. I just can't see any other way to do it and still be sure some legacy code isn't messing me up some way. It might be worth it to have somewhere on the site that has all the versions of the old upgrade instructions for people like me who might miss a few between all the updates.

And the gallery upgrade from 2.1.1 to 2.2.4 was so easy and had me so positive this one would be easy as well. Laughing Mr. Green
Back to top
Hidden View user's profile Send private message
jettyrat

Moderator
Moderator


Joined: Nov 28, 2005
Posts: 1040

PostPosted: Mon Jan 14, 2008 11:05 am    Post subject: Re: Problems with upgrading phpbb Integration Reply with quote

Quote: › So if the UTF-8 stuff isn't required, can this piece be left out as well?

Yes.
Back to top
Offline View user's profile Send private message
gondee

Novice
Novice


Joined: Apr 15, 2006
Posts: 20

PostPosted: Wed Jan 23, 2008 12:56 am    Post subject: Re: Problems with upgrading phpbb Integration Reply with quote

Thanks for your help Jettyrat. Smile Thanks to you I got the integration working. Your help with deciding what I didn't have to use (the UTF stuff) was helpful. I realized I didn't need the edits in admin_db_utilities.php either as all that does is specify the gallery tables to backup using phpbb. I backup using a cron job or phpMyAdmin, so I don't have to worry about that part of the hack.

I do have one bit I was hoping you could help me with. The g2image bbcode is not working, and I know it's because I've messed up naming it to another variable. Would changing the G in the second variable to a V work? (See below)

Code: › #
#-----[ OPEN ]------------------------------------------
#
posting.php

#
#-----[ FIND ]------------------------------------------
#
   'L_BBCODE_F_HELP' => $lang['bbcode_f_help'],

#
#-----[ AFTER, ADD ]------------------------------------------
#
   'L_BBCODE_V_HELP' => $lang['bbcode_v_help'],

#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------
#
$lang['bbcode_f_help'] = 'Font size: [size=x-small]small text[/size]';

#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['bbcode_v_help'] = 'Insert Gallery 2 image';

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/posting_body.tpl

#
#-----[ FIND ]------------------------------------------
#
f_help = "{L_BBCODE_F_HELP}";

#
#-----[ AFTER, ADD ]------------------------------------------
#
v_help = "{L_BBCODE_V_HELP}";

function g2ic_open(form, field) {
   var url = './g2image/g2image.php?g2ic_form='+form+'&g2ic_field='+field;
   var name = 'g2image';
   var w = 600;
   var h = 600;
   var valLeft = (screen.width) ? (screen.width-w)/2 : 0;
   var valTop = (screen.height) ? (screen.height-h)/2 : 0;
   var features = 'width='+w+',height='+h+',left='+valLeft+',top='+valTop+',resizable=1,scrollbars=1';
   window.open(url, name, features);
}


I have changed it multiple times but it continues to error out on my posting page. What is the bbcode generated? And what info should you put in between it to get it to show images from the gallery? It's strange, it's broken all the other bbcode buttons as well.

Additionally, I am running into problems with the "All Gallery Links in Profile" mod - it is not working even though all the edits are correct (I've checked three times). It was working with my old 2.1.1 version of gallery, but once I upgraded to the new version of the bridge and the version of Gallery Links that was in the newest bridge, it was no longer working. My new Gallery version is 2.2.4.

It appears as though it is not picking up the items in the gallery:



Nothing appears in the box.

I have a hunch the code in g2helper.inc is not working or malfunctioning with the newest version of Gallery (2.2.4).

Any ideas?
Back to top
Hidden View user's profile Send private message
jettyrat

Moderator
Moderator


Joined: Nov 28, 2005
Posts: 1040

PostPosted: Thu Jan 24, 2008 3:44 pm    Post subject: Re: Problems with upgrading phpbb Integration Reply with quote

Quote: › I do have one bit I was hoping you could help me with. The g2image bbcode is not working, and I know it's because I've messed up naming it to another variable. Would changing the G in the second variable to a V work? (See below)

There is also the button code that needs to be changed {helpline('v')} in templates/subSilver/posting_body.tpl
Code: ›            <input type="button" class="button" name="g2image" value="g2Img" style="width: 55px"  onClick="g2ic_open('post', 'message');" onMouseOver="helpline('v')" />

Quote: › Additionally, I am running into problems with the "All Gallery Links in Profile" mod - it is not working even though all the edits are correct (I've checked three times). It was working with my old 2.1.1 version of gallery, but once I upgraded to the new version of the bridge and the version of Gallery Links that was in the newest bridge, it was no longer working. My new Gallery version is 2.2.4.

If I remember correctly this is broken in the 0.5.10 release and I fixed it in the 0.5.11 release (that Dari has not released yet). Try replacing the mapAllGalleryLinks function in g2helper.inc with this one:
Code: ›    function mapAllGalleryLinks($userId, $albums, $limit) {
      global $gallery, $lang;

      $this->_initAdmin();

      $ret = GalleryEmbed::isExternalIdMapped($userId, 'GalleryUser');
      if (empty($ret)) {
         list ($ret, $entityId) = GalleryCoreApi::loadEntityByExternalId($userId, 'GalleryUser');
         if (isset($ret)) {
            $this->_errorHandler(GENERAL_ERROR, sprintf($lang['G2_LOADENTITYBYEXTID_FAILED'], $userId) . $lang['G2_ERROR'] . $ret->getAsHtml(), __LINE__, __FILE__);
         }

         list ($ret, $itemIds) = GalleryCoreApi::fetchAllItemIdsByOwnerId($entityId->getId());
         if (isset($ret)) {
            $this->_errorHandler(GENERAL_ERROR, sprintf($lang['G2_FETCHITEMSBYOWNER_FAILED'], $entityId->getId()) . $lang['G2_ERROR'] . $ret->getAsHtml(), __LINE__, __FILE__);
         }

         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)) {
            $this->_errorHandler(GENERAL_ERROR, sprintf($lang['G2_FETCHDESCENDCOUNTS_FAILED'], $entityId->getId()) . $lang['G2_ERROR'] . $ret->getAsHtml(), __LINE__, __FILE__);
         }

         $itemIds = array();
         foreach ($descendentCounts as $key => $value) {
            if (empty($albums) && $value == 0) {
               $itemIds[] = $key;
            }
            elseif (!empty($albums) && $value <> 0) {
               $itemIds[] = $key;
            }
         }

         $count = count($itemIds);

         $itemIds = ($count > $limit) ? array_slice($itemIds, -$limit, $limit) : $itemIds;

         list ($ret, $thumbNails) = GalleryCoreApi::fetchThumbnailsByItemIds($itemIds);
         if (isset($ret)) {
            $this->_errorHandler(GENERAL_ERROR, sprintf($lang['G2_FETCHTHUMBSBYIDS_FAILED'], $entityId->getId()) . $lang['G2_ERROR'] . $ret->getAsHtml(), __LINE__, __FILE__);
         }

         $urlGenerator =& $gallery->getUrlGenerator();

         foreach ($itemIds as $id) {
            $itemLinks[$id] = $urlGenerator->generateUrl(array('view' => 'core.DownloadItem', 'itemId' => $thumbNails[$id]->getId()), array('fullUrl' => true));
         }

         $this->done();

         return array($count, $itemLinks);
      }
      elseif (isset($ret) && $ret->getErrorCode() & ERROR_MISSING_OBJECT) {
         /*
         * User does not exist in gallery, so do nothing!
         */
      }
      else {
         $this->_errorHandler(GENERAL_ERROR, sprintf($lang['G2_ISEXTERNALIDMAPPED_FAILED'], $userId), __LINE__, __FILE__);
      }

      $this->done();

      return null;
   }
Back to top
Offline View user's profile Send private message
gondee

Novice
Novice


Joined: Apr 15, 2006
Posts: 20

PostPosted: Tue Jan 29, 2008 12:27 am    Post subject: Re: Problems with upgrading phpbb Integration Reply with quote

Okay, I plugged that new function into the g2helper.inc file, and I got this error:



It looks like it wants to build it but it doesn't quite get there. (Note the "Array" word where it previously said "Gallery Items for Gondee: 0 items")

Also, do I need to have a special G2Image module installed to get the BBcode to work? I researched elsewhere and ran across that plugin, and I wondered if it applied to this. I do have the ImageBlock module installed and working, but I wasn't sure if this was something different. Just in the future, I would recommend documenting if you need to install something else to get the bbcode to work - as it stands now I have all the stuff changed and it's still not working, and I'm thinking of just leaving out that particular part of the install since it's breaking the bbcodes on my test board. It's not critical is it?
Back to top
Hidden View user's profile Send private message
jettyrat

Moderator
Moderator


Joined: Nov 28, 2005
Posts: 1040

PostPosted: Tue Jan 29, 2008 11:26 am    Post subject: Re: Problems with upgrading phpbb Integration Reply with quote

Hmm...I guess I changed something in the memberlist code also then. Maybe try the 0.5.11 integration, as you are not using the latest mods anyway.

There is no special g2image module, so there is nothing to document. Your problems with the bbcode are the result of conflicts with the other mods you have installed.

phpBB2_0511.zip [jettyfishing.com]
Back to top
Offline View user's profile Send private message
gondee

Novice
Novice


Joined: Apr 15, 2006
Posts: 20

PostPosted: Tue Jan 29, 2008 7:12 pm    Post subject: Re: Problems with upgrading phpbb Integration Reply with quote

I will do that, thanks for the help. Thanks for the clarification on the g2image thing too - if I can't get it to work I may just leave it out.

EDIT: Boy, v. 0.11 is way different, I think I'll redo the integration from scratch to be sure I catch everything...

After reading the install, is the "Show All Gallery Links in Profile" Mod in the integration file? I can't seem to find it.
Back to top
Hidden View user's profile Send private message
gondee

Novice
Novice


Joined: Apr 15, 2006
Posts: 20

PostPosted: Thu Feb 21, 2008 10:30 pm    Post subject: Re: Problems with upgrading phpbb Integration Reply with quote

It looks like this did the trick Jettyrat! Thanks! You might make a note in the install that if you don't have individual galleries for users you have to turn off the feature that puts the button in each post and profile or it'll throw an error or 404 when you select that link. Smile
Back to top
Hidden View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    NukedGallery.net Forum Index » phpBB Issues » phpBB2 / Gallery 2 Integration View previous topicPrinter friendly versionView next topic

 
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