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)
-   -   Admin Avatar Options (https://vborg.vbsupport.ru/showthread.php?t=37982)

Neo 04-27-2002 10:00 PM

Admin Avatar Options
 
This is a add that Dark Angelus requested and something that I wanted but could not find >< I am not to sure if this is already made but here it is.

Info:
This allows admins/smods/mods to have a bigger set avatar and avatar file size from the admin cp. Aswell as make it so it can define the width and height of the avatar.

Install Info:
3 New queries
1 new template
1 template edit
1 file edit


Hope you enjoy :)

Lesane 04-28-2002 07:13 PM

Great hack Neo :D


*Edit* Looked Wrong *Edit*

John 04-28-2002 07:18 PM

But doesn't this hack allow admins and mods to have a bigger file size than Registered Users?

Orlandu 04-28-2002 07:19 PM

That hack, Lesane, is to set it for everyone. This hack that neo released is so you can have a different set height for admins and their avatars. So if you are an admin, you can have a larger avatar than that of a normal member.

I think it is very useful and may end up using it myself.

Lesane 04-28-2002 07:21 PM

aah yes, i looked wrong. Great hack.

Neo 04-28-2002 07:42 PM

Thank you :)

JulianD 04-28-2002 08:03 PM

Nice hack. Thanks for sharing neo.

Dark Angelus 04-28-2002 08:04 PM

i copy and past the last insert thingy in my mysql database and there is an error
_______

INSERT INTO setting (settingid,settinggroupid,title,varname,value,desc ription,optioncode,displayorde r) VALUES (NULL,26,'Admin Maximum File Size','amfs','20000','The maximum file size of admins (in bytes) that an avatar can be.

1 KB = 1024 bytes
1 MB = 1048576 bytes','','6')")

MySQL said: You have an error in your SQL syntax near '")' at line 1
Back
____

What Am I Doing Wrong

Neo 04-28-2002 08:47 PM

Fixed :)

geniuscrew 05-16-2002 05:45 PM

is there a way to allow admins and modertors to have different sized avatars using this? This would be of great help.

Thanx

scud 09-16-2002 03:12 PM

Great Hack, thx, I'll use it :)

Jalrock 09-22-2002 11:29 PM

.

Jalrock 09-23-2002 05:35 PM

Never mind. :)

Jalrock 09-26-2002 05:32 PM

Something is still wrong. The specified usergroupes can use the admin avatar size but now the regular members can not change their avatars. It says thankyou for modifing your profile..... but nothing happens. No error message or anything! Please help.
This is the portion of code I suspect to be in error.
-----------------------------------------------------------------------
Code:

          // ##### Admin / Mod Diff Upload Size
          if ($bbuserinfo[usergroupid]==6 || $bbuserinfo[usergroupid]==7 || $bbuserinfo[usergroupid]==5 || $bbuserinfo[usergroupid]==8 || $bbuserinfo[usergroupid]==11) {
            if ($imginfo[0]>$amw or $imginfo[1]>$amh) {
              eval("standarderror(\"".gettemplate("error_aabd")."\");");
            }
          } else {
            if ($imginfo[0]>$avatarmaxdimension or $imginfo[1]>$avatarmaxdimension) {
              eval("standarderror(\"".gettemplate("error_avatarbaddimensions")."\");");
            }
          }
          // ##### Admin / Mod Diff Upload Size

          }
          if ($imginfo[2] != 1 and $imginfo[2] != 2 and $imginfo[2] != 3) {
            @unlink($filename);
            eval("standarderror(\"".gettemplate("error_avatarnotimage")."\");");
          }
        } else {
          if (1 or !$allowimgsizefailure) {
            @unlink($filename);
            eval("standarderror(\"".gettemplate("error_avatarnotimage")."\");");
          }
        }

        // read file
        $filesize=@filesize($filename);
        if ($bbuserinfo[usergroupid]==6 || $bbuserinfo[usergroupid]==7 || $bbuserinfo[usergroupid]==5 || $bbuserinfo[usergroupid]==8 || $bbuserinfo[usergroupid]==11) {
        if ($filesize>$amfs) {
          eval("standarderror(\"".gettemplate("error_avatartoobig")."\");");
          // file size too big
         
      } else {
        if ($filesize>$avatarmaxsize) {
          eval("standarderror(\"".gettemplate("error_avatartoobig")."\");");
          // file size too big
          exit;
        }
      }


        $filenum=@fopen($filename,"rb");
        $filestuff=@fread($filenum,$filesize);
        @fclose($filenum);

        @unlink($filename);

        if ($avexists=$DB_site->query_first("SELECT userid FROM customavatar WHERE userid=$bbuserinfo[userid]")) {
          $DB_site->query("UPDATE customavatar SET filename='".addslashes($avatarfile_name)."',dateline='".time()."',avatardata='".addslashes($filestuff)."' WHERE userid=$bbuserinfo[userid]");
        } else {
          $DB_site->query("INSERT INTO customavatar (userid,avatardata,dateline,filename) VALUES ($bbuserinfo[userid],'".addslashes($filestuff)."','".time()."','".addslashes($avatarfile_name)."')");
        }
      }
    } else {
      $avatarid=verifyid("avatar",$avatarid);
      $avatarinfo=$DB_site->query_first("SELECT minimumposts FROM avatar WHERE avatarid=$avatarid");
      if ($avatarinfo[minimumposts]>$bbuserinfo[posts]) {
        eval("standarderror(\"".gettemplate("error_avatarmoreposts")."\");");
        // not enough posts error
        exit;
      }
      $DB_site->query("DELETE FROM customavatar WHERE userid=$bbuserinfo[userid]");
    }
  } else {
    $avatarid=0;
    $DB_site->query("DELETE FROM customavatar WHERE userid=$bbuserinfo[userid]");
  }

  $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]\");");

}


TECK 09-26-2002 05:36 PM

Jalrock, [code] vb code... it looks more elegant and it keeps the formatting.
is hard for us to look at the code like that. can you reformat it please? thanks.

and now for mad dog neo.. vb225??????????????? :)
you are gonna have a headache on my board neo, there are no avatars...

Jalrock 09-26-2002 05:42 PM

reformatted sorry.

Mono 01-30-2003 11:24 AM

How would you do it to make it so multiple usergroups can have this feature. Like on my forum there are 3 groups of authority.

The group numbers are 7, 6, and 5.

geniuscrew 03-14-2003 10:45 AM

Mmm I have exactly that - are their avatars the same size?

S.Shady 05-21-2003 11:13 PM

i would like to see this with the option of turning off the reg avatars and only alowing admins,etc. the option for an avatar only.

Plz if this hack exists point me to it. i thought i saw one before but cant find one for anything.

Does this work for 2.3.0 ?

?????p?x???? 08-10-2003 04:17 PM

Can this also be utilized to grant moderators and administrators the exclusive right to use avatars? In other words, can this hack help me make the use of avatars a strictly mod/admin perk only?

Bandwidth may pose a problem by the end of my forum's setup, and I was thinking of permitting only authorities this privilege.

Edit: Nevermind. (http://www.vbulletin.org/hacks/index...ack&hackid=251) :cool:


All times are GMT. The time now is 01:41 AM.

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.01367 seconds
  • Memory Usage 1,759KB
  • 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
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (20)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete