PDA

View Full Version : Change a user's post incrementation factor...


Zzed
03-04-2003, 10:00 PM
This hach was requested by nintendo: https://vborg.vbsupport.ru/showthread.php?s=&threadid=49637

This hack allows you to set the direction and the incrementation factor for user posts.
The default incrementation factor is 1. With this hack you can freeze a user's post
count by setting the incrementation factor to 0, or you can make it go backwards by
setting it to -1. Of course, you are not limitet to -1, 0, or 1. You can set it to
any positive or negative number and that users post caount will increment or decrement
by the specified number each time that user makes a post.

Tables affected by this hack: user, usertitle
Files affected by this hack: newthread.php, newreply.php, admin/user.php

To begin with this hack you must allow for negative post counts, and you need an
additional field in the user table.

Execute the following statements at the MySQL prompt:

alter table user add postdirection smallint(5) DEFAULT 1 NOT NULL;
alter table user modify posts int(6) default 0 NOT NULL;
alter table usertitle modify minposts int(6);


Note: If you have installed this hack and are not able to set the post incrementation factor to a negative number execute the following statement.

alter table user modify postdirection smallint(5) default 1 not null;

I apologize for this mixup. :( I have already updated the instruction file.

geniuscrew
03-05-2003, 05:55 AM
This could be fun :devious:

Zzed
03-05-2003, 06:10 AM
Look at my profile (http://www.ls1.com/forums/member.php?action=getinfo&userid=4112) ;) My factor is set to -1. :D

I have a user whose post incrementation factor is set to -500... :D

geniuscrew
03-05-2003, 08:02 AM
lmao - that's cool

Nice avatar too

Remi
03-05-2003, 09:37 AM
Originally posted by geniuscrew
Nice avatar too

I thik your avatar is much better ;) :D

geniuscrew
03-05-2003, 11:34 AM
Originally posted by Remi


I thik your avatar is much better ;) :D

lol I meant the one in the link he's given -_-

But thanks - I like it too :lick: Rose McGowan rocks

afterlab
03-05-2003, 01:44 PM
haha.. Nice hack idea. I don't think i'll use this at my forums, but it's here if I wanted to. ;)

Dean C
03-05-2003, 03:35 PM
Hehe such a sadistic hack - i like it ;)

- miSt

joeboo
03-06-2003, 10:58 PM
Sounds like a good april fools joke ;)

snyx
03-07-2003, 01:52 PM
im having major trouble installing this over the starhack.
any thoughts?

Zzed
03-07-2003, 07:28 PM
I am not familiar with the star hack.

What errors are you getting?

Can you Email me your newthread.php and newreply.php files?

My Email is edwink@seebeyond.com

snyx
03-08-2003, 10:04 PM
I shot ya over an email yesterday..

snyx
03-11-2003, 04:20 AM
hello zzed? :)

Zzed
03-11-2003, 04:49 AM
Sorry snyx, :( I will take a look tonight and get back to you.

snyx
03-11-2003, 02:18 PM
no problem, thx mate

Boofo
03-27-2003, 11:26 PM
Zzed, I just installed this and I changed my incrementation to -1 but when I go into my user setting to look at it, for some reason it is showing 0 now. Any ideas what might be causing this?

Zzed
03-27-2003, 11:34 PM
Today at 05:26 PM Boofo said this in Post #16 (https://vborg.vbsupport.ru/showthread.php?postid=374296#post374296)
Zzed, I just installed this and I changed my incrementation to -1 but when I go into my user setting to look at it, for some reason it is showing 0 now. Any ideas what might be causing this?


You need to alter your user and usertitle tables. ;) Post counts are unsigned integers, the following code will make them signed integers. ;)


alter table user modify posts int(6) DEFAULT 0 NOT NULL;

alter table usertitle modify minposts int(6);


Also look at my post count in my profile. :D

http://www.ls1.com/forums/member.php?action=getinfo&userid=4112

Boofo
03-27-2003, 11:37 PM
Here are the queries I ran according to your install instructions.

alter table user add postdirection smallint(5) unsigned DEFAULT 1 NOT NULL;
alter table user modify posts int(6);
alter table usertitle modify minposts int(6);

Zzed
03-27-2003, 11:44 PM
I just executed this SQL query in your Admin CP:

alter table user modify postdirection smallint(5) default 1 not null;

Then went ahead and set your post incrementation factor to -1.

It worked. ;)

Boofo
03-28-2003, 11:32 PM
Hey buddy. ;)

I got this error this afternoon sometime.

Database error in vBulletin 2.2.9:

Invalid SQL: SELECT title FROM usertitle WHERE minposts<=22+ $\
bbuserinfo[postdirection] ORDER BY minposts DESC LIMIT 1
mysql error: You have an error in your SQL syntax near '\
bbuserinfo[postdirection] ORDER BY minposts DESC LIMIT 1' at line 1

mysql error number: 1064

Date: Friday 28th of March 2003 03:09:54 PM
Script: http://www.bearfacts2.com/forum/forum/newreply.php
Referer: http://www.bearfacts2.com/forum/showthread.php?s=&threadid=311

and now the user is showing 23 of 22 messages.

Zzed
03-29-2003, 12:07 AM
Today at 05:32 PM Boofo said this in Post #20 (https://vborg.vbsupport.ru/showthread.php?postid=374754#post374754)
Hey buddy. ;)

I got this error this afternoon sometime.



and now the user is showing 23 of 22 messages.


Eureka. :D

Go to line 613 of your newrply.php and join the 2 lines and remove the backslash. ;) The variable $bbuserinfo[postdirection] has the $ and bbuserinfo separated. ;)

snyx
04-01-2003, 05:34 AM
help all my new registered users dont have a post count?
they just sit at no number!! I want to remove the changes I made to mySQL in hopes it fixes this problem how would I do this?!

Boofo
04-01-2003, 07:07 AM
It seems you get a db error when a new user tries to activate also. Apparently, we need to change something in the register.php file, too.

DrunkenStud
04-01-2003, 04:10 PM
Today at 02:34 AM snyx said this in Post #22 (https://vborg.vbsupport.ru/showthread.php?postid=376219#post376219)
help all my new registered users dont have a post count?
they just sit at no number!! I want to remove the changes I made to mySQL in hopes it fixes this problem how would I do this?!


yeah, shouldnt you have altered the posts column like this:

alter table user modify posts int(6) default 0 not null;

Boofo
04-03-2003, 09:33 AM
Zzed, you need to change the following in the text file attached to the first post, too. ;)

alter table user modify posts int(6) default 0 NOT NULL;

Zzed
04-03-2003, 09:36 AM
done. ;)

Thank you sir. :)

Hobbes
08-02-2003, 04:30 AM
anyone know if this conflicts with bitsys's battle hack?


erm it does....sucks...


wouldve been nice :(