Patch for setting order on image upload

"Heath S. Hendrickson" <[email protected]>
Newsgroups gmane.comp.horde.ansel
Message-ID <[email protected]>
Attached is a small patch to lib/Gallery.php that does two things:

1) stores the current time() in the 'date-uploaded' attribute for future 
use (like a page of the last X images uploaded).  I did notice that a 
'date-created' attribute was being set in the Gallery.php code, but I 
haven't traced it through to know if that's reliable for uploaded time 
or if anything else might change that value... if it's reliable, then 
just remove this part of the patch (3 lines)

2) set's the datatree_order for an uploaded image to be the num-images 
for the gallery (placing it at the end of the gallery)

h

-- 
ansel mailing list - Join the hunt: http://horde.org/bounties/#ansel
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: [email protected]
Gallery.php.patch_setOrderOnUpload (text/plain, 696 B)
Index: lib/Gallery.php
===================================================================
RCS file: /usr/local/horde/cvs/ansel/lib/Gallery.php,v
retrieving revision 1.58
diff -u -r1.58 Gallery.php
--- lib/Gallery.php	10 May 2004 03:26:48 -0000	1.58
+++ lib/Gallery.php	11 May 2004 18:43:05 -0000
@@ -292,6 +292,12 @@
         // Update the modified flag.
         $this->data['last-modified'] = time();
 
+        // Set the upload date the  flag.
+        $this->data['date-uploaded'] = time();
+
+        // Set the order to the end of the gallery.
+        $this->setOrder($imageOb->getId(), $this->data['num-images']);
+
         // Store changes to the gallery.
         $this->update();
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.