• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

simple problem, please help

scarfication

New Member
hi

the script below, makes a pop-up window for my gallery pictures..
i want the script to have the function (maximize on) i tried everythin but it doesn't seem to work (and yes i've already tried to put everything on "yes" but the function maximize won't work..

this is the script please help!

/**
* Print the javascript, which is needed for the popup window
*
* @param $pagetitle string
* @return $str string
*/
function show_jscript($pagetitle="autogallery" )
{
// init vars
$str = '';

$host = "http://" . $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] == 80 ? "" : ":" . $_SERVER['SERVER_PORT'] )
. (strlen($_SERVER['PHP_SELF']) ? "" . str_replace(basename($_SERVER['PHP_SELF']), "", $_SERVER['PHP_SELF'] ) : "");

$str .= "\n<script language=\"JavaScript\">\n";
$str .= "<!--\n";
$str .= "function popup (img,sx,sy,num) {\n";
$str .= " var winl = (screen.width-sx)/2;\n";
$str .= " var wint = (screen.height-sy)/2;\n";
$str .= " image = \"<a href='javascript:self.close()'><img src='\"+img+\"' border='0' alt='Click to Close'></a>\";\n";
$str .= " popupwin=window.open(\"\",\"photo\"+num,\"toolbar=no,location=no,directories=no,status=no,menubar=no,top=\"+wint+\",left=\"+winl+\",width=\"+sx+\",height=\"+sy+\"\");\n";
$str .= sprintf(" popupwin.document.write(\"<HTML><HEAD><TITLE>%s</TITLE><BASE HREF=\\%s\\></HEAD><BODY BGCOLOR=#FFFFFF><CENTER>\" + image + \"</CENTER></BODY></HTML>\");\n", $pagetitle, $host );
$str .= " popupwin.document.close();\n";
$str .= "}\n";
$str .= "// -->\n";
$str .= "</script>\n";

return $str;
}


scarfication
 
Back
Top