Code:
<script type="text/javascript">
var aod = 0
var aodo = 0
var aodii = 0
var aodr = 0
var ffme = 0
var hts = 0
var lcars = 0
var pp = 0
var rpgsk = 0
var sth = 0
var stbi = 0
var ticity = 0
var gsm = 0
var tifc = 0
var ztext = 0

function expandaod()
{
if (aod == 0)
{
document.getElementById("aod").innerHTML = "&nbsp <span style='cursor: hand' onclick='expandaod()'><img src='/tifreak8x/up.png'></span> &nbsp Age of Darkness I <br> &nbsp &nbsp - <a href='/tifreak8x/aod/story.htm'>Story</a> <br> &nbsp &nbsp - <a href='/tifreak8x/aod/readme.htm'>Readme</a> <br> &nbsp &nbsp - <a href='/tifreak8x/aod/status.htm'>Current Status</a> <br> &nbsp &nbsp - <a href='/tifreak8x/aod/ss.htm'>Screenshots</a> <br> &nbsp &nbsp - <a href='/tifreak8x/aod/dl.htm'>Download</a>"
aod = 1
}
else if (aod == 1)
{
document.getElementById("aod").innerHTML = "&nbsp <span style='cursor: hand' onclick='expandaod()'><img src='/tifreak8x/down.png'></a> &nbsp Age of Darkness I"
archives = 0
}

}

function expandaodii()
{
if (aodii == 0)
{
document.getElementById("aodii").innerHTML = "&nbsp; <span style='cursor: hand' onclick='expandaodii()'><img src='up.png'></span> &nbsp; Age of Darkness II <br> &nbsp; &nbsp; - <a href='/tifreak8x/aod2/story.htm'>Story</a> <br> &nbsp; &nbsp; - <a href='/tifreak8x/aod2/readme.htm'>Readme</a> <br> &nbsp; &nbsp; - <a href='/tifreak8x/aod2/status.htm'>Current Status</a> <br> &nbsp; &nbsp; - <a href='/tifreak8x/aod2/ss.htm'>Screenshots</a> <br> &nbsp; &nbsp; - <a href='/tifreak8x/aod2/dl.htm'>Download</a>"
aodii = 1
}
else if (aodii == 1)
{
document.getElementById("aodii").innerHTML = "&nbsp; <span style='cursor: hand' onclick='expandaodii()'><img src='down.png'</span> &nbsp; Age of Darkness II"
aodii = 0
}

}

function expandaodr()
{
if (aodr == 0)
{
document.getElementById("aodr").innerHTML = "&nbsp <span style='cursor: hand' onclick='expandaodr()'><img src='up.png'></span> &nbsp Age of Darkness Revenge <br> &nbsp &nbsp - <a href='/tifreak8x/aodr/story.htm'>Story</a> <br> &nbsp &nbsp - <a href='/tifreak8x/aodr/readme.htm'>Readme</a> <br> &nbsp &nbsp - <a href='/tifreak8x/aodr/status.htm'>Current Status</a> <br> &nbsp &nbsp - <a href='/tifreak8x/aodr/ss.htm'>Screenshots</a> <br> &nbsp &nbsp - <a href='/tifreak8x/aodr/dl.htm'>Download</a>"
aodr = 1
}
else if (aodr == 1)
{
document.getElementById("aodr").innerHTML = "&nbsp <span style='cursor: hand' onclick='expandaodr()'>+<img src='down.png'></a> &nbsp Age of Darkness Revenge"
aodr = 0
}

}

function expandaodo()
{
if (aodo == 0)
{
document.getElementById("aodo").innerHTML = "&nbsp <span style='cursor: hand' onclick='expandaodo()'><img src='up.png'></span> &nbsp Age of Darkness Original <br> &nbsp &nbsp - <a href='/tifreak8x/aodo/story.htm'>Story</a> <br> &nbsp &nbsp - <a href='/tifreak8x/aodo/readme.htm'>Readme</a> <br> &nbsp &nbsp - <a href='/tifreak8x/aodo/status.htm'>Current Status</a> <br> &nbsp &nbsp - <a href='/tifreak8x/aodo/ss.htm'>Screenshots</a> <br> &nbsp &nbsp - <a href='/tifreak8x/aodo/dl.htm'>Download</a>"
aodo = 1
}
else if (aodo == 1)
{
document.getElementById("aodo").innerHTML = "&nbsp <span style='cursor: hand' onclick='expandaodo()'><img src='down.png'></a> &nbsp Age of Darkness Original"
aodo = 0
}

}

function expandffme()
{
if (ffme == 0)
{
document.getElementById("ffme").innerHTML = "&nbsp <span style='cursor: hand' onclick='expandffme()'><img src='up.png'></span> &nbsp Final Fantasy Magics End <br> &nbsp &nbsp - <a href='/tifreak8x/ffme/story.htm'>Story</a> <br> &nbsp &nbsp - <a href='/tifreak8x/ffme/readme.htm'>Readme</a> <br> &nbsp &nbsp - <a href='/tifreak8x/ffme/status.htm'>Current Status</a> <br> &nbsp &nbsp - <a href='/tifreak8x/ffme/ss.htm'>Screenshots</a> <br> &nbsp &nbsp - <a href='/tifreak8x/ffme/dl.htm'>Download</a>"
ffme = 1
}
else if (ffme == 1)
{
document.getElementById("ffme").innerHTML = "&nbsp <span style='cursor: hand' onclick='expandffme()'><img src='down.png'></a> &nbsp Final Fantasy Magics End"
ffme = 0
}

}

function expandhts()
{
if (hts == 0)
{
document.getElementById("hts").innerHTML = "&nbsp <span style='cursor: hand' onclick='expandhts()'><img src='up.png'></span> &nbsp Hex-2-Sprite <br> &nbsp &nbsp - <a href='/tifreak8x/hts/readme.htm'>Readme</a> <br> &nbsp &nbsp - <a href='/tifreak8x/hts/status.htm'>Current Status</a> <br> &nbsp &nbsp - <a href='/tifreak8x/hts/ss.htm'>Screenshots</a> <br> &nbsp &nbsp - <a href='/tifreak8x/hts/dl.htm'>Download</a>"
hts = 1
}
else if (hts == 1)
{
document.getElementById("hts").innerHTML = "&nbsp <span style='cursor: hand' onclick='expandhts()'><img src='down.png'></a> &nbsp Hex-2-Sprite"
hts = 0
}

}

function expandlcars()
{
if (lcars == 0)
{
document.getElementById("lcars").innerHTML = "&nbsp <span style='cursor: hand' onclick='expandlcars()'>'up.png'></span> &nbsp LCARS Starship Database <br> &nbsp &nbsp - <a href='/tifreak8x/lcars/readme.htm'>Readme</a> <br> &nbsp &nbsp - <a href='/tifreak8x/lcars/status.htm'>Current Status</a> <br> &nbsp &nbsp - <a href='/tifreak8x/lcars/ss.htm'>Screenshots</a> <br> &nbsp &nbsp - <a href='/tifreak8x/lcars/dl.htm'>Download</a>"
lcars = 1
}
else if (lcars == 1)
{
document.getElementById("lcars").innerHTML = "&nbsp <span style='cursor: hand' onclick='expandlcars()'><img src='down.png'></a> &nbsp LCARS Starship Database"
lcars = 0
}

}

function expandpp()
{
if (pp == 0)
{
document.getElementById("pp").innerHTML = "&nbsp <span style='cursor: hand' onclick='expandpp()'><img src='up.png'></span> &nbsp Pokemon Purple <br> &nbsp &nbsp - <a href='/tifreak8x/pokemon/story.htm'>Story</a> <br> &nbsp &nbsp - <a href='/tifreak8x/pokemon/readme.htm'>Readme</a> <br> &nbsp &nbsp - <a href='/tifreak8x/pokemon/status.htm'>Current Status</a> <br> &nbsp &nbsp - <a href='/tifreak8x/pokemon/ss.htm'>Screenshots</a> <br> &nbsp &nbsp - <a href='/tifreak8x/pokemon/dl.htm'>Download</a>"
pp = 1
}
else if (pp == 1)
{
document.getElementById("pp").innerHTML = "&nbsp <span style='cursor: hand' onclick='expandpp()'><img src='down.png'</a> &nbsp Pokemon Purple"
pp = 0
}

}

