How to integrate phpBB3 with my site

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Ideas Centre
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
User avatar
sandprince
Registered User
Posts: 25
Joined: Tue Jul 03, 2007 10:32 am

How to integrate phpBB3 with my site

Post by sandprince »

How to integrate phpBB3 with my site
User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: How to integrate phpBB3 with my site

Post by Erik Frèrejean »

How do you mean this?

Create the same looks: Edit the templates.
Use the sessions: Put the following code on top of the php files of your site:

Code: Select all

/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('viewforum'); 
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)
User avatar
sandprince
Registered User
Posts: 25
Joined: Tue Jul 03, 2007 10:32 am

Re: How to integrate phpBB3 with my site

Post by sandprince »

Erik Frèrejean wrote:How do you mean this?

Create the same looks: Edit the templates.
Use the sessions: Put the following code on top of the php files of your site:

Code: Select all

/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('viewforum');  

thanx!
I want a login box in my site too. how to make it???
User avatar
battye
Extension Customisations
Extension Customisations
Posts: 11048
Joined: Wed Feb 11, 2004 11:02 am
Location: Australia
Contact:

Re: How to integrate phpBB3 with my site

Post by battye »

From index_body.html:

Code: Select all

<!-- IF not S_USER_LOGGED_IN -->
	<br clear="all" />

	<form method="post" action="{S_LOGIN_ACTION}">
	
	<table class="tablebg" width="100%" cellspacing="1">
	<tr>
		<td class="cat"><h4><a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a></h4></td>
	</tr>
	<tr>
		<td class="row1" align="center"><span class="genmed">{L_USERNAME}:</span> <input class="post" type="text" name="username" size="10" />&nbsp; <span class="genmed">{L_PASSWORD}:</span> <input class="post" type="password" name="password" size="10" />&nbsp; <span class="gensmall">{L_LOG_ME_IN}</span> <input type="checkbox" class="radio" name="autologin" />&nbsp; <input type="submit" class="btnmain" name="login" value="{L_LOGIN}" /></td>
	</tr>
	</table>
	
	</form>
<!-- ENDIF -->
Customisations Team Member

https://github.com/battye/php-array-parser - Give it a Star! :D
User avatar
sandprince
Registered User
Posts: 25
Joined: Tue Jul 03, 2007 10:32 am

Re: How to integrate phpBB3 with my site

Post by sandprince »

battye wrote:From index_body.html:

Code: Select all

<!-- IF not S_USER_LOGGED_IN -->
	<br clear="all" />

	<form method="post" action="{S_LOGIN_ACTION}">
	
	<table class="tablebg" width="100%" cellspacing="1">
	<tr>
		<td class="cat"><h4><a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a></h4></td>
	</tr>
	<tr>
		<td class="row1" align="center"><span class="genmed">{L_USERNAME}:</span> <input class="post" type="text" name="username" size="10" />&nbsp; <span class="genmed">{L_PASSWORD}:</span> <input class="post" type="password" name="password" size="10" />&nbsp; <span class="gensmall">{L_LOG_ME_IN}</span> <input type="checkbox" class="radio" name="autologin" />&nbsp; <input type="submit" class="btnmain" name="login" value="{L_LOGIN}" /></td>
	</tr>
	</table>
	
	</form>
<!-- ENDIF -->
With this code I will have a login box , on my site???
Logout button will i have???
Last edited by sandprince on Tue Nov 27, 2007 7:18 am, edited 2 times in total.
User avatar
battye
Extension Customisations
Extension Customisations
Posts: 11048
Joined: Wed Feb 11, 2004 11:02 am
Location: Australia
Contact:

Re: How to integrate phpBB3 with my site

Post by battye »

You place that code in the associated .html template file to whichever .php file you placed the above integration code in. You might need to set a few variables, such as S_LOGIN_ACTION as I'm not sure if they are global.

It won't create a logout button for you.
Customisations Team Member

https://github.com/battye/php-array-parser - Give it a Star! :D
User avatar
sandprince
Registered User
Posts: 25
Joined: Tue Jul 03, 2007 10:32 am

Re: How to integrate phpBB3 with my site

Post by sandprince »

this is the code who I write:

Code: Select all

<form action=\"". append_sid("{$phpbb_root_path}ucp.php") . "\" method=\"post\">
<input type="hidden" name="mode" value="login" />
User Name:<input type="text"  name="username" />
Password:<input type="password" name="password" />
Hidden:<input type="checkbox" class="radio" name="viewonline" />
<input type="hidden" name="autologin" value="1" />
<input type="submit" value="Submit" name="login" />
<input type="hidden" name="redirect" value="./index.php">
</form>
<form action=\"". append_sid("{$phpbb_root_path}ucp.php") . "\" method=\"post\">
<input type="hidden" name="mode" value="logout" />
Logout: <input type="submit" value="Submit" name="logout" />
</form>
Is this Correct???
User avatar
battye
Extension Customisations
Extension Customisations
Posts: 11048
Joined: Wed Feb 11, 2004 11:02 am
Location: Australia
Contact:

Re: How to integrate phpBB3 with my site

Post by battye »

No.

I think you have to link to a certain part of ucp.php, perhaps ucp.php?mode=login... offhand I can't remember. Also you have two form actions, you just want the one.

You need to set it out like the example I gave.
Customisations Team Member

https://github.com/battye/php-array-parser - Give it a Star! :D
Locked

Return to “[3.0.x] Support Forum”