run sql
Code:
CREATE TABLE IF NOT EXISTS `shout_an` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`uid` varchar(8) NOT NULL,
`tid` varchar(255) NOT NULL,
`uname` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`sname` varchar(25) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL DEFAULT '',
`added` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`xxx` enum('yes','no') NOT NULL DEFAULT 'no',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4231 ;
1) Create a new file called "new_content.php and save too www root
new_content.php
PHP Code:
<?php
//////////////////////////////////New user and torrent announce with jQuery call and update///////////////////////////////
///////////////////////////////// Including time after and number online in words //////////////////////////////
///////////////////////////////// Created by firefly //////////////////////////////
require_once("include/bittorrent.php");
dbconn(false);
function pril($prilin){
if ($prilin > "1"){ $sword = "s ";}else{$sword = " ";}
return $sword;
}
function onlinen(){
global $CURUSER;
if ($CURUSER["stylesheet"] == "4"){ $st = "<font color='#FFF'> online</font>";}else{$st = "<font color='#830f06'> online</font>";}
return $st;
}
function tti($proptime,$intime)
{
$diff = abs(strtotime($proptime) - strtotime($intime));
$years = floor($diff / (365*60*60*24));
$months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24));
$days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24));
$hours = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24)/ (60*60));
$minuts = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60)/ 60);
$seconds = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60 - $minuts*60));
if (empty($years)){echo"";}else{$yearp = $years;}
if (empty($months)){echo"";}else{$monthsp = $months;}
if (empty($days)){echo"";}else{$daysp = $days;}
if (empty($hours)){echo"";}else{$hoursp = $hours;}
if (empty($minuts)){echo"";}else{$minutsp = $minuts;}
if (empty($seconds)){echo"";}else{$secondsp = $seconds;}
if (empty($years)){echo"";}else{$yw = " Years ";}
if (empty($months)){echo"";}else{$mo = " Month ";}
if (empty($days)){echo"";}else{$da = " Day ";}
if (empty($hours)){echo"";}else{$ho = " Hour".pril($hours)."";}
if (empty($minuts)){echo"";}else{$mi = " Minute".pril($minuts)." ";}
if (empty($seconds)){echo"";}else{$sec = " Second".pril($seconds)."";}
$outime = $pretxt . $yearp . ($yw) . $monthsp . ($mo) . $daysp . ($da) . $hoursp . ($ho) . $minutsp . ($mi) . $secondsp . ($sec);
return $outime;
}
$res = mysql_query("SELECT id, uid, tid, sname, uname, added FROM shout_an ORDER BY id DESC LIMIT 1")or die(mysql_error());
$row = mysql_fetch_array($res);
$res2 = mysql_query("SELECT id, name, added, category FROM torrents WHERE id = '".$row["tid"]."' ORDER BY id DESC LIMIT 1")or die(mysql_error());;
$row2 = mysql_fetch_array($res2);
$rescat = mysql_query("SELECT image FROM categories WHERE id = '".$row2["category"]."' ORDER BY id DESC LIMIT 1")or die(mysql_error());
$rowcat = mysql_fetch_array($rescat);
if (empty($row['tid']))$out_cat = " <img src='/pic/kim.png' width='25' height='25' id='newcat'>";else {$out_cat = "<img src='/pic/" . $rowcat['image'] . "' width='25' height='25' id='newcat'>";}
$diff = tti(date('Y-m-d H:i:s.u'),$row["added"]);
$shortname =substr(htmlspecialchars($row2["name"]) , 0, 60);
if ($shortname != htmlspecialchars($row2["name"])){$shortname .= ' ...';}
if (empty($row['tid'])){$out_name = "<strong><font color='#c4480c'>New User:</font></strong> <a href='/userdetails.php?id=". $row['uid'] ."'target='_blank'><font color='#4e063e'>".$row['uname']."</font></a>";} else if (empty($row['uid'])) {$out_name = "<strong><font color='#c4480c'>New Release:</font></strong> <a href='/details.php?id=". $row2['id'] ."'target='_blank'>".$shortname."</a>";
}
$dt = gmtime() - 3600;
$dt = sqlesc(get_date_time($dt));
$reso = mysql_query("SELECT SUM(last_access >= $dt) AS totalol FROM users") or sqlerr(__FILE__, __LINE__);
while ($rowo = mysql_fetch_array ($reso))
{
$getusers = $rowo["totalol" ];
}
switch ($getusers){
case "1":$tone = "<font size=2 color='#0066ff'>One:</font>";break;
case "2":$tone = "<font size=2 color='#059136'>Two:</font>";break;
case "3":$tone = "<font size=2 color='#04792d'>Three:</font>";break;
case "4":$tone = "<font size=2 color='#035e23'>Four:</font>";break;
case "5":$tone = "<font size=2 color='#024f1d'>Five:</font>";break;
case "6":$tone = "<font size=2 color='#0f87f7'>Six:</font>";break;
case "7":$tone = "<font size=1 color='#0d78dc'>Seven:</font>";break;
case "8":$tone = "<font size=1 color='#0a60b0'>Eight:</font>";break;
case "9":$tone = "<font size=1 color='#07427a'>Nine:</font>";break;
case "10":$tone = "<font size=1 color='#19ba20'>Ten:</font>";break;
case "11":$tone = "<font size=1 color='#959705'>Eleven:</font>";break;
case "12":$tone = "<font size=1 color='#927314'>Twelve:</font>";break;
case "13":$tone = "<font size=1 color='#094dca'>thirteen:</font>";break;
case "14":$tone = "<font size=1 color='#65990b'>fourteen:</font>";break;
case "15":$tone = "<font size=1 color='#446706'>Fifteen:</font>";break;
case "16":$tone = "<font size=1 color='#5c1af0'>Sixteen:</font>";break;
case "17":$tone = "<font size=1 color='#4b14c8'>Seventeen:</font>";break;
case "18":$tone = "<font size=1 color='#3a0f9a'>Eighteen:</font>";break;
case "19":$tone = "<font size=1 color='#2a0e69'>Nineteen:</font>";break;
case "20":$tone = "<font size=1 color='#18063f'>Twenty:</font>";break;
case "21":$tone = "<font size=1 color='#18063f'>Twenty1:</font>";break;
case "22":$tone = "<font size=1 color='#18063f'>Twenty2:</font>";break;
case "23":$tone = "<font size=1 color='#18063f'>Twenty3:</font>";break;
case "24":$tone = "<font size=1 color='#18063f'>Twenty4:</font>";break;
case "25":$tone = "<font size=1 color='#18063f'>Twenty5:</font>";break;
case "26":$tone = "<font size=1 color='#18063f'>Twenty6:</font>";break;
case "27":$tone = "<font size=1 color='#18063f'>Twenty7:</font>";break;
case "28":$tone = "<font size=1 color='#18063f'>Twenty8:</font>";break;
case "29":$tone = "<font size=1 color='#18063f'>Twenty9:</font>";break;
default:$tone = "<font size=1 color='#1324a4'>+30:</font>";}
$show =
"
<table width='100%'border='0'>
<tr>
<td width='25'height='40' class='newt'>" . $out_cat . "</td>
<td width='' height='' class='newt'> " . $out_name . " </a><class='newt'></td>
<td width='280' height='' class='newt'><center><font color='#0d66df'>Added: </font>" . $diff . " <font color='#0d66df'>ago.</div>
</center></td><td width='107' class='newt'><center><div class='usertit'>$tone ".onlinen()."</center></div></td>
</tr>
</table>
";
$showe =
"
<table width='100%'>
<tr>
</center></td><td width='115' class='newt' align='right'>$tone <font color='#0cc24c'><a href='/users.php'><img src='/pic/kim.png' alt='online' width='15' height='15' border='0' id='newuseronline'></a> online</font></div> </td>
</tr>
</table>
";
if (empty($row['id'])){
print $showe;
}else {
print $show;
}
2) Add this in above </head> in bittorrent.php
Code:
<script>
$(document).ready(function() {
$("#load").load("new_content.php");
var refreshId = setInterval(function() {
$("#load").load('new_content.php?randval='+ Math.random());
}, 1000);
$.ajaxSetup({ cache: false });
});
</script>
3)Now add this to index.php, I added mine above the shoutbox
Code:
<div id='load'></div>
4) Now edit takeupload.php and add this above
header("Location: $BASEURL/details.php?id=$id&uploaded=1");
Code:
$dt1 = date('Y-m-d H:i:s');
mysql_query("INSERT INTO shout_an ( tid, sname, date) VALUES (" . $id . ", " . $torrent . ", " . $dt1 . ")") OR sqlerr(__FILE__, __LINE__);
and add this to takesignup.php above
header("Refresh: 0; url=ok.php?type=signup&email=" . urlencode($email));
Code:
$dt1 = date('Y-m-d H:i:s');
mysql_query("INSERT INTO shout_an ( uid, date) VALUES (" . $id . ", " . $dt1 . ")") OR sqlerr(__FILE__, __LINE__);
5) now add this to your stylesheet
Code:
td.newt {
font-size: 12px;
height: 25px;
background-color: transparent;
border-right-style: solid;
border-left-style: solid;
border-right-width: thin;
border-bottom-width: thin;
border-left-width: thin;
border-bottom-style: solid;
border-right-color: #212221;
border-bottom-color: #212221;
border-left-color: #212221;
}