define('IN_PHPBB', true);
$phpbb_root_path = '/bbs/';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.php');
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
$dl_id = $_REQUEST['id'];
$userdata = session_pagestart($user_ip, 28);
init_userprefs($userdata);
if(!($userdata['session_logged_in']))
{
$type = 1;
$title = "您未登录,请您登录。";
}
if($type != 1)
{
$sql ="select dl_title, dl_koujian, dl_file from phpbb_download where dl_id = $dl_id and dl_enable = 1";
$result = $db->sql_query($sql);
if ( $row = $db->sql_fetchrow($result) )
{
$koujian = $row['dl_koujian'];
$dl_title = $row['dl_title'];
if( $userdata['user_mian'] == 1 )
{
$type = 2;
$title = "下载" . $dl_title;
}
else if( $userdata['user_jifeng'] >= $koujian )
{
$type = 3;
$title = "下载" . $dl_title;
}
else
{
$type = 4;
$title = "您的积分不足!";
}
}
else
message_die(GENERAL_MESSAGE, "您要下载的资料不存在!");
}
if(($type == 2 or $type ==3) && (!empty($_REQUEST['a'])))
{
$file = $row['dl_file'];
if($type == 3)
{
$sql="UPDATE phpbb_users SET user_jifeng = user_jifeng - $koujian";
$db->sql_query($sql);
$sql="UPDATE phpbb_download SET dl_downs = dl_downs + 1 where dl_id = $dl_id";
$db->sql_query($sql);
}
redirect("/pub/upload/$file",1);
}
$sql = "select url7,img7 from phpbb_ad";
$result=$db->sql_query($sql);
if ( $row = $db->sql_fetchrow($result) )
{
$url1 = $row['url7'];
$img1 = $row['img7'];
}
$title = "企业文化资料下载中心-" . $title;
include "head.php";
?>
=$row['topic_title']?> |
|
|
}?>
switch($type)
{
case 1:
echo "欢迎您光临中华企业文化网下载企业文化相关资料,如您是我们的注册用户,请您先登录;如您还不是我们的注册用户,请您注册。立即注册请点击这里,如您目前不准备注册,欢迎浏览企业文化网站或企业文化论坛。";
break;
case 2:
echo "您荣幸地成为本网超级贵宾,下载此资料,免扣积分!
→点击这里下载!";
break;
case 3:
echo "注意:下载此资料,要扣 $koujian 分!
→点击这里下载!";
break;
case 4:
echo "你的积分不足,不能下载此资料!
在论坛里发表500字以上的主题帖,可获得一分;
跟帖五次,也可获得一分!";
break;
}
?>
|
|
| |
|
include "end.php";
?>