vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=5)
-   -   Mini-Avatars Hack Released (https://vborg.vbsupport.ru/showthread.php?t=44593)

Mystikal 10-12-2002 10:00 PM

Mini-Avatars Hack Released
 
I've re-released this hack with a completely re-written database independent version :) Enjoy.

The mini-avatars system will enable users to have their own 16x16 image in front of their username in threads, and in the who's online portion of the website. The hack creates 1 table and alters a few files, with 2 new files created.

I'm working on the the new modifications to the admin panel, but this will get you up and running so far =)

Pancreas Paul 10-13-2002 08:35 PM

May I see some screenshots?

Mystikal 10-13-2002 08:58 PM

here is 1

Mystikal 10-13-2002 08:59 PM

another.

Mystikal 10-13-2002 08:59 PM

the last.

Neo 10-13-2002 10:19 PM

Nice idea. what about user side editing?

(I can see the store hack integration now.. tisk)

Mystikal 10-13-2002 10:43 PM

eh... see it at blizzforums.com :) im too lazy (actually dont have time) to upload the pic... but its intergrated into the usercp.

mewgood 10-13-2002 11:58 PM

so where do you put this code
Quote:

<img src="icon.php?userid=$uservariable[userid]" height="16" width="16">
if I want it like blizzforum?

As well it seems it is not working for me. I have safe mode for php.
I uploaded an avatar, but it doesn't show anything..

Velocd 10-14-2002 12:26 AM

Nice, I like this idea quite a bit actually ;)
*clicks install*

Mystikal 10-14-2002 01:50 AM

mewgood, we have safe mode and it works fine... the stuff is stored in the database, that's how we get around safe mode.

Mystikal 10-14-2002 01:51 AM

edit whatever templates you want and put that code in front of the username :)

i.e.,
if you want it in who's online, just edit the loggedinuser template in forumhome templates and put <img src="icon.php?userid=$uservariable[userid]" height="16" width="16"> in front of $user[username].

mewgood 10-14-2002 05:15 AM

..
when I trying to upload an avatar, it doesn't change in the index.php..
it is the same with the defult image..
Help please.

bejita 10-14-2002 07:20 AM

finally you release it :) soon i'll install to my forum

NuclioN 10-14-2002 08:38 AM

Also no update after uploading an image. Default stays visible.

Mystikal 10-14-2002 04:40 PM

You have to refresh the page.

mewgood 10-14-2002 06:59 PM

I did refresh.....
nth change...

Sketch 10-14-2002 08:45 PM

looks like it will make the boards look cluttered. I'll pass. Nice idea though. :)

Mystikal 10-14-2002 09:24 PM

Hm. I dunno then. Try going to /icon.php?userid=xxxx and see if its there.. or check phpMyAdmin to see if an entry is created with your userid.... It should work, works for me.

Harryli 10-14-2002 10:52 PM

If i call icon.php?userid=xxx I see icons :D maybe we have the wrong icon.php?

Harryli 10-14-2002 11:24 PM

sorry, was in /admin. under /Forum/icon.php I see my mini, but it also does not show up... only the default one

mewgood 10-14-2002 11:58 PM

Quote:

Try going to /icon.php?userid=xxxx and see if its there
what do you mean?

Mystikal 10-15-2002 12:17 AM

Do you have phpMyAdmin or direct access to the database?

Check to make sure you actually have an entry.. maybe there's a bug but I didn't think so.

Velocd 10-15-2002 12:34 AM

Two questions:

Can you implement a check where it insures the user does not upload an avatar larger than 16 by 16 pixels? Personally I don't want to add the width and height attributes to the image tag, incase somebody uses a larger or smaller icon. This should be possible, if you view the avatar-source code in member.php.

Second, is there any possible way to check if the gif image contains transparency? Probably not, but I'd like all my members to make the backgrounds of their icons transparent, or else the icon looks very tacky.

Velocd 10-15-2002 02:32 AM

Well I figured my first request out pretty easily, you can forget the second since I know it's not possible.

---------------------------------------

For those wanting to check the icon size insuring it's not larger than 16x16 pixels, use this very easy to install add-on:

In member.php, find:
PHP Code:


        
if( !$HTTP_POST_FILES['file1']['size'] || $HTTP_POST_FILES['file1']['size'] < ) {
            eval(
"standarderror(\"".gettemplate("error_invalid_image")."\");");
        } 

Below it add:
PHP Code:

        // check valid image
        
