From 8a76d53f35eabe1b33f012e91fd745c1e0653203 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 21 Jun 2009 21:47:47 +0000 Subject: added convenience function for front page --- lib/exif.php | 1 - lib/tidypics.php | 35 +++++++++++++++++++++++++++++++++++ lib/watermark.php | 2 -- 3 files changed, 35 insertions(+), 3 deletions(-) (limited to 'lib') 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 @@ mimetype; diff --git a/lib/tidypics.php b/lib/tidypics.php index 1254f3ff6..d81b3ab2f 100644 --- a/lib/tidypics.php +++ b/lib/tidypics.php @@ -4,6 +4,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')) { +?> + +
+

+
+ +
+
+ + + * 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 * 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 @@