diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-08-31 14:27:08 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-08-31 14:27:08 +0000 |
commit | b7116447a33401c33bb8526ef007a46686bb71f4 (patch) | |
tree | b6d0f4f47ba7a56a99e8bc8ca1af970e49e0c603 /modules/blogapi/blogapi.module | |
parent | 2405ec9ad75236d6ae0c44ec02a79df20fa24f01 (diff) | |
download | brdo-b7116447a33401c33bb8526ef007a46686bb71f4.tar.gz brdo-b7116447a33401c33bb8526ef007a46686bb71f4.tar.bz2 |
- Patch #302163 by recidive, Crell: convert blog API to DB TNG
Diffstat (limited to 'modules/blogapi/blogapi.module')
-rw-r--r-- | modules/blogapi/blogapi.module | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/modules/blogapi/blogapi.module b/modules/blogapi/blogapi.module index 0569b499a..6272a0be7 100644 --- a/modules/blogapi/blogapi.module +++ b/modules/blogapi/blogapi.module @@ -338,13 +338,19 @@ function blogapi_blogger_get_recent_posts($appkey, $blogid, $username, $password } if ($bodies) { - $result = db_query_range("SELECT n.nid, n.title, r.body, r.format, n.comment, n.created, u.name FROM {node} n, {node_revisions} r, {users} u WHERE n.uid = u.uid AND n.vid = r.vid AND n.type = '%s' AND n.uid = %d ORDER BY n.created DESC", $blogid, $user->uid, 0, $number_of_posts); + $result = db_query_range("SELECT n.nid, n.title, r.body, r.format, n.comment, n.created, u.name FROM {node} n, {node_revisions} r, {users} u WHERE n.uid = u.uid AND n.vid = r.vid AND n.type = :type AND n.uid = :uid ORDER BY n.created DESC", array( + ':type' => $blogid, + ':uid' => $user->uid + ), 0, $number_of_posts); } else { - $result = db_query_range("SELECT n.nid, n.title, n.created, u.name FROM {node} n, {users} u WHERE n.uid = u.uid AND n.type = '%s' AND n.uid = %d ORDER BY n.created DESC", $blogid, $user->uid, 0, $number_of_posts); + $result = db_query_range("SELECT n.nid, n.title, n.created, u.name FROM {node} n, {users} u WHERE n.uid = u.uid AND n.type = :type AND n.uid = :uid ORDER BY n.created DESC", array( + ':type' => $blogid, + ':uid' => $user->uid + ), 0, $number_of_posts); } $blogs = array(); - while ($blog = db_fetch_object($result)) { + foreach ($result as $blog) { $blogs[] = _blogapi_get_post($blog, $bodies); } |