public static function text2html($string, $cutlen = false)
 {
     if (intval($cutlen) > 0) {
         $string = str_cut($string, $cutlen);
     }
     return nl2br(str_replace(' ', ' ', self::new_htmlspecialchars($string)));
 }
Exemple #2
0
function addart($catid, $title, $content)
{
    $info = array();
    $info['catid'] = 3;
    $info['title'] = "api push";
    $info['content'] = "absolutelu api push";
    $db_config = pc_base::load_config('database');
    pc_base::load_sys_class('mysql', '', 0);
    pc_base::load_sys_class('param', '', 0);
    $db = pc_base::load_model('content_model');
    $categorys = getcache('category_content_1', 'commons');
    $category = $categorys[3];
    //var_dump($categorys);
    $modelid = $category['modelid'];
    //var_dump($modelid);
    //die;
    $db->set_model($modelid);
    $setting = string2array($category['setting']);
    $workflowid = $setting['workflowid'];
    $info['status'] = 99;
    $info['keywords'] = "";
    $info['description'] = str_cut(str_replace(array("\r\n", "\t", '[page]', '[/page]', '“', '”', ' '), '', strip_tags($info['content'])), 200);
    $info['username'] = "******";
    $info['inputtime'] = '';
    echo "1";
    if ($db->add_content($info)) {
        return true;
    }
    return false;
}
Exemple #3
0
function post_query($col)
{
    include 'conn.php';
    //  Get the number of row of a table
    $sql = "SELECT count(id) FROM blog";
    $query = mysqli_query($conn, $sql);
    $row = mysqli_fetch_row($query);
    //  Catch the session variable from another page
    $n = $_SESSION['var'];
    for ($i = 1; $i <= $row[0]; $i++) {
        $sql = "SELECT * FROM blog where id = {$n} order by time asc";
        //  For query
        $query = mysqli_query($conn, $sql);
        $row = mysqli_fetch_assoc($query);
        if ($col == 'post_detail') {
            str_cut($row['post_detail']);
            break;
        } elseif ($col == 'author') {
            echo $row['author'];
            break;
        } elseif ($col == 'time') {
            echo $row['time'];
            break;
        } elseif ($col == 'post_heading') {
            echo $row['post_heading'];
            break;
        } elseif ($col == 'image') {
            echo $row['image'];
            break;
        } elseif ($col == 'id') {
            echo $row['id'];
            break;
        }
    }
}
Exemple #4
0
function addart($catid, $title, $content)
{
    $info = array();
    $info['catid'] = $catid;
    $info['title'] = $title;
    $info['content'] = $content;
    $db_config = pc_base::load_config('database');
    pc_base::load_sys_class('mysql', '', 0);
    pc_base::load_sys_class('param', '', 0);
    $db = pc_base::load_model('content_model');
    $category = $categorys[3];
    $modelid = $category['modelid'];
    $db->set_model($modelid);
    $setting = string2array($category['setting']);
    $workflowid = $setting['workflowid'];
    $info['status'] = 99;
    $info['keywords'] = get_keywords($info['title'], 3);
    $info['description'] = str_cut(str_replace(array("\r\n", "\t", '[page]', '[/page]', '&ldquo;', '&rdquo;', '&nbsp;'), '', strip_tags($info['content'])), 200);
    $info['username'] = "******";
    $info['inputtime'] = '';
    if ($db->add_content($info)) {
        return true;
    }
    return false;
}
Exemple #5
0
 public function search()
 {
     $title = safe_replace($_GET['title']);
     if (CHARSET == 'gbk') {
         $title = iconv('utf-8', 'gbk', $title);
     }
     $where = '`status`=21';
     if ($title) {
         $where .= ' AND `title` LIKE \'%' . $title . '%\'';
     }
     $userupload = intval($_GET['userupload']);
     if ($userupload) {
         $where .= ' AND `userupload`=1';
     }
     $page = $_GET['page'];
     $pagesize = 6;
     $infos = $this->db->listinfo($where, 'videoid DESC', $page, $pagesize);
     $number = $this->db->number;
     $pages = $this->pages($number, $page, $pagesize, 4, 'get_videoes');
     if (is_array($infos) && !empty($infos)) {
         $html = '';
         foreach ($infos as $info) {
             $html .= '<li><div class="w9"><a href="javascript:void(0);" onclick="a_click(this);" title="' . $info['title'] . '" data-vid="' . $info['vid'] . '" ><span></span><img src="' . $info['picpath'] . '" width="90" height="51" /></a><p>' . str_cut($info['title'], 18) . '</p></div></li>';
         }
     }
     $data['pages'] = $pages;
     $data['html'] = $html;
     if (CHARSET == 'gbk') {
         $data = array_iconv($data, 'gbk', 'utf-8');
     }
     exit(json_encode($data));
 }
 function get($data, $isimport = 0)
 {
     $this->data = $data = trim_script($data);
     $info = array();
     foreach ($data as $field => $value) {
         if (!isset($this->fields[$field]) && !check_in($field, 'paytype,paginationtype,maxcharperpage,id')) {
             continue;
         }
         $name = $this->fields[$field]['name'];
         $minlength = $this->fields[$field]['minlength'];
         $maxlength = $this->fields[$field]['maxlength'];
         $pattern = $this->fields[$field]['pattern'];
         $errortips = $this->fields[$field]['errortips'];
         if (empty($errortips)) {
             $errortips = $name . ' 不符合要求';
         }
         $length = empty($value) ? 0 : (is_string($value) ? strlen($value) : count($value));
         if ($minlength && $length < $minlength) {
             if ($isimport) {
                 return false;
             } else {
                 showmessage($name . ' 不得少于 ' . $minlength . ' 字符');
             }
         }
         if ($maxlength && $length > $maxlength) {
             if ($isimport) {
                 $value = str_cut($value, $maxlength, '');
             } else {
                 showmessage($name . ' 不得多于 ' . $maxlength . ' 字符');
             }
         } elseif ($maxlength) {
             $value = str_cut($value, $maxlength, '');
         }
         if ($pattern && $length && !preg_match($pattern, $value) && !$isimport) {
             showmessage($errortips);
         }
         // 唯一性判断,和附加函数验证
         /*$MODEL = getcache('model', 'commons');
         		$this->db->table_name = $this->fields[$field]['issystem'] ? $this->db_pre.$MODEL[$this->modelid]['tablename'] : $this->db_pre.$MODEL[$this->modelid]['tablename'].'_data';
         		if($this->fields[$field]['isunique'] && $this->db->get_one(array($field=>$value),$field) && ROUTE_A != 'edit') showmessage($name.L('the_value_must_not_repeat'));*/
         $func = $this->fields[$field]['formtype'];
         if (method_exists($this, $func)) {
             $value = $this->{$func}($field, $value);
         }
         // var_dump($this->fields);
         if ($this->fields[$field]['issystem']) {
             $info['system'][$field] = $value;
         } else {
             $info['model'][$field] = $value;
         }
     }
     //颜色选择为隐藏域 在这里进行取值
     $info['system']['style'] = $_POST['style_color'] ? strip_tags($_POST['style_color']) : '';
     if ($_POST['style_font_weight']) {
         $info['system']['style'] = $info['system']['style'] . ';' . strip_tags($_POST['style_font_weight']);
     }
     return $info;
 }
 function get($data, $isimport = 0)
 {
     $this->data = $data = trim_script($data);
     $info = array();
     foreach ($data as $field => $value) {
         //if(!isset($this->fields[$field]) || check_in($_roleid, $this->fields[$field]['unsetroleids']) || check_in($_groupid, $this->fields[$field]['unsetgroupids'])) continue;
         $name = $this->fields[$field]['name'];
         $minlength = $this->fields[$field]['minlength'];
         $maxlength = $this->fields[$field]['maxlength'];
         $pattern = $this->fields[$field]['pattern'];
         $errortips = $this->fields[$field]['errortips'];
         if (empty($errortips)) {
             $errortips = $name . ' ' . L('not_meet_the_conditions');
         }
         $length = empty($value) ? 0 : strlen($value);
         if ($minlength && $length < $minlength) {
             if ($isimport) {
                 return false;
             } else {
                 showmessage($name . ' ' . L('not_less_than') . ' ' . $minlength . L('characters'));
             }
         }
         if ($maxlength && $length > $maxlength) {
             if ($isimport) {
                 $value = str_cut($value, $maxlength, '');
             } else {
                 showmessage($name . ' ' . L('not_more_than') . ' ' . $maxlength . L('characters'));
             }
         } elseif ($maxlength) {
             $value = str_cut($value, $maxlength, '');
         }
         if ($pattern && $length && !preg_match($pattern, $value) && !$isimport) {
             showmessage($errortips);
         }
         $MODEL = getcache('model', 'commons');
         $this->db->table_name = $this->fields[$field]['issystem'] ? $this->db_pre . $MODEL[$this->modelid]['tablename'] : $this->db_pre . $MODEL[$this->modelid]['tablename'] . '_data';
         if ($this->fields[$field]['isunique'] && $this->db->get_one(array($field => $value), $field) && ROUTE_A != 'edit') {
             showmessage($name . L('the_value_must_not_repeat'));
         }
         $func = $this->fields[$field]['formtype'];
         if (method_exists($this, $func)) {
             $value = $this->{$func}($field, $value);
         }
         if ($this->fields[$field]['issystem']) {
             $info['system'][$field] = $value;
         } else {
             $info['model'][$field] = $value;
         }
         //颜色选择为隐藏域 在这里进行取值
         $info['system']['style'] = $_POST['style_color'] ? strip_tags($_POST['style_color']) : '';
         if ($_POST['style_font_weight']) {
             $info['system']['style'] = $info['system']['style'] . ';' . strip_tags($_POST['style_font_weight']);
         }
     }
     return $info;
 }
