User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 397,852 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,328 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 3291 | Replies: 2
Join Date: Feb 2007
Posts: 13
Reputation: hyperoctave is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
hyperoctave's Avatar
hyperoctave hyperoctave is offline Offline
Newbie Poster

Troubleshooting Embedding a PHPBB forum into your website : Problems/Solutions

  #1  
Nov 15th, 2007
I will start this thread with a problem that I am trying to solve. I have searched for a solution, and can't find one, and daniweb.com users have been a great help in the past. This is a tricky one for me.. I hope we can find a solution.

All of these problems relate to www.hyperoctave.org (if you need to have a look)

Question 1:

Is it possible to embed a PHPBB forum into my website using the <include> tag?

problem..
I have tried this, but I get errors. this code is in index.php (for example)

<head>
<?php 
  
$page= $_GET["page"];                                                 //get the variable from the URL
 $subcode = file_get_contents($page);                     //load the file into a variable

?>
</head>

Then at content location:
<div id="sub_content"><?php echo($subcode) ?> </div>

So, then I would change the url to index.php?page=forum/index.php

*hoping* that the forum would appear in the sub_content div, but instead - a whole page of code appears, eventually crashing with the message
Not Found
The requested URL /.append_sid( was not found on this server.

So, currently, I am using the <iframe> tag to embed my forum, which is fine, but if anyone has a solution to this problem, that would be great!

Question 2:

is there a way to use this.href to control what an <iframe> is showing?

problem..
Since google and other search engines are linking directly to my forum, if people open the links, they will go to the forum without the rest of the website around it! So, here is my plan.. (that I need assistance with..)

If the user goes to the forum index, I have included the code

<script language = "Javascript" type = "text/javascript">
if (top.location == self.location)
{
self.location.replace ("http://www.hyperoctave.org/forum.php")
}
</script>

This will open up the index page with the forum in the <iframe>

Simple! But.. this only works for the forum index.. If someone is linked to an actual forum thread, and I want the link to open the thread with the index page around it, I need some more specific code.. any ideas so far?

The problem is, that even if I include the javascript above into the relevant pages within the forum (viewforum.php, viewtopic.php), they would link to the index page, which has the <iframe> with the command to open the forum index! So no matter what page they arrive at, they will be directed to the forum index.. this isn't very good.

So, I'm thinking along the lines of a javascript redirect code, that will open whatever sub page, within the master page. I think that Iframes make this difficult, but if anyone has any suggestions, I'm eager to discuss this and solve it..

Thanks!
Last edited by hyperoctave : Nov 15th, 2007 at 9:33 am.
AddThis Social Bookmark Button
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 8:19 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC