Exetools  

Go Back   Exetools > General > Source Code

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 12-21-2022, 11:18
atom0s's Avatar
atom0s atom0s is offline
Family
 
Join Date: Jan 2015
Location: 127.0.0.1
Posts: 383
Rept. Given: 26
Rept. Rcvd 116 Times in 59 Posts
Thanks Given: 54
Thanks Rcvd at 687 Times in 269 Posts
atom0s Reputation: 100-199 atom0s Reputation: 100-199
Forum Posts Hider (Javascript)

Over the last few years, I've personally tweaked sites to my preference such as customizing how they look, adding useful shortcuts/features through Javascript injection and so on. One of the scripts I wrote (for two types of forum systems) is used to hide users' posts. This lets you 'block' someone and hides their content so you don't have to deal with their posts.

One of the main reasons I made these scripts was to hide certain members that would prefer to be the center of attention, have their ego's stroked as much as possible, or all around just treat other members like shit. Rather than feel the need to endlessly report posts on said forums, it's easier imo to just not have to see their garbage in the first place.

I've cleaned these scripts up and made sure they worked on the two main/public RE sites most people find via Google. (exetools and tuts4you) These should work on any other website using the same forum systems. You may need to tweak them slightly if the site is using a custom theme.

In order to use these, you will need an extension for your browser that can inject Javascript. I use Chrome and prefer using CJS to do this, which you can find here:

Code:
https://chrome.google.com/webstore/detail/custom-javascript-for-web/ddbjnfjiigjmcpcpkmhogomapikjbjdk
Also note, if the target site does not use jQuery you will need to enable it on CJS, or your extension of choice. CJS has an option to also inject jQuery with your code.

Script For vBulletin 3.8.x - Tested On exetools

PHP Code:
/**
 * Hide User Posts (vBulletin 3.8.x) - by atom0s
 *
 * This is a simple piece of Javascript that will hide given users' posts from being visible.
 * This script was made for and tested on, exetools.
 */

// The list of users' names whose posts should be hidden..
var names = ['SomeRandomUserNameHere1234''SomeRandomUserNameHere1234''SomeRandomUserNameHere1234''SomeRandomUserNameHere1234'];

// Don't edit below this line if you don't know what you're doing!
$.each(names, function (in) {
    
// Find all posts on the page that belong to the current user being iterated..
    
$(`a:contains("${n}").bigusername`).each(function () {
        
// Obtain the parent post div..
        
var obj = $(this).closest('div.page');

        
// Alter the posts color to stand out when visible and hide it..
        
obj.css('background-color''#ff9999');
        
obj.css('margin-bottom''5px');
        
obj.hide();

        
// Inject a custom toggler before the post..
        
obj.before(`
<div style="cursor:pointer; margin-top:10px;margin-bottom:10px;" onclick="
$o = $(this);$o.next('div').slideToggle(100,function (){});">
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center">
<tbody><tr>
    <td class="tcat" width="100%">
        <div class="smallfont">
        <img class="inlineimg" src="images/buttons/report.gif" alt="Report Post" border="0" title="Report Post">
        <b>Hidden post from user: 
${n} (Click to toggle..)</b>
        </div>
    </td>
</tr>
</tbody></table>
</div>
`);
    });
}); 
When this script is enabled, users you have entered to be blocked will have their posts turned into this:

https://i.imgur.com/5ES3jhz.png

The new injected box is clickable, which will toggle the hidden post to show/hide again if you need to potentially see it. (This way it's not just outright removed entirely.) The post will have its background changed to a light red to stand out better when it's uncollapsed too:

https://i.imgur.com/3C7h1Jx.png



Script For IPB 4.x - Tested On tuts4you (Works on both light and dark themes.)


PHP Code:
/**
 * Hide User Posts (IPB 4.x) - by atom0s
 *
 * This is a simple piece of Javascript that will hide given users posts from being visible.
 * This script was made for and tested on, tuts4you.
 */

// The list of users' names whose posts should be hidden..
var names = ['SomeRandomUserNameHere1234''SomeRandomUserNameHere1234''SomeRandomUserNameHere1234''SomeRandomUserNameHere1234'];

// Don't edit below this line if you don't know what you're doing!
$.each(names, function(in) {
    
// Find all posts on the page that belong to the current user being iterated..
    
$(`a:contains('${n}').ipsType_break`).each(function() {
        
// Ensure the block is a user post..
        
if ($(this).parent()[0].localName === 'strong') {
            
// Obtain the parent post article..
            
var obj = $(this).closest('article');
            
            
// Alter the posts border color to stand out when visible and hide it..
            
obj.css('border''2px solid #ff4444');
            
obj.hide();
            
            
// Inject a custom toggler before the post..
            
obj.before(`
<div class="ipsBox ipsResponsive_pull ipsClearfix ipsClear ipsMargin_bottom" style="background-color:#ff4444;cursor:pointer;padding:10px 20px;" onclick="
$o = $(this);$o.next('article').slideToggle(100,function (){});">
    <span class="ipsType_reset ipsType_medium ipsType_light" style="color: black;">
        <i class="fa fa-warning"></i>
        <strong>Hidden post from user: 
${n} (Click to toggle..)</strong>
    </span>
</div>
`);
        }
    });
}); 
When this script is enabled, users you have entered to be blocked will have their posts turned into this:

https://i.imgur.com/dQ7O2s3.png

The new injected box is clickable, which will toggle the hidden post to show/hide again if you need to potentially see it. (This way it's not just outright removed entirely.) The post will have its background changed to a light red to stand out better when it's uncollapsed too:

https://i.imgur.com/rmKLaro.png
__________________
Personal Projects Site: https://atom0s.com
Reply With Quote
The Following 2 Users Gave Reputation+1 to atom0s For This Useful Post:
MarcElBichon (12-21-2022), yoza (12-22-2022)
The Following 4 Users Say Thank You to atom0s For This Useful Post:
Mendax47 (12-21-2022), RiRye (12-21-2022), uranus64 (12-22-2022), user_hidden (12-21-2022)
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On



All times are GMT +8. The time now is 10:05.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( 1998 - 2023 )