Exemple #8
0
 public function get($data, $isimport = 0)
 {
     $this->data = $data;
     $info = array();
     foreach ($data as $field => $value) {
         $name = $this->fields[$field]['name'];
         $minlength = $this->fields[$field]['minlength'];
         $maxlength = $this->fields[$field]['maxlength'];
         $pattern = $this->fields[$field]['pattern'];
         $errortips = $this->fields[$field]['errortips'];
         if (empty($errortips)) {
             $errortips = $name . ' ' . L('not_meet_the_conditions');
         }
         $length = strlen($value);
         if ($minlength && $length < $minlength) {
             if ($isimport) {
                 return false;
             } else {
                 showmessage($name . ' ' . L('not_less_than') . ' ' . $minlength . L('characters'));
             }
         }
         if ($maxlength && $length > $maxlength) {
             if ($isimport) {
                 $value = str_cut($value, $maxlength, '');
             } else {
                 showmessage($name . ' ' . L('not_more_than') . ' ' . $maxlength . L('characters'));
             }
         } elseif ($maxlength) {
             $value = str_cut($value, $maxlength, '');
         }
         if ($pattern && $length && !preg_match($pattern, $value) && !$isimport) {
             showmessage($errortips);
         }
         $MODEL = S('common/model');
         $this->db->table_name = $this->fields[$field]['issystem'] ? $this->db_pre . $MODEL[$this->modelid]['tablename'] : $this->db_pre . $MODEL[$this->modelid]['tablename'] . '_data';
         if ($this->fields[$field]['isunique'] && $this->db->where(array($field => $value))->field($field)->find() && ACTION != 'edit') {
             showmessage($name . L('the_value_must_not_repeat'));
         }
         $func = $this->fields[$field]['formtype'];
         if (method_exists($this, $func)) {
             $value = $this->{$func}($field, $value);
         }
         if ($this->fields[$field]['issystem']) {
             $info['system'][$field] = $value;
         } else {
             $info['model'][$field] = $value;
         }
         // 颜色选择为隐藏域 在这里进行取值
         $info['system']['style'] = isset($_POST['style_color']) ? strip_tags($_POST['style_color']) : '';
         if (isset($_POST['style_font_weight'])) {
             $info['system']['style'] = $info['system']['style'] . ';' . strip_tags($_POST['style_font_weight']);
         }
     }
     return $info;
 }
 function get($data, $isimport = 0)
 {
     $this->data = $data = trim_script($data);
     $info = array();
     foreach ($this->fields as $field) {
         //if(!isset($this->fields[$field]) || check_in($_roleid, $this->fields[$field]['unsetroleids']) || check_in($_groupid, $this->fields[$field]['unsetgroupids'])) continue;
         $name = $field['name'];
         $minlength = $field['minlength'];
         $maxlength = $field['maxlength'];
         $pattern = $field['pattern'];
         $errortips = $field['errortips'];
         $value = $data[$field['field']];
         //if(empty($errortips)) $errortips = $name.' '.L('not_meet_the_conditions');
         if (empty($errortips)) {
             $errortips = "请输入正确的{$name}";
         }
         $length = is_array($value) ? empty($value) ? 0 : 1 : strlen($value);
         if ($minlength && $length < $minlength) {
             if ($isimport) {
                 return false;
             } else {
                 showmessage($name . ' ' . L('not_less_than') . ' ' . $minlength . L('characters'));
             }
         }
         if ($maxlength && $length > $maxlength) {
             if ($isimport) {
                 $value = str_cut($value, $maxlength, '');
             } else {
                 showmessage($name . ' ' . L('not_more_than') . ' ' . $maxlength . L('characters'));
             }
         } elseif ($maxlength) {
             $value = str_cut($value, $maxlength, '');
         }
         if ($pattern && $length && !preg_match($pattern, $value) && !$isimport) {
             showmessage($errortips);
         }
         $func = $field['formtype'];
         if (method_exists($this, $func)) {
             $value = $this->{$func}($field['field'], $value);
         }
         $info[$field['field']] = $value;
         //颜色选择为隐藏域 在这里进行取值
         if ($_POST['style_color']) {
             $info['style'] = $_POST['style_color'];
         }
         if ($_POST['style_font_weight']) {
             $info['style'] = $info['style'] . ';' . strip_tags($_POST['style_font_weight']);
         }
     }
     return $info;
 }
 function get($data, $isimport = 0)
 {
     $this->data = $data = trim_script($data);
     $info = array();
     foreach ($data as $field => $value) {
         if (!isset($this->fields[$field]) && !check_in($field, 'paytype,paginationtype,maxcharperpage,id')) {
             continue;
         }
         $name = $this->fields[$field]['name'];
         $minlength = $this->fields[$field]['minlength'];
         $maxlength = $this->fields[$field]['maxlength'];
         $pattern = $this->fields[$field]['pattern'];
         $errortips = $this->fields[$field]['errortips'];
         if (empty($errortips)) {
             $errortips = $name . ' 不符合要求';
         }
         $length = empty($value) ? 0 : (is_string($value) ? strlen($value) : count($value));
         if ($minlength && $length < $minlength) {
             if ($isimport) {
                 return false;
             } else {
                 showmessage($name . ' 不得少于 ' . $minlength . ' 字符');
             }
         }
         if ($maxlength && $length > $maxlength) {
             if ($isimport) {
                 $value = str_cut($value, $maxlength, '');
             } else {
                 showmessage($name . ' 不得多于 ' . $maxlength . ' 字符');
             }
         } elseif ($maxlength) {
             $value = str_cut($value, $maxlength, '');
         }
         if ($pattern && $length && !preg_match($pattern, $value) && !$isimport) {
             showmessage($errortips);
         }
         // 附加函数验证
         $func = $this->fields[$field]['formtype'];
         if (method_exists($this, $func)) {
             $value = $this->{$func}($field, $value);
         }
         $info['system'][$field] = $value;
     }
     //颜色选择为隐藏域 在这里进行取值
     $info['system']['style'] = $_POST['style_color'] ? strip_tags($_POST['style_color']) : '';
     if ($_POST['style_font_weight']) {
         $info['system']['style'] = $info['system']['style'] . ';' . strip_tags($_POST['style_font_weight']);
     }
     return $info;
 }
 function get($data)
 {
     $this->data = $data = trim_script($data);
     $model_cache = getcache('member_model', 'commons');
     $this->db->table_name = $this->db_pre . $model_cache[$this->modelid]['tablename'];
     $info = array();
     $debar_filed = array('catid', 'title', 'style', 'thumb', 'status', 'islink', 'description');
     if (is_array($data)) {
         foreach ($data as $field => $value) {
             if ($data['islink'] == 1 && !in_array($field, $debar_filed)) {
                 continue;
             }
             $field = safe_replace($field);
             $name = $this->fields[$field]['name'];
             $minlength = $this->fields[$field]['minlength'];
             $maxlength = $this->fields[$field]['maxlength'];
             $pattern = $this->fields[$field]['pattern'];
             $errortips = $this->fields[$field]['errortips'];
             if (empty($errortips)) {
                 $errortips = "{$name} 不符合要求!";
             }
             $length = empty($value) ? 0 : strlen($value);
             if ($minlength && $length < $minlength && !$isimport) {
                 showmessage("{$name} 不得少于 {$minlength} 个字符!");
             }
             if (!array_key_exists($field, $this->fields)) {
                 showmessage('模型中不存在' . $field . '字段');
             }
             if ($maxlength && $length > $maxlength && !$isimport) {
                 showmessage("{$name} 不得超过 {$maxlength} 个字符!");
             } else {
                 str_cut($value, $maxlength);
             }
             if ($pattern && $length && !preg_match($pattern, $value) && !$isimport) {
                 showmessage($errortips);
             }
             if ($this->fields[$field]['isunique'] && $this->db->get_one(array($field => $value), $field) && ROUTE_A != 'edit') {
                 showmessage("{$name} 的值不得重复!");
             }
             $func = $this->fields[$field]['formtype'];
             if (method_exists($this, $func)) {
                 $value = $this->{$func}($field, $value);
             }
             $info[$field] = $value;
         }
     }
     return $info;
 }
