diff --git a/Website/Include/PHP/functions.php b/Website/Include/PHP/functions.php
index 7c93c4d..aa5511c 100644
--- a/Website/Include/PHP/functions.php
+++ b/Website/Include/PHP/functions.php
@@ -54,13 +54,6 @@
}
}
- function stats($redis, $seperator){
- $tracking = $redis->keys("tracking:clicks:*");
- $tracking = rsort($tracking);
- $tracking = array_slice($tracking, 0, 5, true);
- return "8$seperator".json_encode($tracking);
- }
-
function getRemoteTitle($url){
$url = parse_url($url);
if($tags = get_meta_tags($url['scheme'].'://'.$url['host'])){
diff --git a/Website/process.php b/Website/process.php
index efa02ac..341f7bb 100644
--- a/Website/process.php
+++ b/Website/process.php
@@ -56,42 +56,6 @@
require('Include/PHP/functions.php');
- if(isset($_GET['getstats'])){
- $stats = stats($redis, $seperator);
- $stats = explode($seperator, $stats);
-
- if(!empty($_GET['type'])){
- if($_GET['type'] == "htmltable"){
- foreach($stats as $stat){ // There should only be 5, but the page doesn't limit how many
- $id = explode(":", $stat);
- $id = $id[2]; // Grab just the short link ID
-
- $linkData = $redis->lRange("links:$id", 0, -1);
-
- $link = $linkData[0];
- $title = $linkData[1];
- $date = $linkData[2];
- $trackClicks = $redis->get("tracking:clicks:$id");
-
- echo "
-
- |
- $id |
- $link |
- $trackClicks |
- $date |
-
- ";
- }
- }elseif($_GET['type'] == "json"){
- echo $stats[1];
- exit;
- }else{
- die("ERROR: Wrong type. I accept htmltable or json as my type
htmltable will send the partial table that loads on lob.li/stats, json outputs raw json array");
- }
- }
- }
-
if(!empty($_POST['link']) && !empty($_POST['linkage'])){
if(empty($_GET['token']) || $_GET['token'] != $_SESSION['token'] || empty($_POST[$catchid]) || $_POST[$catchid] != $catchVal){
die("Oh Noes! Something happened and I can't continue.
Please try again by using the form located at
lob.li.
");
diff --git a/Website/stats.php b/Website/stats.php
index d09e65c..95a7caa 100644
--- a/Website/stats.php
+++ b/Website/stats.php
@@ -41,57 +41,37 @@
-
+ $stats = $redis->keys("tracking:clicks:*");
+ rsort($stats);
+ $stats = array_slice($stats, 0, 5, true);
+
+ foreach($stats as $stat){ // There should only be 5, but the page doesn't limit how many
+ $id = explode(":", $stat);
+ $id = $id[2]; // Grab just the short link ID
+
+ $linkData = $redis->lRange("links:$id", 0, -1);
+
+ print_r($linkData); exit;
+
+ $link = $linkData[0];
+ $title = $linkData[1];
+ $date = $linkData[2];
+ $trackClicks = $redis->get("tracking:clicks:$id");
+
+ echo "
+
+ |
+ $id |
+ $link |
+ $trackClicks |
+ $date |
+
+ ";
+ }
+
+ ?>
@@ -113,10 +93,6 @@