コード例 #1
0
 }
 /* 设置最长执行时间为5分钟 */
 @set_time_limit(300);
 if (isset($_GET['start'])) {
     $page_size = 50;
     // 默认50张/页
     $thumb = empty($_GET['thumb']) ? 0 : 1;
     $watermark = empty($_GET['watermark']) ? 0 : 1;
     $change = empty($_GET['change']) ? 0 : 1;
     $silent = empty($_GET['silent']) ? 0 : 1;
     /* 检查GD */
     if ($image->gd_version() < 1) {
         make_json_error($_LANG['missing_gd']);
     }
     /* 如果需要添加水印,检查水印文件 */
     if (!empty($_CFG['watermark']) && $_CFG['watermark_place'] > 0 && $watermark && !$image->validate_image($_CFG['watermark'])) {
         make_json_error($image->error_msg());
     }
     $title = '';
     if (isset($_GET['total_icon'])) {
         $count = $db->GetOne("SELECT COUNT(*) FROM " . $ecs->table('goods') . " AS g WHERE g.original_img <> ''" . $goods_where);
         $title = sprintf($_LANG['goods_format'], $count, $page_size);
     }
     if (isset($_GET['total_album'])) {
         $count = $GLOBALS['db']->GetOne("SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('goods_gallery') . ' AS album ' . $album_where);
         $title = sprintf('&nbsp;' . $_LANG['gallery_format'], $count, $page_size);
         $module_no = 1;
     }
     $result = array('error' => 0, 'message' => '', 'content' => '', 'module_no' => $module_no, 'done' => 1, 'title' => $title, 'page_size' => $page_size, 'page' => 1, 'thumb' => $thumb, 'watermark' => $watermark, 'total' => 1, 'change' => $change, 'silent' => $silent, 'do_album' => $do_album, 'do_icon' => $do_icon, 'goods_id' => $goods_id, 'brand_id' => $brand_id, 'cat_id' => $cat_id, 'row' => array('new_page' => sprintf($_LANG['page_format'], 1), 'new_total' => sprintf($_LANG['total_format'], ceil($count / $page_size)), 'new_time' => $_LANG['wait'], 'cur_id' => 'time_1'));
     die($json->encode($result));
 } else {