本文整理汇总了PHP中pic_get函数的典型用法代码示例。如果您正苦于以下问题:PHP pic_get函数的具体用法?PHP pic_get怎么用?PHP pic_get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pic_get函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getArticleSummary
/**
* 获取文章摘要(内容摘要以及图片)
*
* @param int $aid 文章id
* @param bool $transBr 是否要转换换行
* @param array $options 参数选项, 可选值: array('imageList' => 1, 'imageListLen' => 9, 'imageListThumb' => 1)
* @return array array('msg' => '', 'image' => '', 'imageList' => array())
*/
public static function getArticleSummary($aid, $transBr = true, $options = array())
{
$summary = array('msg' => '', 'image' => '', 'imageList' => array());
$summaryLength = WebUtils::getDzPluginAppbymeAppConfig('portal_summary_length');
$allowImage = WebUtils::getDzPluginAppbymeAppConfig('portal_allow_image');
$allowImage = !($allowImage === '0');
if ($summaryLength === '0' && !$allowImage) {
return $summary;
}
require_once DISCUZ_ROOT . './source/function/function_home.php';
$article = DzPortalArticle::getArticleByAid($aid);
if (!empty($article)) {
$getImageList = isset($options['imageList']) ? $options['imageList'] : 0;
$imageListLen = isset($options['imageListLen']) ? $options['imageListLen'] : 9;
$imageListThumb = isset($options['imageListThumb']) ? $options['imageListThumb'] : 1;
$msg = $article['summary'];
if ($article['pic']) {
// $article['pic'] = pic_get($article['pic'], '', $article['thumb'], $article['remote'], 1, 1);
$article['pic'] = pic_get($article['pic'], '', $article['thumb'], $article['remote'], 0, 1);
if ($allowImage) {
$summary['image'] = WebUtils::getHttpFileName($article['pic']);
if ($getImageList) {
$tempImage = $summary['image'];
$imageListThumb && ($tempImage = ImageUtils::getThumbImage($tempImage));
$summary['imageList'][] = $tempImage;
}
}
}
$transBr && ($msg = WebUtils::emptyReturnLine($msg, ' '));
$msg = trim($msg);
$summaryLength === false && ($summaryLength = 40);
$summary['msg'] = (string) WebUtils::subString($msg, 0, $summaryLength);
}
return $summary;
}
示例2: get_uploadcontent
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: function_portalcp.php 10836 2010-05-17 06:24:38Z zhangguosheng $
*/
function get_uploadcontent($attach)
{
$return = '';
if ($attach['isimage']) {
$pic = pic_get($attach['attachment'], 'portal', $attach['thumb'], $attach['remote'], 0);
$small_pic = $attach['thumb'] ? $pic . '.thumb.jpg' : $pic;
$return .= '<table id="attach_list_' . $attach['attachid'] . '" width="100%">';
$return .= '<td width="90"><a href="' . $pic . '" target="_blank"><img src="' . $small_pic . '" width="80" height="80"></a></td>';
$return .= '<td>';
$return .= '<a href="###" onclick="insertImage(\'' . $small_pic . '\', \'' . $pic . '\')">' . lang('portalcp', 'insert_small_image') . '</a><br>';
$return .= '<a href="###" onclick="insertImage(\'' . $pic . '\')">' . lang('portalcp', 'insert_large_image') . '</a><br>';
$return .= '<a href="###" onclick="deleteAttach(\'' . $attach['attachid'] . '\', \'portal.php?mod=attachment&id=' . $attach['attachid'] . '&op=delete\')">' . lang('portalcp', 'delete') . '</a>';
$return .= '</td>';
$return .= '</table>';
} else {
$return .= '<table id="attach_list_' . $attach['attachid'] . '" width="100%">';
$return .= '<td><a href="portal.php?mod=attachment&id=' . $attach['attachid'] . '" target="_blank">' . $attach['filename'] . '</a></td>';
$return .= '<td>';
$return .= '<a href="###" onclick="insertFile(\'' . $attach['filename'] . '\', \'portal.php?mod=attachment&id=' . $attach['attachid'] . '\')">' . lang('portalcp', 'insert_file') . '</a><br>';
$return .= '<a href="###" onclick="deleteAttach(\'' . $attach['attachid'] . '\', \'portal.php?mod=attachment&id=' . $attach['attachid'] . '&op=delete\')">' . lang('portalcp', 'delete') . '</a>';
$return .= '</td>';
$return .= '</table>';
}
return $return;
}
示例3: get_uploadcontent
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: function_portalcp.php 21207 2011-03-18 08:55:18Z zhangguosheng $
* English by Valery Votintsev at sources.ru
*/
function get_uploadcontent($attach)
{
$return = '';
if ($attach['isimage']) {
$pic = pic_get($attach['attachment'], 'portal', $attach['thumb'], $attach['remote'], 0);
$small_pic = $attach['thumb'] ? $pic . '.thumb.jpg' : '';
$check = $attach['pic'] == $attach['attachment'] ? checked : '';
$aid = $check ? $attach['aid'] : '';
$return .= '<table id="attach_list_' . $attach['attachid'] . '" width="100%" class="xi2">';
$return .= '<td width="50" class="bbs"><a href="' . $pic . '" target="_blank"><img src="' . ($small_pic ? $small_pic : $pic) . '" width="40" height="40"></a></td>';
$return .= '<td class="bbs">';
$return .= '<label for="setconver' . $attach['attachid'] . '"><input type="radio" name="setconver" id="setconver' . $attach['attachid'] . '" class="pr" value="1" onclick=setConver(\'' . addslashes(serialize(array('pic' => $attach['attachment'], 'thumb' => $attach['thumb'], 'remote' => $attach['remote']))) . '\') ' . $check . '> ' . lang('portalcp', 'set_to_conver') . '</label><br>';
if ($small_pic) {
$return .= '<a href="javascript:void(0);" onclick="insertImage(\'' . $small_pic . '\', \'' . $pic . '\');return false;">' . lang('portalcp', 'insert_small_image') . '</a><br>';
}
$return .= '<a href="javascript:void(0);" onclick="insertImage(\'' . $pic . '\');return false;">' . lang('portalcp', 'insert_large_image') . '</a><br>';
$return .= '<a href="javascript:void(0);" onclick="deleteAttach(\'' . $attach['attachid'] . '\', \'portal.php?mod=attachment&id=' . $attach['attachid'] . '&aid=' . $aid . '&op=delete\');return false;">' . lang('portalcp', 'delete') . '</a>';
$return .= '</td>';
$return .= '</table>';
} else {
$return .= '<table id="attach_list_' . $attach['attachid'] . '" width="100%">';
$return .= '<td><a href="portal.php?mod=attachment&id=' . $attach['attachid'] . '" target="_blank">' . $attach['filename'] . '</a></td>';
$return .= '<td>';
$return .= '<a href="javascript:void(0);" onclick="insertFile(\'' . $attach['filename'] . '\', \'portal.php?mod=attachment&id=' . $attach['attachid'] . '\');return false;">' . lang('portalcp', 'insert_file') . '</a><br>';
$return .= '<a href="javascript:void(0);" onclick="deleteAttach(\'' . $attach['attachid'] . '\', \'portal.php?mod=attachment&id=' . $attach['attachid'] . '&op=delete\');return false;">' . lang('portalcp', 'delete') . '</a>';
$return .= '</td>';
$return .= '</table>';
}
return $return;
}
示例4: album_update_pic
function album_update_pic($albumid, $picid = 0)
{
global $_G;
$setarr = array();
if ($picid) {
$wheresql = "AND picid='{$picid}'";
} else {
$wheresql = "ORDER BY picid DESC LIMIT 1";
$piccount = getcount('home_pic', array('albumid' => $albumid, 'status' => '0'));
if (empty($piccount) && getcount('home_pic', array('albumid' => $albumid)) == 0) {
DB::query("DELETE FROM " . DB::table('home_album') . " WHERE albumid='{$albumid}'");
return false;
} else {
$setarr['picnum'] = $piccount;
}
}
$query = DB::query("SELECT * FROM " . DB::table('home_pic') . " WHERE albumid='{$albumid}' {$wheresql}");
if (!($pic = DB::fetch($query))) {
return false;
}
$from = $pic['remote'];
$pic['remote'] = $pic['remote'] > 1 ? $pic['remote'] - 2 : $pic['remote'];
$basedir = !getglobal('setting/attachdir') ? DISCUZ_ROOT . './data/attachment/' : getglobal('setting/attachdir');
$picdir = 'cover/' . substr(md5($albumid), 0, 2) . '/';
dmkdir($basedir . './album/' . $picdir);
if ($pic['remote']) {
$picsource = pic_get($pic['filepath'], $from > 1 ? 'forum' : 'album', $pic['thumb'], $pic['remote'], 0);
} else {
$picsource = $basedir . './' . ($from > 1 ? 'forum' : 'album') . '/' . $pic['filepath'];
}
require_once libfile('class/image');
$image = new image();
if ($image->Thumb($picsource, 'album/' . $picdir . $albumid . '.jpg', 120, 120, 2)) {
$setarr['pic'] = $picdir . $albumid . '.jpg';
$setarr['picflag'] = 1;
if (getglobal('setting/ftp/on')) {
if (ftpcmd('upload', 'album/' . $picdir . $albumid . '.jpg')) {
$setarr['picflag'] = 2;
@unlink($_G['setting']['attachdir'] . 'album/' . $picdir . $albumid . '.jpg');
}
}
} else {
if ($pic['status'] == 0) {
$setarr['pic'] = $pic['thumb'] ? $pic['filepath'] . '.thumb.jpg' : $pic['filepath'];
}
if ($from > 1) {
$setarr['picflag'] = $pic['remote'] ? 4 : 3;
} else {
$setarr['picflag'] = $pic['remote'] ? 2 : 1;
}
}
$setarr['updatetime'] = $_G['timestamp'];
DB::update('home_album', $setarr, array('albumid' => $albumid));
return true;
}
示例5: album_update_pic
function album_update_pic($albumid, $picid = 0)
{
global $_G;
$setarr = array();
if (!$picid) {
$piccount = C::t('home_pic')->check_albumpic($albumid, 0);
if (empty($piccount) && C::t('home_pic')->check_albumpic($albumid) == 0) {
C::t('home_album')->delete($albumid);
return false;
} else {
$setarr['picnum'] = $piccount;
}
}
$query = C::t('home_pic')->fetch_all_by_albumid($albumid, 0, 1, $picid, 1);
if (!($pic = $query[0])) {
return false;
}
$from = $pic['remote'];
$pic['remote'] = $pic['remote'] > 1 ? $pic['remote'] - 2 : $pic['remote'];
$basedir = !getglobal('setting/attachdir') ? DISCUZ_ROOT . './data/attachment/' : getglobal('setting/attachdir');
$picdir = 'cover/' . substr(md5($albumid), 0, 2) . '/';
dmkdir($basedir . './album/' . $picdir);
if ($pic['remote']) {
$picsource = pic_get($pic['filepath'], $from > 1 ? 'forum' : 'album', $pic['thumb'], $pic['remote'], 0);
} else {
$picsource = $basedir . './' . ($from > 1 ? 'forum' : 'album') . '/' . $pic['filepath'];
}
require_once libfile('class/image');
$image = new image();
if ($image->Thumb($picsource, 'album/' . $picdir . $albumid . '.jpg', 120, 120, 2)) {
$setarr['pic'] = $picdir . $albumid . '.jpg';
$setarr['picflag'] = 1;
if (getglobal('setting/ftp/on')) {
if (ftpcmd('upload', 'album/' . $picdir . $albumid . '.jpg')) {
$setarr['picflag'] = 2;
@unlink($_G['setting']['attachdir'] . 'album/' . $picdir . $albumid . '.jpg');
}
}
} else {
if ($pic['status'] == 0) {
$setarr['pic'] = $pic['thumb'] ? getimgthumbname($pic['filepath']) : $pic['filepath'];
}
if ($from > 1) {
$setarr['picflag'] = $pic['remote'] ? 4 : 3;
} else {
$setarr['picflag'] = $pic['remote'] ? 2 : 1;
}
}
$setarr['updatetime'] = $_G['timestamp'];
C::t('home_album')->update($albumid, $setarr);
return true;
}
示例6: get_upload_content
function get_upload_content($attachs, $dotype = '')
{
$html = '';
$dotype = $dotype ? 'checked' : '';
$i = 0;
foreach ($attachs as $key => $attach) {
$type = $attach['from'] == 'forum' ? 'forum' : 'portal';
$html .= '<td id="attach_list_' . $attach['attachid'] . '">';
if ($attach['isimage']) {
$pic = pic_get($attach['attachment'], $type, $attach['thumb'], $attach['remote'], 0);
$small_pic = $attach['thumb'] ? getimgthumbname($pic) : '';
$check = $attach['pic'] == $type . '/' . $attach['attachment'] ? 'checked' : $dotype;
$aid = $check ? $attach['aid'] : '';
$html .= '<a href="javascript:;" class="opattach">';
$html .= '<span class="opattach_ctrl">';
$html .= '<span onclick="insertImage(\'' . $pic . '\');" class="cur1">' . lang('portalcp', 'insert_large_image') . '</span><span class="pipe">|</span>';
if ($small_pic) {
$html .= '<span onclick="insertImage(\'' . $small_pic . '\', \'' . $pic . '\');" class="cur1">' . lang('portalcp', 'small_image') . '</span>';
}
$html .= '</span><img src="' . ($small_pic ? $small_pic : $pic) . '" onclick="insertImage(\'' . $pic . '\');" class="cur1" /></a>';
$html .= '<label for="setconver' . $attach['attachid'] . '" class="cur1 xi2"><input type="radio" name="setconver" id="setconver' . $attach['attachid'] . '" class="pr" value="1" onclick=setConver(\'' . addslashes(serialize(array('pic' => $type . '/' . $attach['attachment'], 'thumb' => $attach['thumb'], 'remote' => $attach['remote']))) . '\') ' . $check . '>' . lang('portalcp', 'set_to_conver') . '</label>';
if ($type == 'portal') {
$html .= '<span class="pipe">|</span><span class="cur1 xi2" onclick="deleteAttach(\'' . $attach['attachid'] . '\', \'portal.php?mod=attachment&id=' . $attach['attachid'] . '&aid=' . $aid . '&op=delete\');">' . lang('portalcp', 'delete') . '</span>';
}
} else {
$html .= '<img src="static/image/editor/editor_file_thumb.png" class="cur1" onclick="insertFile(\'' . $attach['filename'] . '\', \'portal.php?mod=attachment&id=' . $attach['attachid'] . '\');" tip="' . $attach['filename'] . '" onmouseover="showTip(this);" /><br/>';
$html .= '<span onclick="deleteAttach(\'' . $attach['attachid'] . '\', \'portal.php?mod=attachment&id=' . $attach['attachid'] . '&op=delete\');" class="cur1 xi2">' . lang('portalcp', 'delete') . '</span>';
}
$html .= '</td>';
$i++;
if ($i % 4 == 0 && isset($attachs[$i])) {
$html .= '</tr><tr>';
}
}
if (!empty($html)) {
if (($imgpad = $i % 4) > 0) {
$html .= str_repeat('<td width="25%"></td>', 4 - $imgpad);
}
$html = '<table class="imgl"><tr>' . $html . '</tr></table>';
}
return $html;
}
示例7: blog_post
//.........这里部分代码省略.........
$classid = intval($POST['classid']);
}
} else {
$classid = $olds['classid'];
}
if($classid && empty($classname)) {
$query = C::t('home_class')->fetch($classid);
$classname = ($query['uid'] == $_G['uid']) ? $query['classname'] : '';
if(empty($classname)) $classid = 0;
}
$blogarr = array(
'subject' => $POST['subject'],
'classid' => $classid,
'friend' => $POST['friend'],
'password' => $POST['password'],
'noreply' => empty($POST['noreply'])?0:1,
'catid' => intval($POST['catid']),
'status' => $blog_status,
);
$titlepic = '';
$uploads = array();
if(!empty($POST['picids'])) {
$picids = array_keys($POST['picids']);
$query = C::t('home_pic')->fetch_all_by_uid($_G['uid'], 0, 0, $picids);
foreach($query as $value) {
if(empty($titlepic) && $value['thumb']) {
$titlepic = getimgthumbname($value['filepath']);
$blogarr['picflag'] = $value['remote']?2:1;
}
$picurl = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote'], 0);
$uploads[md5($picurl)] = $value;
}
if(empty($titlepic) && $value) {
$titlepic = $value['filepath'];
$blogarr['picflag'] = $value['remote']?2:1;
}
}
if($uploads) {
$albumid = 0;
if($POST['savealbumid'] < 0 && !empty($POST['newalbum'])) {
$albumname = addslashes(dhtmlspecialchars(trim($POST['newalbum'])));
if(empty($albumname)) $albumname = dgmdate($_G['timestamp'],'Ymd');
$albumarr = array('albumname' => $albumname);
$albumid = album_creat($albumarr);
} else {
$albumid = $POST['savealbumid'] < 0 ? 0 : intval($POST['savealbumid']);
}
if($albumid) {
C::t('home_pic')->update_for_uid($_G['uid'], $picids, array('albumid' => $albumid));
album_update_pic($albumid);
}
preg_match_all("/\s*\<img src=\"(.+?)\".*?\>\s*/is", $message, $mathes);
if(!empty($mathes[1])) {
foreach ($mathes[1] as $key => $value) {
$urlmd5 = md5($value);
if(!empty($uploads[$urlmd5])) {
unset($uploads[$urlmd5]);
}
}
}
foreach ($uploads as $value) {
示例8: topic_get
function topic_get($topicid)
{
global $_SGLOBAL;
$topic = array();
if ($topicid) {
$typearr = array('blog', 'pic', 'thread', 'poll', 'event', 'share', 'bwzt');
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('topic') . " WHERE topicid='{$topicid}'");
if ($topic = $_SGLOBAL['db']->fetch_array($query)) {
$topic['pic'] = $topic['pic'] ? pic_get($topic['pic'], $topic['thumb'], $topic['remote'], 0) : '';
$topic['joingid'] = empty($topic['joingid']) ? array() : explode(',', $topic['joingid']);
$topic['jointype'] = empty($topic['jointype']) ? $typearr : explode(',', $topic['jointype']);
$topic['lastpost'] = sgmdate('Y-m-d H:i', $topic['lastpost']);
$topic['dateline'] = sgmdate('Y-m-d H:i', $topic['dateline']);
$topic['allowjoin'] = $topic['endtime'] && $_SGLOBAL['timestamp'] > $topic['endtime'] ? 0 : 1;
$topic['endtime'] = $topic['endtime'] ? sgmdate('Y-m-d H:i', $topic['endtime']) : '';
include_once S_ROOT . './source/function_bbcode.php';
$topic['message'] = bbcode($topic['message'], 1);
$topic['joinurl'] = '';
foreach ($typearr as $value) {
if (in_array($value, $topic['jointype'])) {
if ($value == 'pic') {
$value = 'upload';
}
$topic['joinurl'] = "cp.php?ac={$value}&topicid={$topicid}";
break;
}
}
}
}
return $topic;
}
示例9: getranklist_pictures_index
function getranklist_pictures_index($num = 20, $dateline = 0, $orderby = 'hot DESC')
{
$picturelist = array();
$query = DB::query("SELECT p.picid, p.uid, p.username, p.title, p.filepath, p.thumb, p.remote, a.albumid, a.albumname, a.friend\n\t\tFROM " . DB::table('home_pic') . " p\n\t\tLEFT JOIN " . DB::table('home_album') . " a ON p.albumid=a.albumid\n\t\tWHERE p.hot>'3'\n\t\tORDER BY p.dateline DESC\n\t\tLIMIT 0, {$num}");
require_once libfile('function/home');
while ($picture = DB::fetch($query)) {
$picture['url'] = $picture['friend'] == 0 ? pic_get($picture['filepath'], 'album', $picture['thumb'], $picture['remote']) : STATICURL . 'image/common/nopublish.gif';
$picture['origurl'] = $picture['friend'] == 0 ? pic_get($picture['filepath'], 'album', 0, $picture['remote']) : STATICURL . 'image/common/nopublish.gif';
$picturelist[] = $picture;
}
return $picturelist;
}
示例10: saddslashes
$body_data = saddslashes(serialize(sstripslashes(array('message' => $message))));
}
//ʼþfeed
if ($add_doing) {
$ip = getonlineip();
$ip_detail = getIpDetails();
$lon = $ip_detail['latitude'];
$lat = $ip_detail['longitude'];
$pos = "http://lbs.juhe.cn/api/getaddressbylngb?lngx=" . $lat . "&lngy=" . $lon;
$opts = array('http' => array('method' => 'GET', 'time' => 1));
$context = stream_context_create($opts);
$res = file_get_contents($pos, false, $context);
$res = json_decode($res, 1);
$address = $res['row']['result']['formatted_address'];
if ($picid && $filepath) {
$feedarr = array('appid' => UC_APPID, 'icon' => 'doing', 'uid' => $_SGLOBAL['supe_uid'], 'username' => $_SGLOBAL['supe_username'], 'dateline' => $_SGLOBAL['timestamp'], 'title_template' => $title_template, 'title_data' => $title_data, 'body_template' => $body_template, 'body_data' => $body_data, 'id' => $newdoid, 'idtype' => 'doid', 'fromdevice' => 'web', 'image_1' => pic_get($filepath, 1, 0), 'image_1_link' => "space.php?uid={$_SGLOBAL['supe_uid']}&do=album&picid={$picid}", 'ip' => $ip, 'address' => $address);
} else {
$feedarr = array('appid' => UC_APPID, 'icon' => 'doing', 'uid' => $_SGLOBAL['supe_uid'], 'username' => $_SGLOBAL['supe_username'], 'dateline' => $_SGLOBAL['timestamp'], 'title_template' => $title_template, 'title_data' => $title_data, 'body_template' => $body_template, 'body_data' => $body_data, 'id' => $newdoid, 'idtype' => 'doid', 'fromdevice' => 'web', 'ip' => $ip, 'address' => $address);
}
$feedarr['hash_template'] = md5($feedarr['title_template'] . "\t" . $feedarr['body_template']);
//ϲºÃhash
$feedarr['hash_data'] = md5($feedarr['title_template'] . "\t" . $feedarr['title_data'] . "\t" . $feedarr['body_template'] . "\t" . $feedarr['body_data']);
//ºÏ²¢hash
$feedid = inserttable('feed', $feedarr, 1);
}
//ͳ¼Æ
updatestat('doing');
//·ÖÏíÖÁÐÂÀË΢²©
@(include_once S_ROOT . './source/weibo/config.php');
@(include_once S_ROOT . './source/weibo/saetv2.ex.class.php');
$weibo = $message;
示例11: array
$eventlist = $fevents = array();
if(empty($wherearr)) $wherearr = array('1');
if($needquery) {// 好友的活动已特别处理
$sql = "SELECT COUNT(*) FROM $fromsql WHERE ".implode(" AND ", $wherearr);
$count = $_SGLOBAL['db']->result($_SGLOBAL['db']->query($sql),0);
}
if($count){
if($needquery) {
$sql = "SELECT e.* FROM $fromsql $joinsql WHERE ".implode(" AND ", $wherearr) ." ORDER BY $orderby LIMIT $start, $perpage";
}
$query = $_SGLOBAL['db']->query($sql);
while($event = $_SGLOBAL['db']->fetch_array($query)){
if($event['poster']){
$event['pic'] = pic_get($event['poster'], $event['thumb'], $event['remote']);
} else {
$event['pic'] = $_SGLOBAL['eventclass'][$event['classid']]['poster'];
}
realname_set($event['uid'], $event['username']);
if($view=="friend"){
realname_set($event['fuid'], $event['fusername']);
$fevents[$event['eventid']][] = array("fuid"=>$event['fuid'], "fusername"=>$event['fusername'], "status"=>$event['status']);
}
$eventlist[$event['eventid']] = $event;
}
}
realname_get();
$multi = multi($count, $perpage, $page, $theurl);
示例12: feed_publish
function feed_publish($id, $idtype, $add = 0)
{
global $_G;
$setarr = array();
switch ($idtype) {
case 'blogid':
$query = DB::query("SELECT b.*, bf.* 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.blogid='{$id}'");
if ($value = DB::fetch($query)) {
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, 1, 1, 0, -1));
}
}
}
break;
case 'albumid':
$key = 1;
if ($id > 0) {
$query = DB::query("SELECT a.username, a.albumname, a.picnum, a.friend, a.target_ids, p.* FROM " . DB::table('home_pic') . " p\r\n\t\t\t\t\tLEFT JOIN " . DB::table('home_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 = DB::fetch($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'];
$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.picid='{$id}'" : "p.uid='{$_G['uid']}' ORDER BY dateline DESC LIMIT 1";
$query = DB::query("SELECT p.*, a.friend, a.target_ids FROM " . DB::table('home_pic') . " p\r\n\t\t\t\tLEFT JOIN " . DB::table('home_album') . " a ON a.albumid=p.albumid WHERE {$plussql}");
if ($value = DB::fetch($query)) {
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';
$setarr['body_template'] = 'feed_pic_body';
$setarr['body_data'] = array('title' => $value['title']);
}
}
break;
}
if ($setarr['icon']) {
$setarr['title_template'] = $setarr['title_template'] ? lang('feed', $setarr['title_template']) : '';
$setarr['body_template'] = $setarr['body_template'] ? lang('feed', $setarr['body_template']) : '';
$setarr['body_general'] = $setarr['body_general'] ? lang('feed', $setarr['body_general']) : '';
$setarr['title_data']['hash_data'] = "{$idtype}{$id}";
$setarr['title_data'] = serialize($setarr['title_data']);
$setarr['body_data'] = serialize($setarr['body_data']);
$setarr = daddslashes($setarr);
$feedid = 0;
if (!$add && $setarr['id']) {
//.........这里部分代码省略.........
示例13: getTopicCover
/**
* 获取主题封面
*
* @param int $tid
*/
public static function getTopicCover($tid)
{
$image = '';
$topicImage = DbUtils::getDzDbUtils(true)->queryRow('
SELECT *
FROM %t
WHERE tid=%d
', array('forum_threadimage', $tid));
if (!empty($topicImage)) {
require_once DISCUZ_ROOT . './source/function/function_home.php';
$image = pic_get($topicImage['attachment'], 'forum', 0, $topicImage['remote']);
}
return WebUtils::getHttpFileName($image);
}
示例14: cplang
case 'blogid':
$fs['title_template'] = cplang('feed_click_blog');
$fs['title_data'] = array('touser' => "<a href=\"space.php?uid={$item['uid']}\">{$_SN[$item['uid']]}</a>", 'subject' => "<a href=\"space.php?uid={$item['uid']}&do=blog&id={$item['blogid']}\">{$item['subject']}</a>", 'click' => $click['name']);
$note_type = 'clickblog';
$q_note = cplang('note_click_blog', array("space.php?uid={$item['uid']}&do=blog&id={$item['blogid']}", $item['subject']));
break;
case 'tid':
$fs['title_template'] = cplang('feed_click_thread');
$fs['title_data'] = array('touser' => "<a href=\"space.php?uid={$item['uid']}\">{$_SN[$item['uid']]}</a>", 'subject' => "<a href=\"space.php?uid={$item['uid']}&do=thread&id={$item['tid']}\">{$item['subject']}</a>", 'click' => $click['name']);
$note_type = 'clickthread';
$q_note = cplang('note_click_thread', array("space.php?uid={$item['uid']}&do=thread&id={$item['tid']}", $item['subject']));
break;
case 'picid':
$fs['title_template'] = cplang('feed_click_pic');
$fs['title_data'] = array('touser' => "<a href=\"space.php?uid={$item['uid']}\">{$_SN[$item['uid']]}</a>", 'click' => $click['name']);
$fs['images'] = array(pic_get($item['filepath'], $item['thumb'], $item['remote']));
$fs['image_links'] = array("space.php?uid={$item['uid']}&do=album&picid={$item['picid']}");
$fs['body_general'] = $item['title'];
$note_type = 'clickpic';
$q_note = cplang('note_click_pic', array("space.php?uid={$item['uid']}&do=album&picid={$item['picid']}"));
break;
}
//Event Publishing
if (empty($item['friend']) && ckprivacy('click', 1)) {
feed_add('click', $fs['title_template'], $fs['title_data'], '', array(), $fs['body_general'], $fs['images'], $fs['image_links']);
}
//Reward visitors
getreward('click', 1, 0, $idtype . $id);
//Statistics
updatestat('click');
//Notice
示例15: 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';
//.........这里部分代码省略.........