summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorZach Copley <zach@controlyourself.ca>2009-06-14 00:23:48 +0000
committerZach Copley <zach@controlyourself.ca>2009-06-14 00:23:48 +0000
commitd0eb2058a519941e205f7b0960d9a5e0707207bb (patch)
tree37ed1aa1be3c3a7a58463964ce602565c79f8cdf /classes
parenta887d4fe8b1f5e5adc2d701384acf50cf2cf54c3 (diff)
parentdbbb3a4fb558ee4372e157612f3e053a87a53a8e (diff)
Merge branch '0.8.x' into userdesign
Conflicts: actions/showfavorites.php lib/action.php
Diffstat (limited to 'classes')
-rw-r--r--classes/Notice.php19
-rw-r--r--classes/Notice_inbox.php5
2 files changed, 18 insertions, 6 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index 895b5d2c7..1c4858149 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -120,7 +120,8 @@ class Notice extends Memcached_DataObject
}
}
- static function saveNew($profile_id, $content, $source=null, $is_local=1, $reply_to=null, $uri=null) {
+ static function saveNew($profile_id, $content, $source=null,
+ $is_local=1, $reply_to=null, $uri=null, $created=null) {
$profile = Profile::staticGet($profile_id);
@@ -166,7 +167,11 @@ class Notice extends Memcached_DataObject
$notice->query('BEGIN');
$notice->reply_to = $reply_to;
- $notice->created = common_sql_now();
+ if (!empty($created)) {
+ $notice->created = $created;
+ } else {
+ $notice->created = common_sql_now();
+ }
$notice->content = $final;
$notice->rendered = common_render_content($final, $notice);
$notice->source = $source;
@@ -271,13 +276,15 @@ class Notice extends Memcached_DataObject
function getUploadedAttachment() {
$post = clone $this;
- $query = 'select file.url as uploaded from file join file_to_post on file.id = file_id where post_id=' . $post->escape($post->id) . ' and url like "%/notice/%/file"';
+ $query = 'select file.url as up, file.id as i from file join file_to_post on file.id = file_id where post_id=' . $post->escape($post->id) . ' and url like "%/notice/%/file"';
$post->query($query);
$post->fetch();
- $ret = $post->uploaded;
-// var_dump($post);
+ if (empty($post->up) || empty($post->i)) {
+ $ret = false;
+ } else {
+ $ret = array($post->up, $post->i);
+ }
$post->free();
-// die();
return $ret;
}
diff --git a/classes/Notice_inbox.php b/classes/Notice_inbox.php
index 8a27e1747..673e187c7 100644
--- a/classes/Notice_inbox.php
+++ b/classes/Notice_inbox.php
@@ -85,4 +85,9 @@ class Notice_inbox extends Memcached_DataObject
return $ids;
}
+
+ function &pkeyGet($kv)
+ {
+ return Memcached_DataObject::pkeyGet('Notice_inbox', $kv);
+ }
}