summaryrefslogtreecommitdiff
path: root/classes/File_to_post.php
diff options
context:
space:
mode:
authorRobin Millette <millette@controlyourself.ca>2009-05-13 14:27:32 -0400
committerRobin Millette <millette@controlyourself.ca>2009-05-13 14:27:32 -0400
commit3b7ee5a5f9a2cd3066aff8a7a12d09878be3b06c (patch)
treed0f1521040251c6afe522f37f04aade4cd3fa89b /classes/File_to_post.php
parentd010d811ba812ccc8fbb1a49fcba7a30226ea779 (diff)
rewrote short url stuff to handle new file/url classes (redirections, oembed, mimetypes, etc.)
Diffstat (limited to 'classes/File_to_post.php')
-rw-r--r--classes/File_to_post.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/classes/File_to_post.php b/classes/File_to_post.php
index bd0528d98..00ddebe6b 100644
--- a/classes/File_to_post.php
+++ b/classes/File_to_post.php
@@ -40,4 +40,21 @@ class File_to_post extends Memcached_DataObject
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
+
+ function processNew($file_id, $notice_id) {
+ static $seen = array();
+ if (empty($seen[$notice_id]) || !in_array($file_id, $seen[$notice_id])) {
+ $f2p = new File_to_post;
+ $f2p->file_id = $file_id;
+ $f2p->post_id = $notice_id;
+ $f2p->insert();
+ if (empty($seen[$notice_id])) {
+ $seen[$notice_id] = array($file_id);
+ } else {
+ $seen[$notice_id][] = $file_id;
+ }
+ }
+
+ }
}
+