Version: 1.02, by TCM
Developer Last Online: Sep 2009
Version: 3.0.7
Rating:
Released: 03-31-2005
Last Update: Never
Installs: 1
Template Edits
No support by the author.
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 ...
... 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");
$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 ...
... 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
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
To a userid on my forum to be posted as? Or does that mean that user ID 3 will post as the name Joe. If so is there anyway to completly randomise every user on the forum who posts?
To a userid on my forum to be posted as? Or does that mean that user ID 3 will post as the name Joe. If so is there anyway to completly randomise every user on the forum who posts?
Not exactly. I had a hard time explaing this right. This affects every user, unless you change it. It changes the userid and username associated with the post to one that you've provided, randomly seleceted. If that's all you had, all your users would post as whatever user has userid 3, but when viewing threads, it would appear as "Joe" for thead started or most recent poster.