Mehdi's Bridge for Phpbb2 (not 3 yet ...)

Discuss the integratoin of phpbb and Joomla! here.

Moderator: General Support Moderators

MrBrown
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Mon Jul 10, 2006 4:58 pm

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby MrBrown » Mon Jul 24, 2006 11:46 pm

Your Picture was taken from index.php, but these little arrows are shown in viewforum.php
The little Arrows are next to each topic - not next to each forum.

Example:

I go to the forum's base URL, index.php is called, looks this way:
Image

If I click the forum with new postsm, so I go into viewforum.php, looks this way:
Image

And there is that nasty little arrow...

Here's the code that generates the arrow itself, it's not template code but core code from viewtopic.php aka inc_viewtopic.php:

Code: Select all

if( $unread_topics )
{
   $folder_image = $folder_new;
   $folder_alt = $lang['New_posts'];

   $newest_post_img = '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=newest") . '"><img src="' . $images['icon_newest_reply'] . '" alt="' . $lang['View_newest_post'] . '" title="' . $lang['View_newest_post'] . '" border="0" /></a> ';
}
else
{
   $folder_image = $folder;
   $folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];

   $newest_post_img = '';
}


If that "newest" link is clicked, the following code in viewtopic.php (inc_viewtopic.php) is triggered:

Code: Select all

if ( $HTTP_GET_VARS['view'] == 'newest' )
{
   if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) || isset($HTTP_GET_VARS['sid']) )
   {
      $session_id = isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) ? $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid'] : $HTTP_GET_VARS['sid'];

      if (!preg_match('/^[A-Za-z0-9]*$/', $session_id))
      {
         $session_id = '';
      }

      if ( $session_id )
      {
         $sql = "SELECT p.post_id
            FROM " . POSTS_TABLE . " p, " . SESSIONS_TABLE . " s,  " . USERS_TABLE . " u
            WHERE s.session_id = '$session_id'
               AND u.user_id = s.session_user_id
               AND p.topic_id = $topic_id
               AND p.post_time >= u.user_lastvisit
            ORDER BY p.post_time ASC
            LIMIT 1";
         if ( !($result = $db->sql_query($sql)) )
         {
            message_die(GENERAL_ERROR, 'Could not obtain newer/older topic information', '', __LINE__, __FILE__, $sql);
         }

         if ( !($row = $db->sql_fetchrow($result)) )
         {
            message_die(GENERAL_MESSAGE, 'No_new_posts_last_visit');
         }

         $post_id = $row['post_id'];

         if (isset($HTTP_GET_VARS['sid']))
         {
            redirect("viewtopic.$phpEx?sid=$session_id&" . POST_POST_URL . "=$post_id#$post_id");
         }
         else
         {
            redirect("viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id");
         }
      }
   }

   redirect(append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id", true));
}


The problem is that the redirect ends up displaying index.php, although the URL passed to redirect is absolutely correct like like ".....viewtopic.php?p=2#2". If I retrieve that URL by echoing it and paste it manually, it actually does the trick. So the problem seems to be the redirect function of phpBB.
Last edited by MrBrown on Mon Jul 24, 2006 11:50 pm, edited 1 time in total.

mehdi
Joomla! Explorer
Joomla! Explorer
Posts: 437
Joined: Tue Oct 04, 2005 3:56 pm

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby mehdi » Tue Jul 25, 2006 12:51 am

Well, ok
I've seen the problem.
I've never paid attention to that little arrow before ...
Could you explain me what's the difference between the left arrow and right arrow,
I mean since both should redirect to newest topic, then why do they behaves in a different way ?

. So the problem seems to be the redirect function of phpBB.

I don't think so. The joomphpbb_bridge.php file
analyse  and interact with any request done in url, before the inc_viewtopic.php is executed.

Will study/fix this later... Not urgent.

MrBrown
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Mon Jul 10, 2006 4:58 pm

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby MrBrown » Tue Jul 25, 2006 2:10 am

mehdi wrote:Could you explain me what's the difference between the left arrow and right arrow,
I mean since both should redirect to newest topic, then why do they behaves in a different way ?


The left arrow jumps to the first posting which you have not read yet.
So this link is individual for each user, depending on the time of his last visit in that thread.
Or in more detail: The link is the same for all users ("....view=newest"), but it's evaluated individually for each user and then passed to the redirect function by the code in viewtopic.php that I posted above.

The right arrow just jumps to the newest posting in that thread, it's the same link for all users without any individual evaluation or viewtopic.php redirecting to itself.

hafez
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Thu Jul 13, 2006 10:51 am

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby hafez » Tue Jul 25, 2006 1:45 pm

Hi Mehdi

