aboutsummaryrefslogtreecommitdiff
path: root/mod/twitter_api/lib
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2011-11-18 07:32:27 +0100
committerSem <sembrestels@riseup.net>2011-11-18 07:32:27 +0100
commite53d410129701ea1c9d19529afa493f11b5f5b70 (patch)
treed9963b24bf8932654b4a47e36602c75975e50dba /mod/twitter_api/lib
parent377da25d2965c64941f83baae119fc970ec60982 (diff)
parent08a962c98e2923724f8013d6eaae89101243752a (diff)
downloadelgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.gz
elgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.bz2
Merge github.com:Elgg/Elgg
Conflicts: engine/lib/input.php
Diffstat (limited to 'mod/twitter_api/lib')
-rw-r--r--mod/twitter_api/lib/twitter_api.php19
1 files changed, 6 insertions, 13 deletions
diff --git a/mod/twitter_api/lib/twitter_api.php b/mod/twitter_api/lib/twitter_api.php
index b14b84f2d..355123992 100644
--- a/mod/twitter_api/lib/twitter_api.php
+++ b/mod/twitter_api/lib/twitter_api.php
@@ -184,29 +184,22 @@ function twitter_api_create_user($twitter) {
function twitter_api_update_user_avatar($user, $file_location) {
// twitter's images have a few suffixes:
// _normal
- // _resonably_small
+ // _reasonably_small
// _mini
// the twitter app here returns _normal. We want standard, so remove the suffix.
// @todo Should probably check that it's an image file.
$file_location = str_replace('_normal.jpg', '.jpg', $file_location);
- $sizes = array(
- 'topbar' => array(16, 16, TRUE),
- 'tiny' => array(25, 25, TRUE),
- 'small' => array(40, 40, TRUE),
- 'medium' => array(100, 100, TRUE),
- 'large' => array(200, 200, FALSE),
- 'master' => array(550, 550, FALSE),
- );
+ $icon_sizes = elgg_get_config('icon_sizes');
$filehandler = new ElggFile();
$filehandler->owner_guid = $user->getGUID();
- foreach ($sizes as $size => $dimensions) {
+ foreach ($icon_sizes as $size => $dimensions) {
$image = get_resized_image_from_existing_file(
$file_location,
- $dimensions[0],
- $dimensions[1],
- $dimensions[2]
+ $dimensions['w'],
+ $dimensions['h'],
+ $dimensions['square']
);
$filehandler->setFilename("profile/$user->guid$size.jpg");