When someone posts a topic on my forums and you click there username it goes to there profile by there ID but if someone replies and you go to click there username it is linking you to the first posters ID and going to there profile. I have used the same code as I have for my user list and topic area and they all work fine.
Example:
Poster1 - ?page=profiles&id=1
Post2 - ?page=profiles&id=1 but there ID should be 2
View:
http://www.effectivegaming.com/epane...rums&topicid=1
http://www.effectivegaming.com/epane...ums&topicid=10
Roll over the usernames and see how anyone who replies gets the same userid as the first poster.
Code:
PHP Code:
include("db.php");
$query="SELECT epanelforums_topics.*,epanelforums_posts.topic_id AS topic_id, epanelforums_posts.post_description AS post_description, epanelforums_posts.author AS fp_author, epanelforums_posts.date_time AS fp_date_time, epanelusers.id AS userid FROM epanelforums_topics, epanelforums_posts, epanelusers WHERE epanelforums_topics.author=epanelusers.username AND epanelforums_topics.id=\"$topicid\"";
$result=mysql_query($query);
$result2=mysql_query($query);
$row=mysql_fetch_array($result2);
$topicid=$row["id"];
$topic=$row["topic"];
$topic_description=$row["topic_description"];
$author=$row["author"];
$userid=$row["userid"];
$date_time=$row["date_time"];
echo "<font face=verdana size=1 color=#000000>
* Forums :: <a href=?page=forums>Main</a> - <a href=?page=forums§ion=search>Search</a>
</font>
<p>
<table width=550 border=0 cellpadding=0>
<tr>
<td width=325 bgcolor=#f6f6f6 scope=col><div align=center><font face=verdana size=1 color=#000000><b>Topic</b></font></div></td>
<td width=100 bgcolor=#f6f6f6 scope=col><font face=verdana size=1 color=#000000><b>Author</b></font></td>
<td width=190 bgcolor=#f6f6f6 scope=col><font face=verdana size=1 color=#000000><b>Date & Time</b></font></td>
</tr>";
echo "<tr>
<td width=325 bgcolor=#f6f6f6 scope=col><font face=verdana size=1 color=#000000><b>$topic</b></font></td>
<td width=100 bgcolor=#f6f6f6 scope=col><font face=verdana size=1 color=#000000><a href=?page=profiles&userid=$userid>$author</a></font></td>
<td width=190 bgcolor=#f6f6f6 scope=col><font face=verdana size=1 color=#000000>date</font></td>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
<td colspan=3 scope=col><font face=verdana size=1 color=#000000>$topic_description</font></td>
</tr>
<tr>
</tr>
<tr>
</tr>";
while($row = mysql_fetch_array($result)) {
$topicid=$row["id"];
$topic_id=$row["topic_id"];
$post_description=$row["post_description"];
$fp_author=$row["fp_author"];
$userid=$row["userid"];
$fp_date_time=$row["fp_date_time"];
if($topic_id == $topicid)
{
echo "<tr>
<td width=325 bgcolor=#f6f6f6 scope=col><font face=verdana size=1 color=#000000> </font></td>
<td width=100 bgcolor=#f6f6f6 scope=col><font face=verdana size=1 color=#000000><a href=?page=profiles&userid=$userid>$fp_author</a></font></td>
<td width=190 bgcolor=#f6f6f6 scope=col><font face=verdana size=1 color=#000000>date</font></td>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
<td colspan=3 scope=col><font face=verdana size=1 color=#000000>$post_description</font></td>
</tr>
<tr>
</tr>
<tr>
</tr>";
|