function expandrpgsk()
{
if (rpgsk == 0)
{
document.getElementById("rpgsk").innerHTML = "&nbsp <span style='cursor: hand' onclick='expandrpgsk()'><img src='up.png'></span> &nbsp RPG Starter Kit <br> &nbsp &nbsp - <a href='/tifreak8x/rpgsk/devguide.htm'>Developer's Guide</a> <br> &nbsp &nbsp - <a href='/tifreak8x/rpgsk/status.htm'>Current Status</a> <br> &nbsp &nbsp - <a href='/tifreak8x/rpgsk/ss.htm'>Screenshots</a> <br> &nbsp &nbsp - <a href='/tifreak8x/rpgsk/dl.htm'>Download</a>"
rpgsk = 1
}
else if (rpgsk == 1)
{
document.getElementById("rpgsk").innerHTML = "&nbsp <span style='cursor: hand' onclick='expandrpgsk()'><img src='down.png'></a> &nbsp RPG Starter Kit"
rpgsk = 0
}

}

function expandsth()
{
if (sth == 0)
{
document.getElementById("sth").innerHTML = "&nbsp <span style='cursor: hand' onclick='expandsth()'><img src='up.png'></span> &nbsp Sprite-2-Hex <br> &nbsp &nbsp - <a href='/tifreak8x/sth/readme.htm'>Readme</a> <br> &nbsp &nbsp - <a href='/tifreak8x/sth/status.htm'>Current Status</a> <br> &nbsp &nbsp - <a href='/tifreak8x/sth/ss.htm'>Screenshots</a> <br> &nbsp &nbsp - <a href='/tifreak8x/sth/dl.htm'>Download</a>"
sth = 1
}
else if (sth == 1)
{
document.getElementById("sth").innerHTML = "&nbsp <span style='cursor: hand' onclick='expandsth()'><img src='down.png'></a> &nbsp Sprite-2-Hex"
sth = 0
}

}

function expandstbi()
{
if (stbi == 0)
{
document.getElementById("stbi").innerHTML = "&nbsp <span style='cursor: hand' onclick='expandstbi()'><img src='up.png'></span> &nbsp Star Trek: Borg Invasion <br> &nbsp &nbsp - <a href='/tifreak8x/stbi/story.htm'>Story</a> <br> &nbsp &nbsp - <a href='/tifreak8x/stbi/readme.htm'>Readme</a> <br> &nbsp &nbsp - <a href='/tifreak8x/stbi/status.htm'>Current Status</a> <br> &nbsp &nbsp - <a href='/tifreak8x/stbi/ss.htm'>Screenshots</a> <br> &nbsp &nbsp - <a href='/tifreak8x/stbi/dl.htm'>Download</a>"
stbi = 1
}
else if (stbi == 1)
{
document.getElementById("stbi").innerHTML = "&nbsp <span style='cursor: hand' onclick='expandstbi()'><img src='down.png'></a> &nbsp Star Trek: Borg Invasion"
stbi = 0
}

}

function expandticity()
{
if (ticity == 0)
{
document.getElementById("ticity").innerHTML = "&nbsp <span style='cursor: hand' onclick='expandticity()'><img src='up.png'></span> &nbsp TI-City <br> &nbsp &nbsp - <a href='/tifreak8x/ticity/story.htm'>Story</a> <br> &nbsp &nbsp - <a href='/tifreak8x/ticity/readme.htm'>Readme</a> <br> &nbsp &nbsp - <a href='/tifreak8x/ticity/status.htm'>Current Status</a> <br> &nbsp &nbsp - <a href='/tifreak8x/ticity/ss.htm'>Screenshots</a> <br> &nbsp &nbsp - <a href='/tifreak8x/ticity/dl.htm'>Download</a>"
ticity = 1
}
else if (ticity == 1)
{
document.getElementById("ticity").innerHTML = "&nbsp <span style='cursor: hand' onclick='expandticity()'><img src='down.png'></a> &nbsp TI-City"
ticity = 0
}

}


