fixed endless loop in entry overview; fixed PHP warning
This commit is contained in:
parent
227b4d30d8
commit
80abe0a55d
@ -7,14 +7,11 @@
|
||||
<div id="admin-drafts">
|
||||
<p>Your drafts:</p>
|
||||
<ul>
|
||||
|
||||
{draft}
|
||||
{foreach from=$draft_list key=draftid item=draft}
|
||||
<li>
|
||||
<a href="admin.php?p=entry&entry={$id}&action=write">{$subject|truncate:70}</a>
|
||||
|
||||
<a href="admin.php?p=entry&entry={$draftid}&action=write">{$draft|truncate:50}</a>
|
||||
</li>
|
||||
{/draft}
|
||||
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
@ -168,36 +168,6 @@ function smarty_block_draftlist($params, $content, &$smarty, &$repeat) {
|
||||
}
|
||||
}
|
||||
|
||||
function smarty_block_draft($params, $content, &$smarty, &$repeat) {
|
||||
$smarty->assign(array(
|
||||
'subject' => '',
|
||||
'content' => '',
|
||||
'date' => '',
|
||||
'author' => '',
|
||||
'version' => '',
|
||||
'id' => ''
|
||||
));
|
||||
$arr = $smarty->getTemplateVars('draft_list');
|
||||
|
||||
$id = $subject = null;
|
||||
if ($arr) {
|
||||
$firstElement = utils_array_kshift($arr);
|
||||
$id = array_keys($firstElement);
|
||||
$id = $id [0];
|
||||
$subject = $firstElement [$id];
|
||||
}
|
||||
|
||||
if ($id) {
|
||||
$smarty->assign('subject', $subject);
|
||||
$smarty->assign('id', $id);
|
||||
}
|
||||
|
||||
$repeat = (bool) $id;
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
$smarty->registerPlugin('block', 'draft_block', 'smarty_block_draftlist');
|
||||
$smarty->registerPlugin('block', 'draft', 'smarty_block_draft');
|
||||
|
||||
?>
|
||||
|
@ -543,7 +543,7 @@ class FPDB_Query {
|
||||
|
||||
if ($this->params->page) {
|
||||
// if ($this->_getOffsetId(0, ($this->params->start + $this->params->count)))
|
||||
if ($this->walker->valid)
|
||||
if ($this->walker && $this->walker->valid)
|
||||
return array(
|
||||
$GLOBALS ['lang'] ['main'] ['nextpage'],
|
||||
$this->params->page + 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user