Has anyone worked out how to have icons instead of those square border things?
26 2005-04-06 01:02
Topic: Icons (1 replies, posted in PunBB 1.2 modifications, plugins and integrations)
27 2005-04-03 16:46
Re: Integrating logins (15 replies, posted in PunBB 1.2 modifications, plugins and integrations)
If you look at login.php you can get what you need.
You could also use PunBB's register page as your register script then have the login box on your page... like so,
include this on everypage you want to use PunBB cookies.
<?php
$punbb_path = $_SERVER['SCRIPT_FILENAME'];
$punbb_split = explode('/',$punbb_path);
$punbb_page = end($punbb_split);
$punbb_count = substr_count($punbb_path,'/')-2;
$punbb_path = str_repeat('../',$punbb_count).'./forum/';
define('PUN_ROOT', "$punbb_path");
require PUN_ROOT.'include/common.php';
define('PUN_TURN_OFF_MAINT', 1); // if forums go down the site will not
define('PUN_QUIET_VISIT', 0); // update last visit when outside of the forums
?>
The first 5 lines is something i made. Becuase the path has to be relative and my site spans lots of pages in lots of folders i take the current filename, do some PHP magic and then it gets the relative path to PUNBB... cool huh?
NOTE: my forum is in /forum/ is yours is different change './forum/' like this './<PATH_TO_MY_FORUM>/'
for the login form you can do this.
<form id="login" method="post" action="/forum/login.php?action=in" onsubmit="return process_form(this)">
<input type="hidden" name="form_sent" value="1" />
<input type="hidden" name="redirect_url" value="<?php echo $_SERVER['SCRIPT_NAME'] ?>" />
<input type="text" name="req_username" size="25" maxlength="25" />
<input type="password" name="req_password" size="16" maxlength="16" />
<input type="submit" name="login" value="Login" />
</form>
Change
action="/forum/login.php?action=in"
to the location of you script.
Also note,
<input type="hidden" name="redirect_url" value="<?php echo $_SERVER['SCRIPT_NAME'] ?>" />
This will redirect you to the page you were on and not to the forum index. you can remove this if you want.
You can also check you settings using
<pre>
<?php print_r($pun_user)?>
</pre>
This will print the $pun_user array so you can see what settings to use.
EXAMPLE:
if user is logged in display welcome message else display login form
if($pun_user['id'] > 1)
{
echo "Welcome Message";
}
else
{
echo "Login Form";
}
?>
Since guests use 1 as there ID you can use >1 to see if there not a guest.
Anyway, hope that helped.
_Chris