vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Remotely Hosted Avatars (https://vborg.vbsupport.ru/showthread.php?t=61948)

Dataforce 02-25-2004 10:00 PM

Remotely Hosted Avatars
 
Adapted from here

**NO SUPPORT GIVEN**
**USE AT YOUR OWN RISK**

=======

This has been tested, and works on VB3 RC4

not sure about other browsers.

This checks the image dimensions and if its a real image, but does NOT check the file size as the image is not being uploaded to the server, it is eing linked remotely.

Dimension checking is so that it can't screw up layouts.

=======

If A user already has an avatar that is NOTremotely hosted - it will be displayed, else the remotely hsoted avatar will be displayed.

to include the avatar in other places on your site, add an if statement:
PHP Code:

if ($post[avatar2] != '' AND $post[avatar2] != "http://www." AND $post[avatar2] != "http://"  AND $post[avatar2] != "www.") {
        
$post['avatarurl'] = $post[avatar2];


Another alternative (which unfortunatly adds another query) if you only have the userid is:

PHP Code:

$pic $DB_site->query("SELECT * FROM `"TABLE_PREFIX ."user` WHERE userid = ".$userid);
$piccy $DB_site->fetch_array($pic) ;
if (
$piccy['avatar2'] != '' AND $piccy['avatar2'] != "http://www." AND $piccy['avatar2'] != "http://"  AND $piccy['avatar2'] != "www.") {
        
$avatarurl $piccy['avatar2'];


(Replace $avatarurl with whatever the variable is for the url of the avatar to show ;) )
=======
Requires:

File Modifications: 6
File Uploads: 0
SQL Queries: 1
Template additions: 0
Template Changes: 0

=======
Enjoy

-DF

Edit: Attatched ;)

Edit: Fixed Small bugs
- Incomplete lines from editing in pico
- if avatar2 was "http://www." for some reason - it displayed no avatar, rather than the old avatar.

Edit: Added Ability for users to still use predefined avatars or no avatar (In last 2 If statements made it set avatar2 to http://www.)

if user enters NONE in the customavatar URL field - it also sets their avatar to no avatar. (Its up to you to change the phrase if you want your members to know - else they can use the "no avatar" setting above as normal)

Works in member.php aswell now

Edit: Fixed more Pico erros and added example of getting avatar url direclty from DB

alkatraz 02-26-2004 08:21 PM

thx!

Gio Takahashi 02-27-2004 12:52 AM

I really could use something like this. Thanks for the hack and nice job!

dutchbb 03-07-2004 02:37 PM

finally!! thanks alot

Mr. Natural 04-07-2004 01:01 AM

I'm pretty ignorant on this query stuff. Is this something I have to run with something like phpadmin? We're setting up a new site and it's going to have a very large membership. We'd kinda like to set this up but I'm unknowing when it comes to mysql and playing around with it. If I could receive a little better explanation on how to do this query at the end of the text file that would be great. Thanks much.

tanhadil 04-10-2004 06:02 AM

after i run this my users cant upload or use custom avatars at all..when u press upload it resets to Use no avatar option

juanmalaga9 04-14-2004 04:49 AM

Quote:

Originally Posted by tanhadil
after i run this my users cant upload or use custom avatars at all..when u press upload it resets to Use no avatar option

same here, anyone can fix this hack?
It's really usefull... please

northernstar 05-17-2004 03:19 AM

Quote:

Originally Posted by juanmalaga9
same here, anyone can fix this hack?
It's really usefull... please

Yup, would really love to use this hack, except I ran into the same problem...users can remotely link avatars, but they can't upload anymore.

sv1cec 06-18-2004 03:51 AM

Quote:

Originally Posted by northernstar
Yup, would really love to use this hack, except I ran into the same problem...users can remotely link avatars, but they can't upload anymore.

Can someone who has applied this hack tell me exactly what the problem is with it?

I would like to use it, since I do not like my members to upload avatars to my server (so if the problem is that they can no longer upload, it's not a great loss for me), but I want them to be able to select either one of the server's avatars or an external one.

Is this hack doing this?

Many thanks and kind regards
------
John

Justice 10-12-2004 04:56 AM

this should be a default feature in vBulletin, especially with large boards. Is there no working hack for this? Invision has this feature for heaven's sake :(


All times are GMT. The time now is 02:12 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02733 seconds
  • Memory Usage 1,746KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete