aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2009-06-21 21:47:47 +0000
committerCash Costello <cash.costello@gmail.com>2009-06-21 21:47:47 +0000
commit8a76d53f35eabe1b33f012e91fd745c1e0653203 (patch)
treee7bf1fc433e499e2fa45f79a623a6a120f6b62f1 /lib
parent779ff6e97e53a016b9384427d65d98daf6480e24 (diff)
downloadelgg-8a76d53f35eabe1b33f012e91fd745c1e0653203.tar.gz
elgg-8a76d53f35eabe1b33f012e91fd745c1e0653203.tar.bz2
added convenience function for front page
Diffstat (limited to 'lib')
-rw-r--r--lib/exif.php1
-rw-r--r--lib/tidypics.php35
-rw-r--r--lib/watermark.php2
3 files changed, 35 insertions, 3 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;