Website/ board intigration

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.
wGEric
Former Team Member
Posts: 8805
Joined: Sun Oct 13, 2002 3:01 am
Location: Friday
Name: Eric Faerber
Contact:

Post by wGEric »

You aren't using a template is the problem.
Eric
Astaldaran
Registered User
Posts: 41
Joined: Thu Apr 17, 2003 11:01 pm
Contact:

Post by Astaldaran »

I still don't get it, isn't a template file just html that spits out the data from the php script. So why do you need a seperate page. I don't get it... I mean isn't that what the code for is in that tutorial i listed earlier, isn't that the part of the template i need to use?
Astaldaran
Registered User
Posts: 41
Joined: Thu Apr 17, 2003 11:01 pm
Contact:

Post by Astaldaran »

How does the login work. Basicly i want to know how so i can add the log on fields to my main site.


I also want to be able to display new topics
User avatar
Smidge204
Registered User
Posts: 23
Joined: Sun Feb 09, 2003 8:50 am

Post by Smidge204 »

Easiest (?) way, or at least the way I'd do it, would be to:

1) Look at the HTMl that makes up the login form
2) Peek at the login.php file and see how it handles the input from the form

For example, I see int he login page:

Code: Select all

<input type="submit" name="login" class="mainoption" value="Log in">
Which means I'd expect a $HTTP_POST_VARS['submit'] in there somewhere, and checking the value for "Log In" close by.

This is the true hacking experience - getting up to your armpits in code, figuring otu how it all works and massaging it to do what you want! :wink:
=Smidge=
Antony
Registered User
Posts: 529
Joined: Wed Feb 12, 2003 9:06 am

Post by Antony »

I've Been Banned!
Astaldaran
Registered User
Posts: 41
Joined: Thu Apr 17, 2003 11:01 pm
Contact:

Post by Astaldaran »

THanks!!!

i have had some errors but are working them out!

Two however im not sure of

Error:
"

Warning: Cannot modify header information - headers already sent by (output started at /home/wesley/public_html/index2.php:12) in /home/wesley/public_html/boards/includes/sessions.php on line 293

Warning: Cannot modify header information - headers already sent by (output started at /home/wesley/public_html/index2.php:12) in /home/wesley/public_html/boards/includes/sessions.php on line 294


"


any ideas?
User avatar
GPHemsley
Registered User
Posts: 1475
Joined: Fri Apr 18, 2003 3:12 am
Location: Long Beach, NY
Name: Gordon Hemsley
Contact:

Post by GPHemsley »

Make sure there are no spaces after the ?> in sessions.php
Astaldaran
Registered User
Posts: 41
Joined: Thu Apr 17, 2003 11:01 pm
Contact:

Post by Astaldaran »

nope, i checked.


these are the two lings of code that don't work

line 1

setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);


line 2

setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);
wGEric
Former Team Member
Posts: 8805
Joined: Sun Oct 13, 2002 3:01 am
Location: Friday
Name: Eric Faerber
Contact:

Post by wGEric »

Do you have the session stuff at the very top of your page? No HTML tags above it? If you do then it sends information to the browser and it can't do the sessions.

I was looking at your site and it looks like you have all of this above it

Code: Select all

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
<meta name="Microsoft Theme" content="artsy 000, default">
<meta name="Microsoft Border" content="tlb, default">
</head>

<body bgcolor="#000000" text="#FFFFCC" link="#FF9900" vlink="#999900" alink="#669933"><!--msnavigation--><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td><!--mstheme--><font face="Arial, Helvetica"><p><img src="images/logo.gif"
alt="[Company Logo Image]" border="0" width="120" height="24">
 <font size="6" color="#FF0000"><img border="0" src="_borders/redemption_ohio_logo_kings.jpg" width="550" height="286">.com</font> </p>
Try putting the session stuff above that and it should work.
Eric
Astaldaran
Registered User
Posts: 41
Joined: Thu Apr 17, 2003 11:01 pm
Contact:

Post by Astaldaran »

Ok here a question


Lets say i have a site with 3 frames.

1 frame is a menu with links and stuff
another frame is the header frame with the logo and such

the last frame displays the age you are currently looking at.


Question:

How would i make it so that when you go to my boards, the boards show up in the last frame but the default boards header is not loaded?


I assume it is done by where it says "include("includes/header.php")" or whatever .. am i right? further on would i have to take this out of every page? or jsut the index?bascialy when and where is the header.php loaded at? is it loaded when you first go to the boards (index.php) or is it loaded on everypage?
Astaldaran
Registered User
Posts: 41
Joined: Thu Apr 17, 2003 11:01 pm
Contact:

Post by Astaldaran »

ok well i think i can figure out the above desently easy (trial and error) but was jsut wondering if anyone new. Now im wondering about soem otehr stuff. Lets say I use frames for my site (as described above) if i have login information and such on the menu frame. Will it know that I am logged in in the other frames? I mean i know they are different pages but its being used with the same browser, and isn't it teh browser that keeps track of cookies and stuff? Another question concerning this, in every page do i have to add the icludes and all that stuff? or can jsut the menu frame having it work? On the first i would thnik teh browser keeps track but on the second i think i would have to restate all this data for everypage. :(
wGEric
Former Team Member
Posts: 8805
Joined: Sun Oct 13, 2002 3:01 am
Location: Friday
Name: Eric Faerber
Contact:

Post by wGEric »

Just about every page includes the page_header.php if that answers your question.

To keep your sessions going you will have to put the includes and sessions at the top of every page.
Eric
Astaldaran
Registered User
Posts: 41
Joined: Thu Apr 17, 2003 11:01 pm
Contact:

Post by Astaldaran »

ok, im going to look into nested frames.
Astaldaran
Registered User
Posts: 41
Joined: Thu Apr 17, 2003 11:01 pm
Contact:

Post by Astaldaran »

ok if i want the persons username (taht is logged in) is it just this $userdata[username] ? I only see one plcae where this is defined is in common.php with this " $userdata = array(); " and then in my file again (this is a file i made, i coppied this part)


$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);

that is near the begining. Can anyone brake it down and explain exactly what it does?

for example whats the page index? and whats the init_userprefs and session_pagestart, what are these? if there is a place where i can look up all this stuff a link would be appreciated ! :)
wGEric
Former Team Member
Posts: 8805
Joined: Sun Oct 13, 2002 3:01 am
Location: Friday
Name: Eric Faerber
Contact:

Post by wGEric »

Astaldaran wrote: ok if i want the persons username (taht is logged in) is it just this $userdata[username] ? I only see one plcae where this is defined is in common.php with this " $userdata = array(); " and then in my file again (this is a file i made, i coppied this part)


That is where all userdata is kept. I think every field in the users table is kept in that so all you have to do is put $userdata['website'] (not real) for their website.
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);

that is near the begining. Can anyone brake it down and explain exactly what it does?

for example whats the page index?


Thats the constant for what page they are on. Defined in the constants.php and is used by the Who's Online and in the ACP.
and whats the init_userprefs and session_pagestart, what are these?


init_userprefs() gets the users prefrences for your board (theme, language, dateformat, ect). session_pagestart() gets the sessions started for that page. Also updates where they are and last visit time for the user.
if there is a place where i can look up all this stuff a link would be appreciated ! :)


phpBB doesn't have any docs on these things and no one else has written them. This needs to be done so it can help MOD Authors.
Eric
Post Reply

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