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

4.7.x
Dries Buytaert 2005-08-10 20:52:00 +00:00
parent 9dec4430b2
commit f3b28d37d1
2 changed files with 2 additions and 4 deletions

View File

@ -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())) {

View File

@ -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())) {