You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 72 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - How To Insert JavaScript Into Modules/Blocks [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
XtraX
Lieutenant
Lieutenant


Joined: Aug 23, 2003
Posts: 195


PostPosted: Fri Apr 23, 2004 7:12 pm Reply with quoteBack to top

l use an easy method for including Jscripts blocks or modules save the scripts on notpad.TXT file and upload them to a directory called javascripts or what not then the block your trying to add them to simply use this

include("Javascript/Then_the.txt File");

remember this is just an example you will have to create a directory or use an exisiting directory to upload your txt files to then put thew actual path..

and you should be all set good luck !
Find all posts by XtraXView user's profileSend private message
mitch100degrees
Sergeant
Sergeant


Joined: Feb 01, 2004
Posts: 98

Location: USA, Michigan

PostPosted: Fri Apr 23, 2004 7:30 pm Reply with quoteBack to top

Very Happy Your good!!!!! Thanks a million....However...i still have problems

Now that i got that little trick...i got the song playing, but the little QuickTime music thing, and the text where it says "The song you are currently listening to:" is on top of the block, not inside. Inside we have a simple 1, And nothing else, i can't figure out where the 1 is coming from.

Can someone please help me get it inside of the block? Thanks

Mitch
Find all posts by mitch100degreesView user's profileSend private messageAIM AddressYahoo MessengerMSN Messenger
XtraX
Lieutenant
Lieutenant


Joined: Aug 23, 2003
Posts: 195


PostPosted: Fri Apr 23, 2004 8:21 pm Reply with quoteBack to top

No problem glad it worked post your block info and l can see what l can do

XtraX
Find all posts by XtraXView user's profileSend private message
mitch100degrees
Sergeant
Sergeant


Joined: Feb 01, 2004
Posts: 98

Location: USA, Michigan

PostPosted: Sat Apr 24, 2004 9:33 am Reply with quoteBack to top

Hi XtraX,

Here's my new block info since it has changed since i last posted.

File saved as block-RandomMidi2.php:
Code:
<?php
if (eregi("block-RandomMidi2.php", $PHP_SELF)) {
Header("Location: index.php");
die();
}

$content = include("blocks/randommidi.js");
?>


Kinda a short code, i saved it as a .js file insted of a .txt file and it worked.
Now my randommidi.js file:
Code:
<script language="JavaScript">
song = new Array(5); //must match the number of songs and titles;
title = new Array(5);//must match the number of songs and titles;
song[0]='http://resources.bravenet.com/audio/audioclips/disco_dance/rasputin.mid'
song[1]='http://resources.bravenet.com/audio/audioclips/pop_music/tainted_love.mid'
song[2]='http://resources.bravenet.com/audio/audioclips/disco_dance/tribaldance.mid'
song[3] ='http://resources.bravenet.com/audio/audioclips/disco_dance/relax.mid'
song[4] ='http://resources.bravenet.com/audio/audioclips/disco_dance/lefreak.mid'
song[5] ='http://resources.bravenet.com/audio/audioclips/disco_dance/dancingqueen.mid'

title[0] = 'Track 1'
title[1] = 'Track 2'
title[2] = 'Track 3'
title[3] = 'Track 4'
title[4] = 'Track 5'
title[5] = 'Track 6'

index = Math.floor(Math.random() * song.length);document.write("<DL>\n");
document.write("<embed SRC="+song[index]+" width=100 height=45 autostart=true loop=infinite BGCOLOR='#000000'");
document.write(' TEXT="#FFFFFF">');
document.write("<BR>");
document.write("The randomly selected song you are listening to is: ");
document.write("<font size=3 color=red>");
document.write(title[index]);
document.write("</font>")
document.write("</DL>\n");
</script>


I can't figure out why it isn't going inside of the block, maybe i have something wrong with the $content code. Any help as to getting this inside of the block would be great, and thanks again XtraX for helping so far.

Mitch
Find all posts by mitch100degreesView user's profileSend private messageAIM AddressYahoo MessengerMSN Messenger
mitch100degrees
Sergeant
Sergeant


Joined: Feb 01, 2004
Posts: 98

Location: USA, Michigan

PostPosted: Fri May 14, 2004 9:11 pm Reply with quoteBack to top

****Bump*****

Please i have spent days and nights trying to get this to work, and it just ain't happening, Here's what i have tried

1) Reading this whole long forum and others
2) XtraX's solution
3) I tried putting my code in the my_header.php file and that works, but it shows what i want in the block at the top of the page, i tried cutting the document.write tags out of the my_header.php file and putting them into the block, that did'nt work either. I tried editing the .js file so that it would only have the document.write codes in it, that worked, but again it's showing ontop of the block.
4) i tried putting the js code into the block file with the <<<_JS_ tags, that won't work either.

