2006-8-17 11:37 PM
[kae′]
【xanga】Private Blogging Script
PLACE IN WEBSITE STATS
<!-- begin code provided by createblog.com -->
<script>
// Private Blogging
// By Paul Chen
// --- Coyote
// Put your list of (exact) names here.
// Make sure they are all lowercase.
// "join" = unregistered viewers
// Go to end of the script and change
// the custom alert message.
var allowed = new Array(
"USERNAME HERE",
"USERNAME HERE",
"USERNAME HERE",
"USERNAME HERE",
"USERNAME HERE"
)
var links = document.getElementsByTagName('a');
name="";
for(i=0;i<links.length;i++)
{
if(links.innerText.match(/xanga/i) && links[i+2].innerText.match(/sign out/i)){
i++;
if(links.href.match('/private/home.aspx') || links.innerText.match('join')){
name = links.innerText.toLowerCase();
break;
}
}
}
enter=false;
for(j=0;j<allowed.length;j++)
{
users = allowed[j];
if(users.indexOf(name)==0 && users.length==name.length){
enter=true;
break;
}
}
if(enter!=true){
alert('Sorry, this is a private blog!'); //change the message
history.go(-1);
}
</script>
<!-- end code provided by createblog.com -->