<?php
if(!isset($api2)){
$this->rs("请求失败:非法接口。");
}
//统计
if($api2=="tj"){
if(!isset($_SESSION["uiid"]) and !isset($_SESSION["uid"])){
$dowhat="未登录用户";
$this->useripdo($dowhat);
}else if(isset($_SESSION["uiid"]) and !isset($_SESSION["uid"])){
$this->sql("update `s_userip` set `lasttime`='".time()."' where `uiid`='".$_SESSION["uiid"]."' ");
}else if(isset($_SESSION["uid"])){
$this->sql("update `s_user` set `lasttime`='".time()."' where `uid`='".$_SESSION["uid"]."' ");
}
}
else //reg
if($api2=="reg"){
if(!isset($_POST["un"]) or empty($_POST["un"]) ){
$this->rs("注册失败:账号错误");
}
$un=$_POST["un"];
if(!preg_match('/^[a-z0-9A-Z]{3,20}+$/',$un) ){
$this->rs("注册失败:账号格式错误:3位以上数字或字母不区分大小写");
}
if($this->wechat){
if(!isset($_POST["id"]) or !is_numeric($_POST["id"])){
$this->rs("抱歉错误");
}
$id=$_POST["id"];
$slll=$this->Sql("select `dowhat` from `s_userip` where `uiid`='".$this->res($id)."' and `time`>='".(time()-1800)."' and `dowhat` like '公众号绑定%' limit 0,1");
if($this->num($slll)==0){
$this->rs("抱歉错误:无效验证码,请重新扫码获取");
}
$r=$this->row($slll);
$wx=str_replace("公众号绑定", "",$r[0]);
}
if(!isset($_POST["pw"]) or empty($_POST["pw"]) ){
$this->rs("注册失败:请设置密码");
}
$pw=md5("sinpark".md5($_POST["pw"]));
$ip=$this->getIP();
$sql=$this->Sql("select `uiid` from `s_userip` where `ip`='".$this->res($ip)."' and `dowhat`='注册账号' limit 0,5");
if($this->num($sql)>=3){
$this->rs("注册失败:该IP已被暂停注册账号");
}
$sql=$this->Sql("select `uid` from `s_user` where `username`='".$this->res($un)."'");
if($this->num($sql)>0){
$this->rs("注册失败:该用户名已被使用");
}
if(!isset($wx)){
$this->sql("INSERT INTO `s_user`( `username`, `password`, `time`, `nickname`) VALUES ('".$this->res($un)."','".$this->res($pw)."','".time()."','".$this->res(md5($un))."')");
}else{
$this->sql("INSERT INTO `s_user`( `username`, `password`, `time`, `nickname`,`wx`) VALUES ('".$this->res($un)."','".$this->res($pw)."','".time()."','".$this->res(md5($un))."','".$this->res($wx)."')");
$this->sql("delete from `s_userip` where `id`='".$this->res($id)."' ");
$_SESSION["wx"]=$wx;
}
$_SESSION["uid"]=mysql_insert_id();
$this->sql("update `s_user` set `fuid`='".$_SESSION["uid"]."' where `uid`='".$_SESSION["uid"]."'");
$dowhat="注册账号";
$this->useripdo($dowhat,$_SESSION["uid"]);
$this->sendmsg("10000",$_SESSION["uid"],"欢迎来到".$this->cfg["webname"]."站点,我是本站站长,有啥问题,您可以在这里直接联系到我。");
$this->rs("注册成功",1);
}
else //login
if($api2=="login"){
if(!isset($_POST["un"]) or empty($_POST["un"]) ){
$this->rs("登录失败:账号错误");
}
$un=$_POST["un"];
if(!preg_match('/^[a-z0-9A-Z]{3,20}+$/',$un) ){
$this->rs("登录失败:账号格式错误:3位以上数字或字母");
}
if(!isset($_POST["pw"]) or empty($_POST["pw"]) ){
$this->rs("登录失败:请设置密码");
}
$pw=md5("sinpark".md5($_POST["pw"]));
$sql=$this->Sql("select `ban`,`coin` from `s_user` where `username`='".$this->res($un)."'");
if($this->num($sql)==0){
$this->rs("登录失败:该用户不存在");
}
$r22=$this->row($sql);
if($r22["ban"]==1){
$this->rs("登录失败:该用户已被封");
}
if($r22["coin"]<0){
$this->rs("登录失败:该用户存在恶意行为被系统自动封锁了。");
}
$sql2=$this->Sql("select `uid`,`wx` from `s_user` where `username`='".$this->res($un)."' and `password`='".$this->res($pw)."' limit 0,1 ");
if($this->num($sql2)==0){
$this->rs("登录失败:密码错误");
}
$r=$this->row($sql2);
$_SESSION["uid"]=$r[0];
$_SESSION["wx"]=$r[1];
$this->useripdo("登录网站",$_SESSION["uid"]);
$this->rs("登录成功",1);
}
else //添加face
if($api2=="facemake"){
if(!$this->here()){
$this->rs("请求失败:请登录。");
}
$uid=$_SESSION["uid"];
if(!isset($_POST["base64v"]) or empty($_POST["base64v"]) ){
$this->rs("修改失败:请输入内容");
}
$base64v=$_POST["base64v"];
preg_match('/^(data:\s*image\/(\w+);base64,)/',$base64v, $r3);
if(!isset($r3[2])){
$this->rs("修改失败:请输入内容");
}
$base64_body = substr(strstr($base64v,','),1);
$img = base64_decode($base64_body);
$type =$r3[2];
$face=md5($base64v).".".$type;
$file_name_ok ="public/face/".md5($base64v).".".$type;
file_put_contents($file_name_ok,$img);
$this->Sql("update `s_user` set `face`='".$this->res($face)."' where `uid`='".$uid."' ");
$this->rs("修改成功",1);
}
else //添加nn
if($api2=="nickname"){
if(!$this->here()){
$this->rs("请求失败:请登录。");
}
$uid=$_SESSION["uid"];
if(!isset($_POST["nn"]) or empty($_POST["nn"]) ){
$this->rs("修改失败:请输入昵称");
}
$nn=$_POST["nn"];
if(!preg_match('/^[a-zA-Z0-9\x{4e00}-\x{9fa5}]+$/u',$nn)){
$this->rs("修改失败:请输入中文英文或数字");
}
$sql=$this->sql("select `uid` from `s_user` where `nickname`='".$this->res($nn)."' and `uid`!='".$uid."'");
if($this->num($sql)>0){
$this->rs("修改失败:昵称已被使用");
}
$this->Sql("update `s_user` set `nickname`='".$this->res($nn)."' where `uid`='".$uid."' ");
$this->rs("修改成功",1);
}
else //添加关注
if($api2=="follow"){
if(!$this->here()){
$this->rs("请求失败:请<A href='/?type=user&type2=login'>登录</a>。");
}
$uid=$_SESSION["uid"];
if(!isset($_POST["uid2"]) or !is_numeric($_POST["uid2"])){
$this->rs("抱歉错误");
}
$uid2=$_POST["uid2"];
if($uid==$uid2){
$this->rs("抱歉:自己不能关注自己");
}
$sql=$this->sql("select `uid` from `s_user` where `uid`='".$this->res($uid2)."'");
if($this->num($sql)==0){
$this->rs("抱歉:不存在该用户");
}
$sql=$this->sql("select `fid` from `s_follow` where `uid`='".$uid."' and `uid2`='".$this->res($uid2)."'");
if($this->num($sql)==0){
$this->sql("INSERT INTO `s_follow`( `uid`, `time`, `uid2`) VALUES ('".$uid."','".time()."','".$this->res($uid2)."')");
$this->Sql("update `s_user` set `followed`=`followed`+1 where `uid`='".$uid2."' ");
$this->Sql("update `s_user` set `follow`=`follow`+1 where `uid`='".$uid."' ");
$this->rs("成功关注",1);
}
$this->rs("抱歉:已关注");
}
else //取消关注
if($api2=="followend"){
if(!$this->here()){
$this->rs("请求失败:请<A href='/?type=user&type2=login'>登录</a>。");
}
$uid=$_SESSION["uid"];
if(!isset($_POST["uid2"]) or !is_numeric($_POST["uid2"])){
$this->rs("抱歉错误");
}
$uid2=$_POST["uid2"];
if($uid==$uid2){
$this->rs("抱歉:自己不能取消关注自己");
}
$sql=$this->sql("select `uid` from `s_user` where `uid`='".$this->res($uid2)."'");
if($this->num($sql)==0){
$this->rs("抱歉:不存在该用户");
}
$sql=$this->sql("select `fid` from `s_follow` where `uid`='".$uid."' and `uid2`='".$this->res($uid2)."'");
if($this->num($sql)==1){
$this->sql("delete from `s_follow` where `uid`='".$uid."' and `uid2`='".$this->res($uid2)."'");
$this->Sql("update `s_user` set `followed`=`followed`-1 where `uid`='".$uid2."' ");
$this->Sql("update `s_user` set `follow`=`follow`-1 where `uid`='".$uid."' ");
$this->rs("成功取关",1);
}
$this->rs("抱歉:未关注");
}
else //pw
if($api2=="password"){
if(!$this->here()){
$this->rs("请求失败:请<A href='/?type=user&type2=login'>登录</a>。");
}
$uid=$_SESSION["uid"];
if(!isset($_POST["pw"]) or empty($_POST["pw"]) ){
$this->rs("修改失败:请输入原密码");
}
$pw=md5("sinpark".md5($_POST["pw"]));
$sql=$this->Sql("select `uid` from `s_user` where `uid`='".$uid.
没有合适的资源?快使用搜索试试~ 我知道了~
PHP实现多人内容发布社交系统
共106个文件
php:43个
png:36个
jpeg:16个
需积分: 5 0 下载量 191 浏览量
2022-07-01
19:09:51
上传
评论
收藏 418KB RAR 举报
温馨提示
PHP实现多人内容发布社交系统
资源详情
资源评论
资源推荐
收起资源包目录
PHP实现多人内容发布社交系统 (106个子文件)
cm.css 363B
loading.gif 551B
.htaccess 94B
.htaccess 94B
.htaccess 54B
404.html 505B
c180a194fb56e1fa1e5f93ee7170dd4c.jpeg 54KB
a29809cc966a03065f6aa4c5f1663cc4.jpeg 41KB
5aed7b4e249c8143b758947a52eab542.jpeg 38KB
edc660eff86ecd03e00e9e898adbc926.jpeg 21KB
8824333c740e946e310f1ebb59ac56ce.jpeg 21KB
ab4d782aed375bfe9b2bb60db8f95909.jpeg 20KB
b47b39bba31a86bc7b7973c2c6ad76f1.jpeg 9KB
70ff1e61799ab48c75aea0e7232954dd.jpeg 3KB
2edbd29a63c4db8151e3a07436cc1f63.jpeg 3KB
293ea8fb63eaad4cce36e885ae6aa9ab.jpeg 3KB
502d766354338f2258625d68119170ff.jpeg 3KB
8d322840e2f6e2ed7b5546dcff055136.jpeg 2KB
95aa34b7ec0f20f49865ff0870d3f2e1.jpeg 2KB
2b702ee7747724d02daef414e4f07b5c.jpeg 2KB
980114b59f0f4202c78606b0acad8752.jpeg 1KB
7f51ee016f7dce2e4379a3ba3df417fa.jpeg 1KB
jq.js 94KB
mobileBUGFix.mini.js 9KB
jquery.lazyload.js 4KB
localResizeIMG.js 1KB
config.json 217B
post.user.php 11KB
post.pb.php 10KB
index.php 9KB
v.php 9KB
sys.php 8KB
index.php 8KB
soso.php 7KB
tui.php 7KB
comment.php 6KB
send.php 6KB
install.php 6KB
wechat2.php 5KB
wo.php 5KB
webconfig.php 5KB
mai.php 4KB
post.ht.php 4KB
guan.php 4KB
forget.php 4KB
post.msg.php 4KB
zhconfig.php 4KB
reg.php 4KB
vmanage.php 4KB
login.php 3KB
wechat.php 3KB
password.php 3KB
mkwx.php 2KB
zhqh.php 2KB
ft.php 2KB
index.php 2KB
index.php 2KB
index.php 2KB
config.php 2KB
hd.php 2KB
pai.php 2KB
index.php 1KB
ht.php 519B
user.php 433B
msg.php 397B
pub.php 395B
config.php 137B
weili.php 132B
shop.php 104B
wechat.php 37B
xigua.png 11KB
logout.png 10KB
view.png 9KB
shop.png 7KB
unlink.png 7KB
link.png 7KB
order.png 5KB
password.png 5KB
msg.png 4KB
weili.png 4KB
config (1).png 3KB
webconfige.png 2KB
moren.png 2KB
wechat.png 1KB
zhqh.png 1KB
unlike.png 1KB
prev.png 1KB
next.png 1KB
pub (1).png 1KB
sousuo1.png 1KB
comment.png 1KB
config.png 1KB
shoucang.png 1023B
like.png 950B
tag3.png 893B
share.png 892B
useradd.png 806B
pub.png 699B
pw.png 599B
zhconfig.png 591B
共 106 条
- 1
- 2
m0_72500673
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0