if ($imginfo=@getimagesize($HTTP_POST_FILES['file1']['tmp_name'])) {
          if (
$imginfo[0]>16 or $imginfo[1]>16) {
            eval(
"standarderror(\"".gettemplate("error_invalid_image")."\");");
          }
        } 

And there we go :p There is no need to set width and height attributes to the image tag. You can also check for it not to be lower than a certain amount, by modifying the if statement with a lesser than (<) clause.

mewgood 10-15-2002 05:47 AM

yes I have phpmyadmin
what do I check?

mewgood 10-15-2002 05:56 AM

Ok when I go to phpmyadmin after i click the edit button it turns an error..
first ss

mewgood 10-15-2002 05:57 AM

here is the error

Ninth Dimension 10-15-2002 08:17 AM

It's funny, but I was thinking on doing something like this myself a few weeks ago, but yours looks much better than anything I could have developed, so good job to you :)

Harryli 10-15-2002 08:41 AM

I have the same error in phpmyadmin. Looks lige a CR behind 89a

Mystikal 10-15-2002 04:46 PM

Quote:

Originally posted by Velocd
Well I figured my first request out pretty easily, you can forget the second since I know it's not possible.

---------------------------------------

For those wanting to check the icon size insuring it's not larger than 16x16 pixels, use this very easy to install add-on:

In member.php, find:
PHP Code:


        
if( !$HTTP_POST_FILES['file1']['size'] || $HTTP_POST_FILES['file1']['size'] < ) {
            eval(
"standarderror(\"".gettemplate("error_invalid_image")."\");");
        } 

Below it add:
PHP Code:

        // check valid image
        
if ($imginfo=@getimagesize($HTTP_POST_FILES['file1']['tmp_name'])) {
          if (
$imginfo[0]>16 or $imginfo[1]>16) {
            eval(
"standarderror(\"".gettemplate("error_invalid_image")."\");");
          }
        } 

And there we go :p There is no need to set width and height attributes to the image tag. You can also check for it not to be lower than a certain amount, by modifying the if statement with a lesser than (<) clause.

This mod will -not- function on certain servers. This is why I chose -not- to include this. The reason why the getimagesize() function does not work is uknown to most people, and when I tried it.. worked on 1 server, failed on the other (both had the graphic libraries installed that were required).

Mystikal 10-15-2002 04:47 PM

Harry, dont' try and select something from the usericons when using data='whatever', it won't work unless you use the LIKE % command which I don't even think can be done on binary columns (it might be able to be, I forget.. too lazy to check).

Mystikal 10-15-2002 04:48 PM

Oh crap.. mewgood, install a later version of phpMyAdmin.. could be your problem...

Mystikal 10-15-2002 04:51 PM

<a href="http://www.wcgalaxy.com/vbb/icon.php?userid=1" target="_blank">http://www.wcgalaxy.com/vbb/icon.php?userid=1</a>

Shows up fine for me.. looks like its installed fine.

Harryli 10-15-2002 07:40 PM

Yes, my mini is also showing up correct if I use ..icon.php?userid=1 but if I change the forumhome_loggedinuser template from

<a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$userid">$username</a>$invisibleuser

to

<img src="icon.php?userid=$uservariable[userid]" height="16" width="16"><a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$userid">$username</a>$invisibleuser

only the default one shows up :(

Mystikal 10-15-2002 09:28 PM

well that's because $uservariable isn't set to anything.

I should have specified...

$uservariable = whatever variable contains the user info.. it differs from page to page, and you can use the <IMG> stuff anywhere.

mewgood 10-15-2002 11:23 PM

so
I need to install a later version of phpmyadmin
what version is yours?|

Mystikal 10-16-2002 12:07 AM

I have 2.3.0-RC2. No you don't have to..

go to your who's online template and change icon.php?userid=$uservariable to userid=$userid. That should fix your problem.

You gotta make sure that your actually passing it a userid value ya know? Make sure and double check that with any other templtase its put in.

mewgood 10-17-2002 12:16 AM

cool
it works now:D

Mystikal 10-17-2002 06:49 PM

Yup :P Told ya that was all :=)

Mystikal 10-17-2002 06:50 PM

BTW, mewgood, you should really alter the default image it doesn't look right with your vbulletin =\. I didn't make it transparent because it didn't need to be for my board.


All times are GMT. The time now is 04:49 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.01559 seconds
  • Memory Usage 1,824KB
  • 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
  • (4)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
  • (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