function expandtifc()
{
if (tifc == 0)
{
document.getElementById("tifc").innerHTML = "&nbsp <span style='cursor: hand' onclick='expandtifc()'><img src='up.png'></span> &nbsp TI-Freakware's Conversion <br> &nbsp &nbsp - <a href='/tifreak8x/tifc/readme.htm'>Readme</a> <br> &nbsp &nbsp - <a href='/tifreak8x/tifc/status.htm'>Current Status</a> <br> &nbsp &nbsp - <a href='/tifreak8x/tifc/ss.htm'>Screenshots</a> <br> &nbsp &nbsp - <a href='/tifreak8x/tifc/dl.htm'>Download</a>"
tifc = 1
}
else if (tifc == 1)
{
document.getElementById("tifc").innerHTML = "&nbsp <span style='cursor: hand' onclick='expandtifc()'><img src='down.png'></a> &nbsp TI-Freakware's Conversion"
tifc = 0
}

}

function expandztext()
{
if (ztext == 0)
{
document.getElementById("ztext").innerHTML = "&nbsp <span style='cursor: hand' onclick='expandztext()'><img src='up.png'></span> &nbsp ZText <br> &nbsp &nbsp - <a href='/tifreak8x/ztext/readme.htm'>Readme</a> <br> &nbsp &nbsp - <a href='/tifreak8x/ztext/status.htm'>Current Status</a> <br> &nbsp &nbsp - <a href='/tifreak8x/ztext/ss.htm'>Screenshots</a> <br> &nbsp &nbsp - <a href='/tifreak8x/ztext/dl.htm'>Download</a>"
ztext = 1
}
else if (ztext == 1)
{
document.getElementById("ztext").innerHTML = "&nbsp <span style='cursor: hand' onclick='expandztext()'><img src='down.png'></a> &nbsp ZText"
ztext = 0
}

}

</script>

<br><br><div align="center">
<table>
<tr><td width="25%" valign="top">
<table>
<tr><td width="65%" id="aod" align="left">&nbsp <span style="cursor: hand" onclick="expandaod()"><img src="down.png"></span> &nbsp Age of Darkness I</td></tr>
<tr><td id="aodii" align="left">&nbsp <span style="cursor: hand" onclick="expandaodii()"><img src="down.png"></span> &nbsp Age of Darkness II</td></tr>
<tr><td id="aodr" align="left">&nbsp <span style="cursor: hand" onclick="expandaodr()"><img src="down.png"></span> &nbsp Age of Darkness Revenge</td></tr>
<tr><td id="aodo" align="left">&nbsp <span style="cursor: hand" onclick="expandaodo()"><img src="down.png"></span> &nbsp Age of Darkness Original</td></tr>
<tr><td id="ffme" align="left">&nbsp <span style="cursor: hand" onclick="expandffme()"><img src="down.png"></span> &nbsp Final Fantasy Magics End</td></tr>
<tr><td id="hts" align="left">&nbsp <span style="cursor: hand" onclick="expandhts()"><img src="down.png"></span> &nbsp Hex-2-Sprite</td></tr>
<tr><td id="lcars" align="left">&nbsp <span style="cursor: hand" onclick="expandlcars()"><img src="down.png"></span> &nbsp LCARS Starship Database</td></tr>
<tr><td id="pp" align="left">&nbsp <span style="cursor: hand" onclick="expandpp()"><img src="down.png"></span> &nbsp Pokemon Purple</td></tr>
<tr><td id="rpgsk" align="left">&nbsp <span style="cursor: hand" onclick="expandrpgsk()"><img src="down.png"></span> &nbsp RPG Starter Kit</td></tr>
<tr><td id="sth" align="left">&nbsp <span style="cursor: hand" onclick="expandsth()"><img src="down.png"></span> &nbsp Sprite-2-Hex</td></tr>
<tr><td id="stbi" align="left">&nbsp <span style="cursor: hand" onclick="expandstbi()"><img src="down.png"></span> &nbsp Star Trek: Borg Invasion</td></tr>
<tr><td id="ticity" align="left">&nbsp <span style="cursor: hand" onclick="expandticity()"><img src="down.png"></span> &nbsp TI-City</td></tr>
<tr><td id="tifc" align="left">&nbsp <span style="cursor: hand" onclick="expandtifc()"><img src="down.png"></span> &nbsp TI-Freakware's Conversion</td></tr>
<tr><td id="ztext" align="left">&nbsp <span style="cursor: hand" onclick="expandztext()"><img src="down.png"></span> &nbsp ZText</td>


