本文整理匯總了PHP中News::getById方法的典型用法代碼示例。如果您正苦於以下問題:PHP News::getById方法的具體用法?PHP News::getById怎麽用?PHP News::getById使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類News
的用法示例。
在下文中一共展示了News::getById方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: detailsAction
public function detailsAction()
{
$group = $this->getRequest()->getParam("group");
$GroupName = NewGroup::getById($group);
$id = $this->getRequest()->getParam("id");
$this->view->Details = News::getById($id);
$this->view->Deffirent = News::getByGroupId($group);
$this->view->Title = $GroupName->name;
$this->view->headTitle($this->view->Title);
}
示例2: sms
public function sms($params)
{
$module = $params['module'];
$url = "";
if ($params['params']) {
$url = $this->OAuth2Url($this->buildUrl($params), $this->_base_config['APP']['sms']['agentid']);
}
$postData = array();
switch ($params['module']) {
case "email":
$content = $url != "" ? $params['content'] . ("\n<a href='" . $url . "'>") . _("ÔĶÁÓʼþ") . "</a>" : $params['content'];
$postData = array("touser" => $this->cUser($params['user']), "toparty" => $this->cDept($params['dept']), "msgtype" => "text", "agentid" => $this->_base_config['APP']['sms']['agentid'], "text" => array("content" => $content), "safe" => "0");
break;
case "news":
$picurl = "";
include_once "oa.news.php";
//( );
$News = new News();
$row = $News->getById("SUBJECT,CONTENT,ATTACHMENT_ID,ATTACHMENT_NAME,TO_ID,USER_ID,SUMMARY", $params['params']);
$picurl = $News->getFirstImage("news", $row['ATTACHMENT_ID'], $row['ATTACHMENT_NAME']);
$description = $row['SUMMARY'] == "" ? csubstr(strip_tags($this->cContent($row['CONTENT'])), 0, 30, TRUE, 1) . "..." : strip_tags($this->cContent($row['SUMMARY']));
if ($picurl != "") {
$picurl = $this->buildAttachUrl("http://" . BASE_URL . $picurl, $this->_base_config['APP']['sms']['agentid']);
}
$postData = array("touser" => $this->cUser($row['USER_ID'], $row['TO_ID']), "toparty" => $row['TO_ID'] == "ALL_DEPT" ? "" : $this->cDept($row['TO_ID']), "msgtype" => "news", "agentid" => $this->_base_config['APP']['sms']['agentid'], "news" => array("articles" => array(array("title" => strip_tags($row['SUBJECT']), "description" => $description, "url" => $url, "picurl" => $picurl))));
//parent::logs("test",$url);
break;
case "notify":
$picurl = "";
include_once "oa.notify.php";
//( );
$Notify = new Notify();
$row = $Notify->getById("SUBJECT,CONTENT,ATTACHMENT_ID,ATTACHMENT_NAME,TO_ID,USER_ID,SUMMARY", $params['params']);
$picurl = $Notify->getFirstImage("notify", $row['ATTACHMENT_ID'], $row['ATTACHMENT_NAME']);
$description = $row['SUMMARY'] == "" ? csubstr(strip_tags($this->cContent($row['CONTENT'])), 0, 30, TRUE, 1) . "..." : strip_tags($this->cContent($row['SUMMARY']));
if ($picurl != "") {
$picurl = $this->buildAttachUrl("http://" . BASE_URL . $picurl, $this->_base_config['APP']['sms']['agentid']);
}
$postData = array("touser" => $this->cUser($row['USER_ID'], $row['TO_ID']), "toparty" => $row['TO_ID'] == "ALL_DEPT" ? "" : $this->cDept($row['TO_ID']), "msgtype" => "news", "agentid" => $this->_base_config['APP']['sms']['agentid'], "news" => array("articles" => array(array("title" => strip_tags($row['SUBJECT']), "description" => $description, "url" => $url, "picurl" => $picurl))));
//parent::logs("test",$url);
break;
default:
$postData = array("touser" => $this->cUser($params['user']), "toparty" => $this->cDept($params['dept']), "msgtype" => "text", "agentid" => $this->_base_config['APP']['sms']['agentid'], "text" => array("content" => $params['content']), "safe" => "0");
}
$rs = $this->postData($this->url['send'], $postData);
}
示例3: deleteAction
/**
* Delete a news
*/
public function deleteAction()
{
$Content = News::getById($this->getRequest()->getParam('id'));
if ($Content) {
if ($this->getRequest()->isPost()) {
$Content->delete();
$this->Member->log('News: ' . $Content->title . '(' . $this->getRequest()->getParam('id') . ')', 'Delete');
My_Plugin_Libs::setSplash('Delete: <b>' . $Content->title . '</b> have been completed.');
$this->_redirect($this->_helper->url('index', 'news', 'admin'));
}
$this->view->News = $Content;
}
}
示例4: deleteAction
/**
* Delete a Country
*/
public function deleteAction()
{
$Content = News::getById($this->getRequest()->getParam('id'));
if ($Content) {
if ($this->getRequest()->isPost()) {
$Content->delete();
$this->Member->log('Tin tức: ' . $Content->title . '(' . $this->getRequest()->getParam('id') . ')', 'Xóa');
My_Plugin_Libs::setSplash('Tin tức: <b>' . $Content->title . '</b> đã được xóa khỏi hệ thống.');
$this->_redirect($this->_helper->url('index', 'news', 'admin'));
}
$this->view->News = $Content;
}
}
示例5: defaultModule
<?php
//var_dump( get_browser());
$id = getREQUEST('_Id');
if (!$id) {
$url = getSiteLink('home');
//echo $url;
forceRedirect($url);
}
$objCat = new NewsType();
$obj = new News();
$objHitCounter = new HitCounter();
$ip = $_SERVER['REMOTE_ADDR'];
$list = $obj->getById($id);
if ($objHitCounter->CheckHitsByIpPost($ip, $id)) {
//echo 'voila';
$objHitCounter->insert(array('news02uin' => $id, 'ip_add' => $ip, 'agent' => $_SERVER['HTTP_USER_AGENT']));
//echo $id;
$totHits = $list['news02hits'];
$totHits++;
$obj->setFieldValues('hits', $totHits);
$obj->update_core($id);
}
//$page='News';
//echo ($list->rowCount());
//var_dump($list);
$Cat = $objCat->getById($list['news02news01uin']);
$data['title'] = $Cat['news01title'];
$data['catid'] = $Cat['news01uin'];
$data['data'] = $list;
echo defaultModule($strModuleName, $data);