Page 1 of 1

Popup with simple header/footer?

Posted: Fri Sep 25, 2015 12:34 am
by Lord Phobos
Hi!

On my board, I am trying to create a link used to open a small popup page (exactly like the one used for "more smilies") in which to put a webradio player.
The matter is not what should be displayed in this popup, but how to create it all!

In fact, I just can't manage to do it.

I created, in one of my styles, the radio_popup.html file.

The questions are:

- How can I set this link to make it open a SMALL window, like the smilies one?
- I put, in the html file, the codes <!-- INCLUDE simple_header.html --> and <!-- INCLUDE simple_footer.html -->. They simply won't work. It opens a large and ugly white windows, with the content inside.

Maybe I should first create a php file to be put in the root, but I searched and didn't find a suitable guide to do this.

Cna you help me, and forgive me for my poor english use? ;)

Thanks.

Re: Popup with simple header/footer?

Posted: Fri Sep 25, 2015 7:36 am
by AmigoJack
Lord Phobos wrote:make it open a SMALL window, like the smilies one?
Most obvious step would be to look how the editor does that. Open /styles/*/template/posting_editor.html and search for {U_MORE_SMILIES}.
Lord Phobos wrote:They simply won't work
Oh I'm sure they "work" - don't confuse the site's output with requesting the site. In other words: simple header and simple footer should be outputted just as expected, thus looking different from overall header and overall footer - but they have nothing to with the state of its internet browser window/tab.

Re: Popup with simple header/footer?

Posted: Fri Sep 25, 2015 2:40 pm
by Mick
And what happens if the user has pop-ups blocked?

Re: Popup with simple header/footer?

Posted: Fri Sep 25, 2015 5:02 pm
by Sniper_E
I don't think opening up a link like more smilies in a window is the same as a popup.

Re: Popup with simple header/footer?

Posted: Fri Sep 25, 2015 5:15 pm
by Lord Phobos
AmigoJack wrote:
Lord Phobos wrote:make it open a SMALL window, like the smilies one?
Most obvious step would be to look how the editor does that. Open /styles/*/template/posting_editor.html and search for {U_MORE_SMILIES}.
Lord Phobos wrote:They simply won't work
Oh I'm sure they "work" - don't confuse the site's output with requesting the site. In other words: simple header and simple footer should be outputted just as expected, thus looking different from overall header and overall footer - but they have nothing to with the state of its internet browser window/tab.

Hi.

I find this:

Code: Select all

		<!-- IF S_SHOW_SMILEY_LINK -->
			<tr>
				<td align="center"><a class="nav" href="{U_MORE_SMILIES}" onclick="popup(this.href, 300, 350, '_phpbbsmilies'); return false;">{L_MORE_SMILIES}</a></td>
			</tr>
		<!-- ENDIF -->
I created a very simple file for what I am seeking, like this:

Code: Select all

<!-- INCLUDE simple_header.html -->
<table width="100%" cellspacing="1" cellpadding="4" border="0">
<tr>
	<td>
		<table class="tablebg" width="95%" cellspacing="1" cellpadding="4" border="0">
		<tr>
			<th>Radio Lord Phobos</th>
		</tr>
		<tr>
			<td class="row1" align="center" valign="middle"><!-- BEGIN radio --> <!-- BEGINS: AUTO-GENERATED MUSES RADIO PLAYER CODE -->
<script type="text/javascript" src="https://hosted.muses.org/mrp.js"></script>
<script type="text/javascript">
MRP.insert({
'url':'http://eu6.fastcast4u.com:5238/;',
'lang':'it',
'codec':'mp3',
'volume':100,
'autoplay':false,
'buffering':5,
'title':'Radio Lord Phobos',
'welcome':'Urla dal Castello',
'bgcolor':'#FFFFFF',
'skin':'scradio',
'width':160,
'height':100
});
</script>
<!-- ENDS: AUTO-GENERATED MUSES RADIO PLAYER CODE --> <!-- END radio --><br /><br /><a class="nav" href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a></td>
		</tr>
		</table>
	</td>
</tr>
</table>
<!-- INCLUDE simple_footer.html -->
But, when clicking, the simple header and footer don't get parsed... Where I should define that file in php?

Thanks! :)

Re: Popup with simple header/footer?

Posted: Fri Sep 25, 2015 5:25 pm
by Lord Phobos
Maybe in includes/functions.php?

Re: Popup with simple header/footer?

Posted: Fri Sep 25, 2015 5:37 pm
by Sniper_E
Lord Phobos wrote:Maybe I should first create a php file to be put in the root.
Yes it needs that. You can not just open a .html file from your template directory and expect it to work.
It has to have a .php file in the root to defines everything like the index.php file does.
There has to be a knowledge base on setting this up somewhere.

Re: Popup with simple header/footer?

Posted: Fri Sep 25, 2015 5:47 pm
by Lord Phobos
Sniper_E wrote: There has to be a knowledge base on setting this up somewhere.
Yes, and it is just what I am looking for! :D
Can someone link me to that or just explain me how to set up a minimal php file for the html file I posted earlier?

Re: Popup with simple header/footer?

Posted: Fri Sep 25, 2015 6:03 pm
by Lumpy Burgertushie
you need to create a php file like this:

Code: Select all

<?php
    define('IN_PHPBB', true);
    $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
    $phpEx = substr(strrchr(__FILE__, '.'), 1);
    include($phpbb_root_path . 'common.' . $phpEx);
    include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
    include($phpbb_root_path . 'includes/message_parser.' . $phpEx);

    // Start session management
    $user->session_begin();
    $auth->acl($user->data);
    $user->setup();
  
    page_header('About Us');

    $template->set_filenames(array(
        'body' => 'test.html',
    ));

   
    page_footer();
    ?>
change the test.html to whatever your filename is for the html file you created to show in the popup.

save that php file to your main folder where the config.php file is.
save your html file to the template folder

make your link to the popup like this:

Code: Select all

<a class="nav" href="test1.php" onclick="popup(this.href, 300, 350, 'test2'); return false;">testlink</a>
change test1.php to whatever you named your php file, change test2 to whatever you want to name the popup and change testlink to whatever words you want for the link.

also, there is something wrong with the link you have to the simple header and footer.
copy and paste the link from one of the normal template files.

be sure you are only using a good text editor to do this. like notepad++ or editpad lite etc.

keep in mind that the simple header has nothing in it, it is just blank and the simple footer only has the copyright info in it.

robert

Re: Popup with simple header/footer?

Posted: Sat Sep 26, 2015 2:39 pm
by Lord Phobos
Worked like a charm, thanks a lot. ;)