This repository has been archived on 2023-09-19. You can view files and clone it, but cannot push or open issues or pull requests.
AcmlmboardZero/postsbyuser.php

72 lines
2.0 KiB
PHP

<?php
require("function.php");
require("layout.php");
$forums=mysqli_query($con,"SELECT * FROM forums");
$user=mysqli_fetch_array(mysqli_query($con,"SELECT * FROM users WHERE id=$_GET[id]"));
$posts=mysqli_query($con,"SELECT * FROM posts WHERE user = $_GET[id]");
$numposts=mysqli_num_rows($posts);
print $header;
$forumid=$threads[$id][0];
// $posttotal=0;
$postlist="";
$tccellha="<td bgcolor=$tableheadbg";
$tccellhb="><center>$fonthead";
$postlist="$tccellha width=40$tccellhb$smallfont"."Post id</td>
$tccellha width=40$tccellhb$smallfont"."Post#</td>
$tccellha width=130$tccellhb$smallfont"."Posted on</td>
$tccellha$tccellhb$smallfont"."Thread</td>";
if ($logpassword!="" and $users[powerlevel]>1) {
$postlist.="$tccellha width=110$tccellhb$smallfont"."IP address</td>";
}
$postlist.="<tr>";
/*
$i=0;
while ($posts[$i][0]!="") {
$i++;
}
*/
$i=1;
while ($post = mysqli_fetch_array($posts)){
//$i--;
//$post=$posts[$i];
//if ($post[1]==$id) {
// $posttotal++;
// if ($post[5]=="" or $post[5]==0) {
// $post[5]="?";
// }
$thread=mysqli_fetch_array(mysqli_query($con,"SELECT * FROM threads WHERE id = $post[thread]"));
$postlist.="$tccell1$smallfont"."#$post[id]</td>
$tccell1$smallfont#$i</td>
$tccell1$smallfont".date("m-d-y h:i:s A",$post[date])."</td>
$tccell1$smallfont</center><a href=thread.php?id=$post[thread]>".$thread[title]."</a></td>";
if ($logpassword!="" and $users[powerlevel]>1) {
$postlist.="$tccell1$smallfont$post[ip]</td>";
}
$postlist.="<tr>";
$i++;
}
print "$fonttag"."Posts by $user[name] on the board: ($numposts posts found)
<table border=0 bgcolor=$tableborder width=$tablewidth align=center cellpadding=0 cellspacing=0>
<td>
<table border=0 cellpadding=2 cellspacing=1 width=100% bgcolor=$tableborder>
";
print "$postlist
</table>
</td>
</table>
";
print "$footer";
?>