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)

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??


All times are GMT. The time now is 06:14 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.01980 seconds
  • Memory Usage 1,958KB
  • 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
  • (1)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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