View Full Version : Avatar As Link2
Scheccia
03-22-2002, 10:00 PM
This hack display avatar through link... and not stored avatar in your database or server.
This hack is completely various from the first version (https://vborg.vbsupport.ru/showthread.php?s=&threadid=35251) , now it is integrated with the function avatar of vbulletin.
To integrate with welcome pannel
in index.php
instead
############################
if ($bbuserinfo[userid]!=0) {
$avatarurl=getavatarurl($bbuserinfo[userid]);
if ($avatarurl=='') {
$avatarurl='images/avatars/noavatar.gif';
}
$avatarimage='<a href="member.php?s='.$session[sessionhash].'&action=editavatar"><img src="'.$avatarurl.'" border="0">';
} else {
$avatarimage='<a href="register.php?s='.$session[sessionhash].'&action=signup"><img src="images/avatars/guestavatar.gif" border="0"></a>';
}
############################
put
############################
if ($bbuserinfo[userid]!=0) {
$avatarurl=getavatarurl($bbuserinfo[userid]);
if ($avatarurl=='') {
$avatarlink=$DB_site->query_first("SELECT avatar2 FROM avatarlink WHERE userid=$bbuserinfo[userid]");
$avatar2=$avatarlink[avatar2];
if ($avatar2=='') {
$avatarurl='images/noavatar.gif';
}else{
$avatarurl=$avatar2;
}
}
$avatarimage='<a href="member.php?s='.$session[sessionhash].'&action=editavatar"><img src="'.$avatarurl.'" border="0">';
} else {
$avatarimage='<a href="register.php?s='.$session[sessionhash].'&action=signup"><img src="images/guestavatar.gif" border="0"></a>';
}
############################
Scheccia
03-23-2002, 11:25 AM
Screen shoot
in admin --> option
Scheccia
03-23-2002, 11:27 AM
screen shoot in admin--> edit user
Scheccia
03-23-2002, 11:28 AM
screen shoot
in user cp --> modify avatar
ZiRu$
03-23-2002, 08:22 PM
I'll do it! thanks
wooolF[RM]
03-24-2002, 01:38 PM
]Fatal error: Call to a member function on a non-object in /home/wooolf/WWW/forum/member.php on line 1048
on line 1048: I could see }ELSE{
I have changed it to } else {
next step:
Parse error: parse error in /home/wooolf/WWW/forum/member.php on line 1199
on line 1199: }
nothing more...
$DB_site->query("UPDATE user SET avatarid='".addslashes($avatarid)."',usergroupid='$bbuserinfo[usergroupid]' WHERE userid='$bbuserinfo[userid]'");
eval("standardredirect(\"".gettemplate("redirect_updatethanks")."\",\"usercp.php?s=$session[sessionhash]\");");
}
// ############################### start get info ###############################
if ($action=="getinfo") {
$templatesused = "getinfo_sendpm,aol,icq,yahoo,getinfo_birthday,geti nfo_customfields,getinfo";
include("./global.php");
I think u forgot { or } somewhere... :(
The Keeper
03-24-2002, 07:31 PM
Does the script allow people to post giant avatars? Or can a dimension restriction be imposed?
wooolF[RM]
03-24-2002, 08:12 PM
U restrict your dimenions under ADMIN CP
Scheccia
03-24-2002, 08:38 PM
what kind of installation you make?
control the edited file
wooolF[RM]
03-25-2002, 01:02 AM
have controlled twice + made compared two files with one programm to make sure I have edited file right.
wooolF[RM]
03-25-2002, 10:17 AM
]I f I remove that } on line 1199 I'm getting error on anotehr line and so on... :(
Scheccia
03-25-2002, 12:21 PM
you can send me your index or tell me the hack that you have installed.
Psychdrone
03-26-2002, 03:48 AM
I am having trouble with your hack!
ok I thin there is a problem with this step!
Find:
-------------------------------
if ($HTTP_POST_VARS['action']=="updateavatar") {
$templatesused = "error_avatarmoreposts,error_avatarbadurl,error_ava taruploaderror,error_avatarbaddimensions,error_ava tarnotimage,error_avatartoobig,error_avatarmorepos ts,redirect_updatethanks";
include("./global.php");
-------------------------------
After this insert:
-------------------------------
##### Avatar As Link2 #####
if ($avatar2!="") {
// check valid image
if ($imginfo=@getimagesize($avatar2)) {
if ($imginfo[0]>$avatarmaxdimension or $imginfo2[1]>$avatarmaxdimension) {
eval("standarderror(\"".gettemplate("error_avatarbaddimensions")."\");");
}
if ($imginfo[2]!=1 and $imginfo[2]!=2) {
eval("standarderror(\"".gettemplate("error_avatarnotimage")."\");");
}
} else {
if (!$allowimgsizefailure) {
eval("standarderror(\"".gettemplate("error_avatarnotimage")."\");");
}
}
$DB_site->query("DELETE FROM customavatar WHERE userid=$bbuserinfo[userid]");
}
}
$avatarlink=$DB_site->query_first("SELECT avatar2 FROM avatarlink WHERE userid=$bbuserinfo[userid]");
//$avatar2=$avatarlink[avatar2];
if (!$avatarlink[avatar2] and $avatar2!="") {
$DB_site->query("INSERT INTO avatarlink (userid, avatar2) VALUES ($bbuserinfo[userid],'$avatar2')");
}ELSE{
$DB_site->query("UPDATE avatarlink SET avatar2='".$avatar2."' WHERE userid='$bbuserinfo[userid]'");
}
##### Avatar As Link2 #####
cause I get an error that reads
Fatal error: Call to a member function on a non-object in /home/******/public_html/forum/member.php on line 992
and line 992 reads
$avatarlink=$DB_site->query_first("SELECT avatar2 FROM avatarlink WHERE userid=$bbuserinfo[userid]");
wich is in the code above, that you are supposed to insert
whats wrong can you please fix this man!
Thanks!
wooolF[RM]
03-26-2002, 01:00 PM
]yep, I'm getting same error... actually very nice hack... too bad it's not bugfree :(
wooolF[RM]
03-26-2002, 01:08 PM
]Originally posted by Scheccia
you can send me your index or tell me the hack that you have installed.
send to where? I can't see your e-mail anywhere...
Scheccia
03-26-2002, 08:19 PM
ops... my error
you must delete the red } of the script that you have posted.
After this insert:
-------------------------------
##### Avatar As Link2 #####
if ($avatar2!="") {
// check valid image
if ($imginfo=@getimagesize($avatar2)) {
if ($imginfo[0]>$avatarmaxdimension or $imginfo2[1]>$avatarmaxdimension) {
eval("standarderror(\"".gettemplate("error_avatarbaddimensions")."\");");
}
if ($imginfo[2]!=1 and $imginfo[2]!=2) {
eval("standarderror(\"".gettemplate("error_avatarnotimage")."\");");
}
} else {
if (!$allowimgsizefailure) {
eval("standarderror(\"".gettemplate("error_avatarnotimage")."\");");
}
}
$DB_site->query("DELETE FROM customavatar WHERE userid=$bbuserinfo[userid]");
}
} <--delete this
$avatarlink=$DB_site->query_first("SELECT avatar2 FROM avatarlink WHERE userid=$bbuserinfo[userid]");
//$avatar2=$avatarlink[avatar2];
if (!$avatarlink[avatar2] and $avatar2!="") {
$DB_site->query("INSERT INTO avatarlink (userid, avatar2) VALUES ($bbuserinfo[userid],'$avatar2')");
}ELSE{
$DB_site->query("UPDATE avatarlink SET avatar2='".$avatar2."' WHERE userid='$bbuserinfo[userid]'");
}
##### Avatar As Link2 #####
make this change and tell me if it's all ok...
wooolF[RM]
03-26-2002, 10:18 PM
]mine looks like this now:
##### Avatar As Link2 #####
if ($avatar2!="") {
// check valid image
if ($imginfo=@getimagesize($avatar2)) {
if ($imginfo[0]>$avatarmaxdimension or $imginfo2[1]>$avatarmaxdimension) {
eval("standarderror(\"".gettemplate("error_avatarbaddimensions")."\");");
}
if ($imginfo[2]!=1 and $imginfo[2]!=2) {
eval("standarderror(\"".gettemplate("error_avatarnotimage")."\");");
}
} else {
if (!$allowimgsizefailure) {
eval("standarderror(\"".gettemplate("error_avatarnotimage")."\");");
}
}
$DB_site->query("DELETE FROM customavatar WHERE userid=$bbuserinfo[userid]");
}
$avatarlink=$DB_site->query_first("SELECT avatar2 FROM avatarlink WHERE userid=$bbuserinfo[userid]");
$avatar2=$avatarlink[avatar2];
if (!$avatarlink[avatar2] and $avatar2!="") {
$DB_site->query("INSERT INTO avatarlink (userid, avatar2) VALUES ($bbuserinfo[userid],'$avatar2')");
}ELSE{
$DB_site->query("UPDATE avatarlink SET avatar2='".$avatar2."' WHERE userid='$bbuserinfo[userid]'");
}
##### Avatar As Link2 #####
then I'm getting error:
Fatal error: Call to a member function on a non-object in /home/wooolf/WWW/forum/member.php on line 1048
line 1048: $avatarlink=$DB_site->query_first("SELECT avatar2 FROM avatarlink WHERE userid=$bbuserinfo[userid]");
I have checked database and everything is ok (tables and rows)...
:(
wooolF[RM]
03-26-2002, 10:39 PM
]I'm still using old member.php but all other files (3) that u have said we should update with new codes are uploaded to the server... So I'm running with 3/4 of your hack... And I need last 25% to get it work fully... :(
Scheccia
03-26-2002, 11:35 PM
ok.. i receive email...
I test it and it'snt ok.
But when delete from member.php the user rate hack... it is ok.
Now I install user rate hack in my test board and check it...
but tomorrow now for me is 2:04 AM ;)
good night hehe
wooolF[RM]
03-27-2002, 12:35 AM
]great man! Thanx a lot for helping! :)
if u need more files, let me know it :)
Thanx again :)
Psychdrone
03-27-2002, 03:26 AM
alright I did what you said and got this
Parse error: parse error in /home/ochroma/public_html/rpg/member.php on line 1433
Which is the closing of the php
Line 1433: ?>
I guess I will send you my member.php file?
thanks for the support, hope we get it to work!
Scheccia
03-27-2002, 01:22 PM
wooolF[RM]
I send you the file...
:)
wooolF[RM]
03-27-2002, 02:04 PM
]great man! checking! :D
Could a similar hack be done with sig banners ?
People on my board love to have an sig images but I don't want them on my server ! any ideas ??
Scheccia
03-27-2002, 11:23 PM
for sign...
they must use the tag [.img] [./img] in their signature
Psychdrone
03-28-2002, 01:10 AM
Hey sheccia you gonna help me out here buddy??
Originally posted by Scheccia
for sign...
they must use the tag [.img] [./img] in their signature
But then it still can be anywhere and I don't want the sigs on my server!
Scheccia
03-28-2002, 10:37 AM
X xug
yes... the immage can be anywhere not on your server.
X
Psychdrone
tel me your installed hack
Psychdrone
03-29-2002, 01:03 AM
Hey what do you mean......I have installed a lot of hacks.. but it says there is an error within your code that you have me put
Can I please send you my file like the guy above
I really like your hack, just want to make sure it works:)
Scheccia
03-29-2002, 02:39 PM
.... but if I don't know the hack that you have installed ... how can help you?
wooolF[RM]
03-29-2002, 05:01 PM
]Thanx Scheccia ! Everything works just like a dream! :D Thanx very much :D
Psychdrone
03-30-2002, 12:51 AM
I installed your hack Thats why I am posting in this thread:P
so can I send you my file? Could I get your email??
Storm
03-30-2002, 10:17 PM
I installed your hack, and everything works great! But there is one thing that is not right - when I view another member's profile (using getinfo) my avatar shows up instead of the member's avatar, can you fix this? Thanks in advance. :)
Scheccia
03-31-2002, 12:45 AM
yes... ok thanx...
I fix it... :)
in member find
$userinfo[yahoo]=" ";
}
##### Avatar As Link2 #####
$avatarlink=$DB_site->query_first("SELECT avatar2 FROM avatarlink WHERE userid=$bbuserinfo[userid]");
$avatar2=$avatarlink[avatar2];
replace red word with:
$userinfo[userid]
Storm
03-31-2002, 08:11 PM
OK, I changed that one thing there, uploaded, but it didn't fix that problem...
I got a different problem that I just found out about: if a user tries to their avatar in the user control panel, they get this message even if the file exists, even if it's a valid gif/jpeg:
'The uploaded file is not a valid GIF or JPG file. Please ensure that it is and try again.'
I can add avatars through the admin w/o any problems, so what do you think could be causing it?
Scheccia
03-31-2002, 09:15 PM
I think that you have edited wrong the member file.
I register in your forum and I can't go to edit option.
Storm
03-31-2002, 09:47 PM
OK, fixed that, that works perfect now, What do I do about the other problem?
Users can't link to their avatar w/o getting that error...
'Image is not a valid gif or jpeg, please check and try agian'
Scheccia
03-31-2002, 11:46 PM
able it from admin in this way I can test
Storm
04-01-2002, 12:10 AM
Avatars are enabled... you should be able to test it now, you don't need any posts to do it either.
Storm
04-04-2002, 11:47 PM
Ok, you can now go into the admin and test the hack from there, test whatever you want to test, just let me know (please) what I need to change to make it work correctly for the users in the user control panel -> edit avatar screen. Thanks.
Psychdrone
04-05-2002, 12:16 AM
Hey got your e-mail and uploaded it and now I can view profiles
but for some wierd reason its not showing in the postbid template
it dose show thu in users profiles Getinfo template
Something that I notived........ is that the command igetinfo uses
is
<img src="$userinfo[avatarurl]" border="0" align="middle">
But in the post pit it uses $post[avatar]
and it only works in the getinfo template but not the post bit.... I tried taking the getinfo template command
<img src="$userinfo[avatarurl]" border="0" align="middle">
and replacing it with
$post[avatar]
but it shows nothing
man whats going on thanks!
Scheccia
04-05-2002, 07:11 AM
Storm
the templates are ok.
Pysc
i send you an email...
now must work fine :)
Storm
04-06-2002, 06:50 AM
I have uploaded the new member.php file but I am still getting that error.... what else could it be?
I did not change anything in the member file before i uploaded it.
Psychdrone
04-08-2002, 01:07 AM
ok everything is working except this thing
I get like 100 emails a day with this error
Invalid SQL: INSERT INTO avatarlink (userid, avatar2) VALUES
(21,'http://falkonsnest.150m.com/Gendo.jpg')
mysql error: Duplicate entry '21' for key 1
thats the only probelm thu with this..... whats wrong?? Thanks!
Scheccia
04-09-2002, 12:59 AM
simple... go in phpadmin and delete in avatarlink the userid 21.
how come members can upload avatars larger then the specified size?
I still get this error when testing it out.
The uploaded file is not a valid GIF or JPG file. Please ensure that it is and try again.
Anybody figure out a fix for that? Thanks...
Storm
05-11-2002, 08:39 PM
I still get this error when testing it out.
The uploaded file is not a valid GIF or JPG file. Please ensure that it is and try again.
Anybody figure out a fix for that? Thanks...
I am still having that problem as well.
dslteam
06-06-2002, 05:44 PM
Question: I installed it now and there are more than 1000 avatars as a link in the database now.
What happens if i update to vb3.0 ???
Thanks !
I installed the hack, but its not working good :(
in the user controlpanel, I can see the new option, and I can also enter a link.
but, when I take a look at my postings, the old avatar (in the database) is shown.
hows that possible ?
Koneko
07-09-2002, 12:35 AM
I installed that hack and it works great. Except that in the admin control panel the avatar does not show as it normally would, and if I try to edit a members avatar through the control panel I get this error:
------------
Database error in vBulletin Control Panel 2.2.6:
Invalid SQL: SELECT userid
FROM user
WHERE username='Koneko'
AND userid <>
mysql error: You have an error in your SQL syntax near '' at line 4
mysql error number: 1064
Date: Monday 08th of July 2002 09:30:53 PM
Script: http://forums.firefly.nu/admin/user.php
Referer: http://forums.firefly.nu/admin/user.php?action=edit&userid=1
------------
Oh yes... I get a mysql whenever I try to edit ANYTHING about a user in the admin control panel. There is also this error as well...
When there is a member that has made posts but they have been deleted and changed to a "Guest" instead of an actual member, they are now on everyones ignore list and I have no idea to change this. This only started happening after I installed this hack.
edit:
I'm also receiving this error as now well... if you remove your avatar yourself and then try to add it back in, it won't let you.
Here's the error:
------------
Database error in vBulletin 2.2.6:
Invalid SQL: INSERT INTO avatarlink (userid, avatar2) VALUES (1,'http://firefly.nu/stuff/koavatar.gif')
mysql error: Duplicate entry '1' for key 1
mysql error number: 1062
Date: Monday 08th of July 2002 10:02:52 PM
Script: http://spam.dreamwater.nu/member.php
Referer: http://spam.dreamwater.nu/member.php?s=&action=editavatar
-------------
I too had this problem whereas users got the error that the file was not a valid jpg or gif.
I've come to the conclusion it's simply broken, and I hope that at some time in the future it gets fixed. Until then, I simply cannot recommend this hack.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.