The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
I'm tying in to vB's user system for a site I'm working on and I'd like to display user avatars throughout the site on lots of non-vb pages. I'm having trouble getting the images to display though.
Here's the query I'm making in my avatar.php file that should display a user avatar: PHP Code:
Am I missing something? |
#2
|
|||
|
|||
![]()
Note that the userid is numeric, you don't need the quotes (it should work with the quotes, but you are making MySQL do an extra conversion for each row.)
Try the following code, I haven't tried but it should work. PHP Code:
|
#3
|
||||
|
||||
![]()
Still no go. I really have no idea why. Maybe I need some tips on debugging this? I've got error reporting set to E_ALL and it's not giving me anything related to this.
|
#4
|
|||
|
|||
![]()
I just tried it, and it works. You can see it working here: http://www.nuhit.com/test/getavatar.php?userid=86
Here is my full code: (you would need to change the location of your forums in the config_filename variable). PHP Code:
|
#5
|
||||
|
||||
![]()
That's so odd. That very thing doesn't work for me. It's not throwing any errors and if I remove the header() stuff it displays the contents (letters/numbers) of the 'filedata' field.
Could it be something with my version of PHP/MySQL? I'm running PHP 5.1.6 and MySQL 4.1.2-standard. |
#6
|
|||
|
|||
![]()
I am using PHP 5.1 with MySQL 5.
However, if the avatars are shown fine in your forum, then they should show using this script. I "adapted" the code found in vBulletin's image.php. Which brings me to the next point, why don't you use image.php directly?: http://www.nuhit.com/forums/image.php?userid=86 |
#7
|
||||
|
||||
![]()
Well, I'm ultimately wanting to resize the avatars to various sizes depending on their locations throughout the site...so I'm wanting to pass the image through my GD resizing stuff.
|
#8
|
|||
|
|||
![]()
Oh, I see.
You could save the data returned by the query into a local file in your server and compare it with the file returned by image.php, they should be binarily the same. |
#9
|
||||
|
||||
![]()
Ah. Any tips on doing that?
|
#10
|
|||
|
|||
![]()
You could do this:
$filename = 'my_' . $row['filename']; $fp = fopen( $filename, 'wb' ); if ($fp) { fwrite( $fp, $row['filedata'] ); fclose( $fp ); } |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|