function _cookData($data) { global $db_bbsurl; $data['url'] = $db_bbsurl . '/apps.php?q=galbum&a=view&cyid=' . $data['ownerid'] . '&pid=' . $data['pid']; $data['title'] = $data['aname']; $data['image'] = getphotourl($data['path']); return $data; }
function getPhotoList($sv, $aid) { $array = array(); $sv->setPerpage($sv->getAlbumNumByUid()); $result = $sv->getPhotoListByAid($aid, false, false); list(, $photos) = $result; if (S::isArray($photos)) { foreach ($photos as $photo) { $array[] = array('pid' => $photo['pid'], 'thumbpath' => getphotourl($photo['defaultPath'], $photo['ifthumb']), 'path' => $photo['path']); } } return $array; }
if ($pids) { foreach ($pids as $pid) { updateDatanalyse($pid, 'picFav', 1); } } $db->free_result($query); } else { $photo = $db->get_one("SELECT p.pid,p.pintro,p.aid,p.path,p.uploader,p.ifthumb,a.aname,a.private,a.ownerid FROM pw_cnphoto p LEFT JOIN pw_cnalbum a ON p.aid=a.aid WHERE p.pid=" . S::sqlEscape($id) . " AND a.atype='0'"); empty($photo) && Showmsg('data_error'); $collection['type'] = 'photo'; $collection['uid'] = $photo['ownerid']; $collection['link'] = $db_bbsurl . '/{#APPS_BASEURL#}q=photos&a=view&uid=' . $photo['ownerid'] . "&aid=" . $photo['aid'] . '&pid=' . $id; $collection['photo']['aname'] = $photo['aname']; $collection['photo']['pintro'] = $photo['pintro']; //$collection['photo']['username'] = $photo['uploader']; $collection['photo']['image'] = getphotourl($photo['path'], $photo['ifthumb']); updateDatanalyse($photo['pid'], 'picFav', 1); } } elseif ($type == 'group') { $group = $db->get_one("SELECT id,cname,cnimg,admin FROM pw_colonys WHERE id=" . S::sqlEscape($id)); empty($group) && Showmsg('data_error'); if ($group['cnimg']) { list($cnimg) = geturl("cn_img/{$group['cnimg']}", 'lf'); } else { $cnimg = $imgpath . '/g/groupnopic.gif'; } $collection['username'] = $group['admin']; $collection['link'] = $db_bbsurl . '/{#APPS_BASEURL#}q=group&cyid=' . $id; $collection['group']['name'] = $group['cname']; $collection['group']['image'] = $cnimg; } elseif ($type == 'groupactive') {
/** *查看照片 *@param $pid int 照片ID *@param $aid int 相册ID *@return Array 照片相关信息 */ function viewPhoto($pid) { global $attachpath; $nearphoto = array(); $register = array('db_shield' => $this->_dbshield, "groupid" => $this->_groupid, "pwModeImg" => $this->_pwModeImg); L::loadClass('showpicture', 'colony', false); $sp = new PW_ShowPicture($register); list($photo, $nearphoto, $prePid, $nextPid) = $sp->getPictures($pid); if (empty($photo)) { return 'data_error'; } $album = $this->albumViewRight($photo['aid']); if (!is_array($album)) { return $album; } $photo['privacy'] = $album['privacy']; $photo['uptime'] = get_date($photo['uptime']); $photo['path'] = getphotourl($photo['basepath']); $tmpPath = substr($photo['path'], 0, strlen($attachpath) + 1) == "{$attachpath}/" ? R_P . $photo['path'] : $photo['path']; list($photo['w'], $photo['h']) = getimagesize($tmpPath); if ($this->_dbshield && $photo['groupid'] == 6 && !$this->isPermission()) { $photo['path'] = $this->_pwModeImg . '/banuser.gif'; $photo['pintro'] = appShield('ban_photo_pintro'); } $photoDao = $this->_getDaoFactory('CnPhoto'); $data['hits'] = intval($photo['hits']) + 1; $photoDao->update($data, $pid); return array($photo, $nearphoto, $prePid, $nextPid); }
function browseAlbum($num) { global $db, $db_shield, $groupid, $pwModeImg; $lastpid = $albumdb = $smphoto = array(); $sqladd = ''; $db_shield && $groupid != 3 && ($sqladd = " AND m.groupid<>6 "); $query = $db->query("SELECT c.aid,c.aname,c.photonum,c.ownerid,c.owner,c.lastphoto,c.lastpid,c.lasttime,m.groupid FROM pw_cnalbum c LEFT JOIN pw_members m ON c.ownerid=m.uid WHERE c.atype='0' AND c.private='0' {$sqladd} ORDER BY c.aid DESC LIMIT {$num}"); while ($rt = $db->fetch_array($query)) { $rt['sub_aname'] = substrs($rt['aname'], 18); $rt['lasttime'] = get_date($rt['lasttime']); $rt['lastphoto'] = getphotourl($rt['lastphoto']); if ($rt['lastpid']) { $lastpid = array_merge($lastpid, explode(',', $rt['lastpid'])); } $albumdb[] = $rt; } /* if ($lastpid) { $query = $db->query('SELECT c.pid,c.aid,c.path,m.groupid FROM pw_cnphoto c LEFT JOIN pw_members m ON c.uploader=m.username ORDER BY c.pid DESC LIMIT 5'); while ($rt = $db->fetch_array($query)) { $rt['path'] = getphotourl($rt['path']); if ($rt['groupid'] == 6 && $db_shield && $groupid != 3) { $rt['path'] = $pwModeImg.'/banuser.gif'; } $smphoto[$rt['aid']][] = $rt; } } */ return $albumdb; }
$ifthumb = $rt['ifthumb']; } $photos[] = array('aid' => $selaid, 'pintro' => '', 'path' => $path, 'uploader' => $windid, 'uptime' => $timestamp, 'ifthumb' => $ifthumb); $lastphoto = $path; } if ($photos) { $db->update("INSERT INTO pw_cnphoto (aid,pintro,path,uploader,uptime,ifthumb) VALUES " . pwSqlMulti($photos)); $pid = $db->insert_id(); $photoNum = count($photos); $lastpid = getLastPid($selaid, 4); array_unshift($lastpid, $pid); $db->update("UPDATE pw_cnalbum SET photonum=photonum+" . pwEscape($photoNum) . ",lasttime=" . pwEscape($timestamp) . ',lastpid=' . pwEscape(implode(',', $lastpid)) . (!$selalbum['lastphoto'] ? ',lastphoto=' . pwEscape($lastphoto) : '') . " WHERE aid=" . pwEscape($selaid)); countPosts("+{$photoNum}"); $feedText = ''; foreach ($photos as $value) { $feedText .= "[url={$db_bbsurl}/{#APPS_BASEURL#}space=1&q=galbum&a=view&cyid={$cyid}&pid={$pid}][img]" . getphotourl($value['path'], $value['ifthumb']) . "[/img][/url] "; } pwAddFeed($winduid, 'colony_photo', $cyid, array('lang' => 'colony_photo', 'cyid' => $cyid, 'num' => $photoNum, 'colony_name' => $colony['cname'], 'text' => $feedText)); //积分变动 require_once R_P . 'require/credit.php'; $o_groups_creditset = unserialize($o_groups_creditset); $creditset = getCreditset($o_groups_creditset['Uploadphoto']); $creditset = array_diff($creditset, array(0)); if (!empty($creditset)) { $credit->sets($winduid, $creditset, true); updateMemberid($winduid); addLog($creditlog, $windid, $winduid, 'groups_Uploadphoto'); } if ($creditlog = unserialize($o_groups_creditlog)) { addLog($creditlog['Post'], $windid, $winduid, 'groups_Uploadphoto'); }
$uid = $colonydb['uid']; $username = $colonydb['admin']; $cyid = $colonydb['id']; $title = "[url={$db_bbsurl}/mode.php?m=o&q=group&cyid={$cyid}] {$colonydb['cname']} [/url]"; $descrip = $colonydb['descrip']; } elseif ($type == 'album') { $albumdb = $db->get_one("SELECT aid,ownerid,owner,lastphoto,aintro FROM pw_cnalbum WHERE atype='0' AND aid=" . pwEscape($id)); $photourl = getphotourl($albumdb['lastphoto']); $uid = $albumdb['ownerid']; $username = $albumdb['owner']; $aid = $albumdb['aid']; $title = "[url={$db_bbsurl}/mode.php?m=o&q=photos&space=1&a=album&u={$albumdb['ownerid']}&aid={$aid}] {$username} [/url]"; $descrip = $albumdb['aintro']; } elseif ($type == 'photo') { $photodb = $db->get_one("SELECT p.pid,p.path as basepath,p.pintro,p.ifthumb,a.ownerid,a.owner FROM pw_cnphoto p LEFT JOIN pw_cnalbum a ON p.aid=a.aid WHERE p.pid=" . pwEscape($id) . " AND a.atype='0'"); $photourl = getphotourl($photodb['basepath'], $photodb['ifthumb']); $uid = $photodb['ownerid']; $username = $photodb['owner']; $title = "[url={$db_bbsurl}/mode.php?m=o&q=photos&space=1&a=view&u={$photodb['ownerid']}&pid={$photodb['pid']}] {$photodb['owner']} [/url]"; $descrip = $photodb['pintro']; } elseif ($type == 'user') { $userdb = $db->get_one("SELECT uid, username FROM pw_members WHERE uid=" . pwEscape($id)); $uid = $userdb['uid']; $username = $userdb['username']; $title = "[url={$db_bbsurl}/u.php?action=show&uid={$userdb['uid']}] {$userdb['username']} [/url]"; } elseif ($type == 'topic') { $pw_tmsgs = GetTtable($id); $topicdb = $db->get_one("SELECT t.tid,t.subject,t.anonymous,t.ifshield,t.authorid,t.author,t.postdate,tm.content FROM pw_threads t LEFT JOIN {$pw_tmsgs} tm ON t.tid=tm.tid WHERE t.tid=" . pwEscape($id)); if ($topicdb['ifshield'] == 1) { echo getLangInfo('other', 'share_shield_tpc', $log); ajax_footer();
} elseif ($type == 'photo') { $photo = $db->get_one("SELECT p.pid,p.aid,p.path,p.uploader,p.ifthumb,a.aname,a.private,a.ownerid FROM pw_cnphoto p LEFT JOIN pw_cnalbum a ON p.aid=a.aid WHERE p.pid=" . pwEscape($id) . " AND a.atype='0'"); empty($photo) && Showmsg('data_error'); $link = $db_bbsurl . '/{#APPS_BASEURL#}q=photos&space=1&a=view&pid=' . $id; $type = 'photo'; $share['photo']['uid'] = $photo['ownerid']; $share['photo']['username'] = $photo['uploader']; $share['photo']['image'] = getphotourl($photo['path'], $photo['ifthumb']); } elseif ($type == 'album') { $album = $db->get_one("SELECT aname,ownerid,owner,lastphoto FROM pw_cnalbum WHERE atype='0' AND aid=" . pwEscape($id)); empty($album) && Showmsg('data_error'); $link = $db_bbsurl . '/{#APPS_BASEURL#}q=photos&space=1&a=album&aid=' . $id; $type = 'album'; $share['album']['uid'] = $album['ownerid']; $share['album']['username'] = $album['owner']; $share['album']['image'] = getphotourl($album['lastphoto']); } elseif ($type == 'group') { $group = $db->get_one("SELECT id,cname,cnimg FROM pw_colonys WHERE id=" . pwEscape($id)); empty($group) && Showmsg('data_error'); if ($group['cnimg']) { list($cnimg) = geturl("cn_img/{$group['cnimg']}", 'lf'); } else { $cnimg = $pwModeImg . '/nophoto.gif'; } $link = $db_bbsurl . '/{#APPS_BASEURL#}q=group&cyid=' . $id; $type = 'group'; $share['group']['name'] = $group['cname']; $share['group']['image'] = $cnimg; } elseif ($type == 'diary') { $diary = $db->get_one("SELECT did,subject,uid FROM pw_diary WHERE did=" . pwEscape($id)); empty($diary) && Showmsg('data_error');
function get_photos($uid, $num) { global $winduid; $_sql_where = ''; if ($this->spaceinfo['isMe'] || $this->_isGM) { } elseif ($this->base->isFriend($winduid)) { $_sql_where = ' AND a.private<2'; } else { $_sql_where = ' AND a.private=0'; } $array = array(); $query = $this->_db->query("SELECT b.pid,b.path,b.ifthumb,b.pintro FROM pw_cnalbum a LEFT JOIN pw_cnphoto b ON a.aid=b.aid WHERE a.atype='0' AND a.ownerid=" . S::sqlEscape($uid) . $_sql_where . ' AND b.pid IS NOT NULL ORDER BY b.pid DESC ' . S::sqlLimit($num)); while ($rt = $this->_db->fetch_array($query)) { $rt['path'] = getphotourl($rt['path'], $rt['ifthumb']); $rt['title'] = substrs($rt['pintro'], 20); $array[] = $rt; } return $array; }
function _appendPhotosInfo($writes, $photoIds) { if (!is_array($photoIds) || !count($photoIds)) { return $writes; } $photos = array(); global $db; $query = $db->query("SELECT * FROM pw_cnphoto WHERE pid IN (" . S::sqlImplode($photoIds) . ")"); while ($rt = $db->fetch_array($query)) { $photos[$rt['pid']] = array('photo' => getphotourl($rt['path']), 'photoThumb' => getphotourl($rt['path'], $rt['ifthumb'])); } foreach ($photoIds as $writeId => $photoId) { if (!isset($photos[$photoId])) { continue; } $writes[$writeId]['photo'] = $photos[$photoId]['photo']; $writes[$writeId]['photoThumb'] = $photos[$photoId]['photoThumb']; } return $writes; }
echo "success\t{$ajaxPhotos}"; } else { Showmsg('data_error'); } ajax_footer(); exit; } elseif ($job == 'upload') { define('AJAX', 1); S::gp(array('aid')); $result = $photoService->uploadPhoto($aid); if (!is_array($result)) { Showmsg($result); } list($albumInfo, $pid, $photoNum, $photos) = $result; $photoNum > 0 or Showmsg('data_error'); $photo = getphotourl($photos[0]['path'], 0); echo "success\t{$photo}"; ajax_footer(); } if ($db_question && $o_photos_qcheck) { $qkey = array_rand($db_question); } list(, $showq) = explode("\t", $db_qcheck); $networkTab = $albumTab = 'none'; if ($photoEditor) { $result = $photoService->getAlbumBrowseList(); list(, $albums) = $result; //album Count,albums if (S::isArray($albums)) { $aid = intval($aid); $aid = $aid ? $aid : $albums[0]['aid'];
function _getPhotosFromExtra($extra, $type = null) { if (!isset($extra['photos']) || !is_array($extra['photos']) || !count($extra['photos'])) { return array(); } if (in_array($type, array('photos', 'group_photos'))) { $extra['photos'] = array(current($extra['photos'])); } $photos = array(); $isNotLocalPhoto = isset($extra['isNotLocalPhoto']) ? (bool) $extra['isNotLocalPhoto'] : false; foreach ($extra['photos'] as $photoId => $photoInfo) { if (!$isNotLocalPhoto) { $photoUrl = getphotourl($photoInfo['path']); if (strpos($photoUrl, 'http://') === false) { $photoUrl = $this->_getSiteUrl() . $photoUrl; } } else { $photoUrl = $photoInfo['path']; } $photos[] = array('url' => $photoUrl, 'title' => $photoInfo['pintro']); } return $photos; }
echo "ok\t{$pid}"; } else { echo "end"; } } else { $pid = $db->get_value("SELECT MIN(b.pid) AS pid FROM pw_cnphoto a LEFT JOIN pw_cnphoto b ON a.aid=b.aid AND a.pid<b.pid WHERE a.pid=" . S::sqlEscape($pid)); echo "ok\t{$pid}"; } ajax_footer(); } elseif ($a == 'pre') { define('AJAX', 1); S::gp(array('pid', 'aid'), null, 2); if ($aid) { $next_photo = $db->get_one("SELECT c.pid,c.path,c.ifthumb,m.groupid FROM pw_cnphoto c LEFT JOIN pw_members m ON c.uploader=m.username WHERE c.pid<" . S::sqlEscape($pid) . " AND c.aid=" . S::sqlEscape($aid) . " ORDER BY c.pid DESC"); if ($next_photo) { $next_photo['path'] = getphotourl($next_photo['path'], $next_photo['ifthumb']); if ($next_photo['groupid'] == 6 && $db_shield && $groupid != 3) { $next_photo['path'] = $pwModeImg . '/banuser.gif'; } unset($next_photo['ifthumb']); $pid = pwJsonEncode($next_photo); echo "ok\t{$pid}"; } else { echo "begin"; } } else { $pid = $db->get_value("SELECT MAX(b.pid) AS pid FROM pw_cnphoto a LEFT JOIN pw_cnphoto b ON a.aid=b.aid AND a.pid>b.pid WHERE a.pid=" . S::sqlEscape($pid)); echo "ok\t{$pid}"; } ajax_footer(); }
$userinfo = array(); $pids = ''; $usercache = L::loadDB('Usercache'); $userinfo = $usercache->getByUid($uids); foreach ($userinfo as $uid => $value) { if ($value['photos']) { $pids .= $pids ? ',' . $value['photos']['value'] : $value['photos']['value']; $userinfo[$uid]['photos']['value'] = array(); } } /*最新照片*/ if ($pids) { $pids = explode(',', $pids); $query = $db->query("SELECT cp.pid,cp.path,ca.aname,ca.lasttime,ca.aid,ca.ownerid FROM pw_cnphoto cp LEFT JOIN pw_cnalbum ca USING(aid) WHERE cp.pid IN(" . pwImplode($pids) . ")"); while ($rt = $db->fetch_array($query)) { $rt['path'] = getphotourl($rt['path'], $rt['ifthumb']); $userinfo[$rt['ownerid']]['photos']['value']['aname'] = $rt['aname']; $userinfo[$rt['ownerid']]['photos']['value']['aid'] = $rt['aid']; $userinfo[$rt['ownerid']]['photos']['value']['postdate'] = $rt['lasttime']; $userinfo[$rt['ownerid']]['photos']['value']['photo'][] = $rt; } } /*帖子、相册、日志、记录*/ /*数据合并*/ foreach ($uids as $info) { $usercachedb[$info] = $userdb[$info]; $usercachedb[$info]['app'] = $db_appsdb[$info]; foreach ($userinfo[$info] as $key => $value) { $a_url = ''; if ($key == 'topic') { foreach ($value['value']['attimages'] as $k => $val) {
*/ L::loadClass('photoupload', 'upload', false); $pintro = array($_FILES['writePic']['name']); $img = new PhotoUpload($aid); PwUpload::upload($img); pwFtpClose($ftp); if (!($photos = $img->getAttachs())) { Showmsg('colony_uploadnull'); } $photoNum = count($photos); $pid = $img->getNewID(); $lastpid = getLastPid($aid, 4); array_unshift($lastpid, $pid); $photoInfo = $photos[0]; $db_bbsurl = $db_ifftp == 1 ? '' : $db_bbsurl . '/'; list($photo, $photoThumb) = array($db_bbsurl . getphotourl($photoInfo['path']), $db_bbsurl . getphotourl($photoInfo['path'], $photoInfo['ifthumb'])); $photoThumb = $photoThumb ? $photoThumb : $photo; if (!$rt['private']) { //会员资讯缓存 $userCache = L::loadClass('Usercache', 'user'); /* @var $userCache PW_Usercache */ $userCache->delete($winduid, 'cardphoto'); /* $usercache = L::loadDB('Usercache', 'user'); $usercachedata = $usercache->get($winduid,'photos'); $usercachedata = explode(',',$usercachedata['value']); is_array($usercachedata) || $usercachedata = array(); if (count($usercachedata) >=4) array_pop($usercachedata); array_unshift($usercachedata,$pid); $usercachedata = implode(',',$usercachedata); $usercache->update($winduid,'photos',$pid,$usercachedata);
function _buildPictures($needPictureIds) { $pictures = $this->_getPicturesByPicturesIds($needPictureIds); if (!$pictures) { return null; } $photos = array(); foreach ($pictures as $photo) { $photo['path'] = getphotourl($photo['path'], $photo['ifthumb']); if ($album['groupid'] == 6 && $this->_db_shield && $this->_groupid != 3) { //TODO $album? $photo['path'] = $this->_pwModeImg . '/banuser.gif'; } $photos[] = $photo; } return $photos; }
function browseAlbum($num) { global $db, $db_shield, $groupid, $pwModeImg; $albumdb = array(); $query = $db->query("SELECT c.aid,c.aname,c.photonum,c.ownerid,c.owner,c.lastphoto,c.lasttime,m.groupid FROM pw_cnalbum c LEFT JOIN pw_members m ON c.ownerid=m.uid WHERE c.atype='0' AND c.private='0' ORDER BY c.aid DESC LIMIT {$num}"); while ($rt = $db->fetch_array($query)) { $rt['lasttime'] = get_date($rt['lasttime']); $rt['lastphoto'] = getphotourl($rt['lastphoto']); if ($rt['groupid'] == 6 && $db_shield && $groupid != 3) { $rt['lastphoto'] = $pwModeImg . '/banuser.gif'; $rt['aname'] = appShield('ban_album'); } $albumdb[] = $rt; } return $albumdb; }
$o_maxphotonum && $rt['photonum'] >= $o_maxphotonum && Showmsg('colony_photofull'); require_once R_P . 'lib/upload/photoupload.class.php'; $img = new PhotoUpload($aid); PwUpload::upload($img); pwFtpClose($ftp); if (!($photos = $img->getAttachs())) { refreshto("{$basename}a=upload", 'colony_uploadnull'); } $photoNum = count($photos); $pid = $img->getNewID(); $lastpid = getLastPid($aid, 4); array_unshift($lastpid, $pid); if (!$rt['private']) { $feedText = "[url={$db_bbsurl}/{$basename}space=1&a=album&aid={$aid}&u={$winduid}]{$rt[aname]}[/url]\n"; foreach ($photos as $value) { $feedText .= "[url={$db_bbsurl}/{#APPS_BASEURL#}q=photos&space=1&a=view&pid={$pid}&u={$winduid}][img]" . getphotourl($value['path'], $value['ifthumb']) . "[/img][/url] "; } pwAddFeed($winduid, 'photo', $pid, array('num' => $photoNum, 'text' => $feedText)); //会员资讯缓存 $usercache = L::loadDB('Usercache'); $usercachedata = $usercache->get($winduid, 'photos'); $usercachedata = explode(',', $usercachedata['value']); is_array($usercachedata) || ($usercachedata = array()); if (count($usercachedata) >= 4) { array_pop($usercachedata); } array_unshift($usercachedata, $pid); $usercachedata = implode(',', $usercachedata); $usercache->update($winduid, 'photos', $pid, $usercachedata); } $db->update("UPDATE pw_cnalbum SET photonum=photonum+" . pwEscape($photoNum, false) . ",lasttime=" . pwEscape($timestamp, false) . ',lastpid=' . pwEscape(implode(',', $lastpid)) . (!$rt['lastphoto'] ? ',lastphoto=' . pwEscape($img->getLastPhoto()) : '') . " WHERE aid=" . pwEscape($aid));
} $photoNum = count($photos); $pid = $img->getNewID(); $lastpid = getLastPid($aid, 4); array_unshift($lastpid, $pid); if ($rt['atype'] == 1) { $cyid = $rt['ownerid']; $feedText = ''; foreach ($photos as $value) { $feedText .= "[url={$db_bbsurl}/{#APPS_BASEURL#}space=1&q=galbum&a=view&cyid={$cyid}&pid={$pid}][img]" . getphotourl($value['path'], $value['ifthumb']) . "[/img][/url] "; } pwAddFeed($uid, 'colony_photo', $cyid, array('lang' => 'colony_photo', 'cyid' => $cyid, 'num' => $photoNum, 'colony_name' => $colony['cname'], 'text' => $feedText)); } elseif (!$rt['private']) { $feedText = "[url={$db_bbsurl}/{#APPS_BASEURL#}space=1&q=photos&a=album&aid={$aid}&u={$uid}]{$rt[aname]}[/url]\n"; foreach ($photos as $value) { $feedText .= "[url={$db_bbsurl}/mode.php?m=o&space=1&q=photos&a=view&pid={$pid}&u={$uid}][img]" . getphotourl($value['path'], $value['ifthumb']) . "[/img][/url] "; } pwAddFeed($uid, 'photo', $pid, array('num' => $photoNum, 'text' => $feedText)); //会员资讯缓存 $usercache = L::loadDB('Usercache'); $usercachedata = $usercache->get($uid, 'photos'); $usercachedata = explode(',', $usercachedata['value']); is_array($usercachedata) || ($usercachedata = array()); if (count($usercachedata) >= 4) { array_pop($usercachedata); } array_unshift($usercachedata, $pid); $usercachedata = implode(',', $usercachedata); $usercache->update($uid, 'photos', $pid, $usercachedata); } $db->update("UPDATE pw_cnalbum SET photonum=photonum+" . pwEscape($photoNum, false) . ",lasttime=" . pwEscape($timestamp, false) . ',lastpid=' . pwEscape(implode(',', $lastpid)) . (!$rt['lastphoto'] ? ',lastphoto=' . pwEscape($img->getLastPhoto()) : '') . " WHERE aid=" . pwEscape($aid));