Tracks clicks to external affiliate links'; echo '

This is an experimental feature. A class is automatically added to all external links when the posts are created. When a user clicks on such a link then their activity is recorded into a database.

'; if (isset($_POST['submitTracking'])) { if (isset($_POST['ah_tracking_chq'])) { $var = TRUE; } else { $var = NULL; } $this->db_update_options($var); echo self::$success->success_message('You have changed the tracking settings'); } // end if echo $this->turn_off_tracking(); echo $this->create_table(); } /** * Tracking_Controller::turn_off_tracking() * * Form for turning off tracking * * @return string */ protected function turn_off_tracking() { $option = get_option('ah_tracking'); $form = '
'; $form .= '
Click checkbox to turn off tracking'; $form .= ''; $form .= ''; $form .= ''; $form .= ''; $form .= '
Turn off trackingdb_total_tracking_entries(); $form = ''; if ($total) { $pag = new ah_pagination; $pag->items($total); $pag->limit(15); // Limit entries per page $pag->target(admin_url("/options-general.php?page=affiliate-hoover-plugin-admin&tracking=here")); $pag->currentPage($pag->page); // Gets and validates the current page $pag->calculate(); // Calculates what to show $pag->parameterName('paging'); $pag->adjacents(1); //No. of page away from the current page if (!isset($_GET['paging'])) { $pag->page = 1; } else { $pag->page = $_GET['paging']; } //Query for limit paging $limit = "LIMIT ".($pag->page - 1) * $pag->limit.", ".$pag->limit; } if (isset($limit) && $limit != NULL) { $form .= '
'; $form .= '
'; $form .= ''.$total.' items'; $form .= $pag->show(); $form .= '
'; $form .= '
'; $data = $this->db_get_all($limit); } if (isset($data) && $data != NULL) { $form .= ''; $form .= ''; $form .= ''; $form .= ''; $form .= ''; $form .= ''; $form .= ''; $form .= ''; $form .= ''; $form .= ''; foreach ($data as $result) { $post = (int)$result->post_id; $post = get_post($post, OBJECT); $form .= ''; $form .= ''; $form .= ''; $form .= ''; $form .= ''; $form .= ''; } $form .= '
DatePostIP# clicks
'; $date = date_create($result->date); $form .= date_format($date, 'h:i:s A, l jS \of F Y'); $form .= ''; if ($post) { $form .= $post->post_title; } else { $form .= "Deleted post"; } $form .= ''; $form .= $result->ip; $form .= ''; $form .= 1; $form .= '
'; } else { $form .= '

No entries yet

'; } // end if($data) { return $form; } public function tracking_form_facade() { return $this->tracking_form(); } }