Пример #1
0
/**
*获取信息内容
**/
function list_content($SQL, $leng = 40)
{
    global $db, $_pre, $webdb;
    $query = $db->query("SELECT A.* FROM {$_pre}content A {$SQL}");
    while ($rs = $db->fetch_array($query)) {
        //把辅信息表的内容也同时取出来,方便给模板调用
        $rs[mid] && ($rss = $db->get_one("SELECT * FROM {$_pre}content_{$rs['mid']} WHERE id={$rs['id']} LIMIT 1"));
        is_array($rss) && ($rs = $rs + $rss);
        if ($webdb[Info_KeepDataTxt]) {
            $_rid = $rs[rid];
            $dirid = floor($_rid / 1000);
            $rs[content] = read_file(Mpath . "data/data/1_{$dirid}/{$_rid}.php");
            $rs[content] = substr($rs[content], 15);
        }
        $rs[content] = @preg_replace('/<([^>]*)>/is', "", $rs[content]);
        //把HTML代码过滤掉
        $rs[content] = get_word($rs[full_content] = $rs[content], 100);
        $rs[title] = get_word($rs[full_title] = $rs[title], $leng);
        if ($rs[titlecolor] || $rs[fonttype]) {
            $titlecolor = $rs[titlecolor] ? "color:{$rs['titlecolor']};" : '';
            $font_weight = $rs[fonttype] == 1 ? 'font-weight:bold;' : '';
            $rs[title] = "<font style='{$titlecolor}{$font_weight}'>{$rs['title']}</font>";
        }
        $rs[posttime] = date("Y-m-d", $rs[full_time] = $rs[posttime]);
        if ($rs[picurl]) {
            $rs[picurl] = tempdir($rs[picurl]);
        }
        $listdb[] = $rs;
    }
    return $listdb;
}
 function __construct($id = 1)
 {
     if (is_numeric($id)) {
         $dictionary_row = get_word($id);
         $this->build($dictionary_row);
     }
 }
Пример #3
0
 /**
  * 淘宝跳转
  */
 public function index()
 {
     $id = I('id', '', 'trim');
     $iid = I('iid', '', 'number_int');
     $date = I('date');
     $dt = '1';
     if ($date) {
         $dt = '2';
     }
     $tpl = 'index';
     if ($id) {
         if (!intval($id)) {
             exit('input error');
         }
         if (strlen($id) > 9) {
             $item = $this->_mod->where(array('num_iid' => $id))->find();
         } else {
             $item = $this->_mod->where(array('id' => $id))->find();
         }
         if (!$item) {
             $item['num_iid'] = $id;
         }
     }
     if ($iid) {
         if (!intval($iid)) {
             exit('input error');
         }
         $this->_mod = M('items');
         $item = $this->_mod->where(array('num_iid' => $iid))->find();
         if (!$item) {
             $item['num_iid'] = $iid;
         }
     }
     if (C('ftx_click_ai')) {
         $tpl = 'taobao';
         if (!is_mobile()) {
             if ($item['click_url'] && 0 < strpos($item['click_url'], "s.click")) {
                 $this->jump_hidden_referer($item['click_url']);
             } else {
                 if (0 < strpos($item['click_url'], "redirect.simba.taobao.com")) {
                     $this->jump_hidden_referer($item['click_url']);
                 }
             }
         }
     }
     if ($item['shop_type'] == "D") {
         $this->jump_hidden_referer($item['click_url']);
     }
     $taodianjin = C('ftx_taojindian_html');
     if (strpos($taodianjin, 'text/javascript')) {
         $pid = get_word($taodianjin, 'pid: "', '"');
     } else {
         $pid = $taodianjin;
     }
     $this->assign('pid', $pid);
     $this->assign('date', $dt);
     $this->assign('item', $item);
     $this->display($tpl);
 }
