| amykhar's Hideaway A premium support forum for my vbulletin modifications. Members of this forum receive extra help, bug fixes, etc. for my code. To join, Subscribe to the Vbulletin Plan
Minor feature requests will be considered, but major mod alterations will require a special contract. |  | 
07-27-2005, 10:28 AM
|  | Forum Code Administrator | | Join Date: Jun 2000 Location: PA
Posts: 19,972
| | Require Users to Sign A Contract Before Posting in Specified Forums | | This is a port of this mod: http://www.vbulletin.org/forum/showthread.php?t=76835
This little mod forces users to read and sign a "contract" before it allows them to post in certain forums of your choosing.
You may define a different contract for each of your forums if you so choose.
-------------------------------
YOU may easily extend this idea to make readers sign a contract before reading a certain forum. I do not need this feature and will not be adding it at this time.
Installation on 3.5 RC1 is as simple as importing the product.
------------------------------
This hack will always be free, however your donations are kindly accepted and will help towards further development. If you donate, please leave me some info (either your forum site or username at vB.org) so that I can thank you.
Amy
__________________ Salt makes mistakes taste great.
Last edited by amykhar; 07-27-2005 at 11:01 AM.
| 
07-27-2005, 10:56 AM
|  | Forum Code Administrator | | Join Date: Jun 2000 Location: PA
Posts: 19,972
| | Re quire Users to Sign A Contract Before Posting in Specified Forums | | Take two on the attachment:
__________________ Salt makes mistakes taste great.
Last edited by amykhar; 07-27-2005 at 12:07 PM.
| 
07-27-2005, 11:07 AM
| | New Member | | Join Date: Jul 2005
Posts: 8
| | Re quire Users to Sign A Contract Before Posting in Specified Forums | | Hook Location : newthread_start
(sign contract before posting new thread)
Find: PHP Code: if ($ticketarray[$foruminfo[forumid]]»2)
Replace with: PHP Code: if ($ticketarray[$foruminfo[forumid]] == 2)
And phrase don't seem to be working properly, See SS. | 
07-27-2005, 11:11 AM
|  | Forum Code Administrator | | Join Date: Jun 2000 Location: PA
Posts: 19,972
| | Re quire Users to Sign A Contract Before Posting in Specified Forums | | The first is not an error. Three tickets boots the user. 2 is ok. It looks like the special phrases didn't get inported again. I'll go look at that.
Amy
__________________ Salt makes mistakes taste great. | 
07-27-2005, 11:19 AM
| | New Member | | Join Date: Jul 2005
Posts: 8
| | Re quire Users to Sign A Contract Before Posting in Specified Forums | | Well this char » generates an error. I was assuming you wanted a ==. | 
07-27-2005, 11:22 AM
|  | Registered Member | | Join Date: Jul 2005 Location: Northampton, UK
Posts: 9
| | Re quire Users to Sign A Contract Before Posting in Specified Forums | | Parse error: parse error, unexpected T_STRING in /home/cman/public_html/vbh.org/newthread.php(68) : eval()'d code on line 14
It does not initiate the contract thing :p
Satan | 
07-27-2005, 11:23 AM
| | New Member | | Join Date: Jul 2005
Posts: 8
| | Re quire Users to Sign A Contract Before Posting in Specified Forums | | Thats do to that char mentioned in my above post. Worked when i added the '=='. | 
07-27-2005, 11:27 AM
|  | Forum Code Administrator | | Join Date: Jun 2000 Location: PA
Posts: 19,972
| | Re quire Users to Sign A Contract Before Posting in Specified Forums | | OK. Change to > I don't know how the character got hosed
I am having problems getting the phrasegroup register merged in as a plugin. I am trying to do it in the cache_templates hook, but no dice. Code: if (THIS_SCRIPT == "newthread") {
$phrasegroups = array_merge($phrasegroups, array('register'));
}
__________________ Salt makes mistakes taste great. | 
07-27-2005, 11:30 AM
|  | Forum Code Administrator | | Join Date: Jun 2000 Location: PA
Posts: 19,972
| | Re quire Users to Sign A Contract Before Posting in Specified Forums | | Livewire, I think you just found a bug in the product export. My code doesn't have that symbol, but the xml file does.
__________________ Salt makes mistakes taste great. | 
07-27-2005, 11:32 AM
| | New Member | | Join Date: Jul 2005
Posts: 8
| | Re quire Users to Sign A Contract Before Posting in Specified Forums | | I found a buggie! -_-. I'll test on my server and report it. | 
07-27-2005, 11:34 AM
|  | Forum Code Administrator | | Join Date: Jun 2000 Location: PA
Posts: 19,972
| | Re quire Users to Sign A Contract Before Posting in Specified Forums | | http://www.vbulletin.com/forum/bugs3...view&bugid=822
Sorry. I was reporting it while you were posting that.
Amy
__________________ Salt makes mistakes taste great. | 
07-27-2005, 11:39 AM
| | New Member | | Join Date: Jul 2005
Posts: 8
| | Re quire Users to Sign A Contract Before Posting in Specified Forums | | np  | 
07-27-2005, 11:44 AM
| | New Member | | Join Date: Jul 2005
Posts: 8
| | Re quire Users to Sign A Contract Before Posting in Specified Forums | | Amy, read my respond to your bug for a temp fix. | 
07-27-2005, 11:59 AM
|  | Registered Member | | Join Date: Jul 2005 Location: Northampton, UK
Posts: 9
| | Re quire Users to Sign A Contract Before Posting in Specified Forums | | Quote: LiveWire said
Thats do to that char mentioned in my above post. Worked when i added the '=='. | I was just confirming that it was a bug in the product not something you did yourself :p
Satan | 
07-27-2005, 12:01 PM
| | New Member | | Join Date: Jul 2005
Posts: 8
| | Re quire Users to Sign A Contract Before Posting in Specified Forums | | Okay everything works perfect but the phrase. I can't figure out how to get the register phrase there.
I just added a space like this: PHP Code: if ($ticketarray[$foruminfo[forumid]] > 2)
So it don't export that char.
Also, you should use Code: $db->hide_errors();
$db->query("ALTER TABLE ".TABLE_PREFIX."user ADD tickets VARCHAR( 250 ) NOT NULL");
ect....
$db->show_errors(); | 
07-27-2005, 12:07 PM
|  | Forum Code Administrator | | Join Date: Jun 2000 Location: PA
Posts: 19,972
| | Re quire Users to Sign A Contract Before Posting in Specified Forums | | OK. Here's the next release with the phrase and other problems fixed. (The phrase fix is in the instructions)
__________________ Salt makes mistakes taste great.
Last edited by amykhar; 07-28-2005 at 01:31 PM.
| 
07-27-2005, 12:24 PM
| | New Member | | Join Date: Jul 2005
Posts: 8
| | Re quire Users to Sign A Contract Before Posting in Specified Forums | | But the user would have to have debug mode on in order to change the phrase type right? | 
07-28-2005, 01:25 PM
|  | Registered Member | | Join Date: Jul 2005 Location: Northampton, UK
Posts: 9
| | Re quire Users to Sign A Contract Before Posting in Specified Forums | | Quote: | Parse error: parse error, unexpected '{' in /home/cman/public_html/vbh.org/ticket.php on line 25 | ticket.php doesn't work
2 things I've noticed about why: PHP Code: define('THIS_SCRIPT', 'newthread');
Should be PHP Code: define('THIS_SCRIPT', 'ticket');
There is no closing I've fixed both these errors and still get the parse error though... Edit: Found it: PHP Code: if (!can_moderate($vbulletin->GPC['forumid'])
Replace with: PHP Code: if (!can_moderate($vbulletin->GPC['forumid']))
Satan
Last edited by hellsatan; 07-28-2005 at 01:30 PM.
| 
07-28-2005, 01:29 PM
|  | Forum Code Administrator | | Join Date: Jun 2000 Location: PA
Posts: 19,972
| | Re quire Users to Sign A Contract Before Posting in Specified Forums | | I'll look at it. I don't know how I got different versions into the zip than I have running here.
__________________ Salt makes mistakes taste great. | 
07-28-2005, 01:32 PM
|  | Registered Member | | Join Date: Jul 2005 Location: Northampton, UK
Posts: 9
| | Re quire Users to Sign A Contract Before Posting in Specified Forums | | Another error: PHP Code: $tickets[$forumid] = 1; } } } else {
Replace with: PHP Code: $tickets[$forumid] = 1; } } else {
Edit: And another: PHP Code: // If he doesn't, add the ticket $tickets[$forumid] = 1
Replace with: PHP Code: // If he doesn't, add the ticket $tickets[$forumid] = 1;
Satan | 
07-28-2005, 01:32 PM
|  | Forum Code Administrator | | Join Date: Jun 2000 Location: PA
Posts: 19,972
| | Re quire Users to Sign A Contract Before Posting in Specified Forums | | Here you go:
__________________ Salt makes mistakes taste great.
Last edited by amykhar; 07-28-2005 at 02:42 PM.
| 
07-28-2005, 01:35 PM
|  | Registered Member | | Join Date: Jul 2005 Location: Northampton, UK
Posts: 9
| | Re quire Users to Sign A Contract Before Posting in Specified Forums | | Then when it's all corrected: Quote:
Database error in vBulletin 3.5.0 Release Candidate 1:
Invalid SQL:
UPDATE user
SET tickets = a:1:{i:0;i:1;}
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 ':1:{i:0;i:1;}
WHERE userid = 1' at line 2
Error Number : 1064
Date : Thursday, July 28th 2005 @ 12:34:47 PM
Script : http://www.hellsatan.co.uk/vbh.org/t...umid=&userid=1
Referrer : http://www.hellsatan.co.uk/vbh.org/showthread.php?t=5
IP Address : 80.71.4.54
Username : Chris M
Classname : vb_database
| It doesn't like your ticket system :p
Satan | 
07-28-2005, 01:41 PM
|  | Registered Member | | | | |