Plugin Directory

Changeset 130356


Ignore:
Timestamp:
06/29/2009 04:44:51 AM (17 years ago)
Author:
mithra62
Message:

++Features and Modifications++
Added settings to disable user clicks
Added ignore IP address for click tracking
Added link statistics reset
Added link deletion
Changed graphs to Open Flash Chart
Added additional line chart vectors to display unique clicks
Added link parsing of next and prev template tags
Added link parsing of categories in posts/pages as well as sidebar widget
Added link parsing of tags links template
Improved title extraction to reduce No Name Given auto-label
Added global history and report page

++Bug Fixes++
Click graph date descrepancy issue
Added bypass for external links being double tracked when entered in page
Fixed backwards tracking flags
Changed admin widget ordering to list most clicked to least click
Fixed php short tag usage

Location:
wp-click-track/trunk
Files:
81 added
8 edited

Legend:

Unmodified
Added
Removed
  • wp-click-track/trunk/activation-client.php

    r107117 r130356  
    11<?php
    2 
    32/**
    4 
    53 * Activation Client
    6 
    74 *
    8 
    95 * Performs the POST notification.
    10 
    116 * Should be placed in the same directory as the wp plugin you want to monitor.
    12 
    137 *
    14 
    158 * @author Eric Lamb <[email protected]>
    16 
    179 * @package    wp-activation-counter
    18 
    1910 * @version 0.1
    20 
    2111 * @filesource
    22 
    2312 * @copyright 2009 Eric Lamb.
    24 
    2513 */
    2614
    27 
    28 
    2915if(!function_exists('activation_counter_send_notice')){
    30 
    3116    /**
    32 
    3317     * Sends the activation notice
    34 
    3518     *
    36 
    3719     * @param   string  $url        fully resolved URI to notify activation to
    38 
    3920     * @param   string  $name       plugin name activation is for
    40 
    4121     * @param   string  $version    version of the plugin activation is for
    42 
    4322     * @param   string  $db_version database version for the plugin notice
    44 
    4523     * @param   int     $type       notice type. 1 = activation, 2 = deactivation
    46 
    4724     * @return  void
    48 
    4925     */
    50 
    5126    function activation_counter_send_notice($url, $plugin, $version, $db_version = FALSE, $type = 1){
    52 
    5327       
    54 
    5528        $date = date('r');
    56 
    5729        $ident = md5(get_option('siteurl'));
    58 
    5930        $blogname = get_option('blogname');
    60 
    6131        $blogurl = get_option('siteurl');
    62 
    6332        $email = get_option('admin_email');
    64 
    6533        //return TRUE;
    66 
    6734       
    68 
    6935        $post_data = array (
    70 
    7136            'headers'   => null,
    72 
    7337            'body'      => array(
    74 
    7538                'ident' => $ident,
    76 
    7739                'blogname'  => base64_encode($blogname),
    78 
    7940                'blogurl'   => base64_encode($blogurl),
    80 
    8141                'email'     => base64_encode($email),
    82 
    8342                'type'      => $type,
    84 
    8543                'plugin'    => base64_encode($plugin),
    86 
    8744                'db_version'    => $db_version,
    88 
    8945                'version'   => $version
    90 
    9146            ),
    92 
    9347        );
    9448
    95 
    96 
    9749        wp_remote_post($url, $post_data);
    98 
    9950    }
    100 
    10151}
    102 
    10352?>
  • wp-click-track/trunk/admin.inc.php

    r111387 r130356  
    77 * @author Eric Lamb <[email protected]>
    88 * @package    wp-click-tracker
    9  * @version 0.4.1
     9 * @version 0.5
    1010 * @filesource
    1111 * @copyright 2009 Eric Lamb.
     
    2424
    2525    return $errors;
    26 
    2726}
    2827
     
    118117    <p class="submit"><input type="submit" class="button" name="submit" value="<?php echo $submit_value; ?>" /></p>
    119118    </form>
    120 <?
    121 }
    122 
    123 
    124 /**
    125  * Displays the pie chart for the hour clicks
    126  *
    127  * @param   aray  $result   array() of clicks
    128  * @return  void
    129  */
    130 function wp_click_track_display_pie_hour_chart($result){
    131 
    132     if(!isset($result) || !$result){
    133         return FALSE;
    134     }
    135     $total = count($result);
    136     $js = '';
    137     for($i=0;$i<$total;$i++){
    138         $Hour = ($result[$i]->Hour > 12 ? ($result[$i]->Hour-12).' PM' : $result[$i]->Hour.' AM');
    139         if($Hour == '12 AM'){ $Hour = '12 PM'; }
    140         if($Hour == '0 AM'){ $Hour = '12 AM'; }
    141         $js .= "data.setValue($i, 0, '$Hour');\ndata.setValue($i, 1, ".$result[$i]->Clicks.");\n";
    142     }
    143 ?>
    144 
    145     <script type="text/javascript">
    146       google.load("visualization", "1", {packages:["piechart"]});
    147       google.setOnLoadCallback(drawChart);
    148       function drawChart() {
    149         var data = new google.visualization.DataTable();
    150         data.addColumn('string', 'Hour');
    151         data.addColumn('number', 'Clicks');
    152         data.addRows(<?php echo $total; ?>);
    153         <?php echo $js; ?>
    154 
    155         var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
    156         chart.draw(data, {width: 500, height: 400, is3D: true, title: 'Clicks By Hour', backgroundColor: '#f9f9f9', legend: 'top', legendBackgroundColor: '#f1f1f1'});
    157       }
    158     </script>
    159     <div id="chart_div"></div>
    160     <?
    161 }
    162  
    163 /**
    164  * Displays the pie chart for the day clicks
    165  *
    166  * @param   aray  $result   array() of clicks
    167  * @return  void
    168  */
    169 function wp_click_track_display_pie_day_chart($result){
    170 
    171     if(!isset($result) || !$result){
    172         return FALSE;
    173     }
    174 
    175     $js = '';
    176     $total = count($result);
    177     for($i=0;$i<$total;$i++){
    178         $Day = wp_click_track_date_by_num($i);
    179         $js .= "data.setValue($i, 0, '$Day');\ndata.setValue($i, 1, ".$result[$i].");\n";
    180     }
    181 ?>
    182 
    183     <script type="text/javascript">
    184       google.load("visualization", "1", {packages:["piechart"]});
    185       google.setOnLoadCallback(drawChart);
    186       function drawChart() {
    187         var data = new google.visualization.DataTable();
    188         data.addColumn('string', 'Day');
    189         data.addColumn('number', 'Clicks');
    190         data.addRows(<?php echo $total; ?>);
    191         <?php echo $js; ?>
    192 
    193         var chart = new google.visualization.PieChart(document.getElementById('day_chart_div'));
    194         chart.draw(data, {width: 500, height: 400, is3D: true, title: 'Clicks By Day', backgroundColor: '#f9f9f9', legend: 'top', legendBackgroundColor: '#f1f1f1'});
    195       }
    196     </script>
    197     <div id="day_chart_div"></div>
    198     <?
     119<?php
    199120}
    200121
     
    209130    <strong><p><?php echo $message; ?></p></strong>
    210131</div>
    211 <?
     132<?php
    212133}
    213134
     
    258179    <th nowrap>Total Clicks</th>
    259180    <th nowrap>Unique Clicks</th>
    260     <?
     181    <?php
    261182    if($date_ranges){
    262183    ?>
    263184    <th nowrap>First Click</th>
    264185    <th nowrap>Last Click</th>
    265     <? } ?>
     186    <?php } ?>
    266187</thead>
    267 <?
     188<?php
    268189
    269190    for($i=0;$i<$total;$i++){
     
    271192  </tr>
    272193    <tr>
    273     <td><a href="<?=$_SERVER['PHP_SELF'];?>?page=<?=$_REQUEST['page'];?>&link=<?=$result[$i]->link_id; ?>"><?php echo $result[$i]->link_title;?></a></td>
     194    <td><a href="<?php echo $_SERVER['PHP_SELF'];?>?page=<?php echo $_REQUEST['page'];?>&link=<?php echo $result[$i]->link_id; ?>"><?php echo $result[$i]->link_title;?></a></td>
    274195    <td><a href="<?php echo $result[$i]->link_destination;?>" target="_blank" title="<?php echo $result[$i]->link_title;?>">
    275     <?=(strlen($result[$i]->link_destination) >= 50 ? substr($result[$i]->link_destination,0,50).'...' : $result[$i]->link_destination);?></a></td>
     196    <?php echo (strlen($result[$i]->link_destination) >= 50 ? substr($result[$i]->link_destination,0,50).'...' : $result[$i]->link_destination);?></a></td>
    276197    <td><?php echo number_format_i18n($result[$i]->link_total_clicks);?></td>
    277198    <td><?php echo number_format_i18n($result[$i]->link_unique_clicks);?></td>
    278     <?
     199    <?php
    279200    if($date_ranges){
    280201    ?>
    281202    <td nowrap><?php echo $date_ranges['first_click'];?></td>
    282203    <td nowrap><?php echo $date_ranges['last_click'];?></td>
    283     <? } ?>
     204    <?php } ?>
    284205  </tr>
    285 <?
     206<?php
    286207    }
    287208?>
     
    290211</tbody>
    291212</table>
    292 <?
     213<?php
    293214    if($display_message){
    294215?>
    295216NOTE: Only links that have been clicked are above.
    296 <?
     217<?php
    297218    }
    298219}
     
    306227
    307228    if(substr($_SERVER['PHP_SELF'],-18) == 'wp-admin/index.php' || isset($_REQUEST['page']) && $_REQUEST['page'] == 'wp-click-track/click-tracker.php'){
    308         echo '<script type="text/javascript" src="http://www.google.com/jsapi"></script>';
     229        //echo '<script type="text/javascript" src="http://www.google.com/jsapi"></script>';
    309230    }
    310231}
     
    332253    $referr_data = $wpdb->get_results($sql);
    333254    $count = count($referr_data);
    334 
    335     $page_links = paginate_links( array(
    336         'base' => add_query_arg( 'ref_paged', '%#%#in_refer' ),
    337         'format' => '',
    338         'prev_text' => __('&laquo;'),
    339         'next_text' => __('&raquo;'),
    340         'total' => $numofpages,
    341         'current' => $ref_paged
    342     ));
    343 
    344     if ( $page_links ) {
    345         $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
    346         number_format_i18n( ( $ref_paged - 1 ) * $link_page_total + 1 ),
    347         number_format_i18n( min( $ref_paged * $link_page_total, $total_refer ) ),
    348         number_format_i18n( $total_refer ),
    349         $page_links
    350     );
    351         echo "<div class='tablenav'><div class='tablenav-pages'>$page_links_text</div></div>";
    352     }
     255   
     256    wp_click_track_pagination($numofpages, $ref_paged, $link_page_total, $total_refer, 'refer_data', 'ref_paged');
     257
    353258    ?>
    354259    </td></tr></table>
     
    360265        <th>Referrer</th>
    361266        <th>Date</th>
    362 <?
     267<?php
    363268    if($count >= '1'){
    364269        for($i=0;$i<$count;$i++){
     
    366271      </tr>
    367272        <tr>
    368         <td><a href=""><?=$referr_data[$i]->link_title;?></a></td>
    369         <td><a href="<?php echo $referr_data[$i]->click_refer;?>" target="_blank" title=""><?=(strlen($referr_data[$i]->click_refer) >= 100 ? substr($referr_data[$i]->click_refer,0,100).'...' : $referr_data[$i]->click_refer);?></a></a></td>
    370         <td><?=mysql2date(get_option('date_format').' '.get_option('time_format'),$referr_data[$i]->click_date);?></td>
    371     <?
     273        <td><a href=""><?php echo $referr_data[$i]->link_title;?></a></td>
     274        <td><a href="<?php echo $referr_data[$i]->click_refer;?>" target="_blank" title=""><?php echo (strlen($referr_data[$i]->click_refer) >= 100 ? substr($referr_data[$i]->click_refer,0,100).'...' : $referr_data[$i]->click_refer);?></a></a></td>
     275        <td><?php echo mysql2date(get_option('date_format').' '.get_option('time_format'),$referr_data[$i]->click_date);?></td>
     276    <?php
    372277        }
    373278    } else {
     
    380285
    381286    <?php
    382     if ( $page_links ) {
    383         $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
    384         number_format_i18n( ( $ref_paged - 1 ) * $link_page_total + 1 ),
    385         number_format_i18n( min( $ref_paged * $link_page_total, $total_refer ) ),
    386         number_format_i18n( $total_refer ),
    387         $page_links
    388     );
    389         echo "<div class='tablenav'><div class='tablenav-pages'>$page_links_text</div></div>";
    390     }
     287    wp_click_track_pagination($numofpages, $ref_paged, $link_page_total, $total_refer, 'refer_data', 'ref_paged');
    391288
    392289}
     
    394291function wp_click_track_admin_list_link_page($link_id, $req, $page, $paged, $ref_paged) {
    395292    global $wpdb, $click_tracker_dist_get;
     293
     294    $message = FALSE;
     295    $site_url = get_option( 'siteurl' );
     296
     297    if(isset($_POST['reset_link_clicks']) && $_POST['reset_link_clicks'] == 'yes' && $link_id){
     298
     299        $sql = "DELETE FROM ".$wpdb->prefix . "tracking_clicks WHERE link_id = '$link_id'";
     300        $wpdb->query($sql);
     301
     302        $sql = "UPDATE ".$wpdb->prefix . "tracking_links SET link_total_clicks = '0', link_unique_clicks = '0', last_modified = NOW() WHERE link_id = '$link_id'";
     303        $wpdb->query($sql);
     304
     305        $form_updated = TRUE;
     306        $message = __('Clicks Deleted!','default');
     307    }
     308
     309    if(isset($_POST['reset_single_link']) && $_POST['reset_single_link'] == 'yes' && $link_id){
     310
     311        $sql = "DELETE FROM ".$wpdb->prefix . "tracking_links WHERE link_id = '$link_id'";
     312        $wpdb->query($sql);
     313
     314        $sql = "DELETE FROM ".$wpdb->prefix . "tracking_clicks WHERE link_id = '$link_id'";
     315        $wpdb->query($sql);
     316
     317        $form_updated = TRUE;
     318        $message = __('Link Deleted!','default');
     319       
     320        echo '<script type="text/javascript">window.location.replace("'.$site_url.$_SERVER['PHP_SELF'].'?page='.$_GET['page'].'&link_deleted=yes"); </script>';
     321        exit;
     322    }
    396323
    397324    //base url for the admin page (build new links on top of)
     
    409336
    410337    $total = count($result);
    411 
    412     $site_url = get_option( 'siteurl' );
    413338    $dist_link = $site_url.'?'.$click_tracker_dist_get.'='.$link_id;
    414339
     340    if($form_updated && $message){
     341        wp_click_track_admin_message( $message );
     342    }
    415343    ?>
    416344
     
    430358    </tbody>
    431359    </table>
    432     <?
     360    <?php
    433361    echo '<h3>Link Data</h3>';
    434362    wp_click_track_list_links($result, $total, $date_ranges, FALSE);
     363
     364    wp_click_track_admin_stats($link_id, 30);
    435365
    436366    echo '<table width="100%"><tr><td><a name="in_refer"></a><h3>Top Referrers</h3></td><td>';
     
    451381    $count = count($referr_data);
    452382
    453     $page_links = paginate_links( array(
    454         'base' => add_query_arg( 'ref_paged', '%#%#in_refer' ),
    455         'format' => '',
    456         'prev_text' => __('&laquo;'),
    457         'next_text' => __('&raquo;'),
    458         'total' => $numofpages,
    459         'current' => $ref_paged
    460     ));
    461 
    462     if ( $page_links ) {
    463         $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
    464         number_format_i18n( ( $ref_paged - 1 ) * $link_page_total + 1 ),
    465         number_format_i18n( min( $ref_paged * $link_page_total, $total_refer ) ),
    466         number_format_i18n( $total_refer ),
    467         $page_links
    468     );
    469         echo "<div class='tablenav'><div class='tablenav-pages'>$page_links_text</div></div>";
    470     }
     383    wp_click_track_pagination($numofpages, $ref_paged, $link_page_total, $total_refer, 'in_refer', 'ref_paged');
    471384    ?>
    472385    </td></tr></table>
     
    477390        <th>Count</th>
    478391        <th>Referrer</th>
    479 <?
     392<?php
    480393    if($count >= '1'){
    481394        for($i=0;$i<$count;$i++){
     
    483396      </tr>
    484397        <tr>
    485         <td><?=$referr_data[$i]->REFERCNT;?></td>
    486         <td><a href="<?php echo $referr_data[$i]->click_refer;?>" target="_blank" title=""><?=(strlen($referr_data[$i]->click_refer) >= 125 ? substr($referr_data[$i]->click_refer,0,125).'...' : $referr_data[$i]->click_refer);?></a></a></td>
    487     <?
     398        <td><?php echo $referr_data[$i]->REFERCNT;?></td>
     399        <td><a href="<?php echo $referr_data[$i]->click_refer;?>" target="_blank" title=""><?php echo (strlen($referr_data[$i]->click_refer) >= 125 ? substr($referr_data[$i]->click_refer,0,125).'...' : $referr_data[$i]->click_refer);?></a></a></td>
     400    <?php
    488401        }
    489402    } else {
     
    496409
    497410    <?php
    498     if ( $page_links ) {
    499         $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
    500         number_format_i18n( ( $ref_paged - 1 ) * $link_page_total + 1 ),
    501         number_format_i18n( min( $ref_paged * $link_page_total, $total_refer ) ),
    502         number_format_i18n( $total_refer ),
    503         $page_links
    504     );
    505         echo "<div class='tablenav'><div class='tablenav-pages'>$page_links_text</div></div>";
    506     }
     411    wp_click_track_pagination($numofpages, $ref_paged, $link_page_total, $total_refer, 'in_refer', 'ref_paged');
    507412    ?>
    508413
     
    524429    $numofpages = ceil($total_clicks / $link_page_total);
    525430
    526 
    527     $referr_data = $wpdb->get_results("SELECT COUNT(click_ip) AS IPCNT,click_refer,MIN(click_date) AS min_date, MAX(click_date) AS max_date,click_ip FROM ".$wpdb->prefix."tracking_clicks WHERE link_id = '".$wpdb->escape($link_id)."' GROUP BY click_ip ORDER BY IPCNT DESC LIMIT $limitvalue,$link_page_total");
     431    $sql = "SELECT COUNT(click_ip) AS IPCNT,click_refer,MIN(click_date) AS min_date, MAX(click_date) AS max_date,click_ip FROM ".$wpdb->prefix."tracking_clicks WHERE link_id = '".$wpdb->escape($link_id)."' GROUP BY click_ip ORDER BY IPCNT DESC LIMIT $limitvalue,$link_page_total";
     432    $referr_data = $wpdb->get_results($sql);
    528433    $count = count($referr_data);
    529434
    530     $page_links = paginate_links( array(
    531         'base' => add_query_arg( 'paged', '%#%#in_clicks' ),
    532         'format' => '',
    533         'prev_text' => __('&laquo;'),
    534         'next_text' => __('&raquo;'),
    535         'total' => $numofpages,
    536         'current' => $paged
    537     ));
    538 
    539     if ( $page_links ) {
    540         $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
    541         number_format_i18n( ( $paged - 1 ) * $link_page_total + 1 ),
    542         number_format_i18n( min( $paged * $link_page_total, $total_clicks ) ),
    543         number_format_i18n( $total_clicks ),
    544         $page_links
    545     );
    546 
    547         echo "<div class='tablenav'><div class='tablenav-pages'>$page_links_text</div></div>";
    548     }
     435
     436    wp_click_track_pagination($numofpages, $paged, $link_page_total, $total_clicks, 'in_clicks', 'paged');
    549437    echo '</td></tr></table>';
    550438    ?>
     
    557445        <th>Last Click</th>
    558446        <th>Referrer</th>
    559         <?
     447        <?php
    560448        if($count >= '1'){
    561449            for($i=0;$i<$count;$i++){
     
    563451          </tr>
    564452            <tr>
    565             <td><?=$referr_data[$i]->IPCNT;?></td>
    566             <td><a href="<?php echo $page_url.'&ip='.ip2long($referr_data[$i]->click_ip); ?>"><?=$referr_data[$i]->click_ip;?></a></td>
    567             <td><?=mysql2date(get_option('date_format').' '.get_option('time_format'),$referr_data[$i]->min_date);?></td>
    568             <td><?=mysql2date(get_option('date_format').' '.get_option('time_format'),$referr_data[$i]->max_date);?></td>
    569             <td><?php if($referr_data[$i]->click_refer == ''){ echo 'N/A'; } else { ?> <a href="<?php echo $referr_data[$i]->click_refer;?>" target="_blank" title=""><?=(strlen($referr_data[$i]->click_refer) >= 70 ? substr($referr_data[$i]->click_refer,0,70).'...' : $referr_data[$i]->click_refer);?></a><? } ?></td>
     453            <td><?php echo $referr_data[$i]->IPCNT;?></td>
     454            <td><a href="<?php echo $page_url.'&ip='.ip2long($referr_data[$i]->click_ip); ?>"><?php echo $referr_data[$i]->click_ip;?></a></td>
     455            <td><?php echo mysql2date(get_option('date_format').' '.get_option('time_format'),$referr_data[$i]->min_date);?></td>
     456            <td><?php echo mysql2date(get_option('date_format').' '.get_option('time_format'),$referr_data[$i]->max_date);?></td>
     457            <td><?php if($referr_data[$i]->click_refer == ''){ echo 'N/A'; } else { ?> <a href="<?php echo $referr_data[$i]->click_refer;?>" target="_blank" title=""><?php echo (strlen($referr_data[$i]->click_refer) >= 70 ? substr($referr_data[$i]->click_refer,0,70).'...' : $referr_data[$i]->click_refer);?></a><?php } ?></td>
    570458           
    571         <?
     459        <?php
    572460            }
    573461        } else {
     
    578466        </tbody>
    579467        </table>
    580     <?
    581 
    582     if ( $page_links ) {
    583         $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
    584         number_format_i18n( ( $paged - 1 ) * $link_page_total + 1 ),
    585         number_format_i18n( min( $paged * $link_page_total, $total_clicks ) ),
    586         number_format_i18n( $total_clicks ),
    587         $page_links
    588     );
    589 
    590         echo "<div class='tablenav'><div class='tablenav-pages'>$page_links_text</div></div>";
    591     }
    592 
    593     $sql = "SELECT weekday(click_date) AS Day,COUNT(weekday(click_date)) AS CLICKCOUNT FROM `wp_tracking_clicks` WHERE link_id = '".$wpdb->escape($link_id)."' GROUP BY Day ORDER BY Day";
    594     $result = $wpdb->get_results($sql);
    595     $total_days = count($result);
    596     //unset($result);
    597 
    598     echo '<h3>Clicks by Day</h3>';
    599 
    600     ?>
    601     <table class="widefat comments-box " cellspacing="0">
    602     <thead>
    603         <tr>
    604             <th>Monday</th>
    605             <th>Tuesday</th>
    606             <th>Wednesday</th>
    607             <th>Thursay</th>
    608             <th>Friday</th>
    609             <th>Saturday</th>
    610             <th>Sunday</th>
    611         </tr>
    612     </thead>
    613         <tr>
    614         <?php
    615         $day_results = array();
    616         for($i=0;$i<7;$i++){
    617             if(isset($result[$i]->Day)){
    618                 $day_results[$result[$i]->Day] = $result[$i]->CLICKCOUNT;
    619             }
    620         }
    621         for($i=0;$i<7;$i++){
    622             if(!array_key_exists($i,$day_results)){
    623                 $day_results[$i] = 0;
    624             }
    625             echo '<td>'.number_format_i18n($day_results[$i]).'</td>';
    626          } ?>
    627         </tr>
    628     <tbody id="the-comment-list" class="list:comment">
    629     </tbody>
    630     </table>
    631 
    632     <?
    633 
    634     $sql = "SELECT HOUR(click_date) AS Hour,COUNT(HOUR(click_date)) AS Clicks FROM `wp_tracking_clicks` WHERE link_id = '".$wpdb->escape($link_id)."' GROUP BY Hour ORDER BY Hour";
    635     $result = $wpdb->get_results($sql);
    636     $total_hours = count($result);
    637     //unset($result);
    638 
    639     echo '<h3>Clicks by Hour</h3>';
    640 
    641     ?>
    642     <table class="widefat comments-box " cellspacing="0">
    643     <thead>
    644         <tr>
    645         <?
    646             $append = 'AM';
    647             for($i=0;$i<12;$i++){
    648                 $hour = ($i == '0' ? '12' : $i);
    649                 echo "<th>$hour $append</th>";
    650             }
    651         ?>
    652         </tr>
    653         <tr>
    654         <?
    655             for($i=0;$i<12;$i++){
    656                 //check for hour ending
    657                 $Clicks = 0;
    658                 foreach($result AS $key => $value){
    659                     if($i > 12){
    660                         break;
    661                     }
    662 
    663                     if($value->Hour == $i){
    664                         $Clicks = $value->Clicks;
    665                     }
    666                 }
    667         ?>
    668             <td><?=number_format_i18n($Clicks);?></td>
     468    <?php
     469
     470    wp_click_track_pagination($numofpages, $paged, $link_page_total, $total_clicks, 'in_clicks', 'paged');
     471
     472    ?>
     473        <br />
     474        <table width="200" ><tr><td>
    669475           
    670         <?
    671             }
    672         ?>
    673         </tr>
    674 
    675         <tbody id="the-comment-list" class="list:comment">
    676         </tbody>
     476            <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo $_REQUEST['page'];?>&link=<?php echo $link_id; ?>">
     477            <input type="hidden" name="reset_link_clicks" value="yes" \>
     478            <input type="hidden" name="link" value="<?php echo $link_id; ?>" \>
     479            <input type="submit" name="Submit" class="button-primary" value="Reset All Clicks" onclick="javascript: return confirm('Are you sure you want to reset all the clicks for this link? \nThis deletes all click records...')"/>
     480            </form>
     481        </td>
     482        <td>
     483
     484            <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo $_REQUEST['page'];?>">
     485            <input type="hidden" name="reset_single_link" value="yes" \>
     486            <input type="hidden" name="link" value="<?php echo $link_id; ?>" \>
     487            <input type="submit" name="Submit" class="button-primary" value="Delete Link" onclick="javascript: return confirm('Are you sure you want to delete this link? \nThis can not be undone...')"/>
     488            </form>
     489        </td>
     490        </tr>
    677491        </table>
    678 
    679         <br \>
    680 
    681 
    682     <table class="widefat comments-box " cellspacing="0">
    683     <thead>
    684         <tr>
    685         <?
    686             $append = 'PM';
    687             for($i=0;$i<12;$i++){
    688                 $hour = ($i == '0' ? '12' : $i);
    689                 echo "<th>$hour $append</th>";
    690             }
    691         ?>
    692         </tr>
    693         <tr>
    694         <?
    695             for($i=0;$i<12;$i++){
    696                 //check for hour ending
    697                 $Clicks = 0;
    698                 foreach($result AS $key => $value){
    699 
    700                     if($value->Hour == $i+12){
    701                         $Clicks = $value->Clicks;
    702                     }
    703                 }
    704         ?>
    705             <td><?=number_format_i18n($Clicks);?></td>
    706            
    707         <?
    708             }
    709         ?>
    710         </tr>
    711 
    712         <tbody id="the-comment-list" class="list:comment">
    713         </tbody>
    714         </table>
    715 
    716         <table width="100%" align="center">
    717         <tr>
    718             <td align="center"><? wp_click_track_display_pie_hour_chart($result); ?></td>
    719             <td align="center"><? wp_click_track_display_pie_day_chart($day_results); ?></td>
    720         </td>
    721         </table>
    722 
    723     <?
     492        <br />
     493    <?php
    724494}
    725495
     
    750520        echo '</td><td align="right">';
    751521
    752         $page_links = paginate_links( array(
    753             'base' => add_query_arg( 'paged', '%#%' ),
    754             'format' => '',
    755             'prev_text' => __('&laquo;'),
    756             'next_text' => __('&raquo;'),
    757             'total' => $numofpages,
    758             'current' => $paged
    759         ));
    760 
    761         if ( $page_links ) {
    762             $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
    763             number_format_i18n( ( $paged - 1 ) * $link_page_total + 1 ),
    764             number_format_i18n( min( $paged * $link_page_total, $total_links ) ),
    765             number_format_i18n( $total_links ),
    766             $page_links
    767         );
    768 
    769             echo "<div class='tablenav'><div class='tablenav-pages'>$page_links_text</div></div>";
    770         }
     522        wp_click_track_pagination($numofpages, $paged, $link_page_total, $total_links, '', 'paged');
    771523        echo '</td></tr></table>';
    772524
    773525        wp_click_track_list_links($result, $select_total,FALSE,FALSE);
    774526
    775          if ( $page_links ) {
    776             $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
    777             number_format_i18n( ( $paged - 1 ) * $link_page_total + 1 ),
    778             number_format_i18n( min( $paged * $link_page_total, $total_links ) ),
    779             number_format_i18n( $total_links ),
    780             $page_links
    781         );
    782 
    783             echo "<div class='tablenav'><div class='tablenav-pages'>$page_links_text</div></div>";
    784         }
     527        wp_click_track_pagination($numofpages, $paged, $link_page_total, $total_links, '', 'paged');
    785528
    786529    } else {
     
    794537    </div>
    795538
    796     <?
    797 
    798     $date = date("Y-m-d",mktime(0, 0, 0, date("m")  , date("d")-30, date("Y")));
    799     $sql = "SELECT COUNT(tc.link_id) AS click_count, date_format(click_date,\"%Y-%m-%d\") AS click_date_f FROM wp_tracking_clicks tc, wp_tracking_links tl WHERE tc.link_id = tl.link_id AND date_format(click_date,\"%Y-%m-%d\") >= '$date' GROUP BY click_date_f ORDER BY click_date ";
    800 
    801     $result = $wpdb->get_results($sql);
    802     $total = count($result);
    803     $dates = array();
    804     $clicks = array();
    805     for($i=0;$i<$total;$i++){
    806         $dates[$i] = "data.setCell($i, 0, '".mysql2date(get_option('date_format'),$result[$i]->click_date_f)."');";
    807         $clicks[$i] = "data.setCell($i, 1, ".$result[$i]->click_count.");";
    808     }
    809 
    810     ?>
    811     <script type="text/javascript">
    812       google.load("visualization", "1", {packages:["linechart"]});
    813       google.setOnLoadCallback(drawChart);
    814       function drawChart() {
    815       var data = new google.visualization.DataTable();
    816       data.addColumn('string', 'Date');
    817       data.addColumn('number', 'Clicks');
    818       data.addRows(<?php echo $total; ?>);
    819       <?php echo implode("\n",$dates); ?>
    820       <?php echo implode("\n",$clicks); ?>
    821 
    822 
    823         var chart = new google.visualization.LineChart(document.getElementById('click_chart_div'));
    824         chart.draw(data, {width: 950, height: 300, legend: 'bottom', title: 'Click Tracks by Date'});
    825       }
    826     </script>
    827 
    828     <div id='click_chart_div' style='width: 650px; height: 240px;' align="center"></div>
    829 
    830539    <div style="height:100px"></div>
    831     <?
     540    <?php
    832541}
    833542
     
    838547    global $wpdb;
    839548
    840     $date = date("Y-m-d",mktime(0, 0, 0, date("m")  , date("d")-14, date("Y")));
    841     $sql = "SELECT COUNT(tc.link_id) AS click_count, date_format(click_date,\"%Y-%m-%d\") AS click_date_f FROM wp_tracking_clicks tc, wp_tracking_links tl WHERE tc.link_id = tl.link_id AND date_format(click_date,\"%Y-%m-%d\") >= '$date' GROUP BY click_date_f ORDER BY click_date ";
    842 
    843     $result = $wpdb->get_results($sql);
    844     $total = count($result);
    845     $dates = array();
    846     $clicks = array();
    847     for($i=0;$i<$total;$i++){
    848         $dates[$i] = "data.setCell($i, 0, '".mysql2date(get_option('date_format'),$result[$i]->click_date_f)."');";
    849         $clicks[$i] = "data.setCell($i, 1, ".$result[$i]->click_count.");";
    850     }
    851 
    852     ?>
    853     <script type="text/javascript">
    854       google.load("visualization", "1", {packages:["linechart"]});
    855       google.setOnLoadCallback(drawChart);
    856       function drawChart() {
    857       var data = new google.visualization.DataTable();
    858       data.addColumn('string', 'Date');
    859       data.addColumn('number', 'Clicks');
    860       data.addRows(<?php echo $total; ?>);
    861       <?php echo implode("\n",$dates); ?>
    862       <?php echo implode("\n",$clicks); ?>
    863 
    864 
    865         var chart = new google.visualization.LineChart(document.getElementById('click_chart_div'));
    866         chart.draw(data, {width: 500, height: 240, legend: 'bottom', title: 'Click Tracks by Date'});
    867       }
    868     </script>
    869 
    870     <div id='click_chart_div' style='width: 650px; height: 240px;'></div>
     549
     550    $site_url = get_option( 'siteurl' );
     551    include_once dirname(__FILE__).'/open-flash-chart/php-ofc-library/open_flash_chart_object.php';
     552    open_flash_chart_object( 498, 225, $site_url .'/wp-admin/index.php?wp_ofc=true&range=14', FALSE, $site_url.'/wp-content/plugins/wp-click-track/open-flash-chart/');
     553    ?>
    871554
    872555    <div id="stats-info">
     
    890573        <td width="50%" valign="top"><h4 class="heading">Todays Clicks</h4>
    891574        <?php
    892         $sql = "SELECT COUNT(click_id) AS click_count,wp_tracking_clicks.link_id AS link_id, date_format(click_date,\"%Y-%m-%d\") AS click_date, link_title, link_destination, click_refer FROM wp_tracking_links,wp_tracking_clicks WHERE wp_tracking_links.link_id = wp_tracking_clicks.link_id AND date_format(click_date,\"%Y-%m-%d\") = '$date' AND click_refer != '' GROUP BY wp_tracking_clicks.link_id ORDER BY click_count LIMIT 8";
     575        $sql = "SELECT COUNT(click_id) AS click_count,".$wpdb->prefix."tracking_clicks.link_id AS link_id, date_format(click_date,\"%Y-%m-%d\") AS click_date, link_title, link_destination, click_refer FROM ".$wpdb->prefix."tracking_links,".$wpdb->prefix."tracking_clicks WHERE ".$wpdb->prefix."tracking_links.link_id = ".$wpdb->prefix."tracking_clicks.link_id AND date_format(click_date,\"%Y-%m-%d\") = '$date' AND click_refer != '' GROUP BY ".$wpdb->prefix."tracking_clicks.link_id ORDER BY click_count DESC LIMIT 8";
    893576
    894577        $result = $wpdb->get_results($sql);
     
    912595    </div>
    913596    </div>
    914 
    915     <?
    916     //$clicks = wp_click_track_get_clicks(" tc, ".$wpdb->prefix."tracking_links tl WHERE tl.link_id = tc.link_id AND click_date "
     597    <?php
     598}
     599
     600function wp_click_track_apply_data_hack(){
     601    global $wpdb;
     602
     603    //check if hack has been applied yet. Get rid of user if it has...
     604    $plugin_options = get_option('click_tracker');
     605    if(!array_key_exists('data_hack_applied',$plugin_options)){
     606
     607        //grab all the unique links
     608        //0 = unique; should be 1
     609        $sql = "SELECT click_id FROM ".$wpdb->prefix."tracking_clicks WHERE unique_click = '0' ";
     610        $result = $wpdb->get_results($sql);
     611        $total = count($result);
     612
     613        //update all rows to be unique clicks
     614        $sql = "UPDATE ".$wpdb->prefix."tracking_clicks SET unique_click = '0'";
     615        $execute = $wpdb->get_results($sql);
     616
     617        //now update the links in memory to be
     618        for($i=0;$i<$total;$i++){
     619            $sql = "UPDATE ".$wpdb->prefix."tracking_clicks SET unique_click = '1' WHERE click_id = '".$result[$i]->click_id."'";
     620
     621            //echo $sql.'<br>';
     622            $change_result = $wpdb->get_results($sql);
     623        }
     624        //exit;
     625    }
    917626}
    918627
  • wp-click-track/trunk/ajax.js

    r107117 r130356  
    11/* Simple AJAX Code-Kit (SACK) v1.6.1 */
    2 
    32/* ©2005 Gregory Wild-Smith */
    4 
    53/* www.twilightuniverse.com */
    6 
    74/* Software licenced under a modified X11 licence,
    8 
    95   see documentation or authors website for more details */
    106
    11 
    12 
    137function sack(file) {
    14 
    158    this.xmlhttp = null;
    169
    17 
    18 
    1910    this.resetData = function() {
    20 
    2111        this.method = "POST";
    22 
    2312        this.queryStringSeparator = "?";
    24 
    2513        this.argumentSeparator = "&";
    26 
    2714        this.URLString = "";
    28 
    2915        this.encodeURIString = true;
    30 
    3116        this.execute = false;
    32 
    3317        this.element = null;
    34 
    3518        this.elementObj = null;
    36 
    3719        this.requestFile = file;
    38 
    3920        this.vars = new Object();
    40 
    4121        this.responseStatus = new Array(2);
    42 
    4322    };
    4423
    45 
    46 
    4724    this.resetFunctions = function() {
    48 
    4925        this.onLoading = function() { };
    50 
    5126        this.onLoaded = function() { };
    52 
    5327        this.onInteractive = function() { };
    54 
    5528        this.onCompletion = function() { };
    56 
    5729        this.onError = function() { };
    58 
    5930        this.onFail = function() { };
    60 
    6131    };
    6232
    63 
    64 
    6533    this.reset = function() {
    66 
    6734        this.resetFunctions();
    68 
    6935        this.resetData();
    70 
    7136    };
    7237
     38    this.createAJAX = function() {
     39        try {
     40            this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
     41        } catch (e1) {
     42            try {
     43                this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
     44            } catch (e2) {
     45                this.xmlhttp = null;
     46            }
     47        }
    7348
     49        if (! this.xmlhttp) {
     50            if (typeof XMLHttpRequest != "undefined") {
     51                this.xmlhttp = new XMLHttpRequest();
     52            } else {
     53                this.failed = true;
     54            }
     55        }
     56    };
    7457
    75     this.createAJAX = function() {
     58    this.setVar = function(name, value){
     59        this.vars[name] = Array(value, false);
     60    };
    7661
    77         try {
     62    this.encVar = function(name, value, returnvars) {
     63        if (true == returnvars) {
     64            return Array(encodeURIComponent(name), encodeURIComponent(value));
     65        } else {
     66            this.vars[encodeURIComponent(name)] = Array(encodeURIComponent(value), true);
     67        }
     68    }
    7869
    79             this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
     70    this.processURLString = function(string, encode) {
     71        encoded = encodeURIComponent(this.argumentSeparator);
     72        regexp = new RegExp(this.argumentSeparator + "|" + encoded);
     73        varArray = string.split(regexp);
     74        for (i = 0; i < varArray.length; i++){
     75            urlVars = varArray[i].split("=");
     76            if (true == encode){
     77                this.encVar(urlVars[0], urlVars[1]);
     78            } else {
     79                this.setVar(urlVars[0], urlVars[1]);
     80            }
     81        }
     82    }
    8083
    81         } catch (e1) {
     84    this.createURLString = function(urlstring) {
     85        if (this.encodeURIString && this.URLString.length) {
     86            this.processURLString(this.URLString, true);
     87        }
    8288
    83             try {
     89        if (urlstring) {
     90            if (this.URLString.length) {
     91                this.URLString += this.argumentSeparator + urlstring;
     92            } else {
     93                this.URLString = urlstring;
     94            }
     95        }
    8496
    85                 this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
     97        // prevents caching of URLString
     98        this.setVar("rndval", new Date().getTime());
    8699
    87             } catch (e2) {
    88 
    89                 this.xmlhttp = null;
    90 
     100        urlstringtemp = new Array();
     101        for (key in this.vars) {
     102            if (false == this.vars[key][1] && true == this.encodeURIString) {
     103                encoded = this.encVar(key, this.vars[key][0], true);
     104                delete this.vars[key];
     105                this.vars[encoded[0]] = Array(encoded[1], true);
     106                key = encoded[0];
    91107            }
    92108
     109            urlstringtemp[urlstringtemp.length] = key + "=" + this.vars[key][0];
    93110        }
     111        if (urlstring){
     112            this.URLString += this.argumentSeparator + urlstringtemp.join(this.argumentSeparator);
     113        } else {
     114            this.URLString += urlstringtemp.join(this.argumentSeparator);
     115        }
     116    }
    94117
     118    this.runResponse = function() {
     119        eval(this.response);
     120    }
    95121
     122    this.runAJAX = function(urlstring) {
     123        if (this.failed) {
     124            this.onFail();
     125        } else {
     126            this.createURLString(urlstring);
     127            if (this.element) {
     128                this.elementObj = document.getElementById(this.element);
     129            }
     130            if (this.xmlhttp) {
     131                var self = this;
     132                if (this.method == "GET") {
     133                    totalurlstring = this.requestFile + this.queryStringSeparator + this.URLString;
     134                    this.xmlhttp.open(this.method, totalurlstring, true);
     135                } else {
     136                    this.xmlhttp.open(this.method, this.requestFile, true);
     137                    try {
     138                        this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
     139                    } catch (e) { }
     140                }
    96141
    97         if (! this.xmlhttp) {
     142                this.xmlhttp.onreadystatechange = function() {
     143                    switch (self.xmlhttp.readyState) {
     144                        case 1:
     145                            self.onLoading();
     146                            break;
     147                        case 2:
     148                            self.onLoaded();
     149                            break;
     150                        case 3:
     151                            self.onInteractive();
     152                            break;
     153                        case 4:
     154                            self.response = self.xmlhttp.responseText;
     155                            self.responseXML = self.xmlhttp.responseXML;
     156                            self.responseStatus[0] = self.xmlhttp.status;
     157                            self.responseStatus[1] = self.xmlhttp.statusText;
    98158
    99             if (typeof XMLHttpRequest != "undefined") {
     159                            if (self.execute) {
     160                                self.runResponse();
     161                            }
    100162
    101                 this.xmlhttp = new XMLHttpRequest();
     163                            if (self.elementObj) {
     164                                elemNodeName = self.elementObj.nodeName;
     165                                elemNodeName.toLowerCase();
     166                                if (elemNodeName == "input"
     167                                || elemNodeName == "select"
     168                                || elemNodeName == "option"
     169                                || elemNodeName == "textarea") {
     170                                    self.elementObj.value = self.response;
     171                                } else {
     172                                    self.elementObj.innerHTML = self.response;
     173                                }
     174                            }
     175                            if (self.responseStatus[0] == "200") {
     176                                self.onCompletion();
     177                            } else {
     178                                self.onError();
     179                            }
    102180
    103             } else {
     181                            self.URLString = "";
     182                            break;
     183                    }
     184                };
    104185
    105                 this.failed = true;
    106 
     186                this.xmlhttp.send(this.URLString);
    107187            }
    108 
    109188        }
    110 
    111189    };
    112190
    113 
    114 
    115     this.setVar = function(name, value){
    116 
    117         this.vars[name] = Array(value, false);
    118 
    119     };
    120 
    121 
    122 
    123     this.encVar = function(name, value, returnvars) {
    124 
    125         if (true == returnvars) {
    126 
    127             return Array(encodeURIComponent(name), encodeURIComponent(value));
    128 
    129         } else {
    130 
    131             this.vars[encodeURIComponent(name)] = Array(encodeURIComponent(value), true);
    132 
    133         }
    134 
    135     }
    136 
    137 
    138 
    139     this.processURLString = function(string, encode) {
    140 
    141         encoded = encodeURIComponent(this.argumentSeparator);
    142 
    143         regexp = new RegExp(this.argumentSeparator + "|" + encoded);
    144 
    145         varArray = string.split(regexp);
    146 
    147         for (i = 0; i < varArray.length; i++){
    148 
    149             urlVars = varArray[i].split("=");
    150 
    151             if (true == encode){
    152 
    153                 this.encVar(urlVars[0], urlVars[1]);
    154 
    155             } else {
    156 
    157                 this.setVar(urlVars[0], urlVars[1]);
    158 
    159             }
    160 
    161         }
    162 
    163     }
    164 
    165 
    166 
    167     this.createURLString = function(urlstring) {
    168 
    169         if (this.encodeURIString && this.URLString.length) {
    170 
    171             this.processURLString(this.URLString, true);
    172 
    173         }
    174 
    175 
    176 
    177         if (urlstring) {
    178 
    179             if (this.URLString.length) {
    180 
    181                 this.URLString += this.argumentSeparator + urlstring;
    182 
    183             } else {
    184 
    185                 this.URLString = urlstring;
    186 
    187             }
    188 
    189         }
    190 
    191 
    192 
    193         // prevents caching of URLString
    194 
    195         this.setVar("rndval", new Date().getTime());
    196 
    197 
    198 
    199         urlstringtemp = new Array();
    200 
    201         for (key in this.vars) {
    202 
    203             if (false == this.vars[key][1] && true == this.encodeURIString) {
    204 
    205                 encoded = this.encVar(key, this.vars[key][0], true);
    206 
    207                 delete this.vars[key];
    208 
    209                 this.vars[encoded[0]] = Array(encoded[1], true);
    210 
    211                 key = encoded[0];
    212 
    213             }
    214 
    215 
    216 
    217             urlstringtemp[urlstringtemp.length] = key + "=" + this.vars[key][0];
    218 
    219         }
    220 
    221         if (urlstring){
    222 
    223             this.URLString += this.argumentSeparator + urlstringtemp.join(this.argumentSeparator);
    224 
    225         } else {
    226 
    227             this.URLString += urlstringtemp.join(this.argumentSeparator);
    228 
    229         }
    230 
    231     }
    232 
    233 
    234 
    235     this.runResponse = function() {
    236 
    237         eval(this.response);
    238 
    239     }
    240 
    241 
    242 
    243     this.runAJAX = function(urlstring) {
    244 
    245         if (this.failed) {
    246 
    247             this.onFail();
    248 
    249         } else {
    250 
    251             this.createURLString(urlstring);
    252 
    253             if (this.element) {
    254 
    255                 this.elementObj = document.getElementById(this.element);
    256 
    257             }
    258 
    259             if (this.xmlhttp) {
    260 
    261                 var self = this;
    262 
    263                 if (this.method == "GET") {
    264 
    265                     totalurlstring = this.requestFile + this.queryStringSeparator + this.URLString;
    266 
    267                     this.xmlhttp.open(this.method, totalurlstring, true);
    268 
    269                 } else {
    270 
    271                     this.xmlhttp.open(this.method, this.requestFile, true);
    272 
    273                     try {
    274 
    275                         this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
    276 
    277                     } catch (e) { }
    278 
    279                 }
    280 
    281 
    282 
    283                 this.xmlhttp.onreadystatechange = function() {
    284 
    285                     switch (self.xmlhttp.readyState) {
    286 
    287                         case 1:
    288 
    289                             self.onLoading();
    290 
    291                             break;
    292 
    293                         case 2:
    294 
    295                             self.onLoaded();
    296 
    297                             break;
    298 
    299                         case 3:
    300 
    301                             self.onInteractive();
    302 
    303                             break;
    304 
    305                         case 4:
    306 
    307                             self.response = self.xmlhttp.responseText;
    308 
    309                             self.responseXML = self.xmlhttp.responseXML;
    310 
    311                             self.responseStatus[0] = self.xmlhttp.status;
    312 
    313                             self.responseStatus[1] = self.xmlhttp.statusText;
    314 
    315 
    316 
    317                             if (self.execute) {
    318 
    319                                 self.runResponse();
    320 
    321                             }
    322 
    323 
    324 
    325                             if (self.elementObj) {
    326 
    327                                 elemNodeName = self.elementObj.nodeName;
    328 
    329                                 elemNodeName.toLowerCase();
    330 
    331                                 if (elemNodeName == "input"
    332 
    333                                 || elemNodeName == "select"
    334 
    335                                 || elemNodeName == "option"
    336 
    337                                 || elemNodeName == "textarea") {
    338 
    339                                     self.elementObj.value = self.response;
    340 
    341                                 } else {
    342 
    343                                     self.elementObj.innerHTML = self.response;
    344 
    345                                 }
    346 
    347                             }
    348 
    349                             if (self.responseStatus[0] == "200") {
    350 
    351                                 self.onCompletion();
    352 
    353                             } else {
    354 
    355                                 self.onError();
    356 
    357                             }
    358 
    359 
    360 
    361                             self.URLString = "";
    362 
    363                             break;
    364 
    365                     }
    366 
    367                 };
    368 
    369 
    370 
    371                 this.xmlhttp.send(this.URLString);
    372 
    373             }
    374 
    375         }
    376 
    377     };
    378 
    379 
    380 
    381191    this.reset();
    382 
    383192    this.createAJAX();
    384 
    385193}
    386 
  • wp-click-track/trunk/click-tracker.php

    r111387 r130356  
    77 * @author Eric Lamb <[email protected]>
    88 * @package    wp-click-tracker
    9  * @version 0.4.2
     9 * @version 0.5
    1010 * @filesource
    1111 * @copyright 2009 Eric Lamb.
     
    1313/*
    1414Plugin Name: WP-Click-Tracker
    15 Plugin URI: http://blog.ericlamb.net/wp-click-track/
     15Plugin URI: http://blog.ericlamb.net/projects/wp-click-track/
    1616Description: Tracks all links in posts.
    17 Version: 0.4.2
     17Version: 0.5
    1818Author: Eric Lamb
    1919Author URI: http://blog.ericlamb.net
     
    3636    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    3737*/
    38 
     38///error_reporting(E_ALL);
    3939/*
    4040
     
    4848 * @global string   $click_tracker_version
    4949 */
    50 $click_tracker_version = "0.4.2";
     50$click_tracker_version = "0.5";
    5151
    5252/**
     
    9090function wp_click_tracker_extract_urls($content){
    9191
    92     preg_match_all('/<a[^>]+>/i',$content,$links_html);
     92    preg_match_all('/<a (.*?)href=[\'\"](.*?)\/\/([^\'\"]+?)[\'\"](.*?)>(.*?)<\/a>/i',$content,$links_html);
     93    //print_r($links_html);
    9394    $total = count($links_html['0']);
    9495    $links = array();
     
    107108            $links[$i]['title'] = str_replace(array('"','\''),'',$link_meta['2']['0']);
    108109        }
     110
     111        //check if title is blank and try and extract the content
     112        if(trim($links[$i]['title']) == ''){
     113            $links[$i]['title'] = strip_tags($links_html['0'][$i]);
     114        }
    109115    }
    110116    return $links;
     
    118124 */
    119125function wp_click_tracker_replace_uris($content){
     126    global $click_tracker_dist_get;
    120127
    121128    $links = wp_click_tracker_extract_urls($content);
     
    143150            $parse_ok = FALSE;
    144151        }
     152
     153        if(strpos($_links[$i]['href'], $click_tracker_dist_get.'=') === TRUE){ //check if link is external click track
     154            $parse_ok = FALSE;
     155        }
    145156       
    146157        if($parse_ok){
    147             $_new_links = $_links[$i]['href'].'" onclick="javascript:TrackClick(\''.urlencode(trim($_links[$i]['href'])).'\',\''.urlencode(trim($_links[$i]['title'])).'\')"';
     158            $_new_links = $_links[$i]['href'].'" onclick="return TrackClick(\''.urlencode(trim($_links[$i]['href'])).'\',\''.urlencode(trim($_links[$i]['title'])).'\')"';
    148159            $new_content = str_replace($_links[$i]['href'].'"',$_new_links,$new_content);
    149160            $new_content = str_replace($_links[$i]['href']."'",$_new_links,$new_content);
     
    183194            ajax[index].onCompletion = null;
    184195            ajax[index].runAJAX();
    185             return true;
     196
     197            //alert(ajax[index].requestFile);
     198            return FALSE;
    186199        }
    187200    </script>
     
    201214    //$_GET['wp_click_tracked'] is used for internally created links
    202215    $forward_to_url = FALSE;
     216    $track_click = TRUE;
    203217    if(isset($_GET['wp_click_tracked']) || isset($_GET[$click_tracker_dist_get])){ //looks like we have a tracking link...
    204218       
    205         if(isset($_GET[$click_tracker_dist_get])){
     219        if(isset($_GET[$click_tracker_dist_get]) ){
     220
     221           
    206222
    207223            $link_id = (int)$_GET[$click_tracker_dist_get];
     
    243259        }
    244260
    245         $click_refer = $_SERVER['HTTP_REFERER'];
    246         $stat_ip  =  $_SERVER['REMOTE_ADDR'];
    247 
    248         if(isset($_COOKIE["el_$link_id"])){
    249 
    250             $sql = "INSERT INTO ".$wpdb->prefix."tracking_clicks SET link_id = '".$wpdb->escape($link_id)."' , click_refer = '".$wpdb->escape($click_refer)."', unique_click = '1', click_date = now(), click_ip = '".$wpdb->escape($stat_ip)."'";
    251             $wpdb->query($sql);
    252 
    253             $sql = "UPDATE ".$wpdb->prefix."tracking_links SET link_total_clicks = link_total_clicks+1  WHERE link_id = '".$wpdb->escape($link_id)."' ";
    254             $wpdb->query($sql);
    255            
    256         } else {
    257 
    258             setcookie("el_$link_id", $link_id, time()+86400);
    259             $sql = "UPDATE ".$wpdb->prefix."tracking_links SET link_total_clicks = link_total_clicks+1, link_unique_clicks = link_unique_clicks+1 WHERE link_id = '".$wpdb->escape($link_id)."' ";
    260             $wpdb->query($sql);
    261 
    262             $sql = "INSERT INTO ".$wpdb->prefix."tracking_clicks SET link_id = '".$wpdb->escape($link_id)."' , click_refer = '".$wpdb->escape($click_refer)."', unique_click = '0', click_date = now(), click_ip = '".$wpdb->escape($stat_ip)."'";
    263             $wpdb->query($sql);
    264 
     261        $click_refer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : FALSE);
     262        $stat_ip  =  (isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : FALSE);
     263
     264        $plugin_options = get_option('click_tracker');
     265
     266        if($plugin_options['track_user_clicks'] == '0'){ //check if we're supposed to track user clicks
     267            if(is_user_logged_in()) {
     268                $track_click = FALSE;
     269            }
     270        }
     271
     272        //check the IP address white listing
     273        $wl_ips = array_map('trim',explode("\n", $plugin_options['exclude_ips']));
     274        if(in_array($stat_ip,$wl_ips)){
     275            $track_click = FALSE;
     276        }
     277
     278        if($track_click){
     279            if(isset($_COOKIE["el_{$link_id}"])){
     280
     281                $sql = "INSERT INTO ".$wpdb->prefix."tracking_clicks SET link_id = '".$wpdb->escape($link_id)."' , click_refer = '".$wpdb->escape($click_refer)."', unique_click = '0', click_date = now(), click_ip = '".$wpdb->escape($stat_ip)."'";
     282                $wpdb->query($sql);
     283
     284                $sql = "UPDATE ".$wpdb->prefix."tracking_links SET link_total_clicks = link_total_clicks+1  WHERE link_id = '".$wpdb->escape($link_id)."' ";
     285                $wpdb->query($sql);
     286               
     287            } else {
     288
     289                setcookie("el_$link_id", $link_id, time()+86400, SITECOOKIEPATH, COOKIE_DOMAIN, false, true);
     290               
     291                $sql = "UPDATE ".$wpdb->prefix."tracking_links SET link_total_clicks = link_total_clicks+1, link_unique_clicks = link_unique_clicks+1 WHERE link_id = '".$wpdb->escape($link_id)."' ";
     292                $wpdb->query($sql);
     293
     294                $sql = "INSERT INTO ".$wpdb->prefix."tracking_clicks SET link_id = '".$wpdb->escape($link_id)."' , click_refer = '".$wpdb->escape($click_refer)."', unique_click = '1', click_date = now(), click_ip = '".$wpdb->escape($stat_ip)."'";
     295                $wpdb->query($sql);
     296
     297            }
    265298        }
    266299
     
    297330<div class="inside">
    298331
    299 <? 
     332<?php
    300333    $post_links = wp_click_tracker_extract_urls($result['0']->post_content);
    301334    $_check_urls = array();
     
    322355</div>
    323356
    324     <?
     357    <?php
    325358}
    326359
     
    344377 */
    345378function wp_click_tracker_options(){
    346     global $click_tracker_page_default;
     379    global $click_tracker_page_default, $wpdb;
    347380
    348381    $plugin_data = get_plugin_data(__FILE__);
    349382    $plugin_options = get_option('click_tracker');
     383
    350384    $default = $click_tracker_page_default;
    351385    $form_updated = FALSE;
     386    $reset_clicks = FALSE;
     387    $reset_links = FALSE;
     388
     389    //exit;
    352390    $page = (isset($_REQUEST['page']) ? $_REQUEST['page'] : FALSE);
    353391
     
    355393       
    356394       
    357         $plugin_options['parse_the_content'] = (isset($_POST['parse_the_content']) && $_POST['parse_the_content'] == '1' ? $_POST['parse_the_content'] : '0');
    358         $plugin_options['parse_archive'] = (isset($_POST['parse_archive']) && $_POST['parse_archive'] == '1' ? $_POST['parse_archive'] : '0');
    359         $plugin_options['parse_blog_roll'] = (isset($_POST['parse_blog_roll']) && $_POST['parse_blog_roll'] == '1' ? $_POST['parse_blog_roll'] : '0');
    360         $plugin_options['parse_comment_author_link'] = (isset($_POST['parse_comment_author_link']) && $_POST['parse_comment_author_link'] == '1' ? $_POST['parse_comment_author_link'] : '0');
    361         $plugin_options['parse_the_excerpt'] = (isset($_POST['parse_the_excerpt']) && $_POST['parse_the_excerpt'] == '1' ? $_POST['parse_the_excerpt'] : '0');
    362         $plugin_options['parse_the_meta'] = (isset($_POST['parse_the_meta']) && $_POST['parse_the_meta'] == '1' ? $_POST['parse_the_meta'] : '0');
    363         $plugin_options['parse_comment_text'] = (isset($_POST['parse_comment_text']) && $_POST['parse_comment_text'] == '1' ? $_POST['parse_comment_text'] : '0');
     395        $plugin_options['parse_the_content'] = (int)(isset($_POST['parse_the_content']) && $_POST['parse_the_content'] == '1' ? $_POST['parse_the_content'] : '0');
     396        $plugin_options['parse_archive'] = (int)(isset($_POST['parse_archive']) && $_POST['parse_archive'] == '1' ? $_POST['parse_archive'] : '0');
     397        $plugin_options['parse_blog_roll'] = (int)(isset($_POST['parse_blog_roll']) && $_POST['parse_blog_roll'] == '1' ? $_POST['parse_blog_roll'] : '0');
     398        $plugin_options['parse_comment_author_link'] = (int)(isset($_POST['parse_comment_author_link']) && $_POST['parse_comment_author_link'] == '1' ? $_POST['parse_comment_author_link'] : '0');
     399        $plugin_options['parse_the_excerpt'] = (int)(isset($_POST['parse_the_excerpt']) && $_POST['parse_the_excerpt'] == '1' ? $_POST['parse_the_excerpt'] : '0');
     400        $plugin_options['parse_the_meta'] = (int)(isset($_POST['parse_the_meta']) && $_POST['parse_the_meta'] == '1' ? $_POST['parse_the_meta'] : '0');
     401        $plugin_options['parse_comment_text'] = (int)(isset($_POST['parse_comment_text']) && $_POST['parse_comment_text'] == '1' ? $_POST['parse_comment_text'] : '0');
     402        $plugin_options['parse_next_prev'] = (int)(isset($_POST['parse_next_prev']) && $_POST['parse_next_prev'] == '1' ? $_POST['parse_next_prev'] : '0');
     403        $plugin_options['parse_the_tags'] = (int)(isset($_POST['parse_the_tags']) && $_POST['parse_the_tags'] == '1' ? $_POST['parse_the_tags'] : '0');
     404        $plugin_options['parse_the_category'] = (int)(isset($_POST['parse_the_category']) && $_POST['parse_the_category'] == '1' ? $_POST['parse_the_category'] : '0');
    364405       
    365406
    366         $plugin_options['click_count'] = (isset($_POST['click_count']) ? $_POST['click_count'] : $default);
    367         $plugin_options['link_list_count'] = (isset($_POST['link_list_count']) ? $_POST['link_list_count'] : $default);
    368         $plugin_options['referrer_count'] = (isset($_POST['referrer_count']) ? $_POST['referrer_count'] : $default);
     407        $plugin_options['click_count'] = (int)(isset($_POST['click_count']) ? $_POST['click_count'] : $default);
     408        $plugin_options['link_list_count'] = (int)(isset($_POST['link_list_count']) ? $_POST['link_list_count'] : $default);
     409        $plugin_options['referrer_count'] = (int)(isset($_POST['referrer_count']) ? $_POST['referrer_count'] : $default);
     410
     411        $plugin_options['track_user_clicks'] = (int)(isset($_POST['track_user_clicks']) ? $_POST['track_user_clicks'] : '0');
     412        $plugin_options['exclude_ips'] = (isset($_POST['exclude_ips']) ? $_POST['exclude_ips'] : FALSE);
    369413
    370414        update_option('click_tracker', $plugin_options);
    371415        $plugin_options = get_option('click_tracker');
    372416        $form_updated = TRUE;
     417        $message = __($plugin_data['Name'].' settings updated!','default');
     418    }
     419
     420    if(isset($_POST['reset_clicks']) && $_POST['reset_clicks'] == 'yes'){
     421        $sql = "TRUNCATE ".$wpdb->prefix . "tracking_clicks";
     422        $wpdb->query($sql);
     423
     424        $sql = "UPDATE ".$wpdb->prefix . "tracking_links SET link_total_clicks = '0', link_unique_clicks = '0', last_modified = NOW()";
     425        $wpdb->query($sql);
     426
     427        $form_updated = TRUE;
     428        $message = __('Clicks Reset!','default');
     429    }
     430
     431    if(isset($_POST['reset_links']) && $_POST['reset_links'] == 'yes'){
     432        $sql = "TRUNCATE ".$wpdb->prefix . "tracking_links";
     433        $wpdb->query($sql);
     434
     435        $sql = "TRUNCATE ".$wpdb->prefix . "tracking_clicks";
     436        $wpdb->query($sql);
     437
     438        $form_updated = TRUE;
     439        $message = __('Links Reset!','default');
    373440    }
    374441
    375442    ?>
    376443    <div class="wrap" id="sm_div">
    377         <form method="post" action="<?=$_SERVER['PHP_SELF']; ?>?page=<?=$_REQUEST['page'];?>">
     444        <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo $_REQUEST['page'];?>">
    378445        <div id="icon-options-general" class="icon32"><br /></div>
    379446
     
    381448
    382449            <?php
    383             if($form_updated){
    384                 wp_click_track_admin_message( __($plugin_data['Name'].' settings updated!','default'));
     450            if($form_updated && $message){
     451                wp_click_track_admin_message( $message);
    385452            }
    386453            echo '<div align="right"> <a href="'.dirname($_SERVER['PHP_SELF']).'/plugins.php?page='.$page.'" class="button">'.__('View Links').'</a> <a href="'.dirname($_SERVER['PHP_SELF']).'/plugins.php?page='.$page.'&req=add" class="button">'.__('Add Link').'</a></div>';
     
    388455
    389456            <h3>Parse Settings</h3>
    390             <p>You can set <?php echo $plugin_data['Name']; ?> to automatically parse your posts and convert all links to click trackable links. It's pretty memory intensive and rigid though, so if you have poorly formed links it may cause your Wordpress setup to become unstable (it's still a beta afterall :). </p>
     457            <p>You can set <?php echo $plugin_data['Name']; ?> to automatically parse your posts and convert all links to click trackable links. </p>
    391458           
    392459            <p>You can choose the individual areas you want to convert below: </p>
     
    427494            <td><label for="parse_blog_roll"><input name="parse_blog_roll" type="checkbox" id="parse_blog_roll" value="1"  <?php echo ($plugin_options['parse_blog_roll'] == '1' ? 'checked="checked"' : ''); ?> />Parse the links displayed in the Blog Roll Sidebar Widget </label></td>
    428495            </tr>
     496
     497            <tr valign="top">
     498            <th scope="row">Next / Prev</th>
     499            <td><label for="parse_next_prev"><input name="parse_next_prev" type="checkbox" id="parse_next_prev" value="1"  <?php echo ($plugin_options['parse_next_prev'] == '1' ? 'checked="checked"' : ''); ?> />Parse the Next and Previous links in the template (<code>previous_post_link()</code> and <code>next_post_link()</code> template functions)</label></td>
     500            </tr>
     501
     502            <tr valign="top">
     503            <th scope="row">Footer Tags</th>
     504            <td><label for="parse_the_tags"><input name="parse_the_tags" type="checkbox" id="parse_the_tags" value="1"  <?php echo ($plugin_options['parse_the_tags'] == '1' ? 'checked="checked"' : ''); ?> />Parse the tags links on posts and pages</label></td>
     505            </tr>
     506
     507            <tr valign="top">
     508            <th scope="row">Category Links</th>
     509            <td><label for="parse_the_category"><input name="parse_the_category" type="checkbox" id="parse_the_category" value="1"  <?php echo ($plugin_options['parse_the_category'] == '1' ? 'checked="checked"' : ''); ?> />Parse the category links on posts and pages as well as sidebar widget</label></td>
     510            </tr>           
    429511            </table>
    430512
     
    432514            <p>Choose how many items you want displayed in the admin for <?php echo $plugin_data['Name']; ?>. This REALLY helps when you have a lot of items to display.</p>
    433515
    434             <p>NOTE: Anything but a positive number will result in the default of <?php $default; ?> being used.</p>
     516            <p>NOTE: Anything but a positive number will result in the default of <?php echo $default; ?> being used.</p>
    435517
    436518            <table class="form-table">
     
    448530            <th scope="row">Link List Count</th>
    449531            <td><label for="link_list_count"><input name="link_list_count" type="text" id="link_list_count" value="<?php echo $plugin_options['link_list_count']; ?>" class="small-text" /></label></td>
     532            </tr>
     533            </table>
     534
     535            <h3>Tracking Settings</h3>
     536            <p>The below settings only affect how the tracking system works.</p>
     537            <table class="form-table">
     538            <tr valign="top">
     539            <th scope="row">User Clicks</th>
     540            <td><label for="track_user_clicks"><input name="track_user_clicks" type="checkbox" id="track_user_clicks" value="1"  <?php echo ($plugin_options['track_user_clicks'] == '1' ? 'checked="checked"' : ''); ?> /> Track clicks of logged in members. </label></td>
     541            </tr>
     542            <th scope="row">Ignore IPs</th>
     543            <td><label for="exclude_ips"><textarea name="exclude_ips" rows="8" cols="40"><?php echo $plugin_options['exclude_ips']; ?></textarea><br />Put 1 IP address per line. These IP addresses won't be tracked.</label></td>
    450544            </tr>
    451545            </table>
     
    459553
    460554        </form>
     555
     556            <h3>System Reset</h3>
     557            <p>Use these functions at your own risk; there is no way to recover the data if you change your mind later.</p>
     558            <table width="200" ><tr><td>
     559               
     560                <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo $_REQUEST['page'];?>">
     561                <input type="hidden" name="reset_clicks" value="yes" \>
     562                <input type="submit" name="Submit" class="button-primary" value="Reset All Clicks" onclick="javascript: return confirm('Are you sure you want to reset all the clicks? \nThis deletes all click records for all links...')"/>
     563                </form>
     564            </td>
     565            <td>
     566
     567                <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo $_REQUEST['page'];?>">
     568                <input type="hidden" name="reset_links" value="yes" \>
     569                <input type="submit" name="Submit" class="button-primary" value="Delete All Links" onclick="javascript: return confirm('Are you sure you want to delete all the links? \nThis deletes the clicks as well so you\'ll lose everything...')"/>
     570                </form>
     571            </td>
     572            </tr>
     573            </table>
     574
    461575    </div>
    462576
    463     <?
     577    <?php
    464578}
    465579
     
    471585function wp_click_tracker_admin_module() {
    472586    global $click_tracker_db_version,$wpdb,$link_page_total;
     587
    473588    $new_version = TRUE;
    474589    $plugin_data = get_plugin_data(__FILE__);
     
    489604    ?>
    490605<div class="wrap" id="sm_div">
    491     <form method="post" action="<?=$_SERVER['PHP_SELF']; ?>?page=<?=$_REQUEST['page'];?>">
     606    <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo $_REQUEST['page'];?>">
    492607    <div id="icon-link-manager" class="icon32"><br /></div>
    493608        <h2><?php echo $plugin_data['Name']; ?> <?php echo $plugin_data['Version']; ?></h2>
    494     <?
     609    <?php
    495610
    496611    //check if an update has been issued
     
    510625    $google_options = get_option('GoogleAnalyticsPP');
    511626    if(isset($google_options['trackoutbound']) && $google_options['trackoutbound'] == '1'){
    512         wp_click_track_admin_message( __('It looks like you have Google Analytics for WordPress installed with Track Outbound links enabled. This can cause issues with '.$plugin_data['Name'].' '.$plugin_data['Version'].'. </p><p>Click <a href="'.$_SERVER['PHP_SELF'].'?page='.$_REQUEST['page'].'&req=ga_outbound">here</a> to disable.','default'));
     627        wp_click_track_admin_message( __('It looks like you have Google Analytics for WordPress installed with Track Outbound links enabled. This can cause issues with '.$plugin_data['Name'].' '.$plugin_data['Version'].'. <p>Click <a href="'.$_SERVER['PHP_SELF'].'?page='.$_REQUEST['page'].'&req=ga_outbound">here</a> to disable.','default'));
    513628    }
    514629
     
    529644            break;
    530645
    531         }
     646            case 'data_hack_done':
     647                wp_click_track_admin_message( __('Data Hack Applied.','wp_click_tracker'));
     648            break;
     649
     650        }
     651    }
     652
     653    //check if the data has been fixed yet.
     654    $plugin_options = get_option('click_tracker');
     655    if(!array_key_exists('data_hack_applied',$plugin_options)){
     656        wp_click_track_admin_message( __('It looks like your data hasn\'t been updated to match the new system. Click <a href="'.$_SERVER['PHP_SELF'].'?page='.$_REQUEST['page'].'&req=apply_data_hack">here</a> to do that now.','default'));
    532657    }
    533658
     
    535660    echo '<div align="right">';
    536661
    537     if($link_id || $req == 'add' || $req == 'edit'){
    538         echo ' <a href="'.$_SERVER['PHP_SELF'].'?page='.$page.'" class="button">'.__('List Links').'</a> ';
    539     }
     662    echo ' <a href="'.$_SERVER['PHP_SELF'].'?page='.$page.'&req=main" class="button">'.__('Main').'</a> ';
     663
     664    echo ' <a href="'.$_SERVER['PHP_SELF'].'?page='.$page.'&req=list_links" class="button">'.__('List Links').'</a> ';
    540665
    541666    if($link_id && $req != 'edit'){
     
    547672    }
    548673
     674   
    549675    echo ' <a href="'.$_SERVER['PHP_SELF'].'?page='.$page.'&req=add" class="button">'.__('Add Link').'</a> <a href="'.dirname($_SERVER['PHP_SELF']).'/options-general.php?page='.$page.'" class="button">'.__('Configure').'</a></div>';
    550676
     
    571697        break;
    572698
     699        case 'list_links':
     700
     701            wp_click_track_admin_list_links($req, $page, $paged, $ref_paged);
     702
     703        break;
     704
    573705        default:
    574706               
     
    586718            } else {
    587719
    588                 wp_click_track_admin_list_links($req, $page, $paged, $ref_paged);
     720                wp_click_track_admin_main($req, $page, $paged, $ref_paged);
     721                //wp_click_track_admin_list_links($req, $page, $paged, $ref_paged);
    589722
    590723            }
     
    594727}
    595728
     729
     730function wp_click_track_admin_main($req, $page, $paged, $ref_paged){
     731    global $wpdb;
     732
     733    $date = (isset($_GET['date']) ? $_GET['date'] : date("Y-m-d"));
     734    echo '<h3>Clicks on '.mysql2date(get_option('date_format'),$date).'</h3>';
     735
     736    $sql = "SELECT COUNT(click_id) AS link_total_clicks,".$wpdb->prefix."tracking_clicks.link_id AS link_id, date_format(click_date,\"%Y-%m-%d\") AS click_date, link_title, link_destination, click_refer FROM ".$wpdb->prefix."tracking_links,".$wpdb->prefix."tracking_clicks WHERE ".$wpdb->prefix."tracking_links.link_id = ".$wpdb->prefix."tracking_clicks.link_id AND date_format(click_date,\"%Y-%m-%d\") = '$date' GROUP BY ".$wpdb->prefix."tracking_clicks.link_id ORDER BY link_total_clicks DESC ";
     737
     738    $result = $wpdb->get_results($sql);
     739    $total = count($result);
     740
     741    $sql = "SELECT COUNT(click_id) AS link_unique_clicks FROM ".$wpdb->prefix."tracking_clicks WHERE date_format(click_date,\"%Y-%m-%d\") = '$date' AND unique_click = '1' GROUP BY ".$wpdb->prefix."tracking_clicks.link_id ORDER BY link_unique_clicks DESC ";
     742
     743    $uniques = $wpdb->get_results($sql);
     744    for($i=0;$i<$total;$i++){
     745        $result[$i]->link_unique_clicks = $uniques[$i]->link_unique_clicks;
     746    }
     747
     748    wp_click_track_list_links($result, $total, FALSE, FALSE);
     749
     750    wp_click_track_admin_stats(FALSE, $range = 30);
     751}
     752
     753function wp_click_track_admin_stats($link_id = FALSE, $range = 30) {
     754
     755?>
     756    <h3>Statistics</h3>
     757    <table class="widefat comments-box " cellspacing="0">
     758    <thead>
     759        <tr>
     760            <th>Recent</th>
     761        </tr>
     762        <tr>
     763            <td>
     764        <table width="100%" align="center">
     765        <tr><td colspan="2">
     766        <?php
     767            $site_url = get_option( 'siteurl' );
     768            include_once dirname(__FILE__).'/open-flash-chart/php-ofc-library/open_flash_chart_object.php';
     769            open_flash_chart_object( '100%', 225, $site_url .'/wp-admin/index.php?wp_ofc=true&range='.$range.'&link='.$link_id, FALSE, $site_url.'/wp-content/plugins/wp-click-track/open-flash-chart/');
     770        ?>
     771        </td></tr>
     772        </table>
     773        </tr>
     774
     775    <tbody id="the-comment-list" class="list:comment">
     776    </tbody>
     777    </table>
     778
     779<br />
     780    <table class="widefat comments-box " cellspacing="0">
     781    <thead>
     782        <tr>
     783            <th width="50%">Clicks By Hour</th>
     784            <th width="50%">Clicks By Day</th>
     785        </tr>
     786        <tr>
     787            <td align="center">
     788                <?php 
     789                $site_url = get_option( 'siteurl' );
     790                include_once dirname(__FILE__).'/open-flash-chart/php-ofc-library/open_flash_chart_object.php';
     791                open_flash_chart_object( '500', '400', $site_url .'/wp-admin/index.php?wp_ofc=pie&type=hour&link='.$link_id, FALSE, $site_url.'/wp-content/plugins/wp-click-track/open-flash-chart/');
     792                ?>
     793            </td>
     794            <td align="center">
     795                <?php 
     796                $site_url = get_option( 'siteurl' );
     797                include_once dirname(__FILE__).'/open-flash-chart/php-ofc-library/open_flash_chart_object.php';
     798                open_flash_chart_object( '500', '400', $site_url .'/wp-admin/index.php?wp_ofc=pie&type=day&link='.$link_id, FALSE, $site_url.'/wp-content/plugins/wp-click-track/open-flash-chart/');
     799                ?>         
     800            </td>
     801        </td>
     802        </table>
     803
     804<br />
     805    <table class="widefat comments-box " cellspacing="0">
     806    <thead>
     807        <tr>
     808            <th>History</th>
     809        </tr>
     810        <tr>
     811            <td>
     812        <table width="100%" align="center">
     813        <tr><td colspan="2">
     814        <?php
     815            $site_url = get_option( 'siteurl' );
     816            include_once dirname(__FILE__).'/open-flash-chart/php-ofc-library/open_flash_chart_object.php';
     817            open_flash_chart_object( '100%', 225, $site_url .'/wp-admin/index.php?wp_ofc=bar_3d&range='.$range.'&link='.$link_id, FALSE, $site_url.'/wp-content/plugins/wp-click-track/open-flash-chart/');
     818        ?>
     819        </td></tr>
     820        </table>
     821        </tr>
     822
     823    <tbody id="the-comment-list" class="list:comment">
     824    </tbody>
     825    </table>
     826
     827<?php
     828
     829}
    596830/**
    597831 * Returns the clicks
     
    664898        }
    665899    }
     900
     901    //we might also be doing a data upgrade from the STUPID bungling I did on the data format. Fuck I'm sorry...
     902    if(isset($_REQUEST['req']) && $_REQUEST['req'] == 'apply_data_hack'){
     903
     904        wp_click_track_apply_data_hack();
     905        $plugin_options = get_option('click_tracker');
     906        $plugin_options['data_hack_applied'] = 'yes';
     907        update_option('click_tracker', $plugin_options);
     908
     909        header('Location: '.$_SERVER['PHP_SELF'].'?page='.$_REQUEST['page'].'&msg=data_hack_done');
     910        exit;
     911    }
     912}
     913
     914function wp_click_tracker_get_graph_stats(){
     915    global $wpdb;
     916
     917    if(isset($_GET['wp_ofc'])){
     918        $reporting_included = TRUE;
     919        include 'reporting.php';
     920        exit;
     921    }
     922
    666923}
    667924
     
    676933}
    677934
     935function wp_click_track_pagination($numofpages = 1, $ref_paged = 1, $link_page_total = 1, $total = 1, $anchor = FALSE, $paging_var = 'ref_paged'){
     936
     937    $page_links = paginate_links( array(
     938        'base' => add_query_arg( $paging_var, '%#%#'.$anchor ),
     939        'format' => '',
     940        'prev_text' => __('&laquo;'),
     941        'next_text' => __('&raquo;'),
     942        'total' => $numofpages,
     943        'current' => $ref_paged
     944    ));
     945
     946    if ( $page_links ) {
     947        $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
     948        number_format_i18n( ( $ref_paged - 1 ) * $link_page_total + 1 ),
     949        number_format_i18n( min( $ref_paged * $link_page_total, $total ) ),
     950        number_format_i18n( $total ),
     951        $page_links
     952        );
     953        echo "<div class='tablenav'><div class='tablenav-pages'>$page_links_text</div></div>";
     954    }
     955
     956}
    678957register_activation_hook(__FILE__,'wp_click_tracker_install');
    679958register_deactivation_hook(__FILE__, 'wp_click_tracker_deactivate');
     
    689968add_action('init','wp_click_tracker_go');
    690969add_action('admin_init','wp_click_tracker_mod_go');
     970add_action('admin_init','wp_click_tracker_get_graph_stats');
    691971
    692972$ct_options = get_option('click_tracker');
     
    718998    add_filter('comment_text', 'wp_click_tracker_filter', 9);
    719999}
     1000
     1001if(array_key_exists('parse_next_prev',$ct_options) && $ct_options['parse_next_prev'] == '1'){
     1002    add_filter('next_post_link', 'wp_click_tracker_filter', 9);
     1003    add_filter('previous_post_link', 'wp_click_tracker_filter', 9);
     1004}
     1005
     1006if(array_key_exists('parse_the_tags',$ct_options) && $ct_options['parse_the_tags'] == '1'){
     1007    add_filter('the_tags', 'wp_click_tracker_filter', 9);
     1008}
     1009
     1010if(array_key_exists('parse_the_category',$ct_options) && $ct_options['parse_the_category'] == '1'){
     1011    add_filter('the_category', 'wp_click_tracker_filter', 9);
     1012    add_filter('wp_list_categories', 'wp_click_tracker_filter', 9);
     1013}
     1014
    7201015unset($ct_options);
    7211016
  • wp-click-track/trunk/contextual_help.php

    r111387 r130356  
    77 * @author Eric Lamb <[email protected]>
    88 * @package    wp-click-tracker
    9  * @version 0.4.1
     9 * @version 0.5
    1010 * @filesource
    1111 * @copyright 2009 Eric Lamb.
  • wp-click-track/trunk/install.inc.php

    r111392 r130356  
    77 * @author Eric Lamb <[email protected]>
    88 * @package    wp-click-tracker
    9  * @version 0.4
     9 * @version 0.5
    1010 * @filesource
    1111 * @copyright 2009 Eric Lamb.
     
    100100   
    101101    //set the defaults
    102     $options['version'] = '0.4.2';
     102    $options['version'] = '0.5';
    103103    $options['db_version'] = '0.2';
    104104
     
    115115    $options['parse_the_meta'] = '1';
    116116    $options['parse_comment_text'] = '1';
     117    $options['parse_next_prev'] = '1';
     118    $options['parse_the_tags'] = '1';
     119    $options['parse_the_category'] = '1';
     120
     121    $options['track_user_clicks'] = '1';
    117122
    118123    add_option("click_tracker", $options);
  • wp-click-track/trunk/license.txt

    r107117 r130356  
    11            GNU GENERAL PUBLIC LICENSE
    2 
    32               Version 2, June 1991
    43
    5 
    6 
    74 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
    8 
    95              51 Franklin St, Fifth Floor, Boston, MA 02110, USA
    106
    11 
    12 
    137 Everyone is permitted to copy and distribute verbatim copies
    14 
    158 of this license document, but changing it is not allowed.
    169
    17 
    18 
    1910                Preamble
    2011
    21 
    22 
    2312  The licenses for most software are designed to take away your
    24 
    2513freedom to share and change it.  By contrast, the GNU General Public
    26 
    2714License is intended to guarantee your freedom to share and change free
    28 
    2915software--to make sure the software is free for all its users.  This
    30 
    3116General Public License applies to most of the Free Software
    32 
    3317Foundation's software and to any other program whose authors commit to
    34 
    3518using it.  (Some other Free Software Foundation software is covered by
    36 
    3719the GNU Library General Public License instead.)  You can apply it to
    38 
    3920your programs, too.
    4021
    41 
    42 
    4322  When we speak of free software, we are referring to freedom, not
    44 
    4523price.  Our General Public Licenses are designed to make sure that you
    46 
    4724have the freedom to distribute copies of free software (and charge for
    48 
    4925this service if you wish), that you receive source code or can get it
    50 
    5126if you want it, that you can change the software or use pieces of it
    52 
    5327in new free programs; and that you know you can do these things.
    5428
    55 
    56 
    5729  To protect your rights, we need to make restrictions that forbid
    58 
    5930anyone to deny you these rights or to ask you to surrender the rights.
    60 
    6131These restrictions translate to certain responsibilities for you if you
    62 
    6332distribute copies of the software, or if you modify it.
    6433
    65 
    66 
    6734  For example, if you distribute copies of such a program, whether
    68 
    6935gratis or for a fee, you must give the recipients all the rights that
    70 
    7136you have.  You must make sure that they, too, receive or can get the
    72 
    7337source code.  And you must show them these terms so they know their
    74 
    7538rights.
    7639
    77 
    78 
    7940  We protect your rights with two steps: (1) copyright the software, and
    80 
    8141(2) offer you this license which gives you legal permission to copy,
    82 
    8342distribute and/or modify the software.
    8443
    85 
    86 
    8744  Also, for each author's protection and ours, we want to make certain
    88 
    8945that everyone understands that there is no warranty for this free
    90 
    9146software.  If the software is modified by someone else and passed on, we
    92 
    9347want its recipients to know that what they have is not the original, so
    94 
    9548that any problems introduced by others will not reflect on the original
    96 
    9749authors' reputations.
    9850
    99 
    100 
    10151  Finally, any free program is threatened constantly by software
    102 
    10352patents.  We wish to avoid the danger that redistributors of a free
    104 
    10553program will individually obtain patent licenses, in effect making the
    106 
    10754program proprietary.  To prevent this, we have made it clear that any
    108 
    10955patent must be licensed for everyone's free use or not licensed at all.
    11056
    111 
    112 
    11357  The precise terms and conditions for copying, distribution and
    114 
    11558modification follow.
    11659
    117 
    118 
    11960            GNU GENERAL PUBLIC LICENSE
    120 
    12161   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
    12262
    123 
    124 
    12563  0. This License applies to any program or other work which contains
    126 
    12764a notice placed by the copyright holder saying it may be distributed
    128 
    12965under the terms of this General Public License.  The "Program", below,
    130 
    13166refers to any such program or work, and a "work based on the Program"
    132 
    13367means either the Program or any derivative work under copyright law:
    134 
    13568that is to say, a work containing the Program or a portion of it,
    136 
    13769either verbatim or with modifications and/or translated into another
    138 
    13970language.  (Hereinafter, translation is included without limitation in
    140 
    14171the term "modification".)  Each licensee is addressed as "you".
    14272
    143 
    144 
    14573Activities other than copying, distribution and modification are not
    146 
    14774covered by this License; they are outside its scope.  The act of
    148 
    14975running the Program is not restricted, and the output from the Program
    150 
    15176is covered only if its contents constitute a work based on the
    152 
    15377Program (independent of having been made by running the Program).
    154 
    15578Whether that is true depends on what the Program does.
    15679
    157 
    158 
    15980  1. You may copy and distribute verbatim copies of the Program's
    160 
    16181source code as you receive it, in any medium, provided that you
    162 
    16382conspicuously and appropriately publish on each copy an appropriate
    164 
    16583copyright notice and disclaimer of warranty; keep intact all the
    166 
    16784notices that refer to this License and to the absence of any warranty;
    168 
    16985and give any other recipients of the Program a copy of this License
    170 
    17186along with the Program.
    17287
    173 
    174 
    17588You may charge a fee for the physical act of transferring a copy, and
    176 
    17789you may at your option offer warranty protection in exchange for a fee.
    17890
    179 
    180 
    18191  2. You may modify your copy or copies of the Program or any portion
    182 
    18392of it, thus forming a work based on the Program, and copy and
    184 
    18593distribute such modifications or work under the terms of Section 1
    186 
    18794above, provided that you also meet all of these conditions:
    18895
    189 
    190 
    19196    a) You must cause the modified files to carry prominent notices
    192 
    19397    stating that you changed the files and the date of any change.
    19498
    195 
    196 
    19799    b) You must cause any work that you distribute or publish, that in
    198 
    199100    whole or in part contains or is derived from the Program or any
    200 
    201101    part thereof, to be licensed as a whole at no charge to all third
    202 
    203102    parties under the terms of this License.
    204103
    205 
    206 
    207104    c) If the modified program normally reads commands interactively
    208 
    209105    when run, you must cause it, when started running for such
    210 
    211106    interactive use in the most ordinary way, to print or display an
    212 
    213107    announcement including an appropriate copyright notice and a
    214 
    215108    notice that there is no warranty (or else, saying that you provide
    216 
    217109    a warranty) and that users may redistribute the program under
    218 
    219110    these conditions, and telling the user how to view a copy of this
    220 
    221111    License.  (Exception: if the Program itself is interactive but
    222 
    223112    does not normally print such an announcement, your work based on
    224 
    225113    the Program is not required to print an announcement.)
    226114
    227 
    228 
    229115These requirements apply to the modified work as a whole.  If
    230 
    231116identifiable sections of that work are not derived from the Program,
    232 
    233117and can be reasonably considered independent and separate works in
    234 
    235118themselves, then this License, and its terms, do not apply to those
    236 
    237119sections when you distribute them as separate works.  But when you
    238 
    239120distribute the same sections as part of a whole which is a work based
    240 
    241121on the Program, the distribution of the whole must be on the terms of
    242 
    243122this License, whose permissions for other licensees extend to the
    244 
    245123entire whole, and thus to each and every part regardless of who wrote it.
    246 
    247124Thus, it is not the intent of this section to claim rights or contest
    248 
    249125your rights to work written entirely by you; rather, the intent is to
    250 
    251126exercise the right to control the distribution of derivative or
    252 
    253127collective works based on the Program.
    254128
    255 
    256 
    257129In addition, mere aggregation of another work not based on the Program
    258 
    259130with the Program (or with a work based on the Program) on a volume of
    260 
    261131a storage or distribution medium does not bring the other work under
    262 
    263132the scope of this License.
    264133
    265 
    266 
    267134  3. You may copy and distribute the Program (or a work based on it,
    268 
    269135under Section 2) in object code or executable form under the terms of
    270 
    271136Sections 1 and 2 above provided that you also do one of the following:
    272137
    273 
    274 
    275138    a) Accompany it with the complete corresponding machine-readable
    276 
    277139    source code, which must be distributed under the terms of Sections
    278 
    279140    1 and 2 above on a medium customarily used for software interchange; or,
    280141
    281 
    282 
    283142    b) Accompany it with a written offer, valid for at least three
    284 
    285143    years, to give any third party, for a charge no more than your
    286 
    287144    cost of physically performing source distribution, a complete
    288 
    289145    machine-readable copy of the corresponding source code, to be
    290 
    291146    distributed under the terms of Sections 1 and 2 above on a medium
    292 
    293147    customarily used for software interchange; or,
    294148
    295 
    296 
    297149    c) Accompany it with the information you received as to the offer
    298 
    299150    to distribute corresponding source code.  (This alternative is
    300 
    301151    allowed only for noncommercial distribution and only if you
    302 
    303152    received the program in object code or executable form with such
    304 
    305153    an offer, in accord with Subsection b above.)
    306154
    307 
    308 
    309155The source code for a work means the preferred form of the work for
    310 
    311156making modifications to it.  For an executable work, complete source
    312 
    313157code means all the source code for all modules it contains, plus any
    314 
    315158associated interface definition files, plus the scripts used to
    316 
    317159control compilation and installation of the executable.  However, as a
    318 
    319160special exception, the source code distributed need not include
    320 
    321161anything that is normally distributed (in either source or binary
    322 
    323162form) with the major components (compiler, kernel, and so on) of the
    324 
    325163operating system on which the executable runs, unless that component
    326 
    327164itself accompanies the executable.
    328165
    329 
    330 
    331166If distribution of executable or object code is made by offering
    332 
    333167access to copy from a designated place, then offering equivalent
    334 
    335168access to copy the source code from the same place counts as
    336 
    337169distribution of the source code, even though third parties are not
    338 
    339170compelled to copy the source along with the object code.
    340171
    341 
    342 
    343172  4. You may not copy, modify, sublicense, or distribute the Program
    344 
    345173except as expressly provided under this License.  Any attempt
    346 
    347174otherwise to copy, modify, sublicense or distribute the Program is
    348 
    349175void, and will automatically terminate your rights under this License.
    350 
    351176However, parties who have received copies, or rights, from you under
    352 
    353177this License will not have their licenses terminated so long as such
    354 
    355178parties remain in full compliance.
    356179
    357 
    358 
    359180  5. You are not required to accept this License, since you have not
    360 
    361181signed it.  However, nothing else grants you permission to modify or
    362 
    363182distribute the Program or its derivative works.  These actions are
    364 
    365183prohibited by law if you do not accept this License.  Therefore, by
    366 
    367184modifying or distributing the Program (or any work based on the
    368 
    369185Program), you indicate your acceptance of this License to do so, and
    370 
    371186all its terms and conditions for copying, distributing or modifying
    372 
    373187the Program or works based on it.
    374188
    375 
    376 
    377189  6. Each time you redistribute the Program (or any work based on the
    378 
    379190Program), the recipient automatically receives a license from the
    380 
    381191original licensor to copy, distribute or modify the Program subject to
    382 
    383192these terms and conditions.  You may not impose any further
    384 
    385193restrictions on the recipients' exercise of the rights granted herein.
    386 
    387194You are not responsible for enforcing compliance by third parties to
    388 
    389195this License.
    390196
    391 
    392 
    393197  7. If, as a consequence of a court judgment or allegation of patent
    394 
    395198infringement or for any other reason (not limited to patent issues),
    396 
    397199conditions are imposed on you (whether by court order, agreement or
    398 
    399200otherwise) that contradict the conditions of this License, they do not
    400 
    401201excuse you from the conditions of this License.  If you cannot
    402 
    403202distribute so as to satisfy simultaneously your obligations under this
    404 
    405203License and any other pertinent obligations, then as a consequence you
    406 
    407204may not distribute the Program at all.  For example, if a patent
    408 
    409205license would not permit royalty-free redistribution of the Program by
    410 
    411206all those who receive copies directly or indirectly through you, then
    412 
    413207the only way you could satisfy both it and this License would be to
    414 
    415208refrain entirely from distribution of the Program.
    416209
    417 
    418 
    419210If any portion of this section is held invalid or unenforceable under
    420 
    421211any particular circumstance, the balance of the section is intended to
    422 
    423212apply and the section as a whole is intended to apply in other
    424 
    425213circumstances.
    426214
    427 
    428 
    429215It is not the purpose of this section to induce you to infringe any
    430 
    431216patents or other property right claims or to contest validity of any
    432 
    433217such claims; this section has the sole purpose of protecting the
    434 
    435218integrity of the free software distribution system, which is
    436 
    437219implemented by public license practices.  Many people have made
    438 
    439220generous contributions to the wide range of software distributed
    440 
    441221through that system in reliance on consistent application of that
    442 
    443222system; it is up to the author/donor to decide if he or she is willing
    444 
    445223to distribute software through any other system and a licensee cannot
    446 
    447224impose that choice.
    448225
    449 
    450 
    451226This section is intended to make thoroughly clear what is believed to
    452 
    453227be a consequence of the rest of this License.
    454228
    455 
    456 
    457229  8. If the distribution and/or use of the Program is restricted in
    458 
    459230certain countries either by patents or by copyrighted interfaces, the
    460 
    461231original copyright holder who places the Program under this License
    462 
    463232may add an explicit geographical distribution limitation excluding
    464 
    465233those countries, so that distribution is permitted only in or among
    466 
    467234countries not thus excluded.  In such case, this License incorporates
    468 
    469235the limitation as if written in the body of this License.
    470236
    471 
    472 
    473237  9. The Free Software Foundation may publish revised and/or new versions
    474 
    475238of the General Public License from time to time.  Such new versions will
    476 
    477239be similar in spirit to the present version, but may differ in detail to
    478 
    479240address new problems or concerns.
    480241
    481 
    482 
    483242Each version is given a distinguishing version number.  If the Program
    484 
    485243specifies a version number of this License which applies to it and "any
    486 
    487244later version", you have the option of following the terms and conditions
    488 
    489245either of that version or of any later version published by the Free
    490 
    491246Software Foundation.  If the Program does not specify a version number of
    492 
    493247this License, you may choose any version ever published by the Free Software
    494 
    495248Foundation.
    496249
    497 
    498 
    499250  10. If you wish to incorporate parts of the Program into other free
    500 
    501251programs whose distribution conditions are different, write to the author
    502 
    503252to ask for permission.  For software which is copyrighted by the Free
    504 
    505253Software Foundation, write to the Free Software Foundation; we sometimes
    506 
    507254make exceptions for this.  Our decision will be guided by the two goals
    508 
    509255of preserving the free status of all derivatives of our free software and
    510 
    511256of promoting the sharing and reuse of software generally.
    512257
    513 
    514 
    515258                NO WARRANTY
    516259
    517 
    518 
    519260  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
    520 
    521261FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
    522 
    523262OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
    524 
    525263PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
    526 
    527264OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    528 
    529265MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
    530 
    531266TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
    532 
    533267PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
    534 
    535268REPAIR OR CORRECTION.
    536269
    537 
    538 
    539270  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
    540 
    541271WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
    542 
    543272REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
    544 
    545273INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
    546 
    547274OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
    548 
    549275TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
    550 
    551276YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
    552 
    553277PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
    554 
    555278POSSIBILITY OF SUCH DAMAGES.
    556279
    557 
    558 
    559280             END OF TERMS AND CONDITIONS
    560281
    561 
    562 
  • wp-click-track/trunk/readme.txt

    r111390 r130356  
    3838* export data<br />
    3939* search link data<br />
    40 * view IP address click path report<br />
    4140* link list sorting<br />
    4241* referrer link list grouping<br />
    4342* link stat reset<br />
    44 * system data reset<br />
    4543
    4644**Bugs**<br />
     
    5048
    5149**Changelog**<br />
     500.5 :: <br />
     51* Modification *
     52 <br />Added settings to disable user clicks
     53 <br />Added ignore IP address for click tracking
     54 <br />Added link statistics reset
     55 <br />Changed graphs to Open Flash Chart
     56 <br />Added additional line chart vectors to display unique clicks
     57 <br />Added link parsing of next and prev template tags
     58 <br />Added link parsing of categories in posts/pages as well as sidebar widget
     59 <br />Added link parsing of tags links template
     60 <br />Improved title extraction to reduce No Name Given auto-label
     61 <br />Added global history and report page
     62* Bug Fixes *
     63 <br />Click graph date descrepancy issue
     64 <br />Added bypass for external links being double tracked when entered in page
     65 <br />Fixed backwards tracking flags
     66 <br />Changed admin widget ordering to list most clicked to least click
     67<br />
     68
    52690.4.2 :: <br />
    5370* Modification *
Note: See TracChangeset for help on using the changeset viewer.