Author |
Message |
morpheus_75
Involved


Joined: Oct 07, 2003
Posts: 302
|
Posted:
Tue Oct 07, 2003 9:32 am |
|
Hi everyone! I'm new to this forum and to PHP, so I'm sorry in advance for the silliness of my question.
I added three links in a block which are supposed to open a popup. Here's the code of the block:
Code:<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
if (eregi("block-Crew_Block.php",$_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
include "includes/my_header.php";
$content = "<strong><big>·</big></strong> <a href=\"javascript:;\" onClick=\"MM_openBrWindow('morpheus.htm','morpheuspop','width=450,height=480')\">Morpheus</a><br>"
. "<strong><big>·</big></strong> <a href=\"javascript:;\" onClick=\"MM_openBrWindow('trinity.htm','trinitypop','width=450,height=480')\">Trinity</a><br>"
. "<strong><big>·</big></strong> <a href=\"javascript:;\" onClick=\"MM_openBrWindow('neo.htm','neopop','width=450,height=480')\">Neo</a>"
."";
?>
|
I also put the following code in the file my_header.php:
Code:<?php
echo"<Script language=\"javascript\">"
. "<!--"
. "function OpenWind(dest){window.open(dest,\"finestra\",\"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=450,height=480,top=50,left=350\");}"
. ""
. "function MM_openBrWindow(theURL,winName,features) { //v2.0"
. " window.open(theURL,winName,features);"
. "}"
. "//-->"
. "</Script>"
."";
?>
|
Result: The block displays quite well. No errors... BUT... the popups won't open. WHY?
Thamks a lot!! |
Last edited by morpheus_75 on Wed Oct 15, 2003 4:02 am; edited 1 time in total |
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Tue Oct 07, 2003 10:48 am |
|
Try this. Be sure there is NOTHING except a carriage return after the _JS_ and _JS_; tags.Code:<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
if (eregi("block-Crew_Block.php",$_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
$content = <<<_JS_
<script language="javascript">
<!--
function OpenWind(dest){
window.open(dest,"finestra","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=450,height=480,top=50,left=350");
}
function MM_openBrWindow(theURL,winName,features) {
//v2.0
window.open(theURL,winName,features);
}
//-->
</script>
_JS_;
$content .= "\n\n<strong><big>·</big></strong> <a href=\"javascript:;\" onClick=\"MM_openBrWindow('morpheus.htm','morpheuspop','width=450,height=480')\">Morpheus</a><br>"
. "<strong><big>·</big></strong> <a href=\"javascript:;\" onClick=\"MM_openBrWindow('trinity.htm','trinitypop','width=450,height=480')\">Trinity</a><br>"
. "<strong><big>·</big></strong> <a href=\"javascript:;\" onClick=\"MM_openBrWindow('neo.htm','neopop','width=450,height=480')\">Neo</a>";
?>
| Save this as a block and remove that code from the my_header.php file. |
|
|
|
 |
morpheus_75

|
Posted:
Tue Oct 07, 2003 11:51 am |
|
Tnx for ur kind help, Raven!
Unfortunately I had this error:
Parse error: parse error, unexpected $end in D:\Inetpub\webs\whatisthematrixit\portale\blocks\block-Crew_Block.php on line 38
Line 38 is the last line (ending with ?>) |
|
|
|
 |
Raven

|
Posted:
Tue Oct 07, 2003 11:59 am |
|
Let's try the copy again. This is working on my machine.Code:<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
if (eregi("block-Crew_Block.php",$_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
$content = <<<_JS_
<script language="javascript">
<!--
function OpenWind(dest){
window.open(dest,"finestra","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=450,height=480,top=50,left=350");
}
function MM_openBrWindow(theURL,winName,features) {
//v2.0
window.open(theURL,winName,features);
}
//-->
</script>
_JS_;
$content .= "\n\n<strong><big>·</big></strong> <a href=\"javascript:;\" onClick=\"MM_openBrWindow('morpheus.htm','morpheuspop','width=450,height=480')\">Morpheus</a><br>"
. "<strong><big>·</big></strong> <a href=\"javascript:;\" onClick=\"MM_openBrWindow('trinity.htm','trinitypop','width=450,height=480')\">Trinity</a><br>"
. "<strong><big>·</big></strong> <a href=\"javascript:;\" onClick=\"MM_openBrWindow('neo.htm','neopop','width=450,height=480')\">Neo</a>";
?>
|
|
|
|
|
 |
morpheus_75

|
Posted:
Tue Oct 07, 2003 12:09 pm |
|
I'll award u a Nobel Prize for skill and patience!!!
IT WORKS, I can't believe it, IT WORKS!
I've been on this for 2 weeks...
Goda save Raven!
Ok. You have gained a new soldier, my general ehehehehe |
|
|
|
 |
|