- Patch #27947 by Robert Douglas: simplified code, removed SQL query.
parent
9dec4430b2
commit
f3b28d37d1
|
@ -53,8 +53,7 @@ function profile_block($op = 'list', $delta = 0, $edit = array()) {
|
||||||
else if ($op == 'view') {
|
else if ($op == 'view') {
|
||||||
if (user_access('access user profiles')) {
|
if (user_access('access user profiles')) {
|
||||||
if ((arg(0) == 'node') && is_numeric(arg(1)) && (arg(2) == NULL)) {
|
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 = node_load(arg(1));
|
||||||
$node = db_fetch_object($result);
|
|
||||||
$account = user_load(array('uid' => $node->uid));
|
$account = user_load(array('uid' => $node->uid));
|
||||||
|
|
||||||
if ($use_fields = variable_get('profile_block_author_fields', array())) {
|
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') {
|
else if ($op == 'view') {
|
||||||
if (user_access('access user profiles')) {
|
if (user_access('access user profiles')) {
|
||||||
if ((arg(0) == 'node') && is_numeric(arg(1)) && (arg(2) == NULL)) {
|
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 = node_load(arg(1));
|
||||||
$node = db_fetch_object($result);
|
|
||||||
$account = user_load(array('uid' => $node->uid));
|
$account = user_load(array('uid' => $node->uid));
|
||||||
|
|
||||||
if ($use_fields = variable_get('profile_block_author_fields', array())) {
|
if ($use_fields = variable_get('profile_block_author_fields', array())) {
|
||||||
|
|
Loading…
Reference in New Issue