Embeding phpBB3 into my website

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
alex4orly
Registered User
Posts: 185
Joined: Thu May 24, 2018 10:32 pm
Location: Australia
Name: Alex Evans
Contact:

Embeding phpBB3 into my website

Post by alex4orly »

Hello all,

I am new here and have just (sort of) launched it in test mode with a few friends in my retairement village
Please visit this : http://www.beleuramyhome.org.au/forum.html

It is a Responsive site, with a master frame and layout grids and it works OK as embeded. The phpBB is launched here through a page with an iFrame in it, that's how it is loaded "Inside" the website itself.

The problem I have is in that, when a user is subscribed to a topic and gets notified, when they click on the link in that email, it takes them directly to the page, OUTSIDE of the website itself, for the age group I am part of, this becomes very confusing...

Any suggestion how to overcome this.
Maybe someone can tell me how to make a call from the email message and pass the URL including the parameters into an iFrame?

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

Re: Embeding phpBB3 into my website

Post by Lumpy Burgertushie »

the way to solve all those issues is to remove it from the iframe. what you need to do is to use that background image as the background image in phpbb.
then, copy the html for that top menu and put it in the overall_header.html file of whatever style you want to use. tweak the css etc. and you can have the exact same thing as you have now only without all the drawbacks of iframes.


robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
alex4orly
Registered User
Posts: 185
Joined: Thu May 24, 2018 10:32 pm
Location: Australia
Name: Alex Evans
Contact:

Re: Embeding phpBB3 into my website

Post by alex4orly »

Thanks for the feedback Robert,

A MASTER Frame doesn't work that way... There is NO HTML file on the website for the menu on the top.
Each page in the project includes the MASTER frame code in it including the top menu and the bottom bar.

The background image, I understand but this will NOT resolve this case

Thanks again
User avatar
Ger
Registered User
Posts: 2108
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

Re: Embeding phpBB3 into my website

Post by Ger »

It's the entire problem with frames: each frame is a page on it's own and thus can be accessed on it's own. Just like any other page on your site: http://www.beleuramyhome.org.au/mypdf/dogtherapy.html
Once somebody has this link (e.g. through Google, a bookmark or whatever) this can happen. This is the very reason most people moved away from frames around 2000 - 2005.
It was a good idea in the nineties, but it has many drawbacks.

