Сделал вывод Главную последних загруженных "Документов".
Но не определяется Автор и нет перехода по заголовку Документа.
Пишет, что: "Документ, который вы ищете, был удален или не существует".
По категориям в этом же блоке - переход нормально происходит.
Ссылку такую формирует:
mysite.ru/document.php?user=&document_id=38&title=---1-2011
вместо:
mysite.ru/document.php?user=ЮЗВЕРЬ&document_id=38&title=---1-2011
Чё я не додоелал? Гляньте, парни?
Спасибо.
home.php
PHP:
// DISPLAY ERROR PAGE IF USER IS NOT LOGGED IN AND ADMIN SETTING REQUIRES REGISTRATION
if( !$user->user_exists && !$params['permission_document'] )
{
$page = "error";
$smarty->assign('error_header', 639);
$smarty->assign('error_message', 656);
$smarty->assign('error_submit', 641);
include "footer.php";
}
// PARSE GET/POST - LAST DOCUMENTS
if(isset($_POST['p'])) { $p = $_POST['p']; } elseif(isset($_GET['p'])) { $p = $_GET['p']; } else { $p = 1; }
if(isset($_POST['s'])) { $s = $_POST['s']; } elseif(isset($_GET['s'])) { $s = $_GET['s']; } else { $s = "created DESC"; }
if(isset($_POST['v'])) { $v = $_POST['v']; } elseif(isset($_GET['v'])) { $v = $_GET['v']; } else { $v = 0; }
// ENSURE SORT/VIEW ARE VALID
if($s != "document_datecreated DESC" && $s != "document_views DESC" && $s != "document_dateupdated DESC") { $s = "document_datecreated DESC"; }
if($v != "0" && $v != "1") { $v = 0; }
// CREATE SCRIBD OBJECT
$document= new Document(null, null);
$entries_per_page = 4;
// GET TOTAL DOCUMNETS
$total_entries = $document->documents_total($where_browse_listing);
$page_vars = make_page($total_entries, $entries_per_page, $p);
// GET DOCMENTS ARRAY
$documents = $document->documents_list($page_vars[0], $entries_per_page, $s, $where_browse_listing);
// ASSIGN SMARTY VARIABLES AND SHOW VIEW DOCUMENTS PAGE
$smarty->assign('documents', $documents);
$smarty->assign('total_entries', $total_entries);
$smarty->assign('p', $page_vars[1]);
$smarty->assign('maxpage', $page_vars[2]);
$smarty->assign('p_start', $page_vars[0]+1);
$smarty->assign('p_end', $page_vars[0]+count($documents));
$smarty->assign('s', $s);
$smarty->assign('v', $v);
home.tpl
HTML:
<div class='header' style='border:1px solid #cebe8a;margin-top:10px;'>НОВЫЕ ДОКУМЕНТЫ</div>
{assign var=total_docs value=$documents|@count}
{section name=document_loop loop=$documents}
<div>
<table cellpadding='5' cellspacing='0'>
<tr valign="top">
<td width="130">
<div><a href='{$url->url_create("document", $documents[document_loop]->document_owner->user_info.user_username, $documents[document_loop]->document_info.document_id, $documents[document_loop]->document_info.document_slug)}' title='{$documents[document_loop]->document_info.document_title}'><img src="{$documents[document_loop]->document_info.document_thumbnail}" class='photo' width="90" height="100" alt="{$documents[document_loop]->document_info.document_title}" /></a></div></td>
<td width="80%">
<div>
<div class="header" style='font-size:120%;font-weight:600;padding:0 0 5px;'><a href='{$url->url_create("document", $documents[document_loop]->document_owner->user_info.user_username, $documents[document_loop]->document_info.document_id, $documents[document_loop]->document_info.document_slug)}' title="{$documents[document_loop]->document_info.document_title}"> {$documents[document_loop]->document_info.document_title|truncate:70:"...":true}</a></div>
<div class="clr" style='font-size:.916em'>{$documents[document_loop]->document_info.document_description|escape:html|truncate:180:"..":true}</div>
</div>
<div style="clear:both;"></div>
<div class="article_meta">
<span>
Просмотров: {$documents[document_loop]->document_info.document_views}
Комментариев: {$documents[document_loop]->document_info.total_comments}{assign var='document_datecreated' value=$datetime->time_since($documents[document_loop]->document_info.document_datecreated)}{capture assign="created"}{lang_sprintf id=$document_datecreated[0] 1=$document_datecreated[1]}{/capture} Создан:{$created}<br />
Категория: {if $documents[document_loop]->document_info.main_cat}<a href='{$url->url_create("browsedoccat", $documents[document_loop]->document_info.main_cat.category_id)}' title="{if $document->document_info.category_name != ''}{$document->document_info.category_name} {else}Default{/if}">{$documents[document_loop]->document_info.main_cat.category_name}</a> »
<a href='{$url->url_create("browsedoccat", $documents[document_loop]->document_info.category_id)}' title="ebook">
{if $documents[document_loop]->document_info.category_name != ''}{$documents[document_loop]->document_info.category_name} {else}Без категории{/if}</a>
{else}
<a href='{if $documents[document_loop]->document_info.category_id != ""}{$url->url_create("browsedoccat", $documents[document_loop]->document_info.category_id)}{else}{$url->url_create("browsedoccat", 0)}{/if}'>{if $documents[document_loop]->document_info.category_name != ''}{$documents[document_loop]->document_info.category_name} {else}Без категории{/if}</a>
{/if}
Автор: <a href='{$url->url_create("profile", $documents[document_loop]->document_owner->user_info.user_username)}' title='{$documents[document_loop]->document_owner->user_displayname}'>{$documents[document_loop]->document_owner->user_displayname}</a>
</span>
</div>
</td>
</tr></table>
</div>
{/section}
<div style='clear:both;height:10px;'></div>