Minor updates to URL Click-through and Daily Page View graphs.
authorChuck Scott <cscott@gaslightmedia.com>
Fri, 14 Oct 2016 14:30:35 +0000 (10:30 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Fri, 14 Oct 2016 14:30:35 +0000 (10:30 -0400)
Also removed import of daily clicks and views from legacy sites due to that data not being available.

css/admin.css
models/admin/management/import/memberClicksViews.php
views/admin/member/index.html

index c74e49d..6a64ad3 100644 (file)
@@ -419,3 +419,7 @@ input[type=submit], input[type=file] {
     font-weight: bold;
 }
 
+.notice-link
+{
+    cursor: pointer;
+}
\ No newline at end of file
index 7848771..0934525 100644 (file)
@@ -6,7 +6,6 @@
 /*
  * Check all input
  */
-trigger_error('STARTING', E_USER_NOTICE);
 
 // Check hostname
 $dbServer = preg_replace("/[^a-zA-Z0-9\._-]+/", "", trim($_REQUEST['dbServer']));
@@ -86,7 +85,7 @@ if (!$failure) {
 /*
  * Load data from source database
  */
-trigger_error('Memory before: '.memory_get_usage(), E_USER_NOTICE);
+
 // Attempt to get member base data
 if (!$failure) {
     $sql = "
@@ -128,6 +127,9 @@ if (!$failure) {
 
                     // Create or update click entries as needed using a Transaction
                     $this->wpdb->query('BEGIN');
+/*
+ Looking at the data it appears that the old database had some kind of processing that bunched things up by month.
+ Because of that, we're not going to use the day and week counts at this point.
 
                     // Day count - stat_type = 1
                     $this->wpdb->query("
@@ -148,7 +150,7 @@ if (!$failure) {
                         ON DUPLICATE KEY
                             UPDATE clicks = clicks + ".$row['click'].";
                     ");
-
+*/
                     // Month count - stat_type = 3
                     $this->wpdb->query("
                         INSERT INTO ".GLM_MEMBERS_PLUGIN_DB_PREFIX."clickthrough_stats
@@ -168,7 +170,7 @@ if (!$failure) {
 
                     // Create or update click entries as needed using a Transaction
                     $this->wpdb->query('BEGIN');
-
+/*
                     // Day count - stat_type = 1
                     $this->wpdb->query("
                         INSERT INTO ".GLM_MEMBERS_PLUGIN_DB_PREFIX."member_detail_stats
@@ -188,7 +190,7 @@ if (!$failure) {
                         ON DUPLICATE KEY
                             UPDATE clicks = clicks + ".$row['detail'].";
                     ");
-
+*/
                     // Week count - stat_type = 3
                     $this->wpdb->query("
                         INSERT INTO ".GLM_MEMBERS_PLUGIN_DB_PREFIX."member_detail_stats
index 9f4b330..b5f258d 100644 (file)
@@ -53,6 +53,7 @@
         {/foreach}
             </select>
             <div id="clickUpdate" class="button button-secondaryt">Update Graphs</div>
+            <span class="message button notice-link" data-notice='Legacy Websites may not have included retained daily data.-br--br-If this was the case, you will only see daily URL Click-Through counts collected subsequent to the introduction of this site.-br--br-Any monthly count summaries imported from a legacy site should however display on the lower graph.'>?</span>
             &nbsp;&nbsp;&nbsp;&nbsp;<div class="button button-secondary graph-print" data-areaToPrint="urlClicksPrintArea">Print</div>
             <a id="clickExport" class="button button-secondary" href="{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=memberGraphs&graphType=exportClicks&memberId={$member.fieldData.id}&memberSlug={$member.fieldData.member_slug}">Export All Monthly Totals</a>
         </center>
@@ -77,6 +78,7 @@
         {/foreach}
             </select>
             <div id="viewUpdate" class="button button-secondaryt">Update Graphs</div>
+            <span class="message button notice-link" data-notice='Legacy Websites may not have included retained daily data.-br--br-If this was the case, you will only see daily Detail Page View counts collected subsequent to the introduction of this site.-br--br-Any monthly count summaries imported from a legacy site should however display on the lower graph.'>?</span>
             &nbsp;&nbsp;&nbsp;&nbsp;<div class="button button-secondary graph-print" data-areaToPrint="viewsPrintArea">Print</div>
             <a id="viewExport" class="button button-secondary" href="{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=memberGraphs&graphType=exportViews&memberId={$member.fieldData.id}&memberSlug={$member.fieldData.member_slug}">Export All Monthly Totals</a>
         </center>
                 window.location.replace("{$thisUrl}?page={$thisPage}&glm_action=index&member={$memberID}&showArchived=" + checked);                
             });
 
+            $('.message').on('click', function() {
+                var notice = $(this).attr('data-notice');
+                alert(notice.replace(/-br-/g, "\n")); 
+            });
+            
             // Flash certain elements for a short time after display      
             $(".glm-flash-updated").fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500);