PDA

View Full Version : Random userid from the ACP


powerful_rogue
05-30-2009, 02:30 PM
Hi,

Im trying to work on a feature for my mod but getting stuck!
I want a user to be able to enter random UserID's into a field in the ACP.

I then want the code to randomly pick one of those UserID's to be the thread started. This is the code I have at present.

</setting>
<setting varname="wtur_postinguserid" displayorder="50">
<datatype>free</datatype>
<defaultvalue></defaultvalue>
</setting>

$wtur_userids_get = explode(",", $vbulletin->options['wtur_postinguserid']);
$wtur_userids = $wtur_userids_get[array_rand($wtur_userids_get)];
$wtur_userid = fetch_userinfo($wtur_userids);

$threaddm->setr('userid', $wtur_userid['userid']);

Been playing around for ages now, but not having much luck! Any help greatly appreciated!

--------------- Added 1243699590 at 1243699590 ---------------

Oops, how embarrased do I feel! I forgot to submit the thread to an actual forum! No wonder it wasnt showing up!