Post by ŠΗäMΘηΘ on Jul 2, 2008 21:55:06 GMT -8
Creator: Shamono
Placement: Global Footers
Description: Adds a button the inserts [guest] tags. Anything wrapped in the tags will be hidden from members and only shown to guests. It's a simple little code so do what ever with it.
Edit these variables.
var button = "http://i28.tinypic.com/2ep4uat.gif";
The url to the button for adding in the [guest] tag. You can use mine if you want.
var before = "<b>Guest Message:</b><br />";
The text to appear before the message. Can be left blank.
var after = "";
The text to appear after the message. Can be left blank.
var members = "";
The text to appear to members. Can be left blank.
Placement: Global Footers
Description: Adds a button the inserts [guest] tags. Anything wrapped in the tags will be hidden from members and only shown to guests. It's a simple little code so do what ever with it.
<script type="text/javascript">
/* Guest Messages in Posts
Coded by Shamono
Open-Source */
//Edit Variables here
var button = "http://i28.tinypic.com/2ep4uat.gif";
var before = "<b>Guest Message:</b><br />";
var after = "";
var members = "";
//Do not edit Below
var TD = document.getElementsByTagName('td');
var find = /\[guest\](.+?)\[\/guest\]/gi
if(document.postForm){
for(a=0;a<TD.length;a++){
if(TD[a].width == "30%" && TD[a].innerHTML.match(/Add Tags:/i)){
if(location.href.match('quote=')){
fbegin = document.postForm.message.value.split('[guest]');
document.postForm.message.value='';
for(x=1;x<fbegin.length;x++){
fbegin[x]=fbegin[x].split('/guest]');
fbegin[x][0]='';
fbegin[x]=fbegin[x].join('');
}
document.postForm.message.value=fbegin.join('');
}
TD[a+1].getElementsByTagName('font')[0].innerHTML+='<a href=javascript:add("[guest]","[/guest]")><img src="'+button+'" alt="Guest" border="0"/>'
break;
}}}
if(location.href.match(/&thread=/)) {
for(m=0;m<TD.length;m++) {
if(((TD.item(m).colSpan == '3' && TD.item(m).firstChild.width == '100%') || (TD.item(m).width == '100%' && TD.item(m).className == 'windowbg2')) && TD.item(m).innerHTML.match(find)) {
if(pb_username == 'Guest'){
TD.item(m).innerHTML = TD.item(m).innerHTML.replace(find, ''+before+'$1'+after+'');
}else{
TD.item(m).innerHTML = TD.item(m).innerHTML.replace(find, ''+members+'');
}}}}
</script>
Edit these variables.
var button = "http://i28.tinypic.com/2ep4uat.gif";
The url to the button for adding in the [guest] tag. You can use mine if you want.
var before = "<b>Guest Message:</b><br />";
The text to appear before the message. Can be left blank.
var after = "";
The text to appear after the message. Can be left blank.
var members = "";
The text to appear to members. Can be left blank.