1
0

Update 3.0/modules/author/helpers/author_block.php

Rwatcher updated to work with recent versions.
This commit is contained in:
floridave 2012-09-13 20:32:26 -06:00 committed by Bharat Mediratta
parent c2501e5180
commit 0e16587bc4

View File

@ -23,29 +23,35 @@ class author_block_Core {
}
static function get($block_id, $theme) {
$block = "";
$item = $theme->item;
if (!$item) {
return;
if ((!isset($theme->item)) || ($item->is_album())) {
return;
}
if ($block_id != 'author' || $item->is_album() ) {
return '';
switch ($block_id) {
case "author":
$record = ORM::factory("author_record")->where("item_id", "=", $item->id)->find();
$byline = "";
if ($record->loaded()) {
$byline = $record->author;
}
if ($byline == '') {
$byline = author::fix($item);
}
$block = new Block();
$block->css_id = "g-author";
$block->content = new View("author_block.html");
$block->content->author = $byline;
break;
}
$record = db::build()
->select("author")
->from("author_records")
->where("item_id", "=", $item->id)
->execute()
->current();
$byline = $record->author;
if ($byline == '') {
$byline = author::fix($item);
}
$block = new Block();
$block->content = new View("author_block.html");
$block->content->author = $byline;
return $block;
}
}