天天躁日日躁狠狠躁AV麻豆-天天躁人人躁人人躁狂躁-天天澡夜夜澡人人澡-天天影视香色欲综合网-国产成人女人在线视频观看-国产成人女人视频在线观看

Discuz! 5.0.0論壇程序中加入一段js代碼,讓會員點擊下載附件前自動彈出提示窗口

你需要修改attachment.php文件 在根目錄下 
在$attachexists = $ispaid = FALSE;下面添加 
if (!empty($checktwo)) { 
在最末尾的?>前添加 
} else { 
echo "<script>alert('寫上你要提示的內容')</script>"; 
echo "<META HTTP-EQUIV=/"Refresh/" CONTENT=/"0;URL=$php_SELF?checktwo=1&aid=$aid/">"; 

我在本機架設Discuz! 5.0.1調試通過了 
完整代碼如下: 
<?php 
/* 
[Discuz!] (C)2001-2006 Comsenz Inc. 
This is NOT a freeware, use is subject to license terms 
$RCSfile: attachment.php,v $ 
$Revision: 1.13 $ 
$Date: 2006/08/11 06:51:07 $ 
*/ 
require_once './include/common.inc.php'; 
$discuz_action = 14; 
if($attachrefcheck && $_SERVER['HTTP_REFERER'] && preg_replace("/https?:////([^//]+).*/i", "http://1", $_SERVER['HTTP_REFERER']) != $_SERVER['HTTP_HOST']) { 
//header("Location: {$boardurl}images/common/invalidreferer.gif"); 
showmessage('attachment_referer_invalid', NULL, 'HALTED'); 

/* 
$query = $db->query("SELECT a.*, t.fid, p.authorid FROM {$tablepre}attachments a, {$tablepre}threads t, {$tablepre}posts p 
WHERE a.aid='$aid' AND t.tid=a.tid AND p.pid=a.pid AND t.displayorder>='0' AND p.invisible='0'"); 
$attach = $db->fetch_array($query); 
*/ 
periodscheck('attachbanperiods'); 
$attachexists = $ispaid = FALSE; 
if (!empty($checktwo)) { 
if(!empty($aid)) { 
$query = $db->query("SELECT * FROM {$tablepre}attachments WHERE aid='$aid'"); 
if($attach = $db->fetch_array($query)) { 
$query = $db->query("SELECT tid, fid, price, special FROM {$tablepre}threads WHERE tid='$attach[tid]' AND displayorder>='0'"); 
$thread = $db->fetch_array($query); 
if($thread['fid']) { 
$query = $db->query("SELECT authorid FROM {$tablepre}posts WHERE pid='$attach[pid]' AND invisible='0'"); 
if($db->num_rows($query)) { 
$attach['authorid'] = $db->result($query, 0); 
$attachexists = TRUE; 




if($allowgetattach && ($attach['readperm'] && $attach['readperm'] > $readaccess) && $adminid <= 0 && !($discuz_uid && $discuz_uid == $attach['authorid'])) { 
showmessage('attachment_forum_nopermission', NULL, 'NOPERM'); 

if(!$thread['special'] && $thread['price'] > 0 && (!$discuz_uid || ($discuz_uid && $discuz_uid != $attach['authorid'] && $adminid <=0))) { 
$query = $db->query("SELECT uid FROM {$tablepre}paymentlog WHERE uid='$discuz_uid' AND tid='$attach[tid]'"); 
if($db->result($query, 0)) { 
$ispaid = TRUE; 
} else { 
showmessage('attachment_payto', 'viewthread.php?tid='.$attach['tid']); 


$filename = $attachdir.'/'.$attach['attachment']; 
if(is_readable($filename) && $attachexists) { 
$query = $db->query("SELECT f.viewperm, f.getattachperm, f.getattachcredits, a.allowgetattach FROM {$tablepre}forumfields f 
LEFT JOIN {$tablepre}access a ON a.uid='$discuz_uid' AND a.fid=f.fid 
WHERE f.fid='$thread[fid]'"); 
$forum = $db->fetch_array($query); 
if(!$ispaid) { 
if(!$forum['allowgetattach']) { 
if(!$forum['getattachperm'] && !$allowgetattach) { 
showmessage('group_nopermission', NULL, 'NOPERM'); 
} elseif(($forum['getattachperm'] && !forumperm($forum['getattachperm'])) || ($forum['viewperm'] && !forumperm($forum['viewperm']))) { 
showmessage('attachment_forum_nopermission', NULL, 'NOPERM'); 



if(!($isimage = preg_match("/^image//.+/", $attach['filetype']))) { 
checklowerlimit($creditspolicy['getattach'], -1); 

if(empty($noupdate)) { 
if($delayviewcount == 2 || $delayviewcount == 3) { 
$logfile = './forumdata/cache/cache_attachviews.log'; 
if(substr($timestamp, -1) == '0') { 
require_once DISCUZ_ROOT.'./include/misc.func.php'; 
updateviews('attachments', 'aid', 'downloads', $logfile); 

if(@$fp = fopen(DISCUZ_ROOT.$logfile, 'a')) { 
fwrite($fp, "$aid/n"); 
fclose($fp); 
} elseif($adminid == 1) { 
showmessage('view_log_invalid'); 

} else { 
$db->query("UPDATE {$tablepre}attachments SET downloads=downloads+'1' WHERE aid='$aid'", 'UNBUFFERED'); 


if(!$isimage) { 
$forum['getattachcredits'] = $forum['getattachcredits'] ? unserialize($forum['getattachcredits']) : array(); 
$getattachcredits = $forum['getattachcredits'] ? $forum['getattachcredits'] : $creditspolicy['getattach']; 
updatecredits($discuz_uid, $getattachcredits, -1); 

$filesize = filesize($filename); 
ob_end_clean(); 
header('Cache-control: max-age=31536000'); 
header('Expires: '.gmdate('D, d M Y H:i:s', $timestamp + 31536000).' GMT'); 
header('Content-Encoding: none'); 
$attach['filename'] = (strtolower($charset) == 'utf-8' && strexists($_SERVER['HTTP_USER_AGENT'], 'MSIE')) ? urlencode($attach['filename']) : $attach['filename']; 
if($isimage && !empty($noupdate)) { 
header('Content-Disposition: inline; filename='.$attach['filename']); 
} else { 
header('Content-Disposition: attachment; filename='.$attach['filename']); 

header('Content-Type: '.$attach['filetype']); 
@$fp = fopen($filename, 'rb'); 
@flock($fp, 2); 
$attachment = @fread($fp, $filesize); 
@fclose($fp); 
echo $attachment; 

} else { 
showmessage('attachment_nonexistence'); 

} else { 
echo "<script>alert('$php_SELF')</script>"; 
echo "<META HTTP-EQUIV=/"Refresh/" CONTENT=/"0;URL=$php_SELF?checktwo=1&aid=$aid/">"; 

?> 

php技術Discuz! 5.0.0論壇程序中加入一段js代碼,讓會員點擊下載附件前自動彈出提示窗口,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 色噜噜噜视频 | 午夜免费啪视频观看视频 | 2020年国产精品午夜福利在线观看 | 久久超碰国产精品最新 | 欧美另类老少配hd | 中文字幕亚洲无线码在线 | 久久视热频国只有精品 | 亚洲色大成网站WWW永久麻豆 | 国产欧美一区二区精品仙草咪 | 国产真实强被迫伦姧女在线观看 | 沈阳熟女露脸对白视频 | 色妹子综合 | 在线涩涩免费观看国产精品 | 性色AV乱码一区二区三区视频 | 精品极品三大极久久久久 | 人人爽天天碰狠狠添 | 精品无码久久久久久国产百度 | 成人在线小视频 | 快穿之H啪肉 | 我的好妈妈8高清在线观看WWW | 国产精品96久久久久久AV不卡 | 99久久精品免费看国产免费 | 亚洲乱色视频在线观看 | 国产精品一区二区制服丝袜 | 国产免费午夜高清 | 亚州免费一级毛片 | 乱精品一区字幕二区 | 良家人妻无码专区九色颜射 | 亚洲精品成人a在线观看 | 亚洲成片在线看 | 亚洲色爽视频在线观看 | 超嫩校花被灌醉在线观看 | 久久4k岛国高清一区二区 | 亚洲国产第一 | 亚洲人成人毛片无遮挡 | 富婆大保健嗷嗷叫普通话对白 | 调教美丽的白丝袜麻麻视频 | 内射气质御姐视频在线播放 | 在线看片福利无码网址 | 嗯啊快停下我是你老师啊H 嗯啊快拔出来我是你老师视频 | 青青草偷拍国产亚洲欧洲 |