vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Miscellaneous Hacks - Advanced Rules and User Agreement Hack v2.0.0 (https://vborg.vbsupport.ru/showthread.php?t=138113)

Mr_Snob 01-31-2007 10:00 PM

Advanced Rules and User Agreement Hack v2.0.0
 
This modification contains a security vulnerability, you are hereby advised to uninstall until further notice.
- vBulletin.org Staff


Advanced Rules and User Agreement Hack v2.0.0

------------------------------------------------------------
This Hack is Port of UAE's Rules and User Agreement Hack.
And I have this one together combined with my old
"Rules Hack v1.5"


Hack Version: 2.0.0
vB-version: 3.6.4
Developers: UAE and Hasann
Install-difficulty: Easy
Port of: Rules and User Agreement Hack

Requested Here: Hasann was wondering if you and uae who wrote the Rules and User Agreement Hack could get together and combine your modifications into one package?

Introduction:

Advanced Rules and User Agreement Hack Is an agreement rules systems, that requires user to agree to each individual forum or/and pages rules within the whole board community ?if applicable? prior to permission them to different action (Viewing a Forum, Posting New Thread for the first time, Posting New Thread, Posting Reply).

This will limit the forum breaches that occur often due to unawareness of the rules and agreement. This shall automate the manual procedures that are followed by users to read the ?rules and agreement? and will enforce to some extent the users to be aware of rules in place. Moreover this will eliminate the options of any denial by certain users of not being aware of ?rules and agreements? being in place for the desired forum.

This can also be used as alerts, broadcasts, messages and tutorials? etc to certain individual, multi users or groups.

Whats New in this Port Hack?: List of all Rules shows you in /rules.php

Features:
  • Unlimited* Rule(s).
  • An Individual Forum can have multi rules agreement.
  • An Individual FILE within your forum can have mutli rules agreement.
  • List All Rules that user has agreed to from his/her profile page "if a url was provided".
  • Edit/Delete Rule(s).
  • Reset Rule(s) Manually or with Cron Job.
  • Rules can use bbcode.
  • Set to show a rule(s) agreement in any selected forum/page (file url) IF:
- User's Usergroup is Y.
- User's Additional Usergroups is Y.
- User's User Id is X.
- User's User Name is XXX.
- User's first time posting a new thread in this forum.
- User's has posts greater than x posts.
- User's has posts less than x posts.
- User's Join Date is After (yyyy-mm-dd).
- User's Join Date is Befor (yyyy-mm-dd).
- User's Last Activiy is After (yyyy-mm-dd).
- User's Last Activiy is Befor (yyyy-mm-dd).
- User's Last Post is After (yyyy-mm-dd).
- User's Last Post is Befor (yyyy-mm-dd).
* Can Use Conditionals.
  • Fully "phrased" so translations are made easy.
Settings in the Admin CP:
  • List Rule(s).
  • Add New Rule(s).
  • Edit / Delete Rule(s).
  • Reset Rule(s).
  • Activate and Inactivate Rule(s)
Screenshots:

See attachments.

Hack Installation Details:

1 Product XML with 5 Plugins, and 60 Phrases

New files for this Hack: 4
/rules.php
/admincp/rulesagreement.php
/includes/cron/cron_ruleshack.php
/includes/xml/cpnav_rulesagreement.xml

New templates for this Hack: 5
rules
rulesbit
rulesview
ruleshack_rules
ruleshack_rulesbit

File-edits: 0

Template-edits: 1
MEMBERINFO
navbar

New DB tables for this Hack: 1
ruleshack

DB Tables modified for this Hack: 1
user

How to Install:
To install this hack, simply download the zip file, Unzip it to a directory on your computer and follow the steps from README.txt


################################################## ###########################
############################## TEMPLATE EDITS ###############################
################################################## ###########################

******************************* IN NAVBAR TEMPLATE *******************************

FIND

HTML Code:

<td class="vbmenu_control"><a href="memberlist.php$session[sessionurl_q]">$vbphrase[members_list]</a></td>
ABOVE ADD

HTML Code:

<td class="vbmenu_control"><a href="rules.php$session[sessionurl_q]">$vbphrase[rules]</a></td>
******************************* IN MEMBERINFO TEMPLATE *******************************

FIND

HTML Code:

            <if condition="$vboptions['usereferrer']">
ABOVE ADD


HTML Code:

<!-- [START HACK='Rules and User Agreement' by UAE AND HASANN VERSION='2.0.0' CHANGEID= 1 ] -->
            <if condition="$agreedrules">
  <fieldset class="fieldset">
    <legend>$vbphrase[ruleshack_agreed]</legend>
    <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
    <tr>
    <td>
      <phrase 1="$userinfo[username]">$vbphrase[ruleshack_x_has_agreed_to_the_following_rules]</phrase>
    </td>
    </tr>
$agreedrules
    </table>
  </fieldset>
            </if>
<!-- [END HACK='Rules and User Agreement' by UAE AND HASANN VERSION='2.0.0' CHANGEID= 1 ] -->

################################################## ###########################
############################ EDITS END #############################
################################################## ###########################


PLEASE REMEMBER TO BACKUP BEFORE YOU BEGIN!

Snake 02-01-2007 08:01 AM

Wow thanks for this! :D

bashy 02-01-2007 08:07 AM

Hi

I already have uae's version installed, what would you recommend to upgrade please?

redlabour 02-01-2007 08:23 AM

Attention

Ehhmmm .... uploaded all Files and if i now try to import the Product the Importsign [::::::::::::::::::::::::::::::::::::::::::::::] is growing and growing and growing and growing and does never stop .... absolutelly fantastic and never seen effect - this Product does not work.

Mr_Snob 02-01-2007 08:24 AM

Quote:

Originally Posted by bashy (Post 1171894)
Hi

I already have uae's version installed, what would you recommend to upgrade please?

if you are have been allready uae's version installed please upload into forum root directory only rules.php file then you are done hmm you must have the three templates too installed rules,rulesbit and rulesview :confused:

Quote:

Originally Posted by redlabour (Post 1171905)
Attention

Ehhmmm .... uploaded all Files and if i now try to import the Product the Importsign [::::::::::::::::::::::::::::::::::::::::::::::] is growing and growing and growing and growing and does never stop .... absolutelly fantastic and never seen effect - this Product does not work.

What vBulletin version are you trying to install this on?
what version of MySql has your server?

redlabour 02-01-2007 08:27 AM

Quote:

Originally Posted by Mr_Snob (Post 1171906)
What vBulletin version are you trying to install this on?
what version of MySql has your server?

vBulletin 3.6.4 - what else ?? :rolleyes:

mySQL - 4.1.19

Mr_Snob 02-01-2007 08:30 AM

Quote:

Originally Posted by redlabour (Post 1171905)
Attention

Ehhmmm .... uploaded all Files and if i now try to import the Product the Importsign [::::::::::::::::::::::::::::::::::::::::::::::] is growing and growing and growing and growing and does never stop .... absolutelly fantastic and never seen effect - this Product does not work.

has someone the same error???? :eek:

Paul M 02-01-2007 10:56 AM

A number of posts have been removed. Please remember that vb.org is an english only forum, esp in support threads.

Thanks.

projectego 02-01-2007 12:32 PM

Very cool hack. Thanks! ;)

