aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/exif.php1
-rw-r--r--lib/tidypics.php35
-rw-r--r--lib/watermark.php2
-rw-r--r--start.php2
-rw-r--r--views/default/object/image.php43
-rw-r--r--views/default/river/object/album/create.php4
-rw-r--r--views/default/river/object/image/create.php4
-rw-r--r--views/default/tidypics/forms/edit_multi.php2
8 files changed, 68 insertions, 25 deletions
diff --git a/lib/exif.php b/lib/exif.php
index 9d5ae6343..2bc25c996 100644
--- a/lib/exif.php
+++ b/lib/exif.php
@@ -1,5 +1,4 @@
<?php
-include_once dirname(__FILE__) . "/tidypics.php";
function td_get_exif($file) {
$mime = $file->mimetype;
diff --git a/lib/tidypics.php b/lib/tidypics.php
index 1254f3ff6..d81b3ab2f 100644
--- a/lib/tidypics.php
+++ b/lib/tidypics.php
@@ -5,6 +5,41 @@
*/
/**
+ * Get images for display on front page
+ *
+ * @param int number of images
+ * @param int (optional) guid of owner
+ * @return string of html for display
+ *
+ * To use with the custom index plugin, use something like this:
+
+ if (is_plugin_enabled('tidypics')) {
+?>
+ <!-- display latest photos -->
+ <div class="index_box">
+ <h2><a href="<?php echo $vars['url']; ?>pg/photos/world/"><?php echo elgg_echo("tidypics:mostrecent"); ?></a></h2>
+ <div class="contentWrapper">
+ <?php
+ echo tp_get_latest_photos(5);
+ ?>
+ </div>
+ </div>
+<?php
+ }
+?>
+
+ * Good luck
+ */
+ function tp_get_latest_photos($num_images, $owner_guid = 0)
+ {
+ $prev_context = set_context('front');
+ $image_html = list_entities('object', 'image', $owner_guid, $num_images, false, false, false);
+ set_context($prev_context);
+ return $image_html;
+ }
+
+
+ /**
* Get image directory path
*
* Each album gets a subdirectory based on its container id
diff --git a/lib/watermark.php b/lib/watermark.php
index ddc41a36b..330ae7b29 100644
--- a/lib/watermark.php
+++ b/lib/watermark.php
@@ -1,7 +1,5 @@
<?php
-include_once dirname(__FILE__) . "/tidypics.php";
-
function tp_watermark($thumbs) {
global $CONFIG;
diff --git a/start.php b/start.php
index cfd20db62..24423dafd 100644
--- a/start.php
+++ b/start.php
@@ -8,6 +8,8 @@
define('TP_OLD_ALBUM', 0);
define('TP_NEW_ALBUM', 1);
+ // include core libraries
+ include dirname(__FILE__) . "/lib/tidypics.php";
/**
diff --git a/views/default/object/image.php b/views/default/object/image.php
index 9e78ece75..c99bb1ed9 100644
--- a/views/default/object/image.php
+++ b/views/default/object/image.php
@@ -56,17 +56,17 @@ if ($photo_tags) {
}
-/////////////////////////////////////////////////////
-//
-// search view of an image
-//
-/////////////////////////////////////////////////////
+/********************************************************************
+ *
+ * search view of an image
+ *
+ ********************************************************************/
if (get_context() == "search") {
if (get_input('search_viewtype') == "gallery") {
?>
<div class="tidypics_album_images">
- <a href="<?php echo $file->getURL();?>"><img src="<?php echo $vars['url'];?>mod/tidypics/thumbnail.php?file_guid=<?php echo $file_guid;?>&size=small" border="0" alt="thumbnail"/></a>
+ <a href="<?php echo $file->getURL();?>"><img src="<?php echo $vars['url'];?>mod/tidypics/thumbnail.php?file_guid=<?php echo $file_guid;?>&size=small" alt="thumbnail"/></a>
</div>
<?php
}
@@ -82,26 +82,35 @@ if ($photo_tags) {
echo elgg_view_listing($icon, $info);
}
+/***************************************************************
+ *
+ * front page view
+ *
+ ****************************************************************/
+ } else if (get_context() == "front") {
+?>
+ <a href="<?php echo $file->getURL();?>"><img src="<?php echo $vars['url'];?>mod/tidypics/thumbnail.php?file_guid=<?php echo $file_guid;?>&amp;size=thumb" class="tidypics_album_cover" alt="<?php echo $title; ?>" title="<?php echo $title; ?>" /></a>
+<?php
} else {
-////////////////////////////////////////////////
-//
-// simple gallery view - when is this called?
-//
-////////////////////////////////////////////////
+/********************************************************************
+ *
+ * simple gallery view - when is this called?
+ *
+ *********************************************************************/
if (!$vars['full']) {
?>
<div class="tidypics_album_images">
- <a href="<?php echo $file->getURL();?>"><img src="<?php echo $vars['url'];?>mod/tidypics/thumbnail.php?file_guid=<?php echo $file_guid;?>&size=small" border="0" alt="thumbnail"/></a>
+ <a href="<?php echo $file->getURL();?>"><img src="<?php echo $vars['url'];?>mod/tidypics/thumbnail.php?file_guid=<?php echo $file_guid;?>&size=small" alt="thumbnail"/></a>
</div>
<?php
} else {
-////////////////////////////////////////////////////////
-//
-// tidypics individual image display
-//
-////////////////////////////////////////////////////////
+/********************************************************************
+ *
+ * tidypics individual image display
+ *
+ *********************************************************************/
$view_count = get_plugin_setting('view_count', 'tidypics');
diff --git a/views/default/river/object/album/create.php b/views/default/river/object/album/create.php
index 9c2486fa2..a9b261566 100644
--- a/views/default/river/object/album/create.php
+++ b/views/default/river/object/album/create.php
@@ -20,7 +20,7 @@
if ($album_river_view == "cover") {
if ($album->cover) {
- $string .= "<div class=\"river_content\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $album->cover . '&size=thumb" border="0" class="tidypics_album_cover" alt="thumbnail"/>' . "</div>";
+ $string .= "<div class=\"river_content\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $album->cover . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/>' . "</div>";
}
} else {
@@ -30,7 +30,7 @@
if (count($images)) {
foreach($images as $image){
- $string .= "<a href=\"" . $image->getURL() . "\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $image->guid . '&size=thumb" border="0" class="tidypics_album_cover" alt="thumbnail"/> </a>';
+ $string .= "<a href=\"" . $image->getURL() . "\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $image->guid . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/> </a>';
}
}
diff --git a/views/default/river/object/image/create.php b/views/default/river/object/image/create.php
index 8f7a856ea..5229e109a 100644
--- a/views/default/river/object/image/create.php
+++ b/views/default/river/object/image/create.php
@@ -19,9 +19,9 @@
$string .= "<div class=\"river_content\">";
/* // this adds the album cover to the river display
- $string .= "<a href=\"" . $album->getURL() . "\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $album->cover . '&size=thumb" border="0" class="tidypics_album_cover" alt="thumbnail"/> </a>';
+ $string .= "<a href=\"" . $album->getURL() . "\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $album->cover . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/> </a>';
*/
- $string .= "<a href=\"" . $image->getURL() . "\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $image->guid . '&size=thumb" border="0" class="tidypics_album_cover" alt="thumbnail"/> </a>';
+ $string .= "<a href=\"" . $image->getURL() . "\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $image->guid . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/> </a>';
$string .= "</div>";
echo $string;
diff --git a/views/default/tidypics/forms/edit_multi.php b/views/default/tidypics/forms/edit_multi.php
index 01ffb3128..f6c29e4a5 100644
--- a/views/default/tidypics/forms/edit_multi.php
+++ b/views/default/tidypics/forms/edit_multi.php
@@ -27,7 +27,7 @@
}
echo '<div class="tidypics_edit_image_container">';
- echo '<img src="' . $vars['url'] . 'mod/tidypics/thumbnail.php?file_guid=' . $guid . '&size=small" border="0" class="tidypics_edit_images" alt="' . $title . '"/>';
+ echo '<img src="' . $vars['url'] . 'mod/tidypics/thumbnail.php?file_guid=' . $guid . '&size=small" class="tidypics_edit_images" alt="' . $title . '"/>';
echo '<div class="tidypics_image_info">';
echo '<p><label>' . elgg_echo('album:title') . '</label>';
echo elgg_view("input/text", array("internalname" => "title[$key]", "value" => $title,)) . "\n";