2014-07-04 21:28:17 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
<title>lob.li - Objective Links | Link Statistics</title>
|
|
|
|
|
|
|
|
<!-- Bootstrap -->
|
2014-07-25 00:41:14 +00:00
|
|
|
<link href="Include/Bootstrap/css/bootstrap.min.css" rel="stylesheet">
|
|
|
|
<link href="Include/CSS/style.css?<?php echo time(); ?>" rel="stylesheet">
|
2014-07-14 22:37:43 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Montserrat">
|
2014-07-04 21:28:17 +00:00
|
|
|
|
2014-07-10 20:06:01 +00:00
|
|
|
<link rel="shortcut icon" type="image/ico" href="lobli.ico"/>
|
|
|
|
<link rel="shortcut icon" type="image/x-icon" href="lobli.ico"/>
|
|
|
|
|
2014-07-04 21:28:17 +00:00
|
|
|
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
|
|
|
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
|
|
|
<!--[if lt IE 9]>
|
|
|
|
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
|
|
|
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
|
|
|
|
<![endif]-->
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div class="container center-block">
|
|
|
|
|
|
|
|
<?php include('Include/HTML/navbar.htm') ?>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-3"></div>
|
|
|
|
<div class="col-md-6">
|
|
|
|
<h2 class="form-shorten-heading">Lob.li Link Statistics</h2>
|
|
|
|
<table class="table table-condensed">
|
|
|
|
<thead>
|
|
|
|
<tr class="success">
|
|
|
|
<th></th>
|
|
|
|
<th>LinkID</th>
|
|
|
|
<th>Resolved Link</th>
|
|
|
|
<th>Total Clicks</th>
|
|
|
|
<th>Date Added</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2014-08-10 00:30:10 +00:00
|
|
|
<?php
|
|
|
|
|
2014-08-10 00:32:53 +00:00
|
|
|
require('Include/PHP/db.php');
|
|
|
|
|
2014-08-10 22:29:17 +00:00
|
|
|
$stats = $redis->zRangeByScore("tracking:clicks", "-inf", "+inf");
|
|
|
|
$stats = array_reverse($stats);
|
2014-08-10 00:30:10 +00:00
|
|
|
$stats = array_slice($stats, 0, 5, true);
|
|
|
|
|
2014-08-10 22:29:17 +00:00
|
|
|
foreach($stats as $id){ // There should only be 5, but the page doesn't limit how many
|
|
|
|
$trTtl = $redis->ttl("links:$id");
|
|
|
|
if($trTtl == -2){ // The link has been deleted, no need to track it anymore
|
2014-08-10 22:44:40 +00:00
|
|
|
$redis->zRem("tracking:clicks", $id);
|
2014-08-10 22:29:17 +00:00
|
|
|
continue;
|
|
|
|
}
|
2014-08-10 00:30:10 +00:00
|
|
|
|
|
|
|
$linkData = $redis->lRange("links:$id", 0, -1);
|
|
|
|
|
|
|
|
$link = $linkData[0];
|
|
|
|
$date = $linkData[2];
|
2014-08-10 22:29:17 +00:00
|
|
|
$trackClicks = $redis->zScore("tracking:clicks", $id);
|
2014-08-10 00:30:10 +00:00
|
|
|
|
|
|
|
echo "
|
|
|
|
<tr class=\"success\">
|
|
|
|
<td></td>
|
2014-08-11 01:12:19 +00:00
|
|
|
<td class=\"centertab\"><a href=\"http://lob.li/$id\">$id</a></td>
|
2014-08-15 23:35:35 +00:00
|
|
|
<td><a href=\"$link\" class=\"res\">$link</a></td>
|
2014-08-10 00:30:10 +00:00
|
|
|
<td class=\"centertab\">$trackClicks</td>
|
|
|
|
<td>$date</td>
|
|
|
|
</tr>
|
|
|
|
";
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
2014-07-04 21:28:17 +00:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-3"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="footer" style="position:absolute;width:100%;bottom:1px;">
|
|
|
|
<div class="container">
|
|
|
|
<p class="text-muted">Copyright © 2014 Unified Programming Solutions - Version: 0.0.1</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
|
|
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
|
|
|
|
<!-- Include all compiled plugins (below), or include individual files as needed -->
|
2014-07-25 00:41:14 +00:00
|
|
|
<script src="Include/Bootstrap/js/bootstrap.min.js"></script>
|
2014-07-04 21:28:17 +00:00
|
|
|
|
|
|
|
<script type="text/javascript" language="JavaScript">
|
|
|
|
jQuery(document).ready(function(){
|
|
|
|
$('#statlink').addClass('active');
|
|
|
|
});
|
|
|
|
|
|
|
|
$(function(){
|
|
|
|
$(".res").each(function(i){
|
|
|
|
len=$(this).text().length;
|
|
|
|
if(len > 35){
|
|
|
|
$(this).text($(this).text().substr(0, 35) + '...');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|