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 7.5
Author Message
mvillamizar
Regular
Regular



Joined: Nov 02, 2004
Posts: 54
Location: Colombia

PostPosted: Wed Nov 10, 2004 1:09 pm Reply with quote

Hi,

I'm trying to create a rollover menu block in javascript.

I put some javascript in "/include/javascript.php"; this javascript goes in between the <head> tags,
I put some javascript in the "/themes/mytheme/theme.php";this javascript goes in the <head> tag also I created a block-my_block.php and put it inside the block folder.

I can see the block perfectly, I checked the source code of the page and I can see all the javascript but it doesn't work at all.

can anyone help me?

Thanks
 
View user's profile Send private message Visit poster's website
hitwalker
Sells PC To Pay For Divorce



Joined:
Posts: 5661

PostPosted: Wed Nov 10, 2004 1:18 pm Reply with quote

using javascript can be tricky mvillamizar...
your not giving any relevant info to work on.
a little bit more info would be nice....
and some piece of code what your trying to include....
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Wed Nov 10, 2004 3:21 pm Reply with quote

mvillamizar,

You are trying to post javascript with the script tag and I don't allow that. Instead, use something like

<s cript>
 
View user's profile Send private message
mvillamizar







PostPosted: Wed Nov 10, 2004 3:25 pm Reply with quote

ok,
I'm sorry, I didn't know. thanks for let me know, that is why i've been black listed by sentinel
 
hitwalker







PostPosted: Wed Nov 10, 2004 3:27 pm Reply with quote

well if you installed sentinel in a proper way you cannot be banned.
and when you are working on your site with sensitive stuff like javascript better do that logged in as admin....
 
Raven







PostPosted: Wed Nov 10, 2004 3:28 pm Reply with quote

Laughing - You haven't been blacklisted. If you were banned you could not post Wink - Just a warning.
 
mvillamizar







PostPosted: Wed Nov 10, 2004 3:36 pm Reply with quote

*****************************
"/themes/mytheme/theme.php"
*****************************
/*<?php
...
function themeheader() {
global $user, $banners, $sitename, $slogan, $cookie, $prefix;
cookiedecode($user);
$username = $cookie[1];
if ($username == "") {
$username = "Anonymous";
}

echo "<body bgcolor=\"#ccff42\" text=\"#000000\" link=\"#363636\" vlink=\"#363636\" alink=\"#d5ae83\" \n";
echo "onload = \"MM_preloadImages('/images/mainmenu/inicio2.gif',\n";
echo "'/images/mainmenu/restaurant2.gif', '/images/mainmenu/decompras2.gif',\n";
echo "'/images/mainmenu/eventos2.gif', '/images/mainmenu/gente2.gif',\n";
echo "'/images/mainmenu/directorio2.gif', '/images/mainmenu/jobs2.gif',\n";
echo "'/images/mainmenu/cultura2.gif', '/images/mainmenu/cocinalat2.gif',\n";
echo "'/images/mainmenu/cupones2.gif', '/images/mainmenu/musica2.gif',\n";
echo "'/images/mainmenu/quiquedo2.gif', '/images/mainmenu/subscri2.gif',\n";
echo "'/images/mainmenu/anuncie2.gif')\"\n";
echo " bgcolor=\"#ccff42\" text=\"#000000\" link=\"#363636\" vlink=\"#363636\" alink=\"#d5ae83\" >\n";

if ($banners) {
include("banners.php");
}
echo "<br>\n";
...
?>*/

******************************
"/includes/javascript.php"
******************************
/*<?php
if (eregi("javascript.php",$_SERVER['PHP_SELF'])) {
Header("Location: ../index.php");
die();
}

...
//the script tag is like this <s cript> because I can not post it in the normal way
echo "<s cript language=\"JavaScript\" type=\"text/JavaScript\">\n";
echo "<!--\n";
echo "function MM_preloadImages() { //v3.0\n";
echo "var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();\n";
echo "var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)\n";
echo "if (a[i].indexOf(\"#\")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}\n";
echo "}\n";

echo "function MM_findObj(n, d) { //v4.01\n";
echo "var p,i,x; if(!d) d=document; if((p=n.indexOf(\"?\"))>0&&parent.frames.length) {\n";
echo "d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}\n";
echo "if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];\n";
echo "for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);\n";
echo "if(!x && d.getElementById) x=d.getElementById(n); return x;\n";
echo"}\n";

echo "function MM_nbGroup(event, grpName) { //v6.0\n";
echo "var i,img,nbArr,args=MM_nbGroup.arguments;\n";
echo "if (event == \"init\" && args.length > 2) {\n";
echo "if ((img = MM_findObj(args[2])) != null && !img.MM_init) {\n";
echo "img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;\n";
echo "if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();\n";
echo "nbArr[nbArr.length] = img;\n";
echo "for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {\n";
echo "if (!img.MM_up) img.MM_up = img.src;\n";
echo "img.src = img.MM_dn = args[i+1];\n";
echo "nbArr[nbArr.length] = img;\n";
echo "} }\n";
echo "} else if (event == \"over\") {\n";
echo "document.MM_nbOver = nbArr = new Array();\n";
echo "for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {\n";
echo "if (!img.MM_up) img.MM_up = img.src;\n";
echo "img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);\n";
echo "nbArr[nbArr.length] = img;\n";
echo "}\n";
echo "} else if (event == \"out\" ) {\n";
echo "for (i=0; i < document.MM_nbOver.length; i++) {\n";
echo "img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }\n";
echo "} else if (event == \"down\") {\n";
echo "nbArr = document[grpName];\n";
echo "if (nbArr)\n";
echo "for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }\n";
echo "document[grpName] = nbArr = new Array();\n";
echo "for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {\n";
echo "if (!img.MM_up) img.MM_up = img.src;\n";
echo "img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;\n";
echo "nbArr[nbArr.length] = img;\n";
echo " } }\n";
echo "}\n";
echo "//-->\n";
echo "</s cript>\n";

?>*/


