| | |
Embedding a PHPBB forum into your website : Problems/Solutions
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
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)
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
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!
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)
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<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
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<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 10:33 am.
ultimately, I'm thinking that my urls should be more like
http://www.hyperoctave.org/forum.php...opic.php?t=229
if I could embed the forum using the include tag, this would probably work..
so I'm thinking, if I could use javascript to put the suffix
forum.php?page=forum/
on every thread url
then it would work.. but I've tried various methods..
http://www.hyperoctave.org/forum.php...opic.php?t=229
if I could embed the forum using the include tag, this would probably work..
so I'm thinking, if I could use javascript to put the suffix
forum.php?page=forum/
on every thread url
then it would work.. but I've tried various methods..
Stephen Arnold
www.hyperoctave.org
www.hyperoctave.org
I have been getting some emails from people about this problem.. There is no need to contact me about this, I still haven't solved this problem, and to be honest, I don't think that it is possible, however, I have found a way around it, that looks just fine:
I am still using frames on my website, but I have taken away the borders and added transparency, and the code that triggers the onload resize javascript:
<iframe width="800px" id="iframe_id" name="iframe_name" src="http://www.hyperoctave.org/forum/" scrolling="no" frameborder="0" ALLOWTRANSPARENCY="true" onload=resize_iframe();></iframe>
I have also included an iframe resize javascript code, that is controlled by the child window.
<script type="text/javascript">
<!--
moz=document.getElementById&&!document.all
mozHeightOffset=20
function resize_iframe(){
document.getElementById("iframe_id").height="" // required for Moz bug, value can be "", null, or integer
document.getElementById('iframe_id').height=window.frames["iframe_name"].document.body.scrollHeight+(moz?mozHeightOffset:0)
}
// -->
</script>
and also added a code so that if the forum is the parent page, it is automatically replaced with the website around it.. (place this code in the top of index.php in your forum folder)
<script>
if (top.location == self.location)
{
self.location.replace ("http://www.hyperoctave.org/forum.php")
}
</script>
I am still using frames on my website, but I have taken away the borders and added transparency, and the code that triggers the onload resize javascript:
<iframe width="800px" id="iframe_id" name="iframe_name" src="http://www.hyperoctave.org/forum/" scrolling="no" frameborder="0" ALLOWTRANSPARENCY="true" onload=resize_iframe();></iframe>
I have also included an iframe resize javascript code, that is controlled by the child window.
<script type="text/javascript">
<!--
moz=document.getElementById&&!document.all
mozHeightOffset=20
function resize_iframe(){
document.getElementById("iframe_id").height="" // required for Moz bug, value can be "", null, or integer
document.getElementById('iframe_id').height=window.frames["iframe_name"].document.body.scrollHeight+(moz?mozHeightOffset:0)
}
// -->
</script>
and also added a code so that if the forum is the parent page, it is automatically replaced with the website around it.. (place this code in the top of index.php in your forum folder)
<script>
if (top.location == self.location)
{
self.location.replace ("http://www.hyperoctave.org/forum.php")
}
</script>
Stephen Arnold
www.hyperoctave.org
www.hyperoctave.org
![]() |
Similar Threads
- need a tutorial on how to setup a forum (PHP)
- Advertising on CE7.net (Free forum service, 23k uniques, 780k hits) - stats provided! (Ad Space for Sale)
- Textlink ads on free forum/blog service - $4/mth - 10,000+ uniques/month (Ad Space for Sale)
- I need help ASAP!!! (Growing an Online Community)
- unique design using phpBB forum for sale (Websites for Sale)
- Cannot install phpBB on Win2K & MySql (Growing an Online Community)
- My phpbb forum doesnt work ? (PHP)
- Forum moderators & adding phpbb mods (Web Development Job Offers)
- Shine Media Group - Company Website (Website Reviews)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: form validation
- Next Thread: debugging?
| Thread Tools | Search this Thread |
acid2 ajax ajaxexample ajaxjspservlets array browser bug captchaformproblem cart checkbox child class close codes createrange() css cursor date debugger decimal dependent design disablefirebug dom dropdown editor element embed engine enter error events explorer ext file firefox focus form forms frameworks getselection google gxt hiddenvalue highlightedword hint html ie7 ie8 iframe images index internet java javascript javascripthelp2020 jquery jsf jsfile jsp jump libcurl listbox maps masterpage math media menu mp4 object onmouseoutdivproblem onmouseover onreadystatechange parent paypal pdf php position post problem programming progressbar prototype redirect runtime safari scale scriptlets scroll search security shopping size software toggle unicode w3c web wysiwyg \n





