PDA

View Full Version : does this already exist?


a4toronto
05-19-2002, 03:28 PM
hello - new to vB hacking and wondering if such a hack already exists:

i want moderators to be able to flag certain posts (not threads) that will show as a count under the persons username.

for example, person x has 10 flagged posts, person y has 1 flagged posts.

is it out there? or should i roll up my sleeves and start hacking?

Admin
05-19-2002, 03:33 PM
I don't think it exists but it also wouldn't be that hard.

Just create a new field in the `post' table, `flag' for example, which will be 1 or 0. Index that field too.

Then add a button in postbit which will only be visible to mods, and will take them to misc.php or whatever that will update this `flag' field.

Then it's just a matter of counting the number of posts that are flagged in the post tbale.

a4toronto
05-19-2002, 07:12 PM
that's great - thanks for the direction.

a4toronto
05-20-2002, 03:37 PM
can i get some more direction? how can i add another postbit icon? i'm not sure where to add it.

Admin
05-20-2002, 04:08 PM
In the postbit template.

a4toronto
05-20-2002, 05:14 PM
thanks, i've added the flag to the database, and the items to the postbit templates.

i've got two additional questions:
1) in the postbit template, how can i get an image to show up only when the post is flagged?

2) is the best place to put the sql code in misc.php or a new php (eg. flag.php)?

a4toronto
05-21-2002, 01:53 AM
i've answered my second question (i created flag.php) but the first one is still there - how can i get an image to show up only when the flag field in the post table is set to "1"?