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


PHP top函数代码示例

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


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

示例1: update_goods

 function update_goods($arr, $aid, $posttime)
 {
     global $_G;
     if (!$arr[num_iid]) {
         return false;
     }
     if (!$aid || !$posttime) {
         $goods = DB::fetch_first("SELECT aid,posttime,sum FROM " . DB::table('goods') . " WHERE num_iid ='" . $arr[num_iid] . "' ");
         $aid = $goods[aid];
         $posttime = $goods[posttime];
     }
     if ($aid > 0) {
         $data = array();
         foreach ($_G['setting']['filter_field'] as $k => $v) {
             if (isset($arr[$v])) {
                 $data[$v] = $arr[$v];
             }
         }
         //肯定是没有获取成功
         if ($arr[sum] == 0 && $arr[num] == 0) {
             return false;
         }
         //只更新10天前的商品,一般上线时间是5天,可能5天后卖家没有修改价格..
         if ($data[yh_price] && $posttime + 864000 > TIMESTAMP) {
             unset($data[yh_price]);
         }
         if ($data) {
             $data[dateline] = TIMESTAMP;
             $rt = top('goods', 'update', $data, $aid);
             return $rt;
         }
     }
     return false;
 }
开发者ID:lqlstudio,项目名称:ttae_open,代码行数:34,代码来源:m_taobao.api.php

示例2: get_ext_for_baichuan

 function get_ext_for_baichuan($goods_arr)
 {
     $iids = array();
     foreach ($goods_arr as $k => $v) {
         $iids[] = $v['open_iid'];
     }
     $iids = implode(',', $iids);
     $rs = top('baichuan', 'get_goods', '', $iids);
     foreach ($goods_arr as $k => $v) {
         foreach ($rs as $k1 => $v1) {
             if ($v1['open_iid'] == $v['open_iid']) {
                 $goods_arr[$k]['num'] = $v1['num'];
                 $goods_arr[$k]['num_iid'] = $v1['num_iid'];
                 $goods_arr[$k]['url'] = $v1['url'];
                 $goods_arr[$k]['baoyou'] = $v1['baoyou'];
             }
         }
     }
     return $goods_arr;
 }
开发者ID:lqlstudio,项目名称:ttae_open,代码行数:20,代码来源:taobaoke.api.php

示例3: get_goods

 function get_goods($goods_id = '')
 {
     global $_G;
     if (!$goods_id || !$_G[setting][sitekey]) {
         return false;
     }
     if ($_G[setting][web_type] == 0) {
         //外站
         //include_once libfile('api/m_taobao');
         //$m = new m_taobao();
         $m = top('m_taobao');
         //dump($m->get($goods_id,true),1);
         return $m->get($goods_id, true);
     } else {
         if ($_G[setting][web_type] == 2) {
             return top('baichuan', 'get_goods', $goods_id);
         }
     }
     return false;
 }
开发者ID:lqlstudio,项目名称:ttae_open,代码行数:20,代码来源:goods.api.php

示例4: session_start

<?php

require "pics_e.php";
session_start();
$_SESSION["gpics"] = $gpics;
$x = json_decode($gpics, true);
$sz = count($x["gallery"]);
require "funcz/m.functionz.php";
print head("en", "kinder", "kinder.php", "Y");
?>
<body> 
<div data-role="page" id="pageone">
	<div data-role="header">
		<?php 
print top("en", "Photos", "Photos");
?>
	</div>
    <br/>
