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)

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 09:30 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.01045 seconds
  • Memory Usage 1,739KB
  • 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)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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