本文整理汇总了PHP中NewsModel::getUserById方法的典型用法代码示例。如果您正苦于以下问题:PHP NewsModel::getUserById方法的具体用法?PHP NewsModel::getUserById怎么用?PHP NewsModel::getUserById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NewsModel
的用法示例。
在下文中一共展示了NewsModel::getUserById方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: BuildTree_moderate
public function BuildTree_moderate($aLeafs, $aNews, $parentId = 0)
{
$newsModel = new NewsModel();
if (!$checkId && is_array($aLeafs) && count($aLeafs) > 0) {
$checkId = $aLeafs[0];
}
$imgUrl = $this->image_url;
foreach ($aNews as $id => $news) {
if ($parentId != $news['parent_id']) {
continue;
}
$ChangeNewsTreeUrl = Project::getRequest()->createUrl('News', 'ChangeNewsTree');
if (in_array($news['id'], $aLeafs)) {
$isLeaf = true;
$htmlImg = '';
} else {
$isLeaf = false;
$htmlImg = '<img class="minus" height="11" width="11" alt="" src="' . $this->image_url . '1x1.gif" /> ';
}
if ($news['state']) {
$isStrikeClass = "not_strike";
$dodel = '';
} else {
$isStrikeClass = "strike";
$dodel = 'class="to-del"';
}
$user = $newsModel->getUserById($news['user_id']);
/* $this->_htmlTree .= '
<li >
'.$htmlImg.'
<label style="white-space: nowrap; "><span id="news_tree'.$news['id'].'" class="'.$isStrikeClass.'">'.$news['name'].'</span>
[<a href="'.Project::getRequest()->createUrl('User', 'Profile', null, $user['login']).'">'.$user['login'].'</a>]';
$this->_htmlTree .= '
<a onclick=\'
ajax('.AjaxRequest::getJsonParam("News", "ChangeState", array("id"=>$news['id'], "element"=>"news_tree", "attr"=>"strike", "text1"=>"strike", "text2"=>"not_strike" ), "POST").', true);
\' href="javascript: void(0);">Изменить статус</a> <a href="'.$ChangeNewsTreeUrl.'/tree_id:'.$news['id'].'/deleteNewsTree:1/">Удалить</a>';
$this->_htmlTree .= '
</label>
<ul class="nav-list">';
$this->BuildTree_moderate($aLeafs, $aNews, $news['id']);
$this->_htmlTree .= '
</ul>
</li>'; */
$this->_htmlTree .= '
<li ' . $dodel . '>
<dl class="clearfix">
<dt><a href="#" class="with-icon-s ' . $isStrikeClass . '" id="news_tree' . $news['id'] . '"><i class="icon-s close-s-icon"></i>' . $news['name'] . '</a></dt>
<dd class="act">
<a onclick=\'
ajax(' . AjaxRequest::getJsonParam("News", "ChangeState", array("id" => $news['id'], "element" => "news_tree", "attr" => "strike", "text1" => "strike", "text2" => "not_strike"), "POST") . ', true);
\' href="javascript: void(0);" class="script-link"><span class="t">изменить статус</span></a>
<a href="' . $ChangeNewsTreeUrl . '/tree_id:' . $news['id'] . '/deleteNewsTree:1/" class="delete-link">удалить</a>
</dd>
<dd class="who">добавил <a href="' . Project::getRequest()->createUrl('User', 'Profile', null, $user['login']) . '">' . $user['login'] . '</a></dd>
</dl>
<ul>';
$this->BuildTree_moderate($aLeafs, $aNews, $news['id']);
$this->_htmlTree .= '
</ul>
</li>';
}
}