Popup with simple header/footer?

Discussion forum for MOD Writers regarding MOD Development.
Lord Phobos
Registered User
Posts: 935
Joined: Tue May 18, 2004 11:41 pm

Popup with simple header/footer?

Post 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.
User avatar
AmigoJack
Registered User
Posts: 6126
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン

Re: Popup with simple header/footer?

Post 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.
  • "The problem is probably not my English but you do not want to understand correctly. ... We will not come anybody anyway, nevertheless, it's best to shit this." Affin, 2018-11-20
  • "But this shit is not here for you. You can follow with your. Maybe the question, instead, was for you, who know, so you shoved us how you are." axe70, 2020-10-10
  • "My reaction is not to everyone, especially to you." Raptiye, 2021-02-28
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26846
Joined: Fri Aug 29, 2008 9:49 am

Re: Popup with simple header/footer?

Post by Mick »

And what happens if the user has pop-ups blocked?
  • "The more connected we get the more alone we become” - Kyle Broflovski© 🇬🇧
User avatar
Sniper_E
Registered User
Posts: 1196
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey

Re: Popup with simple header/footer?

Post by Sniper_E »

I don't think opening up a link like more smilies in a window is the same as a popup.
Image . -.. / .... ..- -- .--. .... .-. . -.--
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!

:!: Sniper_E Styles | phpbbmodders :!:
Lord Phobos
Registered User
Posts: 935
Joined: Tue May 18, 2004 11:41 pm

Re: Popup with simple header/footer?

Post 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! :)
Lord Phobos
Registered User
Posts: 935
Joined: Tue May 18, 2004 11:41 pm

Re: Popup with simple header/footer?

Post by Lord Phobos »

Maybe in includes/functions.php?
User avatar
Sniper_E
Registered User
Posts: 1196
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey

Re: Popup with simple header/footer?

Post 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.
Image . -.. / .... ..- -- .--. .... .-. . -.--
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!

:!: Sniper_E Styles | phpbbmodders :!:
Lord Phobos
Registered User
Posts: 935
Joined: Tue May 18, 2004 11:41 pm

Re: Popup with simple header/footer?

Post 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?
User avatar
Lumpy Burgertushie
Registered User
Posts: 69228
Joined: Mon May 02, 2005 3:11 am

Re: Popup with simple header/footer?

Post 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
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.
Lord Phobos
Registered User
Posts: 935
Joined: Tue May 18, 2004 11:41 pm

Re: Popup with simple header/footer?

Post by Lord Phobos »

Worked like a charm, thanks a lot. ;)

Return to “[3.0.x] MOD Writers Discussion”