Brew 02-01-2007 03:00 PM

This looks to be a great mod but I do have one question before I click install.

Would this include the rules box when someone registers?

Thanks!

Mr_Snob 02-01-2007 07:47 PM

Quote:

Originally Posted by Brew (Post 1172156)
This looks to be a great mod but I do have one question before I click install.

Would this include the rules box when someone registers?

Thanks!

you can with this hack put that what you says ;)

Hornstar 02-02-2007 11:54 AM

I was using the old user agreement hack from way back, and its still installed on my site, and is still working, and im on 3.6.4 was there something that should not be working with the old version that should require me to update now?

DPSR 02-02-2007 12:08 PM

I think i need this cool now but only one question.. what about searh engines bots?? If i create rule for a forum that one have to agree if he/she want to view hacks in that forum but what about search engines?? This hack will block them?

DPSR 02-03-2007 01:44 AM

I tried installing this hack but when i try to add a new rule to a forum it gives me same mysql db error :( that it was giving on the hack by Hasann

Any help ????

Spinball 02-03-2007 01:28 PM

Nice hack.
Couple of things, though.
First, since there tend to be a number of rules to which the user agrees in order for access to be given to a certain forum (or whatever), in the rules template, I changed the text Number of rules: to Number of rule pages:.
Also, since my rules pages are formatted, in the rulesview template, I changed
<td class="thead" width="100%" align="center">$drule
to
<td class="alt2" width="100%">$drule

Spinball 02-03-2007 05:41 PM

More important requests.
First, is it possible to allow (and correctly display) HTML within the rules text?
Second, is it possible to have a list of forum IDs which the rule applies to?
Third, Rules Options - what does the 'Or from File URL' allow us to do and how?

amagazi 02-04-2007 06:07 AM

Uploaded and installed all files perfectly...

But there are no options in AdminCP? I logged in and out multiple times...

Disregard.. Though, you might want to mention that the options do not have their own heading...

Mr_Snob 02-04-2007 05:02 PM

Quote:

Originally Posted by hornstar1337 (Post 1172896)
I was using the old user agreement hack from way back, and its still installed on my site, and is still working, and im on 3.6.4 was there something that should not be working with the old version that should require me to update now?

overwrite new product with old one
this new version has one feature that is Listing of Rule Pages in the /rules.php

Quote:

Originally Posted by DPSR (Post 1172906)
I think i need this cool now but only one question.. what about searh engines bots?? If i create rule for a forum that one have to agree if he/she want to view hacks in that forum but what about search engines?? This hack will block them?

No no!
if you are have vBSeo or Zoints Seo Installed put your Rule Page's URl put it like this www.DOMAIN.com/forum/file.html

also put your RULE PAGE URL with ending .html not .php that working

Quote:

Originally Posted by Spinball (Post 1173652)
Nice hack.
Couple of things, though.
First, since there tend to be a number of rules to which the user agrees in order for access to be given to a certain forum (or whatever), in the rules template, I changed the text Number of rules: to Number of rule pages:.
Also, since my rules pages are formatted, in the rulesview template, I changed
<td class="thead" width="100%" align="center">$drule
to
<td class="alt2" width="100%">$drule

thanks for your warning i'll fix it in the next version of this hack ;)

Quote:

Originally Posted by Spinball (Post 1173794)
More important requests.
First, is it possible to allow (and correctly display) HTML within the rules text?
Second, is it possible to have a list of forum IDs which the rule applies to?
Third, Rules Options - what does the 'Or from File URL' allow us to do and how?

i believe in next version coming soon this requests :D:up:

Quote:

Originally Posted by amagazi (Post 1174157)
Uploaded and installed all files perfectly...

But there are no options in AdminCP? I logged in and out multiple times...

Disregard.. Though, you might want to mention that the options do not have their own heading...

if i not wrote about settings then do not give settings in the admincp you must that unterstand :eek:
thanks all for you guys;)

