1
gpl13
No AVATAR upload...
  • 2004/7/5 22:21

  • gpl13

  • Just popping in

  • Posts: 33

  • Since: 2004/3/5 1


Hi,

I have a problem - i'm using XOOPS 2.0.7, and i don't want to use orginal XOOPS avantar uploader - becouse i've small server :( I need hack, that alow users to add their avatars from their own servers - someone can helps me ??

2
YourHelp
Re: No AVATAR upload...
  • 2004/7/6 1:35

  • YourHelp

  • Friend of XOOPS

  • Posts: 479

  • Since: 2003/6/9 6


Do you mean they can input a URL to there image that they have uploaded somewhere on the web? Instead of uploading the image. If so I think that this is an excellent idea this should be an option available in forum settings and something for the XOOPS team to consider for future versions but as far as I know this isn’t available. But I support your idea 100% this option should be in xoops.

3
Dave_L
Re: No AVATAR upload...
  • 2004/7/6 1:56

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Personally, I don't like remotely-linked avatars, because of potential problems:

1) avatars load slowly if the connection to the remote server is slow
2) avatars can be broken
3) avatars can be in a password-protected directory
4) avatars can cause a script to be run

But that's just my opinion. I have no objection to the feature being added, as long as it's an admin option.

4
gpl13
Re: No AVATAR upload...
  • 2004/7/7 7:50

  • gpl13

  • Just popping in

  • Posts: 33

  • Since: 2004/3/5 1


Yes, i mean that :) I think it will be good option for users !! Some one can do that ??

5
DonXoop
Re: No AVATAR upload...

One of my pet peeves is external avatar links. IMHO a bad idea for a lot of reasons. Avatars are (should be) very small so diskspace isn't a problem. You have control over file sizes and dimensions etc. let them upload and all is well.

6
gpl13
Re: No AVATAR upload...
  • 2004/7/8 13:06

  • gpl13

  • Just popping in

  • Posts: 33

  • Since: 2004/3/5 1


But if u have 25 mb of space for service, and avatar 80x80 max file size 25000... i'll be happy, if someone can write a hack to this !!

7
gpl13
Re: No AVATAR upload...
  • 2004/7/13 22:41

  • gpl13

  • Just popping in

  • Posts: 33

  • Since: 2004/3/5 1


Where is XOOPS Comunity HELP - i asked for help, and no one, can help me - I need a small modification of edituser.php - i dont known php & mysql, and cannot change it for my self - i asked here, becouse i think that someone help me !!

Look i add form, to edit account, where i have a text box, where i can write url, and this replay to &op=avatarurl. Every think good, but, when i submit my url, avatar have 2 url's :/

http://fcm.zapto.org/xoops/upload/http://freezone.escar.pl/img/50x50.gif

How can i delete this default path 'http://fcm.zapto.org/xoops/upload/'

PEOPLE UNDERSTAND - I WILL BE HAPPY, IF SOMEONE HELP ME TO SOLVE MY PROBLEM !! I WANT AVATAR from other SERVERS - and don't want to UPLOAD !! Please HELP ME !!

8
Mithrandir
Re: No AVATAR upload...

userinfo.php line 86

$xoopsTpl->assign('user_avatarurl', 'uploads/'.$thisUser->getVar('user_avatar'));

Try changing to:
$xoopsTpl->assign('user_avatarurl', $thisUser->getVar('user_avatar'));

9
gpl13
Re: No AVATAR upload...
  • 2004/7/15 19:37

  • gpl13

  • Just popping in

  • Posts: 33

  • Since: 2004/3/5 1


OK Works in profile :) Thats 50% of success !! Now, how to make it work on comments, and newbb ??

Second thing - i dont known what i do, but i can write url to user_avatar :/ Look, i copy it from avatarchoose, and yesterday works:

Quote:
if ($op == 'avatarset') {
if (!is_object($xoopsUser) || $xoopsUser->getVar('uid') != $uid ) {
redirect_header('index.php', 3, _US_NOEDITRIGHT);
exit();
}
$member_handler =& xoops_gethandler('member');
$user_avatar = trim($user_avatar);
$oldavatar = $xoopsUser->getVar('user_avatar');
$xoopsUser->setVar('user_avatar', $user_avatar);
if (!$member_handler->insertUser($xoopsUser)) {
include XOOPS_ROOT_PATH.'/header.php';
echo $xoopsUser->getHtmlErrors();
include XOOPS_ROOT_PATH.'/footer.php';
exit();
} else {
$avt_handler =& xoops_gethandler('avatar');
if ($oldavatar && $oldavatar != 'blank.gif' && preg_match("/^cavt/", strtolower($oldavatar))) { //Koudanshi fix
$avatars =& $avt_handler->getObjects(new Criteria('avatar_file', $oldavatar));
if (is_object($avatars[0])) {
$avt_handler->delete($avatars[0]);
}
@unlink($oldavatar);
}
if ($user_avatar != 'blank.gif') {
$avatars =& $avt_handler->getObjects(new Criteria('avatar_file', $user_avatar));
if (is_object($avatars[0])) {
$avt_handler->addUser($avatars[0]->getVar('avatar_id'), $xoopsUser->getVar('uid'));
}
}
redirect_header('userinfo.php?uid='.$uid, 0, _US_PROFUPDATED);
}
}


And this is form:
Quote:

if ($op == 'avatarform') {
if (!is_object($xoopsUser)) {
redirect_header('index.php', 1);
}
include XOOPS_ROOT_PATH.'/header.php';
echo ''. _US_PROFILE .' »» '. _US_UPLOADMYAVATAR .'

';
$oldavatar = $xoopsUser->getVar('user_avatar');
if ($oldavatar && $oldavatar != 'blank.gif') {
echo '

'._US_OLDDELETED.'

';
echo '
';
}
if ($xoopsConfigUser['avatar_allow_upload'] == 1 && $xoopsUser->getVar('posts') >= $xoopsConfigUser['avatar_minposts']) {
include_once 'class/xoopsformloader.php';
$form = new XoopsThemeForm(_US_UPLOADMYAVATAR, 'uploadavatar', 'edituser.php');
$form->setExtra('enctype="multipart/form-data"');
$form->addElement(new XoopsFormLabel(_US_MAXPIXEL, $xoopsConfigUser['avatar_width'].' x '.$xoopsConfigUser['avatar_height']));
$form->addElement(new XoopsFormLabel(_US_MAXIMGSZ, $xoopsConfigUser['avatar_maxsize']));
$form->addElement(new XoopsFormFile(_US_SELFILE, 'avatarfile', $xoopsConfigUser['avatar_maxsize']), true);
$form->addElement(new XoopsFormHidden('op', 'avatarupload'));
$form->addElement(new XoopsFormHidden('uid', $xoopsUser->getVar('uid')));
$form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
$form->display();
}
$avatar_handler =& xoops_gethandler('user_avatar');
$form2 = new XoopsThemeForm(_US_CHOOSEAVT, 'uploadavatar', 'user.php');
$form2->addElement(new XoopsFormText(_US_SELFILE, 'user_avatar',30,60, $xoopsConfigUser['user_avatar']), true);
$form2->addElement(new XoopsFormHidden('uid', $xoopsUser->getVar('uid')));
$form2->addElement(new XoopsFormHidden('op', 'avatarset'));
$form2->addElement(new XoopsFormButton('', 'submit2', _SUBMIT, 'submit'));
$form2->display();
include XOOPS_ROOT_PATH.'/footer.php';
}


What is wrong ?? Why my URL entered into text pole, dont write to MySQL Database as user_avatar ??


10
bug-free
Re: No AVATAR upload...
  • 2006/6/12 12:54

  • bug-free

  • Just popping in

  • Posts: 25

  • Since: 2005/1/27


hey, i want this option too.

my users want their avatars upload from an URL.

anyone hack this?

Login

Who's Online

281 user(s) are online (239 user(s) are browsing Support Forums)


Members: 0


Guests: 281


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits