Post by acoolie530 on Mar 29, 2005 0:17:36 GMT
Name: Add description to posts
Compatibility: Firefox/IE
Preview: Later
Notes:Adds the ability to add a description to your posts. My best code yet ;D
Main Footer
Board Footer
Update: Ok, it works now. I realize that there is a bug where all posts without a description will be given the uppermost description, but when i was able to fix it, it messed up which description went with what board
Compatibility: Firefox/IE
Preview: Later
Notes:Adds the ability to add a description to your posts. My best code yet ;D
Main Footer
<script>
//Add description to threads v1 by Acoolie
//Do not redistribute or claim as own
//This header must stay in tact
var td = document.getElementsByTagName("td")
for(var g=0;g<td.length;g++){
if(td[g].align=="center" && td[g].className=="windowbg2" && td[g].innerHTML.match(/Total Topics/i)){
td[g].innerHTML = td[g].innerHTML.replace(/desc\[(.+?)\]/i,"")
}
}
</script>
Board Footer
<script>
//Add description to threads v1 by Acoolie
//Do not redistribute or claim as own
//This header must stay in tact
var td = document.getElementsByTagName("td")
var tab = document.getElementsByTagName("table")
if(location.href.match(/action=post/i)){
for(var y=0;y<tab.length;y++){
if(tab[y].cellPadding=="3" && tab[y].cellSpacing=="1" && tab[y].className.match("windowbg")){
var row = tab[y].insertRow(1);
var cell = row.insertCell(0);
cell.width="23%";
cell.innerHTML="<font size=2><b>Description (Optional):</b></font>"
var cell2 = row.insertCell(1);
cell2.innerHTML='<input type="checkbox" onClick="javascript:addDescrip();" name="check"><input size="75" id="descri"></input>';
}
}
}
function addDescrip(){
var check = document.getElementsByName("check")
if(document.postmodify.subject.value.match(document.getElementById('descri').value)){}
else{
document.postmodify.subject.value+= " desc[" + document.getElementById('descri').value + "]"
check.value="0";
}
if(check.value="1"){
check.onClick=document.postmodify.subject.maxlength="250"
}
}
for(var f=0;f<td.length;f++){
if(td[f].width=="48%" && td[f].className=="windowbg"){
td[f].innerHTML = td[f].innerHTML.replace(/desc\[(.+?)\]/i,"")
var descrip = RegExp.$1
td[f].innerHTML += "<br/><td><font size='-2'><i>"+descrip+"</i></font></td>"
}
if(td[f].vAlign=="middle" && td[f].align=="left" && td[f].innerHTML.match(/desc\[(.+?)\]/i)){
td[f].innerHTML = td[f].innerHTML.replace(/desc\[(.+?)\]/i,"")
}
}
</script>
Update: Ok, it works now. I realize that there is a bug where all posts without a description will be given the uppermost description, but when i was able to fix it, it messed up which description went with what board