Location: PHPKode > scripts > Forums Integrator > docs.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
	<title>Forums integrator Documentation</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	</head>
	<style>body {
 margin: 0; padding: 0;
	background-color: #eeeeee;
	font-family:Verdana;
	font-size:11px;
}
td {
	font-family:Verdana;
	font-size:11px;
}

.table1 { 
  border: 1px #AAAAAA solid; 
  font-family: tahoma; 
  font-size: 11px; 
  
  background-color:#CCCCCC;
} 
.table2 { 
  border: 1px #AAAAAA solid; 
  font-family: tahoma; 
  font-size: 11px;

  background-color:#DDDDDD;
} </style>
<body>

<h1><center>Forums integrator v. 1.1</center></h1>
<B>Requirements</B>: PHP5 (PHP4 is also possible, see below), installed punBB or phpBB<BR>
<B>Author</B>: Piotr Malinski, www.english.rk.edu.pl, <a href="mailto:hide@address.com">hide@address.com</a><BR><BR>

This classes can asses punBB and phpBB data about users. You can check if user is logged in, register, login and logout users. You can use these classes to create a script which will use punbb/phpbb user system or to integrate other scripts that have their own user system with forums.<BR><BR>

<center><table width="90%" border="1" cellspacing="0" cellpadding="0">

<tr><td width="170" class="table2"><center><B>-</B></center></td><td class="table2"><center><B>phpBB</B></center></td><td class="table2"><center><B>punBB</B></center></td></tr>

<tr><td width="170" class="table1"><center><B>Start class</B></center></td><td class="table1"><code><span style="color: #000000">
<span style="color: #007700">$x= new </span><span style="color: #0000BB">phpbb</span><span style="color: #007700">(</span><span style="color: #DD0000">'patch/to/phpbb/'</span><span style="color: #007700">); </span></span>
</code></td><td class="table1"><code><span style="color: #000000">
<span style="color: #007700">$x= new </span><span style="color: #0000BB">punbb</span><span style="color: #007700">(</span><span style="color: #DD0000">'patch/to/punbb/'</span><span style="color: #007700">);<br />eval(</span><span style="color: #0000BB">$x</span><span style="color: #007700">-></span><span style="color: #0000BB">set_define</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">$x</span><span style="color: #007700">-></span><span style="color: #0000BB">set_variables</span><span style="color: #007700">(</span><span style="color: #0000BB">$pun_user</span><span style="color: #007700">, </span><span style="color: #0000BB">$pun_config</span><span style="color: #007700">); </span></span>
</code></td></tr>
<tr><td width="170" class="table1"><center><B>Check login</B><BR>Returns true if you are logged in, false if not</center></td><td class="table1"><code><span style="color: #007700">$x-></span><span style="color: #0000BB">check_login</span><span style="color: #007700">(); </span>
</span>
</code></td><td class="table1"><code><span style="color: #000000">
<span style="color: #007700">$x-></span><span style="color: #0000BB">check_login</span><span style="color: #007700">(); </span>
</span>
</code></td></tr>
<tr><td width="170" class="table1"><center><B>Logout</B><BR>Logouts current user</center></td><td class="table1"><code><span style="color: #000000">
<span style="color: #007700">$x-></span><span style="color: #0000BB">logout</span><span style="color: #007700">(); </span>
</span>
</code></td><td class="table1"><code><span style="color: #000000">
<span style="color: #007700">$x-></span><span style="color: #0000BB">logout</span><span style="color: #007700">(); </span>
</span>
</code></td></tr>
<tr><td width="170" class="table1"><center><B>Login</B><BR>Login user based on suplied password and login</center></td><td class="table1"><code><span style="color: #000000"><span style="color: #007700">$x-></span><span style="color: #0000BB">login</span><span style="color: #007700">(</span><span style="color: #0000BB">$login</span><span style="color: #007700">, </span><span style="color: #0000BB">$pass</span><span style="color: #007700">); </span></span></code><BR><BR>on success returns an array of loggedin user</td><td class="table1"><code><span style="color: #000000"><span style="color: #007700">$x-></span><span style="color: #0000BB">login</span><span style="color: #007700">(</span><span style="color: #0000BB">$login</span><span style="color: #007700">, </span><span style="color: #0000BB">$pass</span><span style="color: #007700">); </span></span></code></td></tr>
<tr><td width="170" class="table1"><center><B>Register</B><BR>Registers a new active account</center></td><td class="table1"><code><span style="color: #000000"><span style="color: #007700">$x-></span><span style="color: #0000BB">register</span><span style="color: #007700">(</span><span style="color: #0000BB">$login</span><span style="color: #007700">, </span><span style="color: #0000BB">$pass</span><span style="color: #007700">, </span><span style="color: #0000BB">$email</span><span style="color: #007700">);</span></code><BR>You may pass optional 4th argument - 0<BR>to make the account inactive (but the activation mail won't be send)</td><td class="table1"><code><span style="color: #000000"><span style="color: #007700">$x-></span><span style="color: #0000BB">register</span><span style="color: #007700">(</span><span style="color: #0000BB">$login</span><span style="color: #007700">, </span><span style="color: #0000BB">$pass</span><span style="color: #007700">, </span><span style="color: #0000BB">$email</span><span style="color: #007700">);</span></code></td></tr>
<tr><td width="170" class="table1"><center><B>Is Admin, Is User ?</B><BR>Returns True if current user is admin/user, False if not.</center></td><td class="table1"><code><span style="color: #000000"><span style="color: #007700">$x-></span><span style="color: #0000BB">is_admin</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$x</span><span style="color: #007700">-></span><span style="color: #0000BB">is_user</span><span style="color: #007700">(); </span></span></code></td><td class="table1"><code><span style="color: #000000"><span style="color: #007700">$x-></span><span style="color: #0000BB">is_admin</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$x</span><span style="color: #007700">-></span><span style="color: #0000BB">is_user</span><span style="color: #007700">(); </span></span></code></td></tr>
</table></center>
<BR>

<B><h2>punBB EXTRAS</h2></B>
- <B>User/Forum data</B>: after starting the class you have access to arrays: <B>$pun_user</B> - contains data about current user and <B>$pun_config</B> - forum settings.<BR>
- <B>Login form</B>: <B>$x->login_form();</B> - shows a login form which points to punBB login page, will redirect to the current page.<BR>
- <B>Database access</B>: <B>$x->query($sql);</B> - execute a SQL query, if SELECT will return an assoc array.<BR><BR>

<B><h2>phpBB EXTRAS</h2></B>
- <B>Forum data</B>: <B>$x->board_config();</B> - returns an array with general forum data<BR>
- <B>User data</B>: <B>$x->get_user_data();</B> - returns an array with data about current user.<BR><BR>

<B>IPB</B> - for a integrating class for Invision Power Board check IPB SDK.







</body></html>
Return current item: Forums Integrator