Integrating login screen

This forum is now closed as part of retiring phpBB2.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
Post Reply
User avatar
Elias
Registered User
Posts: 4625
Joined: Sat Feb 25, 2006 4:31 pm
Location: In the Water!
Name: Elias

Integrating login screen

Post by Elias » Sun Mar 16, 2008 4:49 pm

Alright i am trying to follow this KB article: http://www.phpbb.com/kb/article/phpbb2- ... tegration/

I would like it to appear on my index page. Do i place the code in from of all my template codes? As my index is build with CSS and html. Do i put :

Code: Select all

<?php
define('IN_PHPBB', true);
$phpbb_root_path = './forum/';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
?>
In front of ALL the code lines?
"Mystery creates wonder, and wonder is the basis of man's desire to understand." - Neil Armstrong
|Installing Extensions|Writing Extensions|Extension Validation Policy|

User avatar
Lumpy Burgertushie
Registered User
Posts: 66848
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Integrating login screen

Post by Lumpy Burgertushie » Mon Mar 17, 2008 1:37 am

in front of what code lines?

you put that at the very top of any file that you want to be able to use phpbb sessions, etc.

it would be better if you showed us the file you are trying to use the phpbb stuff in .

robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
Elias
Registered User
Posts: 4625
Joined: Sat Feb 25, 2006 4:31 pm
Location: In the Water!
Name: Elias

Re: Integrating login screen

Post by Elias » Mon Mar 17, 2008 1:40 am

It is my html index file. I have a index.html file that runs my forum template.
So i just put that code at the very top?
"Mystery creates wonder, and wonder is the basis of man's desire to understand." - Neil Armstrong
|Installing Extensions|Writing Extensions|Extension Validation Policy|

User avatar
Lumpy Burgertushie
Registered User
Posts: 66848
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Integrating login screen

Post by Lumpy Burgertushie » Mon Mar 17, 2008 1:49 am

EY wrote:It is my html index file. I have a index.html file that runs my forum template.
So i just put that code at the very top?
can you paste the code here for us to see?

also, you will have to rename the file to index.php for it to work.

robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
Elias
Registered User
Posts: 4625
Joined: Sat Feb 25, 2006 4:31 pm
Location: In the Water!
Name: Elias

Re: Integrating login screen

Post by Elias » Mon Mar 17, 2008 1:54 am

Ah okay then forget it it wont work anymore.
Thanks anyways for the help.
"Mystery creates wonder, and wonder is the basis of man's desire to understand." - Neil Armstrong
|Installing Extensions|Writing Extensions|Extension Validation Policy|

User avatar
Lumpy Burgertushie
Registered User
Posts: 66848
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Integrating login screen

Post by Lumpy Burgertushie » Mon Mar 17, 2008 1:59 am

EY wrote:Ah okay then forget it it wont work anymore.
Thanks anyways for the help.
sure it will, all you have to do is rename the index.html file to index.php and it will still work.

you do not have to change anything at all.

you make a file a php file by naming it whatever.php

robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
Lumpy Burgertushie
Registered User
Posts: 66848
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Integrating login screen

Post by Lumpy Burgertushie » Mon Mar 17, 2008 2:00 am

once again,

if you will show me the code you have for your html file, I will show you how to do this.

robrert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
Elias
Registered User
Posts: 4625
Joined: Sat Feb 25, 2006 4:31 pm
Location: In the Water!
Name: Elias

Re: Integrating login screen

Post by Elias » Mon Mar 17, 2008 2:21 am

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>

<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
<meta name="description" content="Free Hosting with cpanel and FTP"/>
<meta name="keywords" content="Free Hosting,Free,Cpanel,FTP,Support,Free hosting with cpanel and FTP,Free Hosting with FTP,Free Hosting with cpanel"/> 
<meta name="author" content="EYzoR"/> 
<link rel="stylesheet" type="text/css" href="default.css" media="screen"/>
<title>KlurX Free Hosting</title>
</head>

<body>

<div class="top">
				
	<div class="header">

		<div class="left">
			
		</div>
		
		<div class="right">

			<h2>No ads!</h2>
			
			<p>We offer free hosting with no forced ads! Join us today!</p>

		</div>

	</div>	

</div>

