mirror of
https://github.com/Xkeeper0/jul.git
synced 2025-08-02 21:21:59 -07:00
css
errors
ext
images
js
lib
numgfx
schemes
tlayouts
.gitignore
.htaccess
README.md
acs.php
activeusers.php
activity.php
activity2.php
activity3.php
activity3u.php
admin-editforums.php
admin-editmods.php
admin-slammer.php
admin-threads.php
admin-threads2.php
admin.php
adnonsense.php
announcement.php
avatar.php
biggestposters.php
calendar.php
del.php
digits.png
digits4.png
digits8.png
digitstiny.png
doomcounter.php
editpost.php
editprofile.php
editthread.php
edituser.php
faq.php
favicon-star.ico
favicon.gif
favicon.ico
favicon.php
favicon1.ico
favicon1x.ico
favicon2.ico
favicon2x.ico
favicon3.ico
favicon3x.ico
favicon4.ico
favicon4x.ico
favicon5.ico
favicon5x.ico
favicon6.ico
favicon6x.ico
favicon7.ico
favicon7x.ico
favicon8.ico
favicon8x.ico
forum.php
hex.php
idiotredir.php
index.php
ipsearch.php
irc.php
latestposts.php
login.php
memberlist.php
milestones.php
mobile.css
newreply.php
newthread.php
newyear.php
numgfx.php
numgfxbig.php
online.php
perfdata.php
posticons.dat
postradar.php
postsbyforum.php
postsbythread.php
postsbytime.php
postsbyuser.php
ppdgauge.php
private.php
profile.php
ranks.php
register.php
robots.txt
sendprivate.php
shitbugs.php
shop.php
shoped.php
shoph.php
showprivate.php
sigsize.php
smilies.dat
smilies.php
smilies2.dat
smilies2.php
smilieslol.dat
stats.php
status.php
thread.php
94 lines
3.9 KiB
PHP
94 lines
3.9 KiB
PHP
<?php
|
|
require 'lib/function.php';
|
|
$maxtime = (($_GET['t']) ? max(min($_GET['t'], 86400), 60) : false);
|
|
$maxposts = (($_GET['p']) ? max(min($_GET['p'], 100), 1) : false);
|
|
if ($maxtime === false && $maxposts === false) $maxposts = 50; // Default
|
|
|
|
$data = $sql->query(
|
|
"SELECT p.id, p.user, p.date as date, f.title as ftitle, t.forum as fid, t.title as title, ".
|
|
"u.name as uname, u.sex as usex, u.powerlevel as upowerlevel ".
|
|
(($log) ? ", r.read AS tread, r.time as treadtime " : "").
|
|
"FROM `posts` p ".
|
|
"LEFT JOIN `threads` t ON p.thread = t.id ".
|
|
"LEFT JOIN `forums` f ON t.forum = f.id ".
|
|
"LEFT JOIN `users` u ON p.user = u.id ".
|
|
(($log) ? "LEFT JOIN threadsread r ON (t.id=r.tid AND r.uid=$loguser[id]) " : "").
|
|
"\n WHERE f.minpower <= '". $loguser['powerlevel'] ."' ".
|
|
"AND p.date >= ".(($maxtime !== false) ? (ctime()-$maxtime) : (ctime()-86400*7))." ". // time limit here
|
|
(($_GET['lastid']) ? "AND p.id > $_GET[lastid] ":"").
|
|
"\nORDER BY `id` DESC ".
|
|
(($maxposts !== false) ? "LIMIT 0, $maxposts" : '') // posts limit here
|
|
);
|
|
$_count = @mysql_num_rows($data);
|
|
|
|
$output = "";
|
|
if ($_GET['raw']) {
|
|
$outarray = array('id', 'ftitle', 'fid', 'title', 'uname', 'upowerlevel', 'usex', 'ucolor', 'date', 'user');
|
|
$outchunks = Array();
|
|
}
|
|
|
|
$windowtitle = "$boardname - A revolution in posting technology™";
|
|
require 'lib/layout.php';
|
|
|
|
if($log && !$_GET['raw']) {
|
|
$headlinks.=' - <a href=index.php?action=markallforumsread>Mark all posts read</a>';
|
|
$header=makeheader($header1,$headlinks,$header2);
|
|
|
|
$forumread = $sql->getresultsbykey("SELECT forum,readdate FROM forumread WHERE user=$loguserid", 'forum', 'readdate');
|
|
}
|
|
|
|
$_counter = 1;
|
|
while ($in = $sql->fetch($data, MYSQL_ASSOC)) {
|
|
if (!$_GET['raw']) {
|
|
if ($log && $in['date'] > max($forumread[$in['fid']], $in['treadtime']))
|
|
$newpost = $statusicons['new']." ";
|
|
else $newpost = "";
|
|
$output .= "<tr>
|
|
$tccell2>". $in['id'] ."</td>
|
|
$tccell2><a href='forum.php?id=". $in['fid'] ."'>". $in['ftitle'] ."</a></td>
|
|
$tccell1l>$newpost<a href='thread.php?pid=". $in['id'] ."&r=1#". $in['id'] ."'>". $in['title'] ."</a></td>
|
|
$tccell1><a href='profile.php?id=". $in['user'] ."'><font ". getnamecolor($in['usex'], $in['upowerlevel']) .">". $in['uname'] ."</font></a></td>
|
|
$tccell2>". timeunits(ctime() - $in['date']) ."</td>
|
|
</tr>\n";
|
|
}
|
|
else {
|
|
$in['ucolor'] = str_replace('color=', '', getnamecolor($in['usex'], $in['upowerlevel']));
|
|
$in['title'] = str_replace("\\", "\\\\", $in['title']);
|
|
$temp = Array();
|
|
foreach($outarray as $outkey)
|
|
$temp[] = ('"'.$outkey . "\":\"" . htmlspecialchars($in[$outkey]) . '"');
|
|
$temp = "{".implode(",",$temp)."}".($_counter == $_count ? "" : ",");
|
|
$output .= $temp;
|
|
}
|
|
$_counter++;
|
|
}
|
|
|
|
if (!$_GET['raw']) {
|
|
/* Doesn't work, as far as I'm aware?
|
|
if ($_GET['fungies']) {
|
|
$jscripts = '<script type="text/javascript" src="/js/jquery.min.js"></script><script type="text/javascript" src="/js/latestposts.js"></script>';
|
|
} */
|
|
print "
|
|
$header
|
|
Show:$smallfont
|
|
<br>Last <a href='?t=1800'>30 minutes</a> - <a href='?t=3600'>1 hour</a> - <a href='?t=18000'>5 hours</a> - <a href='?t=86400'>1 day</a>
|
|
<br>Most recent <a href='?p=20'>20 posts</a> - <a href='?p=50'>50 posts</a> - <a href='?p=100'>100 posts</a>
|
|
<table class='table' cellspacing='0' name='latest'>
|
|
<tr>$tccellc colspan=6><b>Latest Posts</b></td></tr>
|
|
<tr>
|
|
$tccellh width=30> </td>
|
|
$tccellh width=280>Forum</td>
|
|
$tccellh width=*>Thread</td>
|
|
$tccellh width=200>User</td>
|
|
$tccellh width=130>Time</td>
|
|
</tr>
|
|
$output
|
|
". $tblend . $jscripts . $footer;
|
|
printtimedif($startingtime);
|
|
}
|
|
else {
|
|
header("Content-type: text/plain");
|
|
header("Ajax-request: ".IS_AJAX_REQUEST);
|
|
print '{"tzoff": "'.$tzoff.'", "localtime": "'.ctime().'", "posts": ['.$output."]}";
|
|
}
|