/* Plugin Name: Feed List Plugin URI: http://rawlinson.us/blog/articles/feedlist-plugin/ Description: Displays any ATOM or RSS feed in your blog. Author: Bill Rawlinson Author URI: http://blog.rawlinson.us/ Version: 2.2 */ // include files $relroot = dirname(__FILE__).'/../../'; // get the magpie libary if (file_exists($relroot . 'wp-includes/rss.php')) { require_once($relroot . 'wp-includes/rss.php'); } else if(file_exists($relroot . 'wp-includes/rss-functions.php')){ require_once($relroot . 'wp-includes/rss-functions.php'); } else { function FeedListInitError(){ ?>
');
print_r($val);
print('');
}
/* end utility functions */
}
function rssLinkListFilter($text)
{
return preg_replace_callback("//", "feedListFilter", $text);
}
/* Templates can call any of these functions */
function rssLinkList($args){
if(!is_array($args)){
$args = func_get_args();
}
return feedList($args);
}
function feedList($args){
if(!is_array($args)){
$args = func_get_args();
}
$feed = new FeedList($args);
return $feed->FeedListFeed();
}
function randomFeedList($args){
if(!is_array($args)){
$this->args = parse_str($args,$a);
$this->args = $a;
}
$feed = new FeedList($args);
return $feed->FeedListFile();
}
function feedListFilter($args){
$args = explode(",",$args[1]);
if(count($args) == 1 && !strpos($args[0],":=")){
$a = array();
$a["rss_feed_url"] = $args[0];
$args = $a;
} else {
$a = array();
foreach($args as $arg){
$arg = explode(":=",$arg);
$a[$arg[0]] = $arg[1];
}
$args = $a;
}
$feed = new FeedList($args);
return $feed->FeedListFilter();
}
/* end template functions */
if (function_exists('add_filter'))
{
add_filter('the_content', 'rssLinkListFilter');
}
if(function_exists('FeedListInitError')){
add_action('admin_head','FeedListInitError');
}
?>
$theTitle=wp_title(" - ", false);
if($theTitle != "") {
?>
30 Sep // php the_time('Y') ?>
When you load up a profile pic using the geekgrl profile picture plugin which is also basically the same plugin used by suleiman for wpmu the gd graphics library php code in these plugins squash or stretches the thumbnails.
You can see what I mean below.
Here’s an orginal picture:

Here’s the photo thumbnail with the original plugin code - squashed:

Here’s the photo resized and cropped from the center with my code:

Here’s the code that you need to replace:
For a 64 thumbnail cropped from center replace the following:
$new_image = imagecreatetruecolor(64,64);
imagecopyresampled($new_image, $image, 0, 0, 0, 0, 64, 0, $dimensions[0], $dimensions[1]);
imagejpeg($new_image, “$medium_file_path”);
imagedestroy($new_image);
With this new code:
list($ow, $oh) = getimagesize($_FILES[’picture’][’tmp_name’]);
$big = imagecreatefromjpeg($_FILES[’picture’][’tmp_name’]);
$new_image = imagecreatetruecolor(64,64);if ($ow > $oh) {
$off_w = ($ow-$oh)/2;
$off_h = 0;
$ow = $oh;
} elseif ($oh > $ow) {
$off_w = 0;
$off_h = ($oh-$ow)/2;$oh = $ow;
} else {
$off_w = 0;
$off_h = 0;
}
imagecopyresampled($new_image, $big, 0, 0, $off_w, $off_h, 64, 64, $ow, $oh);
imagejpeg($new_image, “$medium_file_path”);
imagedestroy($new_image);
One Response
Would like love view the article with the images available. They are not showing up for me.
Thanks.
Leave a reply