<?php
-include_once dirname(__FILE__) . "/tidypics.php";
function td_get_exif($file) {
$mime = $file->mimetype;
* \r
*/\r
\r
+ /**\r
+ * Get images for display on front page\r
+ *\r
+ * @param int number of images\r
+ * @param int (optional) guid of owner\r
+ * @return string of html for display\r
+ *\r
+ * To use with the custom index plugin, use something like this:\r
+ \r
+ if (is_plugin_enabled('tidypics')) {\r
+?>\r
+ <!-- display latest photos -->\r
+ <div class="index_box">\r
+ <h2><a href="<?php echo $vars['url']; ?>pg/photos/world/"><?php echo elgg_echo("tidypics:mostrecent"); ?></a></h2>\r
+ <div class="contentWrapper">\r
+ <?php\r
+ echo tp_get_latest_photos(5);\r
+ ?>\r
+ </div>\r
+ </div>\r
+<?php\r
+ }\r
+?>\r
+\r
+ * Good luck\r
+ */\r
+ function tp_get_latest_photos($num_images, $owner_guid = 0)\r
+ {\r
+ $prev_context = set_context('front');\r
+ $image_html = list_entities('object', 'image', $owner_guid, $num_images, false, false, false); \r
+ set_context($prev_context);\r
+ return $image_html;\r
+ }\r
+ \r
+ \r
/**\r
* Get image directory path\r
*\r
<?php
-include_once dirname(__FILE__) . "/tidypics.php";
-
function tp_watermark($thumbs) {
global $CONFIG;
define('TP_OLD_ALBUM', 0);\r
define('TP_NEW_ALBUM', 1);\r
\r
+ // include core libraries\r
+ include dirname(__FILE__) . "/lib/tidypics.php";\r
\r
\r
/**\r
}
-/////////////////////////////////////////////////////
-//
-// 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
}
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;?>&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');
\r
if ($album_river_view == "cover") {\r
if ($album->cover) {\r
- $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>";\r
+ $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>";\r
}\r
} else {\r
\r
\r
if (count($images)) {\r
foreach($images as $image){\r
- $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>';\r
+ $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>';\r
}\r
}\r
\r
$string .= "<div class=\"river_content\">";\r
\r
/* // this adds the album cover to the river display \r
- $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>';\r
+ $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>';\r
*/\r
- $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>';\r
+ $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>';\r
$string .= "</div>";\r
\r
echo $string;\r
}\r
\r
echo '<div class="tidypics_edit_image_container">';\r
- echo '<img src="' . $vars['url'] . 'mod/tidypics/thumbnail.php?file_guid=' . $guid . '&size=small" border="0" class="tidypics_edit_images" alt="' . $title . '"/>';\r
+ echo '<img src="' . $vars['url'] . 'mod/tidypics/thumbnail.php?file_guid=' . $guid . '&size=small" class="tidypics_edit_images" alt="' . $title . '"/>';\r
echo '<div class="tidypics_image_info">';\r
echo '<p><label>' . elgg_echo('album:title') . '</label>';\r
echo elgg_view("input/text", array("internalname" => "title[$key]", "value" => $title,)) . "\n";\r