What I am looking to do is take the above code and put it in a file where the page can call it and paste the data, something similar to what Kerm was so kind to do for my site's header.

Is this possible? Would someone be so kind as to take care of it, or give an example of the above code so I can tackle it?

Your help is appreciated. Smile
Here is how i would do it but i don't know if it is the best way or not.

1.Save all the code you pasted including the script tags into a file named whatever.js

2.Then in the page where you want to paste it include this code

Code:

<?php
include("whatever.js");
?>


then to use whichever function you want just call the function in script tags like so

Code:

<script type="text/javascript">
expandaod();
</script>
Close, but wrong.

1. Save all the code you pasted including the script tags into a file named whatever.php, not .js.

2. Then in the page where you want to paste it include this code


Code:
<?php include("whatever.php"); ?>


3. Everything there, including the HTML and JS, will be on any page you put that php code. Remember to change the relative link if it's in a different directory than whatever.php.
you mean I would not have to have any php code within that posted code for that to work? If that is the case, this would make it super easy...
tifreak8x wrote:
you mean I would not have to have any php code within that posted code for that to work? If that is the case, this would make it super easy...
Yup, you have it exactly right. If you include a php file, all it does it insert the contents, parsing any PHP sections that it finds.
I will give that a try here shortly, see how that works out. Smile


Edit:
Does not work, sadly.
tifreak8x wrote:
I will give that a try here shortly, see how that works out. Smile


Edit:
Does not work, sadly.
In what way does it fail?
it does not display.

http://tifreakware.net/tifreak8x/
tifreak8x wrote:
If you look at the page source in a browser, you have <?php include("sidebar.php"); ?>. Is php disabled for your website or something?
Of course php works on my site. Razz How else would I have all the other php like stuff going?
tifreak8x wrote:
Of course php works on my site. Razz How else would I have all the other php like stuff going?
Disabled for that directory then, perhaps? It's failing miserably to actually parse that.
Well, for some reason, it refused to parse anything I put in there, even did <? echo "hello"; ?> in that php include file, still nothing.

Going through and adding document.write( to each line.. Guess I will see if that might work.. Gonna take a while though..
tifreak8x wrote:
Well, for some reason, it refused to parse anything I put in there, even did <? echo "hello"; ?> in that php include file, still nothing.

Going through and adding document.write( to each line.. Guess I will see if that might work.. Gonna take a while though..


Are you putting .php extensions on them? Because you aren't for the index -> http://tifreakware.net/tifreak8x/index.htm (should be index.php)
a, i thought I was forgetting something. Razz And even Kerm did not catch it. XD

Thanks. Wink

Now it displays the echo "hello"; part... going to try the other...
tifreak8x wrote:
<font color=red>censored</font>, i thought I was forgetting something. Razz And even Kerm did not catch it. XD

Thanks. Wink

Now it displays the echo "hello"; part... going to try the other...
Heehee, smart programmers are smart. Good luck with it, I don't see any particular reason why it wouldn't work.
yeah, it displays just fine now. Smile

Now to go through and work on ALL of these pages for the projects section.. <.<

Maybe after getting more done on pokemon Razz
tifreak8x wrote:
yeah, it displays just fine now. Smile

Now to go through and work on ALL of these pages for the projects section.. <.<

Maybe after getting more done on pokemon Razz
Woohoo, glad to hear it, and good luck with the game. Your Pokemons, you can show me them?
Maybe once aod86 is completed, I will go back to pokemonz..
  
 
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

 

Advertisement