So basically, without A LOT of hacking (what probably won't work on about 25% of the devices) we answer your question as to how enforcing your frame-based setup. Also, like explained, you shouldn't.

I think you'll be better off redesigning your website. Not just for phpBB, but also to overcome what I described in my first sentence.
My extensions:
Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update, Modern Quote, Quoted Where (GDPR) and Autoresponder.
Newest: FAQ manager for 3.2

Like my work? Buy me a coffee to keep it coming. :ugeek:

-Don't PM me for support-
alex4orly
Registered User
Posts: 185
Joined: Thu May 24, 2018 10:32 pm
Location: Australia
Name: Alex Evans
Contact:

Re: Embeding phpBB3 into my website

Post by alex4orly »

Hi Ger,

Have you ever tried to develop a website for the age group of 70-80?
The design is intended for this age group, none of them will ever attempt to access any page directly...

Thanks anyway
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26502
Joined: Fri Aug 29, 2008 9:49 am

Re: Embeding phpBB3 into my website

Post by Mick »

Ageism happens when people are defined not by their personality, individuality or beliefs but by their age. I find the comment about 70-80 year olds to be ageist and wrong. You may find out one day that these old buggers know more than you.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
alex4orly
Registered User
Posts: 185
Joined: Thu May 24, 2018 10:32 pm
Location: Australia
Name: Alex Evans
Contact:

Re: Embeding phpBB3 into my website

Post by alex4orly »

Sorry Mick, I didn't intend to be offensive here.
My apology
I am 73 years "Young" and a retired C++ / Web programmer for the time since 1974
I am sure - many know more than I do

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

Re: Embeding phpBB3 into my website

Post by Lumpy Burgertushie »

and you would be surprised by the ages of many of us here on this board including some of those on the support staff.

having looked at the code for your site I have to say that the web builder you used for creating it really makes a mess of code.

anyway, outside of a complete redesign, I don't know what you could do to fix it.

also, as long as you insist on putting phpbb inside a iframe you will not be able to get all those problems solved.
keep in mind that phpbb is not a simple html website. it is a dynamic website that has no html pages as such. it has templates that are comprised of html/css and php variables. the actual pages you see are created on the fly when you click the button to view them.


so, it is not going to work the same as all of your html pages that you are putting inside of frames etc.


robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26502
Joined: Fri Aug 29, 2008 9:49 am

Re: Embeding phpBB3 into my website

Post by Mick »

And don’t forget security, iframes have a habit of biting you in the bum.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
User avatar
Ger
Registered User
Posts: 2108
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

Re: Embeding phpBB3 into my website

Post by Ger »

alex4orly wrote: Tue May 29, 2018 7:56 am Hi Ger,

Have you ever tried to develop a website for the age group of 70-80?
The design is intended for this age group, none of them will ever attempt to access any page directly...

Thanks anyway
So none of them ever use a search engine?

Anyway, of you insist on this iframe approach, I can't offer you a solution.
My extensions:
Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update, Modern Quote, Quoted Where (GDPR) and Autoresponder.
Newest: FAQ manager for 3.2

Like my work? Buy me a coffee to keep it coming. :ugeek:

-Don't PM me for support-
alex4orly
Registered User
Posts: 185
Joined: Thu May 24, 2018 10:32 pm
Location: Australia
Name: Alex Evans
Contact:

Re: Embeding phpBB3 into my website

Post by alex4orly »

Thank you all good people for your feedback.
I will think of where to go from here

Cheers
alex4orly
Registered User
Posts: 185
Joined: Thu May 24, 2018 10:32 pm
Location: Australia
Name: Alex Evans
Contact:

Embeding phpBB3 into my website

Post by alex4orly »

Well folks, I did it...

I don't say it is the ONLY way to do this, nor the best... but this is the way I figured out, after a lot of trial and error, and it works. So, I thought maybe someone else here on the forum can benefit from it.

Firstly, I renamed the page called "viewtopic.php" to "showtopic.php" so that I can have control of the actions taken when a forum member clicks on the link in his email - for example:

http://beleuramyhome.org.au/phpBB3/view ... ead#unread

If you click on such a link in your email, it will take you to the relevant page, BUT - outside of your website...
My challenge was to embed it - within... and I used an iFrame for that

// In the replacement page - viewtopic.php at the top

Code: Select all

<?php
   session_start();
   
   // Get the URL passed into the page
   $uri    = $_SERVER['REQUEST_URI'];

   // I just need the URL arguments, so strip off the URL itself
   $str    = substr($uri, 22);  
 
   // Feed the arguments into a session variable
   // I tried using the $str, but didn't work for some reason
   $_SESSION['params'] = substr($uri, 22);
   
   // Prepare for a redirect to my website page - with the iFrame in it
   $newpage = "http://www.beleuramyhome.org.au/iframeurl.php?";

   // Add the URL arguments
   $newpage .= $str;
   
   // Use this to redirect, because the URL is an argument and can't 
   // be hard coded. That's why I couldn't use the header() function...
   echo '<META HTTP-EQUIV="Refresh" Content="2; URL='.$newpage.'">';   
?>
// In the target page - iframeurl.php, where the iFrame is, at the top of the page

Code: Select all

<?php
   session_start();
   
   // Get the URL passed in from the first step
   $uri    = $_SERVER['REQUEST_URI'];   
   // Strip the URL itself, I need only the arguments
   $_SESSION['params'] = substr($uri, 15);
?>
// In the same page, between the <head> section, I inserted this Javascript function

Code: Select all

<script>   
   
   // This function is called on page load
   window.onload = function()
   {
	  // I will redirect the content into the iFrame, pointing to the 
	  // new page created at the begining 
      var url = "http://beleuramyhome.org.au/phpBB3/showtopic.php?"; 
	  // Get the Session arguments
      var args = "<?php echo $_SESSION['params'] ?>";
	  // Add those to the URL
      url += args; 
      // The actual job of inserting it into the iFrame
      document.getElementById("InlineFrame1").setAttribute("src", url);
	  
	  // Try this URL to see how it works
	  // http://beleuramyhome.org.au/phpBB3/viewtopic.php?f=6&t=3&e=1&view=unread#unread
   }
</script>
Last edited by Kailey on Fri Jun 01, 2018 11:28 pm, edited 1 time in total.
Reason: Added code BBCode.
User avatar
Kailey
Community Team Leader
Community Team Leader
Posts: 3730
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Snay
Contact:

Re: Embeding phpBB3 into my website

Post by Kailey »

Please remember to use the [code][/code] BBCode when posting code. It help with readability.
Kailey Snay - Community Team Leader
Knowledge Base | Documentation | Community rules

If you have any questions about the rules/customs of this website, feel free to send me a PM.
alex4orly
Registered User
Posts: 185
Joined: Thu May 24, 2018 10:32 pm
Location: Australia
Name: Alex Evans
Contact:

Re: Embeding phpBB3 into my website

Post by alex4orly »

Kinerity,
Would love to do it, but need some help.
How?
User avatar
Kailey
Community Team Leader
Community Team Leader
Posts: 3730
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Snay
Contact:

Re: Embeding phpBB3 into my website

Post by Kailey »

code.png
code.png (4.53 KiB) Viewed 2169 times
Kailey Snay - Community Team Leader
Knowledge Base | Documentation | Community rules

If you have any questions about the rules/customs of this website, feel free to send me a PM.
Post Reply

Return to “phpBB Custom Coding”