Jump to content

Forum Avatar


SoireeExtreme

Recommended Posts

I have a forum set up just like any other forum it has the posters name, date, and whatnot. But I want to include an avatar(picture). I have the area for it already set up. And I have a an avatar database. The avatar is stored under users an not forum. So my question is.....

[color=red]How do I go about getting it to show the avatar of the poster?[/color]

Because with the way I have it set up it shows the avatar of the user who is looking at the page of that session.

This is my code:[color=maroon]
<center><img src='$userstats3[avatar]' width='75' height='75'></center>[/color]

So again..[color=red] How do I go about getting it to show the avatar of the poster?[/color] If more code is needed I'd be more than happy to post it. Let me know. Thanks in advance for any and all help possible.
Link to comment
https://forums.phpfreaks.com/topic/26719-forum-avatar/
Share on other sites


$userstats3[] must reference the current user. You need to select the poster's image at the same time that you select the poster's name.

What is the query that you use to select the posts' information with? IE, the query that would return "SoireeExtreme" and "Today at 02:03:06" from the DB for your first post in this thread.
Link to comment
https://forums.phpfreaks.com/topic/26719-forum-avatar/#findComment-122224
Share on other sites

I use this to call forth the forum, posters, date and such.

  $postID=$_GET['postID'];
  $forum="SELECT * from ac_ghforum where postID='$postID'";
  $forum2=mysql_query($forum) or die("Could not query forum");
  while($forum3=mysql_fetch_array($forum2))


And this to call forth the user and any user stats and AVATAR.

    $player=$_SESSION['player'];
    $userstats="SELECT * from ac_users where playername='$player'";
    $userstats2=mysql_query($userstats) or die("Could not get user stats");
    $userstats3=mysql_fetch_array($userstats2);

Since this is where the avatar is located.

I've tried up and down and have been unable to to figure it out myself. As I am still fairly new to php/mysql.
Link to comment
https://forums.phpfreaks.com/topic/26719-forum-avatar/#findComment-122232
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.