Aug 18

By default timthumb offers a cropping starting from center middle. Sometimes you may need some flexibility with a script so we used our knowledge to modify it a bit and make it more functionak for our needs. There are approx. 30 lines of code to add to make it work (see below). This supposed to make the use of plugins based on timthumb more flexible.By default timthumb offers a cropping starting from center middle. Sometimes you may need some flexibility with a script so we used our knowledge to modify it a bit and make it more functionak for our needs. There are approx. 30 lines of code to add to make it work (see below). This supposed to make the use of plugins based on timthumb more flexible.

Also an edited version is available for download.

Added “cropfrom” filter, accepted are values:

1. middle,

2. middleleft,

3. middleright,

4. topleft,

5. topright,

6. topcenter,

7. bottomleft,

8. bottomright,

9. bottomcenter,

simple modification done in 1 place on timthumb.php – easy for any level.

If you want to edit an original timthumb code:

1. Download recent timthumb version.

Read all about it and it’s usage if you not familiar with it yet.

2. Open it in text editor, and:

find: (line 59)

$quality         = preg_replace(“/[^0-9]+/”, “”, get_request(“q”, 80));

$filters        = get_request(“f”, “”);

add below:

// get crop position – added by studio-xl.com

$crop_from = get_request( ‘cropfrom’, ‘middle’ ) ;

// get crop position – added by studio-xl.com

find: (line 160)

imagecopyresampled( $canvas, $image, 0, 0, $src_x, $src_y, $new_width, $new_height, $src_w, $src_h );

REPLACE with:

// Crop position – modification by Studi-XL.com

if($crop_from ==”middle” )

// crop from center

{ imagecopyresampled( $canvas, $image, 0, 0, $src_x, $src_y, $new_width, $new_height, $src_w, $src_h ); }

// crop from middle left

elseif ($crop_from ==”middleleft” )

// crop from middle right

{ imagecopyresampled( $canvas, $image, 0, 0, 0, $src_y, $new_width, $new_height, $src_w, $src_h ); }

elseif ($crop_from ==”middleright” )

// crop from top center

{ imagecopyresampled( $canvas, $image, 0, 0, 2*$src_x, $src_y, $new_width, $new_height, $src_w, $src_h ); }

elseif ($crop_from ==”topcenter” )

// crop from top center

{ imagecopyresampled( $canvas, $image, 0, 0, $src_x, 0, $new_width, $new_height, $src_w, $src_h ); }

elseif ($crop_from ==”topleft” )

// crop from top left

{ imagecopyresampled( $canvas, $image, 0, 0, 0, 0, $new_width, $new_height, $src_w, $src_h ); }

elseif ($crop_from ==”topright” )

// crop from top center

{ imagecopyresampled( $canvas, $image, 0, 0, 2*$src_x, 0, $new_width, $new_height, $src_w, $src_h ); }

elseif ($crop_from ==”bottomcenter” )

// crop from bottom center

{ imagecopyresampled( $canvas, $image, 0, 0, $src_x, 2*$src_y, $new_width, $new_height, $src_w, $src_h ); }

elseif ($crop_from ==”bottomleft” )

// crop from bottom left

{ imagecopyresampled( $canvas, $image, 0, 0, 0, 2*$src_y, $new_width, $new_height, $src_w, $src_h ); }

elseif ($crop_from ==”bottomright” )

// crop from bottom center

{ imagecopyresampled( $canvas, $image, 0, 0, 2*$src_x, 2*$src_y, $new_width, $new_height, $src_w, $src_h ); }

elseif  (!$crop_from)

// no data

{ imagecopyresampled( $canvas, $image, 0, 0, $src_x, $src_y, $new_width, $new_height, $src_w, $src_h ); }

// Crop position – modification by Studi-XL.com

* You may delete any block that you don’t need or leave it all for a max. flexibility.

3. Usage:

by default timthumb query string looks something like this:

src=/images/whatever.jpg&h=150&w=150&zc=1

we added 1 more filter which tells timthumb where to position cropping, you need to add &cropfrom=[position] to it, for example:

src=/images/whatever.jpg&h=150&w=150&zc=1&cropfrom=topleft

If you want an already updated file

You may download a modified ver. This one is fully working and used in our WP blogs.

Dowload edited timthumb.php

Demo of all positions

demo link

Aug 03

limit-login-attempts

Russian Translation available for Limit Login Attempts, tested on Wordpress 2.8.2.

Done by Studio-XL, available for download here:

Limit Login Attempts Russian

More info and instructions in Russian here:

link

limit-login-attempts

Russian Translation available for Limit Login Attempts, tested on Wordpress 2.8.2.

Done by Studio-XL, available for download here:

Limit Login Attempts Russian

More info and instructions in Russian here:

link

Jul 31

preview

GD Star Rating Plugin – the best Rating plugin available for Wordpress – is now translated to Russian.

More info about the plugin is available at GD Star Rating official website and their Forums.

More info about the translation is available at the Russian version of this post.

Demo and example of translated plugin may be found on Dunduk.com website

Download translation files:

GD Star Rating – Russian

Jul 30

Russian translation for a “skype online status” plugin for Wordpress.

More info about the plugin available on plugin’s author’s page.

Skype Online Status development release

Donwload Russian translated files:
skype-online-status-RU.

Jul 10


Best Magento Free Themes Roundup

1.Magento Modern Theme

This theme delivers a more corporate look and feel with a clean and simplistic design. You can view in-action demo here

Available on MagentoConnect (free)


Best Magento Free Themes Roundup

1.Magento Modern Theme

This theme delivers a more corporate look and feel with a clean and simplistic design. You can view in-action demo here

Available on MagentoConnect (free)


Best Magento Free Themes Roundup

1.Magento Modern Theme

This theme delivers a more corporate look and feel with a clean and simplistic design. You can view in-action demo here

Available on MagentoConnect (free)

Continue reading »