Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Random Number
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #1
Random Number
More details:
http://mybbhacks.zingaburga.com/showthread.php?tid=5295

Create a custom thread fields with these settings:
Title: Your Random Number is:
Key: random_number
Applicable Forums: Select any forum(s) where the random number will be displayed.
Hide input field on New/edit thread: Checked
Text Mask Filter: Digits
Input Formatter:

Code:
<?=mt_rand()?>

Modify it as our needs (ex: using min and max).
Custom Modify Error:

Code:
<if THIS_SCRIPT == 'editpost.php' then>Random number cannot be modified</if>

Underlying Data Type: Integer (unsigned, usually 32-bit)

By default, it'll be displayed above the first post. For displaying it manually somewhere else, check the Hide on Show thread setting, set the Display Format setting to:

Code:
<div>Your Random Number is: {VALUE}</div>

then put {$GLOBALS['threadfields']['random_number']} inside postbit_first and/or postbit_first_classic and/or forumdisplay_thread templates.



Attached File(s) Thumbnail(s)
   

(This post was last modified: 12-11-2015 02:05 AM by RateU.)
11-19-2015 03:20 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Random Number - RateU - 11-19-2015 03:20 AM
RE: Random Number - Greig - 11-19-2015, 03:48 AM
RE: Random Number - RateU - 11-19-2015, 03:54 AM
RE: Random Number - Greig - 11-19-2015, 03:54 AM
RE: Random Number - RateU - 11-19-2015, 04:00 AM
RE: Random Number - Greig - 11-19-2015, 04:05 AM
RE: Random Number - RateU - 11-19-2015, 04:16 AM
RE: Random Number - ZiNgA BuRgA - 12-03-2015, 05:15 PM
RE: Random Number - RateU - 12-04-2015, 06:59 AM
RE: Random Number - ZiNgA BuRgA - 12-06-2015, 04:36 PM
RE: Random Number - RateU - 12-11-2015, 02:06 AM

 Standard Tools
Forum Jump: