Commit 71da02bd authored by Joakim Schramm's avatar Joakim Schramm

Simplify the db call for the bloginfo content, there can only be one...

parent c5de70e1
......@@ -143,12 +143,11 @@ function theme_bloginfo_block($description, $format, $author) {
*/
function bloginfo_form_bloginfo($edit, $account, $category) {
if ($category == 'account' && is_numeric(arg(1)) && (user_access('edit own bloginfo') || user_access('administer bloginfo'))) {
$result = db_query("SELECT title, description, format FROM {bloginfo} WHERE uid = :uid", array(':uid' => arg(1),));
foreach ($result as $bloginfo) {
$mybloginfo['title'] = $bloginfo->title;
$mybloginfo['description'] = $bloginfo->description;
$mybloginfo['format'] = $bloginfo->format;
}
$bloginfo = db_query("SELECT title, description, format FROM {bloginfo} WHERE uid = :uid", array(':uid' => arg(1),))->fetch();
$mybloginfo['title'] = !empty($bloginfo->title) ? $bloginfo->title : '';
$mybloginfo['description'] = !empty($bloginfo->description) ? $bloginfo->description : '';
$mybloginfo['format'] = !empty($bloginfo->format) ? $bloginfo->format : '';
$fields['bloginfo_settings'] = array(
'#type' => 'fieldset',
'#title' => t('Blog Information'),
......
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