Back to vBulletin 3.0 Add-Ons

Your Users Post As Random Users
Mod Version: 1.02, by TCM

This modification is in the archives.
vB Version: 3.0.7 Rating: (0 vote - 0 average) Installs: 1
Released: 01 Apr 2005 Last Update: Never Downloads: 0
Not Supported Template Edits  

Hi, this is my first time posting a "hack", so please tell me if I've done something horribly wrong.

This is a hack I made mainly for as an April fools joke for my board. You select certain users, and whenever anyone posts, the post is listed as if it was posted by one of those users, chosen at random. On my boards, we chose the users Somebody, Nobody and Anybody.

The code goes in the PHP_INCLUDE_START template. Selecting which users you want it to pick from is easy, you just add and remove array entries. For example, if I wanted it to pick from the users "Joe" and "Bob", who have userids 3 and 4, I would enter ...
PHP Code:
        $randomuserchoice[1] = array(
            
'userid' => 3,
            
'username' => "Joe");

        
$randomuserchoice[2] = array(
            
'userid' => 4,
            
'username' => "Bob"); 
... where the users are chosen. The full code, with the above example users used, is as follows:
PHP Code:
// vvvvvvvvvvvvv The Computer Mutt's Post As Random User Hack vvvvvvvvvvvvv

    
if ((($_POST['do'] == 'postthread') and ($_POST['sbutton'] == 'Submit New Thread'))
    or ((
$_POST['do'] == 'postreply') and ($_POST['sbutton'] == 'Submit Reply'))
    or ((
$_POST['do'] == 'postreply') and ($_POST['sbutton'] == 'Post Quick Reply')))
    {
        
$bodies = array();

        
// Chose Users To Select From
         // The userid will determine who the post appears to be from in the thread,
         // The username will determine who the post appears to be from when you're looking at a list a threads (search, browsing forums, forumhome)
        
$randomuserchoice[1] = array(
            
'userid' => 3,
            
'username' => "Joe");

        
$randomuserchoice[2] = array(
            
'userid' => 4,
            
'username' => "Bob");

        
$randomuser rand(1,count($randomuserchoice));
        
$bbuserinfo['userid'] = $randomuserchoice[$randomuser]['userid'];
        
$bbuserinfo['username'] = $randomuserchoice[$randomuser]['username'];
    }
// ^^^^^^^^^^^^^ The Computer Mutt's Post As Random User Hack ^^^^^^^^^^^^^ 
If you want to add conditions to when this will apply, such as only applying it to certain users, or only in a given forum, you'd (obviously) just create an if statement and wrap it around all of the code.

You don't need to use real userids and usernames. When I wanted things to be really crazy, I used ...
PHP Code:
        $randomuserchoice[1] = array(
            
'userid' => rand(1208),
            
'username' => "Someone"); 
... 208 being the number of users my board had at the time, so each post would be given to a random user, but would appear as "Someone" while browsing threads.

My members got a kick out of this, I hope you and yours do to.
-The Computer Mutt

Download

No files for download.


vblts.ru supports vBulletin®, 2022-2024