Esempio n. 1
0
 function linkurl($itemid)
 {
     global $MOD;
     $linkurl = show_url($itemid);
     return $MOD['form_url'] . $linkurl;
 }
Esempio n. 2
0
File: index.php Progetto: cfhb/MIS
 function comment()
 {
     $WAP = $this->wap;
     $TYPE = $this->types;
     if ($_POST['dosumbit']) {
         $comment = pc_base::load_app_class('comment', 'comment');
         pc_base::load_app_func('global', 'comment');
         $username = $this->wap['sitename'] . L('phpcms_friends');
         $userid = param::get_cookie('_userid');
         $catid = intval($_POST['catid']);
         $typeid = intval($_POST['typeid']);
         $contentid = intval($_POST['id']);
         $msg = trim($_POST['msg']);
         $commentid = trim($_POST['commentid']);
         $title = $_POST['title'];
         $url = $_POST['url'];
         //通过API接口调用数据的标题、URL地址
         if (!($data = get_comment_api($commentid))) {
             exit(L('parameter_error'));
         } else {
             $title = $data['title'];
             $url = $data['url'];
             unset($data);
         }
         $data = array('userid' => $userid, 'username' => $username, 'content' => $msg);
         $comment->add($commentid, $this->siteid, $data, $id, $title, $url);
         echo '<script type="text/javaScript" src="' . JS_PATH . 'jquery.min.js"></script><script language="JavaScript" src="' . JS_PATH . 'admin_common.js"></script>';
         echo L('wap_guestbook') . '<br/><a href="' . show_url($catid, $contentid, $typeid) . '">' . L('wap_goback') . '</a><script language=javascript>setTimeout("redirect(\'' . HTTP_REFERER . '\');",3000);</script>';
     }
 }
Esempio n. 3
0
 function comment()
 {
     $WAP = $this->wap;
     $TYPE = $this->types;
     if ($_POST['dosumbit']) {
         $comment = pc_base::load_app_class('comment', 'comment');
         pc_base::load_app_func('global', 'comment');
         $username = $this->wap['sitename'] . L('phpcms_friends');
         $userid = param::get_cookie('_userid');
         $catid = intval($_POST['catid']);
         $typeid = intval($_POST['typeid']);
         $contentid = intval($_POST['id']);
         $msg = trim($_POST['msg']);
         $commentid = trim($_POST['commentid']);
         $title = $_POST['title'];
         $url = $_POST['url'];
         //通过API接口调用数据的标题、URL地址
         if (!($data = get_comment_api($commentid))) {
             exit(L('parameter_error'));
         } else {
             $title = $data['title'];
             $url = $data['url'];
             unset($data);
         }
         $data = array('userid' => $userid, 'username' => $username, 'content' => $msg);
         $comment->add($commentid, $this->siteid, $data, $id, $title, $url);
         echo L('wap_guestbook') . '<br/><a href="' . show_url($catid, $contentid, $typeid) . '">' . L('wap_goback') . '</a>';
     }
 }
Esempio n. 4
0
 /**
  * 推荐位标签
  * @param $data
  */
 public function position($data)
 {
     $sql = '';
     $array = array();
     $posid = intval($data['posid']);
     $order = $data['order'];
     $thumb = empty($data['thumb']) || intval($data['thumb']) == 0 ? 0 : 1;
     $siteid = $GLOBALS['siteid'] ? $GLOBALS['siteid'] : 1;
     $catid = empty($data['catid']) || $data['catid'] == 0 ? '' : intval($data['catid']);
     //if(!$this->category[$catid]) return false;
     if ($catid && $this->category[$catid]['child']) {
         $catids_str = $this->category[$catid]['arrchildid'];
         $pos = strpos($catids_str, ',') + 1;
         $catids_str = substr($catids_str, $pos);
         $sql = "`catid` IN ({$catids_str}) AND ";
     } elseif ($catid && !$this->category[$catid]['child']) {
         $sql = "`catid` = '{$catid}' AND ";
     }
     if ($thumb) {
         $sql .= "`thumb` = '1' AND ";
     }
     $sql .= "`posid` = '{$posid}' AND `siteid` = '" . $siteid . "'";
     $pos_arr = $this->position->select($sql, '*', $data['limit'], $order);
     if (!empty($pos_arr)) {
         foreach ($pos_arr as $info) {
             $key = $info['catid'] . '-' . $info['id'];
             $array[$key] = string2array($info['data']);
             $array[$key]['url'] = show_url($info['catid'], $info['id']);
         }
     }
     return $array;
 }