vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Database of Codes/Hacks/Mods :: Stop Deleting First Post - View Topic
Topic Rating: *****
Printable View
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Stop Deleting First Post (11th Apr 08 at 2:16pm UTC)
This code will make it so that the person that made the first post in a topic is unable to delete their post. It allows the option to make it so that staff can delete the post or not.

Change the part in red to either true or false. This will alter whether staff can delete the post or not.

<script>

var s = false; //Allow staff to delete the post?

if(get('reply-0','id')){
    var a = get('reply-0','id');
    var u = a.parentNode.previousSibling;
    if(u.getElementsByTagName('a')[0].href.match(/view_profile\/user\/(.+?)(\/$|$)/) && RegExp.$1 == vf_username){
        if(s){
            if(!get('menu_buttons','id').innerHTML.match(/action\/admin/)){
                a.getElementsByTagName('a')[2].style.display = 'none';
            }
        }else{
            a.getElementsByTagName('a')[2].style.display = 'none';
        }
    }
}
</script>


Global Footer
 Printable View

All times are GMT+0 :: The current time is 5:53pm
Page generated in 1.1969 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums