News:

Join the Facebook Fan Page.

Main Menu

Pop Up page?!

Started by davidsilveria, March 17, 2009, 01:03:57 PM

Previous topic - Next topic

davidsilveria

Hi guys .... i read this http://docs.simplemachines.org/index.php?topic=564 , and i add new tab with name Games... but i want when someone click on "Games" new window to pop up with size like 500,100 ... how to do that ... i try but have no success

// Show the [games] button.
echo ($current_action == 'games' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'games' ? 'active_back' : 'back' , '">
<a href="http://somewhere.com">Games</a>
</td>' , $current_action == 'games' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

Marcus Forsberg

Hello.

In index.template.php, add this inside the <head> tags:

<script language="JavaScript">
function games() {
props=window.open(\'page.php\', \'poppage', \'toolbars=0, scrollbars=0, location=0, statusbars=0, menubars=0, resizable=0, width=500, height=100 left = 100, top = 100\');
}
</script>



Then, use this code for your button:

// Show the [games] button.
   echo ($current_action == 'games' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'games' ? 'active_back' : 'back' , '">
               <a href="javascript:games()">Games</a>
               </td>' , $current_action == 'games' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


Clicking on "Games" will now open a 500x100 window showing page.php. Change page.php and the sizes in the code to fit your needs.
If you have problems editing your file, feel free to attach it here and I will do the edits for you.

davidsilveria

well evrything is perfect but when i edit the index.templete.php some error appear over header

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/supernat/public_html/forum/Sources/Load.php(1745) : eval()'d code on line 175

Marcus Forsberg

May I see your index.template.php file?

davidsilveria

#4
Quote from: Nas on March 18, 2009, 05:32:18 AM
May I see your index.template.php file?

i fix it ... thank you for your help man :)



Marcus Forsberg


Advertisement: