24
2013-12

discuzX3.0论坛活动利用confirm判断是否已经有论坛账户进行跳转

       公司论坛从discuz6.1升级到discuzX3.0之后,以前的程序都不能用了,需要重新修改,经过一番修改判断所有程序又可以重新使用了,下面就贴出代码,记录一下,主要是提示php中confirm的用法!

<?php
define('APPTYPEID', 2);
define('CURSCRIPT', 'forum');
define('EEWORLD_BBS_ROOT',dirname(__FILE__).'/');
include EEWORLD_BBS_ROOT.'/source/class/class_core.php';
C::app()->init();
$discuz_uid = $_G['uid'];
$id = $_GET['id'];
if(!$discuz_uid) {
    header('content-type:text/html; charset=utf-8;');
    echo "<script>if(confirm('如果您已经有EEworld论坛账户,请点击【确定】继续,如果您没有EEworld论坛账户,请点击【取消】注册!')){location.href='http://bbs.eeworld.com.cn/member.php?mod=logging&action=login';}else{location.href='http://bbs.eeworld.com.cn/member.php?mod=register_eeworld.php';}</script>";
}
else{
    $res=DB::fetch_first("select * from %t where uid={$discuz_uid}",array('common_member'));
    if($res) {
        $username=$res['username'];
    }
}
    header('content-type:text/html; charset=utf-8;');
    $username=iconv('gbk','utf-8',$username);
//cypress活动 id=1
if($id==1) {
    include template('huodong/cypress186');
}
//cypress活动表单2  id=2
if($id==2) {
    include template('huodong/cypress187');
}
//ADI活动表单3  id=3
if($id==3) {
    //查询得到用户的姓名,email,公司,电话等信息
    $res1=DB::fetch_first("select m.email,f.realname,f.company,f.telephone from %t as m left join %t as f on m.uid=f.uid where m.uid={$discuz_uid}",array('common_member','common_member_profile'));
    header('content-type:text/html; charset=utf-8;');
    $email=iconv('gbk','utf-8',$res1['email']);
    $name=iconv('gbk','utf-8',$res1['realname']);
    $company=iconv('gbk','utf-8',$res1['company']);
    $mobile=iconv('gbk','utf-8',$res1['telephone']);
    include template('huodong/ADI20130712');
}
//芯币兑换礼品活动表单
if($id==4) {
    $productid=$_GET['productid'];
    include template('huodong/qinbi');
}
//renesas活动表单
if($id==5) {
    include template('huodong/renesas');
}
//MDO混合域示波器
if($id==6) {
    $f18='EEWORLD'.date('His',time()).rand(0,10000);
    include template('huodong/mdo');
}
//NXP LPC800 20130830活动
if($id==7) {
    include template('huodong/lpc800-830');
}
    
//vishay被动元器件活动
if($id==8) {
    include template('huodong/vishay_e');
}
//webench注册有礼活动
if($id==9) {
    include template('huodong/webenchregister');
}
//ADI有奖问答活动2
if($id==10) {
    //查询得到用户的姓名,email,公司,电话等信息
    $res1=DB::fetch_first("select m.email,f.realname,f.company,f.telephone from %t as m left join %t as f on m.uid=f.uid where m.uid={$discuz_uid}",array('common_member','common_member_profile'));
    header('content-type:text/html; charset=utf-8;');
    $email=iconv('gbk','utf-8',$res1['email']);
    $name=iconv('gbk','utf-8',$res1['realname']);
    $company=iconv('gbk','utf-8',$res1['company']);
    $mobile=iconv('gbk','utf-8',$res1['telephone']);
    include template('huodong/ADI2013091822');
}
//Intel有奖问答活动2
if($id==11) {
    include template('huodong/intel1013');
}
//vishay视频活动2
if($id==12) {
    include template('huodong/vishay_20131127');
}
//美信有奖问答活动
if($id==13) {
    include template('huodong/maxin20131129');
}
//美信有奖问答活动
if($id==14) {
    include template('huodong/nxp201312');
}
//ADI有奖问答活动3
if($id==15) {
    //查询得到用户的姓名,email,公司,电话等信息
    $res1=DB::fetch_first("select m.email,f.realname,f.company,f.telephone from %t as m left join %t as f on m.uid=f.uid where m.uid={$discuz_uid}",array('common_member','common_member_profile'));
    header('content-type:text/html; charset=utf-8;');
    $email=iconv('gbk','utf-8',$res1['email']);
    $name=iconv('gbk','utf-8',$res1['realname']);
    $company=iconv('gbk','utf-8',$res1['company']);
    $mobile=iconv('gbk','utf-8',$res1['telephone']);
    include template('huodong/ADI20131219');
}
//Intel有奖问答活动3
if($id==16) {
    include template('huodong/intel1220');
}
?>

除非注明,文章均为史亚永原创,欢迎转载!转载请注明本文地址,谢谢。

本文地址:http://www.shiyayong.cn/post/242.html

评论列表:

发表评论:

(设置个性头像)

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

无觅相关文章插件,快速提升流量