vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Avatar As Link2 (https://vborg.vbsupport.ru/showthread.php?t=36462)

Scheccia 03-22-2002 10:00 PM

Avatar As Link2
 
This hack display avatar through link... and not stored avatar in your database or server.

This hack is completely various from the first version , 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...
Code:

  $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,getinfo_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!
Quote:

Find:
-------------------------------
if ($HTTP_POST_VARS['action']=="updateavatar") {
$templatesused = "error_avatarmoreposts,error_avatarbadurl,error_av ataruploaderror,error_avatarbaddimensions,error_av atarnotimage,error_avatartoobig,error_avatarmorepo sts,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_avatarb addimensions")."\");");
}
if ($imginfo[2]!=1 and $imginfo[2]!=2) {
eval("standarderror(\"".gettemplate("error_avatarn otimage")."\");");
}
} else {
if (!$allowimgsizefailure) {
eval("standarderror(\"".gettemplate("error_avatarn otimage")."\");");
}
}
$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
Quote:

$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

]
Quote:

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.
Quote:

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_avatarb addimensions")."\");");
}
if ($imginfo[2]!=1 and $imginfo[2]!=2) {
eval("standarderror(\"".gettemplate("error_avatarn otimage")."\");");
}
} else {
if (!$allowimgsizefailure) {
eval("standarderror(\"".gettemplate("error_avatarn otimage")."\");");
}
}
$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:
Code:

##### 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

xug 03-27-2002 11:07 PM

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??

xug 03-28-2002 09:04 AM

Quote:

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
Quote:

$userinfo[yahoo]="&nbsp;";
}

##### 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.


All times are GMT. The time now is 10:29 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.01305 seconds
  • Memory Usage 1,821KB
  • 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_code_printable
  • (6)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
  • (40)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