PluginProbe
WebberZone Top 10 — Popular Posts / 1.1
WebberZone Top 10 — Popular Posts v1.1
4.5.1 4.5.0 4.4.3 4.4.2 4.4.1 4.4.0 4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 trunk 1.0 1.0.1 1.1 1.2 1.3 1.4 1.4.1 1.5 1.5.1 1.5.2 1.5.3 1.6 1.6.1 All 117 releases
top-10 / top-10-counter.js.php

top-10-counter.js.php in WebberZone Top 10 — Popular Posts 1.1, at top-10-counter.js.php

35 lines 997 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 //"top-10-counter.js.php" Display number of page views
3 Header("content-type: application/x-javascript");
4
5 if (!function_exists('add_action')) {
6 $wp_root = '../../..';
7 if (file_exists($wp_root.'/wp-load.php')) {
8 require_once($wp_root.'/wp-load.php');
9 } else {
10 require_once($wp_root.'/wp-config.php');
11 }
12 }
13
14 // Display counter using Ajax
15 function tptn_disp_count() {
16 global $wpdb;
17
18 $table_name = $wpdb->prefix . "top_ten";
19 $tptn_settings = tptn_read_options();
20 $count_disp_form = htmlspecialchars(stripslashes($tptn_settings[count_disp_form]));
21
22 $id = intval($_GET['top_ten_id']);
23 if($id > 0) {
24
25 $resultscount = $wpdb->get_row("select postnumber, cntaccess from $table_name WHERE postnumber = $id");
26 $cntaccess = number_format((($resultscount) ? $resultscount->cntaccess : 0));
27
28 $count_disp_form = str_replace("%totalcount%", $cntaccess, $count_disp_form);
29
30 echo 'document.write("'.$count_disp_form.'")';
31 }
32 }
33 tptn_disp_count();
34 ?>
35