pipin 02-05-2007 04:59 PM

the hack reads still 1.1.5 in the plugin management.
and can you add the link to this thread to the title?

stwilson 02-10-2007 06:19 PM

Does anyone have this working with 3.6.4 running on MySQL 5.0.16? I cannot get it to work.

dutchbb 02-10-2007 10:57 PM

Nope.... I'm having database errors everywhere... did all steps including importing the product.

MySQL Error : Table 'forum.ruleshack' doesn't exist
Error Number : 1146

vb 3.6.4
php 5.2.0
MySQL Version 5.0.15-standard

DPSR 02-11-2007 01:15 AM

I'm having exact same error as dutchbb is facing but i get while adding a rule not during installation of the hack .. any sol?

Merriweather 02-11-2007 02:36 AM

I installed this modification and haven't found it to do anything.

I set it to require agreement to a rule when posting for the first time to a particular forum. Made sure it was active, the proper forum and usergroup were set, etc. When to test it and it let me post with no mention of rules at all.

The problem is when you use the conditionals, it says black fields will be ignored. However, if you don't put anything in the "posts are greater than or equal" to or the "posts are less than" fields, they are automatically set to 0. Therefore, it can't work -- no one has both posts greater than AND less than 0. Once I put a large number in the "posts are less than" field it worked, but it should allow that field to be blank.

Merriweather 02-11-2007 02:47 AM

Another issue -- even though I have the rule set to require agreement upon new thread or new post, it only asked the user to agree the first time. Seems if I have it set to require agreement on new post, it should be every new post, correct?

Also, in order for it to have a link in the member profile, the rules must have their own page. However, it should be able to link to a page generated with the rule content as entered, shouldn't it? We shouldn't have to maintain a separate page with the same content for the sake of linking.

Finally, is it possible to make the rules that a user agreed to visible only to select usergroups, such as moderators and administrators and then the person who agreed to them? I don't think everyone needs to see that info.

whitey06 02-11-2007 08:45 AM

Im getting the following error when trying to import the product:

"Fatal error: Cannot use object of type mysqli_result as array in /var/www/mysite.com/forum/admincp/plugin.php(1941) : eval()'d code on line 35"

Any suggestions?

Thanks

Black Widow 02-11-2007 04:26 PM

thanks.
installed...

i have the same problems with the conditions.
Can it be fixed?

BobbyBig 02-11-2007 10:42 PM

Is there any German translation yet ?

regards

whodah 03-19-2007 04:29 AM

First off - thanks for the add-on Mr_Snob! :D

It appears that Rule #14 gets priority over the group tests (I.e. 1-5).