function edit_word_settings_page()
{
    $semantic = WP_PLUGIN_URL . '/vocabulary-plugin/css/semantic.css';
    $word_id = filter_input(INPUT_POST, 'id');
    $words = get_word($word_id);
    $domains = get_domains();
    $categories = get_word_categories();
    if (isset($_GET['id']) && is_numeric($_GET['id'])) {
        $words = build_words($_GET['id']);
    }
    ?>
<link rel="stylesheet" type="text/css" href="<?php 
    echo $semantic;
    ?>
"/>
<h2>Edit a word!</h2>
<hr>

<?php 
    if (isset($_GET['settings-saved'])) {
        ?>
    <div class="updated"><p>Dictionary updated successfully.</p></div>
<?php 
    } elseif (isset($_GET['error'])) {
        ?>
    <div class="error"><p>Error updating dictionary.</p></div>
<?php 
    }
    ?>
<form id="myform" method="post" enctype="multipart/form-data" action="<?php 
    echo get_admin_url() . 'admin-post.php';
    ?>
">
    <!-- pano processing hook -->
    <input type="hidden" name="action" value="edit_word" />
    <input type="hidden" name="word_id" value="<?php 
    echo $words->get_id();
    ?>
"/>

    <div class="ui form segment edit_word_form">

        <div class="ui form">
              <div class="field">
                <label for="domain_id">Select a Domain</label>
                <select name="domain_id">
                     <option value="NA"> ... </option>
                     <?php 
    foreach ($domains as $domain) {
        ?>
                        <option value="<?php 
        echo $domain->id;
        ?>
"><?php 
        echo $domain->name;
        ?>
</option>
                    <?php 
    }
    ?>
                </select>
                </div>
            </div>

        <div class="ui form">
              <div class="field">
                <label for="category_id">Select a Category</label>
                <select name="category_id">
                     <option value="NA">...</option>
                     <?php 
    foreach ($categories as $category) {
        ?>
                        <option value="<?php 
        echo $category->id;
        ?>
"><?php 
        echo $category->name;
        ?>
</option>
                    <?php 
    }
    ?>
                </select>
              </div>
            </div>

	    <div class="ui form">
	      <div class="field">
	      	<div class="ui left labeled icon input">
	        	<label for="word_name">Word Name</label>
	    		<input name="word_name" id="name" value="<?php 
    echo $words->get_word();
    ?>
" required />
     	 	</div>
	      </div>
	    </div>
	    <div class="ui form">
	      <div class="field">
	        <label for="word_description">Description</label>
	        <textarea name="word_description" id="word_description" required ><?php 
    echo $words->get_description();
    ?>
</textarea>
	        <p class="error" id="description_too_big">* Description must be smaller than 255 char</p>
	      </div>
	    </div>
        <div class="ui form">
	      <div class="field">
	        <label for="word_points">Points</label>
	        <select name="word_points">
	            <option value="30">30</option>
	            <option value="20">20</option>
	            <option value="10">10</option>
            </select>
	      </div>
	    </div>
        <div class="ui form">
	      <div class="field">
	        <div class="ui left labeled icon input">
                <label for="word_image">Choose an image: <b>(Preferably 120x120)</b> </label>
                <img class="word_image" src="<?php 
    echo content_url() . '/' . $words->get_image();
    ?>
" alt="Image"/>
                <input type="file" name="word_image" id="word_image"  />
            </div>
	      </div>
	    </div>
        <div class="ui form">
	      <div class="field">
	        <div class="ui left labeled icon input">
                <label for="word_audio">Choose an audio: </label>
                <input type="file" name="word_audio" id="word_audio" />
	        </div>
	      </div>
	    </div>

	    <?php 
    submit_button();
    ?>
	</div>
</form>
</div>

<script>

jQuery('#myform').submit(function(e){
       max_description_size(e);
   });

   function max_description_size(e){
       var size = jQuery("#word_description").val().length;
       if(size > 255){
           document.getElementById("description_too_big").style.display = "block";
           e.preventDefault();
       }else{
           document.getElementById("description_too_big").style.display = "none";
       }
   }
            jQuery(document).ready(function(){
                jQuery("#wordTable").tablesorter();
            })
</script>
<?php 
}
Пример #5
0
            $listdb[] = $_listdb[$value];
        }
        if ($_picdb[$value]) {
            $picdb[] = $_picdb[$value];
        }
    }
}
if (!$listdb) {
    $listdb[] = array("subject" => "本专题暂无文章,请管理员在后台添加文章");
}
//统计点击次数
$db->query("UPDATE {$pre}special SET hits=hits+1,lastview='{$timestamp}' WHERE id='{$id}'");
//SEO
$titleDB[title] = filtrate(strip_tags("{$rsdb['title']} - {$fidDB['name']} - {$webdb['webname']}"));
$titleDB[keywords] = filtrate("{$rsdb['keywords']} {$webdb['metakeywords']}");
$rsdb[description] = get_word(preg_replace("/(<([^<]+)>|\t|&nbsp;|\n)/is", "", $rsdb[content]), 250);
$titleDB[description] = filtrate($rsdb[description]);
//附件真实地址还原
$rsdb[content] = En_TruePath($rsdb[content], 0);
$rsdb[content] = str_replace("\n", "<br>", $rsdb[content]);
$rsdb[posttime] = date("Y-m-d H:i:s", $rsdb[posttime]);
$rsdb[picurl] && ($rsdb[picurl] = tempdir($rsdb[picurl]));
require ROOT_PATH . "inc/head.php";
require html("showsp", $main_tpl);
require ROOT_PATH . "inc/foot.php";
$content = ob_get_contents();
ob_end_clean();
ob_start();
if ($webdb[www_url] == '/.') {
    $content = str_replace('/./', '/', $content);
}
Пример #6
0
        $listdb[] = $rs;
    }
    require ROOT_PATH . "member/head.php";
    require dirname(__FILE__) . "/" . "template/comment/list.htm";
    require ROOT_PATH . "member/foot.php";
} elseif ($job == 'mylist') {
    if (!$page) {
        $page = 1;
    }
    $rows = 20;
    $showpage = getpage("{$_pre}comments", "WHERE uid='{$lfjuid}'", "?job={$job}", $rows);
    $min = ($page - 1) * $rows;
    $query = $db->query("SELECT * FROM {$_pre}comments WHERE uid='{$lfjuid}' ORDER BY cid DESC LIMIT {$min},{$rows}");
    while ($rs = $db->fetch_array($query)) {
        $rs[content] = preg_replace("/<([^<]+)>/is", "", $rs[content]);
        $rs[title] = get_word($rs[content], 70);
        if (!$rs[username]) {
            $detail = explode(".", $rs[ip]);
            $rs[username] = "{$detail['0']}.{$detail['1']}.{$detail['2']}.*";
        }
        $rss = $db->get_one("SELECT city_id FROM {$_pre}db WHERE id='{$rs['id']}'");
        $rs[url] = get_info_url($rs[id], $rs[fid], $rss[city_id]);
        $rs[posttime] = date("Y-m-d H:i", $rs[posttime]);
        $listdb[] = $rs;
    }
    require ROOT_PATH . "member/head.php";
    require dirname(__FILE__) . "/" . "template/comment/mylist.htm";
    require ROOT_PATH . "member/foot.php";
} elseif ($action == "del") {
    if (!$ciddb) {
        showerr("请选择一个");
Пример #7
0
// grk = 2...5944 -- http://www.bibleist.ru/tmp/lexicon.php?strongid=1&lang=2&maxcount=10
// <span class="lex_word_1">בּרא‎</span>
// <span class="lex_word_2">α, ἄλφα</span>
function get_word($num, $lang = 1)
{
    $matches = array();
    $s = file_get_contents("http://www.bibleist.ru/tmp/lexicon.php?strongid={$num}&lang={$lang}&maxcount=10");
    //$s = "<span class=\"lex_strong\">1 &#x2014; </span> <span class=\"lex_word_1\">אָב‎</span>
    //<p>отец, праотец, (родо)начальник, предок.</p>";
    $p1 = strpos($s, "<span class=\"lex_word_{$lang}\">");
    $s = substr($s, $p1 + strlen("<span class=\"lex_word_{$lang}\">"));
    $p2 = strpos($s, "</span>");
    $word = substr($s, 0, $p2);
    $p3 = strpos($s, "<input");
    $s = substr($s, 0, $p3);
    $text = substr($s, $p2 + strlen("</span>"));
    if (strlen($word)) {
        return "<h4>" . sprintf("%05d", $num) . "</h4>\r\n<b>{$num}, {$word}</b>\r\n" . $text . "\r\n\r\n";
    } else {
        return "";
    }
}
//echo get_word(2);
//echo get_word(120);
//echo get_word(8674);
//echo get_word(4, 2);
//echo get_word(120, 2);
//for($i=1; $i<= 8674; $i++) echo get_word($i);
for ($i = 1; $i <= 5624; $i++) {
    echo get_word($i, 2);
}
Пример #8
0
<?php

require dirname(__FILE__) . "/" . "global.php";
if (!$lfjuid) {
    showerr("ÇëÏȵǼ");
}
if ($act == 'del') {
    $db->query("DELETE FROM {$pre}moneylog WHERE uid='{$lfjuid}' AND id='{$id}'");
}
$rows = 20;
if (!$page) {
    $page = 1;
}
$min = ($page - 1) * $rows;
$showpage = getpage("{$pre}moneylog", "WHERE uid='{$lfjuid}'", "?job={$job}");
$query = $db->query("SELECT * FROM `{$pre}moneylog` WHERE uid='{$lfjuid}' ORDER BY id DESC LIMIT {$min},{$rows}");
while ($rs = $db->fetch_array($query)) {
    $rs[title] = get_word($rs[about], 250);
    if ($rs[money] > 0) {
        $rs[money] = "<font color=red>{$rs['money']}</font>";
    }
    $rs[posttime] = date("Y-m-d H:i", $rs[posttime]);
    $listdb[] = $rs;
}
$lfjdb[money] = get_money($lfjuid);
require dirname(__FILE__) . "/" . "head.php";
require dirname(__FILE__) . "/" . "template/moneylog.htm";
require dirname(__FILE__) . "/" . "foot.php";
Пример #9
0
 public function collect()
 {
     $source = '';
     if (false === ($setting = F('uz800_setting'))) {
         $this->ajaxReturn(0, L('illegal_parameters'));
     }
     $p = $this->_get('p', 'intval', 1);
     $url = 'http://zhe800.uz.taobao.com/list.php?&tag_id=' . $setting['cid'] . '&page=' . $p;
     if ($p == 1) {
         $totalcoll = 0;
     } else {
         $totalcoll = F('totalcoll');
     }
     $coll = 0;
     $ftxia_https = new ftxia_https();
     $ftxia_https->fetch($url);
     $source = $ftxia_https->results;
     if (!$source) {
         $source = file_get_contents($url);
     }
     $source = rtrim(ltrim(trim($source), '('), ')');
     $source = iconv('GBK', 'UTF-8//IGNORE', $source);
     if (strpos($source, '对不起! 本分类下暂时没有淘宝限时特价商品!')) {
         $this->ajaxReturn(0, '该类目暂时没有特价商品');
     }
     if (preg_match_all('/<div class="deal(.*?)<\\/div>/s', $source, $matchitem)) {
         for ($i = 0; $i < count($matchitem[1]); $i++) {
             $item = $matchitem[1][$i];
             $title = get_word($item, '<h2>', '<\\/h2>');
             $title = preg_replace("@<strong(.*?)<\\/strong>@is", "", $title);
             $title = preg_replace("/<a[^>]+>/", "", $title);
             $title = preg_replace("/<\\/a>/", "", $title);
             $img = get_word($item, '<img src="', '_290x290.jpg"', '\\/>');
             $url = get_word($item, '<p>', '<\\/p>');
             $url = preg_replace("@<img(.*?)\\/>@is", "", $url);
             preg_match("/id=(\\d*)/", $url, $num);
             $iid = isset($num[1]) ? $num[1] : '';
             $price = get_word($item, '<i>¥', '<\\/i>');
             $zkprice = get_word($item, '<\\/b>', '<em><\\/em><\\/em>');
             $intro = get_word($item, '<h6>', '<\\/h6>');
             $intro = preg_replace("@<em(.*?)<\\/em>@is", "", $intro);
             $intro = trim($intro);
             if (stripos($url, 'taobao.com') > 0) {
                 $shop_type = 'C';
             } else {
                 $shop_type = 'B';
             }
             $likes = rand(99, 9999);
             $ems = '1';
             $zkou = round($zkprice / $price * 10, 1);
             if (!defined(ENDTIME)) {
                 define('ENDTIME', '72');
             }
             if (!$times) {
                 $times = (int) (time() + ENDTIME * 3600);
             }
             $itemUrl = "http://hws.m.taobao.com/cache/wdetail/5.0/?id=" . $iid;
             $ch = curl_init();
             curl_setopt($ch, CURLOPT_URL, $itemUrl);
             curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
             curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
             curl_setopt($ch, CURLOPT_MAXREDIRS, 2);
             $contents = curl_exec($ch);
             curl_close($ch);
             if (!$contents) {
                 $contents = file_get_contents($itemUrl);
             }
             $comslist = json_decode($contents, true);
             $info = array();
             $tmp = json_decode($comslist['data']['apiStack'][0]['value'], true);
             $info['title'] = $comslist['data']['itemInfoModel']['title'];
             $info['volume'] = $tmp['data']['itemInfoModel']['totalSoldQuantity'];
             $info['pic_url'] = $comslist['data']['itemInfoModel']['picsPath'][0];
             $info['pic_url'] = str_replace("_320x320.jpg", "", $info['pic_url']);
             $info['sellerId'] = $comslist['data']['seller']['userNumId'];
             $info['nick'] = $comslist['data']['seller']['nick'];
             $title = $info['title'];
             $nick = $info['nick'];
             $img = $info['pic_url'];
             $sellerId = $info['sellerId'];
             $volume = $info['volume'];
             $tag_list = d("items")->get_tags_by_title($title);
             $tags = implode(" ", $tag_list);
             $itemarray['shop_type'] = $shop_type;
             $itemarray['title'] = $title;
             $itemarray['tags'] = $tags;
             $itemarray['pic_url'] = $img;
             $itemarray['num_iid'] = $iid;
             $itemarray['price'] = $price;
             $itemarray['coupon_price'] = $zkprice;
             $itemarray['volume'] = $volume;
             $itemarray['nick'] = $nick;
             $itemarray['sellerId'] = $sellerId;
             $itemarray['intro'] = $intro;
             $itemarray['ems'] = $ems;
             $itemarray['likes'] = $likes;
             $itemarray['cate_id'] = $setting['cate_id'];
             $itemarray['coupon_rate'] = $zkou * 1000;
             $itemarray['coupon_end_time'] = $times;
             $itemarray['coupon_start_time'] = time();
             if ($title && $img && $iid) {
                 $result['item_list'][] = $itemarray;
             }
         }
     }
     // exit(print_r($result));
     foreach ($result['item_list'] as $key => $val) {
         $res = $this->_ajax_tb_publish_insert($val);
         if ($res > 0) {
             $coll++;
         }
         $totalcoll++;
     }
     if (strpos($source, '<span class="page-next" title="下一页">')) {
         $this->ajaxReturn(0, '已经采集完成' . $p . '页,本次采集到' . $totalcoll . '件商品!请返回,谢谢');
     }
     F('totalcoll', $totalcoll);
     $this->assign('p', $p);
     $this->assign('coll', $coll);
     $this->assign('totalnum', $totalnum);
     $this->assign('totalcoll', $totalcoll);
     $resp = $this->fetch('collect');
     $this->ajaxReturn(1, '', $resp);
 }
Пример #10
0
        break;
    }
    $SQL = " LEFT JOIN {$_pre}sort S ON A.fid=S.fid WHERE S.fup='{$fid}' {$SQL} ";
} else {
    $_erp = $Fid_db['tableid'][$fid];
    $SQL = " WHERE A.fid='{$fid}' {$SQL} ";
}
$query = $db->query("SELECT SQL_CALC_FOUND_ROWS B.*,A.* FROM {$_pre}content{$_erp} A LEFT JOIN {$_pre}content_{$fidDB[mid]} B ON A.id=B.id {$SQL} ORDER BY {$sql_list} {$sql_order} LIMIT {$min},{$rows}");
$RS = $db->get_one("SELECT FOUND_ROWS()");
$totalNum = $RS['FOUND_ROWS()'];
$showpage = getpage("", "", "list.php?fid={$fid}", $rows, $totalNum);
while ($rs = $db->fetch_array($query)) {
    $rs[content] = @preg_replace('/<([^<]*)>/is', "", $rs[content]);
    //把HTML代码过滤掉
    $rs[content] = get_word($rs[full_content] = $rs[content], 100);
    $rs[title] = get_word($rs[full_title] = $rs[title], 50);
    if ($rs['list'] > $timestamp) {
        $rs[title] = " <font color='{$webdb['Info_TopColor']}'>{$rs['title']}</font> <img src='{$webdb['www_url']}/images/default/icotop.gif' border=0>";
    } elseif ($rs['list'] > $rs[posttime]) {
        //置顶过期的信息,需要恢复原来发布日期以方便排序,放在后面
        $db->query("UPDATE {$_pre}content{$_erp} SET list='{$rs['posttime']}' WHERE id='{$rs['id']}'");
    }
    $rs[posttime] = date("Y-m-d", $rs[full_time] = $rs[posttime]);
    if ($rs[picurl]) {
        $rs[picurl] = tempdir($rs[picurl]);
    }
    $Module_db->showfield($field_db, $rs, 'list');
    $rs[url] = get_info_url($rs[id], $rs[fid], $rs[city_id]);
    $listdb[] = $rs;
}
/**
Пример #11
0
    } else {
        showerr("还没通过审核");
    }
}
/**
*内容页的风格优先于栏目的风格,栏目的风格优先于系统的风格
**/
if ($rsdb[style]) {
    $STYLE = $rsdb[style];
} elseif ($fidDB[style]) {
    $STYLE = $fidDB[style];
}
//SEO
$titleDB[title] = filtrate(strip_tags("{$rsdb['title']} - {$city_DB[name][$city_id]}{$fidDB['name']} - {$webdb['Info_webname']}"));
$titleDB[keywords] = filtrate(strip_tags($rsdb[keywords]));
$titleDB[description] = filtrate(get_word(strip_tags($rsdb[content]), 200)) . filtrate(strip_tags("{$fidDB['metadescription']} {$webdb['Info_metadescription']}"));
/**
*栏目指定了哪些用户组才能看信息内容
**/
if ($fidDB[allowviewcontent]) {
    if (!$web_admin && !in_array($groupdb[gid], explode(",", $fidDB[allowviewcontent]))) {
        if (!$lfjid || !in_array($lfjid, explode(",", $fidDB[admin]))) {
            showerr("你所在用户组,无权浏览");
        }
    }
}
/**
*对信息内容字段的处理
**/
$Module_db->hidefield = true;
$Module_db->classidShowAll = true;
Пример #12
0
if (!$webdb[showNoPassComment]) {
    $SQL = " AND A.yz=1 ";
} else {
    $SQL = "";
}
$rows = $webdb[showCommentRows] ? $webdb[showCommentRows] : 8;
if ($page < 1) {
    $page = 1;
}
$min = ($page - 1) * $rows;
/*评论字数再多也只限制显示1000个字*/
$leng = 10000;
$query = $db->query("SELECT A.*,B.icon FROM `{$pre}special_comment` A LEFT JOIN {$pre}memberdata B ON A.uid=B.uid WHERE A.cid='{$cid}' {$SQL} ORDER BY A.cid DESC LIMIT {$min},{$rows}");
while ($rs = $db->fetch_array($query)) {
    if (!$rs[username]) {
        $detail = explode(".", $rs[ip]);
        $rs[username] = "{$detail['0']}.{$detail['1']}.{$detail['2']}.*";
    }
    if ($rs[icon]) {
        $rs[icon] = tempdir($rs[icon]);
    }
    $rs[posttime] = date("Y-m-d H:i:s", $rs[posttime]);
    $rs[content] = get_word($rs[full_content] = $rs[content], $leng);
    $rs[content] = str_replace("\n", "<br>", $rs[content]);
    $rs[content] = kill_badword($rs[content]);
    $rs[username] = kill_badword($rs[username]);
    $listdb[] = $rs;
}
$showpage = getpage("`{$pre}special_comment` A", " WHERE A.cid='{$cid}' {$SQL}", "?cid={$cid}", $rows);
$showpage = preg_replace("/\\?cid=([\\d]+)&page=([\\d]+)/is", "javascript:getcomment('{$webdb['www_url']}/do/special_comment_ajax.php?cid=\\1&page=\\2')", $showpage);
require_once html('special_comment_ajax');
Пример #13
0
        save_test();
    }
}
// scelgo i parametri della prova
$type = get_type();
// 1 = filler, 0 = test
if ($type == 1) {
    $class = get_classe();
    // 0 = non-word e non-word, 1 = word e non-word, 2 = non-word e word}
    $parolefiller = get_filler($class);
    // $parolefiller è un array (id_filler => parolaFiller ...)
}
$primePh1 = get_prime(1);
// TRUE se nella fase 1 avrò parola e dominante, FALSE se avrò parola e subordinato
$primePh2 = get_prime(2);
$word1 = get_word($type);
// words1 è un array (id_parola => parola, dominante => paroladominante, subordinata => parolasubordinata)
$word2 = get_linked_word($word1, $type);
// trovo la lista delle interpretazioni delle due parole collegate
$interpret1 = get_interpret($word1, 1);
//interpret sono array chiave=id_interpretazione e valore=interpretazione
$interpret2 = get_interpret($word2, 2);
?>





