miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Specific miniBB Support Forums / Specific /  
 

Header/Footer templates for forum in iframe

 
 
Page  Page 1 of 2:  1  2  Next »

Author Februs
Partaker
#1 | Posted: 25 May 2010 23:57 
I currently run miniBB within an iframe on my main site which is available only to members who log in. However, the same forum is also available outside of the iframe to certain other site users.

Is there a way I can have a different header (and footer) template for the forum when running in the iframe as opposed to when its not within an iframe?

Any help would be much appreciated.

Author Paul
Lead Developer 
#2 | Posted: 26 May 2010 02:15 
Here you would need to introduce an extra variable when calling the iframe's content. For example, index.php?iframe=1. Under setup_options.php, specify a condition which will dynamically change $ndexphp value, adding extra parameter to it if $_GET['iframe'] is specified. Further to that, also dynamically specify $includeHeader and $includeFooter variables.

As you see, there is a lot of extra programming for an experienced coder. Also this will work only if you do not have $mod_rewrite enabled.

Author Februs
Partaker
#3 | Posted: 26 May 2010 08:43 
Many thanks for your suggestion but wouldn't that only work the first time the forum was launched? It's possible of course that I've not understood correctly.

What I had tried originally was to modify the load_header function within bb_functions.php and depending on the referer URL call either main_header OR main_header2 template where main_header2 was for the version of the forum not in an iframe. That worked when the forum was first launched but as soon as any link was clicked the referer was then the same for both the iframe and the non-iframe version. What I guess I really needed to do was to use javascript to check if the current window was the same as the parent window and then call either main_header or main_header2 template but I couldn't determine how to do this within the load_header function.

Author Paul
Lead Developer 
#4 | Posted: 26 May 2010 09:20 
Februs:
wouldn't that only work the first time the forum was launched?
Of course it will work always. It's not based on a session or something like this. It's a tricky algorithm.

You don't have to modify core functions. This is lame. Actually, calling from from an iframe for some reason is already lame. miniBB is built to workaround custom modifications for keeping easy upgrades. So I don't really understand, why and what did you modify.

Author Februs
Partaker
#5 | Posted: 26 May 2010 09:40 
OK, I think I had misunderstood what was being suggested. Are you saying I should perhaps include something like:

if ($_GET["iframe"]) $indexphp='index.php?iframe=1&';
else
$indexphp='index.php?';


And presumably I'd also need to do the same for $startIndex, i.e.

if ($_GET["iframe"]) $startIndex='index.php?iframe=1';
else
if ($_GET["iframe"])

Author Paul
Lead Developer 
#6 | Posted: 26 May 2010 10:08 
Yes, this is exactly what I meant. This code should be put straight in setup_options.php. I would still recommend to use if(isset($_GET['iframe'])) because it's more "polite" for PHP specially if you have all warnings turned on. If you just put if($_GET...) it means the script will compare the value of $_GET['var'] which is not always present, and will produce a Notice.

Actually, there are a lot of ways how could you trick different options on a certain condition :)

Author Februs
Partaker
#7 | Posted: 26 May 2010 10:11 
Thanks you for your help. Much appreciated.

Author Prince
Partaker
#8 | Posted: 27 Jul 2010 16:48 
I put logo for my header.. but It can't be set for forum..

in some computers it's like this:



in other computers looks like this:



how can I set that image logo.. to be fit for minibb forum?

Author Paul
Lead Developer 
#9 | Posted: 28 Jul 2010 02:31 
Check your HTML, pal :-) It's a very custom question. If it's not up to you, questions like this usually fit our paid support only.

Even looking at pictures, I can't say what's wrong. But something is wrong with your HTML, not the image itself...

Author Prince
Partaker
#10 | Posted: 28 Jul 2010 04:29 
I did it now.. but there is a little problem.. The image logo is fit with forum size (width) but in difrent resolutions image is not static size.. that's just the problem.. ;)

Author Paul
Lead Developer 
#11 | Posted: 28 Jul 2010 06:16 
The image can have only static width. That's the raster image, not the scalar object. So if it's 1000 px in width, it will be always 1000 pix in width, on any resolution.

Or... what else would you expect? :-)

Do you want the image to be dynamically 1024 pix in width on 1024x768 screen and 1280 px in width on 1280x1024 screen? ;-)

Author Prince
Partaker
#12 | Posted: 28 Jul 2010 12:13 
Paul:
Do you want the image to be dynamically 1024 pix in width on 1024x768 screen and 1280 px in width on 1280x1024 screen? ;-)
yeah this is I want.. ;-)

Author Paul
Lead Developer 
#13 | Posted: 29 Jul 2010 02:28 
Oh well... you must study technology much deeper then. Because what you want, may be possible in another century and dimension, not with the stuff we are supposed to work these days.

Author Prince
Partaker
#14 | Posted: 29 Jul 2010 04:44 
Paul:
Oh well... you must study technology much deeper then. Because what you want, may be possible in another century and dimension, not with the stuff we are supposed to work these days.
you didn't get me correctly.. I meant it be like the forum style setting.. for example forum width is 90%... and I made it 85%.. it's ok.. I will manage it.. ;)

Author Paul
Lead Developer 
#15 | Posted: 29 Jul 2010 07:56 
You answer yourself on your question. You set up forum width in a dynamic value. Percents means dynamic size.

But the image itself... like I wrote about... it's a Raster graphics. Binary picture has a final dimension.

If you set its width in percents, it won't work!!!

Page  Page 1 of 2:  1  2  Next » 
Specific miniBB Support Forums / Specific /
 Header/Footer templates for forum in iframe
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Install the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