Exemple #12
0
 public function index()
 {
     $model = M('Article');
     $data['status'] = 1;
     $count = $model->where($data)->count();
     $page_size = $_REQUEST['page_size'] ? $_REQUEST['page_size'] : C('default_page_size');
     $page_count = ceil($count / $page_size);
     $pageno = 1;
     $offset = ($pageno - 1) * $page_size;
     $voList = $model->field('id,title,content,litpic,create_time')->where($data)->limit($offset . ',' . $page_size)->select();
     foreach ($voList as $key => $val) {
         $voList[$key]['content'] = str_cut(htmlspecialchars_decode($val['content']), 45);
     }
     $list['count'] = $count;
     $list['page_count'] = $page_count;
     $list['data'] = $voList;
     echo json_encode($list);
     exit;
 }
Exemple #13
0
function joy($id)
{
    $session_id = "joy_src" . $id;
    $src = $_SESSION[$session_id];
    if (empty($src)) {
        //注意msxv5v2可能是个验证值,以后可能会变更,将导致无法获取
        $url = "http://msx.app.joy.cn/service.php?action=msxv5v2&playertype=joyplayer&videoid=" . $id;
        $str = get_data($url);
        if ($str) {
            $s1 = str_cut($str, "<HostPath", "/HostPath>");
            $s11 = str_cut($s1, ">", "<");
            $s2 = str_cut($str, "<Url", "</Url>");
            $s21 = str_cut($s2, "<![CDATA[", "]]>");
            $src = $s11 . $s21;
            //echo $src;
            $_SESSION[$session_id] = $src;
        }
    }
    return $src;
}
    function autoHookHead(&$style, $isReply)
    {
        global $PIO, $FileIO;
        if ($isReply) {
            $p = $PIO->fetchPosts($isReply);
            $sub = $p[0]['sub'];
            $com = htmlentities(str_cut($p[0]['com'], 100), ENT_QUOTES, 'UTF-8');
            $thumb = '';
            if ($p[0]['ext'] != '') {
                $thumb = $FileIO->resolveThumbName($p[0]['tim']);
                // 檢查是否有預覽圖可以顯示
                $thumb = $thumb ? $FileIO->getImageURL($thumb) : '';
            }
            $style .= <<<_HERE_

<meta property="og:image" content="{$thumb}" />
<meta property="og:title" content="{$sub} - {$this->site}" />
<meta property="og:description" content="{$com}" />
_HERE_;
        }
    }
 function new_age()
 {
     $msg = M('Message');
     $limit = $_POST['limit'];
     $current = I('get.page', 1);
     $art = ($current - 1) * $limit;
     $url = get_url();
     //获取当前页面的URL地址
     $fir = strpos($url, 'page');
     if ($fir) {
         $purl = mb_substr($url, 0, $fir - 1);
     } else {
         $purl = $url;
     }
     $count = $msg->count();
     $show = list_page($current, $limit, $count, $purl);
     $msg = $msg->order('msg_addtime DESC')->limit($art, $limit)->select();
     foreach ($msg as $key => $val) {
         $msg[$key]['msg_ctitle'] = str_cut($val['msg_content'], 0, 21);
     }
     $data = array('msg' => $msg, 'show' => $show);
     echo json_encode($data);
 }
 /**
  * 证书列表、搜索列表
  * @author Martin.Cheng <*****@*****.**>
  */
 public function index()
 {
     $where = array();
     $field = array();
     $order = 'create_time desc';
     $word_form = I('post.w') ? I('post.w') : I('get.w');
     //获取查询字
     $word_form ? $where['full_name|description'] = array('like', "%" . $word_form . "%") : '';
     //生成数据库查询条件
     $where = !empty($where) ? $where : array();
     $where['is_delete'] = 2;
     //证书状态为未删除
     $certificate_total = $this->CertificateModel->getCertificateTotal($where);
     //列表总数量
     $page = isset($_GET['p']) ? intval(htmlspecialchars(strip_tags($_GET['p']))) : '';
     //获取url的分页参数
     $page = max(1, $page);
     $page = min($page, ceil($certificate_total / $this->page_number));
     // 获取合法的分页数
     $certificate_data = $this->CertificateModel->getCertificateList($where, $field, $order, $page, $this->page_number);
     // 分页数据
     $map = $word_form ? array('w' => $word_form) : array();
     //生成分页连接参数
     $Page = new PageAdmin($certificate_total, $this->page_number, $map);
     //分页类实例化
     $this->assign('page', $Page->show());
     // 分页显示输出
     $this->assign('word', $word_form);
     // 查询关键字
     foreach ($certificate_data as $key => $value) {
         $certificate_data[$key]['description'] = str_cut($certificate_data[$key]['description']);
         $certificate_data[$key]['certificate_type'] = self::getCertificateType($certificate_data[$key]['certificate_type']);
     }
     $this->assign('certificate', $certificate_data);
     $this->display();
 }