For instance, I have a rule enabled for "OR from File URL" with the Forum drop down box set to "Destination Forum" and all options beneath it enabled except "URL Exact Match" which is set to "No". (Incidently, I have the URL set to http://www.mydomain.com/showthread.php)

My only "User & Usergroup Options" selections are in the "Primary Usergroup" choices.

Rule #14 then gets a:
Code:

                $flag      = 1;
                $condflag = 1;

in the template 'parse_templates' no matter if the user is in one of the above selected groups or not.

This would explain some of the issues people were having in version 1.5 of the rules being applied to all usergroups instead of just the ones selected.

I did a kludge to get by... (Basically did another check against the Anonymous usergroup.) But at first glance, a more proper fix may be to combine rule #14 w/ rule 1-5?

Or another approach might be to store $flag as an array of violations rather than a boolean. If one did that, you'd have two benefits:
  1. You could compare the output of Rules 1-5 in subsequent Rule checks (Like pesky Rule #14!)
  2. You could enable a 'debug' option which would spit out exactly which rule was violated. I.e. "Rules violated: 1,5,7" letting admins know a bit more while debugging their rules.
HTH! :D

-Who Dah?

pipin 03-23-2007 08:56 AM

Quote:

Originally Posted by stwilson (Post 1179307)
Does anyone have this working with 3.6.4 running on MySQL 5.0.16? I cannot get it to work.

problem is the use of the fieldname repeat, which is a reserved word in mysql 5

https://vborg.vbsupport.ru/showpost....&postcount=216

dbirosel 03-30-2007 07:35 PM

It works great for me and i'm using 3.6.5. Got a problem though, i want to set a category because all the forums under the category i want to have that one rule i set.

Basically, i have a classified section broken down to seperate forums. I want that one set rule i created to be applied to the sections. What do i do? Thanks.

dutchbb 04-09-2007 08:10 AM

Hello,

I got a database error on all pages saying there is no rules table? I followed the instructions to the letter.

Quote:

Database error in vBulletin 3.6.4:

Invalid SQL:
SELECT * FROM ruleshack
WHERE (fileurl LIKE 'http://forum.dutchbodybuilding.com/index.php' AND exactmatch = 1 )
OR (fileurl LIKE 'http://forum.dutchbodybuilding.com/index.php%' AND exactmatch = 0 ) AND active = 1 ORDER BY ruleid;

MySQL Error : Table 'tijl_forum.ruleshack' doesn't exist

RedGTiVR6 05-01-2007 02:49 PM

What is the difference between this mod and CYBs Advanced Forum Rules found here.

?

stwilson 05-05-2007 02:14 AM

Since I cannot get this working on my own, is anyone interested in installing this for me for a nominal fee??? Mr. Snob????

Fearlessninja 05-13-2007 02:17 AM

Having a problem making this hack work for child forums....

ElForro 05-14-2007 12:40 PM

I've two problems:

- When I check "Include Child Forums", the Rules appears when an Unregistered user tries to enter that forums [and child forums]. I hadn't check that Group [unregistered] to accept the Rules, and it only happens when I turn the "Include Child Forums" option on.

- When I try to enter a forum, the rules are displayed correctly. But when I try to enter directly to a Thread, the Rules and all the page don't loads the CSS file.. It appears that the path is incorrect: Insted of "http://www.domain.com/clientscript/vbulletin_css/style-d219a5c6-00001.css" it's "/clientscript/vbulletin_css/style-d219a5c6-00001.css", that is without the domain name. (I have the CSS to load as a separate file)

Thanks in advance and sorry about my english :$

pds 06-02-2007 04:35 PM

Quote:

Originally Posted by RedGTiVR6 (Post 1238957)
What is the difference between this mod and CYBs Advanced Forum Rules found here.

?

Main difference is Cyb's does not allow you to specify accepting a rule on a "per forum" basis, but forces the requirement on all forums.

rmxs 06-12-2007 03:54 PM

Not Working

RedGTiVR6 06-12-2007 05:55 PM

no info on what's not working specifically?

stwilson 06-15-2007 10:47 PM

Quote:

Originally Posted by stwilson (Post 1241710)
Since I cannot get this working on my own, is anyone interested in installing this for me for a nominal fee??? Mr. Snob????

Anyone???? :)

biggeorge 06-16-2007 04:23 AM

Works perfectly for me on 3.6.4

Had a little trouble finding it in the AdminCP... Forums & Moderators | Rules Manager.

I had it up and running with 6 RULES all in the proper forums in about 30-mins. This is EXACTLY what my forum needed.

5 STARS from me. Clicked Installed. Thank you!


All times are GMT. The time now is 09:31 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01471 seconds
  • Memory Usage 1,863KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (4)bbcode_html_printable
  • (14)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete