Page 1 of 1

Problem displaying phpbb avatars outside of forum

Posted: Thu Mar 31, 2011 12:31 pm
by mareksl
Hey!
I have successfully integrated some of phpbb's functions with my website, such as the login system and a part of the user profiles.
The problem is, when I try displaying the avatars of the users, the avatar does not show up.
First of all, I checked, and the filename of the avatar in the database is different from the actual filename in the "forum/images/avatars/upload" directory.
Then, even when I manually tried to correct the filename (just to try it out) it gives me a 403 error.
How can I display the user avatar on my site successfully?
Here is my current code:

Code: Select all

<?php
$user = $_GET["user"];
$con = mysql_connect("localhost","***","***");
if (!$con) {die('Could not connect: ' . mysql_error());}
mysql_select_db("db_kitchentube", $con);
$result = mysql_query("SELECT * FROM phpbb_users WHERE username_clean = '$user'");
And later:

Code: Select all

<img class="user" src="forum/images/avatars/upload/<?php echo $row['user_avatar'] ?>" width="90px" height="90px" alt="pic" /></a>
Thanks!

Re: Problem displaying phpbb avatars outside of forum

Posted: Thu Mar 31, 2011 3:17 pm
by McInfo
Can you use phpBB's download script?

Code: Select all

forum/download/file.php?avatar=0_1234567890.jpg

Re: Problem displaying phpbb avatars outside of forum

Posted: Fri Apr 01, 2011 6:09 am
by mareksl
Thanks, it's working! :)