本文整理汇总了PHP中article::get_count方法的典型用法代码示例。如果您正苦于以下问题:PHP article::get_count方法的具体用法?PHP article::get_count怎么用?PHP article::get_count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类article
的用法示例。
在下文中一共展示了article::get_count方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: module_sheet
function module_sheet()
{
global $global, $smarty;
$cat = get_global('cat');
$page = get_global('page');
$prefix = 'data/mod-sheet';
if ($cat) {
$prefix = $prefix . '/cat-' . $cat;
}
$url = S_SERVER_URL . '?/data/cat-' . $cat . '/page-' . $page . '/index.html';
$str = file_get_contents($url);
$result = json_decode(rawurldecode($str), true);
if (is_array($result)) {
$server_cat_list = $result['cat_list'];
$sheet = $result['sheet'];
for ($i = 0; $i < count($sheet); $i++) {
$obj = new article();
$obj->set_where("art_title = '" . $sheet[$i]['art_title'] . "'");
if ($obj->get_count()) {
$sheet[$i]['is_exist'] = 1;
} else {
$sheet[$i]['is_exist'] = 0;
}
}
$smarty->assign('page_sum', $result['page_sum']);
$smarty->assign('prefix', $prefix);
} else {
$server_cat_list = array();
$sheet = array();
}
$smarty->assign('article', $sheet);
$cat_list = get_local_cat();
if (count($cat_list) < count($server_cat_list)) {
for ($i = 0; $i < count($server_cat_list); $i++) {
$flag = false;
for ($j = 0; $j < count($cat_list); $j++) {
if ($server_cat_list[$i]['cat_id'] == $cat_list[$j]['server_id']) {
$flag = true;
if ($server_cat_list[$i]['cat_name'] != $cat_list[$j]['server_name']) {
$val = $server_cat_list[$i]['cat_id'] . '|' . $server_cat_list[$i]['cat_name'] . '|' . $cat_list[$i]['channel_id'] . '|' . $cat_list[$i]['cat_id'];
$obj = new varia();
$obj->set_value('var_value', $val);
$obj->set_where('var_id = ' . $cat_list[$i]['varia_id']);
$obj->edit();
}
break;
}
}
if (!$flag) {
$val = $server_cat_list[$i]['cat_id'] . '|' . $server_cat_list[$i]['cat_name'] . '|0|0';
$obj = new varia();
$obj->set_value('var_name', 'data_cat');
$obj->set_value('var_value', $val);
$obj->add();
}
}
$cat_list = get_local_cat();
}
$smarty->assign('cat_list', $cat_list);
}
示例2: module_tailor_sheet
function module_tailor_sheet()
{
global $global, $smarty;
$obj = new varia();
$obj->set_where("var_name = 'tailor_data_cat'");
$list = $obj->get_list();
if (count($list)) {
for ($i = 0; $i < count($list); $i++) {
$arr = explode('|', $list[$i]['var_value']);
$cat_list[$i]['server_id'] = $arr[0];
$cat_list[$i]['server_name'] = $arr[1];
}
} else {
$cat_list = array();
}
$smarty->assign('cat_list', $cat_list);
$data_username = rawurlencode(get_varia('data_username'));
$data_password = rawurlencode(get_varia('data_password'));
$cat = get_global('cat');
$page = get_global('page');
$prefix = 'data/mod-tailor_sheet';
$page_sum = 1;
$sheet = array();
if ($cat) {
$prefix = $prefix . '/cat-' . $cat;
}
$url = S_SERVER_URL . 'tailor.php?/tailor/cat-' . $cat . '/page-' . $page . '/data_username-' . $data_username . '/data_password-' . $data_password . '/index.html';
$str = file_get_contents($url);
$result = json_decode(rawurldecode($str), true);
if (is_array($result)) {
if ($result['error'] == 'no') {
$sheet = $result['sheet'];
for ($i = 0; $i < count($sheet); $i++) {
$obj = new article();
$obj->set_where("art_title = '" . $sheet[$i]['art_title'] . "'");
if ($obj->get_count()) {
$sheet[$i]['is_exist'] = 1;
} else {
$sheet[$i]['is_exist'] = 0;
}
}
$page_sum = $result['page_sum'];
}
}
$smarty->assign('page_sum', $page_sum);
$smarty->assign('prefix', $prefix);
$smarty->assign('article', $sheet);
}