Post by SuperJedi224 on Sept 8, 2012 14:48:52 GMT -8
Hi guys this is actually my first pro-boards code.
What it does: Creates an image that, when clicked, is replaced with a string listing the item(s) in the "treasure chest" and a link to a prefilled PM form. If they choose to submit the form, the person on the receiving end should be able to give them the specified items. This started out a lot shorter, but it should still be easy enough to use.
The code:
<Begin Code>
<div align="center">
<p id="imagehere"></p>
<p style="font-size:14px" id="contentshere"></p>
<p style="font-size:12px" id="linkhere"></p>
<p style="font-size:9px" id="coderlink"></p>
</div>
<script type="text/javascript">
//Treasure Chest V1.0 by SuperJedi224
//May be reposted as long as this header remains intact
//Edit only as specified
//edit these
var linktext="You found a chest! Click here to claim your prize."
var itemname="Something"
var linknote="hi"
var boximgurl='"http://thesj224filerepository.wikispaces.com/file/view/Treasure.png/363067968/Treasure.png"'
var boximgwidth="'30'"
var boximgheight="'25'"
var messagesendto="admin"
var messagesubject="I%20have%20found%20it."
var messagetext="The%20treasure%20is%20mine."
var imagehover="Click Me"
//not these
var thalink="?action=pmsend&to="+messagesendto+"&subject="+messagesubject+"&message="+messagetext
function thaFunction()
{
document.getElementById("linkhere").innerHTML="<a href="+thalink+">"+linktext+"</a><br/>"+linknote;
document.getElementById("imagehere").innerHTML=""
document.getElementById("contentshere").innerHTML="Obtained: "+itemname
document.getElementById("coderlink").innerHTML=""
}
document.getElementById("imagehere").innerHTML="<img alt="+imagehover+" title="+imagehover+" src="+boximgurl+" width="+boximgwidth+" height="+boximgheight+" onclick='thaFunction()'/>"
document.getElementById("coderlink").innerHTML="<a href=http://sjproductions.proboards.com/index.cgi?action=viewprofile&user=admin>Treasure chest coded by SuperJedi224</a>"
</script>
<End Code>
Placement: Any header or footer- but I do not suggest global or main, that would make finding it much too easy.
Editing: In the section marked "edit these" and the "align" property of the div tag. NOWHERE ELSE. The variables should be self explanatory. In messagesubject and messagetext, remember to replace every space with "%20", otherwise it won't work properly.
Preview: A preview minus the PM link.
Note: This copy of the code is likely to be updated first and most often.
What it does: Creates an image that, when clicked, is replaced with a string listing the item(s) in the "treasure chest" and a link to a prefilled PM form. If they choose to submit the form, the person on the receiving end should be able to give them the specified items. This started out a lot shorter, but it should still be easy enough to use.
The code:
<Begin Code>
<div align="center">
<p id="imagehere"></p>
<p style="font-size:14px" id="contentshere"></p>
<p style="font-size:12px" id="linkhere"></p>
<p style="font-size:9px" id="coderlink"></p>
</div>
<script type="text/javascript">
//Treasure Chest V1.0 by SuperJedi224
//May be reposted as long as this header remains intact
//Edit only as specified
//edit these
var linktext="You found a chest! Click here to claim your prize."
var itemname="Something"
var linknote="hi"
var boximgurl='"http://thesj224filerepository.wikispaces.com/file/view/Treasure.png/363067968/Treasure.png"'
var boximgwidth="'30'"
var boximgheight="'25'"
var messagesendto="admin"
var messagesubject="I%20have%20found%20it."
var messagetext="The%20treasure%20is%20mine."
var imagehover="Click Me"
//not these
var thalink="?action=pmsend&to="+messagesendto+"&subject="+messagesubject+"&message="+messagetext
function thaFunction()
{
document.getElementById("linkhere").innerHTML="<a href="+thalink+">"+linktext+"</a><br/>"+linknote;
document.getElementById("imagehere").innerHTML=""
document.getElementById("contentshere").innerHTML="Obtained: "+itemname
document.getElementById("coderlink").innerHTML=""
}
document.getElementById("imagehere").innerHTML="<img alt="+imagehover+" title="+imagehover+" src="+boximgurl+" width="+boximgwidth+" height="+boximgheight+" onclick='thaFunction()'/>"
document.getElementById("coderlink").innerHTML="<a href=http://sjproductions.proboards.com/index.cgi?action=viewprofile&user=admin>Treasure chest coded by SuperJedi224</a>"
</script>
<End Code>
Placement: Any header or footer- but I do not suggest global or main, that would make finding it much too easy.
Editing: In the section marked "edit these" and the "align" property of the div tag. NOWHERE ELSE. The variables should be self explanatory. In messagesubject and messagetext, remember to replace every space with "%20", otherwise it won't work properly.
Preview: A preview minus the PM link.
Note: This copy of the code is likely to be updated first and most often.