Post by Matt on Apr 20, 2006 17:49:28 GMT -5
This code will create a PM Summary on the reply or quote page that looks like the Topic Summary on the regular posting page. This code has it's limits because of cookie size limits. This means that very long PMs will not have a PM summary. There is no need to edit this code.
Created By: Wonder
Main Footer
Created By: Wonder
Main Footer
<script>
//PM Summary v1.0 [CB]
//Copyright 11-14-2005 by ~Wonder
//May be reposted anywhere as long as this header remains in tact
if(location.href.match(/action\=pmview/))
{
td=document.getElementsByTagName("td");
for(i=0;i<td.length;i++){if(td[i].width=="20%" && td[i].className.match(/windowbg/)){break;}}
id=location.href.split("id=")[1].replace(/[^\d]/,"");
from=td[i].getElementsByTagName("a")[0].innerHTML;
s=(td[i].nextSibling.firstChild.firstChild.firstChild.childNodes[1].firstChild.firstChild.innerHTML.indexOf("Re:")==0)?1:0;
td[i].nextSibling.firstChild.firstChild.firstChild.childNodes[1].childNodes[2].innerHTML.match(/Message sent on (.+?) ยป/);time=RegExp.$1;
message=td[i].nextSibling.firstChild.firstChild.childNodes[1].firstChild.lastChild.innerHTML.replace(/<!-- google_ad_section_(.+?) -->/ig,"");
if(message.length<3000){document.cookie = "i="+escape(id)+";";document.cookie = "f="+escape(from)+";";document.cookie = "su="+escape(s)+";";document.cookie = "t="+escape(time)+";";document.cookie = "m="+escape(message)+";";}
}
else if(location.href.match(/action\=pmsend&/))
{
id="";if(document.cookie.match(/i\=/)){id=document.cookie.split("i=")[1].split(";")[0];}
if(id.length>0 && location.href.match("="+id))
{
if(document.cookie.match(/f\=/)){from=unescape(document.cookie.split("f=")[1].split(";")[0]);}
if(document.cookie.match(/t\=/)){time=unescape(document.cookie.split("t=")[1].split(";")[0]);}
if(document.cookie.match(/s\=/)){s=unescape(document.cookie.split("su=")[1].split(";")[0]);}
if(document.cookie.match(/m\=/)){message=unescape(document.cookie.split("m=")[1].split(";")[0]);}
s=(s==1)?"Re:":"";o=document.postForm.parentNode.insertRow(-1);p=o.insertCell(0);p.className="windowbg2";
p.innerHTML='<br><br><table border="0" width="100%" cellspacing="0" cellpadding="0" class="bordercolor"><tr><td><table cellpadding="4" cellspacing="1" border="0" width="100%"><tr><td width="100%" class="titlebg"><font size="2"><b>Private Message Summary</b></font></td></tr><tr><td width="100%" class="windowbg"><font size="2">Posted by <a href="/index.cgi?action=viewprofile&user='+document.postForm.to.value+'">'+from+'</a> on '+time+'</font></td></tr><tr><td width="100%" class="windowbg2"><font size="2">Subject: '+s+document.postForm.subject.value.substring(3,document.postForm.subject.value.length)+'</font></td></tr><tr><td width="100%" class="windowbg2"><font size="1">'+message+'</font></td></tr></table></td></tr></table>';
}
}
</script>