PDA

View Full Version : negative post counts?


Pete_C
03-14-2005, 02:12 AM
I was curious as to whether its possible to have a negative post count at all. I tried to enter one in the admin panel, but to no avail, it was changed to 0 instead of the value.

another option I was wondering, if thats not possible, is it possible to have it so that only when my post count is shown, it has a minus sign infront of it, would that be possible at all?

why-not
03-14-2005, 02:59 AM
Hi

Have a read up on INT (http://dev.mysql.com/doc/mysql/en/numeric-type-overview.html) column types over at MySQL. It will explain why what you are trying will not work with the current vB default column type for post count *UNSIGNED RANGE* <= does not allow for 'negative values'. You can change it to a *SIGNED RANGE*, but this will use more space, and also cause some table joins to use temporary tables when they would not be used for unsigned ranges! You can just do a template edit an add '-' before the post count and also use a <if condition=...> so it works only on certain users or groups of users!


Sonia

Pete_C
03-16-2005, 01:08 PM
Thanks, I'll get onto the if condition now :D

::EDIT::

Could someone please verify this please

<if condition="$userid=='18'">-</if>

My user id on the forum is 18, and this seems the only way of doing it as I don't have access to the databases. would I have to use a different code? bearing in mind I'm not used to the vB variables just yet..

dstruct2k
03-16-2005, 05:07 PM
Should work... Why would you want to have negative count, anyways?

Pete_C
03-16-2005, 06:07 PM
no real reason other then a joke, although that if statement doesn't seem to work, I've also tried using $bbuserinfo[userid]==18 and $userinfo[userid]==18 but to no avail, can anyone give me the correct syntax, please?

Oblivion Knight
03-16-2005, 06:58 PM
Run the following queries:
ALTER TABLE user MODIFY posts INT(6) DEFAULT 0 NOT NULL;ALTER TABLE usertitle MODIFY minposts INT(6);All done, you can now set post counts to a negative figure.. :)

Pete_C
03-17-2005, 12:24 PM
Cheers mate, but unfortunately I don't have access to the sql databases.

Does anyone know the correct syntax for the if condition to make it userid specific?