" class="checkitem ml10 mr10" />
        <span><a href="index.php?act=goods&goods_id=<?php 
        echo $consult['goods_id'];
        ?>
" target="_blank"><?php 
        echo $consult['cgoods_name'];
        ?>
</a></span><span class="ml20"><?php 
        echo $lang['store_consult_list_consult_member'] . $lang['nc_colon'];
        ?>
</span>
        <?php 
        if ($consult['member_id'] == "0") {
            echo $lang['nc_guest'];
        } else {
            echo $consult['isanonymous'] == 1 ? str_cut($consult['cmember_name'], 2) . '***' : $consult['cmember_name'];
        }
        ?>
        <span class="ml20"><?php 
        echo $lang['store_consult_list_consult_time'] . $lang['nc_colon'];
        ?>
<em class="goods-time"><?php 
        echo date("Y-m-d H:i:s", $consult['consult_addtime']);
        ?>
</em></span></th>
    </tr>
    <tr>
      <td rowspan="2"></td>
      <td class="tl"><strong><?php 
        echo $lang['store_consult_list_consult_content'] . $lang['nc_colon'];
        ?>
 /**
  * 查看订单
  */
 public function fapiaoOp()
 {
     $order_id = intval($_GET['order_id']);
     if ($order_id <= 0) {
         showMessage(Language::get('wrong_argument'), '', 'html', 'error');
     }
     $order_model = Model('order');
     $condition['order_id'] = $order_id;
     $condition['store_id'] = $_SESSION['store_id'];
     $order_info = $order_model->getOrderInfo($condition, array('order_common', 'order_goods'));
     if (empty($order_info)) {
         showMessage(Language::get('member_printorder_ordererror'), '', 'html', 'error');
     }
     Tpl::output('order_info', $order_info);
     //卖家信息
     $model_store = Model('store');
     $store_info = $model_store->getStoreInfoByID($order_info['store_id']);
     if (!empty($store_info['store_label'])) {
         if (file_exists(BASE_UPLOAD_PATH . DS . ATTACH_STORE . DS . $store_info['store_label'])) {
             $store_info['store_label'] = UPLOAD_SITE_URL . DS . ATTACH_STORE . DS . $store_info['store_label'];
         } else {
             $store_info['store_label'] = '';
         }
     }
     if (!empty($store_info['store_stamp'])) {
         if (file_exists(BASE_UPLOAD_PATH . DS . ATTACH_STORE . DS . $store_info['store_stamp'])) {
             $store_info['store_stamp'] = UPLOAD_SITE_URL . DS . ATTACH_STORE . DS . $store_info['store_stamp'];
         } else {
             $store_info['store_stamp'] = '';
         }
     }
     Tpl::output('store_info', $store_info);
     //订单商品
     $model_order = Model('order');
     $condition = array();
     $condition['order_id'] = $order_id;
     $condition['store_id'] = $_SESSION['store_id'];
     $goods_new_list = array();
     $goods_all_num = 0;
     $goods_total_price = 0;
     if (!empty($order_info['extend_order_goods'])) {
         $goods_count = count($order_goods_list);
         $i = 1;
         foreach ($order_info['extend_order_goods'] as $k => $v) {
             $v['goods_name'] = str_cut($v['goods_name'], 100);
             $goods_all_num += $v['goods_num'];
             $v['goods_all_price'] = ncPriceFormat($v['goods_num'] * $v['goods_price']);
             $goods_total_price += $v['goods_all_price'];
             $goods_new_list[ceil($i / 4)][$i] = $v;
             $i++;
         }
     }
     //优惠金额
     $promotion_amount = $goods_total_price - $order_info['goods_amount'];
     //运费
     $order_info['shipping_fee'] = $order_info['shipping_fee'];
     Tpl::output('promotion_amount', $promotion_amount);
     Tpl::output('goods_all_num', $goods_all_num);
     Tpl::output('goods_total_price', ncPriceFormat($goods_total_price));
     Tpl::output('goods_list', $goods_new_list);
     Tpl::showpage('printer_fapiao', "null_layout");
 }
