Commit f3b28d37 authored by Dries's avatar Dries

- Patch #27947 by Robert Douglas: simplified code, removed SQL query.

parent 9dec4430
......@@ -53,8 +53,7 @@ function profile_block($op = 'list', $delta = 0, $edit = array()) {
else if ($op == 'view') {
if (user_access('access user profiles')) {
if ((arg(0) == 'node') && is_numeric(arg(1)) && (arg(2) == NULL)) {
$result = db_query('SELECT uid FROM {node} WHERE nid = %d ORDER BY uid DESC', arg(1));
$node = db_fetch_object($result);
$node = node_load(arg(1));
$account = user_load(array('uid' => $node->uid));
if ($use_fields = variable_get('profile_block_author_fields', array())) {
......
......@@ -53,8 +53,7 @@ function profile_block($op = 'list', $delta = 0, $edit = array()) {
else if ($op == 'view') {
if (user_access('access user profiles')) {
if ((arg(0) == 'node') && is_numeric(arg(1)) && (arg(2) == NULL)) {
$result = db_query('SELECT uid FROM {node} WHERE nid = %d ORDER BY uid DESC', arg(1));
$node = db_fetch_object($result);
$node = node_load(arg(1));
$account = user_load(array('uid' => $node->uid));
if ($use_fields = variable_get('profile_block_author_fields', array())) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment