<commit_before><?php
//  AcmlmBoard XD - Posts by user viewer
//  Access: all

AssertForbidden("listPosts");

if(!isset($_GET['id']))
	Kill(__("User ID unspecified."));

$id = (int)$_GET['id'];

$qUser = "select * from users where id=".$id;
$rUser = Query($qUser);
if(NumRows($rUser))
	$user = Fetch($rUser);
else
	Kill(__("Unknown user ID."));
$bucket = "userMangler"; include("./lib/pluginloader.php");

$title = __("Post list");

$total = $user['posts'];
$ppp = $loguser['postsperpage'];
if(isset($_GET['from']))
	$from = (int)$_GET['from'];
else
	$from = 0;

if(!$ppp) $ppp = 25;

$minpower = $loguser['powerlevel'];
if($minpower < 0)
	$minpower = 0;

$qPosts = "	SELECT 
				p.thread, p.id, p.date, p.num, p.deleted, p.options, p.mood, p.ip, 
				pt.text, pt.revision, 
				u.id as uid, u.name, u.displayname, u.rankset, u.powerlevel, u.title, u.sex, u.picture, u.posts, u.postheader, u.signature, u.signsep, u.lastposttime, u.lastactivity, u.regdate,
				(u.globalblock OR !ISNULL(bl.user)) layoutblocked,
				t.id thread, t.title threadname,
				f.id fid
			FROM 
				posts p 
				LEFT JOIN posts_text pt ON pt.pid = p.id AND pt.revision = p.currentrevision
				LEFT JOIN users u ON u.id = p.user
				LEFT JOIN blockedlayouts bl ON bl.user=u.id AND bl.blockee=".$loguserid."
				LEFT JOIN threads t ON t.id=p.thread
				LEFT JOIN forums f ON f.id=t.forum
				LEFT JOIN categories c ON c.id=f.catid
			WHERE u.id=".$id." AND f.minpower <= ".$minpower."
			ORDER BY date ASC LIMIT ".$from.", ".$ppp;

$rPosts = Query($qPosts);
$numonpage = NumRows($rPosts);<commit_msg>Add post revision info to listposts as well.<commit_after><?php
//  AcmlmBoard XD - Posts by user viewer
//  Access: all

AssertForbidden("listPosts");

if(!isset($_GET['id']))
	Kill(__("User ID unspecified."));

$id = (int)$_GET['id'];

$qUser = "select * from users where id=".$id;
$rUser = Query($qUser);
if(NumRows($rUser))
	$user = Fetch($rUser);
else
	Kill(__("Unknown user ID."));
$bucket = "userMangler"; include("./lib/pluginloader.php");

$title = __("Post list");

$total = $user['posts'];
$ppp = $loguser['postsperpage'];
if(isset($_GET['from']))
	$from = (int)$_GET['from'];
else
	$from = 0;

if(!$ppp) $ppp = 25;

$minpower = $loguser['powerlevel'];
if($minpower < 0)
	$minpower = 0;

$qPosts = "	SELECT 
				p.thread, p.id, p.date, p.num, p.deleted, p.options, p.mood, p.ip, 
				pt.text, pt.revision, pt.user AS revuser, pt.date AS revdate,
				u.id as uid, u.name, u.displayname, u.rankset, u.powerlevel, u.title, u.sex, u.picture, u.posts, u.postheader, u.signature, u.signsep, u.lastposttime, u.lastactivity, u.regdate,
				(u.globalblock OR !ISNULL(bl.user)) layoutblocked,
				u2.name AS ru_name, u2.displayname AS ru_dn, u2.powerlevel AS ru_power, u2.sex AS ru_sex,
				t.id thread, t.title threadname,
				f.id fid
			FROM 
				posts p 
				LEFT JOIN posts_text pt ON pt.pid = p.id AND pt.revision = p.currentrevision
				LEFT JOIN users u ON u.id = p.user
				LEFT JOIN blockedlayouts bl ON bl.user=u.id AND bl.blockee=".$loguserid."
				LEFT JOIN users u2 ON u2.id = pt.user
				LEFT JOIN threads t ON t.id=p.thread
				LEFT JOIN forums f ON f.id=t.forum
				LEFT JOIN categories c ON c.id=f.catid
			WHERE u.id=".$id." AND f.minpower <= ".$minpower."
			ORDER BY date ASC LIMIT ".$from.", ".$ppp;

$rPosts = Query($qPosts);
$numonpage = NumRows($rPosts);
{'fraction_non_alphanumeric': 0.17769827072152652, 'fraction_numerical': 0.004770423375074538, 'mean_word_length': 3.6727019498607243, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '309175', 'n_tokens_mistral': 1443, 'n_tokens_neox': 1305, 'n_words': 345}