sorry

127

(2 replies, posted in Programming)

So I have made this login box using a tutorial by user ontap.  It allows me to login to my punbb forum from anywhere on my site by having this login box always in the menu bar of my main site.

I am very happy with it except that when I include it in my html homepage it uglies up the look...is there anyway of formatting php functions like this....is there a way of previewing php without uploading it to a webserver.  This would help.

I want it to be a nice looking login box not ust plain and ugly white and grey.  And also to say login and logout next to each box.


any help would be great.

Cheers

Nick

<?php

function login_menu() {

global $pun_user;

if ($pun_user['is_guest']) {
  echo "<form id=\"login\" method=\"post\" action=\"/pun/login.php?action=in\" onsubmit=\"return process_form(this)\">
<input type=\"hidden\" name=\"form_sent\" value=\"1\" />
<input type=\"hidden\" name=\"redirect_url\" value=\"".$_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>";

echo '<a href="/pun/register.php">Need to register.</a>';
echo '<a href="/pun/login.php?action=forget">Forgot your password.</a>';

}

else {
echo "Logged in as: ".pun_htmlspecialchars($pun_user['username'])."
<br>Click <a href=\"/pun/login.php?action=out&id=".$pun_user['id']."&location_out=".$_SERVER['SCRIPT_NAME']."\">here</a> to log out.</div>";
}


}

?>

Hi

am in the process of building a community website....would like to make my own style for punbb...I can see there is a lot out there on this but ust wondered what peoples opinions were of the best recourses out there for getting started with punbb styles

Cheers

Nick

So I have made this login box using a tutorial by user ontap.  It allows me to login to my punbb forum from anywhere on my site by having this login box always in the menu bar of my main site.

I am very happy with it except that when I include it in my html homepage it uglies up the look...is there anyway of formatting php functions like this....is there a way of previewing php without uploading it to a webserver.  This would help.

I want it to be a nice looking login box not ust plain and ugly white and grey.  And also to say login and logout next to each box.


any help would be great.

Cheers

Nick

<?php

function login_menu() {

global $pun_user;

if ($pun_user['is_guest']) {
  echo "<form id=\"login\" method=\"post\" action=\"/pun/login.php?action=in\" onsubmit=\"return process_form(this)\">
<input type=\"hidden\" name=\"form_sent\" value=\"1\" />
<input type=\"hidden\" name=\"redirect_url\" value=\"".$_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>";

echo '<a href="/pun/register.php">Need to register.</a>';
echo '<a href="/pun/login.php?action=forget">Forgot your password.</a>';

}

else {
echo "Logged in as: ".pun_htmlspecialchars($pun_user['username'])."
<br>Click <a href=\"/pun/login.php?action=out&id=".$pun_user['id']."&location_out=".$_SERVER['SCRIPT_NAME']."\">here</a> to log out.</div>";
}


}

?>

130

(1 replies, posted in PunBB 1.2 troubleshooting)

Hey no worries I figured it out in the end

just had to learn a bit of php smile

131

(1 replies, posted in PunBB 1.2 troubleshooting)

So I have a login box that appears on the title page of every page on my site (thanks to ontap for his tutorial).

It has a login/logout and says if you are logged in or not....I also have a link to "forgot your password" and "need to register"....basically what I want to have is these two links (forgot password and register) dissappear if the user is logged in (as they are not necessary anymore).



Here is my code:

this is for the homepage file:

<p>
<a href="http://www.mysite.com/forum/register.php" tabindex="4">not registered?</a><br />
<a href="http://www.mysite.com/forum/login.php?action=forget" tabindex="5">forgot your password?</a>
</p>

<p><?php

define('PUN_ROOT', './pun/');
include './pun/include/common.php';
include './login_function.inc.php';

login_menu();

?></p>

the homepage file calls this function:

<?php

function login_menu() {

global $pun_user;

if ($pun_user['is_guest']) {
  echo "<form id=\"login\" method=\"post\" action=\"/pun/login.php?action=in\" onsubmit=\"return process_form(this)\">
<input type=\"hidden\" name=\"form_sent\" value=\"1\" />
<input type=\"hidden\" name=\"redirect_url\" value=\"".$_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>";
    }
    
else {
echo "Logged in as: ".pun_htmlspecialchars($pun_user['username'])."
<br>Click <a href=\"/pun/login.php?action=out&id=".$pun_user['id']."&location_out=".$_SERVER['SCRIPT_NAME']."\">here</a> to log out.</div>";
}

}
?>

any help would be great

I'm a total noob so please be patient.

cheers
Nick

First off I am a total noob to this - I am trying to setup a portal for illustrators that has a forum and a gallery where users can upload there own illustrations and post stuff in the forum (i was thinking of using coppermine for the photogallery stuff).

One thing that I need to be able to do is have a sort of global login on the main page (like on www.cgsociety.org) that when you login there you are then logged into the forums and the galleries and all the features that require you to be logged into to use.

How on earth do I do this...what should I read to work this out?

Any help would be great

Cheers
Nick