Need a script to grab a user's avatar for use in MyCode...
I have a Blog section set up in my forum, which outputs on the main section of my website.

I was thinking of having a MyCode (based on their username), which would have them input the URL to their current avatar. But what if the user changes the URL of their avatar?

So, thus, is there anyway to somehow create a MyCode which takes their UID, grabs their avatar code, and outputs it, so even if they change it, the script is finding the "current" avatar, so there isn't the issue of a old URL in the code.
Avatar by Rein.
This is a polugin which i made time ago for some friends, i hope it could help you.

The MyCode is:

Now i optimized the code. Just replaced preg_match and str_replace with preg_replace_callback.

Attached Files
.php   avgrab.php (Size: 614 bytes / Downloads: 137)
I'll test it out when I mess w/ my forum again in a few days. I'll letcha know how it works. Smile
Avatar by Rein.
I need to have the MyCode output this HTML...

<td valign="top" width="10%"><img src="$1" align="left" hspace="6" vspace="6" /></td>
<td width="90%">

How would the plugin be edited to allow for this? I tried doing it myself, but I kept having issues...
Avatar by Rein.
It is simple PHP. Smile

return $user['avatar'];
Replace with
return '<table><tr>
<td valign="top" width="10%"><img src="' . $user['avatar'] . '" align="left" hspace="6" vspace="6" /></td>
<td width="90%">';
Thanks. Smile
Avatar by Rein.

Forum Jump:

Users browsing this thread: 1 Guest(s)