Thread: Miscellaneous Hacks - VSa - Advanced Registration
View Single Post
  #165  
Old 11-01-2010, 01:00 PM
stwan stwan is offline
 
Join Date: Feb 2009
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not valid code in template vsa_areg_invite:
HTML Code:
<script language="Javascript" type="text/javascript">
				function VSaAReg_CheckMail(email_field,error_field,target){
					emailRegExp = /^[_A-Za-z0-9-]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(\.([A-Za-z]){2,4})$/;
					error_address = '{vb:rawphrase vsaareg_invitation_mailerror}: ';
					error_blank = '{vb:rawphrase vsaareg_invitation_missingmail}';
					error_number = '{vb:rawphrase vsaareg_invitation_limit}: {vb:raw vboptions.vsaareg_invite_oncelimit}';
					wait_message = '{vb:rawphrase vsaareg_wait}';
					target_clean = target.replace(" ",""); 
					email = target_clean.split(","); 
					errmail = "";

					if (target_clean=='')
					{
						document.getElementById(error_field).innerHTML=error_blank;
						document.vsaareg_invite.vsaareg_invite_email.focus();
						return false;
					}
					else if (email.length>{vb:raw vboptions.vsaareg_invite_oncelimit})
					{
						document.getElementById(error_field).innerHTML=error_number;
						document.vsaareg_invite.vsaareg_invite_email.focus();
						return false;
					}
					else
					{
						for (var i in email)
						{
							if (!emailRegExp.test(email[i]))
							{
								errmail += "; " + email[i];
							}
						} 
						if (errmail)
						{	
							document.vsaareg_invite.vsaareg_invite_email.focus();
							document.getElementById(error_field).innerHTML=error_address + "<span class=\"smallfont\">" + errmail.substr(1) + "</span>";
							return false;
						} else {
							document.getElementById(error_field).innerHTML=wait_message;
							return true;
						}
					}
				}
				function VSaAReg_UpdName(name){
					if (name=='')
					{
						vsaareg_name = "";
					}
					else
					{
						vsaareg_name = "&nbsp;(" + name + ")";
					}
					document.getElementById('vsaareg_nameupd').innerHTML = vsaareg_name;
				}
			</script>

Fix:
HTML Code:
<script language="Javascript" type="text/javascript">
<!--
				function VSaAReg_CheckMail(email_field,error_field,target){
					emailRegExp = /^[_A-Za-z0-9-]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(\.([A-Za-z]){2,4})$/;
					error_address = '{vb:rawphrase vsaareg_invitation_mailerror}: ';
					error_blank = '{vb:rawphrase vsaareg_invitation_missingmail}';
					error_number = '{vb:rawphrase vsaareg_invitation_limit}: {vb:raw vboptions.vsaareg_invite_oncelimit}';
					wait_message = '{vb:rawphrase vsaareg_wait}';
					target_clean = target.replace(" ",""); 
					email = target_clean.split(","); 
					errmail = "";

					if (target_clean=='')
					{
						document.getElementById(error_field).innerHTML=error_blank;
						document.vsaareg_invite.vsaareg_invite_email.focus();
						return false;
					}
					else if (email.length>{vb:raw vboptions.vsaareg_invite_oncelimit})
					{
						document.getElementById(error_field).innerHTML=error_number;
						document.vsaareg_invite.vsaareg_invite_email.focus();
						return false;
					}
					else
					{
						for (var i in email)
						{
							if (!emailRegExp.test(email[i]))
							{
								errmail += "; " + email[i];
							}
						} 
						if (errmail)
						{	
							document.vsaareg_invite.vsaareg_invite_email.focus();
							document.getElementById(error_field).innerHTML=error_address + "<span class=\"smallfont\">" + errmail.substr(1) + "</span>";
							return false;
						} else {
							document.getElementById(error_field).innerHTML=wait_message;
							return true;
						}
					}
				}
				function VSaAReg_UpdName(name){
					if (name=='')
					{
						vsaareg_name = "";
					}
					else
					{
						vsaareg_name = "&nbsp;(" + name + ")";
					}
					document.getElementById('vsaareg_nameupd').innerHTML = vsaareg_name;
				}
//-->
			</script>

And not valid code in template vsa_areg_manage:
HTML Code:
<script language="Javascript" type="text/javascript">
<!--
				function VSaChAregAll(obj) {
					arrInput = document.getElementsByTagName("input");
					for (i=0; i<arrInput.length; i++) {
						if (arrInput[i].type == 'checkbox') {
							arrInput[i].checked = obj.checked;
						}
					}
				}
				function VSa_SwitchAreg(target)
				{
					if (target=="users_mod")
					{
						document.getElementById("vsaareg_tu_mod").style.display = "block";
						document.getElementById("vsaareg_tu_act").style.display = "none";
						document.getElementById("vsaareg_tu_inv").style.display = "none";
						document.getElementById("vsaareg_tq").style.display = "none";
					}
					if (target=="users_act")
					{
						document.getElementById("vsaareg_tu_mod").style.display = "none";
						document.getElementById("vsaareg_tu_act").style.display = "block";
						document.getElementById("vsaareg_tu_inv").style.display = "none";
						document.getElementById("vsaareg_tq").style.display = "none";
					}
					if (target=="users_inv")
					{
						document.getElementById("vsaareg_tu_mod").style.display = "none";
						document.getElementById("vsaareg_tu_act").style.display = "none";
						document.getElementById("vsaareg_tu_inv").style.display = "block";
						document.getElementById("vsaareg_tq").style.display = "none";
					}
					if (target=="questions")
					{
						document.getElementById("vsaareg_tu_mod").style.display = "none";
						document.getElementById("vsaareg_tu_act").style.display = "none";
						document.getElementById("vsaareg_tu_inv").style.display = "none";
						document.getElementById("vsaareg_tq").style.display = "block";
					}
				}
//-->
			</script>
Fix:
HTML Code:
<script language="Javascript" type="text/javascript">
				function VSaChAregAll(obj) {
					arrInput = document.getElementsByTagName("input");
					for (i=0; i<arrInput.length; i++) {
						if (arrInput[i].type == 'checkbox') {
							arrInput[i].checked = obj.checked;
						}
					}
				}
				function VSa_SwitchAreg(target)
				{
					if (target=="users_mod")
					{
						document.getElementById("vsaareg_tu_mod").style.display = "block";
						document.getElementById("vsaareg_tu_act").style.display = "none";
						document.getElementById("vsaareg_tu_inv").style.display = "none";
						document.getElementById("vsaareg_tq").style.display = "none";
					}
					if (target=="users_act")
					{
						document.getElementById("vsaareg_tu_mod").style.display = "none";
						document.getElementById("vsaareg_tu_act").style.display = "block";
						document.getElementById("vsaareg_tu_inv").style.display = "none";
						document.getElementById("vsaareg_tq").style.display = "none";
					}
					if (target=="users_inv")
					{
						document.getElementById("vsaareg_tu_mod").style.display = "none";
						document.getElementById("vsaareg_tu_act").style.display = "none";
						document.getElementById("vsaareg_tu_inv").style.display = "block";
						document.getElementById("vsaareg_tq").style.display = "none";
					}
					if (target=="questions")
					{
						document.getElementById("vsaareg_tu_mod").style.display = "none";
						document.getElementById("vsaareg_tu_act").style.display = "none";
						document.getElementById("vsaareg_tu_inv").style.display = "none";
						document.getElementById("vsaareg_tq").style.display = "block";
					}
				}
			</script>
And bug on screenshot:
Attachment 123297
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01344 seconds
  • Memory Usage 1,823KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_html
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete