本文整理汇总了PHP中pic_cover_get函数的典型用法代码示例。如果您正苦于以下问题:PHP pic_cover_get函数的具体用法?PHP pic_cover_get怎么用?PHP pic_cover_get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pic_cover_get函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAlbumImagePic
public static function getAlbumImagePic($value)
{
loadcache('albumcategory');
require_once DISCUZ_ROOT . './source/function/function_home.php';
if ($value['friend'] != 4 && ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
$value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
} elseif ($value['picnum']) {
$value['pic'] = STATICURL . 'image/common/nopublish.gif';
} else {
$value['pic'] = '';
}
return $value['pic'];
}
示例2: getblockhtml
//.........这里部分代码省略.........
$do = $blockname;
if (ckprivacy('doing', 'view')) {
$dolist = array();
$sql = "SELECT * FROM " . DB::table('home_doing') . " WHERE uid='{$uid}' ORDER BY dateline DESC LIMIT 0,{$shownum}";
$query = DB::query($sql);
while ($value = DB::fetch($query)) {
if ($value['status'] == 0 || $value['uid'] == $_G['uid']) {
$dolist[] = $value;
}
}
if ($dolist) {
foreach ($dolist as $dv) {
$doid = $dv['doid'];
$_G[gp_key] = $key = random(8);
$html .= "<li class=\"pbn bbda\">";
$html .= $dv['message'];
$html .= " <a href=\"home.php?mod=space&uid={$dv['uid']}&do=doing&view=me&from=space&doid={$dv['doid']}\" target=\"_blank\" class=\"xg1\">" . lang('space', 'block_doing_reply') . "</a>";
$html .= "</li>";
}
} else {
$html .= "<p class=\"emp\">" . lang('space', 'block_doing_no_content') . "</p>";
}
} else {
$html .= "<p class=\"emp\">" . lang('space', 'block_view_noperm') . "</p>";
}
$html = '<ul class="xl">' . $html . '</ul>';
break;
case 'blog':
$do = $blockname;
$query = DB::query("SELECT bf.*, b.* FROM " . DB::table('home_blog') . " b\r\n\t\t\t\tLEFT JOIN " . DB::table('home_blogfield') . " bf ON bf.blogid=b.blogid\r\n\t\t\t\tWHERE b.uid='{$uid}'\r\n\t\t\t\tORDER BY b.dateline DESC LIMIT 0,{$shownum}");
while ($value = DB::fetch($query)) {
if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
if ($value['pic']) {
$value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
}
$value['message'] = $value['friend'] == 4 ? '' : getstr($value['message'], 150, 0, 0, 0, -1);
$html .= lang('space', 'blog_li', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'subject' => $value['subject'], 'date' => dgmdate($value['dateline'], 'Y-m-d')));
if (!isset($parameters['showmessage'])) {
$parameters['showmessage'] = true;
}
if ($parameters['showmessage']) {
if ($value['pic']) {
$html .= lang('space', 'blog_li_img', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'src' => $value['pic']));
}
$html .= "<dd>{$value['message']}</dd>";
}
$html .= lang('space', 'blog_li_ext', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'viewnum' => $value['viewnum'], 'replynum' => $value['replynum']));
$html .= "</dl>";
} else {
$html .= '<p>' . lang('space', 'block_view_noperm') . '</p>';
}
}
$more = $html ? '<p class="ptm" style="text-align: right;"><a href="home.php?mod=space&uid=' . $uid . '&do=blog&view=me&from=space">' . lang('space', 'viewmore') . '</a></p>' : '';
$contentclassname = ' xld';
$html = $html . $more;
break;
case 'album':
$do = $blockname;
if (ckprivacy('album', 'view')) {
$query = DB::query("SELECT * FROM " . DB::table('home_album') . " WHERE uid='{$uid}' ORDER BY updatetime DESC LIMIT 0,{$shownum}");
while ($value = DB::fetch($query)) {
if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
$value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
$html .= lang('space', 'album_li', array('albumid' => $value['albumid'], 'src' => $value['pic'], 'albumname' => $value['albumname'], 'uid' => $value['uid'], 'picnum' => $value['picnum'], 'date' => dgmdate($value['updatetime'], 'n-j')));
}
}
示例3: blog_get_stick
function blog_get_stick($uid, $stickblogs, $summarylen)
{
$list = array_flip($stickblogs);
if ($stickblogs) {
$data_blog = C::t('home_blog')->fetch_all($stickblogs);
$data_blogfield = C::t('home_blogfield')->fetch_all($stickblogs);
foreach ($data_blog as $curblogid => $value) {
$value = array_merge($value, (array) $data_blogfield[$curblogid]);
$value['message'] = getstr($value['message'], $summarylen, 0, 0, 0, -1);
$value['message'] = preg_replace("/&[a-z]+\\;/i", '', $value['message']);
if ($value['pic']) {
$value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
}
$value['dateline'] = dgmdate($value['dateline']);
$value['stickflag'] = true;
$list[$value['blogid']] = $value;
}
}
return $list;
}
示例4: feed_publish
function feed_publish($id, $idtype, $add=0) {
global $_G;
$id = intval($id);
if(empty($id)) {
return;
}
if(!helper_access::check_module('feed')) {
return false;
}
$setarr = array();
switch ($idtype) {
case 'blogid':
$value = array_merge(
C::t('home_blog')->fetch($id),
C::t('home_blogfield')->fetch($id)
);
if($value) {
if($value['friend'] != 3) {
$setarr['icon'] = 'blog';
$setarr['id'] = $value['blogid'];
$setarr['idtype'] = $idtype;
$setarr['uid'] = $value['uid'];
$setarr['username'] = $value['username'];
$setarr['dateline'] = $value['dateline'];
$setarr['target_ids'] = $value['target_ids'];
$setarr['friend'] = $value['friend'];
$setarr['hot'] = $value['hot'];
$status = $value['status'];
$url = "home.php?mod=space&uid=$value[uid]&do=blog&id=$value[blogid]";
if($value['friend'] == 4) {
$setarr['title_template'] = 'feed_blog_password';
$setarr['title_data'] = array('subject' => "<a href=\"$url\">$value[subject]</a>");
} else {
if($value['pic']) {
$setarr['image_1'] = pic_cover_get($value['pic'], $value['picflag']);
$setarr['image_1_link'] = $url;
}
$setarr['title_template'] = 'feed_blog_title';
$setarr['body_template'] = 'feed_blog_body';
$value['message'] = preg_replace("/&[a-z]+\;/i", '', $value['message']);
$setarr['body_data'] = array(
'subject' => "<a href=\"$url\">$value[subject]</a>",
'summary' => getstr($value['message'], 150, 0, 0, 0, -1)
);
}
}
}
break;
case 'albumid':
$key = 1;
if($id > 0) {
$query = C::t('home_pic')->fetch_all_by_sql('p.'.DB::field('albumid', $id), 'a.dateline DESC', 0, 4);
foreach($query as $value) {
if($value['friend'] <= 2) {
if(empty($setarr['icon'])) {
$setarr['icon'] = 'album';
$setarr['id'] = $value['albumid'];
$setarr['idtype'] = $idtype;
$setarr['uid'] = $value['uid'];
$setarr['username'] = $value['username'];
$setarr['dateline'] = $value['dateline'];
$setarr['target_ids'] = $value['target_ids'];
$setarr['friend'] = $value['friend'];
$status = $value['status'];
$setarr['title_template'] = 'feed_album_title';
$setarr['body_template'] = 'feed_album_body';
$setarr['body_data'] = array(
'album' => "<a href=\"home.php?mod=space&uid=$value[uid]&do=album&id=$value[albumid]\">$value[albumname]</a>",
'picnum' => $value['picnum']
);
}
$setarr['image_'.$key] = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote']);
$setarr['image_'.$key.'_link'] = "home.php?mod=space&uid=$value[uid]&do=album&picid=$value[picid]";
$key++;
} else {
break;
}
}
}
break;
case 'picid':
$plussql = $id>0 ? 'p.'.DB::field('picid', $id) : 'p.'.DB::field('uid', $_G[uid]).' ORDER BY dateline DESC LIMIT 1';
$query = C::t('home_pic')->fetch_all_by_sql($plussql);
if($value = $query[0]) {
if(empty($value['friend'])) {
$setarr['icon'] = 'album';
$setarr['id'] = $value['picid'];
$setarr['idtype'] = $idtype;
$setarr['uid'] = $value['uid'];
$setarr['username'] = $value['username'];
$setarr['dateline'] = $value['dateline'];
$setarr['target_ids'] = $value['target_ids'];
$setarr['friend'] = $value['friend'];
$setarr['hot'] = $value['hot'];
$status = $value['status'];
$url = "home.php?mod=space&uid=$value[uid]&do=album&picid=$value[picid]";
$setarr['image_1'] = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote']);
$setarr['image_1_link'] = $url;
$setarr['title_template'] = 'feed_pic_title';
//.........这里部分代码省略.........
示例5: intval
$sql .= $friend ? " AND a.friend = '{$friend}'" : '';
$orderby = $orderby ? "a.{$orderby}" : 'a.updatetime';
$ordersc = $ordersc ? "{$ordersc}" : 'DESC';
if ($_G['adminid'] == 2 && $endtime - $starttime > 86400 * 16 || $_G['adminid'] == 3 && $endtime - $starttime > 86400 * 8) {
$error = 'album_mod_range_illegal';
}
if (!$error) {
if ($detail) {
$_G['gp_perpage'] = intval($_G['gp_perpage']) < 1 ? 20 : intval($_G['gp_perpage']);
$perpage = $_G['gp_pp'] ? $_G['gp_pp'] : $_G['gp_perpage'];
$query = DB::query("SELECT * FROM " . DB::table('home_album') . " a WHERE 1 {$sql} ORDER BY {$orderby} {$ordersc} LIMIT " . ($page - 1) * $perpage . ",{$perpage}");
$albums = '';
include_once libfile('function/home');
while ($album = DB::fetch($query)) {
if ($album['friend'] != 4 && ckfriend($album['uid'], $album['friend'], $album['target_ids'])) {
$album['pic'] = pic_cover_get($album['pic'], $album['picflag']);
} else {
$album['pic'] = STATICURL . 'image/common/nopublish.gif';
}
$album['updatetime'] = dgmdate($album['updatetime']);
switch ($album['friend']) {
case '0':
$privacy_name = $lang[setting_home_privacy_alluser];
break;
case '1':
$privacy_name = $lang[setting_home_privacy_friend];
break;
case '2':
$privacy_name = $lang[setting_home_privacy_specified_friend];
break;
case '3':
示例6: showmessage
$query = DB::query("SELECT * FROM " . DB::table('home_album') . " WHERE albumid='{$id}'");
if (!($album = DB::fetch($query))) {
showmessage('album_does_not_exist');
}
if ($album['friend']) {
showmessage('album_can_not_share');
}
if (isblacklist($album['uid'])) {
showmessage('is_blacklist');
}
$arr['itemid'] = $id;
$arr['fromuid'] = $album['uid'];
$arr['title_template'] = lang('spacecp', 'share_album');
$arr['body_template'] = '<b>{albumname}</b><br>{username}';
$arr['body_data'] = array('albumname' => "<a href=\"home.php?mod=space&uid={$album['uid']}&do=album&id={$album['albumid']}\">{$album['albumname']}</a>", 'username' => "<a href=\"home.php?mod=space&uid={$album['uid']}\">" . $album['username'] . "</a>");
$arr['image'] = pic_cover_get($album['pic'], $album['picflag']);
$arr['image_link'] = "home.php?mod=space&uid={$album['uid']}&do=album&id={$album['albumid']}";
$note_uid = $album['uid'];
$note_message = 'share_album';
$note_values = array('url' => "home.php?mod=space&uid={$album['uid']}&do=album&id={$album['albumid']}", 'albumname' => $album['albumname'], 'from_id' => $id, 'from_idtype' => 'albumid');
break;
case 'pic':
$feed_hash_data = "picid{$id}";
$query = DB::query("SELECT album.username, album.albumid, album.albumname, album.friend, pf.*, pic.*\r\n\t\t\t\tFROM " . DB::table('home_pic') . " pic\r\n\t\t\t\tLEFT JOIN " . DB::table('home_picfield') . " pf ON pf.picid=pic.picid\r\n\t\t\t\tLEFT JOIN " . DB::table('home_album') . " album ON album.albumid=pic.albumid\r\n\t\t\t\tWHERE pic.picid='{$id}'");
if (!($pic = DB::fetch($query))) {
showmessage('image_does_not_exist');
}
if (in_array($pic['status'], array(1, 2))) {
showmessage('moderate_pic_not_share');
}
if ($pic['friend']) {
示例7: cplang
$note_uid = $arrangement['uid'];
$note_message = cplang('note_share_arrangement', array("space.php?uid=$arrangement[uid]&do=arrangement&id=$arrangement[arrangementid]", $arrangement['subject']));
break;
*/
case 'blog':
$query = $_SGLOBAL['db']->query("SELECT b.*,bf.message,bf.hotuser FROM " . tname('blog') . " b\r\n\t\t\t\tLEFT JOIN " . tname('blogfield') . " bf ON bf.blogid=b.blogid\r\n\t\t\t\tWHERE b.blogid='{$id}'");
$blog = $_SGLOBAL['db']->fetch_array($query);
//实名
realname_set($blog['uid'], $blog['username']);
realname_get();
$arr['title_template'] = cplang('share_blog');
$arr['body_template'] = '<b>{subject}</b><br>{username}<br>{message}';
$arr['body_data'] = array('subject' => "<a href=\"space.php?uid={$blog['uid']}&do=blog&id={$blog['blogid']}\">{$blog['subject']}</a>", 'username' => "<a href=\"space.php?uid={$blog['uid']}\">" . $_SN[$blog['uid']] . "</a>", 'message' => getstr($blog['message'], 150, 0, 1, 0, 0, -1));
if ($blog['pic']) {
$arr['image'] = pic_cover_get($blog['pic'], $blog['picflag']);
$arr['image_link'] = "space.php?uid={$blog['uid']}&do=blog&id={$blog['blogid']}";
}
//通知
$note_uid = $blog['uid'];
$note_message = cplang('note_share_blog', array("space.php?uid={$blog['uid']}&do=blog&id={$blog['blogid']}", $blog['subject']));
$hotarr = array('blogid', $blog['blogid'], $blog['hotuser']);
break;
/*
case 'album':
$query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('album')." WHERE albumid='$id'");
$album = $_SGLOBAL['db']->fetch_array($query);
//实名
realname_set($album['uid'], $album['username']);
realname_get();
示例8: pic_cover_get
if ($value['pic']) {
$value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
}
$value['message'] = $value['friend'] == 4 ? '' : getstr($value['message'], 150, 0, 0, 0, 0, -1);
$bloglist[] = $value;
}
}
$blognum = count($bloglist);
}
//ᅬ¢ᄇ£
$albumlist = array();
if ($_SGLOBAL['mygroupid'] == 3 || $space['albumnum'] && ckprivacy('album')) {
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('album') . " WHERE uid='{$space['uid']}' ORDER BY updatetime DESC LIMIT 0,6");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
$value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
$albumlist[] = $value;
}
}
}
//友情链接
$flink = array();
if ($space['groupid'] == 3) {
$fquery = $_SGLOBAL['db']->query("SELECT flink FROM " . tname('publicflink') . " WHERE uid={$space['uid']}");
if ($fresult = $_SGLOBAL['db']->fetch_array($fquery)) {
$flink = json_decode($fresult['flink'], true);
}
}
//ᅯᄚ¥
$walllist = array();
if ($_SGLOBAL['mygroupid'] == 3 || ckprivacy('wall')) {
示例9: getblockhtml
function getblockhtml($blockname, $parameters = array())
{
global $_G, $space;
$parameters = empty($parameters) ? array() : $parameters;
$list = array();
$sql = $title = $html = $wheresql = $ordersql = '';
$shownum = 6;
$uid = intval($space['uid']);
$shownum = empty($parameters['shownum']) ? $shownum : intval($parameters['shownum']);
switch ($blockname) {
case 'profile':
$html .= '<div class="avt avtm">' . avatar($space['uid'], 'middle');
$html .= '<h2>' . $space['username'] . '</h2>';
$html .= '</div><ul class="xl xl2 cl">';
if ($space['self']) {
$html .= '<li><a href="home.php?mod=space&diy=yes">' . lang('space', 'block_profile_diy') . '</a></li>';
$html .= '<li><a href="home.php?mod=space&do=wall">' . lang('space', 'block_profile_wall') . '</a></li>';
$html .= '<li><a href="home.php?mod=spacecp&ac=avatar">' . lang('space', 'block_profile_avatar') . '</a></li>';
$html .= '<li><a href="home.php?mod=spacecp&ac=profile">' . lang('space', 'block_profile_update') . '</a></li>';
} else {
require_once libfile('function/friend');
$isfriend = friend_check($space['uid']);
if (!$isfriend) {
$html .= "<li><a href=\"home.php?mod=spacecp&ac=friend&op=add&uid={$space['uid']}&handlekey=addfriendhk_{$space[uid]}\" id=\"a_friend_li_{$space[uid]}\" onclick=\"showWindow(this.id, this.href, 'get', 0);\">" . lang('space', 'block_profile_friend_add') . "</a></li>";
} else {
$html .= "<li><a href=\"home.php?mod=spacecp&ac=friend&op=ignore&uid={$space['uid']}&handlekey=ignorefriendhk_{$space[uid]}\" id=\"a_ignore_{$space[uid]}\" onclick=\"showWindow(this.id, this.href, 'get', 0);\">" . lang('space', 'block_profile_friend_ignore') . "</a></li>";
}
$html .= "<li><a href=\"home.php?mod=space&uid={$space['uid']}&do=wall\">" . lang('space', 'block_profile_wall_to_me') . "</a></li>";
$html .= "<li><a href=\"home.php?mod=spacecp&ac=poke&op=send&uid={$space['uid']}&handlekey=propokehk_{$space[uid]}\" id=\"a_poke_{$space[uid]}\" onclick=\"showWindow(this.id, this.href, 'get', 0);\">" . lang('space', 'block_profile_poke') . "</a></li>";
$html .= "<li><a href=\"home.php?mod=spacecp&ac=pm&op=showmsg&handlekey=showmsg_{$space['uid']}&touid={$space['uid']}&pmid=0&daterange=2\" id=\"a_sendpm_{$space['uid']}\" onclick=\"showWindow('showMsgBox', this.href, 'get', 0)\">" . lang('space', 'block_profile_sendmessage') . "</a></li>";
}
$html .= '</ul>';
$html = '<div class="content"><div id="pcd">' . $html . '</div></div>';
break;
case 'doing':
$dolist = array();
$sql = "SELECT * FROM " . DB::table('home_doing') . " WHERE uid='{$uid}' ORDER BY dateline DESC LIMIT 0,{$shownum}";
$query = DB::query($sql);
while ($value = DB::fetch($query)) {
$dolist[] = $value;
}
if ($dolist) {
foreach ($dolist as $dv) {
$doid = $dv['doid'];
$_G[gp_key] = $key = random(8);
$html .= "<li class=\"pbn bbda\">";
$html .= $dv['message'];
$html .= " <a href=\"home.php?mod=space&uid={$dv['uid']}&do=doing&view=me&from=space&doid={$dv['doid']}\" target=\"_blank\" class=\"xg1\">" . lang('space', 'block_doing_reply') . "</a>";
$html .= "</li>";
}
} else {
$html .= "<p class=\"emp\">" . lang('space', 'block_doing_no_content') . "</p>";
}
$html = '<div class="content"><ul class="xl">' . $html . '</ul></div>';
break;
case 'blog':
$query = DB::query("SELECT bf.*, b.* FROM " . DB::table('home_blog') . " b\n\t\t\t\tLEFT JOIN " . DB::table('home_blogfield') . " bf ON bf.blogid=b.blogid\n\t\t\t\tWHERE b.uid='{$uid}'\n\t\t\t\tORDER BY b.dateline DESC LIMIT 0,{$shownum}");
while ($value = DB::fetch($query)) {
if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
if ($value['pic']) {
$value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
}
$value['message'] = $value['friend'] == 4 ? '' : getstr($value['message'], 150, 0, 0, 0, 0, -1);
$html .= lang('space', 'blog_li', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'subject' => $value['subject'], 'date' => dgmdate($value['dateline'], 'Y-m-d')));
if ($parameters['showmessage']) {
if ($value['pic']) {
$html .= lang('space', 'blog_li_img', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'src' => $value['pic']));
}
$html .= "<dd>{$value['message']}</dd>";
}
$html .= lang('space', 'blog_li_ext', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'viewnum' => $value['viewnum'], 'replynum' => $value['replynum']));
$html .= "</dl>";
} else {
$html .= '<p>' . lang('space', 'block_view_noperm') . '</p>';
}
}
$more = $html ? '<p class="ptm" style="text-align: right;"><a href="home.php?mod=space&uid=' . $space['uid'] . '&do=blog&view=me&from=space">' . lang('space', 'viewmore') . '</a></p>' : '';
$html = '<div class="content xld">' . $html . $more . '</div>';
break;
case 'album':
if (ckprivacy('album', 'view')) {
$query = DB::query("SELECT * FROM " . DB::table('home_album') . " WHERE uid='{$uid}' ORDER BY updatetime DESC LIMIT 0,{$shownum}");
while ($value = DB::fetch($query)) {
if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
$value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
$html .= lang('space', 'album_li', array('albumid' => $value['albumid'], 'src' => $value['pic'], 'albumname' => $value['albumname'], 'uid' => $value['uid'], 'picnum' => $value['picnum'], 'date' => dgmdate($value['updatetime'], 'n-j')));
}
}
} else {
$html .= '<li>' . lang('space', 'block_view_noperm') . '</li>';
}
$html = '<div class="content"><ul class="ml mla cl">' . $html . '</ul></div>';
break;
case 'feed':
if (ckprivacy('feed', 'view')) {
require_once libfile('function/feed');
$query = DB::query("SELECT * FROM " . DB::table('home_feed') . " WHERE uid='{$uid}' ORDER BY dateline DESC LIMIT 0,{$shownum}");
while ($value = DB::fetch($query)) {
if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
$html .= mkfeedhtml(mkfeed($value));
//.........这里部分代码省略.........
示例10: _album_pic_get_url
/**
* 家园-个人空间-相册(space_album):获取图片地址
* @access protected
* @param string $type 类型,可选值'album','albumpic'
* @return string
*/
function _album_pic_get_url($type = 'album')
{
global $album, $pic, $_G;
$pic_url = '';
if ($type == 'album') {
require_once libfile('function/home');
$pic_url = isset($album['pic']) & isset($album['picflag']) ? pic_cover_get($album['pic'], $album['picflag']) : '';
} elseif ($type == 'albumpic') {
$pic_url = isset($pic['pic']) ? (string) $pic['pic'] : '';
}
return 0 === strpos($pic_url, 'http') || 0 === strpos($pic_url, 'ftp') ? $pic_url : $_G['siteurl'] . $pic_url;
}
示例11: feed_publish
function feed_publish($id, $idtype, $add = 0, $fromdevice = '')
{
global $_SGLOBAL, $_SC;
$setarr = array();
switch ($idtype) {
case 'arrangementid':
$query = $_SGLOBAL['db']->query("SELECT * from " . tname('arrangement') . " WHERE arrangementid='{$id}'");
if ($value = $_SGLOBAL['db']->fetch_array($query)) {
//基本
$setarr['icon'] = 'arrangement';
$setarr['id'] = $value['arrangementid'];
$setarr['idtype'] = $idtype;
$setarr['uid'] = $value['uid'];
//$setarr['username'] = $value['username'];
$setarr['dateline'] = $value['dateline'];
//$setarr['target_ids'] = $value['target_ids'];
//$setarr['friend'] = $value['friend'];
//$setarr['hot'] = $value['hot'];
//详细
$url = "space.php?uid={$value['uid']}&do=arrangement&id={$value['arrangementid']}";
if ($value['pic']) {
$setarr['image_1'] = pic_cover_get($value['pic'], $value['picflag']);
$setarr['image_1_link'] = $url;
}
$setarr['title_template'] = cplang('feed_arrangement');
$setarr['body_template'] = '<b>{subject}</b><br>{summary}';
$setarr['body_data'] = array('subject' => "<a href=\"{$url}\">{$value['subject']}</a>", 'summary' => getstr($value['message'], 150, 1, 1, 0, 0, -1));
}
break;
case 'calendar':
$query = $_SGLOBAL['db']->query("SELECT * from " . tname('calendar') . " WHERE id='{$id}'");
if ($value = $_SGLOBAL['db']->fetch_array($query)) {
//基本
$setarr['icon'] = 'calendar';
$setarr['id'] = $value['id'];
$setarr['idtype'] = $idtype;
$setarr['uid'] = $value['uid'];
$setarr['dateline'] = $value['dateline'];
//详细
$url = "space.php?uid={$value['uid']}&do=calendar&id={$value['id']}";
$setarr['title_template'] = cplang('feed_calendar');
$setarr['body_template'] = '<b>{subject}</b>';
$setarr['body_data'] = array('subject' => "<a href=\"{$url}\">{$value['calendar_name']}</a>");
}
break;
case 'blogid':
$query = $_SGLOBAL['db']->query("SELECT b.*, bf.* FROM " . tname('blog') . " b\r\n\t\t\t\tLEFT JOIN " . tname('blogfield') . " bf ON bf.blogid=b.blogid\r\n\t\t\t\tWHERE b.blogid='{$id}'");
if ($value = $_SGLOBAL['db']->fetch_array($query)) {
if ($value['friend'] != 3) {
//基本
$setarr['icon'] = 'blog';
$setarr['icontype'] = $_POST['iswork'] ? 'work' : '';
$setarr['id'] = $value['blogid'];
$setarr['idtype'] = $idtype;
$setarr['uid'] = $value['uid'];
$setarr['username'] = $value['username'];
$setarr['dateline'] = $value['dateline'];
$setarr['target_ids'] = $value['target_ids'];
$setarr['friend'] = $value['friend'];
$setarr['hot'] = $value['hot'];
//详细
$url = "space.php?uid={$value['uid']}&do=blog&id={$value['blogid']}";
if ($value['friend'] == 4) {
//加密
$setarr['title_template'] = cplang('feed_blog_password');
$setarr['title_data'] = array('subject' => "<a href=\"{$url}\">{$value['subject']}</a>");
} else {
//非私人
if ($value['pic']) {
$setarr['image_1'] = pic_cover_get($value['pic'], $value['picflag']);
$setarr['image_1_link'] = $url;
}
$setarr['title_template'] = cplang('feed_blog');
$setarr['body_template'] = '<b>{subject}</b><br>{summary}';
$Message = getstr($value['message'], 150, 1, 1, 0, 0, -1);
$setarr['body_data'] = array('subject' => "<a href=\"{$url}\">{$value['subject']}</a>", 'summary' => $Message);
}
}
}
break;
case 'albumid':
$key = 1;
if ($id > 0) {
$query = $_SGLOBAL['db']->query("SELECT p.*, a.username, a.albumname, a.picnum, a.friend, a.target_ids FROM " . tname('pic') . " p\r\n\t\t\t\t\tLEFT JOIN " . tname('album') . " a ON a.albumid=p.albumid\r\n\t\t\t\t\tWHERE p.albumid='{$id}' ORDER BY dateline DESC LIMIT 0,4");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
if ($value['friend'] <= 2) {
if (empty($setarr['icon'])) {
//基本
$setarr['icon'] = 'album';
$setarr['id'] = $value['albumid'];
$setarr['idtype'] = $idtype;
$setarr['uid'] = $value['uid'];
$setarr['username'] = $value['username'];
$setarr['dateline'] = $value['dateline'];
$setarr['target_ids'] = $value['target_ids'];
$setarr['friend'] = $value['friend'];
//详细
$setarr['title_template'] = '{actor} ' . cplang('upload_album');
$setarr['body_template'] = '<b>{album}</b><br>' . cplang('the_total_picture', array('{picnum}'));
$setarr['body_data'] = array('album' => "<a href=\"space.php?uid={$value['uid']}&do=album&id={$value['albumid']}\">{$value['albumname']}</a>", 'picnum' => $value['picnum']);
//.........这里部分代码省略.........
示例12: array
$where[] = 'uid=' . $brandresult['uid'];
$where[] = 'bid=' . $bid;
$albumcat = C::t('#sanree_brand#sanree_brand_album_category')->fetch_all_by_searchd($where, 'displayorder,dateline DESC');
$bids = array();
foreach ($albumcat as $data) {
$bids[] = $data[catid];
}
$maxpic = $maxishomepic;
$albumlist = array();
for ($i = 0; $i < $maxpic; $i++) {
$albumlist[$i]['pic'] = 'source/plugin/sanree_brand/tpl/good/images/nophoto.gif';
$albumlist[$i]['thumbpic'] = 'source/plugin/sanree_brand/tpl/good/images/nophoto.gif';
$albumlist[$i]['albumname'] = srlang('no_pic');
}
$aids = "''";
if ($bids) {
$where = "AND catid in(" . implode($bids, ",") . ") AND ishome=1";
$albumdata = C::t('#sanree_brand#sanree_brand_album')->fetch_all_by_searchex($where, 'ishome desc,displayorder,albumid desc', 0, $maxpic);
include_once libfile('function/home');
$aids = '[';
$tmparray = array();
foreach ($albumdata as $key => $album) {
$album['thumbpic'] = $isalbumthumb == 1 ? sr_albumimage($album['pic'], 165, 165) : pic_cover_get($album['pic'], 1);
$album['pic'] = pic_cover_get($album['pic'], 1);
$albumlist[$key] = $album;
$tmparray[] = "'{$album['albumid']}'";
}
$aids .= implode($tmparray, ",");
$aids .= ']';
}
include templateEx($plugin['identifier'] . ':' . $template . '/album');
示例13: blog_get_stick
function blog_get_stick($uid, $stickblogs, $summarylen)
{
$list = array_flip($stickblogs);
$stickblogs = dimplode($stickblogs);
if ($stickblogs) {
$query = DB::query("SELECT bf.*, b.* FROM " . DB::table('home_blog') . " b {$f_index}\r\n\t\t\tLEFT JOIN " . DB::table('home_blogfield') . " bf ON bf.blogid=b.blogid\r\n\t\t\tWHERE b.blogid IN ({$stickblogs})");
while ($value = DB::fetch($query)) {
$value['message'] = getstr($value['message'], $summarylen, 0, 0, 0, -1);
$value['message'] = preg_replace("/&[a-z]+\\;/i", '', $value['message']);
if ($value['pic']) {
$value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
}
$value['dateline'] = dgmdate($value['dateline']);
$value['stickflag'] = true;
$list[$value['blogid']] = $value;
}
}
return $list;
}
示例14: getblogbyid
function getblogbyid($blogidarray)
{
global $_G;
$bloglist = array();
if (!empty($blogidarray)) {
$query = DB::query("SELECT bf.*, b.* FROM " . DB::table('home_blog') . " b LEFT JOIN " . DB::table('home_blogfield') . " bf ON bf.blogid=b.blogid WHERE b.blogid IN (" . dimplode($blogidarray) . ") ORDER BY b.dateline DESC");
require_once libfile('function/spacecp');
require_once libfile('function/home');
$classarr = array();
while ($result = DB::fetch($query)) {
$result['dateline'] = dgmdate($result['dateline']);
$classarr = getclassarr($result['uid']);
$result['classname'] = $classarr[$result[classid]]['classname'];
if ($result['friend'] == 4) {
$result['message'] = $result['pic'] = '';
} else {
$result['message'] = getstr($result['message'], $summarylen, 0, 0, 0, -1);
}
$result['message'] = preg_replace("/&[a-z]+\\;/i", '', $result['message']);
if ($result['pic']) {
$result['pic'] = pic_cover_get($result['pic'], $result['picflag']);
}
$bloglist[] = $result;
}
}
return $bloglist;
}
示例15: getblogbyid
function getblogbyid($blogidarray)
{
global $_G;
$bloglist = array();
if (!empty($blogidarray)) {
$data_blog = C::t('home_blog')->fetch_all($blogidarray, 'dateline', 'DESC');
$data_blogfield = C::t('home_blogfield')->fetch_all($blogidarray);
require_once libfile('function/spacecp');
require_once libfile('function/home');
$classarr = array();
foreach ($data_blog as $curblogid => $result) {
$result = array_merge($result, (array) $data_blogfield[$curblogid]);
$result['dateline'] = dgmdate($result['dateline']);
$classarr = getclassarr($result['uid']);
$result['classname'] = $classarr[$result[classid]]['classname'];
if ($result['friend'] == 4) {
$result['message'] = $result['pic'] = '';
} else {
$result['message'] = getstr($result['message'], $summarylen, 0, 0, 0, -1);
}
$result['message'] = preg_replace("/&[a-z]+\\;/i", '', $result['message']);
if ($result['pic']) {
$result['pic'] = pic_cover_get($result['pic'], $result['picflag']);
}
$bloglist[] = $result;
}
}
return $bloglist;
}