Exemple #1
0
            foreach ($condition['column'] as $key => $val) {
                $buffer[$key] = Assign($row[$val], 0);
            }
            $filter_count = array('uid' => Assign($params['uid'], 0), 'tid' => Assign($params['tid'], 0), 'tag' => Assign($params['tag'], 0), 'type' => '1');
            if (StorageCount('hh_techuser_shoucang', $filter_count)) {
                $buffer['collect'] = '1';
            }
            if ($params['type'] == '3' and $buffer['collect'] == '0') {
                continue;
            }
            $filter_count['touid'] = 0;
            if (StorageCount('hh_techuser_dianzan', $filter_count)) {
                $buffer['mypraise'] = '1';
            }
            $filter_total = array('tid' => Assign($params['tid'], 0), 'tag' => Assign($params['tag'], 0), 'type' => '1', 'touid' => 0);
            $buffer['praises'] = StorageCount('hh_techuser_dianzan', $filter_total);
            ## 獲取圖片信息
            if ($params['tag'] == '1' or $params['tag'] == '2') {
                $buffer['mdata'] = array();
                $condition_sub = array('schema' => 'hh_techforum_img', 'fields' => array('id'), 'filter' => array('qid' => Assign($row['id'], 0)));
                $buf = StorageFind($condition_sub);
                if (is_array($buf) and empty($buf) == FALSE) {
                    foreach ($buf as $number => $row_img) {
                        $buffer['mdata'][] = array('mid' => $row_img['id'], 'type' => '0', 'mname' => 'image' . ($number + 1), 'mpic' => "{$row_img['id']}_s.png", 'url' => '');
                    }
                }
            }
            $result['data'][] = $buffer;
        }
    }
}
Exemple #2
0
<?php

// Copyright 2015 The Haohaoxiuche Team Authors. All right reserved.
// Use of this source that is governed by a Apache-style
// license that can be found in the LICENSE file.
//
// 技術版API編號076 總數量條數
//
// @authors hjboss <*****@*****.**> 2015-12-18#
// @version 1.0.0
// @package hhxc
if (!defined('HHXC')) {
    die('Permission denied');
}
$condition = array('schema' => 'hh_dbver', 'fields' => array('ver'), 'filter' => array('vername' => 'datatotal'));
$count = StorageCount($condition['schema'], $condition['filter']);
if (empty($count) == TRUE) {
    $result['msg'] = MESSAGE_EMPTY;
} else {
    $result = array('code' => '101', 'totalnumber' => 0);
    $record = StorageFindOne($condition);
    if (is_array($record) and empty($record) == FALSE) {
        $condition_sub = array('schema' => 'hh_datatotal', 'fields' => array('(symptomp+anli+fault+faultcode+timing+(SELECT COUNT(*) FROM hh_techuser)) AS h_ct'), 'others' => 'ORDER BY id DESC');
        $buf = StorageFindOne($condition_sub);
        if (is_array($buf) and empty($buf) == FALSE) {
            $result['totalnumber'] = $buf['h_ct'];
        }
    }
}
Exemple #3
0
    case '3':
        $sql = "(SELECT tid FROM hh_techuser_shoucang WHERE uid='%d' AND tag='3' AND type='1')";
        $condition['filter']['id'] = array('IN', sprintf($sql, $params['uid']));
        break;
}
$recordset = StorageFind($condition);
if (is_array($recordset) == FALSE or empty($recordset) == TRUE) {
    $result['msg'] = MESSAGE_EMPTY;
} else {
    $result = array('code' => '101', 'data' => array());
    foreach ($recordset as $index => $row) {
        if ($index == 0) {
            $data['databasever'] = $row['id'];
        }
        if ($params['type'] == '2' and $row['pubuser'] != $params['uid']) {
            continue;
        }
        $buffer = array('uid' => $row['pubuser'], 'userpic' => $row['h_headerimg'], 'usernick' => $row['h_nick'], 'grade' => $row['h_grade'], 'posttime' => $row['pubtime'], 'level' => $row['level'], 'experience' => $row['experience'], 'city' => $row['city'], 'tid' => $row['id'], 'messages' => $row['replycount'], 'collect' => '0', 'mypraise' => '0', 'praises' => '0', 'official' => Assign($row['h_official'], 0), 'identified' => Assign($row['h_identified'], 0), 'rank' => Assign($row['h_rank'], 0), 'rankname' => Assign($row['h_rankname']));
        $filter_count = array('uid' => Assign($params['uid'], 0), 'tid' => Assign($buffer['tid'], 0), 'tag' => 3, 'type' => 1);
        if (StorageCount('hh_techuser_shoucang', $filter_count)) {
            $buffer['collect'] = '1';
        }
        $filter_count['touid'] = 0;
        if (StorageCount('hh_techuser_dianzan', $filter_count)) {
            $buffer['mypraise'] = '1';
        }
        $filter_total = array('tid' => Assign($buffer['tid'], 0), 'tag' => 3, 'type' => 1, 'touid' => 0);
        $buffer['praises'] = Assign(StorageCount('hh_techuser_dianzan', $filter_total), 0);
        $result['data'][] = $buffer;
    }
}
Exemple #4
0
            if (empty($row["keyword{$index}"]) == FALSE) {
                $result['data']['keys'][] = $row["keyword{$index}"];
            }
        }
    }
    $anli = json_decode(Charset('[' . GetAnliList(join($word_id, ',')) . ']', DB_CHARSET, CL_CHARSET), TRUE);
    if (is_array($anli) and empty($anli) == FALSE) {
        foreach ($anli as $index => $row) {
            $item = array('cid' => $row['id'], 'title' => $row['title'], 'havpic' => '0', 'words' => '0', 'collect' => '0');
            $condition_sub = array('schema' => 'search_result', 'fields' => array('havpic', 'words', '(SELECT title FROM search_object WHERE id=ofurl) AS fromurl'), 'filter' => array('id' => $item['cid']));
            $buf = StorageFind($condition_sub);
            if (is_array($buf) and empty($buf) == FALSE) {
                foreach ($buf as $index => $row) {
                    $item['havpic'] = "{$row['havpic']}";
                    $item['words'] = "{$row['words']}";
                    $item['fromurl'] = "{$row['fromurl']}";
                    $ofurl = $row['ofurl'];
                }
            }
            $filter = array('tid' => Assign($params['tid'], 0), 'uid' => Assign($params['uid'], 0), 'tag' => 5, 'type' => 1);
            if (StorageCount('hh_techuser_shoucang', $filter)) {
                $item['collect'] = '1';
            }
            $result['data']['list'][] = $item;
            $result_count++;
        }
    }
}
if (CheckOpenID($params['openid'], $params['uid']) == TRUE) {
    Techuser_search(Assign($params['uid'], 0), $content, 2, $word_id, $result_count);
}