Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons

Reply
 
Thread Tools
VSa - Advanced Forum Rules Details »»
VSa - Advanced Forum Rules
Version: 5.0.8, by Valter Valter is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 4.x.x Rating:
Released: 02-16-2010 Last Update: 09-16-2012 Installs: 1259
DB Changes Uses Plugins Auto-Templates
 
No support by the author.

Info:
Advanced Forum Rules system for vBulletin.

Main Features:
-Rules shown on separate page (no file uploads required)
-Several sets of rules can be created and applied to individual forums
-Choose between BB codes and HTML in rules
-Options to force users to accept Forum Rules before can view forums or threads, post replies, PMs, or e-mails...
-Option to replace registration rules with this product ones
-Option to reset user acceptance status when infraction is received

View screenshots.

Installation:
-Import XML file (as product): AdminCP > Plugin System > Manage Products > [Add/Import Product]

To set options:
Go to: AdminCP > vBulletin Options > VSa - Advanced Forum Rules

Versions:
v1.0 - Oct 06. 2005.
-First version
v4.0.2 - May 08. 2009.
-Latest vB 3.x version
v5.0 - Feb 17. 2010.
-Updated for vB 4
-Code optimized, some bugs fixed
v5.0.1 - Apr 18. 2010.
-Fixed: Link to Rules in forumdisplay
-Fixed: Ordered list parsing in Rules
v5.0.2 - Nov 21 2010.
-Fixed: Uncached template
-Fixed: Style issues on Rules page
-Fixed: Style issues on Manage Rules pages
-Fixed: Minor bugs
v5.0.3 - May 04 2011.
-Fixed: Security bug
v5.0.4 - May 06 2011.
-Fixed: vbseo users not able to switch rules
v5.0.5 - May 18 2011.
-Fixed: Security bug
-Improved rule acceptance check
v5.0.6 - May 22 2012.
-Compatible with vBulletin 4.2
-Increased number of maximum rule sets
-Fixed some minor bugs
v5.0.7 - May 26 2012.
-Fixed: Navbar link
v5.0.8 - Sep 17 2012.
-Fixed: Incorrect acceptance status for some users

Download Now

File Type: zip VSa - Advanced Forum Rules v5.0.8.zip (12.7 KB, 2238 views)

Screenshots

File Type: jpg rules.jpg (148.0 KB, 0 views)
File Type: jpg redirect.jpg (38.1 KB, 0 views)
File Type: jpg user.jpg (58.4 KB, 0 views)
File Type: jpg manage.jpg (119.5 KB, 0 views)
File Type: jpg apply.jpg (86.3 KB, 0 views)
File Type: jpg acp.jpg (292.3 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #542  
Old 08-30-2014, 11:46 AM
forums55 forums55 is offline
 
Join Date: May 2014
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by AusPhotography View Post
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.
Reply With Quote
  #543  
Old 11-02-2014, 09:09 PM
wolfey wolfey is offline
 
Join Date: Nov 2009
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 View Post
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
Reply With Quote
  #544  
Old 11-02-2014, 09:28 PM
wolfey wolfey is offline
 
Join Date: Nov 2009
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #545  
Old 11-06-2014, 10:10 PM
sevenmix's Avatar
sevenmix sevenmix is offline
 
Join Date: Apr 2009
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by AusPhotography View Post
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.
Reply With Quote
Благодарность от:
AusPhotography
  #546  
Old 11-27-2014, 09:38 PM
Skyrider Skyrider is offline
 
Join Date: Feb 2006
Location: Netherlands
Posts: 1,392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Благодарность от:
MarkFL
  #547  
Old 05-20-2015, 03:48 PM
jimsflies jimsflies is offline
 
Join Date: Aug 2009
Posts: 136
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It seems this mod doesn't work for the blog. Is it possible to make the forum rules also apply to the blog?
Reply With Quote
  #548  
Old 02-21-2016, 07:14 AM
JesWhite JesWhite is offline
 
Join Date: Apr 2014
Location: Muğla
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i want to show forum rules before registration...
how can i do this ?
Reply With Quote
  #549  
Old 07-15-2016, 07:53 AM
dariyos dariyos is offline
 
Join Date: Nov 2011
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #550  
Old 07-18-2016, 03:08 AM
AusPhotography's Avatar
AusPhotography AusPhotography is offline
 
Join Date: Nov 2007
Location: Hobart & Adelaide .au
Posts: 521
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dariyos View Post
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.
Reply With Quote
  #551  
Old 07-18-2016, 05:01 AM
dariyos dariyos is offline
 
Join Date: Nov 2011
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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??
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:29 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.04997 seconds
  • Memory Usage 2,415KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (1)bbcode_php
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (14)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (7)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete