[RELEASE vB2.0] Custom Avatars as Files

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kier
    Former Lead Developer, vBulletin
    • Sep 2000
    • 8179

    [RELEASE vB2.0] Custom Avatars as Files

    Since there has been so much demand for this, I wrote a hack that will allow you to store all your custom avatars as files, rather than in the mySQL database.



    Doing this will have the following benefits:
    • Avatars folder can be protected by .htaccess (Apache only) to prevent bandwidth stealing
    • No SQL queries or PHP code required to display custom avatars - server load decreases
    • No cacheing issues with Internet Explorer 5.5, so server bandwidth use should decrease
    The install script will make the necessary modifications to your database, install a control panel option to switch the file-based avatars on, and convert your existing custom avatars from the database into files.

    All avatar options that are present when using the standard mySQL avatar system are still present, and users will not notice a difference in the interface.

    Full instructions are available here.

    Please insure that you have thoroughly read the instructions before asking questions, as they are probably already answered there.
    Last edited by Kier; Mon 19 Mar '01, 10:46am.
  • Sharg
    Senior Member
    • Jun 2000
    • 1607

    #2
    Hi kier,
    does your system allow admin to set max avatar size (lets say 80 x 80) and a weight (lets say 3ko) ?

    This worked with mysql storing , will it work with your sysem ?

    Comment

    • Sharg
      Senior Member
      • Jun 2000
      • 1607

      #3
      Oh, and does it allow user to upload their files, switch from one avater to the other (and have the previous one replaced and eareased ) ?

      Comment

      • Sharg
        Senior Member
        • Jun 2000
        • 1607

        #4
        Kier, you know what ?
        It would be GREAT to port this system to attached files to

        Comment

        • Kier
          Former Lead Developer, vBulletin
          • Sep 2000
          • 8179

          #5
          Originally posted by Sharg
          does your system allow admin to set max avatar size (lets say 80 x 80) and a weight (lets say 3kb) ?

          Oh, and does it allow user to upload their files, switch from one avater to the other (and have the previous one replaced and eareased ) ?
          Yes, All avatar options that are present when using the standard mySQL avatar system are still present

          Originally posted by Sharg
          Kier, you know what ?
          It would be GREAT to port this system to attached files to
          I'm not really interested in doing this for attached files, partly for security reasons, and partly because storing attachments in the database does not have the same problems/disadvantages as the avatar system. The reason I have done this for avatars is mainly to solve a problem with IE's cache which causes avatars to be downloaded again for every page, leading to increased server load and bandwidth use.
          Last edited by Kier; Sun 18 Mar '01, 4:17pm.

          Comment

          • Sharg
            Senior Member
            • Jun 2000
            • 1607

            #6
            Yes, All avatar options that are present when using the standard mySQL avatar system are still present
            Ok, just wanted to make sure they worked with directory storing, as I thought these size and weight option were database storing specific.

            Another question: do I need to set to 777 the directory storing the avatars ?

            Comment

            • Kier
              Former Lead Developer, vBulletin
              • Sep 2000
              • 8179

              #7
              Originally posted by Sharg
              Another question: do I need to set to 777 the directory storing the avatars ?
              Do the instructions say you have to? Have a read. http://kier.3dfrontier.com/vbhacks/avatarasfile.php

              Comment

              • Kier
                Former Lead Developer, vBulletin
                • Sep 2000
                • 8179

                #8
                And I quote:

                1) Firstly, you will need to create a new folder in your forums directory called custom_avatars and set the permissions on the folder to 777.

                Comment

                • Sharg
                  Senior Member
                  • Jun 2000
                  • 1607

                  #9
                  Just a last question before I try to install it:

                  I'm not really interested in doing this for attached files, partly for security reasons,
                  What's the security concern that attachement files folder storing involve that isn't involved by avatar folder storing ?

                  Comment

                  • Kier
                    Former Lead Developer, vBulletin
                    • Sep 2000
                    • 8179

                    #10
                    Originally posted by Sharg
                    What's the security concern that attachement files folder storing involve that isn't involved by avatar folder storing ?
                    Avatars are always stored as xxxx.gif. Attachments can be of any file type that the administrator decides to allow. If an administrator decided to let .php files be uploaded, and they were stored as files on the system, anyone could run a php script that could destroy the server.

                    It's a bad idea.

                    Comment

                    • Sharg
                      Senior Member
                      • Jun 2000
                      • 1607

                      #11
                      Ok, got it, thanks Kier.
                      I didn't considered this cause I would only allow jpg,gif, txt and zip and would use it.

                      Anyway, good job with this hack. Gives the webmaster the final decision.

                      Comment

                      • Chris Schreiber
                        Senior Member
                        • Jun 2000
                        • 4113
                        • 4.0.x

                        #12
                        Another wonderful hack, thanks Kier.... I already have it installed and working on Me2Be's forums.

                        Just one small typo, in the control panel options, it says "Store Custom Avatars in Database?", but this has to be set to "yes" to use files, "no" to use the database. It should say "Store Custom Avatars as Files?". But otherwise it works great!

                        Thanks

                        Comment

                        • Kier
                          Former Lead Developer, vBulletin
                          • Sep 2000
                          • 8179

                          #13
                          Fixed

                          If you have this problem and want to correct it, run this query:

                          Code:
                          UPDATE setting SET title='Store Custom Avatars as Files?' WHERE varname='usefileavatar'

                          Comment

                          • Kier
                            Former Lead Developer, vBulletin
                            • Sep 2000
                            • 8179

                            #14
                            important

                            I just discovered that two php files that require modifications were not mentioned in the original documentation... please revisit the docs and follow the steps to modify private.php and announcement.php if you installed this hack prior to the posting of this message.

                            Comment

                            • -saturn-
                              Member
                              • Jan 2001
                              • 93

                              #15
                              Kier, you are great!

                              Are all avatars stored as GIFs? Even those uploaded as JPGs? I'm asking because you said "Avatars are always stored as xxxx.gif".

                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...