Post by Todge on May 18, 2006 10:09:18 GMT -8
This codes allows the admin to approve any posted links before they are available for others to view...
Put it in your Global Footer..
You need to edit this line with the URL of the approval button you would like added to your site...
var approveButton = 'URL OF BUTTON';
What the code does is replace all the un-approved links in posts with '< Waiting for approval >', if the admin clicks on it, he/she will be taken to the linked site, otherwise it's a dead link...
To approve the link, click the modify button, highlight the URL address (not the tags) and click on the new button you have, modify, and the link is viewable by all...
Put it in your Global Footer..
<script type="text/javascript">
<!--
/*
Posted link approval code, by Todge
Copyright © 2006
Please keep this header intact
*/
// Put the URL of your button below..
var approveButton = 'URL OF BUTTON';
// Put the URL of your button above..
if(location.href.match('action=display') || document.postForm)
{
var post = document.getElementsByTagName('font');
var postLinks;
for(p=0; p<post.length; p++)
{
if((post[p].size=='2' && post[p].innerHTML.match('-- google_ad_section_start --')) || (post[p].size=='1' && post[p].parentNode.width == '100%'))
{
postLinks = post[p].getElementsByTagName('a');
for(l=0; l<postLinks.length; l++)
{
// Find links..
if(!postLinks[l].href.match(location.href.split('.com')[0])&&postLinks[l].innerHTML!='')
{
// Remove non-approved links..
if(!postLinks[l].href.match('/Approved'))
{
postLinks[l].href += '/notApproved';
postLinks[l].innerHTML = '< Waiting for approval >';
}
if(postLinks[l].href.match('/notApproved')&&pb_username != 'admin')
{
postLinks[l].href = document.location.href;
}
if(postLinks[l].href.match('/notApproved')&&pb_username == 'admin')
{
postLinks[l].href = postLinks[l].href.split('/notApproved')[0];
}
// Display approved links..
if(postLinks[l].href.match('/Approved'))
{
postLinks[l].href = postLinks[l].href.split('/Approved')[0];
postLinks[l].innerHTML = postLinks[l].innerHTML.split('/Approved')[0];
}}}}}}
if(document.postForm)
{
if(pb_username=='admin')
{
var button = document.createElement('IMG');
button.setAttribute('src',approveButton);
button.setAttribute('border','0');
approveButton = document.createElement('a');
approveButton.appendChild(button);
approveButton.setAttribute('href','javascript:add("","/Approved")');
document.postForm.color.parentNode.appendChild(approveButton);
}
else
{
document.postForm.message.value = document.postForm.message.value.replace(/\/Approved/g,'');
}}
// -->
</script>
You need to edit this line with the URL of the approval button you would like added to your site...
var approveButton = 'URL OF BUTTON';
What the code does is replace all the un-approved links in posts with '< Waiting for approval >', if the admin clicks on it, he/she will be taken to the linked site, otherwise it's a dead link...
To approve the link, click the modify button, highlight the URL address (not the tags) and click on the new button you have, modify, and the link is viewable by all...