I seriously need to get this into this block, the best way i got it working was to do the include tag and then it shows ontop of the block, and also taking the document.write tags out of the header and putting them in the .js file and then using the include tag in the block that way, I noticed its calling the .js script before the table that it's suppose to go in. Please someone tell me how to get it inside of the block, my latest try is shown below
Code:
<?php
if (eregi("block-RandomMidi2.php", $PHP_SELF)) {
Header("Location: index.php");
die();
}
$content = "<<<_JS_
<script>
song = new Array(5); //must match the number of songs and titles;
title = new Array(5);//must match the number of songs and titles;
song[0]='http://resources.bravenet.com/audio/audioclips/disco_dance/rasputin.mid'
song[1]='http://resources.bravenet.com/audio/audioclips/pop_music/tainted_love.mid'
song[2]='http://resources.bravenet.com/audio/audioclips/disco_dance/tribaldance.mid'
song[3] ='http://resources.bravenet.com/audio/audioclips/disco_dance/relax.mid'
song[4] ='http://resources.bravenet.com/audio/audioclips/disco_dance/lefreak.mid'
song[5] ='http://resources.bravenet.com/audio/audioclips/disco_dance/dancingqueen.mid'

title[0] = 'Track 1'
title[1] = 'Track 2'
title[2] = 'Track 3'
title[3] = 'Track 4'
title[4] = 'Track 5'
title[5] = 'Track 6'