<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
Пример #14
0
$show = $SQL = '';
$rows > 50 && ($rows = 50);
$rows < 1 && ($rows = 10);
$leng < 1 && ($leng = 30);
if (!$webdb[Info_ShowNoYz]) {
    $SQL = " AND yz='1' ";
}
$query = $db->query("SELECT * FROM {$_pre}db WHERE city_id='{$city_id}' ORDER BY id DESC LIMIT {$rows}");
while ($rs = $db->fetch_array($query)) {
    $_erp = $Fid_db[tableid][$rs[fid]];
    $rs = $db->get_one("SELECT * FROM {$_pre}content{$_erp} WHERE id={$rs['id']} {$SQL}");
    if (!$rs[title]) {
        continue;
    }
    $rs[url] = get_info_url($rs[id], $rs[fid], $rs[city_id]);
    $rs[title] = get_word($rs[title], $leng);
    $show .= "<div>¡¤<a href='{$rs['url']}' target='_blank'>{$rs['title']}</a></div>";
}
if ($webdb[RewriteUrl] == 1) {
    //È«¾Öα¾²Ì¬
    rewrite_url($show);
}
$show = str_replace(array("\n", "\r", "'"), array("", "", "\\'"), $show);
if ($webdb[cookieDomain]) {
    echo "<SCRIPT LANGUAGE=\"JavaScript\">document.domain = \"{$webdb['cookieDomain']}\";</SCRIPT>";
}
echo "<SCRIPT LANGUAGE=\"JavaScript\">\nparent.document.getElementById('{$iframeID}').innerHTML='{$show}';\n</SCRIPT>";
if ($webdb[Info_index_cache] && time() - filemtime($Cache_FileName) > $webdb[Info_index_cache] * 60) {
    if (!is_dir(dirname($Cache_FileName))) {
        makepath(dirname($Cache_FileName));
    }
 public function collect()
 {
     $source = '';
     if (false === ($setting = F('advanced_setting'))) {
         $this->ajaxReturn(0, L('illegal_parameters'));
     }
     $p = $this->_get('p', 'intval', 1);
     if ($setting['times'] == 1) {
         $urs = 'tejiaListRec';
     } else {
         if ($setting['times'] == 2) {
             $urs = 'tomorrow_item_list';
         }
     }
     if (!$setting['pid']) {
         $url = 'http://tejia.taobao.com/' . $urs . '.htm?&promotionId=' . $setting['cid'] . '&p=' . $p;
     } else {
         $url = 'http://tejia.taobao.com/' . $urs . '.htm?&promotionId=' . $setting['pid'] . '&tagId=' . $setting['cid'] . '&p=' . $p;
     }
     if ($p == 1) {
         $totalcoll = 0;
     } else {
         $totalcoll = F('totalcoll');
     }
     $coll = 0;
     $source = Http::fsockopenDownload($url);
     if (!$source) {
         $source = file_get_contents($url);
     }
     $source = str_replace(array("&nbsp;", " ", " ", "\n"), "", $source);
     $source = iconv('GBK', 'UTF-8//IGNORE', $source);
     if (strpos($source, 'no-pro-box')) {
         $this->ajaxReturn(0, '该类目暂时没有特价商品');
     }
     if (strpos($source, 'result-non')) {
         $this->ajaxReturn(0, '该类目暂时没有特价商品');
     }
     $sources = get_word($source, 'class="filter-list-detail', '<\\/div>');
     if (preg_match_all('/<dl(.*?)<\\/dl>/s', $sources, $matchitem)) {
         for ($i = 0; $i < count($matchitem[1]); $i++) {
             $item = $matchitem[1][$i];
             $titlestr = get_word($item, '<ddclass="title">', '<\\/dd>');
             $title = get_word($titlestr, 'target="_blank">', '<\\/a>');
             $img = get_word($item, 'src="', '_210x210.jpg"');
             if (!$img) {
                 $img = get_word($item, 'data-ks-lazyload="', '_210x210.jpg"');
             }
             if (!strpos($img, 'ttp:')) {
                 $img = 'http:' . $img;
             }
             $iid = get_word($item, '\\?id=', '&f=');
             $price = get_word($item, '<del>', '<\\/del>');
             $zkprice = get_word($item, '<strong>', '<\\/strong>');
             $volume = get_word($item, '<em>', '<\\/em>');
             $nick = '';
             $ems = '1';
             $zekou = round($zkprice / $price, 4);
             if (date("G") < 10) {
                 $coupon_start_time = strtotime(date("Y-m-d H:i:s", mktime(10, 0, 0, date("m"), date("d"), date("Y"))));
                 $coupon_end_time = strtotime(date("Y-m-d H:i:s", mktime(23, 59, 59, date("m"), date("d"), date("Y"))));
             } else {
                 if ($setting['times'] == 2) {
                     $coupon_start_time = strtotime(date("Y-m-d H:i:s", mktime(10, 0, 0, date("m"), date("d") + 1, date("Y"))));
                     $coupon_end_time = strtotime(date("Y-m-d H:i:s", mktime(23, 59, 59, date("m"), date("d") + 1, date("Y"))));
                 } else {
                     $coupon_start_time = strtotime(date("Y-m-d H:i:s", mktime(10, 0, 0, date("m"), date("d"), date("Y"))));
                     $coupon_end_time = strtotime(date("Y-m-d H:i:s", mktime(23, 59, 59, date("m"), date("d"), date("Y"))));
                 }
             }
             $itemarray['shop_type'] = 'C';
             $itemarray['title'] = $title;
             $itemarray['pic_url'] = $img;
             $itemarray['num_iid'] = $iid;
             $itemarray['price'] = $price;
             $itemarray['coupon_price'] = $zkprice;
             $itemarray['volume'] = $volume;
             $itemarray['nick'] = $nick;
             $itemarray['ems'] = $ems;
             $itemarray['cate_id'] = $setting['cate_id'];
             $itemarray['coupon_rate'] = $zekou * 10000;
             $itemarray['coupon_start_time'] = $coupon_start_time;
             $itemarray['coupon_end_time'] = $coupon_end_time;
             if ($title && $img && $iid) {
                 $result['item_list'][] = $itemarray;
             }
         }
     }
     foreach ($result['item_list'] as $key => $val) {
         $res = $this->_ajax_tb_publish_insert($val);
         if ($res > 0) {
             $coll++;
         }
         $totalcoll++;
     }
     if (strpos($source, '<spanclass="page-next"')) {
         $this->ajaxReturn(0, '已经采集完成' . $p . '页,本次采集到' . $totalcoll . '件商品!请返回,谢谢');
     }
     F('totalcoll', $totalcoll);
     $this->assign('p', $p);
     $this->assign('coll', $coll);
     $this->assign('totalnum', $totalnum);
     $this->assign('totalcoll', $totalcoll);
     $resp = $this->fetch('collect');
     $this->ajaxReturn(1, '', $resp);
 }
Пример #16
0
 public function collect()
 {
     $source = '';
     if (false === ($setting = F('advanced_setting'))) {
         $this->ajaxReturn(0, L('illegal_parameters'));
     }
     $p = $this->_get('p', 'intval', 1);
     if (!$setting['pid']) {
         $url = 'http://te.tejia.taobao.com/tomorrow_item_list.htm?&promotionId=' . $setting['cid'] . '&p=' . $p . '#J_More';
     } else {
         $url = 'http://te.tejia.taobao.com/tomorrow_item_list.htm?&promotionId=' . $setting['pid'] . '&cid=' . $setting['cid'] . '&p=' . $p . '#J_More';
     }
     if ($p == 1) {
         $totalcoll = 0;
     } else {
         $totalcoll = F('totalcoll');
     }
     $coll = 0;
     $source = Http::fsockopenDownload($url);
     if (!$source) {
         $source = file_get_contents($url);
     }
     $source = rtrim(ltrim(trim($source), '('), ')');
     $source = iconv('GBK', 'UTF-8//IGNORE', $source);
     if (strpos($source, 'no-pro-box')) {
         $this->ajaxReturn(0, '该类目暂时没有特价商品');
     }
     $sources = get_word($source, '<div class="filter-list-detail"', '<!--page start-->');
     if (preg_match_all('/<li(.*?)<\\/li>/s', $sources, $matchitem)) {
         for ($i = 0; $i < count($matchitem[1]); $i++) {
             $item = $matchitem[1][$i];
             $titlehtml = get_word($item, '<dd class="title">', '<\\/dd>');
             $title = get_word($titlehtml, 'tejiaforenotice" target="_blank">', '<\\/a>');
             $img = get_word($item, 'src="', '_210x210.jpg');
             $iid = get_word($item, 'id=', '&');
             $price = get_word($item, '<dd><del>', '<\\/del>');
             $zkprice = get_word($item, '<dd><strong>', '<\\/strong>');
             $volume = 0;
             $nick = '';
             $ems = '1';
             $zekou = round($zkprice / $price, 4);
             if (date("G") < 9) {
                 $coupon_start_time = strtotime(date("Y-m-d H:i:s", mktime(10, 0, 0, date("m"), date("d"), date("Y"))));
                 $coupon_end_time = strtotime(date("Y-m-d H:i:s", mktime(23, 59, 59, date("m"), date("d"), date("Y"))));
             } else {
                 $coupon_start_time = strtotime(date("Y-m-d H:i:s", mktime(10, 0, 0, date("m"), date("d") + 1, date("Y"))));
                 $coupon_end_time = strtotime(date("Y-m-d H:i:s", mktime(8, 59, 59, date("m"), date("d") + 2, date("Y"))));
             }
             $itemarray['shop_type'] = 'C';
             $itemarray['title'] = $title;
             $itemarray['pic_url'] = $img;
             $itemarray['num_iid'] = $iid;
             $itemarray['price'] = $price;
             $itemarray['coupon_price'] = $zkprice;
             $itemarray['volume'] = $volume;
             $itemarray['nick'] = $nick;
             $itemarray['ems'] = $ems;
             $itemarray['cate_id'] = $setting['cate_id'];
             $itemarray['coupon_rate'] = $zekou * 10000;
             $itemarray['coupon_start_time'] = $coupon_start_time;
             $itemarray['coupon_end_time'] = $coupon_end_time;
             if ($title && $img && $iid) {
                 $result['item_list'][] = $itemarray;
             }
         }
     }
     foreach ($result['item_list'] as $key => $val) {
         $res = $this->_ajax_tb_publish_insert($val);
         if ($res > 0) {
             $coll++;
         }
         $totalcoll++;
     }
     if (strpos($source, '<span class="page-next"')) {
         $this->ajaxReturn(0, '已经采集完成' . $p . '页,本次采集到' . $totalcoll . '件商品!请返回,谢谢');
     }
     F('totalcoll', $totalcoll);
     $this->assign('p', $p);
     $this->assign('coll', $coll);
     $this->assign('totalnum', $totalnum);
     $this->assign('totalcoll', $totalcoll);
     $resp = $this->fetch('collect');
     $this->ajaxReturn(1, '', $resp);
 }
Пример #17
0
function label_set_rs($format, $rs)
{
    global $db, $pre, $timestamp, $webdb, $TB_url;
    //分类的话,对于分表的情况,要特别处理,不支持其它频道调用,会出错
    if ($format[SYS] == 'fenlei' && !$rs[posttime]) {
        global $Fid_db;
        $_erp = $Fid_db[tableid][$rs[fid]];
        $rs = $db->get_one("SELECT * FROM {$pre}{$format[wninfo]}content{$_erp} WHERE id='{$rs['id']}' ");
    }
    //读取自定义字段的表,方便调用,如果声明了noReadMid就不要读了
    if ($format[wninfo] && $rs[mid] && !$format[noReadMid]) {
        $_rss = $db->get_one("SELECT * FROM {$pre}{$format[wninfo]}content_{$rs[mid]} WHERE id='{$rs['id']}' ");
        $_rss && ($rs = $rs + $_rss);
        //文章要读取自定义字段的表,方便调用
    } elseif ($format[SYS] == 'artcile' && $rs[mid]) {
        $_rss = $db->get_one("SELECT * FROM {$pre}article_content_{$rs[mid]} WHERE aid='{$rs['aid']}' ");
        $_rss && ($rs = $rs + $_rss);
    }
    //扩展接口,少用
    if ($format[eval_code]) {
        eval($format[eval_code]);
    }
    //附件处理
    if ($format[SYS] == 'pwbbs') {
        //隐藏或出售贴
        if ($ifhide || strstr($rs[content], '[sell=')) {
            $rs[content] = '******';
        }
        $rs[content] = preg_replace("/\\[([^\\]]+)\\]/is", "", $rs[content]);
        global $db_attachname;
        $rs[picurl] = '';
        if ($rs[attachurl]) {
            //兼容旧版与非主题有图片的.
            if (is_file(ROOT_PATH . "{$webdb['passport_path']}/{$db_attachname}/thumb/{$rs['attachurl']}")) {
                $rs[picurl] = "{$webdb['passport_url']}/{$db_attachname}/thumb/{$rs['attachurl']}";
            } else {
                $rs[picurl] = "{$webdb['passport_url']}/{$db_attachname}/{$rs['attachurl']}";
            }
        }
        $dfont = explode("~", $rs[titlefont]);
        $rs[titlecolor] = $dfont[0];
    } elseif ($format[SYS] == 'dzbbs') {
        $rs[content] = preg_replace("/\\[([^\\]]+)\\]/is", "", $rs[content]);
        global $_DCACHE;
        $rs[picurl] = '';
        $rs[attachment] && ($rs[picurl] = "{$webdb['passport_url']}/{$_DCACHE[settings][attachurl]}/{$rs['attachment']}");
    }
    $rs[full_time] = $rs[posttime];
    $rs[full_title] = $rs[title];
    //内容
    $rs[description] && ($rs[content] = $rs[description]);
    $rs[content] = preg_replace('/<([^<]*)>/is', "", $rs[content]);
    //把HTML代码过滤掉
    $rs[content] = preg_replace('/ | |&nbsp;/is', "", $rs[content]);
    //把多余的空格去除掉
    $rs[full_content] = $rs[content];
    $rs[content] = get_word($rs[content], $format[content_num]);
    //标题样式
    $rs[fontweight] = $rs[fontcolor] = '';
    $rs[fonttype] == 1 && ($rs[fontweight] = 'font-weight:bold;');
    $rs[titlecolor] && ($rs[fontcolor] = "color:{$rs['titlecolor']};");
    //标题
    $rs[smalltitle] && ($rs[title] = $rs[smalltitle]);
    //如果有简短标题的话,就使用简短标题
    $rs[title] = preg_replace('/<([^<]*)>/is', "", $rs[title]);
    $rs[title] = get_word($rs[title], $format[titlenum], $format[titleflood]);
    if (!$format[timeformat]) {
        $format[timeformat] = "Y/m/d";
    }
    $rs[posttime] = date($format[timeformat], $rs[posttime]);
    if ($rs[picurl]) {
        $rs[picurl] = filtrate($rs[picurl]);
        $rs[picurl] = tempdir($rs[picurl]);
        //4:3的图
        $rs[picurl2] = "{$rs['picurl']}.jpg";
        //3:4的图
        $rs[picurl3] = "{$rs['picurl']}.jpg.jpg";
        //1:1的图
    } else {
        $rs[picurl2] = $rs[picurl3] = "";
    }
    //最新文章
    if ($timestamp - $rs[full_time] < $format[newhour] * 3600) {
        $rs['new'] = "<img src='{$webdb['www_url']}/images/default/new.gif' border=0>";
    } else {
        $rs['new'] = "";
    }
    //热门文章
    if ($format[hothits] && $rs[hits] > $format[hothits]) {
        $rs[hot] = "<img src='{$webdb['www_url']}/images/default/hot.gif' border=0>";
    } else {
        $rs[hot] = "";
    }
    //V6以前的版本需要用到
    if ($format[SYS] == 'artcile') {
        $rs[id] = $rs[aid];
    }
    //主要是针对$url,$listurl这两个地址得到其真实网址
    $detail = make_ture_path($format, $rs);
    $rs[tpl_1code] = $detail[tpl_1code];
    $rs[showurl] = $detail[showurl];
    //主要针对幻灯片
    $detail[urlDB] && ($rs[urlDB] = $detail[urlDB]);
    //针对标签里的PHP逻辑,对自定义URL要做处理
    $rs[tpl_2code] = $detail[tpl_2code];
    //不一定都存在的
    $rs[dirid] = floor($rs[id] / 1000);
    $rs[time_Y] = date("Y", $rs[full_time]);
    $rs[time_W] = date("W", $rs[full_time]);
    $rs[time_y] = date("y", $rs[full_time]);
    $rs[time_m] = date("m", $rs[full_time]);
    $rs[time_d] = date("d", $rs[full_time]);
    $rs[time_H] = date("H", $rs[full_time]);
    $rs[time_i] = date("i", $rs[full_time]);
    $rs[time_s] = date("s", $rs[full_time]);
    return $rs;
}
Пример #18
0
 public function collect()
 {
     $source = '';
     if (false === ($setting = F('advanced_setting'))) {
         $this->ajaxReturn(0, L('illegal_parameters'));
     }
     $p = $this->_get('p', 'intval', 1);
     if (!$setting['pid']) {
         $url = 'http://te.tejia.taobao.com/tomorrow_item_list.htm?&promotionId=' . $setting['cid'] . '&p=' . $p . '#J_More';
     } else {
         $url = 'http://te.tejia.taobao.com/tomorrow_item_list.htm?&promotionId=' . $setting['pid'] . '&cid=' . $setting['cid'] . '&p=' . $p . '#J_More';
     }
     if ($p == 1) {
         $totalcoll = 0;
     } else {
         $totalcoll = F('totalcoll');
     }
     $coll = 0;
     $ftxia_https = new ftxia_https();
     $ftxia_https->fetch($url);
     $source = $ftxia_https->results;
     if (!$source) {
         $source = file_get_contents($url);
     }
     $source = rtrim(ltrim(trim($source), '('), ')');
     $source = iconv('GBK', 'UTF-8//IGNORE', $source);
     if (strpos($source, 'result-non-bd')) {
         $this->ajaxReturn(0, '该类目暂时没有特价商品');
     }
     if (preg_match_all('/<dl>(.*?)<\\/dl>/s', $source, $matchitem)) {
         for ($i = 0; $i < count($matchitem[1]); $i++) {
             $item = $matchitem[1][$i];
             $title = get_word($item, 'target="_blank">', '<\\/a><\\/dd>');
             $img = get_word($item, '<img src="', '_210x210.jpg"', ' width="210" height="210"');
             $iid = get_word($item, 'id=', '&f=');
             $price = get_word($item, '<del>', '<\\/del>');
             $zkprice = get_word($item, '<strong>', '<\\/strong>');
             $volume = rand(9, 679);
             $likes = rand(99, 9999);
             $nick = '';
             $ems = '1';
             $zekou = round($zkprice / $price, 4);
             if (date("G") < 10) {
                 $coupon_start_time = strtotime(date("Y-m-d H:i:s", mktime(10, 0, 0, date("m"), date("d"), date("Y"))));
                 $coupon_end_time = strtotime(date("Y-m-d H:i:s", mktime(23, 59, 59, date("m"), date("d"), date("Y"))));
             } else {
                 $coupon_start_time = strtotime(date("Y-m-d H:i:s", mktime(10, 0, 0, date("m"), date("d") + 1, date("Y"))));
                 $coupon_end_time = strtotime(date("Y-m-d H:i:s", mktime(23, 59, 59, date("m"), date("d") + 1, date("Y"))));
             }
             $tag_list = d("items")->get_tags_by_title($title);
             $tags = implode(" ", $tag_list);
             $itemarray['shop_type'] = 'C';
             $itemarray['title'] = $title;
             $itemarray['tags'] = $tags;
             $itemarray['intro'] = '原价:' . $price . '元,折扣后价格:' . $zkprice . '元,' . $likes . '人觉得不错,目前已有' . $volume . '人参与抢购。';
             $itemarray['pic_url'] = $img;
             $itemarray['num_iid'] = $iid;
             $itemarray['price'] = $price;
             $itemarray['coupon_price'] = $zkprice;
             $itemarray['volume'] = $volume;
             $itemarray['nick'] = $nick;
             $itemarray['ems'] = $ems;
             $itemarray['likes'] = $likes;
             $itemarray['cate_id'] = $setting['cate_id'];
             $itemarray['coupon_rate'] = $zekou * 10000;
             $itemarray['coupon_start_time'] = $coupon_start_time;
             $itemarray['coupon_end_time'] = $coupon_end_time;
             if ($title && $img && $iid) {
                 $result['item_list'][] = $itemarray;
             }
         }
     }
     // exit(print_r($result));
     foreach ($result['item_list'] as $key => $val) {
         $res = $this->_ajax_tb_publish_insert($val);
         if ($res > 0) {
             $coll++;
         }
         $totalcoll++;
     }
     if (strpos($source, '<span class="page-next" title="下一页">')) {
         $this->ajaxReturn(0, '已经采集完成' . $p . '页,本次采集到' . $totalcoll . '件商品!请返回,谢谢');
     }
     F('totalcoll', $totalcoll);
     $this->assign('p', $p);
     $this->assign('coll', $coll);
     $this->assign('totalnum', $totalnum);
     $this->assign('totalcoll', $totalcoll);
     $resp = $this->fetch('collect');
     $this->ajaxReturn(1, '', $resp);
 }
Пример #19
0
//突出显示关键字
$IS_BIZ && AvoidGather();
//防采集处理
$rsdb[posttime] = date("Y-m-d H:i:s", $rsdb[posttime]);
if ($rsdb[copyfromurl] && !strstr($rsdb[copyfromurl], "http://")) {
    $rsdb[copyfromurl] = "http://{$rsdb['copyfromurl']}";
}
//文章分布
$showpage = getpage("", "", "bencandy.php?fid={$fid}&aid={$aid}", 1, $rsdb[pages]);
/**
*上一篇与下一篇,比较影响速度
**/
$nextdb = $db->get_one("SELECT title,aid,fid FROM {$pre}article{$erp} WHERE aid<'{$id}' AND fid='{$fid}' AND yz=1 ORDER BY aid DESC LIMIT 1");
$nextdb[subject] = get_word($nextdb[title], 34);
$backdb = $db->get_one("SELECT title,aid,fid FROM {$pre}article{$erp} WHERE aid>'{$id}' AND fid='{$fid}' AND yz=1 ORDER BY aid ASC LIMIT 1");
$backdb[subject] = get_word($backdb[title], 34);
/**
*为获取标签参数
**/
if ($rsdb[mid] && file_exists(html("bencandy_{$rsdb['mid']}", $main_tpl))) {
    $chdb[main_tpl] = html("bencandy_{$rsdb['mid']}", $main_tpl);
} else {
    $chdb[main_tpl] = html("bencandy", $main_tpl);
}
/**
*标签
**/
$ch_fid = intval($fidDB[config][label_bencandy]);
//是否定义了栏目专用标签
$ch_pagetype = 3;
//2,为list页,3,为bencandy页
Пример #20
0
 public function collect()
 {
     $source = '';
     if (false === ($setting = F('tejia_setting'))) {
         $this->ajaxReturn(0, L('illegal_parameters'));
     }
     $p = $this->_get('p', 'intval', 1);
     if (!$setting['pid']) {
         $url = 'http://te.tejia.taobao.com/tejia_list.htm?&promotionId=' . $setting['cid'] . '&p=' . $p . '#J_More';
     } else {
         $url = 'http://te.tejia.taobao.com/tejia_list.htm?&promotionId=' . $setting['pid'] . '&cid=' . $setting['cid'] . '&p=' . $p . '#J_More';
     }
     if ($p == 1) {
         $totalcoll = 0;
     } else {
         $totalcoll = F('totalcoll');
     }
     $coll = 0;
     $ftxia_https = new ftxia_https();
     $ftxia_https->fetch($url);
     $source = $ftxia_https->results;
     if (!$source) {
         $source = file_get_contents($url);
     }
     $source = rtrim(ltrim(trim($source), '('), ')');
     $source = iconv('GBK', 'UTF-8//IGNORE', $source);
     if (strpos($source, 'result-non-bd')) {
         $this->ajaxReturn(0, '该类目暂时没有特价商品');
     }
     if (preg_match_all('/<li class="par-item(.*?)<\\/li>/s', $source, $matchitem)) {
         for ($i = 0; $i < count($matchitem[1]); $i++) {
             $item = $matchitem[1][$i];
             $title = get_word($item, '<dd class="title">', '<\\/dd>');
             $title = preg_replace("/<a[^>]*href=[^>]*>|<\\/[^a]*a[^>]*>/i", "", $title);
             $img = get_word($item, '<img data-ks-lazyload="', '_210x210.jpg"', ' width="210" height="210"');
             $url = get_word($item, '<dd class="title"><a href="', '&f=tejialist"', 'target="_blank">');
             preg_match("/id=(\\d*)/", $url, $num);
             $iid = isset($num[1]) ? $num[1] : '';
             $price = get_word($item, '<del>', '<\\/del>');
             $zkprice = get_word($item, '<strong>', '<\\/strong>');
             $volume = rand(9, 679);
             $likes = rand(99, 9999);
             $nick = '';
             $ems = '1';
             $zekou = get_word($item, '<span class="discount">', '折');
             if (!defined(ENDTIME)) {
                 define('ENDTIME', '24');
             }
             if (!$times) {
                 $times = (int) (time() + ENDTIME * 3600);
             }
             $tag_list = d("items")->get_tags_by_title($title);
             $tags = implode(" ", $tag_list);
             $itemarray['shop_type'] = 'C';
             $itemarray['title'] = '' . $title;
             $itemarray['tags'] = $tags;
             $itemarray['intro'] = '原价:' . $price . '元,折扣后价格:' . $zkprice . '元,' . $likes . '人觉得不错,目前已有' . $volume . '人参与抢购。';
             $itemarray['pic_url'] = $img;
             $itemarray['num_iid'] = $iid;
             $itemarray['price'] = $price;
             $itemarray['coupon_price'] = $zkprice;
             $itemarray['volume'] = $volume;
             $itemarray['nick'] = $nick;
             $itemarray['ems'] = $ems;
             $itemarray['likes'] = $likes;
             $itemarray['cate_id'] = $setting['cate_id'];
             $itemarray['coupon_rate'] = $zekou * 1000;
             $itemarray['coupon_end_time'] = $times;
             $itemarray['coupon_start_time'] = time();
             if ($title && $img && $iid) {
                 $result['item_list'][] = $itemarray;
             }
         }
     }
     // exit(print_r($result));
     foreach ($result['item_list'] as $key => $val) {
         $res = $this->_ajax_tb_publish_insert($val);
         if ($res > 0) {
             $coll++;
         }
         $totalcoll++;
     }
     if (strpos($source, '<span class="page-next" title="下一页">')) {
         $this->ajaxReturn(0, '已经采集完成' . $p . '页,本次采集到' . $totalcoll . '件商品!请返回,谢谢');
     }
     F('totalcoll', $totalcoll);
     $this->assign('p', $p);
     $this->assign('coll', $coll);
     $this->assign('totalnum', $totalnum);
     $this->assign('totalcoll', $totalcoll);
     $resp = $this->fetch('collect');
     $this->ajaxReturn(1, '', $resp);
 }
Пример #21
0
 public function panel()
 {
     $api_config = M('items_site')->where(array('code' => 'ftxia'))->getField('config');
     $ftx_appkey = unserialize($api_config);
     $message = array();
     if (is_dir('./install')) {
         $message[] = array('type' => 'Focus', 'content' => "您还没有删除 install 文件夹,出于安全的考虑,我们建议您删除 install 文件夹。");
     }
     if (APP_DEBUG == true) {
         $message[] = array('type' => 'Focus', 'content' => "您网站的 DEBUG 没有关闭,出于安全考虑,我们建议您关闭程序 DEBUG。 <a href='http://bbs.8mob.com/forum.php?mod=viewthread&tid=1291' target='_blank'>点此看教程</a>");
     }
     if (!function_exists("curl_getinfo")) {
         $message[] = array('type' => 'Error', 'content' => "系统不支持 CURL ,将无法采集商品数据。 <a href='http://bbs.8mob.com/forum.php?mod=viewthread&tid=4925' target='_blank'>点此看教程</a>");
     }
     if (!$ftx_appkey['app_key']) {
         $message[] = array('type' => 'Error', 'content' => "请设置您的 飞天侠开放平台 APPKEY!<a href='http://bbs.8mob.com/forum.php?mod=viewthread&tid=2871' target='_blank'>点此申请APPKEY</a>");
     }
     if (!C('ftx_meilishuo_id')) {
         $message[] = array('type' => 'Error', 'content' => "请设置您的 美丽说联盟ID!<a href='http://bbs.8mob.com/forum.php?mod=viewthread&tid=5692' target='_blank'>点此查看申请教程</a>");
     }
     if (!class_exists("ZipArchive")) {
         $message[] = array('type' => 'Error', 'content' => "请开启支持在线更新相关类:php.ini中 php_zip.dll扩展 <a href='http://bbs.8mob.com/forum.php?mod=viewthread&tid=4924' target='_blank'>点此看教程</a>");
     }
     if (C('ftx_taojindian_html')) {
         $taodianjin = C('ftx_taojindian_html');
         if (strpos($taodianjin, 'text/javascript')) {
             $pid = get_word($taodianjin, 'pid: "', '"');
             if (!$pid) {
                 $message[] = array('type' => 'Error', 'content' => "请设置您的 淘点金代码 !<a href='http://bbs.8mob.com/forum.php?mod=viewthread&tid=3125' target='_blank'>点此查看申请教程</a>");
             }
         }
     } else {
         $message[] = array('type' => 'Error', 'content' => "请设置您的 淘点金代码 !<a href='http://bbs.8mob.com/forum.php?mod=viewthread&tid=3125' target='_blank'>点此查看申请教程</a>");
     }
     $this->assign('message', $message);
     $system_info = array('ftxia_version' => FTX_VERSION . ' RELEASE ' . FTX_RELEASE . ' ', 'server_domain' => $_SERVER['SERVER_NAME'] . ' [ ' . gethostbyname($_SERVER['SERVER_NAME']) . ' ]', 'server_os' => PHP_OS, 'web_server' => $_SERVER["SERVER_SOFTWARE"], 'php_version' => PHP_VERSION, 'mysql_version' => mysql_get_server_info(), 'upload_max_filesize' => ini_get('upload_max_filesize'), 'max_execution_time' => ini_get('max_execution_time') . '秒', 'safe_mode' => (bool) ini_get('safe_mode') ? 'onCorrect' : 'onError', 'zlib' => function_exists('gzclose') ? 'onCorrect' : 'onError', 'zip' => class_exists('ZipArchive') ? 'onCorrect' : 'onError', 'curl' => function_exists("curl_getinfo") ? 'onCorrect' : 'onError', 'timezone' => function_exists("date_default_timezone_get") ? date_default_timezone_get() : L('no'));
     $this->assign('system_info', $system_info);
     $tips_pars = array('action' => 'not' . 'ice', 'sitename' => 'ftxia', 'siteurl' => $_SERVER['SERVER_NAME'], 'version' => FTX_VERSION, 'release' => FTX_RELEASE);
     $tips_str = base64_decode('PGRpdiBpZD0iZnR4aWFfbm90aWNlIj48L2Rpdj48c2NyaXB0IHR5cGU9InRleHQvamF2YXNjcmlwdCIgc3JjPSJodHRwOi8vYmJzLjhtb2IuY29tL3BsdWdpbi5waHA/aWQ9ZnR4aWE6Z2V0dmlwJntwYXJzfSI+PC9zY3JpcHQ+');
     $tips_data = str_replace('{pars}', http_build_query($tips_pars), $tips_str);
     $this->assign('tips_data', $tips_data);
     $my_admin = array('username' => $_SESSION['admin']['username'], 'roleid' => $_SESSION['admin']['role_id'], 'rolename' => $_SESSION['admin']['role_name']);
     $item_total = $this->_item_mod->count();
     $this->assign('item_total', $item_total);
     $item_today = $this->_item_mod->where(array('astime' => date("Ymd")))->count();
     $this->assign('item_today', $item_today);
     $comwhere['commission'] = array('egt', 0);
     $item_commissioon = $this->_item_mod->where($comwhere)->count();
     $this->assign('item_commissioon', $item_commissioon);
     $endwhere['coupon_end_time'] = array('lt', time());
     $item_endtime = $this->_item_mod->where($endwhere)->count();
     $this->assign('item_endtime', $item_endtime);
     $user_total = $this->_user_mod->count();
     $this->assign('user_total', $user_total);
     $regwhere['reg_time'] = array('egt', strtotime(date("Y-m-d")));
     $user_today = $this->_user_mod->where($regwhere)->count();
     $this->assign('user_today', $user_today);
     $online_total = $this->_online_mod->count();
     $this->assign('online_total', $online_total);
     $onlinewhere['uid'] = array('gt', 0);
     $user_online = $this->_online_mod->where($onlinewhere)->count();
     $this->assign('user_online', $user_online);
     if ($online_total > $user_online) {
         $line_total = $online_total - $user_online;
         $this->assign('line_total', $line_total);
     }
     $this->assign('my_admin', $my_admin);
     $this->assign('time', date('Y-m-d H:i'));
     $this->assign('ip', get_client_ip());
     $this->display();
 }
 public function get_desc($iid)
 {
     $res = $this->http("http://zaoshi.uz.taobao.com/api/get_tb.php?num_iid=" . $iid);
     $res = iconv('GBK', 'UTF-8//IGNORE', $res);
     if (isset($res)) {
         $ress = json_decode($res, true);
         if ($ress['tmall'] == 1) {
             $deschtml = $this->http("http://www.laicaiji.com/index.php?s=/admin/public/desc/tmall/b/id/" . $iid);
         } else {
             $deschtml = $this->http("http://www.laicaiji.com/index.php?s=/admin/public/desc/id/" . $iid);
         }
         if ($deschtml) {
             return $deschtml;
         }
     }
     if (isset($res)) {
         $ress = json_decode($res, true);
         if ($ress['tmall'] == 1) {
             $itemurl = "http://detail.m.tmall.com/item.htm?id=" . $iid;
         } else {
             //http://a.m.taobao.com/i43903166984.htm?spm=0.0.0.0&sid=b785427eb8720980&abtest=17&rn=bd4f5c28284d745b2ad6f81139674884
             $itemurl = "http://hws.m.taobao.com/cache/mtop.wdetail.getItemDescx/4.1/?data=%7B%22item_num_id%22%3A%22" . $iid . "%22%7D";
             $itemhtml = $this->http($itemurl);
             $result = json_decode($itemhtml, true);
             $pics = $result['data']['pages'][0];
             if ($pics) {
                 $pics = str_replace("<img>", "<img class=ftxia src=", $pics);
                 $pics = str_replace("</img>", " />", $pics);
                 return $pics;
             }
         }
     } else {
         $itemurl = "http://detail.m.tmall.com/item.htm?id=" . $iid;
     }
     $itemhtml = $this->http($itemurl);
     $itemhtml = iconv('GBK', 'UTF-8//IGNORE', $itemhtml);
     $descUrl = get_word($itemhtml, 'descUrl":"', '"');
     if (!$descUrl) {
         $descUrl = get_word($itemhtml, 'apiItemDesc":"', '"');
     }
     if ($descUrl) {
         $deschtml = $this->http($descUrl);
         $deschtml = iconv('GBK', 'UTF-8//IGNORE', $deschtml);
         $deschtml = str_replace("';", " ", $deschtml);
         $deschtml = str_replace("var desc='", " ", $deschtml);
         $deschtml = str_replace("\\", " ", $deschtml);
         $deschtml = str_replace('href="http://item.taobao.com/item.htm', '><ftxiacom', $deschtml);
         $deschtml = str_replace('href="http://detail.tmall.com/item.htm', '><ftxiacom', $deschtml);
         $pat = "/<(\\/?)(script|i?frame|style|html|body|title|link|a|meta|\\?|\\%)([^>]*?)>/isU";
         $deschtml = preg_replace($pat, "", $deschtml);
         $deschtml = str_replace('width: 0;', ' ', $deschtml);
         $deschtml = str_replace('height: 0;', ' ', $deschtml);
         return $deschtml;
     }
     return '';
 }
Пример #23
0
$query = $db->query("SELECT A.*,B.icon FROM `{$_pre}comments` A LEFT JOIN {$pre}memberdata B ON A.uid=B.uid WHERE A.id={$id} {$SQL} ORDER BY A.cid DESC LIMIT {$min},{$rows}");
while ($rs = $db->fetch_array($query)) {
    if (!$rs[username]) {
        $detail = explode(".", $rs[ip]);
        $rs[username] = "{$detail['0']}.{$detail['1']}.{$detail['2']}.*";
    }
    if ($rs[icon]) {
        $rs[icon] = tempdir($rs[icon]);
    }
    $rs[posttime] = date("Y-m-d H:i:s", $rs[posttime]);
    $rs[full_content] = $rs[content];
    $rs[content] = kill_badword($rs[content]);
    $rs[username] = kill_badword($rs[username]);
    $rs[title] = preg_replace("/\\[quote\\](.*)\\[\\/quote\\]/", "", $rs[content]);
    $rs[title] = get_word($rs[title], 50);
    $rs[content] = get_word($rs[content], $leng);
    $rs[content] = preg_replace("/\\[quote\\](.*)\\[\\/quote\\]/", "<div class='quotecomment_div'>\\1</div>", $rs[content]);
    $rs[content] = str_replace("\n", "<br>", $rs[content]);
    if ($lfjuid) {
        if ($lfjuid === $rs[cuid] || $web_admin || $lfjuid === $rs[uid] || in_array($lfjid, explode(",", $rsdb[admin]))) {
            $rs[ifadmin] = 1;
        } else {
            $rs[ifadmin] = 0;
        }
    } else {
        $rs[ifadmin] = 0;
    }
    $listdb[] = $rs;
}
/**
*评论分页功能
Пример #24
0
<?php

# MetInfo Enterprise Content Management System
# Copyright (C) MetInfo Co.,Ltd (http://www.metinfo.cn). All rights reserved.
$met_weburls = explode('/', $met_weburl);
$url_now = $_SERVER['SERVER_NAME'] ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST'];
$domain = $met_weburl;
if ($url_now != $met_weburls[2]) {
    $domain = str_replace($met_weburls[2], $url_now, $met_weburl);
}
$sidebarcolumn = $db->get_all("select * from {$met_admin_column} order by type desc,list_order");
foreach ($sidebarcolumn as $key => $val) {
    $val['name'] = get_word($val['name']);
    if (($val[name] == 'lang_indexcode' || $val[name] == 'lang_indexebook' || $val[name] == 'lang_indexbbs' || $val[name] == 'lang_indexskinset') && $met_agents_type > 1) {
        continue;
    }
    if (($val[name] == 'lang_webnanny' || $val[name] == 'lang_smsfuc') && $met_agents_sms == 0) {
        continue;
    }
    if ($val[name] == 'lang_dlapptips2' && $met_agents_app == 0) {
        continue;
    }
    if (strstr($val['name'], "lang_")) {
        if (strstr($val['name'], "|lang_")) {
            $linshi = '';
            $linshi = explode('|', $val['name']);
            $val['name'] = ${$linshi}[0] . ${$linshi}[1];
        } else {
            $val['name'] = ${$val}['name'];
        }
    }
Пример #25
0
    jump("修改成功", $FROMURL);
} elseif ($job == "list" && $Apower[comment_list]) {
    !$page && ($page = 1);
    $rows = 20;
    $min = ($page - 1) * $rows;
    $SQL = " WHERE 1 ";
    if ($aid) {
        $SQL .= " AND aid='{$aid}' ";
    }
    if ($type == 'noyz') {
        $SQL .= " AND yz='0' ";
    }
    $showpage = getpage("{$pre}comment", "{$SQL}", "index.php?lfj={$lfj}&job={$job}&aid={$aid}", "{$rows}");
    $query = $db->query(" SELECT * FROM {$pre}comment {$SQL} ORDER BY cid DESC LIMIT {$min},{$rows} ");
    while ($rs = $db->fetch_array($query)) {
        $rs[content] = filtrate(get_word($rs[content], 60));
        $rs[posttime] = date("Y-m-d", $rs[posttime]);
        $rs[username] = $rs[username] ? $rs[username] : $rs[ip];
        if ($rs[yz] == 1) {
            $rs[yz] = "<A HREF='index.php?lfj=comment&action=list&jobs=unyz&ciddb[{$rs[cid]}]={$rs['cid']}' style='color:blue;' title='已通过审核,点击取消审核'><img src='../member/images/check_yes.gif'></A>";
        } elseif ($rs[yz] == 0) {
            $rs[yz] = "<A HREF='index.php?lfj=comment&action=list&jobs=yz&ciddb[{$rs[cid]}]={$rs['cid']}' style='color:red;' title='还没通过审核,点击通过审核'><img src='../member/images/check_no.gif'></A>";
        }
        if ($rs[ifcom] == 1) {
            $rs[com] = "<A HREF='index.php?lfj=comment&action=list&jobs=uncom&ciddb[{$rs[cid]}]={$rs['cid']}' style='color:red;' title='已推荐为精华,点击可取消精华'><img src='../images/default/good_ico.gif'></A>";
        } elseif ($rs[ifcom] == 0) {
            $rs[com] = "<A HREF='index.php?lfj=comment&action=list&jobs=com&ciddb[{$rs[cid]}]={$rs['cid']}' title='非精华,点击可推荐为精华'><img src='../member/images/nogood_ico.gif'></A>";
        }
        $listdb[] = $rs;
    }
    require dirname(__FILE__) . "/" . "head.php";
Пример #26
0
 public function taobao_collect($date, $p)
 {
     M('robots')->where(array('id' => $date['id']))->save(array('last_page' => $p, 'last_time' => time()));
     $s = ($p - 1) * 44;
     $q = '';
     $tp = F('tp');
     if ($p > 1) {
         if ($p > $tp) {
             $this->ajaxReturn(0, '已经采集完成' . $tp . '页!请返回,谢谢');
         }
     }
     if ($p == 1) {
         $totalcoll = 0;
     } else {
         $totalcoll = F('totalcoll');
     }
     if ($date['tb_cid']) {
         $q .= '&cat=' . $date['tb_cid'];
     }
     if ($date['keyword']) {
         $q .= '&q=' . $date['keyword'];
     }
     if ($date['shop_type'] == 'B') {
         $q .= '&tab=mall';
     } else {
         $q .= '&tab=all';
     }
     if ($date['start_coupon_rate'] && $date['end_coupon_rate'] && $date['start_coupon_rate'] < $date['end_coupon_rate']) {
         $q .= '&zk_rate=%5B' . $date['start_coupon_rate'] . '%2C' . $date['end_coupon_rate'] . '%5D';
     }
     if ($date['start_price'] && $date['end_price'] && $date['start_price'] < $date['end_price']) {
         //$q.='&start_price='.$date['start_price'].'&end_price='.$date['end_price'];
         $q .= '&filter=reserve_price%5B' . $date['start_price'] . '%2C' . $date['end_price'] . '%5D';
     }
     if ($date['sort']) {
         $sorts = explode("|", $date['sort']);
         if ($sorts[0] == 'volume') {
             $sorts[0] = 'sale';
         }
         $q .= '&sort=' . $sorts[0] . '-' . $sorts[1];
     }
     $url = 'http://s.taobao.com/search?commend=all' . $q . '&style=grid&atype=b&limitPromotion=true&filterFineness=2&fs=1&discount_index=1&s=' . $s . '&zk_type=0#J_FilterTabBar';
     $ftxia_https = new ftxia_https();
     $ftxia_https->fetch($url);
     $content = $ftxia_https->results;
     if (!$content) {
         $content = file_get_contents($url);
     }
     $content = Newiconv("GBK", "UTF-8", $content);
     $ck = get_word($content, '<li class="home"><a href="http:\\/\\/www.taobao.com\\/">', '<\\/a><\\/li>');
     $pre = L('pre');
     $totalnum = get_word($content, L($pre . 'total_start'), L($pre . 'total_end'));
     if (strpos($totalnum, L($pre . 'wang'))) {
         $totalnum = get_word($content, L($pre . 'total_start'), L($pre . 'total_ends'));
         $totalnum = $totalnum * 10000;
     }
     $tp = intval($totalnum / 40) + 1;
     F('tp', $tp);
     if (preg_match_all(L($pre . 'listitem'), $content, $matchitem)) {
         for ($i = 0; $i < count($matchitem[0]); $i++) {
             $pi = ($p - 1) * 40 + $i;
             $msg = '折扣不满足。不采集';
             $item = $matchitem[1][$i];
             $titlebar = get_word($item, L($pre . 'titlebar_start'), L($pre . 'titlebar_end'));
             $title = get_word($titlebar, L($pre . 'title_start'), L($pre . 'title_end'));
             $img = get_word($item, L($pre . 'img_start'), L($pre . 'img_end'));
             if (!$img) {
                 $img = get_word($item, L($pre . 'imgs_start'), L($pre . 'imgs_end'));
                 if (!$img) {
                     $img = get_word($item, L($pre . 'imgss_start'), L($pre . 'imgss_end'));
                 }
             }
             $iid = get_word($item, L($pre . 'iid_start'), L($pre . 'iid_end'));
             $price = get_word($item, L($pre . 'price_start'), L($pre . 'price_end'));
             if (!$price) {
                 $pricebar = get_word($item, L($pre . 'pricesssbar_start'), L($pre . 'pricesssbar_end'));
                 $price = get_word($pricebar, L($pre . 'pricesss_start'), L($pre . 'pricesss_end'));
             }
             $zkprice = get_word($item, L($pre . 'zkprice_start'), L($pre . 'zkprice_end'));
             if (!$zkprice) {
                 $zkprice = get_word($item, L($pre . 'zkprices_start'), L($pre . 'zkprices_end'));
             }
             if (!$price) {
                 $price = $zkprice;
             }
             $volume = get_word($item, L($pre . 'volume_start'), L($pre . 'volume_end'));
             $nickbar = get_word($item, L($pre . 'nickbar_start'), L($pre . 'nickbar_end'));
             $nick = get_word($nickbar, L($pre . 'nick_start'), L($pre . 'nick_end'));
             $ems = get_word($item, L($pre . 'ems_start'), L($pre . 'ems_end'));
             if (!$ems) {
                 $ems = get_word($item, L($pre . 'emss_start'), L($pre . 'emss_end'));
             }
             if ($ems) {
                 if (strpos($ems, L($pre . 'emsor'))) {
                     $ems = '1';
                 } else {
                     $ems = '0';
                 }
             } else {
                 $ems = L('def_ems');
             }
             if (!$volume) {
                 $volume = 0;
             }
             $zekou = get_word($item, L($pre . 'zekou_start'), L($pre . 'zekou_end'));
             if (!$zekou) {
                 $zekou = get_word($item, L($pre . 'zekous_start'), L($pre . 'zekous_end'));
                 if (!$zekou) {
                     $zekou = L('def_coupon_rate');
                 }
             }
             $coupon_add_time = C('ftx_coupon_add_time');
             if ($coupon_add_time) {
                 $times = (int) (time() + $coupon_add_time * 3600);
             } else {
                 $times = (int) (time() + 72 * 86400);
             }
             if (strpos($item, 'tmall.com')) {
                 $itemarray['shop_type'] = 'B';
             } else {
                 $itemarray['shop_type'] = 'C';
             }
             $itemarray['title'] = $title;
             $itemarray['pic_url'] = $img;
             $itemarray['num_iid'] = $iid;
             $itemarray['price'] = $price;
             $itemarray['coupon_price'] = $zkprice;
             $itemarray['volume'] = $volume;
             $itemarray['nick'] = $nick;
             $itemarray['ems'] = $ems;
             $itemarray['cate_id'] = $date['cate_id'];
             $itemarray['coupon_rate'] = $zekou * 1000;
             $itemarray['coupon_end_time'] = $times;
             $itemarray['coupon_start_time'] = time();
             if ($title && $img && $iid && $nick) {
                 $result['item_list'][] = $itemarray;
             }
         }
     } else {
         $result['msg'] = '采集结束!请返回2';
     }
     $taobaoke_item_list = $result['item_list'];
     $taobaoke_item_list && F('taobaoke_item_list', $taobaoke_item_list);
     $coll = 0;
     $thiscount = 0;
     foreach ($taobaoke_item_list as $key => $val) {
         $res = $this->_ajax_tb_publish_insert($val);
         if ($res > 0) {
             $coll++;
             $totalcoll++;
         }
         $thiscount++;
     }
     F('totalcoll', $totalcoll);
     $result_data['p'] = $p;
     $result_data['msg'] = $msg;
     $result_data['coll'] = $coll;
     $result_data['totalcoll'] = $totalcoll;
     $result_data['totalnum'] = $totalnum;
     $result_data['thiscount'] = $thiscount;
     return $result_data;
 }
Пример #27
0
                $_SQL .= " AND B.`{$key}`='{$value}' ";
                $rsdb[$key][$value] = " selected ";
                $value = urlencode($value);
            }
            $search_url .= "&postdb[{$key}]={$value}";
        }
        //分页功能
        $showpage = getpage("{$_pre}content A LEFT JOIN {$_pre}content_{$mid} B ON A.id=B.id", "WHERE A.mid='{$mid}' AND  {$_SQL}", "?mid={$mid}&fid={$fid}&keyword={$keyword}&action=search&type={$type}{$search_url}", $rows);
        $TABLE = $mid == 1 ? 'content' : 'person';
        $SQL = "SELECT A.*,B.* FROM {$_pre}{$TABLE} A LEFT JOIN {$_pre}content_{$mid} B ON A.id=B.id WHERE A.mid='{$mid}' AND {$_SQL} ORDER BY A.posttime DESC LIMIT {$min},{$rows} ";
    }
    $query = $db->query("{$SQL}");
    while ($rs = $db->fetch_array($query)) {
        $rs[posttime] = date("Y-m-d H:i", $rs[posttime]);
        $rs[content] = @preg_replace('/<([^>]*)>/is', "", $rs[content]);
        $rs[content] = get_word($rs[content], 150);
        if (!$rs[username]) {
            $detail = explode(".", $rs[ip]);
            $rs[username] = "{$detail['0']}.{$detail['1']}.{$detail['2']}.*";
        }
        $field_db && $Module_db->showfield($field_db, $rs, 'list');
        $listdb[] = $rs;
    }
    if (!$listdb) {
        //showerr("很抱歉,没有找到你要查询的内容");
    }
    $typedb[$type] = " checked ";
} else {
    $typedb[title] = " checked ";
}
$mid = intval($mid);
Пример #28
0
function Give_article_money($uid, $type = '', $rsdb)
{
    global $db, $pre, $webdb;
    if ($type == 'yz') {
        $money = $webdb[postArticleMoney];
        $msg = '发表文章通过审核奖分';
    } elseif ($type == 'unyz') {
        $money = -$webdb[postArticleMoney];
        $msg = '发表文章取消审核扣分';
    } elseif ($type == 'com') {
        $money = $webdb[comArticleMoney];
        $msg = '文章被推荐奖分';
    } elseif ($type == 'uncom') {
        $money = -$webdb[comArticleMoney];
        $msg = '文章被取消推荐扣分';
    }
    if ($type == 'del') {
        $money = $webdb[deleteArticleMoney];
        $msg = '文章被删除扣分:' . $rsdb[title];
    } else {
        $msg .= "<A HREF='{$webdb['www_url']}{$webdb['path']}/bencandy.php?fid={$rsdb['fid']}&aid={$rsdb['aid']}' target=_blank>" . get_word($rsdb[title], 30) . "</A>";
    }
    if (!$money || !$uid) {
        return;
    }
    add_user($uid, $money, $msg);
}
Пример #29
0
            } else {
                $val['url'] .= '?anyid=' . $val['id'] . '&lang=' . $_M['lang'];
            }
            $val['url'] = $_M['url']['site_admin'] . $val['url'];
            $adminnav[$val['id']] = $val;
            break;
    }
}
if ($_M['form']['anyid'] == 32 || $_M['form']['anyid'] == 33) {
    $_M['form']['anyid'] = '29';
}
if ($_M['form']['anyid'] == '44') {
    foreach ($adminapplist as $key => $val) {
        if ($val['m_name'] == $_M['form']['n']) {
            $nav_3 = $val;
            $nav_3['name'] = get_word($val['appname']);
            break;
        }
    }
    if (!$nav_3) {
        $nav_3 = $adminnav[$_M['form']['anyid']];
    }
} else {
    $nav_3 = $adminnav[$_M['form']['anyid']];
}
$weizhi = '';
if (!$_M['form']['anyid']) {
    $weizhi = $_M['word']['background_page'];
}
$a = $adminnav[$adminnav[$_M['form']['anyid']]['bigclass']]['name'];
$a = ${$a};
Пример #30
0
    }
    //模块
    $query = $db->query("SELECT * FROM {$pre}module WHERE type=2 AND ifclose=0 ORDER BY list DESC");
    while ($rs = $db->fetch_array($query)) {
        if (!$rs['dirname']) {
            continue;
        }
        if ($rs['ifsys']) {
            //独立的顶部菜单
            $base_menuName[$rs['pre']] = $rs['name'];
            $menu_partDB[$rs['pre']][] = $rs['name'];
        } else {
            $menu_partDB['module'][] = $rs['name'];
        }
        $menudb[$rs['name']] = @(include ROOT_PATH . "{$rs['dirname']}/admin/menu.php");
        foreach ($menudb[$rs['name']] as $key => $value) {
            if (eregi('^file=', $menudb[$rs['name']][$key]['link'])) {
                $menudb[$rs['name']][$key]['link'] = "index.php?lfj=module_admin&dirname={$rs['dirname']}&" . $menudb[$rs['name']][$key]['link'];
                if ($menudb[$rs['name']][$key]['power'] != 1) {
                    $menudb[$rs['name']][$key]['power'] = "Module_" . $rs[pre] . $menudb[$rs['name']][$key]['power'];
                }
            }
            if ($rs['ifsys'] && $value['sort']) {
                $keyname = get_word($rs['name'], 4, 0) . ">{$value['sort']}";
                $menu_partDB[$rs['pre']][$keyname] = $keyname;
                $menudb[$keyname][$key] = $menudb[$rs['name']][$key];
                unset($menudb[$rs['name']][$key]);
            }
        }
    }
}