I know that I'm too dumb to get all this technical stuff but please bear with me a little. How do I create the table joomphpbb_bridge and where is this sql file provided and how to use it?. and where is this phpMyAdmin and how to import the table to that file?

Thanks a lot for your help.

mehdi
Joomla! Explorer
Joomla! Explorer
Posts: 437
Joined: Tue Oct 04, 2005 3:56 pm

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby mehdi » Tue Jul 25, 2006 8:16 pm

Hi hafez,

where is this phpMyAdmin

many host provide the script phpMyAdmin as a tool to administrate your database.
If it's not your case, you can :
- install it.
- use an other tool/script.

I can't learn you to use phpMyAdmin, but if you play a
bit with it  (making backup of databases, or restoring them)
you should become quickly familiar with it.

hafez
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Thu Jul 13, 2006 10:51 am

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby hafez » Fri Jul 28, 2006 4:29 pm

Hi Mehdi,

I've managed toi get to adminmysql and can import your file, no prblem. Just one last question, where exactly shall I add  the instruction for my database in the following table? and what is the format? I can see commas and semicolons down there.

CREATE TABLE IF NOT EXISTS `joomphpbb_bridge` (
  `assoc_id` int(11) NOT NULL auto_increment,
  `joom_id`  int(11) NOT NULL,
  `phpbb_id` mediumint(8) NOT NULL, 
  PRIMARY KEY  (`assoc_id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;

and which database I sould add? the joomla? my joomla database is joomla so will you please just demonstrate how to do it? and finally should I change the name of this table from joomphpbb to joomphpbb_bridge?

Thanks a lot

hafez

mehdi
Joomla! Explorer
Joomla! Explorer
Posts: 437
Joined: Tue Oct 04, 2005 3:56 pm

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby mehdi » Fri Jul 28, 2006 4:47 pm

hi hafez,
which database you use for phpbb ?
is this one the same for joomla ?
You must use the phpbb's one.

let's call it  datab_example

then import:

Code: Select all

USE datab_example;
CREATE TABLE IF NOT EXISTS `joomphpbb_bridge` (
  `assoc_id` int(11) NOT NULL auto_increment,
  `joom_id`  int(11) NOT NULL,
  `phpbb_id` mediumint(8) NOT NULL, 
   PRIMARY KEY  (`assoc_id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;


with some scripts/tools you don't need to add the line 'USE datab_example;',
you just have to select database you wish to use first.

hafez
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Thu Jul 13, 2006 10:51 am

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby hafez » Fri Jul 28, 2006 5:05 pm

Hi Mehdi

I use phpbb databse for phpbb and joomla for joomla. so I sould write

USE phpbb;

nothing after phpbb?

I promise this is my last question

sorryyyyy

hafez

mehdi
Joomla! Explorer
Joomla! Explorer
Posts: 437
Joined: Tue Oct 04, 2005 3:56 pm

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby mehdi » Fri Jul 28, 2006 5:16 pm

nothing after phpbb?

???????????????????????????????????????

>:( 

add the line USE phpbb;
at the begin of your joomphpbb.sql file,
and then import it.
This would be:

Code: Select all

USE phpbb;
CREATE TABLE IF NOT EXISTS `joomphpbb_bridge` (
  `assoc_id` int(11) NOT NULL auto_increment,
  `joom_id`  int(11) NOT NULL,
  `phpbb_id` mediumint(8) NOT NULL, 
   PRIMARY KEY  (`assoc_id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;

TRY THIS before asking more questions.
You can copy and and paste, if you are so scared.
You should see the new table joomphpbb_bridge,
inisde the phpbb database, after this operation.

hafez
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Thu Jul 13, 2006 10:51 am

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby hafez » Fri Jul 28, 2006 5:32 pm

IT'S WORKING...... :D

YOUR ARE THE BEST MEHDI

Thanks a lot...now you can enjoy whatever you are doing...no more silly questions.

hafez

User avatar
egosophist
Joomla! Apprentice
Joomla! Apprentice
Posts: 37
Joined: Fri Mar 31, 2006 2:14 am
Location: is the center of an unobtainium molecule really a place?
Contact:

Just a question...

Postby egosophist » Fri Jul 28, 2006 10:22 pm

I'm not really sure how exactly a bridge works...I am so confused...

But I took my joomla, used the wrapper feature, and walla, had my forum there...

But I would really like to integrate the login functions between both. Can I migrate my current version (it is slightly modded, and is the latest version of phpBB2) over to the latest version of Joomla?

I would even be willing to integrate joomlaforum...but I am at a loss as to where to get started.

Everyone is a noob when they start.
I could go on an on...or just use an ellipsis to get my point across...

mehdi
Joomla! Explorer
Joomla! Explorer
Posts: 437
Joined: Tue Oct 04, 2005 3:56 pm

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby mehdi » Fri Jul 28, 2006 11:16 pm

hi egosophist,
make a backup concerning your modded file,
and read main instructions, hack page, and if you still have problems faq: http://www.mehdiplugins.com/misc/phpbbjoomfaq.htm
If at the end  you can't manage to let it work the way you wish (well some people are unlucky  or don't have enough knowledge for this, see hafez threads  ;D)
then at least you can be sure that the bridge is very easy to uninstall: basically all you have to do is to restore your original files ....
I would off course recommend to perform a local test before doing any change on the server.
And finally if you experiment a difficulty, I "might" help.

User avatar
egosophist
Joomla! Apprentice
Joomla! Apprentice
Posts: 37
Joined: Fri Mar 31, 2006 2:14 am
Location: is the center of an unobtainium molecule really a place?
Contact:

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby egosophist » Fri Jul 28, 2006 11:43 pm

Sounds very "reasonable."

I shalst begin tomorrow, tonight is a little gaming swarrey I have planned.

Thanks for the help.
I could go on an on...or just use an ellipsis to get my point across...

version
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon Jul 31, 2006 11:41 am

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby version » Mon Jul 31, 2006 12:06 pm

Hi Mehdi,

I've try your bridge, it's works and Great!
before using this bridge, i'm using wrapper login .. but had some difficulties about phpbb login session :(
and now, here come another problem.
I want to install that bridge to phpbb with mod_attachment, i've read the hacks ..and still confusing
are there an easy way :D to make it?   
Last edited by version on Mon Jul 31, 2006 12:13 pm, edited 1 time in total.

hmpargi
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Tue Jun 27, 2006 4:10 pm

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby hmpargi » Sat Aug 05, 2006 7:32 am

;) this wors great.. but i want to keep my forums standalone i mean not wrapped with the site.. want to have free from site tell me how to do that ? :-[

MrBrown
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Mon Jul 10, 2006 4:58 pm

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby MrBrown » Sat Aug 05, 2006 11:46 am

hmpargi wrote: ;) this wors great.. but i want to keep my forums standalone i mean not wrapped with the site.. want to have free from site tell me how to do that ? :-[


You can do it with an IF-Statement in you Joomla template's index.php file:

Code: Select all

<?php if( strcmp(mosGetParam($_GET,'option',''), "com_phpbb" ) == 0) { ?>
    [new template code specific for PHPBB here]
 <?php } else  { ?>
    [your old template code here]
 <?php } ?>


So in the IF-case you can strip any code from your template that you don't want to see around your forum.
You still need to call though, otherwise the forum won't load.
The forum will always be wrapped by Joomla with this bridge, BUT you can make it look as if it isn't wrapped with that IF-trick.
Last edited by MrBrown on Sat Aug 05, 2006 11:49 am, edited 1 time in total.

hmpargi
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Tue Jun 27, 2006 4:10 pm

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby hmpargi » Sat Aug 05, 2006 1:13 pm

??? arey i am newB ... i open my template folder and modify the index.php with your given code.. didnt work tell me exactly step bye step... plz  :(.. betwwen thanks for your help plz help me sum1 :( :'(

MrBrown
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Mon Jul 10, 2006 4:58 pm

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby MrBrown » Sun Aug 06, 2006 1:40 am

Well the exact solution depends on your personal template's index.php file.
Keep the header as it is in the index.php file.
Put that IF statement right after "", so that the ELSE-case contains the whole body of your template as it is now.
For the IF-case you just need to call mosMainBody().

So it should look like this roughly:

Code: Select all

<?php defined( "_VALID_MOS" ) or die( "Direct Access to this location is not allowed." );?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
....
<head>
....
</head>
....
<body>
<?php if( strcmp(mosGetParam($_GET,'option',''), "com_phpbb" ) == 0) { ?>
    <?php mosMainBody(); ?>
<?php } else  { ?>
    [your old body code here]
<?php } ?>
</body>
</html>

hmpargi
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Tue Jun 27, 2006 4:10 pm

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby hmpargi » Sun Aug 06, 2006 4:22 am

:D worked thanks.. but still my forusm look width decreased how to increase it...which css code to edit will u take a look me newb soory to disturb you all  :laugh:

hmpargi
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Tue Jun 27, 2006 4:10 pm

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby hmpargi » Sun Aug 06, 2006 4:37 am

oh... after this i got new problems.. i chagned code according to u it seems liek it works now.. but problems are width of forums page and News problem arvied that..i cant log in to my site as well as forum... dont know what problem but it is after the code only.. den alter i put my original index.php and worked fine... but i nthat case i dont got unwrapped forum..

My question is solve my problem of Login after code changing the problem arrives of  Log in ... take a look on that issue and respond me .. thanks :

hmpargi
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Tue Jun 27, 2006 4:10 pm

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby hmpargi » Mon Aug 07, 2006 4:45 pm

:'( help me plz... where were alll pros

mehdi
Joomla! Explorer
Joomla! Explorer
Posts: 437
Joined: Tue Oct 04, 2005 3:56 pm

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby mehdi » Tue Aug 08, 2006 1:03 am

hi hmpargi,
you can also try this trick : http://www.mehdiplugins.com/forum/viewtopic.php?t=633
good luck

kuno
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Sun Jul 16, 2006 9:23 am

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby kuno » Tue Aug 08, 2006 9:12 pm

Hi Mehdi,
Your bridge works great, thanks a lot.  :-*
Only one thing, it is not a big issue, even when not solved I could live. But anyway, we are perfectionists, aren't we?  ;D
As you suggested, the forum is linked to the menu in Joomla by Link-URL type menu item. Therefore, when the forum is called, the navigation structure of the Joomla envelope is not working as it should. You can see this at the breadcrumb line or the menu highlighting. Both stay at the state of the page which the forum has been called from. You may have a look at http://www.swissbirds.ch to see what I mean.
Do you know an easy way to fix this?

Thanks for your answer.

kuno
Last edited by kuno on Tue Aug 08, 2006 9:15 pm, edited 1 time in total.

mehdi
Joomla! Explorer
Joomla! Explorer
Posts: 437
Joined: Tue Oct 04, 2005 3:56 pm

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby mehdi » Tue Aug 08, 2006 10:35 pm

Hi kuno,
I believe that you can get a correct pathway by following the trick:http://www.mehdiplugins.com/forum/viewtopic.php?t=633
The pathway you'll see will correspond to the pathway of the static item you made.

hmpargi
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Tue Jun 27, 2006 4:10 pm

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby hmpargi » Wed Aug 09, 2006 5:19 am

:'( mehndi that trick do mess with my site... i tink either i am doing rong...but.. form my side i think i did rite...plz i want forum in standalone from unwrapped one plz :'(

fiazo.com
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon Jun 05, 2006 7:16 am

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby fiazo.com » Wed Aug 09, 2006 9:03 am

Hey, this bridge sounds perfect! I have a tiny problem though. I've followed the instructions to link to the forum using Link-URL but I'm still seeing {PHPBB_BODY_HTML} when I visit the forum.

My Forum URL: http://www.fiazo.com/forum

(I also have IPB installed at the moment at http://www.fiazo.com/forums so disregard that installation)

I'm almost positive I've set the configuration correctly too ( $joomUrl="http://www.fiazo.com"; ). Any assistance is greatly appreciated  :) Thanks!

kuno
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Sun Jul 16, 2006 9:23 am

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby kuno » Wed Aug 09, 2006 11:47 am

mehdi wrote:Hi kuno,
I believe that you can get a correct pathway by following the trick:http://www.mehdiplugins.com/forum/viewtopic.php?t=633
The pathway you'll see will correspond to the pathway of the static item you made.

Hm.. interesting. I gonna try that tonight or tomorrow, when I have time. Thanks.  8)

mehdi
Joomla! Explorer
Joomla! Explorer
Posts: 437
Joined: Tue Oct 04, 2005 3:56 pm

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby mehdi » Wed Aug 09, 2006 11:54 am

Hi
@ hmpargi,
Cry mehndi that trick do mess with my site..

The "trick" is not intended to install the bridge, but to makes somes change according to user preferences. Forget it.
Please follow regular instructions.

@ fiazo.com,
I don't the see the tag {PHPBB_BODY_HTML}, so I suppose that you've corrected the problem.

fiazo.com
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon Jun 05, 2006 7:16 am

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby fiazo.com » Wed Aug 09, 2006 6:04 pm

Thanks for checking mehdi. It's strange that you don't see the tag - It's still showing up for me.

kuno
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Sun Jul 16, 2006 9:23 am

Re: New Bridge for Phpbb 2.020 available (from Mehdi)

Postby kuno » Wed Aug 09, 2006 6:24 pm

fiazo.com wrote:Thanks for checking mehdi. It's strange that you don't see the tag - It's still showing up for me.

Same here, I see the tag. Mehdi, make sure you look at http://www.fiazo.com/forum , not ../forums.
:-\


Return to “phpbb - Joomla! Integration”

Who is online

Users browsing this forum: No registered users and 3 guests