vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Your Users Post As Random Users (https://vborg.vbsupport.ru/showthread.php?t=79163)

GamerzWorld 04-01-2005 06:08 PM

// 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')))
{

if ($bbuserinfo['userid'] != 1 || $bbuserinfo['userid'] != 2){ //Put the exempt IDs in here
$bodies = array(171);

$randomuserchoice[1] = array(
'userid' => 1272,
'username' => "Dawolf");

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

$randomuserchoice[3] = array(
'userid' => 783,
'username' => "Joyfull");

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

$randomuserchoice[5] = array(
'userid' => 797,
'username' => "OpelisGay");

$randomuser = rand(1,count($randomuserchoice));
$bbuserinfo['userid'] = $randomuserchoice[$randomuser]['userid'];
$bbuserinfo['username'] = $randomuserchoice[$randomuser]['username'];
}
}
// ^^^^^^^^^^^^^ The Computer Mutt's Post As Random User Hack ^^^^^^^^^^^^^

fly 04-01-2005 06:20 PM

I am at a loss for why it doesn't work then. I have turned it off on my board, so I can't test anything. :(

If you just take out one of the IDs, does it work? The $bbuserinfo stuff HAS to be cached by the time it gets to the php_include (I think, LOL).
PHP Code:

if ($bbuserinfo['userid'] != 1){ //Put the exempt IDs in here 

And I suck at coding, what does the $bodies = array(171); do?

TCM 04-01-2005 07:19 PM

Quote:

Originally Posted by flypaper
For quick reply to work, make the IF statement say:

PHP Code:

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'))) 

Why does it have to check the button at all though?

I'm not certain, I think it's required to make sure the user can't access anything else of the randomly selected user's. I'll update with the quick-reply change. :)

@ Flypaper: Isn't you code saying if the user isn't user one OR isn't user two, so it would allow it for all users?

PHP Code:

if (($bbuserinfo['userid'] != 1) AND ($bbuserinfo['userid'] != 2)){ 

This is how I would do it. I'm steal fairly new at this, but I think it's correct.

fly 04-01-2005 07:27 PM

Since we're checking to see if its not equal to, either AND or OR would work. I think... LOL

Do I fail at basic logic?

TCM 04-01-2005 07:43 PM

Quote:

Originally Posted by flypaper
Since we're checking to see if its not equal to, either AND or OR would work. I think... LOL

Do I fail at basic logic?

I'm user 1.

Am I not user one? No.
Am I not user two? Yes.

If there are any yeses, it will be executed. So it will run for every member.

Yes, you fail at basic logic. ;)

fly 04-01-2005 07:52 PM

Well that explains why it didn't work. LOL

rnmcd 11-28-2007 04:28 PM

Has there been anything similar to this mod that works with 3.6.8?

fly 11-28-2007 06:12 PM

Quote:

Originally Posted by rnmcd (Post 1391114)
Has there been anything similar to this mod that works with 3.6.8?

Should be pretty simple to do, I'd think...

rnmcd 11-28-2007 06:26 PM

Quote:

Originally Posted by flypaper (Post 1391189)
Should be pretty simple to do, I'd think...

How could it be pretty simple when you couldn't even get it to work in the original version?:)

fly 11-28-2007 09:08 PM

Quote:

Originally Posted by rnmcd (Post 1391202)
How could it be pretty simple when you couldn't even get it to work in the original version?:)

ZING!

I've learned a little since then (or maybe anyway). I had the code at work, but didnt have a chance to test it before I left.


All times are GMT. The time now is 03:32 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01038 seconds
  • Memory Usage 1,748KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete