diff options
author | Cash Costello <cash.costello@gmail.com> | 2009-06-20 20:52:39 +0000 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2009-06-20 20:52:39 +0000 |
commit | 1bf62f1bc10831d559df147868dd889e5985adcc (patch) | |
tree | 7e2824768e010978853270c831f4a8da9c027207 | |
parent | 774b7c79bfcdb5d3139ec16152e6955a86093699 (diff) | |
download | elgg-1bf62f1bc10831d559df147868dd889e5985adcc.tar.gz elgg-1bf62f1bc10831d559df147868dd889e5985adcc.tar.bz2 |
cleaned up icon code - don't need tidypics/icon view anymore - may reinstate it at a later time
-rw-r--r-- | actions/icon.php | 36 | ||||
-rw-r--r-- | start.php | 1 | ||||
-rw-r--r-- | views/default/object/album.php | 6 | ||||
-rw-r--r-- | views/default/object/image.php | 2 | ||||
-rw-r--r-- | views/default/tidypics/icon.php | 37 |
5 files changed, 6 insertions, 76 deletions
diff --git a/actions/icon.php b/actions/icon.php deleted file mode 100644 index bfc18198a..000000000 --- a/actions/icon.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php
- /**
- * tidypics icon action
- *
- */
-
- $file_guid = get_input("file_guid");
- $file = get_entity($file_guid);
-
- if ($file) {
- $filename = $file->thumbnail;
- $mime = $file->mimetype;
-
- header("Content-type: $mime");
- if (strpos($mime, "image/")!==false)
- header("Content-Disposition: inline; filename=\"$filename\"");
- else
- header("Content-Disposition: attachment; filename=\"$filename\"");
-
-
- $readfile = new ElggFile();
- $readfile->owner_guid = $file->owner_guid;
- $readfile->setFilename($filename);
-
- $contents = $readfile->grabFile();
-
- if (empty($contents))
- echo file_get_contents(dirname(dirname(__FILE__)) . "/graphics/icons/general.jpg" );
- else
- echo $contents;
-
- exit;
- } else {
- register_error(elgg_echo("file:downloadfailed"));
- }
-?>
\ No newline at end of file @@ -386,7 +386,6 @@ register_action("tidypics/addalbum", false, $CONFIG->pluginspath. "tidypics/actions/addalbum.php");
register_action("tidypics/edit", false, $CONFIG->pluginspath. "tidypics/actions/edit.php");
register_action("tidypics/delete", false, $CONFIG->pluginspath. "tidypics/actions/delete.php");
- register_action("tidypics/icon", true, $CONFIG->pluginspath. "tidypics/actions/icon.php");
register_action("tidypics/edit_multi", false, $CONFIG->pluginspath. "tidypics/actions/edit_multi.php");
register_action("tidypics/download", true, $CONFIG->pluginspath . "tidypics/actions/download.php");
register_action("tidypics/addtag", true, $CONFIG->pluginspath . "tidypics/actions/addtag.php");
diff --git a/views/default/object/album.php b/views/default/object/album.php index 3a5f5a975..ca28d1672 100644 --- a/views/default/object/album.php +++ b/views/default/object/album.php @@ -64,7 +64,11 @@ $info .= ", <a href=\"{$album->getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")</a>"; $info .= "</p>"; - $icon = "<a href=\"{$album->getURL()}\">" . elgg_view("tidypics/icon", array('album' => true, 'size' => 'small')) . "</a>"; + //get album cover if one was set + if ($album->cover) + $icon = "<a href=\"{$album->getURL()}\">" . '<img src="' . $vars['url'] . 'mod/tidypics/thumbnail.php?file_guid=' . $album->cover . '&size=thumb" alt="thumbnail" /></a>'; + else + $icon = "<a href=\"{$album->getURL()}\">" . '<img src="' . $vars['url'] . 'mod/tidypics/graphics/image_error_thumb.png" alt="new album"></a>'; echo elgg_view_listing($icon, $info); } diff --git a/views/default/object/image.php b/views/default/object/image.php index 03ba12a02..d09b721f1 100644 --- a/views/default/object/image.php +++ b/views/default/object/image.php @@ -78,7 +78,7 @@ if ($photo_tags) { if ($numcomments) $info .= ", <a href=\"{$file->getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")</a>"; $info .= "</p>"; - $icon = "<a href=\"{$file->getURL()}\">" . elgg_view("tidypics/icon", array("mimetype" => $mime, 'thumbnail' => $file->thumbnail, 'file_guid' => $file_guid, 'size' => 'small')) . "</a>"; + $icon = "<a href=\"{$file->getURL()}\">" . '<img src="' . $vars['url'] . 'mod/tidypics/thumbnail.php?file_guid=' . $file_guid . '&size=thumb" alt="' . $title . '" /></a>'; echo elgg_view_listing($icon, $info); } diff --git a/views/default/tidypics/icon.php b/views/default/tidypics/icon.php deleted file mode 100644 index c960bc00b..000000000 --- a/views/default/tidypics/icon.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - /** - * Elgg tidypic icon - * Optionally you can specify a size. - * - */ - - global $CONFIG; - -if($vars['album']){ - echo "<img src=\"{$CONFIG->wwwroot}mod/tidypics/graphics/icons/album.gif\" border=\"0\" />"; -} -else{ - - $mime = $vars['mimetype']; - if (isset($vars['thumbnail'])) { - $thumbnail = $vars['thumbnail']; - } else { - $thumbnail = false; - } - - $size = $vars['size']; - if ($size != 'large') { - $size = 'small'; - } - - if ($thumbnail && strpos($mime, "image/")!==false) - echo "<img src=\"{$vars['url']}action/tidypics/icon?file_guid={$vars['file_guid']}\" border=\"0\" />"; - else - { - if ($size == 'large') - echo "<img src=\"{$CONFIG->wwwroot}mod/tidypics/graphics/icons/general_lrg.gif\" border=\"0\" />"; - else - echo "<img src=\"{$CONFIG->wwwroot}mod/tidypics/graphics/icons/general.gif\" border=\"0\" />"; - } -} -?>
\ No newline at end of file |