aboutsummaryrefslogtreecommitdiff
path: root/mod/profile/icondirect.php
diff options
context:
space:
mode:
authorkevinjardine <kevinjardine@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-24 10:36:23 +0000
committerkevinjardine <kevinjardine@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-24 10:36:23 +0000
commitdea94d966389092be57ea517065c8822242711ae (patch)
tree45d5ec09d704c17099bbf54c5ca33e89c11efa3f /mod/profile/icondirect.php
parentadc58d2bc1807b6c41b012aae7eb74795ac17c67 (diff)
downloadelgg-dea94d966389092be57ea517065c8822242711ae.tar.gz
elgg-dea94d966389092be57ea517065c8822242711ae.tar.bz2
Made icon views work properly for non-default icons, and introduced elgg_view_enable_simplecache and elgg_view_disable_simplecache functions.
git-svn-id: https://code.elgg.org/elgg/trunk@2910 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/profile/icondirect.php')
-rw-r--r--mod/profile/icondirect.php39
1 files changed, 18 insertions, 21 deletions
diff --git a/mod/profile/icondirect.php b/mod/profile/icondirect.php
index 49d230efa..497420f55 100644
--- a/mod/profile/icondirect.php
+++ b/mod/profile/icondirect.php
@@ -71,33 +71,30 @@
$row = mysql_fetch_object($result);
}
}
- $filename = $dataroot . $matrix . "{$username}/profile/" . $username . $size . ".jpg";
- $contents = @file_get_contents($filename);
}
}
- if (empty($contents)) {
-
- global $CONFIG, $viewinput;
- $viewinput['view'] = 'icon/user/default/'.$size;
- if ($simplecache_enabled) {
+ if ($simplecache_enabled) {
+ $filename = $dataroot . $matrix . "{$username}/profile/" . $username . $size . ".jpg";
+ $contents = @file_get_contents($filename);
+ if (empty($contents)) {
+ global $viewinput;
+ $viewinput['view'] = 'icon/user/default/'.$size;
ob_start();
include(dirname(dirname(dirname(__FILE__))).'/simplecache/view.php');
$loc = ob_get_clean();
+ header('Location: ' . $loc);
+ exit;
//$contents = @file_get_contents(dirname(__FILE__) . "/graphics/default{$size}.jpg");
- } else {
- mysql_close($mysql_dblink);
- require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
- $loc = elgg_view($viewinput['view']);
+ } else {
+ header("Content-type: image/jpeg");
+ header('Expires: ' . date('r',time() + 864000));
+ header("Pragma: public");
+ header("Cache-Control: public");
+ header("Content-Length: " . strlen($contents));
+ echo $contents;
}
- header('Location: ' . $loc);
- exit;
+ } else {
+ mysql_close($mysql_dblink);
+ require_once(dirname(__FILE__).'/icon.php');
}
-
- header("Content-type: image/jpeg");
- header('Expires: ' . date('r',time() + 864000));
- header("Pragma: public");
- header("Cache-Control: public");
- header("Content-Length: " . strlen($contents));
- echo $contents;
-
?> \ No newline at end of file