******************************
"/blocks/block-main_menu.php"
******************************
/*<?php
if (eregi("block-main_menu.php", $PHP_SELF)) {
Header("Location: index.php");
die();
}

$content = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
$content .= " <tr>\n";
$content .= " <td><a href=\"http://phpnuke.escapelatino.com\" target=\"_top\"\n";
$content .= "onclick=\"MM_nbGroup(''down'',''group1'',''inicio'',''/images/mainmenu/inicio2.gif'',1)\"\n";
$content .= "onmouseover=\"MM_nbGroup(''over'',''inicio'',''/images/mainmenu/inicio2.gif'','''',1)\"\n";
$content .= "onmouseout=\"MM_nbGroup(''out'')\"><img src=\"/images/mainmenu/inicio1.gif\" alt=\"inicio\"\n";
$content .= "name=\"inicio\" width=\"117\" height=\"16\" border=\"0\" id=\"inicio\" onload=\"\" /></a></td>\n";
$content .= " </tr>\n";
$content .= " <tr>\n";
...
?>
*/
I've checked already and all php code is well form, all the double quotes are scape with /", I can see the block but it doesn't do the roll over.

what I'm doing wrong? any sugestions

Thanks
 
mvillamizar







PostPosted: Wed Nov 10, 2004 3:44 pm Reply with quote

well I really don't know but when I was trying to post like 3 time the post before this one I saw a black screen saying that I have been black listed and I'm still posting, but I want to make it clear, I just wanted to post!!!
 
Raven







PostPosted: Wed Nov 10, 2004 3:48 pm Reply with quote

First of all, get rid of all those echo statements and follow this:

http://www.ravenphpscripts.com/postt28.html
 
mvillamizar







PostPosted: Wed Nov 10, 2004 9:52 pm Reply with quote

Hi Raven,

I did what it says in the link above, I put all the code using the heredoc stuff, still happening the same, I can se the block as I would expected to see it, but still doesn't work the rollover script.

*****************************
"/themes/mytheme/theme.php"
*****************************
<?php
...
echo <<<HEADTAG
//all the head stuff here
HEADTAG;
...
?>

******************************
"/includes/javascript.php"
******************************
<?php
echo <<<JST
...
function MM_preloadImages()
//all the javascripts go here
...
JST;
?>

******************************
"/blocks/block-main_menu.php"
******************************
/*<?php
if (eregi("block-main_menu.php", $PHP_SELF)) {
Header("Location: index.php");
die();
}
...
$temp = <<<ROLLOVERBLOCK
//all the html-javascript to do the rollover efect goes here
ROLLOVERBLOCK;
$content = $temp;
?>
 
southern
Client



Joined: Jan 29, 2004
Posts: 624

PostPosted: Wed Nov 10, 2004 11:38 pm Reply with quote

You might want to try this custom javas cript block from monkeyman...
Code:


############
######  monkeyMan customizable block for PHP-Nuke
######  (May. 31, 2004) Version 1.1
######  Created by Marvin.P
######  http://monkeymanv2.com
############

-----------
About
-----------
The monkeyMan customizable block to PHP-Nuke should work through verions 6.5 - 7.3+. With
this handy block, you can add pretty much anything to your PHP-Nuke site...

Hope this helps. Alternatively, put your s cript in a .php file like
Code:


<?php
<s cript language="Javas cript">
....
?>

name it something like rollover.php, put it in your includes directory and call it through the my_header.php file.

_________________
Computer Science is no more about computers than astronomy is about telescopes.
- E. W. Dijkstra 
View user's profile Send private message
southern







PostPosted: Thu Nov 11, 2004 2:27 pm Reply with quote

Look at this topic, also. May give you ideas.
http://www.karakas-online.de/forum/viewtopic.php?t=859
 
mvillamizar







PostPosted: Fri Nov 19, 2004 3:01 pm Reply with quote

Hi,

Well I was a bit busy and didn't have time to have a look at it.

I checked The monkeyMan customizable block to PHP-Nuke and this is the code

<?php
############
###### monkeyMan customizable block for PHP-Nuke
###### (May. 31, 2004) Version 1.1
###### Created by Marvin.P
###### http://monkeymanv2.com
############

if (eregi("block-Custom_Javascript.php", $PHP_SELF)) {
Header("Location: index.php");
die();
}
##Code goes in gap!
$content = '<center>

</center>';
?>

This is it!!! Sad nothing new, if you see a few post above my code it is almost the same.

I did the rollover menu in html/javascript; it did work, also I read the karakas's link and that it is not my case needer.

the second choice you mentioned is to put the javascript code in /includes/javascript.php, but if you see my code above, the javascript has one part that must go inside the head tags (Functions definitions) and another part that must go inside the body tags (function calls).

what can I do here, any other sugestion.
 
mvillamizar







PostPosted: Sun Nov 21, 2004 6:14 am Reply with quote

Hi,

any idea Any one out there, it will be really helpful this javascript menu stuff is getting really annoying.......PLEASE!
 
Raven







PostPosted: Sun Nov 21, 2004 10:03 am Reply with quote

You can place it all in the body tags. Placing the functions between the head tags is not required.
 
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 7.5

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 ©