Hi, i'm new here and hope i can explain myself clearly,
i have a ezboard and want to use java script to put my name in the who's online section even when i'm offline,
that way when members come to the board they think i'm actually there when i'm not,
i would appreciate any help, thanxx Amanda
Khalid Ali
06-25-2003, 01:13 PM
I am presuming that your MSB is written in some other programming lang...and the html is generated by that server side app? is that true?
if it is then you will not have control over it unless you do this on the server side.
Amanda360
06-25-2003, 02:20 PM
hi khalid,
i'm a real novice to the world of java scripting but one of the scripters at the ez board help forums said it was possible
heres a little of his post to me
post it in the Javascript Help forum and no doubt one of the scripters will come to your rescue. :)
>
>my idea for the script would be, if whoseonline is empty or does not include/display your username, the script writes your username within the whoseonline as if you are online, if whoseonline has your username in, do nothing.
>
i can post my source code if you need it, honestly i don't know what server side language it uses but i've added all the scripts and css on the client side
pyro
06-25-2003, 02:40 PM
Yes, post your code, please. Although, as Khalid said, you'd be better off doing it server side, in whichever language ezboard is written in in the first place.
Amanda360
06-25-2003, 03:08 PM
Hello Pyro and thank you for your insight,
heres my board url,
http://pub39.ezboard.com/bhoshossurfshop
i tried to post the source code but its way to much, please forgive some scripting errors i have, i haven't had the time to correct them:o
pyro
06-25-2003, 04:03 PM
Ok, I took a look at the page... I think something like this should work:
<script type="text/javascript">
function getUsers() {
online = document.getElementById("usersonline"); //get the reference to the <div>
if (!/Amanda360/.test(online.innerHTML)) { //test if your username is not in the <div>
online.innerHTML += " . <A HREF=http://pub39.ezboard.com/uamanda360.showPublicProfile><FONT FACE=\"Verdana,Arial\" SIZE=1>Amanda360</FONT></A>"; //if not, append it to the end
}
}
window.onload = getUsers; //after page has loaded, run this getUsers function.
</script>
Note that you have to put a <div> around the contents of the users online with an id of "usersonline". The user that I have in there, are just the first one that was on when I visited that page... just to test it, and show you where the users need to go in the above code.
Amanda360
06-25-2003, 05:01 PM
Thank you Pyro, the code works perfectly but i'm an idiot when it comes to placing it,
the html section is divided up into
head - where i have the css
body - where i have my flash movies and most other java scripts
footer -
i placed the code in the head and it put the name at the top of my board, should i add it to the body?
sorry for asking these stupid questions but all this is still new to me
but thanks so much for your typing this code up for me, i appreciate it much
pyro
06-25-2003, 05:05 PM
It goes in the <body>. Replace this code (Lines 2869-2873):
// detect plugin for NS flash 3 version
if (bName=="Netscape")
{
if (navigator.plugins["Shockwave Flash 2.0"]) {ver = "2.0"}
else if(navigator.plugins["Shockwave Flash"]) {ver = "3.0"}
else {flashver = navigator.plugins["Shockwave Flash"].description.substring(16,19);}
test=navigator.plugins["Shockwave Flash"].description.substring(16,19);
if (test>0) {ver=test;}
}
else { action = "ie_exec" }
bver=0;
if (navigator.appVersion.indexOf('3.')!=-1) {bver=3}
if (navigator.appVersion.indexOf('4.')!=-1) {bver=4}
if (navigator.appVersion.indexOf('5.')!=-1) {bver=5}
if (navigator.appVersion.indexOf('6.')!=-1) {bver=6}
//-->
</SCRIPT>
<SCRIPT LANGUAGE="VBScript"***>
<!--
on error resume next
If action = "ie_exec" then
flashver2=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2")))
flashver3=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3")))
flashver4=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")))
flashver5=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")))
flashver6=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")))
End If
//-->
</SCRIPT***>
<***SCRIPT LANGUAGE="JavaScript">
<!-- Actions
if(flashver2) {ver=2};
if(flashver3) {ver=3};
if(flashver4) {ver=4};
if(flashver5) {ver=5};
if(flashver6) {ver=6};
if (ver<minimumver)
{
if (bver>=4) {alert('This page requires ShockWave Flash Plug-In.\n \n Press OK to install the Plug-In')}// Flash can be installed automatic
<***HTML>
<***HEAD>
<TITLE>Click File and save if this page is OK - Hit the backbutton to change settings.</TITLE>
<!-- ** THIS PAGE EMBEDS A FLASHMOVIE IN A HTML-DOCUMENT ** -->
<!-- ** THE CODE IS PRODUCED AUTOMATIC BY THE TOOL AT: EchoEcho.Com/toolflashembedder.htm ** -->
<!-- ** NOTE: The code to embed the file is divided into two sections ** -->
<!-- ** The first section MUST be placed in the HEAD-section of the document. ** -->
<!-- ** The second section MUST be placed in the BODY-section of the document. ** -->
<!-- ** Below follows the two sections: ** -->
<!-- *********** START OF FLASHEMBEDDING CODE TO BE PLACED IN THE HEAD OF YOUR PAGE *********** -->
// detect plugin for NS flash 3 version
if (bName=="Netscape")
{
if (navigator.plugins["Shockwave Flash 2.0"]) {ver = "2.0"}
else if(navigator.plugins["Shockwave Flash"]) {ver = "3.0"}
else {flashver = navigator.plugins["Shockwave Flash"].description.substring(16,19);}
test=navigator.plugins["Shockwave Flash"].description.substring(16,19);
if (test>0) {ver=test;}
}
else { action = "ie_exec" }
bver=0;
if (navigator.appVersion.indexOf('3.')!=-1) {bver=3}
if (navigator.appVersion.indexOf('4.')!=-1) {bver=4}
if (navigator.appVersion.indexOf('5.')!=-1) {bver=5}
if (navigator.appVersion.indexOf('6.')!=-1) {bver=6}
//-->
</SCRIPT***>
<***SCRIPT LANGUAGE="VBScript">
<!--
on error resume next
If action = "ie_exec" then
flashver2=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2")))
flashver3=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3")))
flashver4=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")))
flashver5=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")))
flashver6=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")))
End If
//-->
</SCRIPT***>
<***SCRIPT LANGUAGE="JavaScript">
<!-- Actions
if(flashver2) {ver=2};
if(flashver3) {ver=3};
if(flashver4) {ver=4};
if(flashver5) {ver=5};
if(flashver6) {ver=6};
if (ver<minimumver)
{
if (bver>=4) {alert('This page requires ShockWave Flash Plug-In.\n \n Press OK to install the Plug-In')}// Flash can be installed automatic
<!-- *********** END OF FLASHEMBEDDING CODE TO BE PLACED IN THE HEAD OF YOUR PAGE *********** -->
</head***>
<body bgcolor="White">
<!-- *********** START OF FLASHEMBEDDING CODE TO BE PLACED IN THE BODY OF YOUR PAGE *********** -->
<***OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=3,0,0,0" ID=ECHOECHO WIDTH=336 HEIGHT=280><PARAM NAME=movie VALUE="http://i.i.com.com/cnwk.1d/Ads/1662/11/5/20030620/1/traod_mpu_out.swf">
<PARAM NAME=quality VALUE=AUTOLOW>
<PARAM NAME=play VALUE=true>
<PARAM NAME="wmode" value="transparent">
<PARAM NAME=menu VALUE=false>
<***SCRIPT LANGUAGE=JavaScript>
<!--
function checkForShockwave()
{
navigator.plugins.refresh();
if ( navigator.plugins["Shockwave Flash"] ){
parent.location.reload();
} else {
setTimeout( "checkForShockwave()", 1000 );
}
}
var ShockMode = 0;
if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
if (navigator.plugins && navigator.plugins["Shockwave Flash"])
ShockMode = 1;
}
if (!ShockMode && navigator.appName && navigator.appName.indexOf("Netscape") != - 1 && navigator.appVersion.indexOf("4.") != - 1
&& navigator.javaEnabled() && netscape.softupdate.Trigger.UpdateEnabled() && document.cookie.indexOf("StartedShockwaveInstall") == -1) {
var jarPath = new String("");
if (navigator.platform.indexOf("Win32") >= 0 )
jarPath = "http://download.macromedia.com/pub/shockwave/jars/english/silentflash32.jar"
else if (navigator.platform.indexOf("Win16") >= 0 )
jarPath = "http://download.macromedia.com/pub/shockwave/jars/english/silentflash16.jar"
else if (navigator.platform.indexOf("MacPPC") >= 0 )
jarPath = "http://download.macromedia.com/pub/shockwave/jars/english/silentflashppc.jar"
if (jarPath.length) {
netscape.softupdate.Trigger.StartSoftwareUpdate (jarPath, netscape.softupdate.Trigger.FORCE_MODE);
document.cookie='StartedShockwaveInstall;path=/;'
setTimeout("checkForShockwave()", 1000);
}
}
//-->
</SCRIPT***>
<EMBED SRC="http://i.i.com.com/cnwk.1d/Ads/1662/11/5/20030620/1/traod_mpu_out.swf" swLiveConnect=FALSE WIDTH=336 HEIGHT=280 QUALITY=AUTOLOW MENU=false PLAY=true BGCOLOR=#FFFFFF TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</EMBED>
</OBJECT>
<!-- *********** END OF FLASHEMBEDDING CODE *********** -->
</BODY***></HTML***>
Well, I hate to tell you this, but you are going to have to go into the code that is running ez board and make the changes. I'm not familiar with ez board, so I can't tell you where that would be.
Originally posted by pyro
Well, I hate to tell you this, but you are going to have to go into the code that is running ez board and make the changes. I'm not familiar with ez board, so I can't tell you where that would be.
oh, well that sucks, thanks then Pyro
i mean your code works perfectly, its just not in the right place
pyro
06-25-2003, 06:31 PM
You're welcome, and good luck. :)
webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved.