View Full Version : User Ranks - Can't add ranks that require 0 minimum posts
speedway
Sun 15th Jun '03, 6:21am
I wanted to set the first level of user ranks to zero posts. However, the rank manger won't allow a zero in Number of Posts - complains about needing to fill in all required fields.
qxh
Sun 15th Jun '03, 6:25am
Confirmed.
Freddie Bingham
Sun 15th Jun '03, 11:10am
Change all instances of the following line in admincp/ranks.php
if (!$ranklevel OR !$minposts OR !$rankpath)
to
if (!$ranklevel OR !$rankpath)
Boofo
Mon 16th Jun '03, 1:25am
Change all instances of the following line in admincp/ranks.php
if (!$ranklevel OR !$minposts OR !$rankpath)
to
if (!$ranklevel OR !$rankpath)
I have one like this:
if (!$ranklevel OR !$minposts OR !$rankpath)
And one like this:
if (!$ranklevel OR !$minposts OR !$rankimg)
I just took out "OR !$minposts" from both of them. That's right, isn't it?
Freddie Bingham
Mon 16th Jun '03, 1:28am
Yes remove "OR !$minposts" from both lines.
Chris M
Mon 16th Jun '03, 4:22am
Thanks freddie:)
Satan
Faruk
Mon 16th Jun '03, 5:36am
I haven't looked at the code yet, but wouldn't it be more useful if you leave the check on $minposts there but instead of doing it "OR !$minposts" doing it "OR !is_numeric($minposts)" ?
*shrugs*
Freddie Bingham
Mon 16th Jun '03, 7:32am
You could do that if you wish, doesn't really matter. If you leave the min posts blank, it will default to 0 with what I gave you.
Faruk
Mon 16th Jun '03, 8:48am
like I said, I haven't yet gone into looking at that part of the (insane amount of :p) vB3-code, but I was wondering whether it might be useful for people accidentally entering a ' in the field or so (though I'm sure there's already 4 other checks for that throughout the code ;p)
Freddie Bingham
Mon 16th Jun '03, 10:41am
The field is ran through intval before we use it, hence a ' would become a zero.
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.