<div class="container">	

	<div class="navigation">
		<a href="http://klurx.com/index.html">Home</a>
		<a href="http://klurx.com/forum">Forums</a>
		<a href="http://klurx.com/terms.html">Terms</a>
		<a href="http://klurx.com/forum/viewforum.php?f=4">Get Hosted</a>
		<a href="http://klurx.com/forum/viewforum.php?f=6">Support</a>
		<div class="clearer"><span></span></div>
	</div>

	<div class="main">		
		
		<div class="content">

			

			<p>I would like to welcome everyone to KlurX. Who are we you may ask? We are here to provide people not able to pay or people that do not want to waste money on hosting free hosting with NO forced ads! </p>
			
			<h1>How To Request Free Webhosting:</h1>

			<p>We offer free webhosting. What you need to do is meet the requirements to request the plan you desire. Posting and earning credit on our forum is the way we will work. This means when you post on our forums you earn credits. With those credits you will be able to pay off your plan!</p>

			<ul>
				<li>Ad Free</li>
				<li>Fast Setup</li>
				<li>Fast Support</li>
			</ul>

			<p>We will also offert support if you need a Bultin Board installed for you or if you need modifications install on your board or scripts. We will also guide you threw if you would like to do it yourself.</p>

			<h1>Terms of Service</h1>

			<ul>
				<li>No Illegal Use(User will be banned for illegal use)</li>
				<li>NO spam (User will be banned for spam)</li>
				<li>No Background processes</li>
				<li>No Proxy sites</li>
			</ul>
			
			<ul>
			<li><a href="terms.html">Read The Rules</a></li>
			</ul>

		</div>

		<div class="sidenav">

			<h2>KlurX Host</h2>
			<ul>
				<li><a href="http://klurx.com/index.html">Plans</a></li>
				<li><a href="http://klurx.com/terms.html">Terms</a></li>
				<li><a href="http://klurx.com/forum/viewforum.php?f=4">Host Request</a></li>
				<li><a href="http://klurx.com/advertise.html">Advertise On KlurX.com</a></li>
			</ul>

		</div>

		<div class="clearer"><span></span></div>

	</div>

	<div class="footer">&copy; 2008 <a href="http://klurx.com">Klurx.com</a>. Valid <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a> & <a href="http://validator.w3.org/check?uri=referer">XHTML</a>. Template design by <a href="http://klurx.com">Klurx Hosting!</a>
	</div>

</div>

</body>

</html>
So renaming it to .php will not bother anything at all?
"Mystery creates wonder, and wonder is the basis of man's desire to understand." - Neil Armstrong
|Installing Extensions|Writing Extensions|Extension Validation Policy|

User avatar
Lumpy Burgertushie
Registered User
Posts: 66848
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Integrating login screen

Post by Lumpy Burgertushie » Mon Mar 17, 2008 2:30 pm

assuming that you want is a login box on this page that will log you into the board, try this:

Code: Select all

<?php

define('IN_PHPBB', true);
$phpbb_root_path = './phpBB2/';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
?>  

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html>

    <head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
    <meta name="description" content="Free Hosting with cpanel and FTP"/>
    <meta name="keywords" content="Free Hosting,Free,Cpanel,FTP,Support,Free hosting with cpanel and FTP,Free Hosting with FTP,Free Hosting with cpanel"/>
    <meta name="author" content="EYzoR"/>
    <link rel="stylesheet" type="text/css" href="default.css" media="screen"/>
    <title>KlurX Free Hosting</title>
    </head>

    <body>

    <div class="top">
                
       <div class="header">

          <div class="left">
<?
		  if( $userdata['session_logged_in'] )
{
   

   // put your html or php code here the following is an example
   // you would need to at least change the redirect from test.php  to whatever page
   //you want to redirect to.
   echo "Welcome $userdata[username]!<br />";
   echo '<a href="' . append_sid($phpbb_root_path . 'login.'.$phpEx.'?logout=true&redirect=../index.php&sid=' . $userdata['session_id']) . '">Click Here</a> to logout';
}
else
{
 echo "Please Log IN!<br />";
//login boxes
//edit this  to reflect the path to login.php
//and to reflect the redirect  you want.
echo '
<table width="100%"><center>
                   </b><tr>
                   <td align="center"><strong>Username:</strong></td></tr><tr>
              <td align="center"><form action="/phpBB2/login.php" method="post"><input type="text" name="username" class="textarea" size="18"></td>
                   </tr>
                   <tr>
                   <td align="center"><strong>Password:</strong></td></tr><tr>
                   <td align="center"><input type="password" name="password" class="textarea" size="18"></td>
                   </tr>
                <tr>
      <td align="center"><span class="gen"><font size="2">Log me on automatically each visit:</font></td></tr><tr><td align="center"><input type="checkbox" name="autologin" /></span></td>
       </tr>
                   <tr>
                   <td align="center"><input type="submit" value="login" name="login" class="textarea"><input type="hidden" value="../hello.html" name="redirect"></form></td>
                   </tr>
                <tr>
    <td align="center"><span class="gensmall"><a href="/phpBB2/profile.php?mode=sendpassword" class="gensmall">I forgot my password</a></span></td>
       </tr>
       <tr>
      <td align="center"><a href="/phpBB2/profile.php?mode=register" target="_blank">Click here to register</a></span></td></tr></center></table>
  ';
}

?>
             
          </div>
          
          <div class="right">

             <h2>No ads!</h2>
             
             <p>We offer free hosting with no forced ads! Join us today!</p>

          </div>

       </div>   

    </div>

    <div class="container">   

       <div class="navigation">
          <a href="http://klurx.com/index.html">Home</a>
          <a href="http://klurx.com/forum">Forums</a>
          <a href="http://klurx.com/terms.html">Terms</a>
          <a href="http://klurx.com/forum/viewforum.php?f=4">Get Hosted</a>
          <a href="http://klurx.com/forum/viewforum.php?f=6">Support</a>
          <div class="clearer"><span></span></div>
       </div>

       <div class="main">      
          
          <div class="content">

             

             <p>I would like to welcome everyone to KlurX. Who are we you may ask? We are here to provide people not able to pay or people that do not want to waste money on hosting free hosting with NO forced ads! </p>
             
             <h1>How To Request Free Webhosting:</h1>

             <p>We offer free webhosting. What you need to do is meet the requirements to request the plan you desire. Posting and earning credit on our forum is the way we will work. This means when you post on our forums you earn credits. With those credits you will be able to pay off your plan!</p>

             <ul>
                <li>Ad Free</li>
                <li>Fast Setup</li>
                <li>Fast Support</li>
             </ul>

             <p>We will also offert support if you need a Bultin Board installed for you or if you need modifications install on your board or scripts. We will also guide you threw if you would like to do it yourself.</p>

             <h1>Terms of Service</h1>

             <ul>
                <li>No Illegal Use(User will be banned for illegal use)</li>
                <li>NO spam (User will be banned for spam)</li>
                <li>No Background processes</li>
                <li>No Proxy sites</li>
             </ul>
             
             <ul>
             <li><a href="terms.html">Read The Rules</a></li>
             </ul>

          </div>

          <div class="sidenav">

             <h2>KlurX Host</h2>
             <ul>
                <li><a href="http://klurx.com/index.html">Plans</a></li>
                <li><a href="http://klurx.com/terms.html">Terms</a></li>
                <li><a href="http://klurx.com/forum/viewforum.php?f=4">Host Request</a></li>
                <li><a href="http://klurx.com/advertise.html">Advertise On KlurX.com</a></li>
             </ul>

          </div>

          <div class="clearer"><span></span></div>

       </div>

       <div class="footer">&copy; 2008 <a href="http://klurx.com">Klurx.com</a>. Valid <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a> & <a href="http://validator.w3.org/check?uri=referer">XHTML</a>. Template design by <a href="http://klurx.com">Klurx Hosting!</a>
       </div>

    </div>

    </body>

    </html>
you can tweak it however you wish.

here are the basics;

1. the phpbb folder name is phpBB2, change it to whatever yours is.

2. it assumes that the index page is one level up from the phpbb folder.

3. It will redirect after login or logout , back to itself. If you wish to change where it redirects, simply edit the redirect lines in the code.

luck,
robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
Lumpy Burgertushie
Registered User
Posts: 66848
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Integrating login screen

Post by Lumpy Burgertushie » Mon Mar 17, 2008 2:31 pm

the only problem with renaming it from html to php is that any links you have to it will no longer work and will have to be changed.

it looks like this is a brand new page/site, so I don't think you have to worry about that.

robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
Elias
Registered User
Posts: 4625
Joined: Sat Feb 25, 2006 4:31 pm
Location: In the Water!
Name: Elias

Re: Integrating login screen

Post by Elias » Tue Mar 18, 2008 12:42 am

Alright i will try this out.
Thanks very much for the help!
"Mystery creates wonder, and wonder is the basis of man's desire to understand." - Neil Armstrong
|Installing Extensions|Writing Extensions|Extension Validation Policy|

Post Reply

Return to “[2.0.x] MOD Writers Discussion”