예제 #1
0
if (!defined('APP_PATH')) {
    exit("Access is denied.");
}
require_once APP_PATH . 'util/db.php';
require_once APP_PATH . 'util/Collect.class.php';
$collect_size = 300;
// 采集数量
$con = get_con();
$collect = new Collect();
$result = mysql_query("select album_id from {DBPREFIX}album where album_title='' or album_title is null limit {$collect_size}", $con);
$albumIdArr = array();
while (!!($row = mysql_fetch_array($result))) {
    $albumIdArr[] = $row['album_id'];
}
if (!empty($albumIdArr)) {
    $albumInfoArr = $collect->albumInfo($albumIdArr, COVERSAVEPATH, COVERRELATIVEPATH);
    if (!empty($albumInfoArr)) {
        foreach ($albumInfoArr as $album) {
            $data['album_id'] = $album['album_id'];
            $data['album_title'] = $album['album_title'];
            $data['album_cover'] = $album['album_cover'];
            $data['time'] = $album['time'];
            $data['styles'] = $album['styles'];
            $data['company'] = $album['company'];
            $data['description'] = $album['description'];
            $data['status'] = 1;
            // 已审核
            $data['create_time'] = time();
            $albumSql = "update\n                                " . DBPREFIX . "album\n                            set\n                                album_title = '{$data['album_title']}',\n                                album_cover = '{$data['album_cover']}',\n                                time = '{$data['time']}',\n                                styles = '{$data['styles']}',\n                                company = '{$data['company']}',\n\t\t\t\t\t\t\t\tdescription='{$data['description']}',\n\t\t\t\t\t\t\t\tstatus='{$data['status']}',\n\t\t\t\t\t\t\t\tcreate_time='{$data['create_time']}'\n                          where\n                                album_id = {$data['album_id']}";
            // echo $albumSql;die;
            mysql_query($albumSql, $con);