Wordpress help please!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rogueteens
    So fucking bland
    • Jul 2006
    • 8005

    #1

    Business Wordpress help please!

    Two questions ....

    1) What's the best wordpress stats plug-in at the moment? I'm mostly after low server load with this plugin.

    2) Is there a way for a wordpress install to check on uploaded images and refuse ones that are below a sertain size?

    Cheers.
    Free traffic and backlinks from one of the fastest growing adult pinsites on the net - SAUCY PICTURES!
    Easily my best performing webcam sponsor - CLICK HERE!!
  • fris
    Too lazy to set a custom title
    • Aug 2002
    • 55679

    #2
    1. https://en-ca.wordpress.org/plugins/...for-wordpress/

    they have a pro version too.

    2. you can use filters to limit the size, depends if you want dimensions, or filesize

    which is it you want for #2?
    Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

    Comment

    • fris
      Too lazy to set a custom title
      • Aug 2002
      • 55679

      #3
      here is both methods

      Code:
      add_filter('wp_handle_upload_prefilter','_limit_image_dimensions');
      
      function _limit_image_dimensions( $file ) {
          $image = getimagesize($file['tmp_name']);
      
          $minimum = array(
              'width' => '400',
              'height' => '400'
          );
      
          $maximum = array(
              'width' => '2000',
              'height' => '2000'
          );
          $image_width = $image[0];
          $image_height = $image[1];
      
          $too_small = "Image dimensions are too small. Minimum size is {$minimum['width']} by {$minimum['height']} pixels. Uploaded image is $image_width by $image_height pixels.";
          $too_large = "Image dimensions are too large. Maximum size is {$maximum['width']} by {$maximum['height']} pixels. Uploaded image is $image_width by $image_height pixels.";
      
          if ( $image_width < $minimum['width'] || $image_height < $minimum['height'] ) {
              $file['error'] = $too_small; 
              return $file;
          }
          elseif ( $image_width > $maximum['width'] || $image_height > $maximum['height'] ) {
              $file['error'] = $too_large; 
              return $file;
          }
          else
              return $file;
      }
      
      function _limit_image_size($file) {
      
          $image_size = $file['size']/1024;
      
          $limit = 200; // size in kb
      
          $is_image = strpos($file['type'], 'image');
      
          if ( ( $image_size > $limit ) && ($is_image !== false) )
                $file['error'] = 'Your picture is too large. It has to be smaller than '. $limit .'KB';
      
                return $file;
      
      }
      add_filter('wp_handle_upload_prefilter', '_limit_image_size');
      Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

      Comment

      • rogueteens
        So fucking bland
        • Jul 2006
        • 8005

        #4
        cheers, I've already installed that google analytics for wordpress, I saw how many d/ls it had and thought it worth a try.

        the code, which file should it go in?
        Free traffic and backlinks from one of the fastest growing adult pinsites on the net - SAUCY PICTURES!
        Easily my best performing webcam sponsor - CLICK HERE!!

        Comment

        • fris
          Too lazy to set a custom title
          • Aug 2002
          • 55679

          #5
          your themes functions.php file
          Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

          Comment

          • rogueteens
            So fucking bland
            • Jul 2006
            • 8005

            #6
            Thanks, unfortunately, it didn't work. I've a feeling that there is already code in the functions code that does this but is set very low, maybe but php is dutch to me.
            Free traffic and backlinks from one of the fastest growing adult pinsites on the net - SAUCY PICTURES!
            Easily my best performing webcam sponsor - CLICK HERE!!

            Comment

            • fris
              Too lazy to set a custom title
              • Aug 2002
              • 55679

              #7
              Originally posted by rogueteens
              Thanks, unfortunately, it didn't work. I've a feeling that there is already code in the functions code that does this but is set very low, maybe but php is dutch to me.
              if you can send me the theme i can assist.

              zip it up and email me it.
              Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

              Comment

              • NatalieK
                Natalie K
                • Apr 2010
                • 20106

                #8
                bump for help on WP, maybe BabeTerminal can help, he´s not much good for anything, but who knows...

                My official site Custom vids Make money & get into the businessFirst time girls
                Skype: GspotProductions - "Converting traffic into income since 2005"

                Comment

                • rogueteens
                  So fucking bland
                  • Jul 2006
                  • 8005

                  #9
                  Originally posted by fris
                  if you can send me the theme i can assist.

                  zip it up and email me it.
                  mail sent, many thanks
                  Free traffic and backlinks from one of the fastest growing adult pinsites on the net - SAUCY PICTURES!
                  Easily my best performing webcam sponsor - CLICK HERE!!

                  Comment

                  Working...