Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Feb 2000
Posts: 4,625
Member
Member
Offline
Joined: Feb 2000
Posts: 4,625
By CAL:
find:
Code
[/code]
replace with:
Code
</pre></div></div><br><br>At the top of ubb_lib.cgi find:<br><div class="ubbcode-block"><div class="ubbcode-header">Code</div><div class="ubbcode-body ubbcode-pre" ><pre>
Under it add:
[code]

[ March 26, 2001: Message edited by: MasterMind ]

Sponsored Links
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Hey MM, that looks pretty good. Does it affect speed? Or is it just a much cleaner way of writing that sub?


- Allen wavey
- What Drives You?
Joined: Jan 2001
Posts: 14
Junior Member
Junior Member
Offline
Joined: Jan 2001
Posts: 14
probably a stupid question, but where can i find that sub?

Joined: Mar 2001
Posts: 97
Member
Member
Offline
Joined: Mar 2001
Posts: 97
Quote
quote:
You can find it in ubb_lib.cgi.

Joined: Feb 2000
Posts: 4,625
Member
Member
Offline
Joined: Feb 2000
Posts: 4,625
Hi Borg!

[ March 26, 2001: Message edited by: MasterMind ]

Sponsored Links
Joined: Jul 2000
Posts: 1,349
Ell Offline
Member
Member
Offline
Joined: Jul 2000
Posts: 1,349
Hi Greg!

Joined: Feb 1999
Posts: 1,379
cal Offline
Programmer
Programmer
Offline
Joined: Feb 1999
Posts: 1,379
NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO!

DO NOT USE THIS AS IS!!!!!!

You need two important changes. Firstly, my example code generates a 5 digit random, whilst the existing gives a 6 digit. This version works:
Code
code:
Secondly, you MUST put a call to "srand(time());" somewhere where it will get run once per execution (like the top os lib.cgi) else they wont be random at all!

Just a thought smile

Joined: Jul 2000
Posts: 1,349
Ell Offline
Member
Member
Offline
Joined: Jul 2000
Posts: 1,349
Greg: Shouldn't this be included in your "speeding up UBB" hack? smile

BTW, 2 huge bugs in 1 line of code? Must be a record. wink

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
smile

Somebody wanna finish this then?


- Allen wavey
- What Drives You?
Joined: Nov 2000
Posts: 1,271
Kahuna
Kahuna
Joined: Nov 2000
Posts: 1,271
and also...

please tell me (poor, poor rob) what this does?

i mean, sure, we all want clean make_random_number subs. my mom never let me leave home without one on! but... ...now that im all grow'd up... what does it do?

Sponsored Links
Joined: Feb 2000
Posts: 4,625
Member
Member
Offline
Joined: Feb 2000
Posts: 4,625
Fixed docs.
It cleans up the make random number sub. wink


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
AllenAyres
AllenAyres
Texas
Posts: 21,079
Joined: March 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services