if (($account->uid == $user->uid) && user_access('create blog entries')) {
$items[] = l(t('Post new blog entry.'), "node/add/blog");
}
else if ($account->uid == $user->uid) {
$items[] = t('You are not allowed to post a new blog entry.');
}
$output = theme('item_list', $items);
$result = pager_query(db_rewrite_sql("SELECT n.nid, n.sticky, n.created FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC"), variable_get('default_nodes_main', 10), 0, NULL, $account->uid);
* Menu callback; displays a Drupal page containing recent blog entries of all users.
*/
function blog_page_last() {
global $user;
$output = '';
$items = array();
if (user_access('edit own blog')) {
$items[] = l(t('Create new blog entry.'), "node/add/blog");
}
$output = theme('item_list', $items);
$result = pager_query(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC"), variable_get('default_nodes_main', 10));
* Menu callback; displays an RSS feed containing recent blog entries of a given user.
*/
function blog_feed_user($account) {
$result = db_query_range(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1 ORDER BY n.created DESC"), $account->uid, 0, variable_get('feed_default_items', 10));
* Menu callback; displays an RSS feed containing recent blog entries of all users.
*/
function blog_feed_last() {
$result = db_query_range(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC"), 0, variable_get('feed_default_items', 10));