Quiz And Survey Master (Formerly Quiz Master Next) - Version 3.6.1

Version Description

Upgrade for many backend upgrades

Download this release

Release Info

Developer fpcorso
Plugin Icon 128x128 Quiz And Survey Master (Formerly Quiz Master Next)
Version 3.6.1
Comparing to
See all releases

Code changes from version 3.5.2 to 3.6.1

includes/mlw_adverts.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function mlw_qmn_show_adverts()
4
+ {
5
+ $mlw_advert = "";
6
+ $mlw_advert_text = "";
7
+ if ( get_option('mlw_advert_shows') == 'true' )
8
+ {
9
+ $mlw_random_int = rand(0, 8);
10
+ switch ($mlw_random_int) {
11
+ case 0:
12
+ $mlw_advert_text = "Need support or features? Check out our Premium Support options! Visit our <a href=\"http://mylocalwebstop.com/shop/\">WordPress Store</a> for details!";
13
+ break;
14
+ case 1:
15
+ $mlw_advert_text = "Is Quiz Master Next beneficial to your website? Please help by giving us a review on WordPress.org by going <a href=\"http://wordpress.org/support/view/plugin-reviews/quiz-master-next\">here</a>!";
16
+ break;
17
+ case 2:
18
+ $mlw_advert_text = "Want help installing and configuring one of our plugins? Check out our Plugin Installation services. Visit our <a href=\"http://mylocalwebstop.com/shop/\">WordPress Store</a> for details!";
19
+ break;
20
+ case 3:
21
+ $mlw_advert_text = "Would you like to support this plugin but do not need or want premium support? Please consider our inexpensive 'Advertisements Be Gone' add-on which will get rid of these ads. Visit our <a href=\"http://mylocalwebstop.com/shop/\">Plugin Add-On Store</a> for details!";
22
+ break;
23
+ case 4:
24
+ $mlw_advert_text = "Need to be able to export the results of your quizzes? Be sure to check out our new Export Results add-on in our <a href=\"http://mylocalwebstop.com/shop/\">WordPress Store</a>!";
25
+ break;
26
+ case 5:
27
+ $mlw_advert_text = "Need help keeping your plugins, themes, and WordPress up to date? Want around the clock security monitoring and off-site back-ups? How about WordPress training videos, a monthly status report, and support/consultation? Check out our <a href=\"http://mylocalwebstop.com/wordpress-maintenance-services/\">WordPress Maintenance Services</a> for more details!";
28
+ break;
29
+ case 6:
30
+ $mlw_advert_text = "Setting up a new site? Let us take care of the set-up so you back to running your business. Check out our <a href=\"http://mylocalwebstop.com/shop/\">WordPress Store</a> for more details!";
31
+ break;
32
+ case 7:
33
+ $mlw_advert_text = "Need a page so your users can see their results from all the quizzes they have taken? Try our new User Dashboard add-on. Check out our <a href=\"http://mylocalwebstop.com/shop/\">WordPress Store</a> for more details!";
34
+ break;
35
+ case 8:
36
+ $mlw_advert_text = "Our new Popular Add-On Pack is now only $45 for 6 add-ons! Now is the time to save almost 50%! Visit our <a href=\"http://mylocalwebstop.com/shop/\">WordPress Store</a> for details.";
37
+ break;
38
+ default:
39
+ $mlw_advert_text = "Need support or features? Check out our Premium Support options! Visit our <a href=\"http://mylocalwebstop.com/shop/\">Plugin Add-On Store</a> for details!";
40
+ }
41
+ $mlw_advert .= "
42
+ <style>
43
+ div.help_decide
44
+ {
45
+ display: block;
46
+ text-align:center;
47
+ letter-spacing: 1px;
48
+ margin: auto;
49
+ text-shadow: 0 1px 1px #000000;
50
+ background: #0d97d8;
51
+ border: 5px solid #106daa;
52
+ -moz-border-radius: 20px;
53
+ -webkit-border-radius: 20px;
54
+ -khtml-border-radius: 20px;
55
+ border-radius: 20px;
56
+ color: #FFFFFF;
57
+ }
58
+ div.help_decide a
59
+ {
60
+ color: yellow;
61
+ }
62
+ </style>";
63
+ $mlw_advert .= "
64
+ <div class=\"help_decide\">
65
+ <p>$mlw_advert_text</p>
66
+ </div>";
67
+ }
68
+ return $mlw_advert;
69
+ }
70
+ ?>
includes/mlw_qmn_credits.php CHANGED
@@ -89,32 +89,33 @@ function mlw_generate_about_page()
89
  <div class="mlw_qmn_icon_wrap">Version <?php echo $mlw_quiz_version; ?></div>
90
  <h2 class="nav-tab-wrapper">
91
  <a href="javascript:mlw_qmn_setTab(1);" id="mlw_qmn_tab_1" class="nav-tab nav-tab-active">
92
- What&#8217;s New In 3.5</a>
93
  <a href="javascript:mlw_qmn_setTab(2);" id="mlw_qmn_tab_2" class="nav-tab">
94
  Changelog For <?php echo $mlw_quiz_version; ?> </a>
95
  <a href="javascript:mlw_qmn_setTab(3);" id="mlw_qmn_tab_3" class="nav-tab">
96
  Requested Features</a>
97
  </h2>
98
  <div id="mlw_quiz_what_new">
99
- <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Require Users To Be Logged In</h2>
100
- <p style="text-align: center;">You can now require users to be logged in to access your quiz. Set this up from the options tab. You can customize the text it shows to non-logged in users on the Text tab.</p>
101
  <br />
102
- <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Limit Total Entries</h2>
103
- <p style="text-align: center;">You can now limit the amount of total entries to your quiz. For example, you could say only 10 people can complete the survey. Edit this setting from the options tab. You can customize the text it shows once it reaches the limit on the text tab.</p>
104
- <br />
105
- <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">LaTeX/Tex Support For Mathematics</h2>
106
- <p style="text-align: center;">You can now use LaTex/Tex to show mathematic symbols and formulas such as square root, fractions, exponents, and more. You can place your math in any question, answer, or text on the quiz! For help with LaTeX, <a href="http://www.andy-roberts.net/writing/latex/mathematics_1">check out this tutorial</a>.</p>
107
  <br />
108
  <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">We Are On GitHub Now</h2>
109
  <p style="text-align: center;">We have had several users ask for this so we thought we would try it out. We now love github! Be sure to <a href="https://github.com/fpcorso/quiz_master_next/">make suggestions or contribute</a>.</p>
110
  <br />
111
- <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Our Premium Add-Ons!</h2>
112
- <p style="text-align: center;">We have several new premium add-ons in our WordPress Store: MailPoet Integration (subscribes users to your MailPoet list), MailChimp Integration (subscribes users to your Mailchimp list), Export Results (exports your quiz results), Extra Shortcodes (gives you extra shortcodes to use), User Dashboard (allow users to see the results from all the quizzes they have taken), and Advertisement Be Gone (gets rid of blue-border ads). Visit our <a href="http://mylocalwebstop.com/shop/">WordPress Store</a> for details! </p>
113
  </div>
114
  <div id="mlw_quiz_changelog" style="display: none;">
115
- <h3><?php echo $mlw_quiz_version; ?> (November 26, 2014)</h3>
116
  <ul>
117
- <li>* Bug Fix For Some Bugs Resulting In Error Code 0008</li>
 
 
 
 
118
  </ul>
119
  </div>
120
  <div id="mlw_quiz_requested" style="display: none;">
@@ -137,7 +138,6 @@ function mlw_generate_about_page()
137
  <li>Graphical Click Aware Questions</li>
138
  <li>Results Bar Graph For Users Taking Polls</li>
139
  <li>Head To Head Comparison Questions</li>
140
- <li>Different Social Media Sharing Text For Different Social Media</li>
141
  <li>Ability To Highlight Incorrect Answers</li>
142
  <li>Set Default Question Type</li>
143
  <li>Show Pop-Up When Clicking Submit</li>
89
  <div class="mlw_qmn_icon_wrap">Version <?php echo $mlw_quiz_version; ?></div>
90
  <h2 class="nav-tab-wrapper">
91
  <a href="javascript:mlw_qmn_setTab(1);" id="mlw_qmn_tab_1" class="nav-tab nav-tab-active">
92
+ What&#8217;s New In 3.6</a>
93
  <a href="javascript:mlw_qmn_setTab(2);" id="mlw_qmn_tab_2" class="nav-tab">
94
  Changelog For <?php echo $mlw_quiz_version; ?> </a>
95
  <a href="javascript:mlw_qmn_setTab(3);" id="mlw_qmn_tab_3" class="nav-tab">
96
  Requested Features</a>
97
  </h2>
98
  <div id="mlw_quiz_what_new">
99
+ <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Separate Social Network Text Templates</h2>
100
+ <p style="text-align: center;">You can now customize the sharing text for each social network instead of having one for all of them.</p>
101
  <br />
102
+ <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">New Developer Filters</h2>
103
+ <p style="text-align: center;">For the developers that like to extend this plugin's functionality, there are now two new filters for creating your own template variables.</p>
 
 
 
104
  <br />
105
  <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">We Are On GitHub Now</h2>
106
  <p style="text-align: center;">We have had several users ask for this so we thought we would try it out. We now love github! Be sure to <a href="https://github.com/fpcorso/quiz_master_next/">make suggestions or contribute</a>.</p>
107
  <br />
108
+ <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Popular Add-on Pack</h2>
109
+ <p style="text-align: center;">Our Popular Add-On Pack is now only $45 for 6 add-ons! Now is the time to save almost 50%! Visit our <a href=\"http://mylocalwebstop.com/shop/\">WordPress Store</a> for details.</p>
110
  </div>
111
  <div id="mlw_quiz_changelog" style="display: none;">
112
+ <h3><?php echo $mlw_quiz_version; ?> (December 2, 2014)</h3>
113
  <ul>
114
+ <li>* Add Separate Social Network Text Templates</li>
115
+ <li>* Added Hours Field To Timer And Completion Time</li>
116
+ <li>* Converted Quizzes Page To Use wpdb->update And wpdb->insert Instead Of query</li>
117
+ <li>* Created New Filter For Creating New Variables For Quiz Page</li>
118
+ <li>* Created New Filter For Creating New Variables For Results Page</li>
119
  </ul>
120
  </div>
121
  <div id="mlw_quiz_requested" style="display: none;">
138
  <li>Graphical Click Aware Questions</li>
139
  <li>Results Bar Graph For Users Taking Polls</li>
140
  <li>Head To Head Comparison Questions</li>
 
141
  <li>Ability To Highlight Incorrect Answers</li>
142
  <li>Set Default Question Type</li>
143
  <li>Show Pop-Up When Clicking Submit</li>
includes/mlw_quiz.php CHANGED
@@ -33,12 +33,16 @@ function mlw_quiz_shortcode($atts)
33
  break;
34
  }
35
 
 
 
 
 
 
36
  //Check if user is required to be checked in
37
  if ( $mlw_quiz_options->require_log_in == 1 && !is_user_logged_in() )
38
  {
39
  $mlw_message = htmlspecialchars_decode($mlw_quiz_options->require_log_in_text, ENT_QUOTES);
40
- $mlw_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message);
41
- $mlw_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message);
42
  $mlw_display = $mlw_message;
43
  $mlw_display .= wp_login_form( array('echo' => false) );
44
  return $mlw_display;
@@ -187,8 +191,7 @@ function mlw_quiz_shortcode($atts)
187
  if ($mlw_qmn_entries_count >= $mlw_quiz_options->limit_total_entries)
188
  {
189
  $mlw_message = htmlspecialchars_decode($mlw_quiz_options->limit_total_entries_text, ENT_QUOTES);
190
- $mlw_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message);
191
- $mlw_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message);
192
  $mlw_display = $mlw_message;
193
  return $mlw_display;
194
  $mlw_qmn_isAllowed = false;
@@ -356,17 +359,47 @@ function mlw_quiz_shortcode($atts)
356
  }
357
  function minToSec(amount)
358
  {
359
- var minutes = Math.floor(amount/60);
360
- var seconds = amount - (minutes * 60);
361
- if (seconds == '0')
362
- {
363
- seconds = "00";
364
- }
365
- else if (seconds < 10)
366
- {
367
- seconds = '0' + seconds;
368
- }
369
- return minutes+":"+seconds;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
370
  }
371
  </script>
372
  <?php
@@ -468,8 +501,7 @@ function mlw_quiz_shortcode($atts)
468
  $mlw_display .= "<span id='mlw_top_of_quiz'></span>";
469
  $mlw_display .= "<div class='quiz_section quiz_begin slide".$mlw_qmn_section_count."'>";
470
  $mlw_message_before = htmlspecialchars_decode($mlw_quiz_options->message_before, ENT_QUOTES);
471
- $mlw_message_before = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_before);
472
- $mlw_message_before = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_before);
473
  $mlw_display .= "<span class='mlw_qmn_message_before'>".$mlw_message_before."</span><br />";
474
  $mlw_display .= "<span name='mlw_error_message' id='mlw_error_message' style='color: red;'></span><br />";
475
 
@@ -806,8 +838,7 @@ function mlw_quiz_shortcode($atts)
806
  $mlw_qmn_section_count = $mlw_qmn_section_count + 1;
807
  $mlw_display .= "<div class='quiz_section slide".$mlw_qmn_section_count."'>";
808
  $mlw_message_comments = htmlspecialchars_decode($mlw_quiz_options->message_comment, ENT_QUOTES);
809
- $mlw_message_comments = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_comments);
810
- $mlw_message_comments = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_comments);
811
  $mlw_display .= "<label for='mlwQuizComments' class='mlw_qmn_comment_section_text' style='font-weight:bold;'>".$mlw_message_comments."</label><br />";
812
  $mlw_display .= "<textarea cols='70' rows='15' id='mlwQuizComments' name='mlwQuizComments' ></textarea>";
813
  $mlw_display .= "</div>";
@@ -819,8 +850,7 @@ function mlw_quiz_shortcode($atts)
819
  if ($mlw_quiz_options->message_end_template != '')
820
  {
821
  $mlw_message_end = htmlspecialchars_decode($mlw_quiz_options->message_end_template, ENT_QUOTES);
822
- $mlw_message_end = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_end);
823
- $mlw_message_end = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_end);
824
  $mlw_display .= "<span class='mlw_qmn_message_end'>".$mlw_message_end."</span>";
825
  $mlw_display .= "<br /><br />";
826
  }
@@ -1043,6 +1073,25 @@ function mlw_quiz_shortcode($atts)
1043
  $mlw_qm_quiz_comments = "";
1044
  }
1045
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1046
 
1047
  //Prepare Certificate
1048
  $mlw_certificate_link = "";
@@ -1054,20 +1103,7 @@ function mlw_quiz_shortcode($atts)
1054
  if ($mlw_certificate_options[4] == 0)
1055
  {
1056
  $mlw_message_certificate = $mlw_certificate_options[1];
1057
- $mlw_message_certificate = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message_certificate);
1058
- $mlw_message_certificate = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message_certificate);
1059
- $mlw_message_certificate = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message_certificate);
1060
- $mlw_message_certificate = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message_certificate);
1061
- $mlw_message_certificate = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message_certificate);
1062
- $mlw_message_certificate = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_certificate);
1063
- $mlw_message_certificate = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message_certificate);
1064
- $mlw_message_certificate = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message_certificate);
1065
- $mlw_message_certificate = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message_certificate);
1066
- $mlw_message_certificate = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message_certificate);
1067
- $mlw_message_certificate = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message_certificate);
1068
- $mlw_message_certificate = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message_certificate);
1069
- $mlw_message_certificate = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message_certificate);
1070
- $mlw_message_certificate = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_certificate);
1071
  $mlw_message_certificate = str_replace( "\n" , "<br>", $mlw_message_certificate);
1072
  $mlw_plugindirpath = plugin_dir_path( __FILE__ );
1073
  $plugindirpath=plugin_dir_path( __FILE__ );
@@ -1094,7 +1130,7 @@ EOC;
1094
  $mlw_qmn_certificate_filename = str_replace(home_url()."/", '', plugin_dir_url( __FILE__ ))."certificates/mlw_qmn_quiz".date("YmdHis").$mlw_qmn_timer.".php";
1095
  file_put_contents($mlw_qmn_certificate_filename, $mlw_qmn_certificate_file);
1096
  $mlw_qmn_certificate_filename = plugin_dir_url( __FILE__ )."certificates/mlw_qmn_quiz".date("YmdHis").$mlw_qmn_timer.".php";
1097
- $mlw_certificate_link = "<a href='".$mlw_qmn_certificate_filename."' style='color: blue;'>Download Certificate</a>";
1098
  }
1099
 
