function Resampled_Image_URL($attachment_id, $width = 0, $height = 0, $crop = False, $grayscale = False, $negate = False, $qualy = 80)
 {
     global $blog_id;
     // Mime Type
     list($attachment_mime, $attachment_type) = Explode('/', get_post_mime_type($attachment_id));
     // Attachment file
     $attachment_file = RealPath(get_attached_file($attachment_id));
     // Read Cache Directory and URL
     $cache_file_name = '/image_thumbs/' . IntVal($blog_id) . '-' . IntVal($attachment_id) . '-' . IntVal($width) . '-' . IntVal($height) . '-' . IntVal($crop) . '-' . IntVal($grayscale) . '-' . IntVal($negate) . '-' . IntVal($qualy) . '.' . $attachment_type;
     if (Is_File(WP_CONTENT_DIR . $cache_file_name) && Is_File($attachment_file) && FileSize(WP_CONTENT_DIR . $cache_file_name) > 0 && FileMTime(WP_CONTENT_DIR . $cache_file_name) > FileMTime($attachment_file)) {
         return WP_CONTENT_URL . $cache_file_name;
     } else {
         return $this->base_url . '/wp-thumb.php?' . HTTP_Build_Query(array('a' => IntVal($attachment_id), 'w' => IntVal($width), 'h' => IntVal($height), 'c' => IntVal($crop), 'g' => IntVal($grayscale), 'n' => IntVal($negate), 'q' => IntVal($qualy)));
     }
 }
Example #2
0
 public static function GenerateLoginURL($ReturnTo)
 {
     $Host = self::GetHost();
     $Parameters = array('openid.identity' => 'http://specs.openid.net/auth/2.0/identifier_select', 'openid.claimed_id' => 'http://specs.openid.net/auth/2.0/identifier_select', 'openid.ns' => 'http://specs.openid.net/auth/2.0', 'openid.mode' => 'checkid_setup', 'openid.realm' => $Host, 'openid.return_to' => $Host . $ReturnTo);
     return self::STEAM_LOGIN . '?' . HTTP_Build_Query($Parameters, '', '&');
 }
Example #3
0
 function build_link($action, $dir = False, $file = False)
 {
     $link = SPrintF('?%s', HTTP_Build_Query(array('action' => $action, 'dir' => $dir ? $dir : Null, 'file' => $file ? $file : Null), Null, '&'));
     return $link;
 }