** Display the last blogs for this user:
*/
- $result = db_query("SELECT n.nid, n.timestamp FROM node n LEFT JOIN users u ON u.id = n.author WHERE u.userid = '". check_input($userid) ."' AND n.timestamp > ". (time() - 2592000) ." LIMIT 15");
+ $result = db_query("SELECT n.nid, n.timestamp FROM node n LEFT JOIN users u ON u.id = n.author WHERE u.userid = '". check_input($userid) ."' AND n.timestamp > ". (time() - 2592000) ." ORDER BY n.timestamp DESC LIMIT 15");
while ($blog = db_fetch_object($result)) {
if ($date != date("ndy", $blog->timestamp)) {
$date = date("ndy", $blog->timestamp);
}
function blog_form($edit = array()) {
- global $REQUEST_URI, $id, $type, $user, $theme;
+ global $REQUEST_URI, $id, $mod, $type, $user, $theme;
- if ($edit[type] == "blog") {
+ if ($mod == "node" || $edit[type] == "blog") {
}
else if ($type == "blog") {
$item = node_get_object(array(type => "blog", nid => $id));
** Display the last blogs for this user:
*/
- $result = db_query("SELECT n.nid, n.timestamp FROM node n LEFT JOIN users u ON u.id = n.author WHERE u.userid = '". check_input($userid) ."' AND n.timestamp > ". (time() - 2592000) ." LIMIT 15");
+ $result = db_query("SELECT n.nid, n.timestamp FROM node n LEFT JOIN users u ON u.id = n.author WHERE u.userid = '". check_input($userid) ."' AND n.timestamp > ". (time() - 2592000) ." ORDER BY n.timestamp DESC LIMIT 15");
while ($blog = db_fetch_object($result)) {
if ($date != date("ndy", $blog->timestamp)) {
$date = date("ndy", $blog->timestamp);
}
function blog_form($edit = array()) {
- global $REQUEST_URI, $id, $type, $user, $theme;
+ global $REQUEST_URI, $id, $mod, $type, $user, $theme;
- if ($edit[type] == "blog") {
+ if ($mod == "node" || $edit[type] == "blog") {
}
else if ($type == "blog") {
$item = node_get_object(array(type => "blog", nid => $id));