Author |
Message |
American
New Member
![New Member New Member](modules/Forums/images/ranks/1star.gif)
![](modules/Forums/images/avatars/blank.gif)
Joined: Mar 14, 2004
Posts: 10
|
Posted:
Sun Mar 14, 2004 11:34 am |
|
I have searched and read everything I can find here and on nukecops that Raven has posted but I am still having no luck. This is likely due to my ignorance of programming. I am trying to insert some Web Ring code on a 6.9 site in a bottom center block at www.sporttwin.com.
Here is what I am working with:
PURE CODE
Code:<script language=javascript type="text/javascript"
src="http://ss.webring.com/navbar?f=j;y=sporttwin;u=defurl">
</script><noscript><center>
<table bgcolor=gray cellspacing=0 border=2><tr>
<td><table cellpadding=2 cellspacing=0 border=0><tr><td align=center>
<font face=arial size=-1>This site is a member of WebRing.
<br>To browse visit <a href="http://ss.webring.com/navbar?f=l;y=sporttwin;u=defurl">
Here</a>.</font></td></tr></table></td></tr></table>
</center></noscript>
|
I created a block-Buell_Webring.php file in /blocks, gave it the same permissions and ownership as the other then created the block via the admin section. Here is the block code I am using now:
Code:<?
$content = <<<_JS_
<script language=javascript type="text/javascript"src="http://ss.webring.com/navbar?f=j;y=sporttwin;u=defurl">
</script><noscript><center>
<table bgcolor=gray cellspacing=0 border=2><tr>
<td><table cellpadding=2 cellspacing=0 border=0><tr><td align=center>
<font face=arial size=-1>This site is a member of WebRing.
<br>To browse visit <a href="http://ss.webring.com/navbar?f=l;y=sporttwin;u=defurl">Here</a>.</font></td></tr></table></td></tr></table>
</center></noscript>
_JS_;
?>
|
I am getting this warning in the block on my main page:
Parse error: parse error in /home/buellman/domains/sporttwin.com/public_html/blocks/block-Buell_Webring.php on line 13
Buell Web Ring
There isn't content right now for this block.
Which is the last line after/below ?>. I am using pico on RH9.0. I have tried using the _ANYHTMLCODE_ instead of JS, I have tried to backspace the last line to make sure there was no junk, I tried adding PHP on the first line next to <?, I did away with the space above the last ?>... all with no luck.
I would also be open to adding it to my footer.php file as well, either is fine.
What am I doing wrong?
Thanks! |
_________________ Brad G |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
American
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Mar 14, 2004 11:58 am |
|
Ok finally got it working. I copied the content via pico then deleted the block-Buell_Webring.php file, created a new one using the following code:
Code:<?php
$content = <<<_JS_
<script language=javascript type="text/javascript"src="http://ss.webring.com/navbar?f=j;y=sporttwin;u=defurl">
</script><noscript><center>
<table bgcolor=gray cellspacing=0 border=2><tr>
<td><table cellpadding=2 cellspacing=0 border=0><tr><td align=center>
<font face=arial size=-1>This site is a member of WebRing.
<br>To browse visit <a href="http://ss.webring.com/navbar?f=l;y=sporttwin;u=defurl">Here</a>.</font></td></tr></table></td></tr></table>
</center></noscript>
_JS_;
?>
|
Which seems to work... added the php tag on the first line, I also think that because I initially pulled the code from a temp Notepad file that there must have been some junk at the end I just couldn't get rid of... using pico from start to finish might have been the fix in addition to adding the php tag. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Nukeum66
Life Cycles Becoming CPU Cycles
![](modules/Forums/images/avatars/438e821747faeb6553037.gif)
Joined: Jul 30, 2003
Posts: 551
Location: Neurotic, State, USA
|
Posted:
Sun Mar 14, 2004 12:20 pm |
|
Try it this way.. let me know how it works I would test it but my host server is upgrading today, so i have no access to my site...
Code:<?php
if (eregi("block-Webring.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
$content = "<script language=javascript type=\"text/javascript\" src=\"http://ss.webring.com/navbar?f=j;y=sporttwin;u=defurl\"></script><noscript><center><table bgcolor=gray cellspacing=0 border=2><tr><td><table cellpadding=2 cellspacing=0 border=0><tr><td align=center><font face=arial size=-1>This site is a member of WebRing.<br>To browse visit <a href=\"http://ss.webring.com/navbar?f=l;y=sporttwin;u=defurl\">Here</a>.</font></td></tr></table></td></tr></table></center></noscript>";
?>
|
|
_________________ Scott Johnson MIS Ubuntu/Linux 11.10 |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
Site Admin/Owner
![](modules/Forums/images/avatars/45030c033f18773153cd2.gif)
Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Sun Mar 14, 2004 1:48 pm |
|
The way you got it working is the preferred and recommended way. That way you never have to escape '\' quotes and it literally is copy and paste. In addition, you can reference PHP variable in the heredoc syntax. Rather than having to edit it in *nix, if you prefer to work in windoz, get Textpad. It's great. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
southern
Client
![](modules/Forums/images/avatars/42f55d56513263cbdd206.jpg)
Joined: Jan 29, 2004
Posts: 624
|
Posted:
Sat Apr 10, 2004 10:46 am |
|
I have a similar problem getting javascript to work, only I want to run a little mindnumbing midi tune to greet visitors. I've tried the disipal block creator:
Code:
<?php
#### Generated by Block Creator by Disipal Site (www.disipal.net) ###
if (eregi("block-music.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
$content = "<script language=\"JavaScript\"><!--";
$content .= "if(navigator.appName==\"Netscape\"){";
$content .= "document.write('<embed src=\"http://southernwolf.net/sounds/mexshuf.mid\" autostart=\"true\" loop=\"1\" hidden=\"false\"></embed>');}";
$content .= "else if(navigator.appName==\"Microsoft Internet Explorer\"){";
$content .= "document.write('<embed src=\"http://southernwolf.net/sounds/mexshuf.mid\" autostart=\"true\" loop=\"1\" hidden=\"false\"></embed>');}";
$content .= "else{";
$content .= "document.write('<embed src=\"http://southernwolf.net/sounds/mexshuf.mid\" autostart=\"true\" loop=\"1\"></embed>');}";
$content .= "//-->";
$content .= "</script>";
$content .= "<noscript><embed src=\"http://southernwolf.net/sounds/mexshuf.mid\" autostart=\"true\" loop=\"1\"></embed></noscript>";
$content .= "<noembed><bgsound src=\"http://southernwolf.net/sounds/mexshuf.mid\" loop=1></noembed>.";
?>
|
but this doesn't seem to work well. So I next tried the way American did it:
Code:
<?php
$content = <<<_JS_
<script language="JavaScript"><!--
if(navigator.appName=="Netscape"){
document.write('<embed src="http://southernwolf.net/sounds/mexshuf.mid" autostart="true" loop="1" hidden="true"></embed>');}
else if(navigator.appName=="Microsoft Internet Explorer"){
document.write('<embed src="http://southernwolf.net/sounds/mexshuf.mid" autostart="true" loop="1" hidden="true"></embed>');}
else{
document.write('<embed src="http://southernwolf.net/sounds/mexshuf.mid" autostart="true" loop="1"></embed>');}
//-->
</script>
<noscript><embed src="http://southernwolf.net/sounds/mexshuf.mid" autostart="true" loop="1"></embed></noscript>
<noembed><bgsound src="http://southernwolf.net/sounds/mexshuf.mid" loop=1></noembed>
_JS_;
?>
|
but I got a parse error.
Is there a simple solution to inserting this sort of javascript into nuke that my numbed mind hasn't discerned? Perhaps in my_header.php? Thanks for any insights. |
_________________ Computer Science is no more about computers than astronomy is about telescopes.
- E. W. Dijkstra |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Apr 10, 2004 11:18 am |
|
I have to run out and I can't look at this right now. But, a parse error is just that - a parse error. That's a syntactical error. Look closely for code that has a line break that shouldn't, usually due to a copy and paste problem. Like moving that loop="1" back to the previous line. Things like that. The method I have prescribed ALWAYS works. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
southern
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Apr 10, 2004 1:21 pm |
|
OK, I'll tinker around. I'll let you know how it develops later. Right now I've gotta shuffle off to plant melons... |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Nukeum66
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Apr 10, 2004 4:01 pm |
|
Cool sound! I have it working on my family site I'm building ...
http://ofamily.mycws.org
Let me run another test and I'll tell you how to do this...
Oh I'm Hot linked to the sound file, but I"ll remove it soon..
I don't want ![HitsFan](modules/Forums/images/smiles/icon_hitsfan.gif) |
Last edited by Nukeum66 on Sat Apr 10, 2004 4:21 pm; edited 1 time in total |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Nukeum66
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Apr 10, 2004 4:18 pm |
|
Ok it works fine, so here you go
Saves this as whatever.php (just as it is)and upload it to your includes directory
Code:<script language="JavaScript"><!--
if(navigator.appName=="Netscape"){
document.write('<embed src="http://southernwolf.net/sounds/mexshuf.mid" autostart="true" loop="1" hidden="true"></embed>');}
else if(navigator.appName=="Microsoft Internet Explorer"){
document.write('<embed src="http://southernwolf.net/sounds/mexshuf.mid" autostart="true" loop="1" hidden="true"></embed>');}
else{
document.write('<embed src="http://southernwolf.net/sounds/mexshuf.mid" autostart="true" loop="1"></embed>');}
//-->
</script>
<noscript><embed src="http://southernwolf.net/sounds/mexshuf.mid" autostart="true" loop="1"></embed></noscript>
<noembed><bgsound src="http://southernwolf.net/sounds/mexshuf.mid" loop=1></noembed>
|
then open includes/my_header.php and add this line
Code:include("includes/whatever.php");
|
So it looks like this
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. */
/************************************************************************/
/*
This file is to customize whatever stuff you need to include in your site
when the header loads. This can be used for third party banners, custom
javascript, popup windows, etc. With this file you don't need to edit
system code each time you upgrade to a new version. Just remember, in case
you add code here to not overwrite this file when updating!
Whatever you put here will be between <head> and </head> tags.
*/
include("includes/whatever.php");
?>
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Nukeum66
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Apr 10, 2004 4:44 pm |
|
NOTE!: If you want it to eventually STOP and you will! . Set loop=0 |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
southern
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Apr 10, 2004 7:28 pm |
|
Haha, Nukeum, you were listening to that Mexican Shuffle midi tune? You made me laugh at your crackwise attitude! OK I'll save that as whatever.php 'cause I might change the tune now and then, so whatever... uh, I guess this means another case of Pepsi, right? That makes two so far. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Nukeum66
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Apr 10, 2004 11:37 pm |
|
By whatever.php I meant whatever you what to call it.
Went on a diet so now I'll have Diet Pepsi ... Not Diet Coke! ![Laughing](modules/Forums/images/smiles/icon_lol.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
southern
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Apr 11, 2004 10:44 am |
|
Well, whatever.php is a good enough name, why change a winner? And I changed the loop to 0- I want mindnumbing not insanity provoking. How in the hey am I supposed to get two cases of Diet Pepsi to Memphis? Maybe you can pick it up at a store there... I'll look into it! |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Deseroka
Client
![](modules/Forums/images/avatars/Animaniacs/Animaniacs_-_Stinkbomb.gif)
Joined: Apr 15, 2003
Posts: 466
Location: FL
|
Posted:
Sun Apr 11, 2004 11:08 am |
|
Eeew, Nukeem, why don't you just get some Coke and add water? Pepsi don't have enuff fizz unless it comes from a fountain where they are trying to save $ by addng extra co2 ![Laughing](modules/Forums/images/smiles/icon_lol.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
southern
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Apr 11, 2004 10:15 pm |
|
I think,Nukeum guru, that the site needs a bit more... ah... Caribbean look to go with the sound but its a start.
And everything is Coke in the souf',Deseroka, as you might know there in FL. ![Smile](modules/Forums/images/smiles/icon_smile.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Deseroka
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Apr 11, 2004 10:46 pm |
|
Now you know that in Texas when going to the store you ask
"Wanna Coke?"
"What kind?"
Even Grapette's are Coke's! |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
southern
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Apr 12, 2004 11:26 am |
|
Right! And that's why Nukeum said Pepsi not Coke!
Got another bit of javascript and wonder if it can load the same way as whatever.php:
Code:
<script language="javascript">
<!-- hide
var howMany = 12
var snd = new Array(howMany+1)
snd[0]= "browneyedgirl.mid"
snd[1]= "lyingeyes.mid"
snd[2]= "takeiteasy.mid"
snd[3]= "tamborineman.mid"
snd[4]= "brn-eyed.mid"
snd[5]= "crockrock.mid"
snd[6]= "64.mid"
snd[7]= "thing.mid"
snd[8]= "margt.mid"
snd[9]= "allmyexs.mid"
snd[10]= "taxman.mid"
snd[11]= "whtshdpl.mid"
snd[12]= "navy.mid"
//function to generate a random number between 0 and howMany.
function rndnumber(){
var randscript = -1
while (randscript < 0 || randscript > howMany || isNaN(randscript)){
randscript = parseInt(Math.random()*(howMany+1))
}
return randscript
}
// Code below creates the tag that plays the random sound.>
var randomsub = rndnumber()
var sfile = snd[randomsub]
sfile= "http://southernwolf.net/sounds" + sfile
// Background sound for Internet Explorer.
document.write ('<bgsound src= "' + sfile + '" loop="infinite">')
// Background sound for Netscape Navigator.
if (navigator.appName == "Netscape") {
document.write ('<EMBED src= "' + sfile + '" hidden=true autostart=true loop=true>')
}
//unhide -->
</script>
|
The song names are just examples. Could this go into whatever.php? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Nukeum66
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Apr 12, 2004 12:49 pm |
|
I believe so! try it all you can do is break it! ... LOL! ![Very Happy](modules/Forums/images/smiles/icon_biggrin.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
southern
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Apr 12, 2004 2:35 pm |
|
lol indeed. It's not the breaking I mind so much as the fixing. ![Smile](modules/Forums/images/smiles/icon_smile.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
southern
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Apr 12, 2004 3:45 pm |
|
OK, click the little WWW icon and let me know how your reception is on Planet M16X5, I have a good selection of random tunes for the listening pleasure of visitors to my site, including the interplantary variety. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Nukeum66
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Apr 12, 2004 4:42 pm |
|
Reception here on Planet M16X5 is great! Good Job! The transition affects are cool ... I really liked the Mex-Music. Did you keep it in the selection? ![Shocked](modules/Forums/images/smiles/icon_eek.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Deseroka
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Apr 12, 2004 5:48 pm |
|
I understand how a Pepsi can be a Coke, but I'm not sure how a Coke can be a Pespi. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
southern
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Apr 12, 2004 6:03 pm |
|
Nukeum66 wrote: | Reception here on Planet M16X5 is great! Good Job! The transition affects are cool ... I really liked the Mex-Music. Did you keep it in the selection? |
Of course, it's in the random selection somewhere. I did have to change the code a bit for IE so autostart=true. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Deseroka
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Apr 12, 2004 7:18 pm |
|
What are you running for music? I was by earlier today, but just for a second. I'll have to go back now and check it out. I'm always looking for a new way to pipe music in. Not that many NDN stations out there.........
![Crying or Very sad](modules/Forums/images/smiles/icon_cry.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
southern
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Apr 27, 2004 10:39 am |
|
In my whatever.php I have these set for random play:
ATasteOfHoney.mid 18 k
Blues_Stay_Away_From_Me.mid 47 k
Boom_Boom_Boom.mid 39 k
Brain_Damage.mid 21 k
GoodMorningLittleSchoolGirl.mid 54 k
Great_Gig_in_the_Sky.mid 27 k
Have_a_Cigar.mid 49 k
Hey_You.mid 52 k
Honky_Tonk_Blues.mid 47 k
ISawHerStandingThere.mid 31 k
Little_Red_Rooster.mid 47 k
OneBourbonOneScotchOneBeer.mid 60 k
PleasePleaseMe.mid 25 k
Salty_Dog.mid 25 k
The_Wind_Cries_Mary.mid 28 k
TheresAPlace.mid 25 k
Wish_You_Were_Here.mid 44 k
Yellow_Rose_Of_Texas.mid 6 k
deep_tex.mid 14 k
mexshuf.mid 32 k
Just the right blend of mindnumbing oldies but goodies from jazz, blues, early r&r... |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|