Takara
06-08-2002, 10:06 AM
Im trying to use some stuff that FireFly did before to add the number of times a user made a new thread in a certin amount of forums (they work as columns).
Inside of members.php I added the following
// get the total number of columns posted
$columns=$DB_site->query("SELECT postuserid,count(*) AS totalcolumns FROM thread WHERE forumid IN (25,26,27,28,29,30,31) AND postuserid = $userid GROUP BY postuserid");
if (!isset($columns[totalcolumns])) {
$total_columns="";
} else {
eval("\$total_columns = \"".gettemplate("column_total")."\";");
}
Thats near the bottem, then of course I have a template column_total, it simply reads<tr>
<td bgcolor="{firstaltcolor}"><normalfont><b>Total <a href="forumdisplay.php?s=$session[sessionhash]&forumid=24">Columns</a>:</b></normalfont></td>
<td bgcolor="{firstaltcolor}"><normalfont>$columns[totalcolumns]</normalfont></td>
</tr>
And then inside my getinfo template I put $total_columns right after the 'Total Posts:' part. Thing is, it always returns as not set (I know because I assigned a value where it says $total_columns=""; )
Im assuming the problem is that $userid isnt right, I also tried $user[userid]. How can I get the userid of the profile that is being requested?
Thanks :bunny:
Inside of members.php I added the following
// get the total number of columns posted
$columns=$DB_site->query("SELECT postuserid,count(*) AS totalcolumns FROM thread WHERE forumid IN (25,26,27,28,29,30,31) AND postuserid = $userid GROUP BY postuserid");
if (!isset($columns[totalcolumns])) {
$total_columns="";
} else {
eval("\$total_columns = \"".gettemplate("column_total")."\";");
}
Thats near the bottem, then of course I have a template column_total, it simply reads<tr>
<td bgcolor="{firstaltcolor}"><normalfont><b>Total <a href="forumdisplay.php?s=$session[sessionhash]&forumid=24">Columns</a>:</b></normalfont></td>
<td bgcolor="{firstaltcolor}"><normalfont>$columns[totalcolumns]</normalfont></td>
</tr>
And then inside my getinfo template I put $total_columns right after the 'Total Posts:' part. Thing is, it always returns as not set (I know because I assigned a value where it says $total_columns=""; )
Im assuming the problem is that $userid isnt right, I also tried $user[userid]. How can I get the userid of the profile that is being requested?
Thanks :bunny: