'; echo ''; global $wpdb; $table_name = $wpdb->prefix . "AffiLinker_db_stat"; if($_POST['hitcountsort']=='Sort Up') { // check_admin_referer('AffiLinker_sort'); // $myrows = $wpdb->get_results( "SELECT * FROM ". $table_name . " ORDER BY link_hit_count DESC"); $myrows = $wpdb->get_results( "SELECT * FROM ". $table_name . " GROUP BY hit_keyword ORDER BY SUM(link_hit_count) DESC"); } else if($_POST['hitcountsort']=='Sort Down') { $myrows = $wpdb->get_results( "SELECT * FROM ". $table_name . " GROUP BY hit_keyword ORDER BY SUM(link_hit_count) ASC"); } else { $myrows = $wpdb->get_results( "SELECT * FROM ". $table_name . " GROUP BY hit_keyword"); } echo '

'; echo '

Track Affiliate Links



Get AffiLinker Premium Version to manage unlimited Affiliate Links and more features.
'; ?> '; $sortlink = '?page=affilinker.php&AffiLinker_Do=sort'; $sortlink = ( function_exists('wp_nonce_url') ) ? wp_nonce_url($sortlink, 'AffiLinker_sort') : $sortlink; echo ' '; $table_name_stat_uniq = $wpdb->prefix . "AffiLinker_db_stat_uniq"; $row_counter = 1; foreach($myrows as $row) { $row_counter = $row_counter + 1; $bluebk = $row_counter % 2; $id = $row->id; $keyword = $row->hit_keyword; $link_hit_count = $row->link_hit_count; $deletelink = '?page=affilinker.php&AffiLinker_Do=delete&id='. $id; $deletelink = ( function_exists('wp_nonce_url') ) ? wp_nonce_url($deletelink, 'AffiLinker_delete_link') : $deletelink; // echo '
  • Link: '. $link .'   Keywords: '. $keywords .'    Delete
  • '; ?> style="background-color:#E8D9FF;" style="background-color:#D2B0FF;" > get_results( "SELECT * FROM ". $table_name . " WHERE hit_keyword='$keyword'"); $countfortablehdr = 0; foreach ($mysubrows as $subrow) { if ($countfortablehdr == 0) { echo ''; } ?>
    Keyword
    Total Clicks
    Unique Clicks
    '; echo $keyword; ?>
    get_results( "SELECT * FROM ". $table_name_stat_uniq . " WHERE hit_keyword='$keyword'"); echo $wpdb->num_rows; ?>
    '; $countfortablehdr = 1; } echo ''; } if ($countfortablehdr == 1) { echo '
    Keyword
    Total Clicks
    Unique Clicks
    '; // print_r($myrows); ?>