<?php 
$col = 1;
$endblock = false;
for ($i = 0; $i < $sz; $i++) {
    $y = $x["gallery"][$i];
    $picSmall = $y["picSmall"];
    $picLarge = $y["picLarge"];
    $picTtl = $y["picTtl"];
    $flag = $y["flag"];
    $copy = $y["copy"];
    switch ($flag) {
        case "T":
            if ($endblock) {
开发者ID:guylancaster999,项目名称:william2016,代码行数:31,代码来源:m.foto_e.php

示例5: top

<?php

include_once "util/top_foot_inc.php";
include "includes/caching.php";
include "includes/versetto.php";
top();
?>
<br><br><br><br>
<div class="testo_18" style="position:static;margin:auto;width:650px;" >
    <form action="request2.php" method="post" accept-charset="utf-8">
Descrivi il problema / suggerimento
<br>E anche cosa stavi facendo se possibile
		<textarea style="position: relative; top: 10px;" id="omg" class="text2" rows="10" cols="75" name="omg">
Cosa stavi facendo: 
Suggerimento: 









</textarea>
<input type="submit" value="Invia" style="height:36px;
left:720px;
position:relative;
top:-27px;
width:50px;"/>
开发者ID:RoyBellingan,项目名称:Seishonotasuke,代码行数:30,代码来源:1.php

示例6: search_shop

 function search_shop()
 {
     global $_G, $assign;
     $sid = $_GET['sid'] ? $_GET['sid'] : $_GET['shop'];
     $index = array();
     //获取相关的
     $rs = memory('get', $sid);
     if ($rs) {
         $index['xiangguan'] = $rs;
     } else {
         $index['xiangguan'] = top('taobaoke', 'get_recommend', 4, $sid, 20);
         if ($index['xiangguan']) {
             memory('set', $sid, $index['xiangguan'], 86400);
         }
     }
     $title = $assign['shop']['shop_title'];
     $shop1 = "专营";
     $shop2 = "旗舰";
     $shop3 = "专卖";
     $and = "";
     if (strpos($title, $shop1) !== false) {
         $and = " AND shop_title like '%{$shop1}%'";
     } else {
         if (strpos($title, $shop2) !== false) {
             $and = " AND shop_title like '%{$shop2}%'";
         } else {
             if (strpos($title, $shop3) !== false) {
                 $and = " AND shop_title like '%{$shop3}%'";
             }
         }
     }
     //	$index['tag_shop'] = $this->get_shop($and);
     $tehui = D(array('and' => '', 'limit' => 20));
     $index['tehui'] = $tehui;
     return $index;
 }
开发者ID:lqlstudio,项目名称:ttae_open,代码行数:36,代码来源:data_api.php

示例7: update

 function update()
 {
     global $_G;
     $success = 0;
     $type = $_G['setting']['api_type'];
     if (!$_GET[num_iid]) {
         msg('商品num_iid不存在');
     }
     //1,用淘宝客权限的API来获取,只能获取部分字段,一次最多10条,只能用open_iid
     //2,用百川高级商品权限,获取字段较多较完整,可返回open_iid,num_iid,url . 一次最多50条, 可用num_iid,open_iid	(推荐)
     //3,远程抓取,一般外站来用
     //0=阿里妈妈淘客	1 = 百川淘宝客
     if ($type == 1) {
         $rs = top('baichuan', 'get_goods', $_GET[num_iid]);
         if (!$rs) {
             msg('更新失败' + $_G['msg']);
         }
         if ($rs['num_iid']) {
             $rs = array($rs);
         }
         foreach ($rs as $k => $v) {
             if (!$v['num_iid']) {
                 continue;
             }
             $id = $v['num_iid'];
             $v['dateline'] = TIMESTAMP;
             $len = DB::update('goods', $v, "num_iid='{$id}'");
             if ($len > 0) {
                 $success++;
             }
         }
     } else {
         if ($type == 0) {
             $tmp = explode(',', trim($_GET[num_iid]));
             $arr = array();
             foreach ($tmp as $k => $v) {
                 $arr[$v . ''] = array('num_iid' => $v);
             }
             $rs = top('tbk', 'extends_info_j', $arr);
             foreach ($rs as $k => $v) {
                 $id = $v['num_iid'];
                 $v['dateline'] = TIMESTAMP;
                 if (is_array($v['images'])) {
                     $v['images'] = implode(',', $v['images']);
                 }
                 $len = DB::update('goods', $v, "num_iid='{$id}'");
                 if ($len > 0) {
                     $success++;
                 }
             }
         } else {
             $tmp = explode(',', trim($_GET[num_iid]));
             $ids = array();
             $m = top('m_taobao');
             foreach ($tmp as $k => $v) {
                 $v = get_goods_id($v);
                 $len = $m->get($v, true);
                 if ($len > 0) {
                     $success++;
                 }
             }
         }
     }
     json(array('status' => 'success', 'len' => $success, 'data' => ''));
 }
开发者ID:lqlstudio,项目名称:ttae_open,代码行数:65,代码来源:goods.action.php

示例8: number_format

         $hourly_stat[$i]['pi_percent'] = $totalPageImpressions ? number_format(100 * $pi[$i]['value'] / $totalPageImpressions, 2) : '0';
         $hourly_stat[$i]['visits_number'] = $visits[$i]['value'];
         $hourly_stat[$i]['visits_percent'] = $totalVisits ? number_format(100 * $visits[$i]['value'] / $totalVisits, 2) : '0';
     }
     //ha grafikonokat hasznalunk
     if (!empty($_SESSION['site_stat_is_graph'])) {
         $tpl->assign('graph_link_hourly', 'admin/stat_graph.php?what=access_statistics&amp;when=hourly&amp;client_id=' . $clientID);
     }
     $tpl->assign('year', $year);
     $tpl->assign('month', $monthNames[$month]);
     $tpl->assign('day', $day);
     $tpl->assign('back_arrow', 'admin.php?p=' . $module_name . '&amp;act=' . $page . '&amp;sub_act=' . $sub_act . '&amp;statpage=month&amp;client_id=' . $clientID . '&amp;month=' . $month . '&amp;year=' . $year);
 }
 //Top oldalak
 include_once $include_dir . '/function.stat.php';
 $top = top($clientID, $limit, $start, $end);
 //Keresok
 if (!empty($_SESSION['site_stat_search'])) {
     include_once $libs_dir . '/' . $pear_dir . '/phpOpenTracker/API.php';
     if (phpOpenTracker_API::pluginLoaded('search_engines')) {
         $engines = phpOpenTracker::get(array('client_id' => $clientID, 'api_call' => 'search_engines', 'what' => 'top_search_engines', 'start' => $start, 'end' => $end, 'limit' => $limit));
         $keywords = phpOpenTracker::get(array('client_id' => $clientID, 'api_call' => 'search_engines', 'what' => 'top_search_keywords', 'start' => $start, 'end' => $end, 'limit' => $limit));
     }
     $tpl->assign('search_engines', $engines['top_items']);
     $tpl->assign('search_keywords', $keywords['top_items']);
 }
 //orszagok listaja
 if (!empty($_SESSION['site_stat_country'])) {
     if (phpOpenTracker_API::pluginLoaded('localizer')) {
         $countries = phpOpenTracker::get(array('client_id' => $clientID, 'api_call' => 'localizer', 'what' => 'top_localizer', 'start' => $start, 'end' => $end, 'limit' => $limit));
     }
开发者ID:span20,项目名称:Kallay,代码行数:31,代码来源:stat_total.php

示例9: connect

oke
<?php 
include 'functions.php';
connect();
if (isset($_GET['all']) and isset($_GET['host'])) {
    if ($_GET['all'] == 'all') {
        make_sommatie_all($_GET['host'], $_GET['fuid']);
    } elseif ($_GET['all'] == 'notall' and isset($_GET['number'])) {
        make_sommatie_limit($_GET['host'], $_GET['fuid'], $_GET['number']);
    } else {
        exit;
    }
} else {
    exit;
}
top("Add sommatie");
?>

</head>
<body>

<?php 
logo();
?>
<div class="row">
    <div class="large-12 columns">

        <div class="panel">
            <h4>Add sommatie</h4>
            <div class="row">
                <p>
开发者ID:Beertie,项目名称:web_scraper,代码行数:31,代码来源:sommatie.php

示例10: head

<?php

require "funcz/m.functionz.php";
print head("de", "kontakt", "kontakt.php", "Y");
?>
<body>
<div data-role="page" id="pageone">
  <div data-role="header">
       <?php 
print top("de", "kontakt", "Kontakt");
?>
  </div>
  <div data-role="main" class="ui-content">
    <blockquote> <table class="table">
<tr>
<td valign="top"><strong>Post</strong></td>
<td valign="top"><b>&nbsp;:&nbsp;</b></td>
<td>William Cuthbertson<br/>
Theodor-Heuss-Str.16<br/>
79183 Waldkirch<br/>
Baden-Württemberg<br/>
Deutschland</td>
</tr>
<tr>
<td   valign="top"><strong>Tel.</strong></td>
<td valign="top"><b>&nbsp;:&nbsp;</b></td>
<td><a href="tel:+497681409260">076 81 40 92 60</a></td></tr>
<tr>
<td  valign="top" ><strong>E-Mail</strong></td>
<td valign="top"><b>&nbsp;:&nbsp;</b></td>
<td  valign="top" ><a href="mailto:w.cuthbertson@gmx.de" target="_new">w.cuthbertson@gmx.de</a></td></tr>
开发者ID:guylancaster999,项目名称:william2016,代码行数:31,代码来源:m.kontakt.php

示例11: head

<?php

require "funcz/m.functionz.php";
print head("en", "kontakt", "kontakt_e.php", "Y");
?>
<body>
<div data-role="page" id="pageone">
  <div data-role="header">
       <?php 
print top("en", "kontakt", "Kontakt");
?>
  </div>
  <div data-role="main" class="ui-content">
  <blockquote>
  <table class="table">
      <tr>
      <td  valign="top"><strong>Post</strong></td>
      <td valign="top">:</td>
      <td>William Cuthbertson<br/>
      Theodor-Heuss-Str.16<br/>
      79183 Waldkirch<br/>
      Baden-Württemberg<br/>
      Germany</td>
      </tr>
      <tr>
      <td   valign="top"><strong>Tel.</strong></td>
      <td valign="top">:</td>
      <td><a href="tel:+497681409260">076 81 40 92 60</a></td>
      </tr>
      <tr>
      <td  valign="top" ><strong>E-Mail</strong></td>
开发者ID:guylancaster999,项目名称:william2016,代码行数:31,代码来源:m.kontakt_e.php

示例12: escape

					  cost= "' . escape($c) . '",
					  price= "' . escape($sP) . '",
					  onHand= "' . escape($noH) . '",
					  reorderPoint= "' . escape($rP) . '",
					  backOrder= "' . escape($bO) . '",
					  deleted= "' . escape($del) . '"';
    }
    $status = new DBlink();
    $res = $status->set($status->conn(), $query);
    if ($res) {
        header("Location: view.php");
    } else {
        echo "Your query didn't work.  <a href=add.php>try again</a>";
    }
} else {
    top("Brennan Films Add");
    ?>
    <h5>*All fields mandatory except "On Back Order"</h5>	
	<form action="" method="post">
		<table>
		<tr>
			<?php 
    if (isset($_GET['id'])) {
        ?>
				<td>ID:</td>
				<td><input readonly="readonly" value="<?php 
        echo $_GET['id'];
        ?>
"></td>	
			<?php 
        $row = escape($_GET['id']);
开发者ID:DanBrennan33,项目名称:Admin-Manager-Web,代码行数:31,代码来源:add.php

示例13: post

 function post()
 {
     global $_G;
     $goods_id = '';
     if ($_GET['onsubmit'] && check()) {
         $shop = get_filed(__CLASS__, $_GET['postdb'], $_GET[id]);
         if ($_FILES[file]) {
             $src = upload();
             if ($src) {
                 $shop[picurl] = $src;
             }
         }
         if ($_FILES['pic_path']['tmp_name']) {
             $src = upload($_FILES['pic_path']);
             if ($src) {
                 $shop[pic_path] = $src;
             }
         }
         $url = '';
         if ($_GET['id']) {
             $id = intval($_GET['id']);
             top('shop', 'insert', $shop, $id);
             $url = '&id=' . $id;
             $msg = '修改';
         } else {
             $msg = '添加';
             $top = top('shop', 'insert', $shop);
         }
         cpmsg($msg . '成功', 'success', 'm=' . __CLASS__ . '&a=' . __FUNCTION__ . $url);
         return false;
     } elseif ($_GET[get_submit] && $_GET['goods_id']) {
         $goods_id = get_goods_id($_GET['goods_id']);
         if (!$goods_id) {
             cpmsg('抓取失败,商品ID或链接不存在或填写错误', 'error', 'm=' . __CLASS__ . '&a=' . __FUNCTION__);
             return false;
         }
         $goods = top('goods', 'get_goods', $goods_id);
         if ($goods === false) {
             cpmsg('当前商品未成功获取,可能是商品未上线,请更换当前店铺中的其它一款商品再重试,或是请手动添加');
             return false;
         }
         $query = top('shop', 'get_shop', $goods['sid']);
         $query[nick] = $goods[nick];
         if ($query === false) {
             cpmsg('抱歉,获取失败,请检查用户名是否正确');
             return false;
         }
         foreach ($query as $k => $v) {
             $shop[$k] = trim_html($v, 1);
         }
         $shop = get_filed(__CLASS__, $shop);
     } elseif ($_GET['id']) {
         $id = intval($_GET['id']);
         $shop = DB::fetch_first("SELECT * FROM " . DB::table('shop') . " WHERE id = {$id} ");
         $shop['start_time'] = dgmdate($shop['start_time'], 'dt');
         $shop['end_time'] = dgmdate($shop['end_time'], 'dt');
     } else {
         $shop = get_filed(__CLASS__);
     }
     $this->add(array('shop' => $shop, 'goods_id' => $goods_id));
     $this->show();
 }
开发者ID:lqlstudio,项目名称:ttae_open,代码行数:62,代码来源:shop.action.php

示例14: connect

$insert_db = connect('insert');
$stmt = dbexec($insert_db, 'INSERT IGNORE INTO users (email, first_name, last_name, username, password, last_update, activation_key)
			VALUES (?, ?, ?, ?, ?, ?, ?)', array($params['email'], $params['first_name'], $params['last_name'], $params['username'], $params['password'], 0, $key->get_key()), array(PDO::PARAM_STR, PDO::PARAM_STR, PDO::PARAM_STR, PDO::PARAM_STR, PDO::PARAM_STR, PDO::PARAM_INT, PDO::PARAM_STR));
$last_id = $insert_db->lastInsertId();
$stmt = $insert_db->prepare('INSERT INTO group_users (user_id, group_id) VALUES (?, ?)');
$stmt->bindParam(1, $last_id, PDO::PARAM_INT);
$stmt->bindParam(2, $group_id);
$group_id = GROUP_ROOT;
$stmt->execute();
//for the alpha
//$group_id = CLASSMATCHES_ROOT;
//$stmt->execute();
$message = 'Thank you for registering for an account with us here at Classmatches. To help
			ensure security for our website, we have sent you this email with a confirmation key. Follow
			this url to activate your account!
			https://classmatches.com/account/activate.php?username=' . $params['username'] . '&key=' . urlencode($key->get_key());
$headers = "From: accountcreation@classmatches.com \n";
$headers .= "Reply-To: accountcreation@classmatches.com \n";
$headers .= "Return-Path: accountcreation@classmatches.com \n";
$headers .= "X-Mailer: PHP \n";
if (!mail($params['email'], 'Account Creation Confirmation', $message, $headers)) {
    error('There was an error with sending the email, please try again', 'login.php');
}
top(false, 'Thanks for creating an account!', false);
?>
<p>An email has been sent to <?php 
echo htmlspecialchars($params['email']);
?>
</p>
<?php 
bottom();
开发者ID:dulinriley,项目名称:classmatches,代码行数:31,代码来源:newaccountsubmit.php

示例15: connect

 *
 * 2: handmatig controlleren of de links weg zijn dan worden er automatch een x aantal links geven die handmatig moeten wordne gecontoleert
 *
 * Veder kan hier ook de HTML-tag wordne toegevoegt
 */
//Haal de pagina met functie op
include 'functions.php';
//Maak conectie met de DB
connect();
//Zet de titlte van de pagina
$title = "Controle";
//haal de sommatie op als dit niet lukt laat helemaal nisk zien
if (!($data = get_sommatie())) {
    exit('Er gaat iets super fout met opahlen');
}
top($title, 1, 'asc');
?>
</head>
<body>
<?php 
logo($title);
?>
<div class="row">
    <table id="datatables" class="display" style="width:955px;border:1px solid #ccc;">
        <thead>
            <tr>
                <th>
                    Hostname
                </th>
                <th>
                    Date Report
开发者ID:Beertie,项目名称:web_scraper,代码行数:31,代码来源:controle.php


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