本文整理汇总了PHP中getimgthumbname函数的典型用法代码示例。如果您正苦于以下问题:PHP getimgthumbname函数的具体用法?PHP getimgthumbname怎么用?PHP getimgthumbname使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getimgthumbname函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_uploadcontent
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: function_portalcp.php 23372 2011-07-12 01:50:34Z zhangguosheng $
*/
function get_uploadcontent($attach, $type = 'portal', $dotype = '')
{
$return = '';
$dotype = $dotype ? 'checked' : '';
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'] : '';
$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 align="right" 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' => $type . '/' . $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>';
if ($type == 'portal') {
$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%" class="xi2">';
$return .= '<td width="50" class="bbs"><a href="portal.php?mod=attachment&id=' . $attach['attachid'] . '" target="_blank">' . $attach['filename'] . '</a></td>';
$return .= '<td align="right" class="bbs">';
$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;
}
示例2: before_feed
public function before_feed()
{
if (!empty($_GET['addfeed']) && $this->forum['allowfeed'] && !$this->param['isanonymous']) {
$this->feed['icon'] = 'goods';
$this->feed['title_template'] = 'feed_thread_goods_title';
if ($_GET['item_price'] > 0) {
if ($this->setting['creditstransextra'][5] != -1 && $_GET['item_credit']) {
$this->feed['body_template'] = 'feed_thread_goods_message_1';
} else {
$this->feed['body_template'] = 'feed_thread_goods_message_2';
}
} else {
$this->feed['body_template'] = 'feed_thread_goods_message_3';
}
$this->feed['body_data'] = array('itemname' => "<a href=\"forum.php?mod=viewthread&do=tradeinfo&tid=" . $this->tid . "&pid={$pid}\">{$_GET['item_name']}</a>", 'itemprice' => $_GET['item_price'], 'itemcredit' => $_GET['item_credit'], 'creditunit' => $this->setting['extcredits'][$this->setting['creditstransextra'][5]]['unit'] . $this->setting['extcredits'][$this->setting['creditstransextra'][5]]['title']);
if ($_GET['tradeaid']) {
$this->feed['images'] = array(getforumimg($_GET['tradeaid']));
$this->feed['image_links'] = array("forum.php?mod=viewthread&do=tradeinfo&tid=" . $this->tid . "&pid={$pid}");
}
if ($_GET['tradeaid']) {
$attachment = C::t('forum_attachment_n')->fetch('tid:' . $this->tid, $_GET['tradeaid']);
if (in_array($attachment['filetype'], array('image/gif', 'image/jpeg', 'image/png'))) {
$imgurl = $this->setting['attachurl'] . 'forum/' . ($attachment['thumb'] && $attachment['filetype'] != 'image/gif' ? getimgthumbname($attachment['attachment']) : $attachment['attachment']);
$this->feed['images'][] = $attachment['attachment'] ? $imgurl : '';
$this->feed['image_links'][] = $attachment['attachment'] ? "forum.php?mod=viewthread&tid=" . $this->tid : '';
}
}
}
}
示例3: dunlink
function dunlink($attach) {
global $_G;
$filename = $attach['attachment'];
$havethumb = $attach['thumb'];
$remote = $attach['remote'];
if($remote) {
ftpcmd('delete', 'forum/'.$filename);
$havethumb && ftpcmd('delete', 'forum/'.getimgthumbname($filename));
} else {
@unlink($_G['setting']['attachdir'].'/forum/'.$filename);
$havethumb && @unlink($_G['setting']['attachdir'].'/forum/'.getimgthumbname($filename));
}
if($attach['aid']) {
@unlink($_G['setting']['attachdir'].'image/'.$attach['aid'].'_100_100.jpg');
}
}
示例4: 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;
}
示例5: fparseattach
function fparseattach($aid, $length = 0, $extra = '')
{
global $_G;
$html = '';
if (!empty($_G['post_attach']) && !empty($_G['post_attach'][$aid])) {
$attach = $_G['post_attach'][$aid];
unset($_G['post_attach'][$attach['aid']]);
$attach['url'] = ($attach['remote'] ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']) . 'forum/';
$attach['isimage'] = $attach['isimage'] && !$attach['price'] ? $attach['isimage'] : 0;
$attach['refcheck'] = !$attach['remote'] && $_G['setting']['attachrefcheck'] || $attach['remote'] && ($_G['setting']['ftp']['hideurl'] || $attach['isimage'] && $_G['setting']['attachimgpost'] && strtolower(substr($_G['setting']['ftp']['attachurl'], 0, 3)) == 'ftp');
$rimg_id = random(5) . $attach['aid'];
if ($attach['isimage'] && !$attach['price'] && !$attach['readperm']) {
$nothumb = $length ? 0 : 1;
$src = $attach['url'] . (!$attach['thumb'] ? $attach['attachment'] : getimgthumbname($attach['attachment']));
$html = bbcodeurl($src, '<img id="aimg_' . $rimg_id . '" src="' . $src . '" border="0" alt="' . $attach['filename'] . '" ' . $extra . ' style="cursor: pointer;" />');
return fcodedisp($html, 'image');
} else {
if ($attach['price'] || $attach['readperm']) {
$html = '<a href="forum.php?mod=viewthread&tid=' . $attach['tid'] . '" id="attach_' . $rimg_id . '" target="_blank" class="flw_attach_price"><strong>' . $attach['filename'] . '</strong><span>' . sizecount($attach['filesize']) . '</span></a>';
} else {
require_once libfile('function/attachment');
$aidencode = packaids($attach);
$attachurl = "forum.php?mod=attachment&aid={$aidencode}";
$html = '<a href="' . $attachurl . '" id="attach_' . $rimg_id . '"><strong>' . $attach['filename'] . '</strong><span>' . sizecount($attach['filesize']) . '</span></a>';
}
return fcodedisp($html, 'attach');
}
}
return '';
}
示例6: getalbumpic
function getalbumpic($uid, $id)
{
global $_G;
$query = DB::query("SELECT filepath, thumb FROM " . DB::table('home_pic') . " WHERE albumid='{$id}' AND uid='{$uid}' ORDER BY thumb DESC, dateline DESC LIMIT 0,1");
if ($pic = DB::fetch($query)) {
return $pic['thumb'] ? getimgthumbname($pic['filepath']) : $pic['filepath'];
} else {
return '';
}
}
示例7: parseforumattach
function parseforumattach(&$post, $aids)
{
global $_G;
if ($aids = array_unique($aids)) {
require_once libfile('function/attachment');
$finds = $replaces = array();
foreach (C::t('forum_attachment_n')->fetch_all_by_id('tid:' . $post['tid'], 'aid', $aids) as $attach) {
$attach['url'] = ($attach['remote'] ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']) . 'forum/';
$attach['dateline'] = dgmdate($attach['dateline'], 'u');
$extension = strtolower(fileext($attach['filename']));
$attach['ext'] = $extension;
$attach['imgalt'] = $attach['isimage'] ? strip_tags(str_replace('"', '\\"', $attach['description'] ? $attach['description'] : $attach['filename'])) : '';
$attach['attachicon'] = attachtype($extension . "\t" . $attach['filetype']);
$attach['attachsize'] = sizecount($attach['filesize']);
$attach['refcheck'] = !$attach['remote'] && $_G['setting']['attachrefcheck'] || $attach['remote'] && ($_G['setting']['ftp']['hideurl'] || $attach['isimage'] && $_G['setting']['attachimgpost'] && strtolower(substr($_G['setting']['ftp']['attachurl'], 0, 3)) == 'ftp');
$aidencode = packaids($attach);
$widthcode = attachwidth($attach['width']);
$is_archive = $_G['forum_thread']['is_archived'] ? "&fid=" . $_G['fid'] . "&archiveid=" . $_G['forum_thread']['archiveid'] : '';
if ($attach['isimage']) {
$attachthumb = getimgthumbname($attach['attachment']);
if ($_G['setting']['thumbstatus'] && $attach['thumb']) {
$replaces[$attach['aid']] = "<a href=\"javascript:;\"><img id=\"_aimg_{$attach['aid']}\" aid=\"{$attach['aid']}\" onclick=\"zoom(this, this.getAttribute('zoomfile'), 0, 0, '{$_G[forum][showexif]}')\"\n\t\t\t\t\t\tzoomfile=\"" . ($attach['refcheck'] ? "forum.php?mod=attachment{$is_archive}&aid={$aidencode}&noupdate=yes¬humb=yes" : $attach['url'] . $attach['attachment']) . "\"\n\t\t\t\t\t\tsrc=\"" . ($attach['refcheck'] ? "forum.php?mod=attachment{$is_archive}&aid={$aidencode}" : $attach['url'] . $attachthumb) . "\" alt=\"{$attach['imgalt']}\" title=\"{$attach['imgalt']}\" w=\"{$attach['width']}\" /></a>";
} else {
$replaces[$attach['aid']] = "<img id=\"_aimg_{$attach['aid']}\" aid=\"{$attach['aid']}\"\n\t\t\t\t\t\tzoomfile=\"" . ($attach['refcheck'] ? "forum.php?mod=attachment{$is_archive}&aid={$aidencode}&noupdate=yes¬humb=yes" : $attach['url'] . $attach['attachment']) . "\"\n\t\t\t\t\t\tsrc=\"" . ($attach['refcheck'] ? "forum.php?mod=attachment{$is_archive}&aid={$aidencode}&noupdate=yes " : $attach['url'] . $attach['attachment']) . "\" {$widthcode} alt=\"{$attach['imgalt']}\" title=\"{$attach['imgalt']}\" w=\"{$attach['width']}\" />";
}
} else {
$replaces[$attach['aid']] = "{$attach['attachicon']}<a href=\"forum.php?mod=attachment{$is_archive}&aid={$aidencode}\" onmouseover=\"showMenu({'ctrlid':this.id,'pos':'12'})\" id=\"aid{$attach['aid']}\" target=\"_blank\">{$attach['filename']}</a>";
}
$finds[$attach['aid']] = '[attach]' . $attach['aid'] . '[/attach]';
}
if ($finds && $replaces) {
$post['message'] = str_ireplace($finds, $replaces, $post['message']);
}
}
}
示例8: showmessage
$payrequired = $_G['uid'] ? !DB::result_first("SELECT uid FROM " . DB::table('common_credit_log') . " WHERE uid='{$_G['uid']}' AND relatedid='{$attach['aid']}' AND operation='BAC'") : 1;
$payrequired && showmessage('attachement_payto_attach', 'forum.php?mod=misc&action=attachpay&aid=' . $attach['aid'] . '&tid=' . $attach['tid']);
}
}
$isimage = $attach['isimage'];
$_G['setting']['ftp']['hideurl'] = $_G['setting']['ftp']['hideurl'] || $isimage && !empty($_G['gp_noupdate']) && $_G['setting']['attachimgpost'] && strtolower(substr($_G['setting']['ftp']['attachurl'], 0, 3)) == 'ftp';
if (empty($_G['gp_nothumb']) && $attach['isimage'] && $attach['thumb']) {
$db = DB::object();
$db->close();
!$_G['config']['output']['gzip'] && ob_end_clean();
dheader('Content-Disposition: inline; filename=' . getimgthumbname($attach['filename']));
dheader('Content-Type: image/pjpeg');
if ($attach['remote']) {
$_G['setting']['ftp']['hideurl'] ? getremotefile(getimgthumbname($attach['attachment'])) : dheader('location:' . $_G['setting']['ftp']['attachurl'] . 'forum/' . getimgthumbname($attach['attachment']));
} else {
getlocalfile($_G['setting']['attachdir'] . '/forum/' . getimgthumbname($attach['attachment']));
}
exit;
}
$filename = $_G['setting']['attachdir'] . '/forum/' . $attach['attachment'];
if (!$attach['remote'] && !is_readable($filename)) {
if (!$requestmode) {
showmessage('attachment_nonexistence');
} else {
exit;
}
}
if (!$requestmode) {
if (!$ispaid && !$forum['allowgetattach']) {
if (!$forum['getattachperm'] && !$allowgetattach) {
showmessage('getattachperm_none_nopermission', NULL, array(), array('login' => 1));
示例9: updateattach
function updateattach($modnewthreads, $tid, $pid, $attachnew, $attachupdate = array(), $uid = 0)
{
global $_G;
$uid = $uid ? $uid : $_G['uid'];
$uidadd = $_G['forum']['ismoderator'] ? '' : " AND uid='{$uid}'";
if ($attachnew) {
$newaids = array_keys($attachnew);
$newattach = $newattachfile = $albumattach = array();
$query = DB::query("SELECT * FROM " . DB::table('forum_attachment_unused') . " WHERE aid IN (" . dimplode($newaids) . "){$uidadd}");
while ($attach = DB::fetch($query)) {
$newattach[$attach['aid']] = daddslashes($attach);
if ($attach['isimage']) {
$newattachfile[$attach['aid']] = $attach['attachment'];
}
}
if ($_G['setting']['watermarkstatus'] && empty($_G['forum']['disablewatermark'])) {
require_once libfile('class/image');
$image = new image();
}
if (!empty($_G['gp_albumaid'])) {
array_unshift($_G['gp_albumaid'], '');
$_G['gp_albumaid'] = array_unique($_G['gp_albumaid']);
unset($_G['gp_albumaid'][0]);
foreach ($_G['gp_albumaid'] as $aid) {
if (isset($newattach[$aid])) {
$albumattach[$aid] = $newattach[$aid];
}
}
}
foreach ($attachnew as $aid => $attach) {
$update = array();
$update['readperm'] = $_G['group']['allowsetattachperm'] ? $attach['readperm'] : 0;
$update['price'] = $_G['group']['maxprice'] ? intval($attach['price']) <= $_G['group']['maxprice'] ? intval($attach['price']) : $_G['group']['maxprice'] : 0;
$update['tid'] = $tid;
$update['pid'] = $pid;
$update['uid'] = $uid;
$update['description'] = cutstr(dhtmlspecialchars($attach['description']), 100);
DB::update(getattachtablebytid($tid), $update, "aid='{$aid}'");
if (!$newattach[$aid]) {
continue;
}
$update = array_merge($update, $newattach[$aid]);
if (!empty($newattachfile[$aid])) {
if ($_G['setting']['thumbstatus'] && $_G['forum']['disablethumb']) {
$update['thumb'] = 0;
@unlink($_G['setting']['attachdir'] . '/forum/' . getimgthumbname($newattachfile[$aid]));
if (!empty($albumattach[$aid])) {
$albumattach[$aid]['thumb'] = 0;
}
}
if ($_G['setting']['watermarkstatus'] && empty($_G['forum']['disablewatermark'])) {
$image->Watermark($_G['setting']['attachdir'] . '/forum/' . $newattachfile[$aid], '', 'forum');
$update['filesize'] = $image->imginfo['size'];
}
}
if (!empty($_G['gp_albumaid']) && isset($albumattach[$aid])) {
$newalbum = 0;
if (!$_G['gp_uploadalbum']) {
require_once libfile('function/spacecp');
$_G['gp_uploadalbum'] = album_creat(array('albumname' => $_G['gp_newalbum']));
$newalbum = 1;
}
$picdata = array('albumid' => $_G['gp_uploadalbum'], 'uid' => $_G['uid'], 'username' => $_G['username'], 'dateline' => $albumattach[$aid]['dateline'], 'postip' => $_G['clientip'], 'filename' => $albumattach[$aid]['filename'], 'title' => cutstr(dhtmlspecialchars($attach['description']), 100), 'type' => fileext($albumattach[$aid]['attachment']), 'size' => $albumattach[$aid]['filesize'], 'filepath' => $albumattach[$aid]['attachment'], 'thumb' => $albumattach[$aid]['thumb'], 'remote' => $albumattach[$aid]['remote'] + 2);
$update['picid'] = DB::insert('home_pic', $picdata, 1);
if ($newalbum) {
require_once libfile('function/home');
require_once libfile('function/spacecp');
album_update_pic($_G['gp_uploadalbum']);
}
}
DB::insert(getattachtablebytid($tid), $update, false, true);
DB::update('forum_attachment', array('tid' => $tid, 'pid' => $pid, 'tableid' => getattachtableid($tid)), "aid='{$aid}'");
DB::delete('forum_attachment_unused', "aid='{$aid}'");
}
if (!empty($_G['gp_albumaid'])) {
$albumdata = array('picnum' => DB::result_first("SELECT count(*) FROM " . DB::table('home_pic') . " WHERE albumid='{$_G['gp_uploadalbum']}'"), 'updatetime' => $_G['timestamp']);
DB::update('home_album', $albumdata, "albumid='{$_G['gp_uploadalbum']}'");
}
if ($newattach) {
ftpupload($newaids, $uid);
}
}
if (!$modnewthreads && $newattach && $uid == $_G['uid']) {
updatecreditbyaction('postattach', $uid, array(), '', count($newattach), 1, $_G['fid']);
}
if ($attachupdate) {
$query = DB::query("SELECT pid, aid, attachment, thumb, remote FROM " . DB::table(getattachtablebytid($tid)) . " WHERE aid IN (" . dimplode(array_keys($attachupdate)) . ")");
while ($attach = DB::fetch($query)) {
if (array_key_exists($attach['aid'], $attachupdate) && $attachupdate[$attach['aid']]) {
dunlink($attach);
}
}
$uaids = dimplode($attachupdate);
$query = DB::query("SELECT aid, width, filename, filesize, attachment, isimage, thumb, remote FROM " . DB::table('forum_attachment_unused') . " WHERE aid IN ({$uaids}){$uidadd}");
DB::query("DELETE FROM " . DB::table('forum_attachment_unused') . " WHERE aid IN ({$uaids}){$uidadd}");
$attachupdate = array_flip($attachupdate);
while ($attach = DB::fetch($query)) {
$update = $attach;
$update['dateline'] = TIMESTAMP;
$update['remote'] = 0;
//.........这里部分代码省略.........
示例10: libfile
} else {
if ($attach['isimage']) {
require_once libfile('class/image');
$image = new image();
$attach['thumb'] = $image->Thumb($attach['target'], '', '80', '50');
}
if (getglobal('setting/ftp/on')) {
if (ftpcmd('upload', 'portal/' . $attach['attachment'])) {
if ($attach['thumb']) {
ftpcmd('upload', 'portal/' . getimgthumbname($attach['attachment']));
}
$attach['remote'] = 1;
} else {
if (getglobal('setting/ftp/mirror')) {
@unlink($attach['target']);
@unlink(getimgthumbname($attach['target']));
topic_upload_error($attach, 'diy_remote_upload_failed');
}
}
}
$setarr = array('uid' => $_G['uid'], 'username' => $_G['username'], 'filename' => $attach['name'], 'filepath' => $attach['attachment'], 'size' => $attach['size'], 'thumb' => $attach['thumb'], 'remote' => $attach['remote'], 'dateline' => $_G['timestamp'], 'topicid' => $topicid);
$setarr['picid'] = C::t('portal_topic_pic')->insert($setarr, true);
topic_upload_show($topicid);
}
} elseif (submitcheck('diysubmit')) {
require_once libfile('function/portalcp');
$tpldirectory = getstr($_POST['tpldirectory'], 80);
$template = getstr($_POST['template'], 50);
if (dsign($tpldirectory . $template) !== $_POST['diysign']) {
showmessage('diy_sign_invalid');
}
示例11: attachinpost
function attachinpost($attach, $post)
{
global $_G;
$firstpost = $post['first'];
$attach['refcheck'] = !$attach['remote'] && $_G['setting']['attachrefcheck'] || $attach['remote'] && ($_G['setting']['ftp']['hideurl'] || $attach['isimage'] && $_G['setting']['attachimgpost'] && strtolower(substr($_G['setting']['ftp']['attachurl'], 0, 3)) == 'ftp');
$aidencode = packaids($attach);
$widthcode = attachwidth($attach['width']);
$is_archive = $_G['forum_thread']['is_archived'] ? '&fid=' . $_G['fid'] . '&archiveid=' . $_G[forum_thread][archiveid] : '';
$attachthumb = getimgthumbname($attach['attachment']);
$musiccode = getstatus($post[status], 7) && fileext($attach['attachment']) == 'mp3' ? browserversion('ie') > 8 || browserversion('safari') ? '<audio controls="controls"><source src="' . $attach['url'] . $attach['attachment'] . '"></audio>' : parseaudio($attach['url'] . $attach['attachment'], 400) : '';
$__STATICURL = STATICURL;
$return = <<<EOF
<ignore_js_op>
EOF;
if ($attach['attachimg'] && $_G['setting']['showimages'] && (!$attach['price'] || $attach['payed']) && ($_G['group']['allowgetimage'] || $_G['uid'] == $attach['uid'])) {
if (!IS_ROBOT) {
if ($_G['setting']['thumbstatus'] && $attach['thumb']) {
$return .= <<<EOF
<img
EOF;
if ($attach['price'] && $_G['forum_attachmentdown'] && $_G['uid'] != $attach['uid']) {
$return .= <<<EOF
class="attprice"
EOF;
}
$return .= <<<EOF
style="cursor:pointer" id="aimg_{$attach['aid']}" aid="{$attach['aid']}" src="{$__STATICURL}image/common/none.gif" onclick="zoom(this, this.getAttribute('zoomfile'), 0, 0, '{$_G['setting']['showexif']}')" zoomfile="
EOF;
if ($attach['refcheck']) {
$return .= <<<EOF
forum.php?mod=attachment{$is_archive}&aid={$aidencode}&noupdate=yes¬humb=yes
EOF;
} else {
$return .= <<<EOF
{$attach['url']}{$attach['attachment']}
EOF;
}
$return .= <<<EOF
" file="
EOF;
if ($attach['refcheck']) {
$return .= <<<EOF
forum.php?mod=attachment{$is_archive}&aid={$aidencode}
EOF;
} else {
$return .= <<<EOF
{$attach['url']}{$attachthumb}
EOF;
}
$return .= <<<EOF
" inpost="1" alt="{$attach['imgalt']}" title="{$attach['imgalt']}" onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})" />
EOF;
} else {
$return .= <<<EOF
<img
EOF;
if ($attach['price'] && $_G['forum_attachmentdown'] && $_G['uid'] != $attach['uid']) {
$return .= <<<EOF
class="attprice"
EOF;
}
$return .= <<<EOF
id="aimg_{$attach['aid']}" aid="{$attach['aid']}" src="{$__STATICURL}image/common/none.gif" zoomfile="
EOF;
if ($attach['refcheck']) {
$return .= <<<EOF
forum.php?mod=attachment{$is_archive}&aid={$aidencode}&noupdate=yes¬humb=yes
EOF;
} else {
$return .= <<<EOF
{$attach['url']}{$attach['attachment']}
EOF;
}
$return .= <<<EOF
" file="
EOF;
if ($attach['refcheck']) {
$return .= <<<EOF
forum.php?mod=attachment{$is_archive}&aid={$aidencode}&noupdate=yes
EOF;
} else {
$return .= <<<EOF
{$attach['url']}{$attach['attachment']}
EOF;
}
$return .= <<<EOF
" {$widthcode} id="aimg_{$attach['aid']}" inpost="1" alt="{$attach['imgalt']}" title="{$attach['imgalt']}" onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})" />
EOF;
}
$return .= <<<EOF
<div class="tip tip_4 aimg_tip" id="aimg_{$attach['aid']}_menu" style="position: absolute; display: none" disautofocus="true">
<div class="tip_c xs0">
<div class="y">{$attach['dateline']} 上传</div>
//.........这里部分代码省略.........
示例12: blog_post
function blog_post($POST, $olds = array())
{
global $_G, $space;
$isself = 1;
if (!empty($olds['uid']) && $olds['uid'] != $_G['uid']) {
$isself = 0;
$__G = $_G;
$_G['uid'] = $olds['uid'];
$_G['username'] = addslashes($olds['username']);
}
$POST['subject'] = getstr(trim($POST['subject']), 80, 1, 1);
$POST['subject'] = censor($POST['subject']);
if (strlen($POST['subject']) < 1) {
$POST['subject'] = dgmdate($_G['timestamp'], 'Y-m-d');
}
$POST['friend'] = intval($POST['friend']);
$POST['target_ids'] = '';
if ($POST['friend'] == 2) {
$uids = array();
$names = empty($_POST['target_names']) ? array() : explode(',', preg_replace("/(\\s+)/s", ',', $_POST['target_names']));
if ($names) {
$query = DB::query("SELECT uid FROM " . DB::table('common_member') . " WHERE username IN (" . dimplode($names) . ")");
while ($value = DB::fetch($query)) {
$uids[] = $value['uid'];
}
}
if (empty($uids)) {
$POST['friend'] = 3;
} else {
$POST['target_ids'] = implode(',', $uids);
}
} elseif ($POST['friend'] == 4) {
$POST['password'] = trim($POST['password']);
if ($POST['password'] == '') {
$POST['friend'] = 0;
}
}
if ($POST['friend'] !== 2) {
$POST['target_ids'] = '';
}
if ($POST['friend'] !== 4) {
$POST['password'] == '';
}
$POST['tag'] = dhtmlspecialchars(trim($POST['tag']));
$POST['tag'] = getstr($POST['tag'], 500, 1, 1);
$POST['tag'] = censor($POST['tag']);
if ($_G['mobile']) {
$POST['message'] = getstr($POST['message'], 0, 1, 0, 1);
$POST['message'] = censor($POST['message']);
} else {
$POST['message'] = checkhtml($POST['message']);
$POST['message'] = getstr($POST['message'], 0, 1, 0, 0, 1);
$POST['message'] = censor($POST['message']);
$POST['message'] = preg_replace(array("/\\<div\\>\\<\\/div\\>/i", "/\\<a\\s+href\\=\"([^\\>]+?)\"\\>/i"), array('', '<a href="\\1" target="_blank">'), $POST['message']);
}
$message = $POST['message'];
if (censormod($message) || censormod($POST['subject']) || $_G['group']['allowblogmod']) {
$blog_status = 1;
} else {
$blog_status = 0;
}
if (empty($olds['classid']) || $POST['classid'] != $olds['classid']) {
if (!empty($POST['classid']) && substr($POST['classid'], 0, 4) == 'new:') {
$classname = dhtmlspecialchars(trim(substr($POST['classid'], 4)));
$classname = getstr($classname, 0, 1, 1);
$classname = censor($classname);
if (empty($classname)) {
$classid = 0;
} else {
$classid = DB::result(DB::query("SELECT classid FROM " . DB::table('home_class') . " WHERE uid='{$_G['uid']}' AND classname='{$classname}'"));
if (empty($classid)) {
$setarr = array('classname' => $classname, 'uid' => $_G['uid'], 'dateline' => $_G['timestamp']);
$classid = DB::insert('home_class', $setarr, 1);
}
}
} else {
$classid = intval($POST['classid']);
}
} else {
$classid = $olds['classid'];
}
if ($classid && empty($classname)) {
$classname = DB::result(DB::query("SELECT classname FROM " . DB::table('home_class') . " WHERE classid='{$classid}' AND uid='{$_G['uid']}'"));
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 = DB::query("SELECT * FROM " . DB::table('home_pic') . " WHERE picid IN (" . dimplode($picids) . ") AND uid='{$_G['uid']}'");
while ($value = DB::fetch($query)) {
if (empty($titlepic) && $value['thumb']) {
$titlepic = getimgthumbname($value['filepath']);
$blogarr['picflag'] = $value['remote'] ? 2 : 1;
}
$uploads[$POST['picids'][$value['picid']]] = $value;
}
//.........这里部分代码省略.........
示例13: mobcent_pic_save
//.........这里部分代码省略.........
return lang('message', 'no_privilege_avatar');
}
if ($_G['setting']['need_email'] && empty($_G['member']['emailstatus'])) {
return lang('message', 'no_privilege_email');
}
if ($_G['setting']['need_friendnum']) {
space_merge($_G['member'], 'count');
if ($_G['member']['friends'] < $_G['setting']['need_friendnum']) {
return lang('message', 'no_privilege_friendnum', array('friendnum' => $_G['setting']['need_friendnum']));
}
}
}
if ($_G['group']['maximagesize'] && $upload->attach['size'] > $_G['group']['maximagesize']) {
return lang('spacecp', 'files_can_not_exceed_size', array('extend' => $upload->attach['ext'], 'size' => sizecount($_G['group']['maximagesize'])));
}
$maxspacesize = checkperm('maxspacesize');
if ($maxspacesize) {
space_merge($space, 'count');
space_merge($space, 'field_home');
if ($space['attachsize'] + $upload->attach['size'] > $maxspacesize + $space['addsize'] * 1024 * 1024) {
return lang('spacecp', 'inadequate_capacity_space');
}
}
$showtip = true;
$albumfriend = 0;
if ($albumid) {
$catid = intval($catid);
$albumid = album_creat_by_id($albumid, $catid);
} else {
$albumid = 0;
$showtip = false;
}
$upload->save();
if ($upload->error()) {
return lang('spacecp', 'mobile_picture_temporary_failure');
}
if (!$upload->attach['imageinfo'] || !in_array($upload->attach['imageinfo']['2'], array(1, 2, 3, 6))) {
@unlink($upload->attach['target']);
return lang('spacecp', 'only_allows_upload_file_types');
}
$new_name = $upload->attach['target'];
require_once libfile('class/image');
$image = new image();
$result = $image->Thumb($new_name, '', 140, 140, 1);
$thumb = empty($result) ? 0 : 1;
if ($_G['setting']['maxthumbwidth'] && $_G['setting']['maxthumbheight']) {
if ($_G['setting']['maxthumbwidth'] < 300) {
$_G['setting']['maxthumbwidth'] = 300;
}
if ($_G['setting']['maxthumbheight'] < 300) {
$_G['setting']['maxthumbheight'] = 300;
}
$image->Thumb($new_name, '', $_G['setting']['maxthumbwidth'], $_G['setting']['maxthumbheight'], 1, 1);
}
// 支持客户端上传相册水印 Author:HanPengyu Data:2014/12/04
Yii::import('application.components.discuz.source.class.class_image', true);
$image = new Mobcent_Image();
$image->makeWatermark($new_name, '', 'album');
// if ($iswatermark) {
// $image->Watermark($new_name, '', 'album');
// }
$pic_remote = 0;
$album_picflag = 1;
if (getglobal('setting/ftp/on')) {
$ftpresult_thumb = 0;
$ftpresult = ftpcmd('upload', 'album/' . $upload->attach['attachment']);
if ($ftpresult) {
@unlink($_G['setting']['attachdir'] . 'album/' . $upload->attach['attachment']);
if ($thumb) {
$thumbpath = getimgthumbname($upload->attach['attachment']);
ftpcmd('upload', 'album/' . $thumbpath);
@unlink($_G['setting']['attachdir'] . 'album/' . $thumbpath);
}
$pic_remote = 1;
$album_picflag = 2;
} else {
if (getglobal('setting/ftp/mirror')) {
@unlink($upload->attach['target']);
@unlink(getimgthumbname($upload->attach['target']));
return lang('spacecp', 'ftp_upload_file_size');
}
}
}
$title = getstr($title, 200);
$title = censor($title);
if (censormod($title) || $_G['group']['allowuploadmod']) {
$pic_status = 1;
} else {
$pic_status = 0;
}
$setarr = array('albumid' => $albumid, 'uid' => $_G['uid'], 'username' => $_G['username'], 'dateline' => $_G['timestamp'], 'filename' => addslashes($upload->attach['name']), 'postip' => $_G['clientip'], 'title' => $title, 'type' => addslashes($upload->attach['ext']), 'size' => $upload->attach['size'], 'filepath' => $upload->attach['attachment'], 'thumb' => $thumb, 'remote' => $pic_remote, 'status' => $pic_status);
$setarr['picid'] = C::t('home_pic')->insert($setarr, 1);
C::t('common_member_count')->increase($_G['uid'], array('attachsize' => $upload->attach['size']));
include_once libfile('function/stat');
if ($pic_status) {
updatemoderate('picid', $setarr['picid']);
}
updatestat('pic');
return $setarr;
}
示例14: attachinpost
function attachinpost($attach, $firstpost = 0)
{
global $_G;
$attach['refcheck'] = !$attach['remote'] && $_G['setting']['attachrefcheck'] || $attach['remote'] && ($_G['setting']['ftp']['hideurl'] || $attach['isimage'] && $_G['setting']['attachimgpost'] && strtolower(substr($_G['setting']['ftp']['attachurl'], 0, 3)) == 'ftp');
$aidencode = packaids($attach);
$widthcode = attachwidth($attach['width']);
$is_archive = $_G['forum_thread']['is_archived'] ? '&fid=' . $_G['fid'] . '&archiveid=' . $_G[forum_thread][archiveid] : '';
$attachthumb = getimgthumbname($attach['attachment']);
$replayinfo_g = get_replayinfo($attach['aid']);
$time_len = get_game_lentime($replayinfo_g['length']);
$data = get_replayplayerinfo($attach['aid']);
//echo $attach['aid'];
//print_r($attach);
$return = <<<EOF
<ignore_js_op>
<style type="text/css" id="replay_css">
.wa .wa_text {
font-family: tahoma;
font-size: 42px;
font-weight:bold;
position: absolute;
margin: 60px 0px 0px 50px;
}
.page
{
background: #E5ECF4;
color: #000000;
}
.tborder
{
background: #D1D1E1;
color: #000000;
border: 1px solid #0B198C;
}
.tcat
{
background: #869BBF url(../../images/gradients/gradient_tcat.gif) repeat-x top left;
color: #FFFFFF;
font: bold 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
}
.tcat a:link, .tcat_alink
{
color: #ffffff;
text-decoration: none;
}
.tcat a:visited, .tcat_avisited
{
color: #ffffff;
text-decoration: none;
}
.tcat a:hover, .tcat a:active, .tcat_ahover
{
color: #FFFF66;
text-decoration: underline;
}
.thead
{
background: #5C7099 url(../../images/gradients/gradient_thead.gif) repeat-x top left;
color: #FFFFFF;
font: bold 12px tahoma, verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
}
.thead a:link, .thead_alink
{
color: #FFFFFF;
}
.thead a:visited, .thead_avisited
{
color: #FFFFFF;
}
.thead a:hover, .thead a:active, .thead_ahover
{
color: #FFFF00;
}
.tfoot
{
background: #3E5C92;
color: #E0E0F6;
}
.tfoot a:link, .tfoot_alink
{
color: #E0E0F6;
}
.tfoot a:visited, .tfoot_avisited
{
color: #E0E0F6;
}
.tfoot a:hover, .tfoot a:active, .tfoot_ahover
{
color: #FFFF66;
}
.alt1, .alt1Active
{
background: #F5F5FF;
color: #000000;
}
.alt2, .alt2Active
{
background: #E5ECF4;
color: #000000;
//.........这里部分代码省略.........
示例15: blog_post
//.........这里部分代码省略.........
}
}
} else {
$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]);
}