Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 /**
  * 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;
     }
 }
Exemplo n.º 4
0
 /**
  * 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;
     }
 }
Exemplo n.º 5
0
<?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);