Ejemplo n.º 1
0
 public function getLeaderRecursion($page, $pagesize, $ldid, $ldidsort)
 {
     $cond['ldid'] = $ldid;
     $cond['ldidsort'] = $ldidsort;
     $data = $this->where($cond)->limit($page, $pagesize)->order('articleid DESC')->select();
     $data = string_gb2312_to_utf8($data);
     foreach ($data as $k => $v) {
         $data[$k]['addtime'] = date('Y-m-d', strtotime($v['addtime']));
         $data[$k]['addtime1'] = date('m.d', strtotime($v['addtime']));
         $data[$k]['subcontent'] = utf8_strcut(strip_tags($data[$k]['content']), 0, 500);
     }
     return $data;
 }
Ejemplo n.º 2
0
<?php

include_once './_common.php';
if (!$is_member) {
    die('');
}
$sql = " select as_id, as_uid, as_subject, as_datetime from {$g5['autosave_table']} where mb_id = '{$member['mb_id']}' order by as_id desc ";
$result = sql_query($sql);
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
echo "<list>\n";
for ($i = 0; $row = sql_fetch_array($result); $i++) {
    $subject = htmlspecialchars(utf8_strcut($row['as_subject'], 25), ENT_QUOTES);
    $datetime = substr($row['as_datetime'], 2, 14);
    echo "<item>\n";
    echo "<id>{$row['as_id']}</id>\n";
    echo "<uid>{$row['as_uid']}</uid>\n";
    echo "<subject><![CDATA[{$subject}]]></subject>\n";
    echo "<datetime>{$datetime}</datetime>\n";
    echo "</item>\n";
}
echo "</list>";
Ejemplo n.º 3
0
<?php

include_once './_common.php';
$g5['title'] = "상품 검색 결과";
include_once G5_MSHOP_PATH . '/_head.php';
// QUERY 문에 공통적으로 들어가는 내용
// 상품명에 검색어가 포한된것과 상품판매가능인것만
$sql_common = " from {$g5['g5_shop_item_table']} a, {$g5['g5_shop_category_table']} b ";
$where = array();
$where[] = " (a.ca_id = b.ca_id and a.it_use = 1 and b.ca_use = 1) ";
$search_all = false;
// 상세검색 이라면
if (isset($_GET['qname']) || isset($_GET['qexplan']) || isset($_GET['qid'])) {
    $search_all = false;
}
$q = utf8_strcut(get_search_string(trim($_GET['q'])), 30, "");
$qname = isset($_GET['qname']) ? trim($_GET['qname']) : '';
$qexplan = isset($_GET['qexplan']) ? trim($_GET['qexplan']) : '';
$qid = isset($_GET['qid']) ? trim($_GET['qid']) : '';
$qcaid = isset($_GET['qcaid']) ? trim($_GET['qcaid']) : '';
$qfrom = isset($_GET['qfrom']) ? preg_replace('/[^0-9]/', '', trim($_GET['qfrom'])) : '';
$qto = isset($_GET['qto']) ? preg_replace('/[^0-9]/', '', trim($_GET['qto'])) : '';
if (isset($_GET['qsort'])) {
    $qsort = trim($_GET['qsort']);
    $qsort = preg_replace("/[\\<\\>\\'\"\\\\'\\\"\\%\\=\\(\\)\\s]/", "", $qsort);
} else {
    $qsort = '';
}
if (isset($_GET['qorder'])) {
    $qorder = preg_match("/^(asc|desc)\$/i", $qorder) ? $qorder : '';
} else {
Ejemplo n.º 4
0
            $link = G5_BBS_URL . '/board.php?bo_table=' . $bo_table . '&wr_id=' . $wr['wr_parent'] . '&#c_' . $comment_id;
            $attachment = array('message' => stripslashes($wr_content), 'name' => $wr_subject, 'link' => $link, 'description' => stripslashes(strip_tags($wr['wr_content'])));
            // 등록
            $facebook->api('/me/feed/', 'post', $attachment);
            //$errors = error_get_last(); print_r2($errros); exit;
            set_cookie('ck_facebook_checked', true, 86400 * 31);
        } catch (FacebookApiException $e) {
        }
    }
    $wr_facebook_user = get_session("ss_facebook_user");
}
//============================================================================
//============================================================================
// 트위터
//----------------------------------------------------------------------------
$wr_twitter_user = "";
if ($_POST['twitter_checked']) {
    include_once G5_SNS_PATH . "/twitter/twitteroauth/twitteroauth.php";
    include_once G5_SNS_PATH . "/twitter/twitterconfig.php";
    if (!(empty($_SESSION['access_token']) || empty($_SESSION['access_token']['oauth_token']) || empty($_SESSION['access_token']['oauth_token_secret']))) {
        $post = googl_short_url($comment_url) . ' ' . $wr_content;
        $post = utf8_strcut($post, 140);
        $access_token = $_SESSION['access_token'];
        $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token['oauth_token'], $access_token['oauth_token_secret']);
        // 등록
        $connection->post('statuses/update', array('status' => $post));
        set_cookie('ck_twitter_checked', true, 86400 * 31);
    }
    $wr_twitter_user = get_session("ss_twitter_user");
}
//============================================================================
Ejemplo n.º 5
0
 /**
  * 处室下的内容
  * @param int $page
  * @param int $pagesize
  * @param int $scksid
  * @param int $iscopy
  * @return string
  */
 public function getScksContent($page, $pagesize, $scksid, $iscopy = null)
 {
     $cond['scks'] = $scksid;
     if ($iscopy) {
         $cond['sortid'] = $iscopy;
     }
     //         $cond['iscopy'] = $iscopy;
     $count = $this->where($cond)->count();
     $data = $this->field('articleid,title,addtime,picture,sortid,content')->where($cond)->order('articleid DESC')->limit($page, $pagesize)->select();
     $data = string_gb2312_to_utf8($data);
     foreach ($data as $k => $v) {
         $data[$k]['addtime'] = date('Y-m-d', strtotime($v['addtime']));
         $data[$k]['addtime1'] = date('m.d', strtotime($v['addtime']));
         $data[$k]['subcontent'] = utf8_strcut(strip_tags($data[$k]['content']), 0, 50) . '...';
         $data[$k]['title1'] = mb_substr($v['title'], 0, 16, 'utf-8') . '...';
         $data[$k]['title'] = mb_substr($v['title'], 0, 18, 'utf-8') . '...';
     }
     $info['data'] = $data;
     $info['count'] = $count;
     return $info;
 }