Update 3.0/modules/author/helpers/author_block.php
Rwatcher updated to work with recent versions.
This commit is contained in:
parent
c2501e5180
commit
0e16587bc4
|
@ -23,29 +23,35 @@ class author_block_Core {
|
||||||
}
|
}
|
||||||
|
|
||||||
static function get($block_id, $theme) {
|
static function get($block_id, $theme) {
|
||||||
|
$block = "";
|
||||||
|
|
||||||
$item = $theme->item;
|
$item = $theme->item;
|
||||||
if (!$item) {
|
|
||||||
|
if ((!isset($theme->item)) || ($item->is_album())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($block_id != 'author' || $item->is_album() ) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
$record = db::build()
|
|
||||||
->select("author")
|
|
||||||
->from("author_records")
|
|
||||||
->where("item_id", "=", $item->id)
|
|
||||||
->execute()
|
|
||||||
->current();
|
|
||||||
|
|
||||||
|
switch ($block_id) {
|
||||||
|
case "author":
|
||||||
|
$record = ORM::factory("author_record")->where("item_id", "=", $item->id)->find();
|
||||||
|
|
||||||
|
$byline = "";
|
||||||
|
if ($record->loaded()) {
|
||||||
$byline = $record->author;
|
$byline = $record->author;
|
||||||
|
}
|
||||||
|
|
||||||
if ($byline == '') {
|
if ($byline == '') {
|
||||||
$byline = author::fix($item);
|
$byline = author::fix($item);
|
||||||
}
|
}
|
||||||
|
|
||||||
$block = new Block();
|
$block = new Block();
|
||||||
|
$block->css_id = "g-author";
|
||||||
$block->content = new View("author_block.html");
|
$block->content = new View("author_block.html");
|
||||||
$block->content->author = $byline;
|
$block->content->author = $byline;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
return $block;
|
return $block;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue
Block a user