当前位置: 首页>>代码示例>>PHP>>正文


PHP get_word函数代码示例

本文整理汇总了PHP中get_word函数的典型用法代码示例。如果您正苦于以下问题:PHP get_word函数的具体用法?PHP get_word怎么用?PHP get_word使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_word函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: list_content

/**
*获取信息内容
**/
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;
}
开发者ID:xubo245,项目名称:liuyangzhang,代码行数:34,代码来源:global.php

示例2: __construct

 function __construct($id = 1)
 {
     if (is_numeric($id)) {
         $dictionary_row = get_word($id);
         $this->build($dictionary_row);
     }
 }
开发者ID:Trying-On-The-Trades,项目名称:vocabulary-plugin,代码行数:7,代码来源:dictionary.php

示例3: index

 /**
  * 淘宝跳转
  */
 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);
 }
开发者ID:jmche,项目名称:qiangmini,代码行数:62,代码来源:jumpAction.class.php

示例4: edit_word_settings_page

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>
//.........这里部分代码省略.........
开发者ID:Trying-On-The-Trades,项目名称:vocabulary-plugin,代码行数:101,代码来源:edit_word.php

示例5: array

            $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);
}
开发者ID:GHubgenius,项目名称:qbbj,代码行数:31,代码来源:showsp.php

示例6: dirname

        $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("请选择一个");
开发者ID:xubo245,项目名称:liuyangzhang,代码行数:31,代码来源:comment.php

示例7: get_word

// 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);
}
开发者ID:Jaden-J,项目名称:biblequote,代码行数:31,代码来源:bibleist.php

示例8: dirname

<?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";
开发者ID:GHubgenius,项目名称:qbbj,代码行数:28,代码来源:moneylog.php

示例9: collect

 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();
//.........这里部分代码省略.........
开发者ID:leamiko,项目名称:9k9,代码行数:101,代码来源:uz800Action.class.php

示例10: FOUND_ROWS

        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;
}
/**
开发者ID:xubo245,项目名称:liuyangzhang,代码行数:31,代码来源:list.php

示例11: showerr

    } 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;
开发者ID:xubo245,项目名称:liuyangzhang,代码行数:31,代码来源:bencandy.php

示例12: while

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');
开发者ID:GHubgenius,项目名称:qbbj,代码行数:31,代码来源:special_comment_ajax.php

示例13: save_test

        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">
开发者ID:ErikaKek,项目名称:applicazione,代码行数:30,代码来源:test.php

示例14: while

$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));
    }
开发者ID:xubo245,项目名称:liuyangzhang,代码行数:31,代码来源:allnewinfo.php

示例15: collect

 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);
//.........这里部分代码省略.........
开发者ID:lzstg,项目名称:guangchangwu_web,代码行数:101,代码来源:advancedAction.class.php


注:本文中的get_word函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。