MyBB Community Forums

Full Version: Help with template change.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I have added this code into my header template and it works fine in Firefox but not in I.E. Any ideas?

<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr><td class="thead"><strong>Latest Park Information</strong></td></tr>
<tr><td class="trow1">
<div align="center"> <a <!--
body {
background-color: #000000;
}
-->
</style><style type="text/css">
<!--
body {
}
-->

</style></head>
<body background-color="#FFFFFF" onLoad="StartTexte()">
<p align="center" style="text-align: center;">
<div align="center"></div>
</p>
<div align="center">
<script language="JavaScript">
<!--

var max=0;
function textlist()
{
max=textlist.arguments.length;
for (i=0; i<max; i++)
this[i]=textlist.arguments[i];
}

tl=new textlist
(
" Current Closed rides & attractions: ",
" Alton Towers: ",
" Awaiting update. ",
" Alton Towers Hotels & other attractions: ",
" Awaiting update. ",
" Thorpe Park ",
" All rides reported open. ",
" Chessington ",
" All rides reported open. "
);

var text_x=0; pos=0;
var l=tl[0].length;

function textticker()
{
document.form1.textfeld.value=tl[text_x].substring(0,pos)+"_";

if(pos++==l)
{
pos=0;
setTimeout("textticker()",2000);
text_x++;
if(text_x==max)
text_x=0;
l=tl[text_x].length;
} else
setTimeout("textticker()",50);
}

function StartTexte()
{
textticker();
}

// -->
Maybe IE can't decipher the comments and FF is ignoring them.. Sad

What is this supposed to do ?

Quote:</style><style type="text/css">
<!--
body {
}
-->

</style></head>

Or this ??

Quote:<script language="JavaScript">
<!--

With the ending .js wrapper

// -->

If you are commenting strings out, then you may as well delete them..

And .js uses different comment wrappers to html, much like .css uses different ones again.
Lopalong Wrote:What is this supposed to do ?

Well its a board message that looks like it is being typed. What do you suggest the finished code should be.
Thanks for your help so far.
I'd rather see the original script, not something that's been changed. Wink

Do you have the original .html file or the source file you got ir from. ?
Here is the original script -

<!--
body {
background-color: #000000;
}
-->
</style><style type="text/css">
<!--
body {
}
-->

</style></head>
<body background-color="#000000" onLoad="StartTexte()">
<p align="center" style="text-align: center;">
<div align="center"></div>
</p>
<div align="center">
<script language="JavaScript">
<!--

var max=0;
function textlist()
{
max=textlist.arguments.length;
for (i=0; i<max; i++)
this[i]=textlist.arguments[i];
}

tl=new textlist
(
" Hi, man! ",
" How are u? ",
" You read my announcement now =) ",
" This modification by ",
" AoRGuN ",
" Contact: [email protected] ",
" www.mybbdestek.com - www.mybbhackers.com - www.avrupayakasi-fan.com vs... =) ",
" Who is me? ",
" I'm MyBB Maniac =) AoRGuN, respect..."
);

var text_x=0; pos=0;
var l=tl[0].length;

function textticker()
{
document.form1.textfeld.value=tl[text_x].substring(0,pos)+"_";

if(pos++==l)
{
pos=0;
setTimeout("textticker()",2000);
text_x++;
if(text_x==max)
text_x=0;
l=tl[text_x].length;
} else
setTimeout("textticker()",50);
}

function StartTexte()
{
textticker();
}

// -->
</script>
</div>
<p align="center" style="text-align: center">
<form name="form1" style="text-align: center">
<div align="center">
<input type="text" STYLE="border: none; background-color: #000000;
color: #F3F3F3; font-size: 16px; font-family: monospace;" size="72" name="textfeld" value="" readonly="readonly">

</div>
</form>
<div align="center">
</p>

</div>
</body>
</html>
Try these as it should do all that you want it to do.

The headliner.html is original from http://javascript.internet.com/

headliner2.html shows the simple input changes I made so that it acts like a typewriter with all of the strings. Wink
Ok thanks for your help i will try that tonight.
PM me if you need any help splitting the .js and writing the MyBB tables to slot it in. Wink
Oh ummm now you have lost me!
Simple.. Wink

Cut the .js to a file called /jscripts/headline.js

Set the path in the header to the headline.js

Rewrite the .html to a template and call it with a variable from a core-file with a template-qualified eval statement.

Or just write the .html into the template >> header or index etc.. wherever you want to put it.

Want some help ?? Toungue

It's easy really... But let's just re-qualify that it's supposed to look like the message is being typed one letter at a time.. is that correct ?

If so, I'll try to organise a demo on my site using the text-insert's from your original script and see if that's what you want. And then we can take it from there. Smile
Pages: 1 2