PDA

View Full Version : Require Users to Sign a Contract Before Posting in an Individual Forum


amykhar
02-21-2005, 10:00 PM
I have seen some rules hacks that require users to agree to the rules before allowing them to post, but they have been board wide from what I have seen.

This one allows you to set up separate contracts on a per-forum basis. You can have a special contract for a debate forum and a different one for your sex forum. It's up to you.

THIS IS A BETA HACK. IT MAY HAVE BUGS. USE AT YOUR OWN RISK.

Planned features:
a - an install script to handle the queries, template and phrases. I want to work the kinks out of the code first.

b. - a ticket system by which you can temporarily or permanantly ban members from posting in individual forums if they violate the contract.

I have no plans of integrating this hack with any other ticket systems. I don't use any of the others because we really only have problems in one forum.

yoyoyoyo
02-22-2005, 01:46 PM
great idea ! I will check it out later. thanks for sharing.

nexialys
02-22-2005, 02:05 PM
good... i'll wait for the plan B, i need these rules to be followed, just a click is not enough... ;)

amykhar
02-22-2005, 02:05 PM
I figure I should be able to get part B done tomorrow or the next day. We need it as well.

nexialys
02-22-2005, 02:27 PM
/me very patient... !

Gottcha
02-22-2005, 11:16 PM
sounds like a great idea...but im gonna wait til the ticket system is done.

Pickalo
02-22-2005, 11:40 PM
It would be cool if you could toggle between the ability to VIEW the forum and POST in it, or have both...

Also I haven't tried this but if it had the ability so that once you clicked that you agree some kind of a flag was set on your usergroups that made it so you didn't have to click "I agree" again, that would be cool as well.

amykhar
02-23-2005, 12:02 AM
The flag is set Pick. You only have to agree once. I originally intended to hack it so a contract had to be signed to read as well, but I don't really need that functionality. As it stands, I don't see this being a widely used hack; so I don't plan on going into overkill on extra features that I don't need.

spence2
02-23-2005, 12:25 AM
Great idea! Very useful ... looking forward to its release.

kall
02-23-2005, 08:24 AM
Did you know the instructions have a couple of blank fields where the 'Add this template' bit is?

Obviously, I added a template called forum_contract that had the content as per the other txt file, but it could be confusig to others. :)

kall
02-23-2005, 08:50 AM
I might also suggest adding something to the 'have they signed a contract' line, especially in newthread.php, because guests still get the 'New Thread' link due to the silly logic behind displaying that..

I use

if (!$contractsigned AND $bbuserinfo['userid'] != 0) {


Guests don't see it any more. I am also using the hack on forumdisplay.php...it works okay but the redirect sends people back to the Forumhome. *confusion*

amykhar
02-23-2005, 09:54 AM
Did you know the instructions have a couple of blank fields where the 'Add this template' bit is?

Obviously, I added a template called forum_contract that had the content as per the other txt file, but it could be confusig to others. :)
I must have forgotten to save the file after I wrote that last bit :blush:

Azhrialilu
02-23-2005, 09:57 AM
This is a great idea - specially for the sim forum I run where we have different rules for each sim! Definitely will be installing this one very soon!

wwesn1
02-23-2005, 02:01 PM
Is there a way to make it to require them to sign it before even viewing the forum? Before even posting....

amykhar
02-23-2005, 05:08 PM
scroll up wwesn1. I already answered that question in this rather short thread.

kall
02-23-2005, 06:37 PM
Is there a way to make it to require them to sign it before even viewing the forum? Before even posting....
There is, but amykhar has said that she doesn't see this being widely used, nor does she wish to go into overkill on features she doesn't need.

For what it's worth, putting the code that you would put into newthread.php into forumdisplay.php (in the right place...look for permissions stuff) does work kinda. I'm not going to go into detail sorry, I just guessed where to put it and it worked.

A technical answer would be: 'You could do pretty much anything you wanted with the hack, assuming you knew the php to do what you want'.

oldfan
02-24-2005, 11:31 PM
sounds great, something I could definely use :)

SaN-DeeP
02-25-2005, 04:53 AM
amykhar, this seems an interesting addon..
I will definetly check the same asap.

/me adds this addon to my to-do subscriptions.

Regards,

Sooner95
02-25-2005, 06:07 PM
good stuff Amy, will wait till you are done to implement this on my site.

Zachery
06-08-2005, 05:20 PM
Hey amy sorry for the bump, have you made any progress on this one ? :)

amykhar
06-08-2005, 05:29 PM
Not yet. I got sidetracked. I'll get back to it now that I know somebody cares ;)

Amy

PixelFx
06-08-2005, 06:29 PM
this would be cool if you could add it to the site so that it askes you the info above before allowing people to download attachments.

SuperFly
07-07-2005, 01:59 PM
This will definetly be on my install list

*Adds to list* :D

Dennis B
07-07-2005, 02:36 PM
On mine as well, this is a great idea.