1100
  /*
@@ -1113,21 +1149,7 @@ EOC;
1113
  if ($mlw_each[0] == 0 && $mlw_each[1] == 0)
1114
  {
1115
  $mlw_message_after = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES);
1116
- $mlw_message_after = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message_after);
1117
- $mlw_message_after = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message_after);
1118
- $mlw_message_after = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message_after);
1119
- $mlw_message_after = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message_after);
1120
- $mlw_message_after = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message_after);
1121
- $mlw_message_after = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_after);
1122
- $mlw_message_after = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message_after);
1123
- $mlw_message_after = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message_after);
1124
- $mlw_message_after = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message_after);
1125
- $mlw_message_after = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message_after);
1126
- $mlw_message_after = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message_after);
1127
- $mlw_message_after = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message_after);
1128
- $mlw_message_after = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message_after);
1129
- $mlw_message_after = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message_after);
1130
- $mlw_message_after = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_after);
1131
  $mlw_message_after = str_replace( "\n" , "<br>", $mlw_message_after);
1132
  $mlw_display .= $mlw_message_after;
1133
  break;
@@ -1138,21 +1160,7 @@ EOC;
1138
  if ($mlw_quiz_options->system == 1 && $mlw_points >= $mlw_each[0] && $mlw_points <= $mlw_each[1])
1139
  {
1140
  $mlw_message_after = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES);
1141
- $mlw_message_after = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message_after);
1142
- $mlw_message_after = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message_after);
1143
- $mlw_message_after = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message_after);
1144
- $mlw_message_after = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message_after);
1145
- $mlw_message_after = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message_after);
1146
- $mlw_message_after = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_after);
1147
- $mlw_message_after = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message_after);
1148
- $mlw_message_after = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message_after);
1149
- $mlw_message_after = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message_after);
1150
- $mlw_message_after = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message_after);
1151
- $mlw_message_after = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message_after);
1152
- $mlw_message_after = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message_after);
1153
- $mlw_message_after = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message_after);
1154
- $mlw_message_after = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message_after);
1155
- $mlw_message_after = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_after);
1156
  $mlw_message_after = str_replace( "\n" , "<br>", $mlw_message_after);
1157
  $mlw_display .= $mlw_message_after;
1158
  break;
@@ -1161,21 +1169,7 @@ EOC;
1161
  if ($mlw_quiz_options->system == 0 && $mlw_total_score >= $mlw_each[0] && $mlw_total_score <= $mlw_each[1])
1162
  {
1163
  $mlw_message_after = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES);
1164
- $mlw_message_after = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message_after);
1165
- $mlw_message_after = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message_after);
1166
- $mlw_message_after = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message_after);
1167
- $mlw_message_after = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message_after);
1168
- $mlw_message_after = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message_after);
1169
- $mlw_message_after = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_after);
1170
- $mlw_message_after = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message_after);
1171
- $mlw_message_after = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message_after);
1172
- $mlw_message_after = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message_after);
1173
- $mlw_message_after = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message_after);
1174
- $mlw_message_after = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message_after);
1175
- $mlw_message_after = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message_after);
1176
- $mlw_message_after = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message_after);
1177
- $mlw_message_after = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message_after);
1178
- $mlw_message_after = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_after);
1179
  $mlw_message_after = str_replace( "\n" , "<br>", $mlw_message_after);
1180
  $mlw_display .= $mlw_message_after;
1181
  break;
@@ -1187,21 +1181,7 @@ EOC;
1187
  {
1188
  //Prepare the after quiz message
1189
  $mlw_message_after = htmlspecialchars_decode($mlw_quiz_options->message_after, ENT_QUOTES);
1190
- $mlw_message_after = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message_after);
1191
- $mlw_message_after = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message_after);
1192
- $mlw_message_after = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message_after);
1193
- $mlw_message_after = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message_after);
1194
- $mlw_message_after = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message_after);
1195
- $mlw_message_after = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_after);
1196
- $mlw_message_after = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message_after);
1197
- $mlw_message_after = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message_after);
1198
- $mlw_message_after = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message_after);
1199
- $mlw_message_after = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message_after);
1200
- $mlw_message_after = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message_after);
1201
- $mlw_message_after = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message_after);
1202
- $mlw_message_after = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message_after);
1203
- $mlw_message_after = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message_after);
1204
- $mlw_message_after = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_after);
1205
  $mlw_message_after = str_replace( "\n" , "<br>", $mlw_message_after);
1206
  $mlw_display .= $mlw_message_after;
1207
  }
@@ -1217,7 +1197,7 @@ EOC;
1217
  var sqShareOptions = "height=400,width=580,toolbar=0,status=0,location=0,menubar=0,directories=0,scrollbars=0,top=" + sTop + ",left=" + sLeft;
1218
  var pageUrl = window.location.href;
1219
  var pageUrlEncoded = encodeURIComponent(pageUrl);
1220
- if (network == 1)
1221
  {
1222
  var Url = "https://www.facebook.com/dialog/feed?"
1223
  + "display=popup&"
@@ -1227,7 +1207,7 @@ EOC;
1227
  + "description= &"
1228
  + "redirect_uri=http://www.mylocalwebstop.com/mlw_qmn_close.html";
1229
  }
1230
- if (network == 2)
1231
  {
1232
  var Url = "https://twitter.com/intent/tweet?text=" + encodeURIComponent(mlw_qmn_social_text);
1233
  }
@@ -1236,17 +1216,20 @@ EOC;
1236
  }
1237
  </script>
1238
  <?php
1239
- $mlw_social_message = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_quiz_options->social_media_text);
1240
- $mlw_social_message = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_social_message);
1241
- $mlw_social_message = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_social_message);
1242
- $mlw_social_message = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_social_message);
1243
- $mlw_social_message = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_social_message);
1244
- $mlw_social_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_social_message);
1245
- $mlw_social_message = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_social_message);
1246
- $mlw_social_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_social_message);
 
 
 
1247
  $mlw_display .= "<br />
1248
- <a class=\"mlw_qmn_quiz_link\" style=\"display: inline; vertical-align:top !important;font-weight: bold; cursor: pointer;text-decoration: none;\" onclick=\"mlw_qmn_share(1, '".esc_js($mlw_social_message)."', '".esc_js($mlw_quiz_options->quiz_name)."');\">Facebook</a>
1249
- <a class=\"mlw_qmn_quiz_link\" style=\"display: inline; vertical-align:top !important;font-weight: bold; cursor: pointer;text-decoration: none;\" onclick=\"mlw_qmn_share(2, '".esc_js($mlw_social_message)."', '".esc_js($mlw_quiz_options->quiz_name)."');\">Twitter</a>
1250
  <br />";
1251
  }
1252
 
@@ -1275,39 +1258,13 @@ EOC;
1275
  {
1276
  $mlw_each[3] = "Quiz Results For %QUIZ_NAME";
1277
  }
1278
- $mlw_each[3] = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_each[3]);
1279
- $mlw_each[3] = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_each[3]);
1280
- $mlw_each[3] = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_each[3]);
1281
- $mlw_each[3] = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_each[3]);
1282
- $mlw_each[3] = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_each[3]);
1283
- $mlw_each[3] = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_each[3]);
1284
- $mlw_each[3] = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_each[3]);
1285
- $mlw_each[3] = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_each[3]);
1286
- $mlw_each[3] = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_each[3]);
1287
- $mlw_each[3] = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_each[3]);
1288
- $mlw_each[3] = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_each[3]);
1289
- $mlw_each[3] = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_each[3]);
1290
-
1291
 
1292
  //Check to see if default
1293
  if ($mlw_each[0] == 0 && $mlw_each[1] == 0)
1294
  {
1295
  $mlw_message = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES);
1296
- $mlw_message = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message);
1297
- $mlw_message = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message);
1298
- $mlw_message = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message);
1299
- $mlw_message = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message);
1300
- $mlw_message = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message);
1301
- $mlw_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message);
1302
- $mlw_message = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message);
1303
- $mlw_message = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message);
1304
- $mlw_message = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message);
1305
- $mlw_message = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message);
1306
- $mlw_message = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message);
1307
- $mlw_message = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message);
1308
- $mlw_message = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message);
1309
- $mlw_message = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message);
1310
- $mlw_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message);
1311
  $mlw_message = str_replace( "\n" , "<br>", $mlw_message);
1312
  $mlw_message = str_replace( "<br/>" , "<br>", $mlw_message);
1313
  $mlw_message = str_replace( "<br />" , "<br>", $mlw_message);
@@ -1321,21 +1278,7 @@ EOC;
1321
  if ($mlw_quiz_options->system == 1 && $mlw_points >= $mlw_each[0] && $mlw_points <= $mlw_each[1])
1322
  {
1323
  $mlw_message = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES);
1324
- $mlw_message = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message);
1325
- $mlw_message = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message);
1326
- $mlw_message = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message);
1327
- $mlw_message = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message);
1328
- $mlw_message = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message);
1329
- $mlw_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message);
1330
- $mlw_message = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message);
1331
- $mlw_message = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message);
1332
- $mlw_message = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message);
1333
- $mlw_message = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message);
1334
- $mlw_message = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message);
1335
- $mlw_message = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message);
1336
- $mlw_message = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message);
1337
- $mlw_message = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message);
1338
- $mlw_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message);
1339
  $mlw_message = str_replace( "\n" , "<br>", $mlw_message);
1340
  $mlw_message = str_replace( "<br/>" , "<br>", $mlw_message);
1341
  $mlw_message = str_replace( "<br />" , "<br>", $mlw_message);
@@ -1348,21 +1291,7 @@ EOC;
1348
  if ($mlw_quiz_options->system == 0 && $mlw_total_score >= $mlw_each[0] && $mlw_total_score <= $mlw_each[1])
1349
  {
1350
  $mlw_message = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES);
1351
- $mlw_message = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message);
1352
- $mlw_message = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message);
1353
- $mlw_message = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message);
1354
- $mlw_message = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message);
1355
- $mlw_message = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message);
1356
- $mlw_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message);
1357
- $mlw_message = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message);
1358
- $mlw_message = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message);
1359
- $mlw_message = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message);
1360
- $mlw_message = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message);
1361
- $mlw_message = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message);
1362
- $mlw_message = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message);
1363
- $mlw_message = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message);
1364
- $mlw_message = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message);
1365
- $mlw_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message);
1366
  $mlw_message = str_replace( "\n" , "<br>", $mlw_message);
1367
  $mlw_message = str_replace( "<br/>" , "<br>", $mlw_message);
1368
  $mlw_message = str_replace( "<br />" , "<br>", $mlw_message);
@@ -1376,21 +1305,7 @@ EOC;
1376
  else
1377
  {
1378
  $mlw_message = htmlspecialchars_decode($mlw_quiz_options->user_email_template, ENT_QUOTES);
1379
- $mlw_message = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message);
1380
- $mlw_message = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message);
1381
- $mlw_message = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message);
1382
- $mlw_message = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message);
1383
- $mlw_message = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message);
1384
- $mlw_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message);
1385
- $mlw_message = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message);
1386
- $mlw_message = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message);
1387
- $mlw_message = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message);
1388
- $mlw_message = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message);
1389
- $mlw_message = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message);
1390
- $mlw_message = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message);
1391
- $mlw_message = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message);
1392
- $mlw_message = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message);
1393
- $mlw_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message);
1394
  $mlw_message = str_replace( "\n" , "<br>", $mlw_message);
1395
  $mlw_message = str_replace( "<br/>" , "<br>", $mlw_message);
1396
  $mlw_message = str_replace( "<br />" , "<br>", $mlw_message);
@@ -1405,21 +1320,7 @@ EOC;
1405
  if ($mlw_quiz_options->send_admin_email == "0")
1406
  {
1407
  $mlw_message = htmlspecialchars_decode($mlw_quiz_options->admin_email_template, ENT_QUOTES);
1408
- $mlw_message = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message);
1409
- $mlw_message = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message);
1410
- $mlw_message = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message);
1411
- $mlw_message = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message);
1412
- $mlw_message = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message);
1413
- $mlw_message = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message);
1414
- $mlw_message = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message);
1415
- $mlw_message = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message);
1416
- $mlw_message = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message);
1417
- $mlw_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message);
1418
- $mlw_message = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message);
1419
- $mlw_message = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message);
1420
- $mlw_message = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message);
1421
- $mlw_message = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message);
1422
- $mlw_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message);
1423
  if ( get_option('mlw_advert_shows') == 'true' ) {$mlw_message .= "<br>This email was generated by the Quiz Master Next script by Frank Corso";}
1424
  $mlw_message = str_replace( "\n" , "<br>", $mlw_message);
1425
  $mlw_message = str_replace( "<br/>" , "<br>", $mlw_message);
@@ -1452,9 +1353,7 @@ EOC;
1452
  {
1453
  $current_user = wp_get_current_user();
1454
  $mlw_message = htmlspecialchars_decode($mlw_quiz_options->total_user_tries_text, ENT_QUOTES);
1455
- $mlw_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message);
1456
- $mlw_message = str_replace( "%USER_NAME%" , $current_user->display_name, $mlw_message);
1457
- $mlw_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message);
1458
  $mlw_display .= $mlw_message;
1459
  }
1460
  elseif (isset($_POST["mlw_code_captcha"]) && $_POST["mlw_user_captcha"] != $_POST["mlw_code_captcha"])
33
  break;
34
  }
35
 
36
+ $mlw_qmn_quiz_options_array = array(
37
+ 'quiz_name' => $mlw_quiz_options->quiz_name,
38
+ 'quiz_id' => $mlw_quiz_options->quiz_id
39
+ );
40
+
41
  //Check if user is required to be checked in
42
  if ( $mlw_quiz_options->require_log_in == 1 && !is_user_logged_in() )
43
  {
44
  $mlw_message = htmlspecialchars_decode($mlw_quiz_options->require_log_in_text, ENT_QUOTES);
45
+ $mlw_message = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message, $mlw_qmn_quiz_options_array);
 
46
  $mlw_display = $mlw_message;
47
  $mlw_display .= wp_login_form( array('echo' => false) );
48
  return $mlw_display;
191
  if ($mlw_qmn_entries_count >= $mlw_quiz_options->limit_total_entries)
192
  {
193
  $mlw_message = htmlspecialchars_decode($mlw_quiz_options->limit_total_entries_text, ENT_QUOTES);
194
+ $mlw_message = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message, $mlw_qmn_quiz_options_array);
 
195
  $mlw_display = $mlw_message;
196
  return $mlw_display;
197
  $mlw_qmn_isAllowed = false;
359
  }
360
  function minToSec(amount)
361
  {
362
+ var timer_display = '';
363
+ var hours = Math.floor(amount/3600);
364
+ if (hours == '0')
365
+ {
366
+ timer_display = timer_display +"00:";
367
+ }
368
+ else if (hours < 10)
369
+ {
370
+ timer_display = timer_display + '0' + hours + ":";
371
+ }
372
+ else
373
+ {
374
+ timer_display = timer_display + hours + ":";
375
+ }
376
+ var minutes = Math.floor((amount % 3600)/60);
377
+ if (minutes == '0')
378
+ {
379
+ timer_display = timer_display +"00:";
380
+ }
381
+ else if (minutes < 10)
382
+ {
383
+ timer_display = timer_display + '0' + minutes + ":";
384
+ }
385
+ else
386
+ {
387
+ timer_display = timer_display + minutes + ":";
388
+ }
389
+ var seconds = Math.floor(amount % 60);
390
+ if (seconds == '0')
391
+ {
392
+ timer_display = timer_display +"00";
393
+ }
394
+ else if (seconds < 10)
395
+ {
396
+ timer_display = timer_display +'0' + seconds;
397
+ }
398
+ else
399
+ {
400
+ timer_display = timer_display + seconds;
401
+ }
402
+ return timer_display;
403
  }
404
  </script>
405
  <?php
501
  $mlw_display .= "<span id='mlw_top_of_quiz'></span>";
502
  $mlw_display .= "<div class='quiz_section quiz_begin slide".$mlw_qmn_section_count."'>";
503
  $mlw_message_before = htmlspecialchars_decode($mlw_quiz_options->message_before, ENT_QUOTES);
504
+ $mlw_message_before = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message_before, $mlw_qmn_quiz_options_array);
 
505
  $mlw_display .= "<span class='mlw_qmn_message_before'>".$mlw_message_before."</span><br />";
506
  $mlw_display .= "<span name='mlw_error_message' id='mlw_error_message' style='color: red;'></span><br />";
507
 
838
  $mlw_qmn_section_count = $mlw_qmn_section_count + 1;
839
  $mlw_display .= "<div class='quiz_section slide".$mlw_qmn_section_count."'>";
840
  $mlw_message_comments = htmlspecialchars_decode($mlw_quiz_options->message_comment, ENT_QUOTES);
841
+ $mlw_message_comments = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message_comments, $mlw_qmn_quiz_options_array);
 
842
  $mlw_display .= "<label for='mlwQuizComments' class='mlw_qmn_comment_section_text' style='font-weight:bold;'>".$mlw_message_comments."</label><br />";
843
  $mlw_display .= "<textarea cols='70' rows='15' id='mlwQuizComments' name='mlwQuizComments' ></textarea>";
844
  $mlw_display .= "</div>";
850
  if ($mlw_quiz_options->message_end_template != '')
851
  {
852
  $mlw_message_end = htmlspecialchars_decode($mlw_quiz_options->message_end_template, ENT_QUOTES);
853
+ $mlw_message_end = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message_end, $mlw_qmn_quiz_options_array);
 
854
  $mlw_display .= "<span class='mlw_qmn_message_end'>".$mlw_message_end."</span>";
855
  $mlw_display .= "<br /><br />";
856
  }
1073
  $mlw_qm_quiz_comments = "";
1074
  }
1075
 
1076
+ $mlw_qmn_result_array = array(
1077
+ 'quiz_id' => $mlw_quiz_id,
1078
+ 'quiz_name' => $mlw_quiz_options->quiz_name,
1079
+ 'quiz_system' => $mlw_quiz_options->system,
1080
+ 'total_points' => $mlw_points,
1081
+ 'total_score' => $mlw_total_score,
1082
+ 'total_correct' => $mlw_correct,
1083
+ 'total_questions' => $mlw_total_questions,
1084
+ 'user_name' => $mlw_user_name,
1085
+ 'user_business' => $mlw_user_comp,
1086
+ 'user_email' => $mlw_user_email,
1087
+ 'user_phone' => $mlw_user_phone,
1088
+ 'user_id' => get_current_user_id(),
1089
+ 'question_answers_display' => $mlw_question_answers,
1090
+ 'question_answers_array' => $mlw_qmn_answer_array,
1091
+ 'timer' => $mlw_qmn_timer,
1092
+ 'comments' => $mlw_qm_quiz_comments,
1093
+ 'certificate_link' => ''
1094
+ );
1095
 
1096
  //Prepare Certificate
1097
  $mlw_certificate_link = "";
1103
  if ($mlw_certificate_options[4] == 0)
1104
  {
1105
  $mlw_message_certificate = $mlw_certificate_options[1];
1106
+ $mlw_message_certificate = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message_certificate, $mlw_qmn_result_array);
 
 
 
 
 
 
 
 
 
 
 
 
 
1107
  $mlw_message_certificate = str_replace( "\n" , "<br>", $mlw_message_certificate);
1108
  $mlw_plugindirpath = plugin_dir_path( __FILE__ );
1109
  $plugindirpath=plugin_dir_path( __FILE__ );
1130
  $mlw_qmn_certificate_filename = str_replace(home_url()."/", '', plugin_dir_url( __FILE__ ))."certificates/mlw_qmn_quiz".date("YmdHis").$mlw_qmn_timer.".php";
1131
  file_put_contents($mlw_qmn_certificate_filename, $mlw_qmn_certificate_file);
1132
  $mlw_qmn_certificate_filename = plugin_dir_url( __FILE__ )."certificates/mlw_qmn_quiz".date("YmdHis").$mlw_qmn_timer.".php";
1133
+ $mlw_qmn_result_array["certificate_link"] = "<a href='".$mlw_qmn_certificate_filename."' style='color: blue;'>Download Certificate</a>";
1134
  }
1135
 
1136
  /*
1149
  if ($mlw_each[0] == 0 && $mlw_each[1] == 0)
1150
  {
1151
  $mlw_message_after = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES);
1152
+ $mlw_message_after = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message_after, $mlw_qmn_result_array);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1153
  $mlw_message_after = str_replace( "\n" , "<br>", $mlw_message_after);
1154
  $mlw_display .= $mlw_message_after;
1155
  break;
1160
  if ($mlw_quiz_options->system == 1 && $mlw_points >= $mlw_each[0] && $mlw_points <= $mlw_each[1])
1161
  {
1162
  $mlw_message_after = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES);
1163
+ $mlw_message_after = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message_after, $mlw_qmn_result_array);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1164
  $mlw_message_after = str_replace( "\n" , "<br>", $mlw_message_after);
1165
  $mlw_display .= $mlw_message_after;
1166
  break;
1169
  if ($mlw_quiz_options->system == 0 && $mlw_total_score >= $mlw_each[0] && $mlw_total_score <= $mlw_each[1])
1170
  {
1171
  $mlw_message_after = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES);
1172
+ $mlw_message_after = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message_after, $mlw_qmn_result_array);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1173
  $mlw_message_after = str_replace( "\n" , "<br>", $mlw_message_after);
1174
  $mlw_display .= $mlw_message_after;
1175
  break;
1181
  {
1182
  //Prepare the after quiz message
1183
  $mlw_message_after = htmlspecialchars_decode($mlw_quiz_options->message_after, ENT_QUOTES);
1184
+ $mlw_message_after = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message_after, $mlw_qmn_result_array);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1185
  $mlw_message_after = str_replace( "\n" , "<br>", $mlw_message_after);
1186
  $mlw_display .= $mlw_message_after;
1187
  }
1197
  var sqShareOptions = "height=400,width=580,toolbar=0,status=0,location=0,menubar=0,directories=0,scrollbars=0,top=" + sTop + ",left=" + sLeft;
1198
  var pageUrl = window.location.href;
1199
  var pageUrlEncoded = encodeURIComponent(pageUrl);
1200
+ if (network == 'facebook')
1201
  {
1202
  var Url = "https://www.facebook.com/dialog/feed?"
1203
  + "display=popup&"
1207
  + "description= &"
1208
  + "redirect_uri=http://www.mylocalwebstop.com/mlw_qmn_close.html";
1209
  }
1210
+ if (network == 'twitter')
1211
  {
1212
  var Url = "https://twitter.com/intent/tweet?text=" + encodeURIComponent(mlw_qmn_social_text);
1213
  }
1216
  }
1217
  </script>
1218
  <?php
1219
+ //Load Social Media Text
1220
+ $qmn_social_media_text = "";
1221
+ $qmn_social_media_text = @unserialize($mlw_quiz_options->social_media_text);
1222
+ if (!is_array($qmn_social_media_text)) {
1223
+ $qmn_social_media_text = array(
1224
+ 'twitter' => $mlw_quiz_options->social_media_text,
1225
+ 'facebook' => $mlw_quiz_options->social_media_text
1226
+ );
1227
+ }
1228
+ $qmn_social_media_text["twitter"] = apply_filters( 'mlw_qmn_template_variable_results_page', $qmn_social_media_text["twitter"], $mlw_qmn_result_array);
1229
+ $qmn_social_media_text["facebook"] = apply_filters( 'mlw_qmn_template_variable_results_page', $qmn_social_media_text["facebook"], $mlw_qmn_result_array);
1230
  $mlw_display .= "<br />
1231
+ <a class=\"mlw_qmn_quiz_link\" style=\"display: inline; vertical-align:top !important;font-weight: bold; cursor: pointer;text-decoration: none;\" onclick=\"mlw_qmn_share('facebook', '".esc_js($qmn_social_media_text["facebook"])."', '".esc_js($mlw_quiz_options->quiz_name)."');\">Facebook</a>
1232
+ <a class=\"mlw_qmn_quiz_link\" style=\"display: inline; vertical-align:top !important;font-weight: bold; cursor: pointer;text-decoration: none;\" onclick=\"mlw_qmn_share('twitter', '".esc_js($qmn_social_media_text["twitter"])."', '".esc_js($mlw_quiz_options->quiz_name)."');\">Twitter</a>
1233
  <br />";
1234
  }
1235
 
1258
  {
1259
  $mlw_each[3] = "Quiz Results For %QUIZ_NAME";
1260
  }
1261
+ $mlw_each[3] = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_each[3], $mlw_qmn_result_array);
 
 
 
 
 
 
 
 
 
 
 
 
1262
 
1263
  //Check to see if default
1264
  if ($mlw_each[0] == 0 && $mlw_each[1] == 0)
1265
  {
1266
  $mlw_message = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES);
1267
+ $mlw_message = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message, $mlw_qmn_result_array);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1268
  $mlw_message = str_replace( "\n" , "<br>", $mlw_message);
1269
  $mlw_message = str_replace( "<br/>" , "<br>", $mlw_message);
1270
  $mlw_message = str_replace( "<br />" , "<br>", $mlw_message);
1278
  if ($mlw_quiz_options->system == 1 && $mlw_points >= $mlw_each[0] && $mlw_points <= $mlw_each[1])
1279
  {
1280
  $mlw_message = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES);
1281
+ $mlw_message = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message, $mlw_qmn_result_array);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1282
  $mlw_message = str_replace( "\n" , "<br>", $mlw_message);
1283
  $mlw_message = str_replace( "<br/>" , "<br>", $mlw_message);
1284
  $mlw_message = str_replace( "<br />" , "<br>", $mlw_message);
1291
  if ($mlw_quiz_options->system == 0 && $mlw_total_score >= $mlw_each[0] && $mlw_total_score <= $mlw_each[1])
1292
  {
1293
  $mlw_message = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES);
1294
+ $mlw_message = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message, $mlw_qmn_result_array);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1295
  $mlw_message = str_replace( "\n" , "<br>", $mlw_message);
1296
  $mlw_message = str_replace( "<br/>" , "<br>", $mlw_message);
1297
  $mlw_message = str_replace( "<br />" , "<br>", $mlw_message);
1305
  else
1306
  {
1307
  $mlw_message = htmlspecialchars_decode($mlw_quiz_options->user_email_template, ENT_QUOTES);
1308
+ $mlw_message = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message, $mlw_qmn_result_array);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1309
  $mlw_message = str_replace( "\n" , "<br>", $mlw_message);
1310
  $mlw_message = str_replace( "<br/>" , "<br>", $mlw_message);
1311
  $mlw_message = str_replace( "<br />" , "<br>", $mlw_message);
1320
  if ($mlw_quiz_options->send_admin_email == "0")
1321
  {
1322
  $mlw_message = htmlspecialchars_decode($mlw_quiz_options->admin_email_template, ENT_QUOTES);
1323
+ $mlw_message = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message, $mlw_qmn_result_array);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1324
  if ( get_option('mlw_advert_shows') == 'true' ) {$mlw_message .= "<br>This email was generated by the Quiz Master Next script by Frank Corso";}
1325
  $mlw_message = str_replace( "\n" , "<br>", $mlw_message);
1326
  $mlw_message = str_replace( "<br/>" , "<br>", $mlw_message);
1353
  {
1354
  $current_user = wp_get_current_user();
1355
  $mlw_message = htmlspecialchars_decode($mlw_quiz_options->total_user_tries_text, ENT_QUOTES);
1356
+ $mlw_message = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message, $mlw_qmn_quiz_options_array);
 
 
1357
  $mlw_display .= $mlw_message;
1358
  }
1359
  elseif (isset($_POST["mlw_code_captcha"]) && $_POST["mlw_user_captcha"] != $_POST["mlw_code_captcha"])
includes/mlw_quiz_admin.php CHANGED
@@ -66,10 +66,113 @@ function mlw_generate_quiz_admin()
66
  margin: auto;
67
  }";
68
  $mlw_question_answer_default = "%QUESTION%<br /> Answer Provided: %USER_ANSWER%<br /> Correct Answer: %CORRECT_ANSWER%<br /> Comments Entered: %USER_COMMENTS%<br />";
69
- $insert = "INSERT INTO " . $table_name .
70
- "(quiz_id, quiz_name, message_before, message_after, message_comment, message_end_template, user_email_template, admin_email_template, submit_button_text, name_field_text, business_field_text, email_field_text, phone_field_text, comment_field_text, email_from_text, question_answer_template, leaderboard_template, system, randomness_order, loggedin_user_contact, show_score, send_user_email, send_admin_email, contact_info_location, user_name, user_comp, user_email, user_phone, admin_email, comment_section, question_from_total, total_user_tries, total_user_tries_text, certificate_template, social_media, social_media_text, pagination, pagination_text, timer_limit, quiz_stye, question_numbering, quiz_settings, theme_selected, last_activity, quiz_views, quiz_taken, deleted) " .
71
- "VALUES (NULL , '" . $quiz_name . "' , 'Enter your text here', 'Enter your text here', 'Enter your text here', '', 'Enter your text here', 'Enter your text here', 'Submit Quiz', 'Name', 'Business', 'Email', 'Phone Number', 'Comments', 'Wordpress', '".$mlw_question_answer_default."', '".$mlw_leaderboard_default."', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '".get_option( 'admin_email', 'Enter email' )."', 0, 0, 0, 'Enter Your Text Here', 'Enter Your Text Here!', 0, 'I just score a %CORRECT_SCORE%% on %QUIZ_NAME%!', 0, 'Next', 0, '".$mlw_style_default."', 0, '', 'default', '".date("Y-m-d H:i:s")."', 0, 0, 0)";
72
- $results = $wpdb->query( $insert );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  if ($results != false)
74
  {
75
  $mlwQmnAlertManager->newAlert('Your new quiz has been created successfully. To begin editing your quiz, click the Edit link on the new quiz.', 'success');
66
  margin: auto;
67
  }";
68
  $mlw_question_answer_default = "%QUESTION%<br /> Answer Provided: %USER_ANSWER%<br /> Correct Answer: %CORRECT_ANSWER%<br /> Comments Entered: %USER_COMMENTS%<br />";
69
+ $results = $wpdb->insert(
70
+ $wpdb->prefix . "mlw_quizzes",
71
+ array(
72
+ 'quiz_name' => $quiz_name,
73
+ 'message_before' => 'Enter your text here',
74
+ 'message_after' => 'Enter your text here',
75
+ 'message_comment' => 'Enter your text here',
76
+ 'message_end_template' => '',
77
+ 'user_email_template' => 'Enter your text here',
78
+ 'admin_email_template' => 'Enter your text here',
79
+ 'submit_button_text' => 'Submit Quiz',
80
+ 'name_field_text' => 'Name',
81
+ 'business_field_text' => 'Business',
82
+ 'email_field_text' => 'Email',
83
+ 'phone_field_text' => 'Phone Number',
84
+ 'comment_field_text' => 'Comments',
85
+ 'email_from_text' => 'Wordpress',
86
+ 'question_answer_template' => $mlw_question_answer_default,
87
+ 'leaderboard_template' => $mlw_leaderboard_default,
88
+ 'system' => 0,
89
+ 'randomness_order' => 0,
90
+ 'loggedin_user_contact' => 0,
91
+ 'show_score' => 0,
92
+ 'send_user_email' => 0,
93
+ 'send_admin_email' => 0,
94
+ 'contact_info_location' => 0,
95
+ 'user_name' => 0,
96
+ 'user_comp' => 0,
97
+ 'user_email' => 0,
98
+ 'user_phone' => 0,
99
+ 'admin_email' => get_option( 'admin_email', 'Enter email' ),
100
+ 'comment_section' => 0,
101
+ 'question_from_total' => 0,
102
+ 'total_user_tries' => 0,
103
+ 'total_user_tries_text' => 'Enter Your Text Here',
104
+ 'certificate_template' => 'Enter Your Text Here!',
105
+ 'social_media' => 0,
106
+ 'social_media_text' => 'I just scored %CORRECT_SCORE%% on %QUIZ_NAME%!',
107
+ 'pagination' => 0,
108
+ 'pagination_text' => 'Next',
109
+ 'timer_limit' => 0,
110
+ 'quiz_stye' => $mlw_style_default,
111
+ 'question_numbering' => 0,
112
+ 'quiz_settings' => '',
113
+ 'theme_selected' => 'default',
114
+ 'last_activity' => date("Y-m-d H:i:s"),
115
+ 'require_log_in' => 0,
116
+ 'require_log_in_text' => 'Enter Your Text Here',
117
+ 'limit_total_entries' => 0,
118
+ 'limit_total_entries_text' => 'Enter Your Text Here',
119
+ 'quiz_views' => 0,
120
+ 'quiz_taken' => 0,
121
+ 'deleted' => 0
122
+ ),
123
+ array(
124
+ '%s',
125
+ '%s',
126
+ '%s',
127
+ '%s',
128
+ '%s',
129
+ '%s',
130
+ '%s',
131
+ '%s',
132
+ '%s',
133
+ '%s',
134
+ '%s',
135
+ '%s',
136
+ '%s',
137
+ '%s',
138
+ '%s',
139
+ '%s',
140
+ '%d',
141
+ '%d',
142
+ '%d',
143
+ '%d',
144
+ '%d',
145
+ '%d',
146
+ '%d',
147
+ '%d',
148
+ '%d',
149
+ '%d',
150
+ '%d',
151
+ '%s',
152
+ '%d',
153
+ '%d',
154
+ '%d',
155
+ '%s',
156
+ '%s',
157
+ '%d',
158
+ '%s',
159
+ '%d',
160
+ '%s',
161
+ '%d',
162
+ '%s',
163
+ '%d',
164
+ '%s',
165
+ '%s',
166
+ '%s',
167
+ '%d',
168
+ '%s',
169
+ '%d',
170
+ '%s',
171
+ '%d',
172
+ '%d',
173
+ '%d'
174
+ )
175
+ );
176
  if ($results != false)
177
  {
178
  $mlwQmnAlertManager->newAlert('Your new quiz has been created successfully. To begin editing your quiz, click the Edit link on the new quiz.', 'success');
includes/mlw_quiz_options.php CHANGED
@@ -923,7 +923,6 @@ function mlw_options_text_tab_content()
923
  //Variables for save templates form
924
  $mlw_before_message = htmlspecialchars($_POST["mlw_quiz_before_message"], ENT_QUOTES);
925
  $mlw_qmn_message_end = htmlspecialchars($_POST["message_end_template"], ENT_QUOTES);
926
- $mlw_qmn_social_medi_text = htmlspecialchars($_POST["mlw_quiz_social_media_text_template"], ENT_QUOTES);
927
  $mlw_user_tries_text = htmlspecialchars($_POST["mlw_quiz_total_user_tries_text"], ENT_QUOTES);
928
  $mlw_submit_button_text = htmlspecialchars($_POST["mlw_submitText"], ENT_QUOTES);
929
  $mlw_name_field_text = htmlspecialchars($_POST["mlw_nameText"], ENT_QUOTES);
@@ -935,11 +934,12 @@ function mlw_options_text_tab_content()
935
  $mlw_require_log_in_text = htmlspecialchars($_POST["mlw_require_log_in_text"], ENT_QUOTES);
936
  $mlw_limit_total_entries_text = htmlspecialchars($_POST["mlw_limit_total_entries_text"], ENT_QUOTES);
937
  $mlw_qmn_pagination_field = serialize(array( $_POST["pagination_prev_text"], $_POST["pagination_next_text"] ));
 
938
  $mlw_email_from_text = $_POST["emailFromText"];
939
  $mlw_question_answer_template = htmlspecialchars($_POST["mlw_quiz_question_answer_template"], ENT_QUOTES);
940
  $quiz_id = $_POST["quiz_id"];
941
 
942
- $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET message_before='".$mlw_before_message."', message_comment='".$mlw_before_comments."', message_end_template='".$mlw_qmn_message_end."', comment_field_text='".$mlw_comment_field_text."', email_from_text='".$mlw_email_from_text."', question_answer_template='".$mlw_question_answer_template."', submit_button_text='".$mlw_submit_button_text."', name_field_text='".$mlw_name_field_text."', business_field_text='".$mlw_business_field_text."', email_field_text='".$mlw_email_field_text."', phone_field_text='".$mlw_phone_field_text."', total_user_tries_text='".$mlw_user_tries_text."', social_media_text='".$mlw_qmn_social_medi_text."', pagination_text='".$mlw_qmn_pagination_field."', require_log_in_text='".$mlw_require_log_in_text."', limit_total_entries_text='".$mlw_limit_total_entries_text."', last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=".$quiz_id;
943
  $results = $wpdb->query( $update );
944
  if ($results != false)
945
  {
@@ -967,11 +967,21 @@ function mlw_options_text_tab_content()
967
  }
968
 
969
  //Load Pagination Text
970
- $mlw_qmn_pagination_text = "";
971
  $mlw_qmn_pagination_text = @unserialize($mlw_quiz_options->pagination_text);
972
  if (!is_array($mlw_qmn_pagination_text)) {
973
- $mlw_qmn_pagination_text = array('Previous', $mlw_quiz_options->pagination_text);
974
- }
 
 
 
 
 
 
 
 
 
 
975
  ?>
976
  <div id="tabs-2" class="mlw_tab_content">
977
  <h3 style="text-align: center;">Template Variables</h3>
@@ -1117,7 +1127,24 @@ function mlw_options_text_tab_content()
1117
  </tr>
1118
  <tr>
1119
  <td width="30%">
1120
- <strong>Social Media Sharing Text</strong>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1121
  <br />
1122
  <p>Allowed Variables: </p>
1123
  <p style="margin: 2px 0">- %POINT_SCORE%</p>
@@ -1129,7 +1156,7 @@ function mlw_options_text_tab_content()
1129
  <p style="margin: 2px 0">- %TIMER%</p>
1130
  <p style="margin: 2px 0">- %CURRENT_DATE%</p>
1131
  </td>
1132
- <td><textarea cols="80" rows="15" id="mlw_quiz_social_media_text_template" name="mlw_quiz_social_media_text_template"><?php echo $mlw_quiz_options->social_media_text; ?></textarea>
1133
  </td>
1134
  </tr>
1135
  </table>
923
  //Variables for save templates form
924
  $mlw_before_message = htmlspecialchars($_POST["mlw_quiz_before_message"], ENT_QUOTES);
925
  $mlw_qmn_message_end = htmlspecialchars($_POST["message_end_template"], ENT_QUOTES);
 
926
  $mlw_user_tries_text = htmlspecialchars($_POST["mlw_quiz_total_user_tries_text"], ENT_QUOTES);
927
  $mlw_submit_button_text = htmlspecialchars($_POST["mlw_submitText"], ENT_QUOTES);
928
  $mlw_name_field_text = htmlspecialchars($_POST["mlw_nameText"], ENT_QUOTES);
934
  $mlw_require_log_in_text = htmlspecialchars($_POST["mlw_require_log_in_text"], ENT_QUOTES);
935
  $mlw_limit_total_entries_text = htmlspecialchars($_POST["mlw_limit_total_entries_text"], ENT_QUOTES);
936
  $mlw_qmn_pagination_field = serialize(array( $_POST["pagination_prev_text"], $_POST["pagination_next_text"] ));
937
+ $qmn_social_media_text = serialize(array('twitter' => $_POST["mlw_quiz_twitter_text_template"], 'facebook' => $_POST["mlw_quiz_facebook_text_template"]));
938
  $mlw_email_from_text = $_POST["emailFromText"];
939
  $mlw_question_answer_template = htmlspecialchars($_POST["mlw_quiz_question_answer_template"], ENT_QUOTES);
940
  $quiz_id = $_POST["quiz_id"];
941
 
942
+ $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET message_before='".$mlw_before_message."', message_comment='".$mlw_before_comments."', message_end_template='".$mlw_qmn_message_end."', comment_field_text='".$mlw_comment_field_text."', email_from_text='".$mlw_email_from_text."', question_answer_template='".$mlw_question_answer_template."', submit_button_text='".$mlw_submit_button_text."', name_field_text='".$mlw_name_field_text."', business_field_text='".$mlw_business_field_text."', email_field_text='".$mlw_email_field_text."', phone_field_text='".$mlw_phone_field_text."', total_user_tries_text='".$mlw_user_tries_text."', social_media_text='".$qmn_social_media_text."', pagination_text='".$mlw_qmn_pagination_field."', require_log_in_text='".$mlw_require_log_in_text."', limit_total_entries_text='".$mlw_limit_total_entries_text."', last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=".$quiz_id;
943
  $results = $wpdb->query( $update );
944
  if ($results != false)
945
  {
967
  }
968
 
969
  //Load Pagination Text
970
+ $mlw_qmn_pagination_text = "";
971
  $mlw_qmn_pagination_text = @unserialize($mlw_quiz_options->pagination_text);
972
  if (!is_array($mlw_qmn_pagination_text)) {
973
+ $mlw_qmn_pagination_text = array('Previous', $mlw_quiz_options->pagination_text);
974
+ }
975
+
976
+ //Load Social Media Text
977
+ $qmn_social_media_text = "";
978
+ $qmn_social_media_text = @unserialize($mlw_quiz_options->social_media_text);
979
+ if (!is_array($qmn_social_media_text)) {
980
+ $qmn_social_media_text = array(
981
+ 'twitter' => $mlw_quiz_options->social_media_text,
982
+ 'facebook' => $mlw_quiz_options->social_media_text
983
+ );
984
+ }
985
  ?>
986
  <div id="tabs-2" class="mlw_tab_content">
987
  <h3 style="text-align: center;">Template Variables</h3>
1127
  </tr>
1128
  <tr>
1129
  <td width="30%">
1130
+ <strong>Twitter Sharing Text</strong>
1131
+ <br />
1132
+ <p>Allowed Variables: </p>
1133
+ <p style="margin: 2px 0">- %POINT_SCORE%</p>
1134
+ <p style="margin: 2px 0">- %AVERAGE_POINT%</p>
1135
+ <p style="margin: 2px 0">- %AMOUNT_CORRECT%</p>
1136
+ <p style="margin: 2px 0">- %TOTAL_QUESTIONS%</p>
1137
+ <p style="margin: 2px 0">- %CORRECT_SCORE%</p>
1138
+ <p style="margin: 2px 0">- %QUIZ_NAME%</p>
1139
+ <p style="margin: 2px 0">- %TIMER%</p>
1140
+ <p style="margin: 2px 0">- %CURRENT_DATE%</p>
1141
+ </td>
1142
+ <td><textarea cols="80" rows="15" id="mlw_quiz_twitter_text_template" name="mlw_quiz_twitter_text_template"><?php echo $qmn_social_media_text["twitter"]; ?></textarea>
1143
+ </td>
1144
+ </tr>
1145
+ <tr>
1146
+ <td width="30%">
1147
+ <strong>Facebook Sharing Text</strong>
1148
  <br />
1149
  <p>Allowed Variables: </p>
1150
  <p style="margin: 2px 0">- %POINT_SCORE%</p>
1156
  <p style="margin: 2px 0">- %TIMER%</p>
1157
  <p style="margin: 2px 0">- %CURRENT_DATE%</p>
1158
  </td>
1159
+ <td><textarea cols="80" rows="15" id="mlw_quiz_facebook_text_template" name="mlw_quiz_facebook_text_template"><?php echo $qmn_social_media_text["facebook"] ?></textarea>
1160
  </td>
1161
  </tr>
1162
  </table>
includes/mlw_results.php CHANGED
@@ -151,7 +151,12 @@ function mlw_generate_quiz_results()
151
  $mlw_qmn_results_array = @unserialize($mlw_quiz_info->quiz_results);
152
  if (is_array($mlw_qmn_results_array))
153
  {
154
- $mlw_complete_minutes = floor($mlw_qmn_results_array[0] / 60);
 
 
 
 
 
155
  if ($mlw_complete_minutes > 0)
156
  {
157
  $mlw_complete_time .= "$mlw_complete_minutes minutes ";
@@ -246,4 +251,4 @@ function mlw_generate_quiz_results()
246
  </div>
247
  <?php
248
  }
249
- ?>
151
  $mlw_qmn_results_array = @unserialize($mlw_quiz_info->quiz_results);
152
  if (is_array($mlw_qmn_results_array))
153
  {
154
+ $mlw_complete_hours = floor($mlw_qmn_results_array[0] / 3600);
155
+ if ($mlw_complete_hours > 0)
156
+ {
157
+ $mlw_complete_time .= "$mlw_complete_hours hours ";
158
+ }
159
+ $mlw_complete_minutes = floor(($mlw_qmn_results_array[0] % 3600) / 60);
160
  if ($mlw_complete_minutes > 0)
161
  {
162
  $mlw_complete_time .= "$mlw_complete_minutes minutes ";
251
  </div>
252
  <?php
253
  }
254
+ ?>
includes/mlw_results_details.php CHANGED
@@ -186,7 +186,12 @@ EOC;
186
  else
187
  {
188
  $mlw_complete_time = '';
189
- $mlw_complete_minutes = floor($mlw_qmn_results_array[0] / 60);
 
 
 
 
 
190
  if ($mlw_complete_minutes > 0)
191
  {
192
  $mlw_complete_time .= "$mlw_complete_minutes minutes ";
@@ -310,4 +315,4 @@ EOC;
310
  <?php
311
  }
312
  }
313
- ?>
186
  else
187
  {
188
  $mlw_complete_time = '';
189
+ $mlw_complete_hours = floor($mlw_qmn_results_array[0] / 3600);
190
+ if ($mlw_complete_hours > 0)
191
+ {
192
+ $mlw_complete_time .= "$mlw_complete_hours hours ";
193
+ }
194
+ $mlw_complete_minutes = floor(($mlw_qmn_results_array[0] % 3600) / 60);
195
  if ($mlw_complete_minutes > 0)
196
  {
197
  $mlw_complete_time .= "$mlw_complete_minutes minutes ";
315
  <?php
316
  }
317
  }
318
+ ?>
includes/mlw_template_variables.php ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+
4
+ Results Array For Reference:
5
+
6
+ $mlw_qmn_result_array = array(
7
+ 'quiz_id' => $mlw_quiz_id,
8
+ 'quiz_name' => $mlw_quiz_options->quiz_name,
9
+ 'quiz_system' => $mlw_quiz_options->system,
10
+ 'total_points' => $mlw_points,
11
+ 'total_score' => $mlw_total_score,
12
+ 'total_correct' => $mlw_correct,
13
+ 'total_questions' => $mlw_total_questions,
14
+ 'user_name' => $mlw_user_name,
15
+ 'user_business' => $mlw_user_comp,
16
+ 'user_email' => $mlw_user_email,
17
+ 'user_phone' => $mlw_user_phone,
18
+ 'user_id' => get_current_user_id(),
19
+ 'question_answers_display' => $mlw_question_answers,
20
+ 'question_answers_array' => $mlw_qmn_answer_array,
21
+ 'timer' => $mlw_qmn_timer,
22
+ 'comments' => $mlw_qm_quiz_comments,
23
+ 'certificate_link' => CERTIFICATE LINK
24
+ );
25
+
26
+ */
27
+ add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_point_score',10,2);
28
+ add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_average_point',10,2);
29
+ add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_amount_correct',10,2);
30
+ add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_total_questions',10,2);
31
+ add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_correct_score',10,2);
32
+ add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_quiz_name',10,2);
33
+ add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_user_name',10,2);
34
+ add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_user_business',10,2);
35
+ add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_user_phone',10,2);
36
+ add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_user_email',10,2);
37
+ add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_question_answers',10,2);
38
+ add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_comments',10,2);
39
+ add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_timer',10,2);
40
+ add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_date',10,2);
41
+ add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_certificate_link',10,2);
42
+
43
+ add_filter('mlw_qmn_template_variable_quiz_page', 'mlw_qmn_variable_quiz_name',10,2);
44
+ add_filter('mlw_qmn_template_variable_quiz_page', 'mlw_qmn_variable_date',10,2);
45
+ add_filter('mlw_qmn_template_variable_quiz_page', 'mlw_qmn_variable_current_user',10,2);
46
+ function mlw_qmn_variable_point_score($content, $mlw_quiz_array)
47
+ {
48
+ $content = str_replace( "%POINT_SCORE%" , $mlw_quiz_array["total_points"], $content);
49
+ return $content;
50
+ }
51
+ function mlw_qmn_variable_average_point($content, $mlw_quiz_array)
52
+ {
53
+ $mlw_average_points = $mlw_quiz_array["total_points"]/$mlw_quiz_array["total_questions"];
54
+ $content = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $content);
55
+ return $content;
56
+ }
57
+ function mlw_qmn_variable_amount_correct($content, $mlw_quiz_array)
58
+ {
59
+ $content = str_replace( "%AMOUNT_CORRECT%" , $mlw_quiz_array["total_correct"], $content);
60
+ return $content;
61
+ }
62
+ function mlw_qmn_variable_total_questions($content, $mlw_quiz_array)
63
+ {
64
+ $content = str_replace( "%TOTAL_QUESTIONS%" , $mlw_quiz_array["total_questions"], $content);
65
+ return $content;
66
+ }
67
+ function mlw_qmn_variable_correct_score($content, $mlw_quiz_array)
68
+ {
69
+ $content = str_replace( "%CORRECT_SCORE%" , $mlw_quiz_array["total_score"], $content);
70
+ return $content;
71
+ }
72
+ function mlw_qmn_variable_quiz_name($content, $mlw_quiz_array)
73
+ {
74
+ $content = str_replace( "%QUIZ_NAME%" , $mlw_quiz_array["quiz_name"], $content);
75
+ return $content;
76
+ }
77
+ function mlw_qmn_variable_user_name($content, $mlw_quiz_array)
78
+ {
79
+ $content = str_replace( "%USER_NAME%" , $mlw_quiz_array["user_name"], $content);
80
+ return $content;
81
+ }
82
+ function mlw_qmn_variable_current_user($content, $mlw_quiz_array)
83
+ {
84
+ $current_user = wp_get_current_user();
85
+ $content = str_replace( "%USER_NAME%" , $current_user->display_name, $content);
86
+ return $content;
87
+ }
88
+ function mlw_qmn_variable_user_business($content, $mlw_quiz_array)
89
+ {
90
+ $content = str_replace( "%USER_BUSINESS%" , $mlw_quiz_array["user_business"], $content);
91
+ return $content;
92
+ }
93
+ function mlw_qmn_variable_user_phone($content, $mlw_quiz_array)
94
+ {
95
+ $content = str_replace( "%USER_PHONE%" , $mlw_quiz_array["user_phone"], $content);
96
+ return $content;
97
+ }
98
+ function mlw_qmn_variable_user_email($content, $mlw_quiz_array)
99
+ {
100
+ $content = str_replace( "%USER_EMAIL%" , $mlw_quiz_array["user_email"], $content);
101
+ return $content;
102
+ }
103
+ function mlw_qmn_variable_question_answers($content, $mlw_quiz_array)
104
+ {
105
+ $content = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_quiz_array["question_answers_display"], $content);
106
+ return $content;
107
+ }
108
+ function mlw_qmn_variable_comments($content, $mlw_quiz_array)
109
+ {
110
+ $content = str_replace( "%COMMENT_SECTION%" , $mlw_quiz_array["comments"], $content);
111
+ return $content;
112
+ }
113
+ function mlw_qmn_variable_timer($content, $mlw_quiz_array)
114
+ {
115
+ $content = str_replace( "%TIMER%" , $mlw_quiz_array["timer"], $content);
116
+ return $content;
117
+ }
118
+ function mlw_qmn_variable_date($content, $mlw_quiz_array)
119
+ {
120
+ $content = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $content);
121
+ return $content;
122
+ }
123
+ function mlw_qmn_variable_certificate_link($content, $mlw_quiz_array)
124
+ {
125
+ $content = str_replace( "%CERTIFICATE_LINK%" , $mlw_quiz_array["certificate_link"], $content);
126
+ return $content;
127
+ }
128
+ ?>
includes/mlw_update.php CHANGED
@@ -6,7 +6,7 @@ function mlw_quiz_update()
6
  {
7
 
8
  //Update this variable each update. This is what is checked when the plugin is deciding to run the upgrade script or not.
9
- $data = "3.5.2";
10
  if ( ! get_option('mlw_quiz_master_version'))
11
  {
12
  add_option('mlw_quiz_master_version' , $data);
6
  {
7
 
8
  //Update this variable each update. This is what is checked when the plugin is deciding to run the upgrade script or not.
9
+ $data = "3.6.1";
10
  if ( ! get_option('mlw_quiz_master_version'))
11
  {
12
  add_option('mlw_quiz_master_version' , $data);
mlw_quizmaster2.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  Plugin Name: Quiz Master Next
5
  Description: Use this plugin to add multiple quizzes, tests, or surveys to your website.
6
- Version: 3.5.2
7
  Author: Frank Corso
8
  Author URI: http://www.mylocalwebstop.com/
9
  Plugin URI: http://www.mylocalwebstop.com/
@@ -20,175 +20,108 @@ Neither My Local Webstop nor its suppliers and licensors, makes any warranty tha
20
  You understand that you install, operate, and unistall the plugin at your own discretion and risk.
21
  */
22
 
23
-
24
- ///Files to Include
25
- include("includes/mlw_alerts.php");
26
- include("includes/mlw_quiz.php");
27
- include("includes/mlw_dashboard.php");
28
- include("includes/mlw_quiz_admin.php");
29
- include("includes/mlw_quiz_options.php");
30
- include("includes/mlw_quiz_install.php");
31
- include("includes/mlw_results.php");
32
- include("includes/mlw_results_details.php");
33
- include("includes/mlw_tools.php");
34
- include("includes/mlw_leaderboard.php");
35
- include("includes/mlw_update.php");
36
- include("includes/mlw_qmn_widgets.php");
37
- include("includes/mlw_qmn_credits.php");
38
-
39
-
40
- ///Activation Actions
41
- add_action('admin_menu', 'mlw_add_menu');
42
- add_action('admin_init', 'mlw_quiz_update');
43
- add_action('widgets_init', create_function('', 'return register_widget("Mlw_Qmn_Leaderboard_Widget");'));
44
- add_shortcode('mlw_quizmaster', 'mlw_quiz_shortcode');
45
- add_shortcode('mlw_quizmaster_leaderboard', 'mlw_quiz_leaderboard_shortcode');
46
- register_activation_hook( __FILE__, 'mlw_quiz_activate');
47
- register_deactivation_hook( __FILE__, 'mlw_quiz_deactivate');
48
-
49
- //Setup Translations
50
- function mlw_qmn_translation_setup() {
51
- load_plugin_textdomain( 'mlw_qmn_text_domain', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
52
- }
53
- add_action('plugins_loaded', 'mlw_qmn_translation_setup');
54
-
55
-
56
- ///Create Admin Pages
57
- function mlw_add_menu()
58
  {
59
- if (function_exists('add_menu_page'))
 
 
 
 
 
 
 
 
 
 
60
  {
61
- add_menu_page('Quiz Master Next', 'Quiz Dashboard', 'moderate_comments', __FILE__, 'mlw_generate_quiz_dashboard', 'dashicons-feedback');
62
- add_submenu_page(__FILE__, 'Quizzes', 'Quizzes', 'moderate_comments', 'mlw_quiz_admin', 'mlw_generate_quiz_admin');
63
- add_submenu_page(__FILE__, 'Quiz Settings', 'Quiz Settings', 'moderate_comments', 'mlw_quiz_options', 'mlw_generate_quiz_options');
64
- add_submenu_page(__FILE__, 'Quiz Results', 'Quiz Results', 'moderate_comments', 'mlw_quiz_results', 'mlw_generate_quiz_results');
65
- add_submenu_page(__FILE__, 'Quiz Result Details', 'Quiz Result Details', 'moderate_comments', 'mlw_quiz_result_details', 'mlw_generate_result_details');
66
- add_submenu_page(__FILE__, 'Tools', 'Tools', 'manage_options', 'mlw_quiz_tools', 'mlw_generate_quiz_tools');
67
- add_submenu_page(__FILE__, 'QMN About', 'QMN About', 'manage_options', 'mlw_qmn_about', 'mlw_generate_about_page');
68
- }
69
- }
70
-
71
-
72
- //Admin Notice
73
- add_action('admin_notices', 'mlw_qmn_notice');
74
- function mlw_qmn_notice() {
75
- if ( get_option('mlw_qmn_review_notice') == 1 && current_user_can( 'manage_options' ) )
76
- {
77
- echo "
78
- <style>
79
- div.help_decide
80
- {
81
- display: block;
82
- text-align:center;
83
- letter-spacing: 1px;
84
- margin: auto;
85
- text-shadow: 0 1px 1px #000000;
86
- background: #0d97d8;
87
- border: 5px solid #106daa;
88
- -moz-border-radius: 20px;
89
- -webkit-border-radius: 20px;
90
- -khtml-border-radius: 20px;
91
- border-radius: 20px;
92
- color: #FFFFFF;
93
- }
94
- div.help_decide a
95
- {
96
- color: yellow;
97
- }
98
- </style>";
99
- echo '<div class="help_decide"><p>';
100
- printf(__('You have been using the Quiz Master Next plugin for a while now! Thanks for choosing to use this plugin. If it has benefited your website, please consider purchasing an <a href="http://mylocalwebstop.com/shop/">add-on</a>, giving a <a href="http://wordpress.org/support/view/plugin-reviews/quiz-master-next">review</a>, or taking this <a href="http://mylocalwebstop.com/sample-survey/" target="_blank">survey</a>. | <a href="%1$s">Hide Notice</a>'), '?page=quiz-master-next/mlw_quizmaster2.php&&mlw_qmn_ignore_notice=0');
101
- echo "</p></div>";
102
  }
103
- }
104
- //Check to see if notices should be shown or dismissed
105
- add_action('admin_init', 'mlw_qmn_notice_ignore');
106
- function mlw_qmn_notice_ignore() {
107
- global $wpdb;
108
- if ( ! get_option('mlw_qmn_review_notice'))
 
 
109
  {
110
- add_option('mlw_qmn_review_notice' , '0');
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  }
112
- if ($wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_results" ) >= 20 && get_option('mlw_qmn_review_notice') == 0)
 
 
 
 
 
 
 
 
 
113
  {
114
- update_option('mlw_qmn_review_notice' , '1');
 
 
 
 
 
115
  }
116
- if ( isset($_GET['mlw_qmn_ignore_notice']) && '0' == $_GET['mlw_qmn_ignore_notice'] ) {
117
- update_option('mlw_qmn_review_notice' , '2');
118
- }
119
- }
120
- function mlw_qmn_show_adverts()
121
- {
122
- $mlw_advert = "";
123
- $mlw_advert_text = "";
124
- if ( get_option('mlw_advert_shows') == 'true' )
 
125
  {
126
- $mlw_random_int = rand(0, 8);
127
- switch ($mlw_random_int) {
128
- case 0:
129
- $mlw_advert_text = "Need support or features? Check out our Premium Support options! Visit our <a href=\"http://mylocalwebstop.com/shop/\">WordPress Store</a> for details!";
130
- break;
131
- case 1:
132
- $mlw_advert_text = "Is Quiz Master Next beneficial to your website? Please help by giving us a review on WordPress.org by going <a href=\"http://wordpress.org/support/view/plugin-reviews/quiz-master-next\">here</a>!";
133
- break;
134
- case 2:
135
- $mlw_advert_text = "Want help installing and configuring one of our plugins? Check out our Plugin Installation services. Visit our <a href=\"http://mylocalwebstop.com/shop/\">WordPress Store</a> for details!";
136
- break;
137
- case 3:
138
- $mlw_advert_text = "Would you like to support this plugin but do not need or want premium support? Please consider our inexpensive 'Advertisements Be Gone' add-on which will get rid of these ads. Visit our <a href=\"http://mylocalwebstop.com/shop/\">Plugin Add-On Store</a> for details!";
139
- break;
140
- case 4:
141
- $mlw_advert_text = "Need to be able to export the results of your quizzes? Be sure to check out our new Export Results add-on in our <a href=\"http://mylocalwebstop.com/shop/\">WordPress Store</a>!";
142
- break;
143
- case 5:
144
- $mlw_advert_text = "Need help keeping your plugins, themes, and WordPress up to date? Want around the clock security monitoring and off-site back-ups? How about WordPress training videos, a monthly status report, and support/consultation? Check out our <a href=\"http://mylocalwebstop.com/wordpress-maintenance-services/\">WordPress Maintenance Services</a> for more details!";
145
- break;
146
- case 6:
147
- $mlw_advert_text = "Setting up a new site? Let us take care of the set-up so you back to running your business. Check out our <a href=\"http://mylocalwebstop.com/shop/\">WordPress Store</a> for more details!";
148
- break;
149
- case 7:
150
- $mlw_advert_text = "Need a page so your users can see their results from all the quizzes they have taken? Try our new User Dashboard add-on. Check out our <a href=\"http://mylocalwebstop.com/shop/\">WordPress Store</a> for more details!";
151
- break;
152
- case 8:
153
- $mlw_advert_text = "Our new Popular Add-On Pack is now only $45 for 6 add-ons! Now is the time to save almost 50%! Visit our <a href=\"http://mylocalwebstop.com/shop/\">WordPress Store</a> for details.";
154
- break;
155
- default:
156
- $mlw_advert_text = "Need support or features? Check out our Premium Support options! Visit our <a href=\"http://mylocalwebstop.com/shop/\">Plugin Add-On Store</a> for details!";
157
  }
158
- $mlw_advert .= "
159
- <style>
160
- div.help_decide
161
- {
162
- display: block;
163
- text-align:center;
164
- letter-spacing: 1px;
165
- margin: auto;
166
- text-shadow: 0 1px 1px #000000;
167
- background: #0d97d8;
168
- border: 5px solid #106daa;
169
- -moz-border-radius: 20px;
170
- -webkit-border-radius: 20px;
171
- -khtml-border-radius: 20px;
172
- border-radius: 20px;
173
- color: #FFFFFF;
174
- }
175
- div.help_decide a
176
- {
177
- color: yellow;
178
- }
179
- </style>";
180
- $mlw_advert .= "
181
- <div class=\"help_decide\">
182
- <p>$mlw_advert_text</p>
183
- </div>";
184
  }
185
- return $mlw_advert;
 
 
 
 
 
 
 
 
 
 
186
  }
187
 
188
-
189
-
190
- /*
191
-
192
-
193
- */
194
  ?>
3
  /*
4
  Plugin Name: Quiz Master Next
5
  Description: Use this plugin to add multiple quizzes, tests, or surveys to your website.
6
+ Version: 3.6.1
7
  Author: Frank Corso
8
  Author URI: http://www.mylocalwebstop.com/
9
  Plugin URI: http://www.mylocalwebstop.com/
20
  You understand that you install, operate, and unistall the plugin at your own discretion and risk.
21
  */
22
 
23
+ /**
24
+ * This class is the main class of the plugin
25
+ *
26
+ * When loaded, it loads the included plugin files and add functions to hooks or filters. The class also handles the admin menu
27
+ *
28
+ * @since 3.6.1
29
+ */
30
+ class MLWQuizMasterNext
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  {
32
+ /**
33
+ * Main Construct Function
34
+ *
35
+ * Call functions within class
36
+ *
37
+ * @since 3.6.1
38
+ * @uses MLWQuizMasterNext::load_dependencies() Loads required filed
39
+ * @uses MLWQuizMasterNext::add_hooks() Adds actions to hooks and filters
40
+ * @return void
41
+ */
42
+ public function __construct()
43
  {
44
+ $this->load_dependencies();
45
+ $this->add_hooks();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  }
47
+
48
+ /**
49
+ * Load File Dependencies
50
+ *
51
+ * @since 3.6.1
52
+ * @return void
53
+ */
54
+ private function load_dependencies()
55
  {
56
+ include("includes/mlw_quiz.php");
57
+ include("includes/mlw_dashboard.php");
58
+ include("includes/mlw_quiz_admin.php");
59
+ include("includes/mlw_quiz_options.php");
60
+ include("includes/mlw_quiz_install.php");
61
+ include("includes/mlw_results.php");
62
+ include("includes/mlw_results_details.php");
63
+ include("includes/mlw_tools.php");
64
+ include("includes/mlw_leaderboard.php");
65
+ include("includes/mlw_update.php");
66
+ include("includes/mlw_qmn_widgets.php");
67
+ include("includes/mlw_qmn_credits.php");
68
+ include("includes/mlw_template_variables.php");
69
+ include("includes/mlw_adverts.php");
70
  }
71
+
72
+ /**
73
+ * Add Hooks
74
+ *
75
+ * Adds functions to relavent hooks and filters
76
+ *
77
+ * @since 3.6.1
78
+ * @return void
79
+ */
80
+ private function add_hooks()
81
  {
82
+ add_action('admin_menu', array( $this, 'setup_admin_menu'));
83
+ add_action('admin_init', 'mlw_quiz_update');
84
+ add_action('widgets_init', create_function('', 'return register_widget("Mlw_Qmn_Leaderboard_Widget");'));
85
+ add_shortcode('mlw_quizmaster', 'mlw_quiz_shortcode');
86
+ add_shortcode('mlw_quizmaster_leaderboard', 'mlw_quiz_leaderboard_shortcode');
87
+ add_action('plugins_loaded', array( $this, 'setup_translations'));
88
  }
89
+
90
+ /**
91
+ * Setup Admin Menu
92
+ *
93
+ * Creates the admin menu and pages for the plugin and attaches functions to them
94
+ *
95
+ * @since 3.6.1
96
+ * @return void
97
+ */
98
+ public function setup_admin_menu()
99
  {
100
+ if (function_exists('add_menu_page'))
101
+ {
102
+ add_menu_page('Quiz Master Next', 'Quiz Dashboard', 'moderate_comments', __FILE__, 'mlw_generate_quiz_dashboard', 'dashicons-feedback');
103
+ add_submenu_page(__FILE__, 'Quizzes', 'Quizzes', 'moderate_comments', 'mlw_quiz_admin', 'mlw_generate_quiz_admin');
104
+ add_submenu_page(__FILE__, 'Quiz Settings', 'Quiz Settings', 'moderate_comments', 'mlw_quiz_options', 'mlw_generate_quiz_options');
105
+ add_submenu_page(__FILE__, 'Quiz Results', 'Quiz Results', 'moderate_comments', 'mlw_quiz_results', 'mlw_generate_quiz_results');
106
+ add_submenu_page(__FILE__, 'Quiz Result Details', 'Quiz Result Details', 'moderate_comments', 'mlw_quiz_result_details', 'mlw_generate_result_details');
107
+ add_submenu_page(__FILE__, 'Tools', 'Tools', 'manage_options', 'mlw_quiz_tools', 'mlw_generate_quiz_tools');
108
+ add_submenu_page(__FILE__, 'QMN About', 'QMN About', 'manage_options', 'mlw_qmn_about', 'mlw_generate_about_page');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  }
111
+
112
+ /**
113
+ * Loads the plugin language files
114
+ *
115
+ * @since 3.6.1
116
+ * @return void
117
+ */
118
+ public function setup_translations()
119
+ {
120
+ load_plugin_textdomain( 'mlw_qmn_text_domain', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
121
+ }
122
  }
123
 
124
+ $mlwQuizMasterNext = new MLWQuizMasterNext();
125
+ include("includes/mlw_alerts.php");
126
+ register_activation_hook( __FILE__, 'mlw_quiz_activate');
 
 
 
127
  ?>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: quiz, test, score, exam, survey, contact, form, email, answer, question
5
  Requires at least: 3.8.1
6
  Tested up to: 4.0
7
- Stable tag: 3.5.2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
  The easiest and most flexible way to add multiple quizzes, tests, and surveys to your website.
@@ -109,6 +109,13 @@ Feel free to use the widget on the quiz dashboard within the plugin or from the
109
 
110
  == Changelog ==
111
 
 
 
 
 
 
 
 
112
  = 3.5.2 (November 26, 2014) =
113
  * Bug Fix For Some Bugs Resulting In Error Code 0008
114
 
@@ -549,6 +556,9 @@ Feel free to use the widget on the quiz dashboard within the plugin or from the
549
 
550
  == Upgrade Notice ==
551
 
 
 
 
552
  = 3.5.2 =
553
  Upgrade for minor bug fixes
554
 
4
  Tags: quiz, test, score, exam, survey, contact, form, email, answer, question
5
  Requires at least: 3.8.1
6
  Tested up to: 4.0
7
+ Stable tag: 3.6.1
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
  The easiest and most flexible way to add multiple quizzes, tests, and surveys to your website.
109
 
110
  == Changelog ==
111
 
112
+ = 3.6.1 (December 2, 2014) =
113
+ * Add Separate Social Network Text Templates
114
+ * Added Hours Field To Timer And Completion Time
115
+ * Converted Quizzes Page To Use wpdb->update And wpdb->insert Instead Of query
116
+ * Created New Filter For Creating New Variables For Quiz Page
117
+ * Created New Filter For Creating New Variables For Results Page
118
+
119
  = 3.5.2 (November 26, 2014) =
120
  * Bug Fix For Some Bugs Resulting In Error Code 0008
121
 
556
 
557
  == Upgrade Notice ==
558
 
559
+ = 3.6.1 =
560
+ Upgrade for many backend upgrades
561
+
562
  = 3.5.2 =
563
  Upgrade for minor bug fixes
564