Changeset 1244796
- Timestamp:
- 09/14/2015 05:25:01 AM (10 years ago)
- Location:
- svs-shortlink-analytics/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
svs-shortlink-analytics/trunk/ShortlinkAnalyticsMain.php
r1233974 r1244796 5 5 * Plugin URI: http://svs-websoft.com 6 6 * Description: Generate short links & show link analytics. 7 * Version: 1.0. 07 * Version: 1.0.1 8 8 * Author: SVS WebSoft 9 9 * Author URI: http://svs-websoft.com … … 13 13 require_once "ShortlinkAnalyticsUtils.php"; 14 14 require_once "ShortlinkAnalyticsModel.php"; 15 global $wpdb; 15 16 16 17 /** -
svs-shortlink-analytics/trunk/ShortlinkAnalyticsModel.php
r1113225 r1244796 111 111 $wp_svs_shortlinks = $this->db->prefix . 'svs_shortlinks'; 112 112 $wp_svs_statistics = $this->db->prefix . 'svs_statistics'; 113 $name = esc_sql($_POST['name']); 114 $select_http = esc_sql($_POST['select_http']); 115 $url = esc_sql($_POST['url']); 113 if (empty($_POST)){ 114 return false; 115 } 116 $name = esc_sql(@$_POST['name']); 117 $select_http = esc_sql(@$_POST['select_http']); 118 $url = esc_sql(@$_POST['url']); 116 119 if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { 117 120 $insert_url = $select_http.$url; … … 129 132 $generated_link = get_site_url() . "/" . $randomnumber; 130 133 $this->db->insert( 131 'wp_svs_shortlinks',134 $wp_svs_shortlinks, 132 135 array( 133 136 'name_link' => esc_sql($_POST['name']), … … 193 196 $wp_svs_statistics = $this->db->prefix . 'svs_statistics'; 194 197 195 $id = esc_sql( $_GET['id']);196 $filter = esc_sql( $_GET['filter']);197 $display_range = esc_sql( $_GET['displayRange']);198 $startDate = esc_sql( $_GET['Startdate']);199 $endDate = esc_sql( $_GET['Enddate']);198 $id = esc_sql(@$_GET['id']); 199 $filter = esc_sql(@$_GET['filter']); 200 $display_range = esc_sql(@$_GET['displayRange']); 201 $startDate = esc_sql(@$_GET['Startdate']); 202 $endDate = esc_sql(@$_GET['Enddate']); 200 203 201 204 … … 269 272 private function getCurrentUrl() { 270 273 $pageURL = 'http'; 271 if ( $_SERVER["HTTPS"] == "on") {$pageURL .= "s";}274 if (array_key_exists("HTTPS", $_SERVER) && $_SERVER["HTTPS"] == "on") {$pageURL .= "s";} 272 275 $pageURL .= "://"; 273 276 if ($_SERVER["SERVER_PORT"] != "80") { … … 313 316 $town = (string)((!empty($details_obs->geoplugin_city)) ? $details_obs->geoplugin_city : "Unknown"); 314 317 $this->db->insert( 315 'wp_svs_statistics',318 $wp_svs_statistics, 316 319 array( 317 320 'FK_links' => $id, -
svs-shortlink-analytics/trunk/readme.txt
r1238594 r1244796 41 41 42 42 == Changelog == 43 = 1.0.1 = 44 * Bug fixing. 45 43 46 = 1.0.0 = 44 47 * Initial Release. -
svs-shortlink-analytics/trunk/style/css_svs.css
r1113225 r1244796 44 44 #back_button { 45 45 float:right; 46 top: 20px;47 right: 20px;48 position: absolute;49 46 } 50 47 #filters_svs, #charts_svs { -
svs-shortlink-analytics/trunk/views/statistics.php
r1113225 r1244796 43 43 <?php 44 44 45 $id = esc_sql( $_GET['id']);46 $filter = esc_sql( $_GET['filter']);45 $id = esc_sql(@$_GET['id']); 46 $filter = esc_sql(@$_GET['filter']); 47 47 if (!$filter) { 48 48 $filter = "country"; 49 49 } 50 $displayRange = esc_sql( $_GET['displayRange']);51 $startDate = esc_sql( $_GET['Startdate']);52 $endDate = esc_sql( $_GET['Enddate']);50 $displayRange = esc_sql(@$_GET['displayRange']); 51 $startDate = esc_sql(@$_GET['Startdate']); 52 $endDate = esc_sql(@$_GET['Enddate']); 53 53 $today = date('Y-m-d'); 54 54 $firstday = date('Y-m-01'); … … 60 60 <h2 style="font-size: 20px;padding-top: 40px">Filter by</h2> 61 61 </div> 62 <p <?php if( $_GET['filter'] == 'country' or !$_GET['filter']){ echo "class='selected_filter'"; } ?> >62 <p <?php if(@$_GET['filter'] == 'country' or !@$_GET['filter']){ echo "class='selected_filter'"; } ?> > 63 63 <a href="<?php echo admin_url() . "admin.php?page=svs_shortlink_analytics&Action=View&id=$id&filter=country&displayRange=$displayRange&Startdate=$startDate&Enddate=$endDate"?>">Country</a></p> 64 <p <?php if( $_GET['filter'] == 'town'){ echo "class='selected_filter'"; } ?> >64 <p <?php if(@$_GET['filter'] == 'town'){ echo "class='selected_filter'"; } ?> > 65 65 <a href="<?php echo admin_url() . "admin.php?page=svs_shortlink_analytics&Action=View&id=$id&filter=town&displayRange=$displayRange&Startdate=$startDate&Enddate=$endDate" ?>">City</a></p> 66 <p <?php if( $_GET['filter'] == 'browser'){ echo "class='selected_filter'"; } ?> >66 <p <?php if(@$_GET['filter'] == 'browser'){ echo "class='selected_filter'"; } ?> > 67 67 <a href="<?php echo admin_url() . "admin.php?page=svs_shortlink_analytics&Action=View&id=$id&filter=browser&displayRange=$displayRange&Startdate=$startDate&Enddate=$endDate" ?>">Browser</a></p> 68 <p <?php if( $_GET['filter'] == 'system'){ echo "class='selected_filter'"; } ?> style="border-bottom: 1px solid #E1DBDB;">68 <p <?php if(@$_GET['filter'] == 'system'){ echo "class='selected_filter'"; } ?> style="border-bottom: 1px solid #E1DBDB;"> 69 69 <a href="<?php echo admin_url() . "admin.php?page=svs_shortlink_analytics&Action=View&id=$id&filter=system&displayRange=$displayRange&Startdate=$startDate&Enddate=$endDate" ?>">Operating System</a></p> 70 70 … … 83 83 <label>Select Date:</label> 84 84 <select id="select_sort" onchange="sort()" name="date"> 85 <option <?php if ( $_GET['displayRange'] == 'total') { echo "selected"; }?> value="total">Total</option>86 <option <?php if ( $_GET['displayRange'] == 'thisweek') { echo "selected"; }?> value="thisweek">This Week</option>87 <option <?php if ( $_GET['displayRange'] == 'thismonth') { echo "selected"; }?> value="thismonth">This Month</option>88 <option <?php if ( $_GET['displayRange'] == 'lastmonth') { echo "selected"; }?> value="lastmonth">Last Month</option>89 <option <?php if ( $_GET['displayRange'] == 'custom') { echo "selected"; }?> value="custom">Custom</option>85 <option <?php if (@$_GET['displayRange'] == 'total') { echo "selected"; }?> value="total">Total</option> 86 <option <?php if (@$_GET['displayRange'] == 'thisweek') { echo "selected"; }?> value="thisweek">This Week</option> 87 <option <?php if (@$_GET['displayRange'] == 'thismonth') { echo "selected"; }?> value="thismonth">This Month</option> 88 <option <?php if (@$_GET['displayRange'] == 'lastmonth') { echo "selected"; }?> value="lastmonth">Last Month</option> 89 <option <?php if (@$_GET['displayRange'] == 'custom') { echo "selected"; }?> value="custom">Custom</option> 90 90 </select> 91 91 <div onload id="datepiker" style="display: none;"> … … 108 108 <h2 style="font-size: 20px; text-align: center;">Clicks and Views filter by 109 109 <?php 110 if( $_GET['filter'] == 'country' or !$_GET['filter']){ echo "Country "; }111 else if ( $_GET['filter'] == 'town' or !$_GET['filter']){ echo "City "; }112 else if ( $_GET['filter'] == 'browser' or !$_GET['filter']){ echo "Browser "; }113 else if ( $_GET['filter'] == 'system' or !$_GET['filter']){ echo "Operating System "; }114 if ( $_GET['displayRange'] or $_GET['displayRange'] != "" or$_GET['displayRange'] != "total"){115 if( $_GET['displayRange'] == "thisweek") {110 if(@$_GET['filter'] == 'country' or !@$_GET['filter']){ echo "Country "; } 111 else if (@$_GET['filter'] == 'town' or !@$_GET['filter']){ echo "City "; } 112 else if (@$_GET['filter'] == 'browser' or !@$_GET['filter']){ echo "Browser "; } 113 else if (@$_GET['filter'] == 'system' or !@$_GET['filter']){ echo "Operating System "; } 114 if (@$_GET['displayRange'] or @$_GET['displayRange'] != "" or @$_GET['displayRange'] != "total"){ 115 if(@$_GET['displayRange'] == "thisweek") { 116 116 $start = (date('D') != 'Mon') ? date('Y-m-d', strtotime('last Monday')) : date('Y-m-d'); 117 117 $today = date("Y-m-d"); 118 118 echo " and period: ".$start." / " .$today; 119 }else if( $_GET['displayRange'] == "thismonth") {119 }else if(@$_GET['displayRange'] == "thismonth") { 120 120 echo ": ".date('Y-M'); 121 }else if( $_GET['displayRange'] == "lastmonth") {121 }else if(@$_GET['displayRange'] == "lastmonth") { 122 122 echo ": ".date('Y-M', strtotime(date('Y-m')." -1 month")); 123 }else if( $_GET['displayRange'] == "custom" and $_GET['Startdate'] != "" and$_GET['Enddate'] != "") {123 }else if(@$_GET['displayRange'] == "custom" and @$_GET['Startdate'] != "" and @$_GET['Enddate'] != "") { 124 124 echo " and period: ".$startDate." / " .$endDate; 125 125 } … … 140 140 <th id="title_table_field"> 141 141 <?php 142 $title_filter = esc_sql( $_GET['filter']);142 $title_filter = esc_sql(@$_GET['filter']); 143 143 if (!$title_filter) { 144 144 echo "Country"; … … 163 163 <th id="title_table_field"> 164 164 <?php 165 $title_filter = esc_sql( $_GET['filter']);165 $title_filter = esc_sql(@$_GET['filter']); 166 166 if (!$title_filter) { 167 167 echo "Country";
Note: See TracChangeset
for help on using the changeset viewer.