Skip to content

Commit

Permalink
Merge pull request #67 from fpcorso/3.8.1
Browse files Browse the repository at this point in the history
Version 3.8.1
  • Loading branch information
fpcorso committed Dec 16, 2014
2 parents 38d6d39 + c050d8b commit f825d8c
Show file tree
Hide file tree
Showing 12 changed files with 882 additions and 478 deletions.
4 changes: 4 additions & 0 deletions includes/certificates/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php


?>
256 changes: 4 additions & 252 deletions includes/mlw_dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,59 +6,20 @@
Copyright 2014, My Local Webstop (email : [email protected])
*/

function mlw_generate_quiz_dashboard(){

//Support Email Validation Script
echo "
<script>
function mlw_validateForm()
{
var x=document.forms['emailForm']['email'].value;
if (x==null || x=='')
{
document.getElementById('mlw_support_message').innerHTML = '**Email must be filled out!**';
return false;
};
var x=document.forms['emailForm']['username'].value;
if (x==null || x=='')
{
document.getElementById('mlw_support_message').innerHTML = '**Name must be filled out!**';
return false;
};
var x=document.forms['emailForm']['message'].value;
if (x==null || x=='')
{
document.getElementById('mlw_support_message').innerHTML = '**There must be a message to send!**';
return false;
};
var x=document.forms['emailForm']['email'].value;
var atpos=x.indexOf('@');
var dotpos=x.lastIndexOf('.');
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
{
document.getElementById('mlw_support_message').innerHTML = '**Not a valid e-mail address!**';
return false;
}
}
</script>
";

function mlw_generate_quiz_dashboard()
{
//Page Variables
$mlw_quiz_version = get_option('mlw_quiz_master_version');


///Creates the widgets
add_meta_box("wpss_mrts", 'Quiz Daily Stats - Times Taken', "mlw_dashboard_box", "quiz_wpss");
add_meta_box("wpss_mrts", 'Quiz Total Stats', "mlw_dashboard_box_three", "quiz_wpss3");
add_meta_box("wpss_mrts", 'Quiz Weekly Stats - Times Taken', "mlw_dashboard_box_four", "quiz_wpss4");
add_meta_box("wpss_mrts", 'Quiz Monthly Stats - Times Taken', "mlw_dashboard_box_five", "quiz_wpss5");
add_meta_box("wpss_mrts", 'Support', "mlw_dashboard_box_seven", "quiz_wpss7");
if ( get_option('mlw_advert_shows') == 'true' )
{
add_meta_box("wpss_mrts", 'My Local Webstop Services', "mlw_dashboard_box_six", "quiz_wpss6");
add_meta_box("wpss_mrts", 'Contribution', "mlw_dashboard_box_eight", "quiz_wpss8");
}
add_meta_box("wpss_mrts", 'News From My Local Webstop', "mlw_dashboard_box_nine", "quiz_wpss9");
add_meta_box("wpss_mrts", 'Quizzes Taken Today', "mlw_qmn_daily_percent_taken_widget", "quiz_wpss10");
add_meta_box("wpss_mrts", 'Quizzes Taken Last 7 Days', "mlw_qmn_weekly_percent_taken_widget", "quiz_wpss11");
add_meta_box("wpss_mrts", 'Quizzes Taken Last 30 Days', "mlw_qmn_monthly_percent_taken_widget", "quiz_wpss12");
Expand All @@ -70,34 +31,15 @@ function mlw_validateForm()
<?php
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'jquery-ui-core' );
wp_enqueue_script( 'jquery-ui-dialog' );
wp_enqueue_script( 'jquery-ui-button' );
wp_enqueue_script( 'jquery-ui-tooltip' );
wp_enqueue_script( 'jquery-effects-blind' );
wp_enqueue_script( 'jquery-effects-explode' );
?>
<script type="text/javascript" src="<?php echo plugin_dir_url( __FILE__ ); ?>jquery_sparkline.js"></script>
<script type="text/javascript">
var $j = jQuery.noConflict();
// increase the default animation speed to exaggerate the effect
$j.fx.speeds._default = 1000;
$j(function() {
$j('#dialog').dialog({
autoOpen: false,
show: 'blind',
hide: 'explode',
buttons: {
Ok: function() {
$j(this).dialog('close');
}
}
});

$j('#opener').click(function() {
$j('#dialog').dialog('open');
return false;
});

$j(function() {
$j( document ).tooltip();
});
Expand All @@ -106,45 +48,8 @@ function mlw_validateForm()
$j('.inlinesparkline').sparkline('html', {type: 'line', width: '400', height: '200'});
});
</script>
<style type="text/css">
textarea{
border-color:#000000;
color:#3300CC;
cursor:hand;
}
p em {
padding-left: 1em;
color: #555;
font-weight: bold;
}
div.quiz_email_support {
text-align: left;
}
div.quiz_email_support input[type='text'] {
border-color:#000000;
color:#3300CC;
cursor:hand;
}
div.donation {
border-width: 1px;
border-style: solid;
padding: 0 0.6em;
margin: 5px 0 15px;
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
background-color: #ffffe0;
border-color: #e6db55;
text-align: center;
}
donation.p { margin: 0.5em 0;
line-height: 1;
padding: 2px;
}
</style>
<div class="wrap">
<h2>Quiz Master Next Version <?php echo $mlw_quiz_version; ?> <?php _e("Dashboard", "mlw_qmn_text_domain"); ?><a id="opener" href="">(?)</a></h2>
<h2>Quiz Master Next Version <?php echo $mlw_quiz_version; ?> Statistics</h2>

<?php echo mlw_qmn_show_adverts(); ?>
<!--Display Widget Boxes-->
Expand Down Expand Up @@ -187,36 +92,6 @@ function mlw_validateForm()
</div>

<div style="clear:both">

<div style="float:left; width:38%;" class="inner-sidebar1">
<?php do_meta_boxes('quiz_wpss9','advanced',''); ?>
</div>

<div style="float:left; width:38%; " class="inner-sidebar1">
<?php do_meta_boxes('quiz_wpss7','advanced',''); ?>
</div>

<div style="float:right; width:24%; " class="inner-sidebar1">
<?php if ( get_option('mlw_advert_shows') == 'true' ) {do_meta_boxes('quiz_wpss8','advanced','');} ?>
</div>

<div style="clear:both">


<!--Dialogs-->
<div id="dialog" title="Help" style="display:none;">
<h3><b>Help</b></h3>
<p>This page is the main admin dashboard for the Quiz Master Next. It contains many useful widgets for the admin.</p>
<p>Quiz Daily Stats -> This widget shows the times all quizzes have been taken each day over the last week.</p>
<p>Quiz Weekly Stats -> This widget shows the times all quizzes have been taken each week over the last few weeks.</p>
<p>Quiz Monthly Stats -> This widget shows the times all quizzes have been taken each month over the last few months.</p>
<p>Quiz Total Stats -> This widget shows several different stats that has been collected.</p>
<p>In This Update -> This widget shows what is new in the most recent update of the plugin.</p>
<p>Support -> This widget allows you to send a message to the developer of the plugin.</p>
<p>News From My Local Webstop -> This widget allows you to keep up with the latest news from My Local Webstop, the developer behind Quiz Master Next.</p>
<p>Contribution -> This widget allows you to make a contribution to the developer.</p>
</div>

</div>
<?php
}
Expand Down Expand Up @@ -496,129 +371,6 @@ function mlw_dashboard_box_six()
</div>
<?php
}

function mlw_dashboard_box_seven()
{
$quiz_master_email_message = "";
$mlw_quiz_version = get_option('mlw_quiz_master_version');
if(isset($_POST["action"]))
{
$quiz_master_email_success = $_POST["action"];
$user_name = $_POST["username"];
$user_email = $_POST["email"];
$user_message = $_POST["message"];
$user_quiz_url = $_POST["quiz_url"];
$current_user = wp_get_current_user();
$mlw_site_name = get_bloginfo('name');
$mlw_site_url = get_bloginfo('url');
$mlw_site_version = get_bloginfo('version');
$mlw_site_info = $mlw_site_name." ".$mlw_site_url." ".$mlw_site_version;
if ($quiz_master_email_success == 'update')
{
$mlw_message = "Message from ".$user_name." at ".$user_email." It says: \n \n ".$user_message."\n Version: ".$mlw_quiz_version."\n Quiz URL Provided: ".$user_quiz_url."\n User ".$current_user->display_name." from ".$current_user->user_email."\n Wordpress Info: ".$mlw_site_info;
wp_mail('[email protected]' ,'Support From Quiz Master Next Plugin', $mlw_message);
$quiz_master_email_message = "**Message Sent**";
}
}
?>
<div class='quiz_email_support'>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>?page=quiz-master-next/mlw_quizmaster2.php" method='post' name='emailForm' onsubmit='return mlw_validateForm()'>
<input type='hidden' name='action' value='update' />
<table>
<tr>
<td>If there is something you would like to suggest to add or even if you just want
to let me know if you like the plugin or not, feel free to use the email form below.</td>
</tr>
<tr>
<td><span name='mlw_support_message' id='mlw_support_message' style="color: red;"><?php echo $quiz_master_email_message; ?></span></td>
</tr>
<tr>
<td align='left'><span style='font-weight:bold;';>Name (Required): </span></td>
</tr>
<tr>
<td><input type='text' name='username' value='' /></td>
</tr>
<tr>
<td align='left'><span style='font-weight:bold;';>Email (Required): </span></td>
</tr>
<tr>
<td><input type='text' name='email' value='' /></td>
</tr>
<tr>
<td align='left'><span style='font-weight:bold;';>URL To Quiz (Not Required): </span></td>
</tr>
<tr>
<td><input type='text' name='quiz_url' value='' /></td>
</tr>
<tr>
<td align='left'><span style='font-weight:bold;';>Message (Required): </span></td>
</tr>
<tr>
<td align='left'><TEXTAREA NAME="message" COLS=40 ROWS=6></TEXTAREA></td>
</tr>
<tr>
<td align='left'><input type='submit' class="button-primary" value='Send Email' /></td>
</tr>
<tr>
<td align='left'></td>
</tr>
</table>
</form>
<p>Disclaimer: In order to better assist you, this form will also send some useful information about your WordPress installation such as version of plugin, version of WordPress, and website url along with your message.</p>
</div>
<?php
}

function mlw_dashboard_box_eight()
{
?>
<div>
<table width='100%'>
<tr>
<td align='left'>
Quiz Master Next is and always will be a free plugin. I have spent a lot of time and effort developing and maintaining this plugin. If it has been beneficial to your site, please consider supporting this plugin by making a donation.
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>
<div class="donation">
<p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="RTGYAETX36ZQJ">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
</p>
</div>
</td>
</tr>
</table>
<p>Thank you to those who have contributed so far!</p>
</div>
<?php
}
function mlw_dashboard_box_nine()
{
?>
<div>
<table width='100%'>
<tr>
<td align='left'><iframe src="http://www.mylocalwebstop.com/mlw_news.html?cache=<?php echo rand(); ?>" seamless="seamless" style="width: 100%; height: 550px;"></iframe></td>
</tr>
</table>
</div>
<?php
}
function mlw_qmn_weekly_percent_taken_widget()
{
global $wpdb;
Expand Down Expand Up @@ -812,4 +564,4 @@ function mlw_qmn_quaterly_percent_taken_widget()
</div>
<?php
}
?>
?>
Loading

0 comments on commit f825d8c

Please sign in to comment.