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


PHP get_cat函数代码示例

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


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

示例1: main

function main($query, $type, $joke_id, $cat_id, $limit)
{
    if ($query == 'cat') {
        get_cat($type);
    } elseif ($query == 'joke') {
        get_joke($type, $joke_id, $cat_id, $limit);
    } else {
        write_error($GLOBALS['ERR_PARAMS_QUERY']);
    }
}
开发者ID:paladin74,项目名称:gzbusnow_v1,代码行数:10,代码来源:joke.php

示例2: get_cat

function get_cat($page_id, $level)
{
    global $ft, $rewrite;
    $query = sprintf("\r\n        SELECT \r\n            id, \r\n            parent_id, \r\n            title \r\n        FROM \r\n            %1\$s \r\n        WHERE \r\n            parent_id = '%2\$d' \r\n        AND \r\n            published = 'Y' \r\n        ORDER BY \r\n            id \r\n        ASC", TABLE_PAGES, $page_id);
    $db = new DB_SQL();
    $db->query($query);
    while ($db->next_record()) {
        $page_id = $db->f("id");
        $parent_id = $db->f("parent_id");
        $page_name = $db->f("title");
        $page_link = (bool) $rewrite ? '1,' . $page_id . ',5,item.html' : 'index.php?p=5&id=' . $page_id . '';
        $ft->assign(array('PAGE_NAME' => $page_name, 'PAGE_ID' => $page_id, 'CLASS' => "child", 'PARENT' => str_repeat('  ', $level), 'PAGE_LINK' => $page_link));
        $ft->parse('PAGES_ROW', ".pages_row");
        get_cat($page_id, $level + 2);
    }
}
开发者ID:BackupTheBerlios,项目名称:core-svn,代码行数:16,代码来源:main_lib.php

示例3: make_cat_nav_tree

// {
// 	message_die(GENERAL_ERROR, 'Could not query categories list', '', __LINE__, __FILE__, $sql);
// }
//
// $category_rows = array();
// while ($row = $db->sql_fetchrow($result))
// {
//	$category_rows[] = $row;
// }
// $db->sql_freeresult($result);
//
// get the nav sentence
$nav_cat_desc = make_cat_nav_tree($viewcat, false);
//
// categories array
$category_rows = get_cat($viewcat);
// End PNphpBB2 Categories Hierarchie Mod
if ($total_categories = count($category_rows)) {
    //
    // Define appropriate SQL
    //
    switch (SQL_LAYER) {
        case 'postgresql':
            $sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id \n\t\t\t\tFROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . USERS_TABLE . " u\n\t\t\t\tWHERE p.post_id = f.forum_last_post_id \n\t\t\t\t\tAND u.user_id = p.poster_id  \n\t\t\t\t\tUNION (\n\t\t\t\t\t\tSELECT f.*, NULL, NULL, NULL, NULL\n\t\t\t\t\t\tFROM " . FORUMS_TABLE . " f\n\t\t\t\t\t\tWHERE NOT EXISTS (\n\t\t\t\t\t\t\tSELECT p.post_time\n\t\t\t\t\t\t\tFROM " . POSTS_TABLE . " p\n\t\t\t\t\t\t\tWHERE p.post_id = f.forum_last_post_id  \n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t\tORDER BY cat_id, forum_order";
            break;
        case 'oracle':
            $sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id \n\t\t\t\tFROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . USERS_TABLE . " u\n\t\t\t\tWHERE p.post_id = f.forum_last_post_id(+)\n\t\t\t\t\tAND u.user_id = p.poster_id(+)\n\t\t\t\tORDER BY f.cat_id, f.forum_order";
            break;
        default:
            $sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id\n\t\t\t\tFROM (( " . FORUMS_TABLE . " f\n\t\t\t\tLEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )\n\t\t\t\tLEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id )\n\t\t\t\tORDER BY f.cat_id, f.forum_order";
            break;
开发者ID:nmpetkov,项目名称:ZphpBB2,代码行数:31,代码来源:index.php

示例4: add

 function add($post)
 {
     global $MOD, $L;
     $post = $this->set($post);
     $sqlk = $sqlv = '';
     foreach ($post as $k => $v) {
         if (in_array($k, $this->fields)) {
             $sqlk .= ',' . $k;
             $sqlv .= ",'{$v}'";
         }
     }
     $sqlk = substr($sqlk, 1);
     $sqlv = substr($sqlv, 1);
     $this->db->query("INSERT INTO {$this->table} ({$sqlk}) VALUES ({$sqlv})");
     $this->itemid = $this->db->insert_id();
     $t = get_cat($this->itemid);
     if ($t) {
         $t = $this->db->get_one("SELECT MAX(catid) AS id FROM {$this->db->pre}category");
         $itemid = intval($t['id'] + 1);
         $this->db->query("UPDATE {$this->table} SET itemid={$itemid} WHERE itemid={$this->itemid}");
         $maxid = $itemid + 100;
         $this->db->query("INSERT {$this->db->pre}category (catid) VALUES ({$maxid})");
         $this->db->query("DELETE FROM {$this->db->pre}category WHERE catid={$maxid}");
         $this->itemid = $itemid;
     }
     $this->update($this->itemid);
     clear_upload($post['thumb']);
     return $this->itemid;
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:29,代码来源:group.class.php

示例5: update

 function update($itemid)
 {
     $item = $this->db->get_one("SELECT * FROM {$this->table} WHERE itemid={$itemid}");
     $update = '';
     $keyword = $item['title'] . ',' . ($item['tag'] ? str_replace(' ', ',', trim($item['tag'])) . ',' : '') . strip_tags(cat_pos(get_cat($item['catid']), ','));
     if ($keyword != $item['keyword']) {
         $keyword = str_replace("//", '', addslashes($keyword));
         $update .= ",keyword='{$keyword}'";
     }
     $mobile = $this->m3u8($item['video']) ? 1 : 0;
     if ($mobile != $item['mobile']) {
         $update .= ",mobile='{$mobile}'";
     }
     $item['itemid'] = $itemid;
     $linkurl = itemurl($item);
     if ($linkurl != $item['linkurl']) {
         $update .= ",linkurl='{$linkurl}'";
     }
     if ($update) {
         $this->db->query("UPDATE {$this->table} SET " . substr($update, 1) . " WHERE itemid={$itemid}");
     }
 }
开发者ID:hcd2008,项目名称:destoon,代码行数:22,代码来源:video.class.php

示例6: update

 function update($itemid)
 {
     global $TYPE;
     $item = $this->db->get_one("SELECT * FROM {$this->table} WHERE itemid={$itemid}");
     $update = '';
     $keyword = $item['title'] . ',' . $TYPE[$item['typeid']] . ',' . strip_tags(cat_pos(get_cat($item['catid']), ','));
     if ($keyword != $item['keyword']) {
         $keyword = str_replace("//", '', addslashes($keyword));
         $update .= ",keyword='{$keyword}'";
     } else {
         $keyword = str_replace("//", '', addslashes($keyword));
     }
     $item['itemid'] = $itemid;
     $linkurl = itemurl($item);
     if ($linkurl != $item['linkurl']) {
         $update .= ",linkurl='{$linkurl}'";
     }
     $member = $item['username'] ? userinfo($item['username']) : array();
     if ($member) {
         $update .= update_user($member, $item);
     }
     if ($update) {
         $this->db->query("UPDATE {$this->table} SET " . substr($update, 1) . " WHERE itemid={$itemid}");
     }
     $sorttime = $this->get_sorttime($item['edittime'], $item['vip']);
     $this->db->query("REPLACE INTO {$this->table_search} (itemid,catid,areaid,status,content,sorttime) VALUES ({$itemid},'{$item['catid']}','{$item['areaid']}','{$item['status']}','{$keyword}','{$sorttime}')");
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:27,代码来源:sell.class.php

示例7: update

 function update($itemid)
 {
     global $TYPE;
     $item = $this->db->get_one("SELECT * FROM {$this->table} WHERE itemid={$itemid}");
     $update = '';
     $keyword = $item['title'] . ',' . ($item['tag'] ? $item['tag'] . ',' : '') . $TYPE[$item['typeid']] . ',' . strip_tags(cat_pos(get_cat($item['catid']), ','));
     if ($keyword != $item['keyword']) {
         $keyword = str_replace("//", '', addslashes($keyword));
         $update .= ",keyword='{$keyword}'";
     }
     $item['itemid'] = $itemid;
     $linkurl = itemurl($item);
     if ($linkurl != $item['linkurl']) {
         $update .= ",linkurl='{$linkurl}'";
     }
     $member = $item['username'] ? userinfo($item['username']) : array();
     if ($member) {
         $update .= update_user($member, $item);
     }
     if ($update) {
         $this->db->query("UPDATE {$this->table} SET " . substr($update, 1) . " WHERE itemid={$itemid}");
     }
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:23,代码来源:buy.class.php

示例8: update

 function update($itemid)
 {
     $item = $this->db->get_one("SELECT * FROM {$this->table} WHERE itemid={$itemid}");
     $update = '';
     $keyword = $item['title'] . ',' . $item['company'] . ',' . strip_tags(cat_pos(get_cat($item['catid']), ','));
     if ($keyword != $item['keyword']) {
         $keyword = str_replace("//", '', addslashes($keyword));
         $update .= ",keyword='{$keyword}'";
     }
     $item['itemid'] = $itemid;
     $linkurl = itemurl($item);
     if ($linkurl != $item['linkurl']) {
         $update .= ",linkurl='{$linkurl}'";
     }
     $member = $item['username'] ? userinfo($item['username']) : array();
     if ($member) {
         foreach (array('groupid', 'vip', 'validated', 'company', 'areaid', 'truename', 'telephone', 'mobile', 'address', 'qq', 'msn', 'ali', 'skype') as $v) {
             if ($item[$v] != $member[$v]) {
                 $update .= ",{$v}='" . addslashes($member[$v]) . "'";
             }
         }
         if ($item['email'] != $member['mail']) {
             $update .= ",email='" . addslashes($member['mail']) . "'";
         }
     }
     if ($update) {
         $this->db->query("UPDATE {$this->table} SET " . substr($update, 1) . " WHERE itemid={$itemid}");
     }
 }
开发者ID:hcd2008,项目名称:destoon,代码行数:29,代码来源:group.class.php

示例9: message

        if (!$r || $r['username'] != $_username) {
            message();
        }
        $do->delete($itemid);
        dmsg($L['op_del_success'], $forward);
        break;
    default:
        $status = isset($status) ? intval($status) : 3;
        in_array($status, array(2, 3)) or $status = 3;
        $condition = "username='{$_username}' AND status={$status}";
        $lists = $do->get_list($condition);
        if ($lists) {
            $tmp = $MOD['linkurl'];
            foreach ($lists as $k => $v) {
                if ($v['catid']) {
                    $lists[$k]['cate'] = cat_pos(get_cat($v['catid']), '-', 1);
                }
                if ($v['email'] != $_email) {
                    $db->query("UPDATE {$DT_PRE}alert SET email='{$_email}' WHERE itemid={$v['itemid']}");
                }
            }
            $MOD['linkurl'] = $tmp;
        }
        $head_title = $L['alert_title'];
        break;
}
$nums = array();
$limit_used = 0;
for ($i = 2; $i < 4; $i++) {
    $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}alert WHERE username='{$_username}' AND status={$i}");
    $nums[$i] = $r['num'];
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:alert.inc.php

示例10: defined

<?php

defined('IN_DESTOON') or exit('Access Denied');
$gid = $catid;
$GRP = get_group($gid);
if (!$GRP || $GRP['status'] != 3) {
    include load('404.inc');
}
if ($GRP['list_type'] && !is_fans($GRP)) {
    $action = 'list';
    $head_title = lang('message->without_permission');
    exit(include template('nofans', $module));
}
$CAT = get_cat($GRP['catid']);
$GRP['managers'] = $GRP['manager'] ? explode('|', $GRP['manager']) : array();
$admin = is_admin($GRP);
$typeid = isset($typeid) ? intval($typeid) : 0;
isset($TYPE[$typeid]) or $typeid = 0;
$condition = 'status=3 AND gid=' . $catid;
if ($typeid) {
    switch ($typeid) {
        case 1:
            $MOD['order'] = 'addtime DESC';
            break;
        case 2:
            $MOD['order'] = 'replytime DESC';
            break;
        case 3:
            $condition .= " AND level>0";
            break;
        case 4:
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:group.inc.php

示例11: mysql_safe

		 
		 <!-- Begin Right Column -->
		 <div id="rightcolumn">
<?php 
if (isset($_GET['cat'])) {
    if (isset($_GET['sub'])) {
        if (isset($_GET['item'])) {
            // need to show item with description
            $item_id = $_GET['item'];
            $res = mysql_safe("SELECT id, id_subcat, name, price FROM items WHERE id=?", array($item_id));
            if (mysql_num_rows($res) > 0) {
                // everything is Ok, item exists
                $row = mysql_fetch_array($res);
                echo "<p id='itemtitle'>" . $row['name'] . "</p>";
                echo "<table width = 100%><tr>";
                $cur_cat = get_cat($row['id_subcat']);
                $cur_sub = $row['id_subcat'];
                $cur_item = $row['id'];
                $cur_name = $row['name'];
                mysql_query("INSERT INTO hits (`subcat`,`item`,`host`,`ip`) VALUES('{$cur_sub}','{$cur_item}','{$host}','{$cur_ip}')");
                $res1 = mysql_safe("SELECT id FROM items WHERE (id_subcat=?) AND (name=(SELECT MAX(name) FROM items WHERE (name<?) AND (id_subcat=?)))", array($cur_sub, $cur_name, $cur_sub));
                if (mysql_num_rows($res1) > 0) {
                    $row1 = mysql_fetch_array($res1);
                    echo "<td align='left' width=30%><a href='index.php?cat=" . $cur_cat . "&sub=" . $cur_sub . "&item=" . $row1['id'] . "' class='pointer'>&lt;&lt;&lt; предыдущий товар</a></td>";
                } else {
                    echo "<td align='left' width=30%> &nbsp; </td>";
                }
                $res2 = mysql_safe("SELECT percent, round FROM subcat WHERE id = ?", array($cur_sub));
                $row2 = mysql_fetch_array($res2);
                $sell = 0;
                if ($row2['percent'] > 0) {
开发者ID:Net7x,项目名称:vt,代码行数:30,代码来源:index.php

示例12: show_concat_waste

function show_concat_waste($ref_sell, $price_call)
{
    mysql_connect('localhost', 'root', 'krasnal') or die(mysql_error());
    mysql_select_db('dbs3') or die(mysql_error());
    $customer1 = "SELECT waste_barcode.category,waste_barcode.weight,type_item,count(*) as quantity FROM transaction_waste, waste_barcode,item_has_cat Where waste_barcode.idwaste_barcode=transaction_waste.waste_barcode_idwaste_barcode " . "AND Item_has_cat.id_item_cat=waste_barcode.type_item AND ref_sell_number='{$ref_sell}' GROUP BY type_item ORDER By type_item";
    //echo $ref_sell;
    $reuse = array();
    $cust = add_db($customer1);
    $waste_barcode = array();
    $waste_barcode_weight = array();
    //echo "bf fetch";
    while ($rek = mysql_fetch_array($cust, MYSQL_BOTH)) {
        //changed from 1
        $i++;
        //echo " in fetch ";
        //if($tab[$rek["id_test"]]<'1')
        //{
        //here we count unige barcode waste and add to array
        $index = $rek['type_item'];
        // echo " <BR /> ";
        $waste_barcode[$index] += $rek['quantity'];
        $waste_barcode_weight[$index] = $rek['weight'] * $rek['quantity'];
        //echo '<tr>';
        //echo '<td>'.get_item_name($rek['type_item']).'</td>';
        // echo '<td>'.$rek["quantity"].'</td>';
        // echo '<td>'.$rek["category"].'</td>';
        //   echo '<td>'.$rek["pn"].'.</td>';
        //     	echo '<td>1</td>';
        //echo '<td>'.$rek["sum_weight"].'</td>';
        // echo '<td>'.$rek["Name_sub"].'</td>';
        //echo '</tr>';
        $cat = $rek['category'];
        $reuse[$cat] += $rek['weight'] * $rek['quantity'];
        //}
        //$tab[$rek["id_test"]]+=1;
    }
    $waste_barcode[3];
    $waste_barcode_weight[3];
    echo '<form action="sell_item_invoice_waste.php?invoice=1&ref_sell=' . $ref_sell . '" method="POST">';
    $weee_reused_waste_qtty = array();
    global $sum_rec;
    global $qtty_rec;
    global $ind_rec;
    for ($name_cat = 0; $name_cat < 62; $name_cat++) {
        if (($qtty = get_waste_qtty($ref_sell, $name_cat)) > 0) {
            echo "<tr>";
            echo "<td>";
            echo $sum_qtty_recalculate = $qtty + $waste_barcode[$name_cat];
            echo " UNIT </td>";
            echo "<td>";
            echo get_item_name($name_cat);
            echo "</td>";
            // echo '<td>';
            // echo get_weight_qtty($ref_sell, $name_cat)+$waste_barcode_weight[$name_cat];
            //    echo "</td>";
            //    echo "<td>".$name_cat."</td>";
            echo "<td>" . $sum_qtty_recalculate . " x </td>";
            // echo $sum_rec[$name_cat];
            echo "<input type='hidden' name='qtty_rec" . $name_cat . "' value='" . $sum_qtty_recalculate . "'>";
            echo "<td><input type='text' name='price" . $name_cat . "' value='" . $ind_rec[$name_cat] . "' placeholder='Individual price'></td>";
            if ($sum_rec[$name_cat] > 0) {
                echo "<td> <b>Price Set:</b> <BR/>" . $sum_rec[$name_cat] . " Pounds</td>";
            }
            echo "</tr>";
            $sum_qtty = get_weight_qtty($ref_sell, $name_cat);
            +$waste_barcode[$name_cat];
            $cat = get_cat($name_cat);
            $weee_reused_waste_qtty[$cat] += get_weight_qtty($ref_sell, $name_cat);
        } else {
            $customer1 = "SELECT waste_barcode.category,waste_barcode.weight,type_item,count(*) as quantity FROM transaction_waste, waste_barcode,item_has_cat Where waste_barcode.idwaste_barcode=transaction_waste.waste_barcode_idwaste_barcode " . "AND Item_has_cat.id_item_cat=waste_barcode.type_item AND ref_sell_number='{$ref_sell}' AND type_item='{$name_cat}' GROUP BY type_item ORDER By type_item";
            $cust = add_db($customer1);
            while ($rek = mysql_fetch_array($cust, MYSQL_BOTH)) {
                $i++;
                //if($tab[$rek["id_test"]]<'1')
                //{
                //here we count unige barcode waste and add to array
                if ($rek['quantity'] > 0) {
                    $qtty_indiv = $rek["quantity"];
                    $index = $rek['type_item'];
                    $waste_barcode_weight[$index] = $rek['weight'] * $rek['quantity'];
                    // echo " <BR /> ";
                    //$waste_barcode[$index]+=$rek['quantity'];
                    // $waste_barcode_weight[$index]=$rek['weight']*$rek['quantity'];
                    echo '<tr>';
                    echo '<td>' . $rek["quantity"] . ' Unit</td>';
                    echo '<td>' . get_item_name($rek['type_item']) . '</td>';
                    //   echo '<td>'.$waste_barcode_weight[$index]
                    //   .'</td>';
                    //  echo '<td>'.$rek["category"].'</td>';
                    // echo '<td>'.$rek["pn"].'.</td>';
                    //      	echo '<td>1</td>';
                    //echo '<td>'.$rek["sum_weight"].'</td>';
                    // echo '<td>'.$rek["Name_sub"].'</td>';
                    echo "<td>" . $qtty_indiv . " x </td>";
                    echo "<input type='hidden' name='qtty_rec" . $name_cat . "' value='" . $qtty_indiv . "'>";
                    echo "<td><input type='text' name='price" . $name_cat . "' value='" . $ind_rec[$name_cat] . "' placeholder='Individual price'></td>";
                    if ($sum_rec[$name_cat] > 0) {
                        echo "<td> <b>Price Set:</b> <BR/>" . $sum_rec[$name_cat] . " Pounds</td>";
                    }
                    echo '</tr>';
//.........这里部分代码省略.........
开发者ID:bruce28,项目名称:vip,代码行数:101,代码来源:sell_item_invoice_waste.php

示例13: update

 function update($itemid)
 {
     $item = $this->db->get_one("SELECT * FROM {$this->table} WHERE itemid={$itemid}");
     $update = '';
     $GRP = get_group($item['gid']);
     $keyword = $item['title'] . ',' . $GRP['title'] . ',' . strip_tags(cat_pos(get_cat($item['catid']), ','));
     if ($keyword != $item['keyword']) {
         $keyword = str_replace("//", '', addslashes($keyword));
         $update .= ",keyword='{$keyword}'";
     }
     if ($item['username']) {
         $passport = addslashes(get_user($item['username'], 'username', 'passport'));
         if ($passport != $item['passport']) {
             $update .= ",passport='{$passport}'";
         }
     }
     $item['itemid'] = $itemid;
     $linkurl = itemurl($item);
     if ($linkurl != $item['linkurl']) {
         $update .= ",linkurl='{$linkurl}'";
     }
     if ($item['hits'] > 1 || $item['status'] == 3) {
         $reply = $this->db->count($this->table . '_reply', "tid={$itemid} AND status=3");
         if ($reply != $item['reply']) {
             $update .= ",reply='{$reply}'";
         }
     }
     if ($update) {
         $this->db->query("UPDATE {$this->table} SET " . substr($update, 1) . " WHERE itemid={$itemid}");
     }
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:club.class.php

示例14: get_cat

<div id="headline_right"><h1>Seiten von: <?php 
echo $p_title;
?>
 im Webkatalog</h1></div>
</div>
<br clear="left" />
</div>

<br />

<div id="cat_seiten">
<?  
$pageurl="".$cat."/".$mod."";
$limit="5";
$orderby="typ";
get_cat($cat);
?>
<br />
</div>

<div id="cont_box">
<a href="seite-eintragen/1.html" rel="nofollow"><img src="templates/<?php 
echo get_aktiv_layout_data(layout_path);
?>
images/addsite.jpg" border="0" alt="Seite Anmelden Webkatalog" /></a>
<br /><br />
Nach <strong><?php 
echo $p_title;
?>
</strong> suchen auf: <a href="http://www.google.de/search?hl=de&q=<? echo $suchtag; ?>" target="_blank" rel="nofollow">[Google]</a> <a href="http://www.bing.com/search?q=<? echo $suchtag; ?>" target="_blank" rel="nofollow">[Bing]</a> <a href="http://search.lycos.de/cgi-bin/pursuit?query=<? echo $suchtag; ?>&cat=web&enc=utf-8" target="_blank" rel="nofollow">[Lycos]</a> <a href="http://de.search.yahoo.com/search?p=<? echo $suchtag; ?>" target="_blank" rel="nofollow">[Yahoo]</a>
</div>
开发者ID:Online-Marketing,项目名称:drawWEBKATALOG,代码行数:31,代码来源:categories.php

示例15: update

 function update($itemid)
 {
     global $TYPE;
     $item = $this->db->get_one("SELECT * FROM {$this->table} WHERE itemid={$itemid}");
     $update = '';
     $keyword = $item['title'] . ',' . $TYPE[$item['typeid']] . ',' . strip_tags(cat_pos(get_cat($item['catid']), ','));
     if ($keyword != $item['keyword']) {
         $keyword = str_replace("//", '', addslashes($keyword));
         $update .= ",keyword='{$keyword}'";
     } else {
         $keyword = str_replace("//", '', addslashes($keyword));
     }
     $item['itemid'] = $itemid;
     $linkurl = itemurl($item);
     if ($linkurl != $item['linkurl']) {
         $update .= ",linkurl='{$linkurl}'";
     }
     $member = $item['username'] ? userinfo($item['username']) : array();
     if ($member) {
         foreach (array('groupid', 'vip', 'validated', 'company', 'areaid', 'truename', 'telephone', 'mobile', 'address', 'qq', 'msn', 'ali', 'skype') as $v) {
             if ($item[$v] != $member[$v]) {
                 $update .= ",{$v}='" . addslashes($member[$v]) . "'";
             }
         }
         if ($item['email'] != $member['mail']) {
             $update .= ",email='" . addslashes($member['mail']) . "'";
         }
     }
     if ($update) {
         $this->db->query("UPDATE {$this->table} SET " . substr($update, 1) . " WHERE itemid={$itemid}");
     }
     $sorttime = $this->get_sorttime($item['edittime'], $item['vip']);
     $this->db->query("REPLACE INTO {$this->table_search} (itemid,catid,areaid,status,content,sorttime) VALUES ({$itemid},'{$item['catid']}','{$item['areaid']}','{$item['status']}','{$keyword}','{$sorttime}')");
 }
开发者ID:hcd2008,项目名称:destoon,代码行数:34,代码来源:sell.class.php


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