diff options
author | Robin Millette <millette@controlyourself.ca> | 2009-05-13 14:27:32 -0400 |
---|---|---|
committer | Robin Millette <millette@controlyourself.ca> | 2009-05-13 14:27:32 -0400 |
commit | 3b7ee5a5f9a2cd3066aff8a7a12d09878be3b06c (patch) | |
tree | d0f1521040251c6afe522f37f04aade4cd3fa89b /classes/File_to_post.php | |
parent | d010d811ba812ccc8fbb1a49fcba7a30226ea779 (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.php | 17 |
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; + } + } + + } } + |