MyBB Community Forums

Full Version: [Tutorial] Add popup links to your header
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello people,
In the following tutorial you will learn how to make custom popup links and add them to your header!Smile
Preview:
[attachment=21096]

Go to:
Admin Control Panel>> Templates & Styles>> Templates>> (Your Theme's Name) Templates>> Header Templates>> Header.

Find:
<li><a href="{$mybb->settings['bburl']}/calendar.php" class="calendar">{$lang->toplinks_calendar}</a></li>

Copy this and paste it again right below, so it looks like:
<li><a href="{$mybb->settings['bburl']}/calendar.php" class="calendar">{$lang->toplinks_calendar}</a></li>
<li><a href="{$mybb->settings['bburl']}/calendar.php" class="calendar">{$lang->toplinks_calendar}</a></li>

Now, you will need to replace where "calendar.php" with your file's name and where "{$lang->toplinks_calendar}" with a word.
What about the popup links? Let's make them right now!Cool
Replace the <a href> value with "#" and add the popup window code.The popup window code is shown right below:
<li><a href="{$mybb->settings['bburl']}/calendar.php" class="calendar">{$lang->toplinks_calendar}</a></li>
<li><a href="#" onclick="MyBB.popupWindow('{$mybb->settings['bburl']}/yourfile.php','Your File',400,200);">Your File</a></li>
'Your File' is the title of the popup window, it won't be used if you have already defined a name within the document by using the <title> tag.
Also, you can change 400,200 to your desired width,height so it suits your content. Finally replace >Your File</a> with a word you'd like.

Note that I didn't touch anything in the first line.
All changes have been made in the second line, so do not touch the first line or you'll end with a calendar popup window!


That's all.Big Grin
Originally posted at MyBB Extras by me.
Nice tut Big Grin
nice tutorial indeed..
Thanks for your good words, happy new year too!Smile
First post updated, added a screenshot and made the whole guide a lil bit smaller.
How can i add Modal box......so it is not blockable by popup blockers

(some thing like pop up)