vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Miscellaneous Hacks - VSa - Advanced Forum Rules (https://vborg.vbsupport.ru/showthread.php?t=236069)

ForceHSS 09-22-2013 09:09 PM

Then just edit them and add what you want to show

katie hunter 10-05-2013 07:25 PM

This mod is really bad, it locks my table. endless loading that i couldn't load the forum at all.

AusPhotography 10-08-2013 01:14 AM

Quote:

Originally Posted by katie hunter (Post 2450253)
This mod is really bad, it locks my table. endless loading that i couldn't load the forum at all.

It works very well for us.

It would help if you advised your environment and vB version to get help

Ba'al 10-17-2013 10:56 PM

Quote:

Originally Posted by katie hunter (Post 2450253)
This mod is really bad, it locks my table. endless loading that i couldn't load the forum at all.

Quote:

Originally Posted by AusPhotography (Post 2450815)
It works very well for us.

It would help if you advised your environment and vB version to get help

It works perfectly for us also.

Ba'al 10-17-2013 11:00 PM

Quote:

Originally Posted by suvari1794 (Post 2447344)
I mean, just "general rules" shown at the first click to forum rules link on the navbar.
But, I want to see every rules (general rules and other rules sets) in the first visit. I don't want 'More Rules' drop-down menu.

Can I explain?

That is how i have mine setup, you can disable more rules in the settings, i just added all rules and the code to the general rules(I did try the drop down window at first but noticed that most of my members didnt notice it and didnt complete their rules requirements.)

thienhi228 11-14-2013 12:51 AM

Please update for vbb 5, thanks you!

ozzy47 11-14-2013 01:42 AM

Quote:

Originally Posted by thienhi228 (Post 2460531)
Please update for vbb 5, thanks you!

I know the developer of this mod is quite busy, so I would not expect that to happen within the foreseeable future.

thenashy 12-17-2013 12:03 PM

All of my VSA products, when clicking links to change options, eg. Setup link in Advanced Reg, and Edit Rules in Advanced Forum Rules, load the smiles explanation page.

Odd?

Bacon Butty 01-08-2014 07:46 PM

Quote:

Originally Posted by thenashy (Post 2469002)
All of my VSA products, when clicking links to change options, eg. Setup link in Advanced Reg, and Edit Rules in Advanced Forum Rules, load the smiles explanation page.

Odd?

Same here.

Uninstalled.

Videx 01-08-2014 08:22 PM

The smilies page loads when an "Unknown error" occurs. There's something on your server keeping the script from running correctly. I know that's not very helpful, but there it is.

btedition 01-15-2014 10:32 AM

Not working here on 4.2.0!

vsarules page taking me to Smilies page and I'm not able to edit the rules as well. Something is wrong for sure there.

dariyos 03-18-2014 12:50 PM

works fine,

need only a german translation for this...

does it have a german language pack?

edit: solved

dariyos 05-20-2014 01:29 PM

is there a function that shows, who accepted the rules and who not?

it should generate a list, that shows who accepted it or who not..

AusPhotography 05-21-2014 10:17 PM

Quote:

Originally Posted by dariyos (Post 2498600)
is there a function that shows, who accepted the rules and who not?

it should generate a list, that shows who accepted it or who not..

Works fine for us on vB4.2.2.

You can generate you own reports via a database query, there are extra fields on the user table.

AusPhotography 05-24-2014 07:29 AM

Just upgraded to PHP 5.4 and the edit rules does not work :(
The edit window is empty

This change fixed it... (adding ,ENT_COMPAT | ENT_HTML401,"ISO-8859-1" to the htmlspecialchars call -- don't know why it works??
See: http://docs.php.net/manual/en/functi...ecialchars.php

PHP Code:

            if (($_REQUEST['do'] == 'vsaafr_addedit') AND $vbulletin->userinfo['userid'] AND is_member_of($vbulletin->userinfo,6))
            {
                
$vsafr_getrule_set $vbulletin->input->clean_gpc('r''cfrset'TYPE_UINT);
                if (
$vsafr_getrule_set>0)
                {
                    
$vbulletin->db->hide_errors();
                    
$vsafr_getrule $vbulletin->db->query_first("
                        SELECT id, name, rules
                        FROM " 
TABLE_PREFIX "vsa_frules AS vsa_frules
                        WHERE id = '" 
$vbulletin->db->escape_string($vsafr_getrule_set) . "'
                    "
);
                    
$vsafr_getrule['name'] = htmlspecialchars($vsafr_getrule['name'],ENT_COMPAT ENT_HTML401,"ISO-8859-1");
                    
$vsafr_getrule['rules'] = htmlspecialchars($vsafr_getrule['rules'],ENT_COMPAT ENT_HTML401,"ISO-8859-1");
                    
$vbulletin->db->show_errors();
                } 

Edit: The two htmlspecialchars would seem to be pointless anyway

forums55 06-01-2014 01:32 PM

Quote:

Originally Posted by dariyos (Post 2488017)
works fine,

need only a german translation for this...

does it have a german language pack?

edit: solved

How did you solve this? I'm trying to translate the rules phrases but I cannot find the VSA phrases in the Phrase Manager. Need support please!

forums55 06-02-2014 06:47 PM

This mod doesn't have the vb rawphrase so I cannot seem to be able to translate it. Should I edit the whole Mod ?

AusPhotography 06-03-2014 02:17 AM

Given the rules themselves are an editiable text, there is very little text that can be phrased.

In other words it is a single language mod

forums55 06-03-2014 01:28 PM

Quote:

Originally Posted by AusPhotography (Post 2500489)
Given the rules themselves are an editiable text, there is very little text that can be phrased.

In other words it is a single language mod

Thanks.

Sad though, otherwise is a nice mod.

AusPhotography 06-04-2014 01:42 AM

You can set up multiple rule sets.
You could do the following:
1. Set up the default set with links to each language specific set of rules
2. Create a rule set for each language you need

You can link each rule by using a syntax like:
.../misc.php?do=vsarules&cfrset=7
The &cfrset=X (X = a number) allows a specific set to be linked.

We use multiple rule sets on our site.

forums55 08-30-2014 11:46 AM

Quote:

Originally Posted by AusPhotography (Post 2500609)
You can set up multiple rule sets.
You could do the following:
1. Set up the default set with links to each language specific set of rules
2. Create a rule set for each language you need

You can link each rule by using a syntax like:
.../misc.php?do=vsarules&cfrset=7
The &cfrset=X (X = a number) allows a specific set to be linked.

We use multiple rule sets on our site.

I'm not that resourceful in coding but thanks for the TIP.

wolfey 11-02-2014 09:09 PM

I am currently having same issue here,
Doesn't happen to myself in admin usergroup, but users can not get passed the loop of keep having to click accept. the odd thing is that the rule they have to click accept for isn't the one I have set for that group.
I have one rule (#2) set in one forum, but they are being forced to accept the general rule (#1) over and over and page keeps returning to same general rule, but never able to get into that forum.?




Quote:

Originally Posted by sergioloporto (Post 2059043)
Hi... I think this is not the reason. I have been notified by a guest about this less than 2 hours after the activation of the plugin.

I have then tried myself with different browsers and different accounts and the issue is persisting.... any idea?


Some more informations that may help to understand what is happening:
  • if I go to the profile of one of these users with the admin account I can read that the rules have been accepted "Rules accepted: 06-24-2010, 10:53 PM"
  • But it's not true. If the users go back and try to start a thread, they are redirected to the Forum Rules
  • Even if I change the timer to 0, the loop persists

P.s. in other forums using the same application it works


wolfey 11-02-2014 09:28 PM

OK, Got it!

This shouldn't have mattered but, this single forum section that I had set a rule only for is set in forum options for "not active" because I use a link on the NAVBAR to access is using the url instead of having it listed on the main forum page, changed it to "active":up:

Hope this helps someone else too.

sevenmix 11-06-2014 10:10 PM

Quote:

Originally Posted by AusPhotography (Post 2499177)
Just upgraded to PHP 5.4 and the edit rules does not work :(
The edit window is empty

This change fixed it... (adding ,ENT_COMPAT | ENT_HTML401,"ISO-8859-1" to the htmlspecialchars call -- don't know why it works??
See: http://docs.php.net/manual/en/functi...ecialchars.php

PHP Code:

            if (($_REQUEST['do'] == 'vsaafr_addedit') AND $vbulletin->userinfo['userid'] AND is_member_of($vbulletin->userinfo,6))
            {
                
$vsafr_getrule_set $vbulletin->input->clean_gpc('r''cfrset'TYPE_UINT);
                if (
$vsafr_getrule_set>0)
                {
                    
$vbulletin->db->hide_errors();
                    
$vsafr_getrule $vbulletin->db->query_first("
                        SELECT id, name, rules
                        FROM " 
TABLE_PREFIX "vsa_frules AS vsa_frules
                        WHERE id = '" 
$vbulletin->db->escape_string($vsafr_getrule_set) . "'
                    "
);
                    
$vsafr_getrule['name'] = htmlspecialchars($vsafr_getrule['name'],ENT_COMPAT ENT_HTML401,"ISO-8859-1");
                    
$vsafr_getrule['rules'] = htmlspecialchars($vsafr_getrule['rules'],ENT_COMPAT ENT_HTML401,"ISO-8859-1");
                    
$vbulletin->db->show_errors();
                } 

Edit: The two htmlspecialchars would seem to be pointless anyway

Thanks, this solved my problem.

Skyrider 11-27-2014 09:38 PM

For those who are wanting to fix the specialchars,

edit:
Quote:

VSa - Advanced Forum Rules - RA
With hook location:
Quote:

misc_start
and copy/paste (override everything) with:

Code:

if ($vbulletin->options['vsafrules_enable_global'])
                {
                        require_once(DIR . '/includes/class_bbcode.php');
                        if ($_REQUEST['do'] == 'vsarules')
                        {
                                if ($_REQUEST['doredir'] != '1')
                                {
                                        vbsetcookie('vsafr_redtopage', $_SERVER['HTTP_REFERER']);
                                }

                                $vsafr_requestedset = $vbulletin->input->clean_gpc('r', 'cfrset', TYPE_UINT);
                                if (!$vsafr_requestedset)
                                {
                                        $vsafr_requestedset = 1;
                                }

                                $vsarulesforumperms = array();
                                if ($vbulletin->options['apboupc_global_enable'])
                                {
                                        $vsarules_vsaapbopc_exclgroups = explode(",",$vbulletin->options['apboupc_forum_excludedgroups']);
                                }
                                foreach($vbulletin->forumcache AS $vsafrforum)
                                {
                                        $vsarulesforumperms[$vsafrforum["forumid"]] = fetch_permissions($vsafrforum['forumid']);
                                        if ((!($vsarulesforumperms[$vsafrforum["forumid"]] & $vbulletin->bf_ugp_forumpermissions['canview'])) OR (!($vsafrforum['options'] & $vbulletin->bf_misc_forumoptions['active']) AND !$vbulletin->options['showprivateforums'] AND !is_member_of($vbulletin->userinfo, 5,6,7)) OR ($vbulletin->options['apboupc_global_enable'] AND ($vsafrforum['accessf_nb']>$vbulletin->userinfo['posts']) AND !is_member_of($vbulletin->userinfo, $vsarules_vsaapbopc_exclgroups)))
                                        {
                                                $vsafrexclfids .= ','.$vsafrforum['forumid'];
                                        }
                                }
                                $vsafrexclfids = substr($vsafrexclfids, 1);
                                if ($vsafrexclfids!='')
                                {
                                        $vsafrexclfids = "WHERE forum.forumid NOT IN($vsafrexclfids) OR ISNULL(forum.forumid)";
                                }

                                $vbulletin->db->hide_errors();
                                $vsafr_getallrules = $vbulletin->db->query_read("
                                        SELECT vsa_frules.id, vsa_frules.name, vsa_frules.rules, forum.forumid
                                        FROM " . TABLE_PREFIX . "vsa_frules AS vsa_frules
                                        LEFT JOIN " . TABLE_PREFIX . "forum AS forum ON (forum.vsa_frules = vsa_frules.id)
                                        $vsafrexclfids
                                        GROUP BY vsa_frules.id
                                        ORDER BY vsa_frules.id ASC
                                ");
                                $vsafrules_fsetnr = $vbulletin->db->num_rows($vsafr_getallrules);
                                while ($vsafr_ruleset = $vbulletin->db->fetch_array($vsafr_getallrules))
                                {
                                        if ($vsafr_ruleset['id']==1)
                                        {
                                                $vsafrules_general_id = $vsafr_ruleset['id'];
                                                $vsafrules_general_name = $vsafr_ruleset['name'];
                                                $vsafrules_general_rules = $vsafr_ruleset['rules'];
                                        }
                                        if (($vsafr_ruleset['id']==$vsafr_requestedset) AND ($vsafr_requestedset!=1))
                                        {
                                                $vsafrules_target_id = $vsafr_ruleset['id'];
                                                $vsafrules_target_name = $vsafr_ruleset['name'];
                                                $vsafrules_target_rules = $vsafr_ruleset['rules'];
                                        }
                                        eval('$vsafrules_setselector .= " <option value=\"'.$vsafr_ruleset['id'].'\" " . iif($vsafr_requestedset==$vsafr_ruleset[id]," selected=\"selected\"","").">'.htmlspecialchars($vsafr_ruleset['name']).'</option> ";');
                                }

                                $vbulletin->db->show_errors();
                                if ($vbulletin->options['vsafrules_bb'])
                                {
                                        $cafr_parse_rules = new vB_BbCodeParser($vbulletin, fetch_tag_list());
                                        $vsafrules_general_rules = $cafr_parse_rules->do_parse($vsafrules_general_rules,1, 1, 1, 1, 1);
                                        $vsafrules_target_rules = $cafr_parse_rules->do_parse($vsafrules_target_rules,1, 1, 1, 1, 1);
                                }

                                $vsafrules_showgeneral = true;
                                $vsafrules_acceptgeneral = true;
                                if (($vbulletin->options['vsafrules_gen_rules']==3) AND ($vsafrules_target_id!=''))
                                {
                                        $vsafrules_showgeneral = false;
                                }

                                $vsafrules_style_general = '$vbcollapse[collapseobj_cybfrules_rsetg]';
                                if (($vbulletin->options['vsafrules_gen_rules']==2) AND ($vsafrules_target_id!=''))
                                {
                                        $vsafrules_style_general = 'display:none';
                                        $vsafrules_acceptgeneral = false;
                                }

                                if ($vsafrules_showgeneral AND $vsafrules_acceptgeneral)
                                {
                                        $vsafr_rulestoaccept .= ",1";
                                }
                                if ($vsafrules_target_id)
                                {
                                        $vsafr_rulestoaccept .= ",".$vsafrules_target_id;
                                }
                                $vsafr_rulestoaccept = substr($vsafr_rulestoaccept, 1);

                                $vsafr_checkaccepted_form = in_array($vsafr_requestedset, explode(',',$vbulletin->userinfo['vsafrules_sets']));

                                $vsafr_showaccform = false;
                                if (!$vsafr_checkaccepted_form AND !is_member_of($vbulletin->userinfo, explode(',', $vbulletin->options['vsafrules_excluded_groups'])) AND (strstr($vbulletin->options['vsafrules_enable_items'], 'viewforums') OR strstr($vbulletin->options['vsafrules_enable_items'], 'postthreads') OR strstr($vbulletin->options['vsafrules_enable_items'], 'postreplies') OR strstr($vbulletin->options['vsafrules_enable_items'], 'sendpms')))
                                {
                                        $vsafr_showaccform = true;
                                }

                                $navbits = construct_navbits(array('' => $vbphrase['vsafrules_rules']));
                                $navbar = render_navbar_template($navbits);

                                $templater = vB_Template::Create('vsa_frules');
                                $templater->register_page_templates();
                                $templater->register('navbar', $navbar);
                                $templater->register('vsafrules_fsetnr', $vsafrules_fsetnr);
                                $templater->register('vsafrules_setselector', $vsafrules_setselector);
                                $templater->register('vsafr_showaccform', $vsafr_showaccform);
                                $templater->register('vsafr_rulestoaccept', $vsafr_rulestoaccept);
                                $templater->register('vsafrules_showgeneral', $vsafrules_showgeneral);
                                $templater->register('vsafrules_general_name', $vsafrules_general_name);
                                $templater->register('vsafrules_general_rules', $vsafrules_general_rules);
                                $templater->register('vsafrules_style_general', $vsafrules_style_general);
                                $templater->register('vsafrules_target_id', $vsafrules_target_id);
                                $templater->register('vsafrules_target_name', $vsafrules_target_name);
                                $templater->register('vsafrules_target_rules', $vsafrules_target_rules);
                                $templater->register('vsacb_cantpost', $vsacb_cantpost);
                                print_output($templater->render());
                        }
                               
                        if (($_REQUEST['do'] == 'vsaafr_mng') AND $vbulletin->userinfo['userid'] AND is_member_of($vbulletin->userinfo,6))
                        {
                                $vbulletin->db->hide_errors();
                                $vsafr_getrules = $vbulletin->db->query_read("
                                        SELECT id, name, rules
                                        FROM " . TABLE_PREFIX . "vsa_frules AS vsa_frules
                                        ORDER BY id ASC
                                ");
                                while ($vsafr_rules = $vbulletin->db->fetch_array($vsafr_getrules))
                                {
                                        $vsafrules_rowid += 1;
                                        $vsafrules_list .= '<option value="'.$vsafr_rules['id'].'">'.$vsafr_rules['name'].'</option>';
                                        if ($vbulletin->options['vsafrules_bb'])
                                        {
                                                $cafr_parse_mng = new vB_BbCodeParser($vbulletin, fetch_tag_list());
                                                $vsafr_rules['rules'] = $cafr_parse_mng->do_parse($vsafr_rules['rules'],1, 1, 1, 1, 1);
                                        }
                                        $templater = vB_Template::Create('vsa_frules_mng_bit');
                                        $templater->register('vsafrules_rowid', $vsafrules_rowid);
                                        $templater->register('vsafr_rules', $vsafr_rules);
                                        $vsa_frules_manage .= $templater->render();
                                }
                                $vsafrules_list .= '<option value="0">'.$vbphrase['none'].'</option>';

                                $vsafr_getforums = $vbulletin->db->query_read("
                                        SELECT forum.forumid, forum.title_clean, forum.parentid, forum.displayorder, forum.vsa_frules, forum.threadcount, forum.replycount, vsa_frules.name
                                        FROM " . TABLE_PREFIX . "forum AS forum
                                        LEFT JOIN " . TABLE_PREFIX . "vsa_frules AS vsa_frules ON (vsa_frules.id = forum.vsa_frules)
                                        ORDER BY parentid, displayorder, title_clean ASC
                                ");
                                while ($vsafr_forum = $vbulletin->db->fetch_array($vsafr_getforums))
                                {
                                        if ($vsafr_forum['parentid']=='-1')
                                        {
                                                $vsafrules_iscat = $vsafr_forum['forumid'];
                                        }
                                        if ($vsafr_forum['parentid']==$vsafrules_iscat)
                                        {
                                                $vsafr_forum['title_clean'] = '-- <a href="forumdisplay.php?f='.$vsafr_forum['forumid'].'">'.$vsafr_forum['title_clean'].'</a>';
                                        }
                                        else if ($vsafr_forum['parentid']!='-1')
                                        {
                                                $vsafr_forum['title_clean'] = '---- <a href="forumdisplay.php?f='.$vsafr_forum['forumid'].'">'.$vsafr_forum['title_clean'].'</a>';
                                        }
                                        else
                                        {
                                                $vsafr_forum['title_clean'] = '<a href="forumdisplay.php?f='.$vsafr_forum['forumid'].'">'.$vsafr_forum['title_clean'].'</a>';
                                        }
                                        $vsafr_id = $vsafr_forum['forumid'];
                                        if (!$vsafr_forum['name'])
                                        {
                                                $vsafr_forum['name'] = $vbphrase['none'];
                                        }

                                        $templater = vB_Template::Create('vsa_frules_frms_bit');
                                        $templater->register('vsafr_id', $vsafr_id);
                                        $templater->register('vsafr_forum', $vsafr_forum);
                                        $vsa_frules_forums .= $templater->render();
                                }
                                $vbulletin->db->show_errors();
                               
                                $vsafr_display_rules = "none";
                                $vsafr_display_forums = "none";
                                switch ($_REQUEST['at'])
                                {
                                        case rs: $vsafr_display_rules = "block"; ; break;
                                        case fs: $vsafr_display_forums = "block"; ; break;
                                        default: $vsafr_display_rules = "block"; ; break;
                                }

                                $navbits = construct_navbits(array('' => $vbphrase['vsafrules_rules']));
                                $navbar = render_navbar_template($navbits);

                                $templater = vB_Template::Create('vsa_frules_mng');
                                $templater->register_page_templates();
                                $templater->register('navbar', $navbar);
                                $templater->register('vsafr_display_rules', $vsafr_display_rules);
                                $templater->register('vsa_frules_manage', $vsa_frules_manage);
                                $templater->register('vsafr_display_forums', $vsafr_display_forums);
                                $templater->register('vsafrules_list', $vsafrules_list);
                                $templater->register('vsa_frules_forums', $vsa_frules_forums);
                                print_output($templater->render());
                        }

                        if (($_REQUEST['do'] == 'vsaafr_addedit') AND $vbulletin->userinfo['userid'] AND is_member_of($vbulletin->userinfo,6))
            {
                $vsafr_getrule_set = $vbulletin->input->clean_gpc('r', 'cfrset', TYPE_UINT);
                if ($vsafr_getrule_set>0)
                {
                    $vbulletin->db->hide_errors();
                    $vsafr_getrule = $vbulletin->db->query_first("
                        SELECT id, name, rules
                        FROM " . TABLE_PREFIX . "vsa_frules AS vsa_frules
                        WHERE id = '" . $vbulletin->db->escape_string($vsafr_getrule_set) . "'
                    ");
                    $vsafr_getrule['name'] = htmlspecialchars($vsafr_getrule['name'],ENT_COMPAT | ENT_HTML401,"ISO-8859-1");
                    $vsafr_getrule['rules'] = htmlspecialchars($vsafr_getrule['rules'],ENT_COMPAT | ENT_HTML401,"ISO-8859-1");
                    $vbulletin->db->show_errors();
                } 
                                $navbits = construct_navbits(array('' => $vbphrase['vsafrules_rules']));
                                $navbar = render_navbar_template($navbits);

                                $templater = vB_Template::Create('vsa_frules_addedit');
                                $templater->register_page_templates();
                                $templater->register('navbar', $navbar);
                                $templater->register('vsafr_getrule_set', $vsafr_getrule_set);
                                $templater->register('vsafr_getrule', $vsafr_getrule);
                                print_output($templater->render());
                        }

                        if (($_REQUEST['do'] == 'vsaafr_doaddedit') AND $vbulletin->userinfo['userid'] AND is_member_of($vbulletin->userinfo,6))
                        {
                                $vbulletin->db->hide_errors();
                                $vbulletin->input->clean_array_gpc('p', array(
                                        'set_id' => TYPE_UINT,
                                        'set_name' => TYPE_STR,
                                        'set_rules' => TYPE_STR,
                                        'set_del' => TYPE_UINT)
                                );
                                if ($vbulletin->GPC['set_id'])
                                {
                                        if ($vbulletin->GPC['set_del']=='1')
                                        {
                                                $vbulletin->db->query_write(" DELETE FROM " . TABLE_PREFIX . "vsa_frules WHERE id = '" . $vbulletin->db->escape_string($vbulletin->GPC['set_id']) . "' ");
                                        }
                                        else
                                        {
                                                $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "vsa_frules SET name = '" . $vbulletin->db->escape_string($vbulletin->GPC['set_name']) . "', rules = '" . $vbulletin->db->escape_string($vbulletin->GPC['set_rules']) . "' WHERE id = '" . $vbulletin->db->escape_string($vbulletin->GPC['set_id']) . "' ");
                                        }
                                }
                                else
                                {
                                        $vbulletin->db->query_write("
                                                INSERT INTO `". TABLE_PREFIX ."vsa_frules`
                                                (name, rules)
                                                VALUES ('" . $vbulletin->db->escape_string($vbulletin->GPC['set_name']) . "', '" . $vbulletin->db->escape_string($vbulletin->GPC['set_rules']) . "')
                                        ");
                                }
                                $vbulletin->db->show_errors();
                                $vbulletin->url = 'misc.php?do=vsaafr_mng&amp;at=rs';
                                exec_header_redirect($vbulletin->url);
                        }

                        if (($_REQUEST['do'] == 'vsaafr_dosetforum') AND $vbulletin->userinfo['userid'] AND is_member_of($vbulletin->userinfo,6))
                        {
                                $vbulletin->db->hide_errors();
                                $vbulletin->input->clean_array_gpc('p', array(
                                        'forum_id' => TYPE_ARRAY,
                                        'rules_id' => TYPE_INT)
                                );
                                $vsaafr_forums = implode(',', $vbulletin->GPC['forum_id']);
                                if ($vsaafr_forums)
                                {
                                        $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "forum SET vsa_frules = '" . $vbulletin->db->escape_string($vbulletin->GPC['rules_id']) . "' WHERE forumid IN ($vsaafr_forums) ");
                                }
                                $vbulletin->db->show_errors();
                                require_once(DIR . '/includes/adminfunctions.php');
                                build_forum_permissions();
                                $vbulletin->url = 'misc.php?do=vsaafr_mng&amp;at=fs';
                                exec_header_redirect($vbulletin->url);
                        }

                        if ($_REQUEST['do'] == 'vsaafragree')
                        {
                                $vbulletin->db->hide_errors();
                                $vsafr_rulesaccept = $vbulletin->input->clean_gpc('p', 'cfrset', TYPE_NOHTML);

                                if ($vbulletin->userinfo['userid'])
                                {
                                        $vsafr_rulesaccepted = $vbulletin->userinfo['vsafrules_sets'].",".$vsafr_rulesaccept;
                                }
                                else
                                {
                                        $vsafr_rulesaccepted = $_COOKIE[COOKIE_PREFIX . 'cfrrs'].",".$vsafr_rulesaccept;
                                }

                                $vsafr_rulesaccepted = explode(",",trim($vsafr_rulesaccepted, ','));
                                $vsafr_rulesaccepted = implode(",",array_unique($vsafr_rulesaccepted));
                                if (!$vsafr_rulesaccepted)
                                {
                                        $vsafr_rulesaccepted = '0';
                                }

                                if ($vbulletin->userinfo['userid'])
                                {
                                        $vbulletin->db->query_write(" UPDATE " . TABLE_PREFIX . "user SET vsafrules_sets = '" . $vbulletin->db->escape_string($vsafr_rulesaccepted) . "', vsafrules_date = '".TIMENOW."' WHERE userid = " . $vbulletin->userinfo['userid'] . " ");
                                }
                                else
                                {
                                        vbsetcookie('cfrrs', $vsafr_rulesaccepted);
                                }

                                $vbulletin->input->clean_gpc('c', COOKIE_PREFIX . 'vsafr_redtopage', TYPE_NOHTML);
                                if ($vbulletin->GPC[COOKIE_PREFIX . 'vsafr_redtopage']!='')
                                {
                                        $vbulletin->url = $vbulletin->GPC[COOKIE_PREFIX . 'vsafr_redtopage'];
                                }
                                else
                                {
                                        $vbulletin->url = $vbulletin->options['homeurl'];
                                }
                                $vbulletin->db->show_errors();
                                exec_header_redirect($vbulletin->url);
                        }

                        if (($_REQUEST['do']=='cfrresetuser') OR ($_REQUEST['do']=='cfrresetall'))
                        {
                                if ($_REQUEST['do']=='cfrresetuser')
                                {
                                        $afrresettype='user';
                                }
                                if ($_REQUEST['do']=='cfrresetall')
                                {
                                        $afrresettype='all';
                                        $vsafr_getrulesets = $vbulletin->db->query_read("
                                                SELECT id, name
                                                FROM " . TABLE_PREFIX . "vsa_frules AS vsa_frules
                                                ORDER BY id ASC
                                        ");
                                        while ($vsafr_ruleset = $vbulletin->db->fetch_array($vsafr_getrulesets))
                                        {
                                                $vsa_frules_rulesetid = $vsafr_ruleset['id'];
                                                $vsa_frules_rulesets .= "<br /><input type=\"checkbox\" name=\"cfrdel[$vsa_frules_rulesetid]\" value=\"$vsa_frules_rulesetid\" /> ".$vsafr_ruleset['name'];
                                        }       
                                }

                                $vbulletin->input->clean_array_gpc('r', array(
                                        'tu' => TYPE_UINT,
                                        'tun' => TYPE_NOHTML,
                                        'cfrset' => TYPE_UINT,
                                        'cfrsetn' => TYPE_NOHTML)
                                );
                                $cfr_tu = $vbulletin->GPC['tu'];
                                $cfr_tun = $vbulletin->GPC['tun'];
                                $cfr_tset = $vbulletin->GPC['cfrset'];
                                $cfr_tsetn = $vbulletin->GPC['cfrsetn'];

                                if ($cfr_tun=='')
                                {
                                        $cfr_tu = '';
                                }
                               
                                $vsafr_resetuserall_phrase = construct_phrase($vbphrase['vsafrules_resetuser_confirmall'], $cfr_tun.' (ID:'.$cfr_tu.')', 'member.php?u='.$cfr_tu, $cfr_tsetn);
                                $vsafr_resetusersel_phrase = construct_phrase($vbphrase['vsafrules_resetuser_confirm'], $cfr_tun.' (ID:'.$cfr_tu.')', 'member.php?u='.$cfr_tu, $cfr_tsetn);

                                $navbits = construct_navbits(array('' => $vbphrase['vbulletin_message']));
                                $navbar = render_navbar_template($navbits);

                                $templater = vB_Template::Create('vsa_frules_reset');
                                $templater->register_page_templates();
                                $templater->register('navbar', $navbar);
                                $templater->register('cfr_tset', $cfr_tset);
                                $templater->register('afrresettype', $afrresettype);
                                $templater->register('vsa_frules_rulesets', $vsa_frules_rulesets);
                                $templater->register('cfr_tu', $cfr_tu);
                                $templater->register('vsafr_resetuserall_phrase', $vsafr_resetuserall_phrase);
                                $templater->register('vsafr_resetusersel_phrase', $vsafr_resetusersel_phrase);
                                print_output($templater->render());
                        }

                        if ($_REQUEST['do']=='cfrreset')
                        {
                                $vbulletin->input->clean_array_gpc('p', array(
                                        'resettype' => TYPE_NOHTML,
                                        'cfrtu' => TYPE_UINT,
                                        'cfrtset' => TYPE_UINT)
                                );
                                if (($vbulletin->GPC['resettype']=='cfruser') AND ($vbulletin->GPC['cfrtu']!='') AND can_moderate())
                                {
                                        $vbulletin->db->hide_errors();
                                        if ($vbulletin->GPC['cfrtset']==0)
                                        {
                                                $vbulletin->db->query_write(" UPDATE " . TABLE_PREFIX . "user SET vsafrules_sets = '0', vsafrules_date = '0' WHERE userid = '" . $vbulletin->GPC['cfrtu'] . "' ");
                                        }
                                        else
                                        {
                                                $vsafr_tgtuser = $vbulletin->db->query_first("
                                                        SELECT userid, vsafrules_sets
                                                        FROM " . TABLE_PREFIX . "user AS user
                                                        WHERE userid = '".$vbulletin->GPC['cfrtu']."'
                                                ");
                                                $vsafr_rulesaccepted = str_replace($vbulletin->GPC['cfrtset'],"",$vsafr_tgtuser['vsafrules_sets']);
                                                $vsafr_rulesaccepted = str_replace(",,",",",$vsafr_rulesaccepted);
                                                $vsafr_rulesaccepted = trim($vsafr_rulesaccepted, ',');
                                                if (!$vsafr_rulesaccepted)
                                                {
                                                        $vsafr_rulesaccepted = '0';
                                                }
                       
                                                $vbulletin->db->query_write(" UPDATE " . TABLE_PREFIX . "user SET vsafrules_sets = '" . $vbulletin->db->escape_string($vsafr_rulesaccepted) . "' WHERE userid = " . $vbulletin->GPC['cfrtu'] . " ");
                                        }

                                        $vbulletin->db->show_errors();
                                        $vbulletin->url = 'member.php?u='.$vbulletin->GPC['cfrtu'];
                                        eval(print_standard_redirect('redirect_vsafrules_resetdone_user',1,1));
                                }

                                if (($vbulletin->GPC['resettype']=='cfrall') AND is_member_of($vbulletin->userinfo,6))
                                {
                                        $vbulletin->db->hide_errors();
                                        $vbulletin->input->clean_gpc('r', 'cfrdel', TYPE_ARRAY);       
                                        if ($vbulletin->GPC['cfrdel']!='')
                                        {
                                                foreach ($vbulletin->GPC['cfrdel'] AS $vsafr_rsetid)
                                                {
                                                        $vbulletin->db->query_write(" UPDATE " . TABLE_PREFIX . "user SET vsafrules_sets = REPLACE(vsafrules_sets, $vsafr_rsetid, '0') ");
                                                }
                                        }

                                        $vbulletin->db->show_errors();
                                        $vbulletin->url = $vbulletin->config['Misc']['admincpdir'].'/options.php?do=options&amp;dogroup=vsafrules';
                                        eval(print_standard_redirect('redirect_vsafrules_resetdone_all',1,1));
                                }

                                if ($vbulletin->GPC['resettype']=='')
                                {
                                        exec_header_redirect($vbulletin->options['homeurl']);
                                }
                        }
                }

I know the answer is in the above posts, but I made it easier for people to copy/paste the solution rather than searching for the proper plugin/line(s) to alter.

jimsflies 05-20-2015 03:48 PM

It seems this mod doesn't work for the blog. Is it possible to make the forum rules also apply to the blog?

JesWhite 02-21-2016 07:14 AM

i want to show forum rules before registration...
how can i do this ?

dariyos 07-15-2016 07:53 AM

Is it possible to translate the forum rules into an other language?

e.g. the original text is german,
and when I change the forum language into english, it shows the english text

like replace phrases (when I have two texts)

But I think the rules-text is not a phrase. Can't find that as a phrase...

AusPhotography 07-18-2016 03:08 AM

Quote:

Originally Posted by dariyos (Post 2573272)
Is it possible to translate the forum rules into an other language?

e.g. the original text is german,
and when I change the forum language into english, it shows the english text

like replace phrases (when I have two texts)

But I think the rules-text is not a phrase. Can't find that as a phrase...

I would just create two sets of rules, one in each language.

dariyos 07-18-2016 05:01 AM

This is a bad solution... I didn't want to set a new rule.. other suggestions?

An other problem:

When I want to edit the rules, it shows only an empty field, nothing filled in.
So it's not possible to edit it??

MarkFL 07-18-2016 05:26 AM

Regarding your question about displaying the rules in the user-selected language, what I think I would do is use HTML in the defined rules, where each set of rules in the different languages is wrapped in a div element having a classname that is the language. For example:

HTML Code:

<div class="english">
        English rules here...
</div>

<div class="german">
        German rules here...
</div>

Then create a plugin hooked at "parse_templates" as follows:

PHP Code:

if (THIS_SCRIPT === 'misc')
{
    if (
$vbulletin->userinfo['languageid'] == '0')
    {
        
$css '.english {display: block;}.german {display: none;}';
    }
    else
    {
        
$css '.english {display: none;}.german {display: block;}';
    }

    
$template_hook['headinclude_css'] .= '<style>' $css '</style>';


Now, as to why you aren't able to edit your rules, I don't know. I am able to edit them on my dev and production sites. If you want, create a temporary admin account for me, and PM the login credentials to me, and I will be glad to come to your site and see if I can get both issues resolved. :)

dariyos 07-18-2016 06:32 AM

thanks a lot!

it works fine,
language ID = 4 is my english language..

Code:

if (THIS_SCRIPT === 'misc')
{
    if ($vbulletin->userinfo['languageid'] == '4')
    {
        $css = '.german {display: block;}.german {display: none;}';
    }
    else
    {
        $css = '.english {display: none;}.english {display: none;}';
    }

    $template_hook['headinclude_css'] .= '<style>' . $css . '</style>';


And the empty field is only because I putted html code to format the text..

my text shows like this:

Code:

<br>
<font size="3"><b>1. Verhalten im Forum:</b></font><br>
<br>
<b>?1 Seid freundlich und hilfsbereit zueinander</b><br>
Wenn du nichts Positives schreiben kannst, dann schreibe lieber nichts.<br>

When I edit this, it shows nothing.

when I put a text without html code, the text will be displayed, but without formatting.

MarkFL 07-18-2016 06:41 AM

If the languageid is 4 for English, then you want:

PHP Code:

if (THIS_SCRIPT === 'misc')
{
    if (
$vbulletin->userinfo['languageid'] == '4')
    {
        
$css '.english {display: block;}.german {display: none;}';
    }
    else
    {
        
$css '.english {display: none;}.german {display: block;}';
    }

    
$template_hook['headinclude_css'] .= '<style>' $css '</style>';


Can you post a screenshot of your product settings?

dariyos 07-18-2016 07:28 AM

thanks, it works.

These are my settings:

https://vborg.vbsupport.ru/external/2016/07/11.png

MarkFL 07-18-2016 08:11 AM

Okay, try disabling BB Codes in rules (that's the way I have mine set)...see if that allows you to edit. :)

Manipulation 04-17-2017 06:29 PM

Is it possible to have this added on to the top bar above the navbar?

FrankP 05-21-2018 06:51 AM

Quote:

Originally Posted by AusPhotography (Post 2498875)
Works fine for us on vB4.2.2.

You can generate you own reports via a database query, there are extra fields on the user table.


Soory, but may I ask how this query may look like? I can't get it when scanning the columns of the user table. I saw some "ALTER TABLE" in the products xml, but I cannot find the columns in the database (4.2.2-5). But the add on seems to work, at least it's shown only once, and this is all I need. But it would be helpful to have a chance to check if/when a specific user accepted the rules.

Many thanks in advance!

Abominus 05-23-2018 08:45 PM

Could this be used for the "General Data Protection Regulation - GDPR"?

djbaxter 05-23-2018 11:18 PM

Quote:

Originally Posted by Abominus (Post 2594881)
Could this be used for the "General Data Protection Regulation - GDPR"?

Yes but it's easier just to edit the FAQ and put a link in the footer or header.

z3r0 05-26-2018 08:59 AM

Quote:

Originally Posted by Abominus (Post 2594881)
Could this be used for the "General Data Protection Regulation - GDPR"?

Yep with some changes to the phrases it works quite well for GDPR policy consent, it's not perfect, but it's the best option atm without having something custom coded.


All times are GMT. The time now is 07:59 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.02279 seconds
  • Memory Usage 2,074KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_html_printable
  • (4)bbcode_php_printable
  • (18)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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