Popup with simple header/footer?

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

Popup with simple header/footer?

Post by Lord Phobos » Fri Sep 25, 2015 12:34 am

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: 4993
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Popup with simple header/footer?

Post by AmigoJack » Fri Sep 25, 2015 7:36 am

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 worst thing about censorship is ███████████

User avatar
Mick
Support Team Member
Support Team Member
Posts: 18118
Joined: Fri Aug 29, 2008 9:49 am
Location: Cardiff

Re: Popup with simple header/footer?

Post by Mick » Fri Sep 25, 2015 2:40 pm

And what happens if the user has pop-ups blocked?
"The more connected we get the more alone we become" - Kyle Broflovski

There are no ‘threads’ in phpBB, they are topics.
Forza Garibaldi

User avatar
Sniper_E
Registered User
Posts: 592
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey
Contact:

Re: Popup with simple header/footer?

Post by Sniper_E » Fri Sep 25, 2015 5:02 pm

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: 407
Joined: Tue May 18, 2004 11:41 pm

Re: Popup with simple header/footer?

Post by Lord Phobos » Fri Sep 25, 2015 5:15 pm

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: 407
Joined: Tue May 18, 2004 11:41 pm

Re: Popup with simple header/footer?

Post by Lord Phobos » Fri Sep 25, 2015 5:25 pm

Maybe in includes/functions.php?

User avatar
Sniper_E
Registered User
Posts: 592
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey
Contact:

Re: Popup with simple header/footer?

Post by Sniper_E » Fri Sep 25, 2015 5:37 pm

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: 407
Joined: Tue May 18, 2004 11:41 pm

Re: Popup with simple header/footer?

Post by Lord Phobos » Fri Sep 25, 2015 5:47 pm

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: 63196
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Popup with simple header/footer?

Post by Lumpy Burgertushie » Fri Sep 25, 2015 6:03 pm

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
I am available for custom work on a donation basis. Please send me a PM with your needs.
Premium phpBB 3.2 Styles by PlanetStyles.net

New phpbb 3.0 support site

Lord Phobos
Registered User
Posts: 407
Joined: Tue May 18, 2004 11:41 pm

Re: Popup with simple header/footer?

Post by Lord Phobos » Sat Sep 26, 2015 2:39 pm

Worked like a charm, thanks a lot. ;)

Locked

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

Who is online

Users browsing this forum: No registered users and 16 guests

cron