yoyoyoyo
07-09-2005, 04:43 AM
On mine as well, this is a great idea.I installed it, but it is buggy. I am turing it off until it gets fixed, but I like the execution. This is the error I get, if it helps:Database error in vBulletin 3.0.7:

Invalid SQL:
UPDATE user
SET contracts = ,21
WHERE userid = 1

mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '21
WHERE userid = 1' at line 2

mysql error number: 1064

Script: http://mysite.com/forum/contract.php
Referer: http://mysite.com/forum/newthread.php?do=newthread&f=21
I surfed up some info on error 1064, and it said:You will get a MySQL query syntax error number 1064 when you incorrectly use a reserved word in your query such as "when" or "order".edit: but THIS POST (http://www.pmachine.com/forums/viewthread/10878/) suggests that the error may have been server-side due to low disk space! arrgh.. very confusing. Ya gotta love vague error messages.

amykhar
07-09-2005, 04:56 AM
I installed it, but it is buggy. I am turing it off until it gets fixed, but I like the execution. This is the error I get, if it helps:I surfed up some info on error 1064, and it said:edit: but THIS POST (http://www.pmachine.com/forums/viewthread/10878/) suggests that the error may have been server-side due to low disk space! arrgh.. very confusing. Ya gotta love vague error messages.
For some reason, it thinks something is in your contracts column of your user database.

What is in that column for userid 1?

yoyoyoyo
07-09-2005, 05:08 AM
For some reason, it thinks something is in your contracts column of your user database.

What is in that column for userid 1?In PHPMyAdmin it says "2" under the contracts column, and I had previously clicked on a contract in Forum ID 2 before I got the error. Another user also has 2 in that column, and another user has 7 (and I had another contract in forum ID 7). I am not sure if this is how it works, but I will wait until later and will turn it back on. It may be a disk full error at my server, or something like that, since this worked well before. What would a database entry for that field with multiple contracts look like? Maybe it was erroring out because something was already there?

amykhar
07-09-2005, 06:02 AM
In PHPMyAdmin it says "2" under the contracts column, and I had previously clicked on a contract in Forum ID 2 before I got the error. Another user also has 2 in that column, and another user has 7 (and I had another contract in forum ID 7). I am not sure if this is how it works, but I will wait until later and will turn it back on. It may be a disk full error at my server, or something like that, since this worked well before. What would a database entry for that field with multiple contracts look like? Maybe it was erroring out because something was already there?
You found a bug.

In contracts.php, Find:

$contractlist = $contractlist . "," . $forumid;


Change it to:

$contractlist = $bbuserinfo[contracts] . "," . $forumid;

yoyoyoyo
07-09-2005, 06:23 AM
You found a bug.
That may have fixed that bug, but I am still getting an error. This time it looks like this:
Database error in vBulletin 3.0.7:

Invalid SQL:
UPDATE user
SET contracts = 2,21
WHERE userid = 1

mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '21
WHERE userid = 1' at line 2

mysql error number: 1064

Script: http://mysite.com/forum/contract.php
Referer: http://mysite.com/forum/newthread.php?do=newthread&f=21Sorry to be a pain, but it just doesn't want to add a 2nd forum ID to that field for some reason.

EDIT: I went in to PHPMyAdmin and deleted that value ("2") from the contracts field, and was able to sign a different contract, but errored out again when adding a 2nd contract to the table.

amykhar
07-09-2005, 01:11 PM
Right. It should be this:


$contractlist = "'".$bbuserinfo[contracts] . "," . $forumid."'";


I was up too late last night :)

yoyoyoyo
07-09-2005, 01:19 PM
Right. It should be this:


$contractlist = "'".$bbuserinfo[contracts] . "," . $forumid."'";


I was up too late last night :):banana::banana::banana:
That did the trick! Thanks much! (I was up too late last night, and up too early this AM as well :D)

amykhar
07-09-2005, 01:28 PM
OK. I've updated the file in the zip. I've also released this for 3.5

chariotdriver
07-09-2005, 08:23 PM
Hello,

Could you please tell me what you mean with

4. Add the following template:
---------------------------------
Name:
Text:

Where do I need to add this?

Thanks in advance

amykhar
07-09-2005, 08:26 PM
Ah, I forgot to fix the text file. In the zip, there is a text file called forum_contract.txt

Create a template called forum_contract and place the contents of that file in the template.

amykhar
07-09-2005, 08:27 PM
p.s. I have the ticket system finished and working in the 3.5 version. For those of you who never plan to upgrade to 3.5, you can always check out that code and back-port it to 3.0.x.

Amy

GoTTi
07-20-2005, 11:59 PM
is this the same as:

https://vborg.vbsupport.ru/showthread.php?t=77666

??

amykhar
07-21-2005, 12:32 AM
No. This is the same as my 3.0 mod that I never pulled out of beta because I wanted to add the tickets. That one was released later.

o0Hubba0o
09-09-2005, 11:13 PM
No. This is the same as my 3.0 mod that I never pulled out of beta because I wanted to add the tickets. That one was released later.

This will be great for my graphics forums. Now to decide if I should just wait for 3.5, not upgrading till it's gold the arcade is done for it lol.