index = \"Math.floor(Math.random() * song.length)\";document.write(\"<DL>\n\");
document.write(\"<embed SRC=\"+song[index]+\" width=100 height=45 autostart=true loop=infinite BGCOLOR='#000000'\");
document.write(' TEXT=\"#FFFFFF\">');
document.write(\"<BR>\");
document.write(\"The randomly selected song you are listening to is: \");
document.write(\"<font size=3 color=red>\");
document.write(title[index]);
document.write(\"</font>\")
document.write(\"</DL>\n\");
</script>
_JS_;
?>

The code is also in the header and the script is working fine in the header, i just don't want it at the top of the page, nor ontop of the block, i want it in the block. As you can see i have added the \ code everywhere to make it stop saying prase error, i've seen a million of them since i started making this block.

Thanks for any help anyone can give me.

Mitch
Find all posts by mitch100degreesView user's profileSend private messageAIM AddressYahoo MessengerMSN Messenger
RavennX
Nuke Cadet
Nuke Cadet


Joined: Sep 29, 2003
Posts: 6


PostPosted: Fri Jul 09, 2004 7:39 am Reply with quoteBack to top

Im still having problems.. here is my 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-Server_Monitor.php",$_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
$ServerMonitor = <<<_JSCODE_
<SCRIPT LANGUAGE="JavaScript"
SRC='http://share1.serverspy.net/cgi-bin/monitor.js?mid=59361'>
</SCRIPT>

_JSCODE_;

$content = $ServerMonitor;

?>


And i get this error....


Parse error: parse error in /home/sites/site92/web/ngl/blocks/block-Server_Monitor.php on line 19

any help?
Find all posts by RavennXView user's profileSend private message
lilcrabbygal
Nuke Cadet
Nuke Cadet


Joined: Aug 01, 2004
Posts: 9


PostPosted: Sun Aug 01, 2004 12:35 pm Reply with quoteBack to top

Phew... I've read through all the thread and tried most of the stuff shared previously and I keep getting an error

I have a drop-down navigation I made in Xara which I created for the magazine and now that I have switched to PhpNuke I can't for the life of me figure out how to embed it into the templates. I say template because I have a range of templates for users to view the site in. I want the nav bar to show up just below the logo.

I pasted it into a text file and uploaded to blocks/block-Xara_Menu.php it showed up below my welcome message even though I set it to display 'center up'.


Last edited by lilcrabbygal on Thu Dec 16, 2004 10:07 am; edited 1 time in total
Find all posts by lilcrabbygalView user's profileSend private message
spottedhog
Captain
Captain


Joined: Apr 30, 2004
Posts: 566


PostPosted: Fri Aug 13, 2004 4:55 am Reply with quoteBack to top

mitch100degrees....

about your block code......

just a quick glance shows me that I do not see a closing " for the $content=

In other words, all code for $conten= should have this format:

$content = "all your code here"

In your code, I do not see a closing " (but I have been wrong before...)

_________________
SMF-Nuke admin

SMF and PHP Nuke integration is ready! Take a look at it by clicking on the link above.
Find all posts by spottedhogView user's profileSend private messageSend e-mailVisit poster's website
jose_luix
Nuke Cadet
Nuke Cadet


Joined: Aug 14, 2004
Posts: 4


PostPosted: Sat Aug 14, 2004 5:37 am Reply with quoteBack to top

Have a nice day:

I have a problem. I need to install 2 phpnuke and 2 phpbb (boards) under the same domain. I made this...

www.aaa.com/board1

www.aaa.com/board2

www.aaa.com/nuke1

www.aaa.com/nuke2

And it works wonderfull. But I need that users from each board or nuke can use ther ID and password to enter the 4 boards or nukes. I have 4 mysql databases now, but I need one unique database for the 4 sites. Is it possible??? Or I am crazy??? I someone can help I would really apreciatte it, best regards

Joe
Find all posts by jose_luixView user's profileSend private message
inkydink1234
Nuke Soldier
Nuke Soldier


Joined: Aug 29, 2003
Posts: 32


PostPosted: Sat Aug 14, 2004 7:25 am Reply with quoteBack to top

spottedhog wrote:
mitch100degrees....

about your block code......

just a quick glance shows me that I do not see a closing " for the $content=

In other words, all code for $conten= should have this format:

$content = "all your code here"

In your code, I do not see a closing " (but I have been wrong before...)
The quotes are all closed. Look again.
Find all posts by inkydink1234View user's profileSend private message
_clone_
Nuke Cadet
Nuke Cadet


Joined: Sep 15, 2004
Posts: 6


PostPosted: Wed Sep 15, 2004 8:22 pm Reply with quoteBack to top

How can i changed my site status link in my nuke site. I want to Changed it and disabled those link appearing when i point my mouse over a link. Also it is possible to encrypt my index.php i want to encrypt my site when visiors view my site source codes....
Find all posts by _clone_View user's profileSend private message
EarthAngel
Sergeant
Sergeant


Joined: Sep 05, 2004
Posts: 87

Location: Denmark

PostPosted: Sat Oct 16, 2004 11:21 am Reply with quoteBack to top

Okay, all I'm really sorry - you can call me ignorant, but I'm not much of a programmer.. but great at following instructions. Laughing

I'm trying to put in a counter from a well known Danish search engine on my site, at the very bottom. Preferably in the footer.

How do I do it? I've read through all 6 pages of replies here, and am none the wiser, I'm afraid Sad Can someone tell me which specific file to change and with which codes? Please... Embarassed

Here's the javascript I'm trying to put in my footer..

Code:
<!-- Chart Basis HTML kode start v003 -->
<script language="javascript" type="text/javascript">
<!--
  document.write('<a href="http://www.chart.dk/ref.asp?ct=v003&id=106994" target="_blank">');
  var myref; myref=document.referrer; if(top.document.referrer!=null) myref=top.document.referrer;
  document.write('<img src="http://cluster.chart.dk/chart.asp?id=106994&style=7&secID=' + Math.random()*10000000 + '&ref=' + escape(myref) + '" border="0" alt="Chart.dk"><');
  document.write('/a>');
//-->
</script>
<noscript>
  <a href="http://www.chart.dk/ref.asp?ct=v003&amp;id=106994" target="_blank"><img src="http://cluster.chart.dk/chart.asp?id=106994&amp;style=7&amp;secID=1" border="0" alt="Chart.dk"></a>
</noscript>
<!-- Chart Basis HTML kode slut v003 -->


Thanks whomever can help me <3
Find all posts by EarthAngelView user's profileSend private message
Mesum
Support Staff
Support Staff


Joined: Mar 11, 2003
Posts: 842

Location: Chicago

PostPosted: Sat Oct 16, 2004 11:28 am Reply with quoteBack to top

EarthAngel wrote:
Okay, all I'm really sorry - you can call me ignorant, but I'm not much of a programmer.. but great at following instructions. Laughing

I'm trying to put in a counter from a well known Danish search engine on my site, at the very bottom. Preferably in the footer.

How do I do it? I've read through all 6 pages of replies here, and am none the wiser, I'm afraid Sad Can someone tell me which specific file to change and with which codes? Please... Embarassed

Here's the javascript I'm trying to put in my footer..

Code:
<!-- Chart Basis HTML kode start v003 -->
<script language="javascript" type="text/javascript">
<!--
  document.write('<a href="http://www.chart.dk/ref.asp?ct=v003&id=106994" target="_blank">');
  var myref; myref=document.referrer; if(top.document.referrer!=null) myref=top.document.referrer;
  document.write('<img src="http://cluster.chart.dk/chart.asp?id=106994&style=7&secID=' + Math.random()*10000000 + '&ref=' + escape(myref) + '" border="0" alt="Chart.dk"><');
  document.write('/a>');
//-->
</script>
<noscript>
  <a href="http://www.chart.dk/ref.asp?ct=v003&amp;id=106994" target="_blank"><img src="http://cluster.chart.dk/chart.asp?id=106994&amp;style=7&amp;secID=1" border="0" alt="Chart.dk"></a>
</noscript>
<!-- Chart Basis HTML kode slut v003 -->


Thanks whomever can help me <3


What's this code for? can you have it way at the end of your page or you want it to show up before copyright/footers?

_________________
Only FREE Dating site for Desis.
Find all posts by MesumView user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN Messenger
EarthAngel
Sergeant
Sergeant


Joined: Sep 05, 2004
Posts: 87

Location: Denmark

PostPosted: Sat Oct 16, 2004 11:33 am Reply with quoteBack to top

It's a counter thing.. A lot of Danish people find their websites through Chart.dk which is where the counter is from. I'm basicly trying to get more traffic to my site by adding it. Very Happy

You can see it as a little tiny green C on this site, at the very bottom: http://www.ungmor.dk - but I don't know how they put it there..

And yes, it can easily be at the very end of my page.. as long as its at the bottom and not too visible Wink
Find all posts by EarthAngelView user's profileSend private message
Mesum
Support Staff
Support Staff


Joined: Mar 11, 2003
Posts: 842

Location: Chicago

PostPosted: Sat Oct 16, 2004 11:36 am Reply with quoteBack to top

Well if that's the case, copy and paste this code right above the very last tag, which is ?>

Code:

?>
<!-- Chart Basis HTML kode start v003 -->
<script language="javascript" type="text/javascript">
<!--
  document.write('<a href="http://www.chart.dk/ref.asp?ct=v003&id=106994" target="_blank">');
  var myref; myref=document.referrer; if(top.document.referrer!=null) myref=top.document.referrer;
  document.write('<img src="http://cluster.chart.dk/chart.asp?id=106994&style=7&secID=' + Math.random()*10000000 + '&ref=' + escape(myref) + '" border="0" alt="Chart.dk"><');
  document.write('/a>');
//-->
</script>
<noscript>
  <a href="http://www.chart.dk/ref.asp?ct=v003&amp;id=106994" target="_blank"><img src="http://cluster.chart.dk/chart.asp?id=106994&amp;style=7&amp;secID=1" border="0" alt="Chart.dk"></a>
</noscript>
<!-- Chart Basis HTML kode slut v003 -->
<?

Make sure you copy and paste EACH AND EVERY LINE of this code.

_________________
Only FREE Dating site for Desis.
Find all posts by MesumView user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN Messenger
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next 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



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.951 Seconds - 477 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::