Code: Select all
<?php
$_page_cont[0]['TMI_Chat'] = TopCodeMenuItem ( $f(_t("Quick Tour")), "tour\index.htm",$site[url],0,"target=_blank" );
?>Moderator: General Moderators
Code: Select all
<?php
$_page_cont[0]['TMI_Chat'] = TopCodeMenuItem ( $f(_t("Quick Tour")), "tour\index.htm",$site[url],0,"target=_blank" );
?>Code: Select all
window.open("http://forums.devnetwork.net/", "devWin", "width=800,height=600,location=yes,menubar=no");Code: Select all
$_page_contї0]ї'TMI_Chat'] = TopCodeMenuItem ( $f(_t("Quick Tour")), "window.open("tour/index.htm", "Quick Tour", "width=600,height=450,location=yes,menubar=no")",$siteїurl] );Code: Select all
$_page_cont[0]['TMI_Chat'] = TopCodeMenuItem ( $f(_t("Quick Tour")), 'window.open("tour/index.htm", "Quick Tour", "width=600,height=450,location=yes,menubar=no")',$site[url] );okay, no errors this time, but it says that it can't find the page and the address in the address bar shows 'http://..../window.open('feyd wrote:Code: Select all
$_page_cont[0]['TMI_Chat'] = TopCodeMenuItem ( $f(_t("Quick Tour")), 'window.open("tour/index.htm", "Quick Tour", "width=600,height=450,location=yes,menubar=no")',$site[url] );
well, the entire function looks like this (and i think it's set up to only open up pages with no javascript functions or whatever) ...feyd wrote:your function isn't setting the html right.
Code: Select all
<?php
function PageCode( )
{
global $dir;
global $site;
global $_page;
global $_page_comp;
global $logged;
global $_SLMOD;
global $tmpl;
global $logged;
global $ADMIN;
global $tmi_letters;
global $content_w;
global $bgcolor;
global $_page_cont;
global $en_up;
$ni = $_page['name_index'];
$no_cart = getParam("no_cart") == "on" ? 1 : 0;
$membership_only = getParam("membership_only") == "on" ? 1 : 0;
// reading templates
$fn = "$dir[root]tmpl_${tmpl}_page_$ni.html";
if ( !file_exists($fn) ) $fn = "$dir[root]tmpl_${tmpl}_page.html";
$fs = filesize ( $fn );
$f = fopen ( $fn, "r" );
$templ = fread ( $f, $fs );
fclose ( $f );
// lang block
if ( $_SLMOD )
{
ob_start();
lang_select_txt();
$_page_cont[0]['switch_lang_block'] = ob_get_contents();
ob_end_clean();
}
else
{
$_page_cont[0]['switch_lang_block'] = "";
}
// top menu items
{
switch ($tmi_letters)
{
case "upper": $f = "strtoupper"; break;
case "lower": $f = "strtolower"; break;
default: $f = "sprintf";
}
$_page_cont[0]['TMI_Home'] = TopCodeMenuItem ( $f(_t("_Homepage")), "index.php", $site[url] );
$_page_cont[0]['TMI_Search'] = TopCodeMenuItem ( $f(_t("_Search")), "search.php", $site[url] );
if ( $logged['member'] )
$_page_cont[0]['TMI_Join'] = TopCodeMenuItem ( $f(_t("Control Panel")), "member.php", $site[url] );
else
$_page_cont[0]['TMI_Join'] = TopCodeMenuItem ( $f(_t("Register")), "join_form.php", $site[url] );
if ( $logged['member'] )
$_page_cont[0]['TMI_Login'] = TopCodeMenuItem ( (_t("Search")), "search.php", $site[url] );
else
$_page_cont[0]['TMI_Login'] = TopCodeMenuItem ( $f(_t("Log In")), "member.php", $site[url] );
if ( $logged['member'] )
$_page_cont[0]['TMI_Chat'] = TopCodeMenuItem ( (_t("Chat")), "chat.php", $site[url],0,"target=_blank" );
else
$_page_cont[0]['TMI_Chat'] = TopCodeMenuItem ( $f(_t("Quick Tour")), "tour\index.htm",$site[url],0,"target=_blank" );
if ( $logged['member'] )
$_page_cont[0]['TMI_Search'] = TopCodeMenuItem ( (_t("Communicator")), "cc.php", $site[url] );
else
$_page_cont[0]['TMI_Search'] = TopCodeMenuItem ( $f(_t("Search")), "search.php", $site[url] );
if ( $logged['member'] )
$_page_cont[0]['TMI_Contacts'] = TopCodeMenuItem ( (_t("Log Out")), "logout.php?action=member_logout", $site[url] );
else
$_page_cont[0]['TMI_Contacts'] = TopCodeMenuItem ( $f(_t("Contact")), "contact.php", $site[url] );
if ( !$no_cart && !$membership_only && $logged['member'] )
$_page_cont[0]['TMI_Cart'] = TopCodeMenuItem ( $f(_t("_Cart")), "cart.php?t=".time(), $site[url] );
else
$_page_cont[0]['TMI_Cart'] = TopCodeMenuItem ( $f(_t("_Chat Now")), "chat.php",$site[url],0,"target=_blank" );
$_page_cont[0]['TMI_Forum'] = TopCodeMenuItem ( $f(_t("_Forum")), "forum.php",$site[url],0,"target=_blank");
$_page_cont[0]['TMI_About'] = TopCodeMenuItem ( $f(_t("_About Us")), "about_us.php", $site[url] );
}
?>Code: Select all
<?php
function TopCodeMenuItem( $text, $link, $path = "", $dir = 0, $ex = "" )
{
global $menu_item_width_a;
global $menu_item_width_i;
global $menu_text_margin_top;
global $menu_item_height;
global $site;
}
?>Code: Select all
<script>
function open()
{
window.open('file.php',null,'height=470,width=400,status=yes,toolbar=no,menubar=no,location=no')
}
</script>
<?php
function TopCodeMenuItem( $text, $link, $path = "", $dir = 0, $ex = "" )
{
global $menu_item_width_a;
global $menu_item_width_i;
global $menu_text_margin_top;
global $menu_item_height;
global $site;
print("<script>open()</script>");
}
?>