Web Page Integration > Invisionize.eu - IP.Board (IPB) News
Kanał Rss Kanał Rss
Kanał Atom Kanał Atom

Web Page Integration

wersja drukowalna wersja Microsoft Word wersja HTML

Hello folks..

I am not sure where to go to find this information as I am not personally well versed with IPB.

I am looking for a php script that will allow access to stand alone web pages based on 2 criteria

1) That a person is currently logged onto the IPB forum; and
2) Is a member of a valid forum group permitted to see the stand alone page.

I am trying to support 2 forums at a public service support web site. Owned by the same people, they have two different (older) installations of IPB. The first is Version 2.2.2 and the second is version 2.3.6

I have done something like this before with other forum-ware such as phpBB. They call this script "page integration". This just involved adding the appropriate php "include" lines to the stand alone page, and checking that the a user is logged in -and- is a member of a group permitted to see the stand alone page.

Does anyone know if and where a guy could get a hold of this information for those 2 versions? (hopefully the same requirements)



To give an idea of what I am attempting to accomplish, here is a code snippet from an example for phpBB3 that does exactly what I am wanting to do with these two versions of IPB:

// phpBB Integration -----------------------------------------------------------------------------------------
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../../forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

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

if ($user->data['user_id'] == ANONYMOUS)
{
   //echo 'Please login!';
   header('Location: /forum/index.php'); exit;
}
else
{
   // Allowed Groups
   if ($user->data['group_id'] == "32") {$flag = "1";} // Parents group
   if ($user->data['group_id'] == "37") {$flag = "1";} // Teachers group
   if ($user->data['group_id'] == "15") {$flag = "1";} // Webmaster
   // Allowed People
   $fp=fopen("tmpls/set_bar.bbf","r");
  	while (!feof($fp)) {
		$tline = explode("|", fgets($fp));  
    	if ($user->data['username'] == $tline[0]) {$flag = "1";}
  	}  
   fclose($fp);
   // Evaluate and handle
   if ($flag != "1") {header('Location: /forum/index.php'); exit;}
}
// End phpBB Integration ------------------------------------------------------------------------------------


That snippet, of course is simply added to the top of any stand alone web page (php) to test for access rights on phpbb.

So the integration snippet only needs to return:
1) Are they logged in?
2) username of currently logged in member
3) What group(s) this member belongs to.


EDIT: I just realized that I probably put this question in the wrong place. Perhaps more on topic in "Programming Chat" topic. Moderator/Admin feel free to move to the appropriate location please.

śro, 14 wrzesień 2011

Komentarze:

Brak komentarzy

Imię/Nick:

Adres email:

Strona WWW:

Treść Komentarza: