本文整理汇总了PHP中getphotourl函数的典型用法代码示例。如果您正苦于以下问题:PHP getphotourl函数的具体用法?PHP getphotourl怎么用?PHP getphotourl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getphotourl函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _cookData
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;
}
示例2: getPhotoList
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;
}
示例3: foreach
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') {
示例4: viewPhoto
/**
*查看照片
*@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);
}
示例5: browseAlbum
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;
}
示例6: array
$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');
}
示例7: elseif
$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();
示例8: elseif
} 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');
示例9: get_photos
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;
}
示例10: _appendPhotosInfo
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;
}
示例11: Showmsg
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'];
示例12: _getPhotosFromExtra
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;
}
示例13: MIN
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();
}
示例14: array
$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) {
示例15: array
*/
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);