Post by acoolie530 on Apr 18, 2005 20:14:06 GMT
Name: Add descriptions to posts v2
Compatibility: Firefox/IE
Edit: None
Placement: Main & Board Footers
Notes: I know that it is a little close to the original to update but... this version is much better. It was a complete recode so i didnt modify the first version. What this does is add a little message beneath the thread title on the board page. You can either have the title be w/e you want, or you can have the title be the first few words of your post. I hope you like it ;D
Main Footers
Board Footers
Compatibility: Firefox/IE
Edit: None
Placement: Main & Board Footers
Notes: I know that it is a little close to the original to update but... this version is much better. It was a complete recode so i didnt modify the first version. What this does is add a little message beneath the thread title on the board page. You can either have the title be w/e you want, or you can have the title be the first few words of your post. I hope you like it ;D
Main Footers
<script>
//Add description to threads v1 by Acoolie
//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 Footers
<script>
//Add description to threads v2 by Acoolie
//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 size="40" id="descri"></input>';
}
}
}
if(location.href.match(/board=(.+?)&action=post/i) && !location.href.match(/board=(.+?)&action=post&thread=/i)){
document.postmodify.onsubmit = function(){
document.postmodify.subject.maxlength="250"
if(document.getElementById('descri').value.match(/\S+/i)){
document.postmodify.subject.value+= " desc[" + document.getElementById('descri').value + "]"
} else {
if(document.postmodify.message.value.match(/.{40,10000}/i)){
var newdes = (document.postmodify.message.value.match(/(.{0,40})\s/i)) ? RegExp.$1:"";
} else {
var newdes = (document.postmodify.message.value.match(/(.{0,40})/i)) ? RegExp.$1:"";
}
document.postmodify.subject.value+= " desc[" + newdes + "]"
}
}
}
for(var x=0;x<td.length;x++){
if(td[x].innerHTML.match(/desc\[(.+?)\]/i) && td[x].width=="48%" && td[x].className=="windowbg"){
var des = RegExp.$1
td[x].innerHTML = td[x].innerHTML.split("desc["+des)[0]+"</a><br/><font size='-4'>"+des+"</font>"
}
}
document.title = document.title.replace(/desc\[(.+?)\]/i,"")
if(location.href.match(/num=\d+/i)){
td[1].innerHTML = td[1].innerHTML.replace(/desc\[(.+?)\]/i,"")
for(var j=0;j<td.length;j++){
if(td[j].innerHTML.match(/Pages:/i) && td[j].className=="titlebg"){
td[j-3].innerHTML = td[j-3].innerHTML.replace(/desc\[(.+?)\]/i,"")
}
}
for(var a=0;a<td.length;a++){
if(td[a].width=="80%" && td[a].vAlign=="middle" && td[a].className=="catbg" && td[a].innerHTML.match(/Topic:/i)){
td[a].innerHTML = td[a].innerHTML.replace(/desc\[(.+?)\]/i,"")
}
}
for(var f=0;f<td.length;f++){
if(td[f].vAlign=="top" && td[f].width=="80%" && td[f].innerHTML.match(/desc\[(.+?)\]/i)){
td[f].innerHTML = td[f].innerHTML.replace(/desc\[(.+?)\]/i,"")
}
}
}
</script>