CheckUser.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. if(!defined('InEmpireCMS'))
  3. {
  4. exit();
  5. }
  6. //统计访问
  7. function UpdateSpaceViewStats($userid){
  8. global $empire,$dbtbpre;
  9. $userid=(int)$userid;
  10. if(!getcvar('dospacevstats'.$userid))
  11. {
  12. $sql=$empire->query("update {$dbtbpre}enewsmemberadd set viewstats=viewstats+1 where userid='".$userid."' limit 1");
  13. esetcookie("dospacevstats".$userid,1,time()+3600);
  14. }
  15. }
  16. //关闭
  17. if($public_r['openspace']==1)
  18. {
  19. printerror('CloseMemberSpace','',1);
  20. }
  21. require_once ECMS_PATH.'e/space/spacefun.php';
  22. //用户是否存在
  23. $userid=intval($_GET['userid']);
  24. if($userid)
  25. {
  26. $add="userid=$userid";
  27. $username='';
  28. $utfusername='';
  29. $uadd=egetmf('userid')."='$userid'";
  30. }
  31. else
  32. {
  33. $username=RepPostVar($_GET['username']);
  34. if(empty($username))
  35. {
  36. printerror("NotUsername","",1);
  37. }
  38. $add="username='$username'";
  39. $utfusername=$username;
  40. $uadd=egetmf('username')."='$username'";
  41. }
  42. $ur=$empire->fetch1("select ".eReturnSelectMemberF('*')." from ".eReturnMemberTable()." where ".$uadd." limit 1");
  43. if(empty($ur['username']))
  44. {
  45. printerror("NotUsername","",1);
  46. }
  47. if(empty($ur['checked']))
  48. {
  49. printerror("NotUsername","",1);
  50. }
  51. //会员组
  52. if($public_r['spacegids'])
  53. {
  54. if(!strstr($public_r['spacegids'],','.$ur['groupid'].','))
  55. {
  56. printerror("UserNotSpace","",1);
  57. }
  58. }
  59. //实名验证
  60. eCheckHaveTruename('msp',$ur['userid'],$ur['username'],$ur['isern'],$ur['checked'],0);
  61. $userid=$userid?$userid:$ur['userid'];
  62. $utfusername=$utfusername?$utfusername:$ur['username'];
  63. $username=$username?$username:$ur['username'];
  64. $groupid=$ur['groupid'];
  65. UpdateSpaceViewStats($userid);//统计访问
  66. $addur=$empire->fetch1("select * from {$dbtbpre}enewsmemberadd where userid='".$userid."' limit 1");
  67. //头像
  68. $userpic=$addur['userpic']?$addur['userpic']:$public_r[newsurl].'e/data/images/nouserpic.gif';
  69. //空间地址
  70. $spaceurl=eReturnDomainSiteUrl()."e/space/?userid=".$userid;
  71. //空间名称
  72. $addur['spacename']=stripSlashes($addur['spacename']);
  73. $addur['spacegg']=stripSlashes($addur['spacegg']);
  74. $spacename=$addur['spacename']?$addur['spacename']:$username." 的空间";
  75. //空间模板
  76. $spacestyleid=$addur['spacestyleid'];
  77. if(empty($spacestyleid))
  78. {
  79. $spacestyleid=$public_r['defspacestyleid'];
  80. }
  81. $spacestyler=$empire->fetch1("select stylepath from {$dbtbpre}enewsspacestyle where styleid='$spacestyleid'");
  82. $spacestyle=$spacestyler['stylepath']?$spacestyler['stylepath']:'default';
  83. ?>