Post by ŠΗäMΘηΘ on Jul 5, 2008 19:55:14 GMT -8
Name: Hidden Messages from Guests
Creator: Shamono
Cross Browser: Yes
Placement: Global Footer
Description: Kinda the opposite of the last code I submitted. It hides messages you define from guests and only shows them to registered members. Note: there will always be a way around it.
var button = "http://i28.tinypic.com/2ep4uat.gif";
URL to the button for the UBBC inserted.
var before = '<table width="92%" cellspacing="1" cellpadding="0" border="0" align="center" bgcolor="000000" class="bordercolor"><tr><td class="titlebg"><b>Protected Message:</b></td></tr><tr><td align="center" class="windowbg">';
What will be before the hidden message.
var after = "</td></tr></table>";
What comes after the hidden message.
Creator: Shamono
Cross Browser: Yes
Placement: Global Footer
Description: Kinda the opposite of the last code I submitted. It hides messages you define from guests and only shows them to registered members. Note: there will always be a way around it.
<script type="text/javascript">
/* Hidden Messages from Guests
Coded by Shamono
Open Source*/
//Edit Variables here
var button = "http://i28.tinypic.com/2ep4uat.gif";
var before = '<table width="92%" cellspacing="1" cellpadding="0" border="0" align="center" bgcolor="000000" class="bordercolor"><tr><td class="titlebg"><b>Protected Message:</b></td></tr><tr><td align="center" class="windowbg">';
var after = "</td></tr></table>";
//Do not edit Below
var TD = document.getElementsByTagName('td');
var find = /\[noguest\](.+?)\[\/noguest\]/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('[noguest]');
document.postForm.message.value='';
for(x=1;x<fbegin.length;x++){
fbegin[x]=fbegin[x].split('/noguest]');
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("[noguest]","[/noguest]")><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+'---You must be a *registered user* to view this message---'+after+'');
}else{
TD.item(m).innerHTML = TD.item(m).innerHTML.replace(find, ''+before+'$1'+after+'');
}}}}
</script>
var button = "http://i28.tinypic.com/2ep4uat.gif";
URL to the button for the UBBC inserted.
var before = '<table width="92%" cellspacing="1" cellpadding="0" border="0" align="center" bgcolor="000000" class="bordercolor"><tr><td class="titlebg"><b>Protected Message:</b></td></tr><tr><td align="center" class="windowbg">';
What will be before the hidden message.
var after = "</td></tr></table>";
What comes after the hidden message.