Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 6.8
Author Message
morpheus_75
Involved
Involved



Joined: Oct 07, 2003
Posts: 302

PostPosted: Tue Oct 07, 2003 9:32 am Reply with quote

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 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Tue Oct 07, 2003 10:48 am Reply with quote

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.
 
View user's profile Send private message
morpheus_75







PostPosted: Tue Oct 07, 2003 11:51 am Reply with quote

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







PostPosted: Tue Oct 07, 2003 11:59 am Reply with quote

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







PostPosted: Tue Oct 07, 2003 12:09 pm Reply with quote

I'll award u a Nobel Prize for skill and patience!!! Very Happy Razz

IT WORKS, I can't believe it, IT WORKS!

I've been on this for 2 weeks...

Goda save Raven! Razz

Ok. You have gained a new soldier, my general ehehehehe
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 6.8

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©