tweetmonitor/index.php
2016-02-09 14:23:43 +01:00

192 lines
5.9 KiB
PHP

<?php
include('config/config.php');
include('includes/classes/class.Tweet.php');
$objTweet=new Tweet();
require 'common/display_lib.php';
$tweet_data=$objTweet->getDeletedTweets();
$searched="";
if(isset($_POST['search']))
{
$sql="";
if(!empty($_POST['search']))
{
$tweet_search=$_POST['search'];
$sql.=" AND u.screen_name='$tweet_search'";
$searched=$tweet_search;
}
$getRes = mysql_query($sql);
$page = (int)(!isset($_GET["page"]) ? 1 : $_GET["page"]);
if ($page <= 0) $page = 1;
$per_page = 5;
$startpoint = ($page * $per_page) - $per_page;
$statement = "tweets AS t
LEFT JOIN users AS u ON u.user_id=t.user_id
WHERE t.is_deleted='Y' ".$sql." ORDER BY t.deleted_at DESC";
$results = mysql_query("SELECT u.screen_name,u.name,u.profile_image_url,t.tweet_id,t.tweet_text,t.created_at,t.deleted_at FROM {$statement} LIMIT {$startpoint} , {$per_page}");
}
else
{
$MySQL = "SELECT u.screen_name,u.name,u.profile_image_url,t.tweet_id,t.tweet_text,t.created_at,t.deleted_at
FROM tweets AS t
LEFT JOIN users AS u ON u.user_id=t.user_id
WHERE t.is_deleted='Y'
ORDER BY t.deleted_at DESC";
$getRes = mysql_query($MySQL);
$page = (int)(!isset($_GET["page"]) ? 1 : $_GET["page"]);
if ($page <= 0) $page = 1;
$per_page = 5;
$startpoint = ($page * $per_page) - $per_page;
$statement = "tweets AS t
LEFT JOIN users AS u ON u.user_id=t.user_id
WHERE t.is_deleted='Y'
ORDER BY t.deleted_at DESC";
$results = mysql_query("SELECT u.screen_name,u.name,u.profile_image_url,t.tweet_id,t.tweet_text,t.created_at,t.deleted_at FROM {$statement} LIMIT {$startpoint} , {$per_page}");
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Deleted Tweets Monitor - All deleted tweets from politicians</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href="css/styleee67.css?1412676191" media="screen" rel="stylesheet" type="text/css" />
<link href="css/mainee67.css?1412676191" media="screen" rel="stylesheet" type="text/css" />
<link href="js/chosen/chosenee67.css?1412676191" media="screen" rel="stylesheet" type="text/css" />
<link href="js/tablesorter/themes/blue/styleee67.css?1412676191" media="screen" rel="stylesheet" type="text/css" />
<script src="js/jqueryee67.js?1412676191" type="text/javascript"></script>
<script src="js/jquery_ujsee67.js?1412676191" type="text/javascript"></script>
<script src="js/applicationee67.js?1412676191" type="text/javascript"></script>
<script src="js/socialite/socialite.min.js?1412676191" type="text/javascript"></script>
<link rel="icon" href="images/favicon.png" type="image/png">
<style type="text/css">
ul.pagination {
text-align:center;
color:#829994;
}
ul.pagination li {
display:inline;
padding:0 3px;
}
ul.pagination a {
color:#0d7963;
display:inline-block;
padding:5px 10px;
border:1px solid #cde0dc;
text-decoration:none;
}
ul.pagination a:hover,
ul.pagination a.current {
background:#0d7963;
color:#fff;
}
</style>
</head>
<body class="layout-politwoops">
<div id="wrapper">
<div id="header"> <a href="index.php">Deleted Tweets Monitor</a> </div>
<div id="topmenu">
<p>Find Tweets By Username</p>
<form action="" method="post">
<input id="q" name="search" type="text" placeholder="Enter Username..." value="<?php echo $searched;?>" required/>
<input type="submit" value="Search" />
</form>
</div>
<div id="breadcrumbs"> You are here :
<ul>
<li class="first"> <a href="index.php">Home</a> </li>
</ul>
</div>
<div id="content">
<div id="sharing"></div>
<div class="clear"></div>
<div id="explanation">
<p>Even politicians post things they regret later.</p>
<p>You can see the tweets they posted first, and deleted after.</p>
</div>
<div id="main">
<?php
if(mysql_num_rows($results)>0)
{
while($row = mysql_fetch_array($results))
{
$tweet_text=base64_decode($row['tweet_text']);
?>
<div id="tweet-<?php echo $row['tweet_id']; ?>" class="tweet">
<a href="https://twitter.com/<?php echo $row['screen_name'];?>" class="avatar">
<img src="<?php echo $row['profile_image_url'];?>" alt="" width"73" height="73" /><div class="clear"></div>
</a>
<div class="content">
<div class="tweet-content">
<a href="https://twitter.com/<?php echo $row['screen_name'];?>" class="user_name"><?php echo $row['screen_name'];?></a>:
<span class="tweet-actual-content">
<?php echo linkify($tweet_text);?>
</span>
</div>
<div class="byline">
<a href="https://twitter.com/<?php echo $row['screen_name'];?>" class="twitter"><?php echo $row['screen_name'];?></a>
Deleted at: <?php echo date('d/m/Y g:i a',strtotime($row['deleted_at']));?>
<img src="images/bird_16_blue.png" style="width:16px; height:16px; padding-left:10px;margin-right:0px;"/>
Was Posted at: <?php echo date('d/m/Y g:i a',strtotime($row['created_at']));?>
</div>
<div class="clear"> </div>
</div>
<!--<div class="actions">
<div class="action action-reply">
<div class="icon"> </div>
<a href="http://twitter.com/intent/tweet?in_reply_to=<?php echo $row['tweet_id'];?>" class="reply" target="_blank">reply</a>
<div class="clear"> </div>
</div>
<div class="action action-retweet">
<div class="icon"> </div>
<a href="http://twitter.com/intent/retweet?tweet_id=<?php echo $row['tweet_id'];?>" class="retweet" target="_blank">retweet</a>
<div class="clear"> </div>
</div>
</div>-->
<div class="clear"> </div>
</div>
<?php
}
}
else
{
echo "<hr/><span style='color:green'>No Record Found!</span>";
}
?>
<div id="pager">
<div class="pagination">
<?php
echo pagination($statement,$per_page,$page);
?>
</div>
</div>
<div class="clear"> </div>
</div>
</div>
</div>
<div id="footer-menu">
<a href="index.php">Home</a> |
<a href="admin/">Administrator Login</a> | &copy; 2014 Klaus-Uwe Mitterer
</div>
</body>
</html>