aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/icon.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-14 02:14:20 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-14 02:14:20 +0000
commit6ccf524f48df49ed97a2c0c051f0276a377b9f48 (patch)
tree5016040ef327c29523774471ec52acd7b4644eb9 /mod/groups/icon.php
parent5dfb9a97cd5d99479610339f1c613f1468b96687 (diff)
downloadelgg-6ccf524f48df49ed97a2c0c051f0276a377b9f48.tar.gz
elgg-6ccf524f48df49ed97a2c0c051f0276a377b9f48.tar.bz2
finished discussion rewrite to use new html/css
git-svn-id: http://code.elgg.org/elgg/trunk@7881 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/icon.php')
-rw-r--r--mod/groups/icon.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/mod/groups/icon.php b/mod/groups/icon.php
new file mode 100644
index 000000000..a6ceaf3b5
--- /dev/null
+++ b/mod/groups/icon.php
@@ -0,0 +1,41 @@
+<?php
+ /**
+ * Icon display
+ *
+ * @package ElggGroups
+ */
+
+ global $CONFIG;
+ require_once(dirname(dirname(dirname(dirname(__FILE__)))) . "/engine/start.php");
+
+ $group_guid = get_input('group_guid');
+ $group = get_entity($group_guid);
+
+ $size = strtolower(get_input('size'));
+ if (!in_array($size,array('large','medium','small','tiny','master','topbar')))
+ $size = "medium";
+
+ $success = false;
+
+ $filehandler = new ElggFile();
+ $filehandler->owner_guid = $group->owner_guid;
+ $filehandler->setFilename("groups/" . $group->guid . $size . ".jpg");
+
+ $success = false;
+ if ($filehandler->open("read")) {
+ if ($contents = $filehandler->read($filehandler->size())) {
+ $success = true;
+ }
+ }
+
+ if (!$success) {
+ $contents = @file_get_contents($CONFIG->pluginspath . "groups/graphics/default{$size}.jpg");
+ }
+
+ 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