www.gusucode.com > 仿51.com的php源码 1.1 > User/MyHomepageTemplate.php
<?php include("CheckLogined.php"); include("../include/dbclass.php"); $db=new DbConn(); include "functions.php"; $function=new functions(); include "user.php"; $globalvars->set_vars(); $user_dat = $user->process_user($globalvars); if($_GET["action"]=="SetDefaultStyle") { $styleid=$_GET["styleid"]; $uid=$_COOKIE["uid"]; $db=new DbConn(); $sql="update userdata set DefaultStyle='$styleid' where User_Account='$uid'"; $db->Execute($sql); echo "<script>alert('保存成功!');window.location.href='MyHomepageTemplate.php';</script>"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>村委会档案管理中心 - 首页</title> <script src="/js/global.js" language="javascript"></script> <link href="../images/User_Main.css" rel="stylesheet" type="text/css" /> <script> try{ if(top!=window){ document.domain ="www.wu-liao.com"; }else{ top.location.href="/webin.php?refer=%2FUser%2FMyHomepageTemplate.php"; } }catch(e){} function showNewMessage(user){ top.showNewMessage(user); } </script> <script> /*********Js Function Begin*********/ //非VIP使用受限功能时弹出free-vip.php function AppUpgrateVip(msg) { var isVip = false; if (!isVip) { alert(msg); window.open('http://www.wu-liao.com/help/free-vip.php', 'VIP'); return false; } else { return true; } } function AppClosePOP() { var elm_popBackground = document.getElementById("popBackgroundLayer"); var elm_popFrameWork = document.getElementById("popFrameWorkLayer"); popContentObject2 = document.getElementById("popContentLayer"); srcContentObject.innerHTML = popContentObject2.innerHTML; popContentObject2.innerHTML = ''; elm_popBackground.style.display = "none"; elm_popFrameWork.style.display = "none"; } function AppMoveLayer(layerId) { var layer = document.getElementById(layerId); if (layer) { layer.style.position = "absolute"; layer.style.top = (document.documentElement.scrollTop + (document.documentElement.clientHeight - document.getElementById(layerId).offsetHeight) / 2) + "px"; layer.style.left = (document.documentElement.scrollLeft + (document.documentElement.clientWidth - document.getElementById(layerId).offsetWidth) / 2) + "px"; } } function AppCreatePOP() { var layerContainer = '<div id="popBackgroundLayer"></div><div id="popFrameWorkLayer" style="width:100%"><div id="popContentLayer" align="center"></div></div>'; document.write(layerContainer); popContentObject2 = document.getElementById("popContentLayer"); } function AppOpenPOP(title, obj_name, w, h) { var elm_popBackground = document.getElementById("popBackgroundLayer"); var elm_popFrameWork = document.getElementById("popFrameWorkLayer"); elm_popBackground.style.height = document.body.scrollHeight; elm_popBackground.style.width = document.body.scrollWidth; elm_popFrameWork.style.width = w; elm_popFrameWork.style.height = h; srcContentObject = document.getElementById(obj_name); if(srcContentObject) { popContentObject2.innerHTML = srcContentObject.innerHTML; }else{ alert(obj_name + '未找到'); } elm_popBackground.style.display = "block"; elm_popFrameWork.style.display = "block"; AppMoveLayer("popFrameWorkLayer"); } /*********Js Function End*********/ var isDisabled=""; function selectTpl(num) { if(isDisabled=='YES') { alert('要选择该模板必须满足以下条件\r1、拥有5篇以上公开的日记文集 \r2、拥有5张以上照片 \r3、用户积分为200分以上 '); return false; } document.all("radio"+num).checked=true; if(confirm('确定要选择该模板吗?')) { document.tplform.submit(); return true; } return false; } function openEditForm(styleid,gname_old) { var obj = document.formedit; obj.styleid_old.value=styleid; obj.gname_old.value=gname_old; obj.gname.value = gname_old; document.getElementById("oldgroupname").innerHTML = gname_old; document.getElementById("editform").style.display = "block"; } function closeEditForm(obj) { obj.style.display = "none"; } function checkEditForm(obj) { if(obj.gname.value == "" || obj.gname.value == obj.gname_old.value) { obj.gname.focus(); return false; } obj.change.disabled=true; return true; } </script> </head> <body> <div id="top"><?php require("../top.php"); ?> </div> <div id="nav"> <div id="navt"></div> </div> <div id="mjx"></div> <div id="main"> <div id="left"> <div id="leph"> <div class="phff"> <div class="phtt"> 主页设置</div> <div class=phl1><div class=phz><a title='选择经典模板'>选择经典模板</a></div></div><div class=phl2><a href='MyHomepageTemplate2.php?group=2' title='选择博客模板'>选择博客模板</a></div><div class=phl2><a href='MusicHomepageBg.php' title='设置背景音乐'>设置背景音乐</a></div><div class=phl2><a href='MyHomepageBulletin.php' title='设置主页标题'>设置主页标题</a></div><!--<div class="phl2"> <a href='http://shop.51.com/main/' title='设置主页特效'>设置主页特效</a></div>--> </div> </div> </div> <div id="right"> <div id="a4n"> <div class="anphg"><div class="a4">选择经典模板</div></div> <script src="../js/uccookie.js"></script> <script> var bConfirm=false; //我的主页连接cookie设置 function myhomepageset() { SetCookie("ucpreviewhomepage",0,null,'/','www.wu-liao.com'); window.open("http://www.wu-liao.com/home.php?user=<?php echo $user_dat['name'];?>",'',''); } document.getElementById('myhomepage').target="_self"; document.getElementById('myhomepage').href="javascript:myhomepageset()"; //离开页面时设置cookie window.onbeforeunload=function() { if(!bConfirm) { //alert('okk'); SetCookie("ucpreviewhomepage",0,null,'/','www.wu-liao.com'); SetCookie("tplpagestate",'-1',null,'/','www.wu-liao.com'); //-1表示即使是预览,"日记文集在首页的显示"也是读数据库的 } bConfirm=false; } //预览函数 function previewFunc(styleid) { bConfirm=true; SetCookie("ucpreviewhomepage",1,null,'/','www.wu-liao.com'); SetCookie("tplpagestate",'-1',null,'/','www.wu-liao.com'); //-1表示即使是预览,"日记文集在首页的显示"也是读数据库的 var formurl='/User/_SocketStyle.php?action=applystyle&user=<?php echo $user_dat['name'];?>&styleid='+styleid+'&url=/User/MyHomepageTemplate.php?type=&group=0&preview=1'; var newwin=window.open(formurl,'preview',''); newwin.focus(); } </script> <script> function previewTpl(num) { bConfirm=true; SetCookie("ucpreviewhomepage",1,null,'/','www.wu-liao.com'); SetCookie("ucpreview",1,null,'/','www.wu-liao.com'); SetCookie("tpldefaultstyle",'norefusercss',null,'/','www.wu-liao.com'); SetCookie("tplhomepageid",num,null,'/','www.wu-liao.com'); SetCookie("tplpagestate",1,null,'/','www.wu-liao.com'); var userweburl="http://www.wu-liao.com/home.php?user=<?php echo $user_dat['name'];?>"; var newwin=window.open(userweburl,'preview',''); newwin.focus(); } </script> </div> <div id="fenle"> <div style='width:568px;border:1px solid #FFCC33;background:#FDFCDF;line-height:22px;height:22px;font-size:14px;font-weight:bold;margin-bottom:7px;margin-left:16px!important;margin-left:32px'> <!-- 想要寻找图片素材?制造个性主页? <a href='http://qun.51.com/index' target='_blank'><u><font color="#FF0000" size='14px'>点击这里</font></u></a>,5分钟马上学会美化51主页!--> </div> <div class="mbys" style='margin-left:16px!important;margin-left:32px'>系统模板</div> <div class="semk2" style='width:600px;margin-top:10px;height:160px;margin-left:16px!important;margin-left:32px'> <ul> <li style='width:170px;height:160px;'> <?php if($user_dat['DefaultStyle']=="130") {?> <a href='http://www.wu-liao.com/home.php?user=<?php echo $user_dat['name']; ?>' id="myhomepage" target='_blank'><img src="skin/130.jpg" width="100" height="73" style='background:#FFFF99; padding:3px;border:3px #FFCC00 solid;cursor:hand' /></a><br /> <br/><span style='color:#FF0000'><B>已应用</B></span> <?php }else{?> <img src="skin/130.jpg" width="100" height="73" style='cursor:hand;' onclick="location.href='?action=SetDefaultStyle&styleid=130';"/><br> <br><a style='cursor:hand;' onclick="location.href='?action=SetDefaultStyle&styleid=130';" /><span style='color:#0000cc'><u>应用</u></span></a> <?php }?> |<a href="#" onClick="previewTpl('130')"><span style='color:#0000cc'><u>预览</u></span></a><!--<br><a href='/User/CreateStyle.php?MainStyleId=130&action=Quick' onclick="return AppUpgrateVip('只有VIP才能应用自定模版。请升级VIP')" ><span style='color:#0000CC;position:relative;top:5px'><u>快速自定义</u></span></a><span style="position:relative;top:5px">|</span><a href='/User/CreateStyle.php?MainStyleId=130&action=Adv' onclick="return AppUpgrateVip('只有VIP才能应用自定模版。请升级VIP')"><span style='color:#0000CC;position:relative;top:5px'><u>高级自定义</u></span></a><BR>--> </li> <li style='width:170px;height:160px;'> <?php if($user_dat['DefaultStyle']=="132") {?> <a href='http://www.wu-liao.com/home.php?user=<?php echo $user_dat['name']; ?>' id="myhomepage" target='_blank'><img src="skin/132.jpg" width="100" height="73" style='background:#FFFF99; padding:3px;border:3px #FFCC00 solid;cursor:hand' /></a><br /> <br/><span style='color:#FF0000'><B>已应用</B></span> <?php }else{?> <img src="skin/132.jpg" width="100" height="73" style='cursor:hand;' onclick="location.href='?action=SetDefaultStyle&styleid=132';"/><br> <br><a style='cursor:hand;' onclick="location.href='?action=SetDefaultStyle&styleid=132';" /><span style='color:#0000cc'><u>应用</u></span></a> <?php }?>|<a href="#" onClick="previewTpl('132')"><span style='color:#0000cc'><u>预览</u></span></a><!--<br><a href='/User/CreateStyle.php?MainStyleId=132&action=Quick' onclick="return AppUpgrateVip('只有VIP才能应用自定模版。请升级VIP')"><span style='color:#0000CC;position:relative;top:5px'><u>快速自定义</u></span></a><span style="position:relative;top:5px">|</span><a href='/User/CreateStyle.php?MainStyleId=132&action=Adv' onclick="return AppUpgrateVip('只有VIP才能应用自定模版。请升级VIP')"><span style='color:#0000CC;position:relative;top:5px'><u>高级自定义</u></span></a><BR>--> </li> <li style='width:170px;height:160px;'> <?php if($user_dat['DefaultStyle']=="134") {?> <a href='http://www.wu-liao.com/home.php?user=<?php echo $user_dat['name']; ?>' id="myhomepage" target='_blank'><img src="skin/134.jpg" width="100" height="73" style='background:#FFFF99; padding:3px;border:3px #FFCC00 solid;cursor:hand' /></a><br /> <br/><span style='color:#FF0000'><B>已应用</B></span> <?php }else{?> <img src="skin/134.jpg" width="100" height="73" style='cursor:hand;' onclick="location.href='?action=SetDefaultStyle&styleid=134';"/><br> <br><a style='cursor:hand;' onclick="location.href='?action=SetDefaultStyle&styleid=134';" /><span style='color:#0000cc'><u>应用</u></span></a> <?php }?>|<a href="#" onClick="previewTpl('134')"><span style='color:#0000cc'><u>预览</u></span></a><!--<br><a href='/User/CreateStyle.php?MainStyleId=134&action=Quick' onclick="return AppUpgrateVip('只有VIP才能应用自定模版。请升级VIP')" ><span style='color:#0000CC;position:relative;top:5px'><u>快速自定义</u></span></a><span style="position:relative;top:5px">|</span><a href='/User/CreateStyle.php?MainStyleId=134&action=Adv' onclick="return AppUpgrateVip('只有VIP才能应用自定模版。请升级VIP')"><span style='color:#0000CC;position:relative;top:5px'><u>高级自定义</u></span></a><BR>--> </li> <li style='width:170px;height:160px;'> <?php if($user_dat['DefaultStyle']=="135") {?> <a href='http://www.wu-liao.com/home.php?user=<?php echo $user_dat['name']; ?>' id="myhomepage" target='_blank'><img src="skin/135.jpg" width="100" height="73" style='background:#FFFF99; padding:3px;border:3px #FFCC00 solid;cursor:hand' /></a><br /> <br/><span style='color:#FF0000'><B>已应用</B></span> <?php }else{?> <img src="skin/135.jpg" width="100" height="73" style='cursor:hand;' onclick="location.href='?action=SetDefaultStyle&styleid=135';"/><br> <br><a style='cursor:hand;' onclick="location.href='?action=SetDefaultStyle&styleid=135';" /><span style='color:#0000cc'><u>应用</u></span></a> <?php }?>|<a href="#" onClick="previewTpl('135')"><span style='color:#0000cc'><u>预览</u></span></a><!--<br><a href='/User/CreateStyle.php?MainStyleId=135&action=Quick' onclick="return AppUpgrateVip('只有VIP才能应用自定模版。请升级VIP')" ><span style='color:#0000CC;position:relative;top:5px'><u>快速自定义</u></span></a><span style="position:relative;top:5px">|</span><a href='/User/CreateStyle.php?MainStyleId=135&action=Adv' onclick="return AppUpgrateVip('只有VIP才能应用自定模版。请升级VIP')"><span style='color:#0000CC;position:relative;top:5px'><u>高级自定义</u></span></a><BR>--> </li> <li style='width:170px;height:160px;'> <?php if($user_dat['DefaultStyle']=="136") {?> <a href='http://www.wu-liao.com/home.php?user=<?php echo $user_dat['name']; ?>' id="myhomepage" target='_blank'><img src="skin/136.jpg" width="100" height="73" style='background:#FFFF99; padding:3px;border:3px #FFCC00 solid;cursor:hand' /></a><br /> <br/><span style='color:#FF0000'><B>已应用</B></span> <?php }else{?> <img src="skin/136.jpg" width="100" height="73" style='cursor:hand;' onclick="location.href='?action=SetDefaultStyle&styleid=136';"/><br> <br><a style='cursor:hand;' onclick="location.href='?action=SetDefaultStyle&styleid=136';" /><span style='color:#0000cc'><u>应用</u></span></a> <?php }?>|<a href="#" onClick="previewTpl('136')"><span style='color:#0000cc'><u>预览</u></span></a><!--<br><a href='/User/CreateStyle.php?MainStyleId=136&action=Quick' onclick="return AppUpgrateVip('只有VIP才能应用自定模版。请升级VIP')" ><span style='color:#0000CC;position:relative;top:5px'><u>快速自定义</u></span></a><span style="position:relative;top:5px">|</span><a href='/User/CreateStyle.php?MainStyleId=136&action=Adv' onclick="return AppUpgrateVip('只有VIP才能应用自定模版。请升级VIP')"><span style='color:#0000CC;position:relative;top:5px'><u>高级自定义</u></span></a><BR>--> </li> <li style='width:170px;height:160px;'> <?php if($user_dat['DefaultStyle']=="137") {?> <a href='http://www.wu-liao.com/home.php?user=<?php echo $user_dat['name']; ?>' id="myhomepage" target='_blank'><img src="skin/137.jpg" width="100" height="73" style='background:#FFFF99; padding:3px;border:3px #FFCC00 solid;cursor:hand' /></a><br /> <br/><span style='color:#FF0000'><B>已应用</B></span> <?php }else{?> <img src="skin/137.jpg" width="100" height="73" style='cursor:hand;' onclick="location.href='?action=SetDefaultStyle&styleid=137';"/><br> <br><a style='cursor:hand;' onclick="location.href='?action=SetDefaultStyle&styleid=137';" /><span style='color:#0000cc'><u>应用</u></span></a> <?php }?>|<a href="#" onClick="previewTpl('137')"><span style='color:#0000cc'><u>预览</u></span></a><!--<br><a href='/User/CreateStyle.php?MainStyleId=137&action=Quick' onclick="return AppUpgrateVip('只有VIP才能应用自定模版。请升级VIP')" ><span style='color:#0000CC;position:relative;top:5px'><u>快速自定义</u></span></a><span style="position:relative;top:5px">|</span><a href='/User/CreateStyle.php?MainStyleId=137&action=Adv' onclick="return AppUpgrateVip('只有VIP才能应用自定模版。请升级VIP')"><span style='color:#0000CC;position:relative;top:5px'><u>高级自定义</u></span></a><BR>--> </li> </ul> </div> </div> </div> </div> <div id="bottom"> <div id="baidu" style="color:#a0a0a0;"><?php require("../foot.php"); ?></div> </div> </body> </html>