Exemple #19
0
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="public-top-layout w">
  <div class="topbar warp-all">
    <div class="user-entry">
      <?php 
if ($_SESSION['is_login'] == '1') {
    ?>
      <?php 
    echo $lang['nc_hello'];
    ?>
<span><a href="<?php 
    echo urlShop('member_snsindex');
    ?>
"><?php 
    echo str_cut($_SESSION['member_name'], 20);
    ?>
</a></span><?php 
    echo $lang['nc_comma'], $lang['welcome_to_site'];
    ?>
 <a href="<?php 
    echo SHOP_SITE_URL;
    ?>
"  title="<?php 
    echo $lang['homepage'];
    ?>
" alt="<?php 
    echo $lang['homepage'];
    ?>
"><span><?php 
    echo $GLOBALS['setting_config']['site_name'];
Exemple #20
0
        echo $val['goods_name'];
        ?>
" src="<?php 
        echo $val['goods_image'] ? UPLOAD_SITE_URL . DS . ATTACH_MALBUM . '/' . $val['member_id'] . '/' . $val['goods_image'] : SHOP_TEMPLATES_URL . '/images/member/default_image.png';
        ?>
" />
					  </a>
					</span>
				  </div>
				  <h3 class="fn-right">
					<a href="index.php?act=flea_goods&goods_id=<?php 
        echo $val['goods_id'];
        ?>
" >
						<?php 
        echo str_cut($val['goods_name'], 40);
        ?>
					</a>
				  </h3>
				  <p class="price orange fn-right"><?php 
        echo $lang['currency'];
        echo $val['goods_store_price'];
        ?>
</p>
				  <div class="item-attrs blue2 fn-right">
                    <span class="item_fav fn-right" title="<?php 
        echo $lang['flea_goods_collect'];
        ?>
"><?php 
        echo $val['flea_collect_num'];
        ?>
Exemple #21
0
<?php 
if (!empty($output['goodsevallist']) && is_array($output['goodsevallist'])) {
    foreach ($output['goodsevallist'] as $k => $v) {
        ?>
<div class="ncs-commend-floor">
    <div class="user">
		<img src="<?php 
        echo getMemberAvatarForID($v['geval_frommemberid']);
        ?>
">
		<span>
		<?php 
        if ($v['geval_isanonymous'] == 1) {
            ?>
		<?php 
            echo str_cut($v['geval_frommembername'], 2) . '***';
            ?>
		<?php 
        } else {
            ?>
		<?php 
            echo $v['geval_frommembername'];
            ?>
		<?php 
        }
        ?>
		</span>
		<time pubdate="pubdate">[<?php 
        echo @date('Y-m-d', $v['geval_addtime']);
        ?>
]</time>
Exemple #22
0
<div class="<?php 
echo $D->g->list_index % 2 == 0 ? 'post' : 'post dark';
?>
" style="background-image: url('<?php 
echo $C->IMG_URL;
?>
avatars/thumbs3/<?php 
echo $D->g->avatar;
?>
');">
	<div class="postttl"><a href="<?php 
echo $C->SITE_URL . $D->g->groupname;
?>
" title="<?php 
echo htmlspecialchars($D->g->title);
?>
" class="user"><?php 
echo htmlspecialchars($D->g->title);
?>
</a></div>
	<p class="message"><?php 
echo empty($D->g->about_me) ? '&nbsp;' : htmlspecialchars(str_cut($D->g->about_me, 50));
?>
</p>
</div>
<hr />
        <thead>
            <tr>
			<th width="33%">&nbsp;</th><th width="33%">&nbsp;</th><th width="33%">&nbsp;</th>
            </tr>
        </thead>
        <tbody>
 <?php 
if(is_array($infos)){
	$n = 0;
	foreach($infos as $info){
		$n++;
?>   
	<?php if($n%3==1){?><tr><?php }?>
	<td><div class="col-left mr10" style="width:146px; height:112px"><img src="<?php echo format_url($info['video']['picPath'])?>" width="146" height="112" style="border:1px solid #eee" align="left" title="<?php echo $info['video']['title'];?>"></div>
	<div class="col-auto">  
		<h2 class="title-1 f14 lh28 mb6 blue" title="<?php echo $info['video']['title'];?>"><?php echo str_cut($info['video']['title'], 26)?></h2>
		<div class="lh22"><?php echo $info['video']['desc']?></div>
	<p class="gray4">上传时间:<?php echo format::date(substr(trim($info['video']['uploadTime']), 0, 10), 1)?></p>
	<p class="gray4">播放次数:<?php echo $info['video']['videoTime']?></p>
	</div>
	</td>
	<?php if($n%3==0){?></tr><?php }?>
<?php 
	}
}
?>
</tbody>
    </table>
  
    <div class="btn"></div>
 <div id="pages"><?php echo $pages;?></div><script>window.top.$("#display_center_id").css("display","none");</script>
Exemple #24
0
 /**
  * 表单验证
  * @param array $data 表单数据
  * @param string $type 按数据表数据判断
  * @param string $action 在添加时会加上默认数据
  * @return array 数据检验后返回的数组
  */
 private function check($data = array(), $type = 'info', $action = 'add', $content = '')
 {
     if ($type == 'info') {
         if (!$data['title']) {
             showmessage(L('title_no_empty'), HTTP_REFERER);
         }
         if (!$data['typeid']) {
             showmessage(L('no_select_type'), HTTP_REFERER);
         }
         $data['inputtime'] = $data['inputtime'] ? strtotime($data['inputtime']) : SYS_TIME;
         $data['islink'] = $data['islink'] ? intval($data['islink']) : 0;
         $data['style'] = '';
         if ($data['style_color']) {
             $data['style'] .= 'color:#00FF99;';
         }
         if ($data['style_font_weight']) {
             $data['style'] .= 'font-weight:bold;';
         }
         //截取简介
         if ($_POST['add_introduce'] && $data['description'] == '' && !empty($content)) {
             $content = stripslashes($content);
             $introcude_length = intval($_POST['introcude_length']);
             $data['description'] = str_cut(str_replace(array("\r\n", "\t"), '', strip_tags($content)), $introcude_length);
         }
         //自动提取缩略图
         if (isset($_POST['auto_thumb']) && $data['thumb'] == '' && !empty($content)) {
             $content = stripslashes($content);
             $auto_thumb_no = intval($_POST['auto_thumb_no']) - 1;
             if (preg_match_all("/(src)=([\"|']?)([^ \"'>]+\\.(gif|jpg|jpeg|bmp|png))\\2/i", $content, $matches)) {
                 $data['thumb'] = $matches[3][$auto_thumb_no];
             }
         }
         unset($data['style_color'], $data['style_font_weight']);
         if ($action == 'add') {
             $data['updatetime'] = SYS_TIME;
             $data['username'] = param::get_cookie('admin_username');
             $data['userid'] = $_SESSION['userid'];
         }
     } elseif ($type == 'data') {
         if (!$data['content']) {
             showmessage(L('content_no_empty'), HTTP_REFERER);
         }
     }
     return $data;
 }
Exemple #25
0
','<?php 
    echo addslashes($this->lang('user_unfollow_confirm', array('#USERNAME#' => $D->u->username)));
    ?>
','<?php 
    echo addslashes($this->lang('msg_follow_user_off', array('#USERNAME#' => $D->u->username)));
    ?>
');" class="unfollowusr" onfocus="this.blur();"><b><?php 
    echo $this->lang('usrlist_tltp_unfollow');
    ?>
</b></a>
										<?php 
}
?>
										</div>
										<div class="groupdesc"><?php 
echo htmlspecialchars(str_cut($D->u->position, 25));
?>
</div>
										<div class="grouptext">
											<?php 
echo $D->u->num_followers;
?>
 <?php 
echo $this->lang($D->u->num_followers == 1 ? 'usrlist_numfollowers1' : 'usrlist_numfollowers');
?>
,
											<?php 
echo $D->u->num_posts;
?>
 <?php 
echo $this->lang($D->u->num_posts == 1 ? 'usrlist_numposts1' : 'usrlist_numposts');
Exemple #26
0
    ?>
		<div class="attachment">
			<a href="<?php 
    echo $C->SITE_URL;
    ?>
getfile/pid:<?php 
    echo $D->p->post_tmp_id;
    ?>
/<?php 
    echo htmlspecialchars($D->p->post_attached['file']->title);
    ?>
" title="<?php 
    echo htmlspecialchars($D->p->post_attached['file']->title);
    ?>
"><?php 
    echo htmlspecialchars(str_cut($D->p->post_attached['file']->title, 40));
    ?>
 (<?php 
    echo show_filesize($D->p->post_attached['file']->filesize);
    ?>
)</a><br />
			<div class="klear"></div>
		</div>
		<?php 
}
?>
		
		<?php 
if (isset($D->p->post_attached['image'])) {
    ?>
		<div class="attachment">
function RightAd()
{
    global $db, $wd, $wd_en, $tg;
    ?>
<table width="30%" border="0" cellpadding="0" cellspacing="0" align="right"><tr>
<td align="left" style="padding-right:10px">
<div style="border-left:1px solid #e1e1e1;padding-left:10px;word-break:break-all;word-wrap:break-word;">
<?php 
    /*
    echo "<div style=\"line-height:25px;\">";
    foreach($tg as $t)
    {
        $file_fix=substr($t["pic"],strrpos($t["pic"],"."));
    	  if(in_array($file_fix,array(".gif",".jpg",".png")))
    	  {
    	     $pic_code="<img src=\"".$t["pic"]."\">";
    	  }
    	  elseif($file_fix==".swf")
    	  {
    	     $pic_code="<embed src=\"".$t["pic"]."\"></embed>";
    	  }
    	  else
    	  {
    	     $pic_code="<embed src=\"".$t["pic"]."\"></embed>";
    	  }
        echo $pic_code."<br><br><a target=\"_blank\" href=\"".$t["url"]."\"><font size=3>".$t["title2"]."</font></a><br><font style=\"color:#666666;width:250px;\">".$t["txt2"]."</font>";
    }
    echo "</div><br><br>";
    */
    ?>
<div id="ec_im_container">
<?php 
    $GetAdKeywordSql = GetAdKeywordSql();
    if (empty($GetAdKeywordSql)) {
        $GetAdKeywordSql = "title like '%" . $wd . "%'";
    }
    $query_ad = $db->query("select * from ve123_ad where " . $GetAdKeywordSql . " and type='2' and is_show limit 5");
    $num = $db->num_rows($query_ad);
    if ($num < 1) {
        $query_ad = $db->query("select * from ve123_ad where type='2' and is_show limit 5");
    }
    while ($row_ad = $db->fetch_array($query_ad)) {
        ?>
<div class="r" id="bdfs0">

<a id=dfs0 href='<?php 
        echo $row_ad["siteurl"];
        ?>
' target='_blank' onMouseOver="return ss('链接至 <?php 
        echo $config["name"];
        ?>
')" onMouseOut="cs()">

<font size="3"><?php 
        echo $row_ad["title"];
        ?>
</font>

</a><br>

<span id="bdfs0"><font size="-1" color="#000000"><?php 
        echo $row_ad["content"];
        ?>
</font><br><font size="-1" color="#008000"><?php 
        echo str_cut($row_ad["siteurl"], 38);
        ?>
</font></span>

</div><br>
<?php 
    }
    ?>
</div>
<div style="line-height:25px;">
<?php 
    $query_ad = $db->query("select * from ve123_ad where type='1' and is_show limit 5");
    while ($row_ad = $db->fetch_array($query_ad)) {
        ?>
<a href='<?php 
        echo str_replace("{zeidu:keyword}", $wd_en, $row_ad["siteurl"]);
        ?>
' target='_blank'><?php 
        echo str_replace("{zeidu:keyword}", "<font color=#C60A00>" . str_cut($wd, 20) . "</font>", $row_ad["title"]);
        ?>
</a><br>
<?php 
    }
    ?>
</div>


<table border=0 cellpadding=0 cellspacing=0  style="width:240px;border-left: #EFF2FA 1px solid; border-right: #EFF2FA 1px solid;border-bottom: #EFF2FA 1px solid; font-size: 12px; color: #333333;background-color: #EFF2FA;"><tr><td style="table-layout:fixed;word-break:break-all;border-top: #7593E5 1px solid;background-color: #EFF2FA;padding-left:10px;line-height:24px;">
<!--<a href="#" target=_blank><font style="font-size:9pt">发布/查看关于<font color="#C60A00"><?php 
    echo str_cut($wd, 20);
    ?>
</font>留言</font></a>-->
&nbsp;</td>
</tr></table>
<DIV id=ScriptDiv></DIV>
</div>
</td></tr></table>

<?php 
}
Exemple #28
0
   <div class="hotgoods">
     <h2><a class="more gray2 fn-right" href="index.php?act=flea_class"><?php echo $lang['flea_goods_more'];?></a></h2>
     <div class="hotgoods_G">
       <dl>
         <dt class="fn-left">
           <div class="pic">
             <span class="thumb size100">
               <i></i>
               <a title="<?php echo $output['new_flea_goods']['goods_name'];?>" target="_blank" href="index.php?act=flea_goods&goods_id=<?php echo $output['new_flea_goods']['goods_id']?>"><img height="100" width="100" onload="javascript:DrawImage(this,100,100);" src="<?php echo $output['new_flea_goods']['goods_image'] != '' ? UPLOAD_SITE_URL.DS.ATTACH_MALBUM.DS.$output['new_flea_goods']['member_id'].DS.$output['new_flea_goods']['goods_image'] : SHOP_TEMPLATES_URL.'/images/member/default_image.png';?>" /></a>
             </span>
           </div>
         </dt>
         <dd class="fn-left"><?php echo $lang['flea_index_goods_1'];?><?php echo checkQuality($output['new_flea_goods']['flea_quality'])?><?php echo $lang['flea_index_goods_2'];?> <?php echo $output['new_flea_goods']['goods_name']?></dd>
         <dd class="fn-left"><span class="price orange"><?php echo $output['new_flea_goods']['goods_store_price']?></span><?php echo $lang['flea_index_rmbtransfer'];?></dd>
         <dd class="fn-left"><img src="<?php echo SHOP_TEMPLATES_URL;?>/images/flea/zr.png" /></dd>
         <dd class="flea_message fn-left"><?php echo str_cut(trim(str_replace(array("\r\n","\n","\r",'&nbsp;'),' ',strip_tags($output['one_goods_title']))),150); ?></dd>
       </dl>
     </div>
 </div>
   <div class="sell">
     	<div class="collect">
           <h2></h2>
           <div class="collect_goods">
             <p class="collect_hot"><?php echo $lang['flea_mostwell_goods'];?></p>
             <div class="pic fn-left">
               <span class="thumb size76">
                 <i></i>
                 <a title="<?php echo $output['col_flea_goods']['goods_name'];?>" href="index.php?act=flea_goods&goods_id=<?php echo $output['col_flea_goods']['goods_id']?>" target="_blank"><img height="76" width="76" onload="javascript:DrawImage(this,76,76);" src="<?php echo $output['col_flea_goods']['goods_image'] != '' ? UPLOAD_SITE_URL.DS.ATTACH_MALBUM.DS.$output['col_flea_goods']['member_id'].DS.$output['col_flea_goods']['goods_image'] : SHOP_TEMPLATES_URL.'/images/member/default_image.png';?>" /></a>
               </span>
             </div>
             <div class="collect_info fn-left">
 function GetTg()
 {
     $db = $this->db;
     $array = array();
     $keywordsql = $this->GetKeywordSql("title,' ',url,' ',description");
     if (empty($keywordsql)) {
         $keywordsql = "title like '%" . $this->wd . "%'";
     }
     $sql = "select a.*,b.* from ve123_tg_links a left join ve123_tg_user b on a.user_id=b.user_id where b.points>=a.price and a.user_id>0 and " . $keywordsql . " order by price desc limit 10";
     //echo $sql;
     $query = $db->query($sql);
     while ($row = $db->fetch_array($query)) {
         $data["title"] = $this->GetRedKeyWord(str_cut($row["title"], 60));
         $data["title2"] = $row["title"];
         $data["txt"] = $this->GetRedKeyWord(str_cut($row["description"], 250));
         $data["txt2"] = $row["description"];
         $data["url"] = str_cut($row["url"], 50);
         $data["updatetime"] = date("Y-m", $row["updatetime"]);
         $data["pagesize"] = number_format(strlen($row["description"]) / 1024, 0, ".", "") + 1;
         $data["link_id"] = $row["link_id"];
         $data["is_tg"] = true;
         // $data["jscode"]=$row["jscode"];
         // $data["pic"]=$row["pic"];
         $array[] = $data;
     }
     return $array;
 }
 public function downloadxls()
 {
     // $list=$this->_list(MODULE_NAME);
     $where = 1;
     $name = "全部订单:" . time();
     if (intval($_REQUEST["uid"])) {
         $where['userid'] = intval($_REQUEST["uid"]);
         $name = "用户" . intval($_REQUEST["uid"]);
     }
     if ($_REQUEST["username"]) {
         $where['username'] = $_REQUEST["username"];
         $name = "用户-" . $_REQUEST["username"];
     }
     if (intval($_REQUEST["mid"])) {
         $where["mid"] = intval($_REQUEST["mid"]);
     }
     if ($_REQUEST["mx"]) {
         $where["mx"] = get_safe_replace($_REQUEST["mx"]);
         $name = get_safe_replace($_REQUEST["mx"]) . intval($_REQUEST["uid"]);
     }
     if ($_REQUEST["mb"]) {
         $where["mobile"] = get_safe_replace($_REQUEST["mb"]);
         $name = "手机" . get_safe_replace($_REQUEST["mb"]);
     }
     if ($_REQUEST["time1"] || $_REQUEST["time2"]) {
         $time1 = get_safe_replace($_REQUEST["time1"]);
         $time2 = get_safe_replace($_REQUEST["time2"]);
         /*strtotime($time2)-($day*86400);*/
         if ($time1 == $time2) {
             $time1 = strtotime($time1) - 86400;
         } else {
             $time1 = strtotime($time1);
         }
         /*相同日期则选择一天*/
         $where["createtime"] = array('between', array($time1, strtotime($time2)));
         $name = "时间段" . $time1;
     }
     $udata = M(MODULE_NAME)->where($where)->select();
     $data = array();
     foreach ($udata as $key => $v) {
         $data[$key][1] = $key;
         $data[$key][2] = $v["username"];
         $data[$key][3] = $v["creditno"];
         $data[$key][4] = $v["mobile"];
         $data[$key][5] = str_cut($v["title"], 20, "");
         $data[$key][6] = $v["mcount"];
         $data[$key][7] = $v["amount"];
         $data[$key][8] = $v["godate"];
         $data[$key][9] = toDate($v["add_time"], "Y/m/d H:i:s");
     }
     $title = array(1 => "订单编号", 2 => "姓名", 3 => "身份证", 4 => "手机", 5 => "线路", 6 => "数量", 7 => "总价格", 8 => "出发时间", 9 => "添加时间");
     $this->exportexcel($data, $title, $name);
 }