Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
s_ibanshou
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋林
s_ibanshou
Commits
78dfc5a8
Commit
78dfc5a8
authored
Sep 01, 2017
by
夏彬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门户添加评论回复消息
parent
8eb8cee6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
150 additions
and
1 deletion
+150
-1
comment.php
e/action/news/comment.php
+17
-1
q_functions.php
e/class/q_functions.php
+13
-0
Message.php
e/extend/internalApi/ucenter/Message.php
+120
-0
init.zip
init.zip
+0
-0
No files found.
e/action/news/comment.php
View file @
78dfc5a8
<?php
<?php
require
(
__DIR__
.
'/../../extend/internalApi/autoload.php'
);
require
(
__DIR__
.
"/../../class/connect.php"
);
require
(
__DIR__
.
"/../../class/connect.php"
);
require
(
__DIR__
.
"/../../class/db_sql.php"
);
require
(
__DIR__
.
"/../../class/db_sql.php"
);
require
(
__DIR__
.
"/../../member/class/user.php"
);
require
(
__DIR__
.
"/../../member/class/user.php"
);
require
(
__DIR__
.
"/../../class/q_functions.php"
);
require
(
__DIR__
.
"/../../class/q_functions.php"
);
require
__DIR__
.
'/../../config/config_ibanshou.php'
;
require
__DIR__
.
'/../../config/config_ibanshou.php'
;
\internalApi\base\Client
::
config
(
$config
[
'wxh.internal'
][
'client'
]);
$link
=
db_connect
();
$link
=
db_connect
();
$empire
=
new
mysqlquery
();
$empire
=
new
mysqlquery
();
...
@@ -85,7 +87,7 @@ function createComment($newsid, $content) {
...
@@ -85,7 +87,7 @@ function createComment($newsid, $content) {
//回复评论
//回复评论
function
replyComment
(
$plid
,
$content
)
{
function
replyComment
(
$plid
,
$content
)
{
global
$empire
,
$dbtbpre
;
global
$empire
,
$dbtbpre
,
$ecms_config
;
$table
=
$dbtbpre
.
'ecms_comments'
;
$table
=
$dbtbpre
.
'ecms_comments'
;
$user
=
islogin
();
$user
=
islogin
();
...
@@ -109,6 +111,20 @@ function replyComment($plid, $content) {
...
@@ -109,6 +111,20 @@ function replyComment($plid, $content) {
$tablenews
=
$dbtbpre
.
'ecms_news'
;
$tablenews
=
$dbtbpre
.
'ecms_news'
;
$sql
=
"update
{
$tablenews
}
set plnum=plnum+1 where id=
{
$comment
[
'newsid'
]
}
"
;
$sql
=
"update
{
$tablenews
}
set plnum=plnum+1 where id=
{
$comment
[
'newsid'
]
}
"
;
$empire
->
query
(
$sql
);
$empire
->
query
(
$sql
);
//添加消息
$tablenews
=
$dbtbpre
.
'ecms_news'
;
$newsid
=
$comment
[
'newsid'
];
$sql
=
"select * from
{
$tablenews
}
where id=
{
$newsid
}
"
;
$news
=
$empire
->
fetchassoc1
(
$sql
);
$userId
=
getucidbyuid
(
$comment
[
'user_id'
]);
$title
=
$comment
[
'content'
];
$sourceUrl
=
$ecms_config
[
'site_url'
]
.
$news
[
'titleurl'
];
$type
=
'comment'
;
$commentId
=
$id
;
$replyUserId
=
$user
[
'ucid'
];
$replyedComment
=
$content
;
\internalApi\ucenter\Message
::
addComment
(
$userId
,
$title
,
$sourceUrl
,
's'
,
$type
,
$commentId
,
$replyUserId
,
$replyedComment
);
returnmsg
(
true
,
'回复成功'
,
comment
(
$id
));
returnmsg
(
true
,
'回复成功'
,
comment
(
$id
));
}
}
}
}
...
...
e/class/q_functions.php
View file @
78dfc5a8
...
@@ -306,4 +306,17 @@ function returnmsg($status=false, $msg='', $data='') {
...
@@ -306,4 +306,17 @@ function returnmsg($status=false, $msg='', $data='') {
exit
();
exit
();
}
}
function
getucidbyuid
(
$uid
){
global
$empire
;
require_once
__DIR__
.
'/../member/class/user.php'
;
$member
=
$empire
->
fetch1
(
"SELECT "
.
eReturnSelectMemberF
(
'*'
)
.
" FROM "
.
eReturnMemberTable
()
.
" WHERE "
.
egetmf
(
'userid'
)
.
"=
{
$uid
}
limit 1"
);
if
(
!
$member
)
{
return
false
;
}
return
$member
[
'ucid'
];
}
?>
?>
\ No newline at end of file
e/extend/internalApi/ucenter/Message.php
0 → 100644
View file @
78dfc5a8
<?php
/**
* Created by PhpStorm.
* User: pader
* Date: 2017/6/30
* Time: 15:08
*/
namespace
internalApi\ucenter
;
use
internalApi\base\Client
;
/**
* 用户中心消息服务
*
* @package internalApi\ucenter
*/
class
Message
extends
Client
{
/**
* 向指定号码发送短信
*
* @param string $tel
* @param string $content
* @param string $signature 短信签名,中括号【】中的内容
* @return bool|string 成功返回 true,失败返回错误文本
*/
public
static
function
sendSms
(
$tel
,
$content
,
$signature
)
{
return
self
::
call
(
'message.sendSms'
,
compact
(
'tel'
,
'content'
,
'signature'
));
}
/**
* 向指定用户发送短信
*
* @param int $uid
* @param string $content
* @param string $signature 短信签名,中括号【】中的内容
* @return bool|string 成功返回 true,失败返回错误文本
*/
public
static
function
sendSmsByUid
(
$uid
,
$content
,
$signature
)
{
return
self
::
call
(
'message.sendSmsByUid'
,
compact
(
'uid'
,
'content'
,
'signature'
));
}
/***
* @param $userId
* @param $title
* @param $sourceUrl
* @param $from 0:xue 1:bbs 2:s
* @param $type 0:评论 1:帖子
* @param $commentId
* @param $replyUserId
* @param string $replyedComment
* @return mixed
*/
public
static
function
addComment
(
$userId
,
$title
,
$sourceUrl
,
$from
,
$type
,
$commentId
,
$replyUserId
,
$replyedComment
=
''
)
{
return
self
::
call
(
'message.addComment'
,
compact
(
'userId'
,
'title'
,
'sourceUrl'
,
'from'
,
'type'
,
'commentId'
,
'replyUserId'
,
'replyedComment'
));
}
/**
* @param $userId
* @param $title
* @param $sourceUrl
* @param $from
* @param $type
* @param $sourceId 点赞的评论id
* @param $likeUserId
* @param $likedComment
* @return mixed
*/
public
static
function
addLike
(
$userId
,
$title
,
$sourceUrl
,
$from
,
$type
,
$sourceId
,
$likeUserId
,
$likedComment
=
''
)
{
return
self
::
call
(
'message.addLike'
,
compact
(
'userId'
,
'title'
,
'sourceUrl'
,
'from'
,
'type'
,
'sourceId'
,
'likeUserId'
,
'likedComment'
));
}
/**
* @param $userId
* @param $title
* @param $desc
* @param $from
* @param $type
* @param string $content
* @param int $toUser 0系统消息其它为用户id,多个用户id数组
* @return mixed
*/
public
static
function
add
(
$userId
,
$title
,
$desc
,
$from
,
$type
,
$content
=
''
,
$toUser
=
0
)
{
return
self
::
call
(
'message.add'
,
compact
(
'userId'
,
'title'
,
'desc'
,
'from'
,
'type'
,
'content'
,
'toUser'
));
}
/**
* 删除评论消息
* @param $userId
* @param $from
* @param $type
* @param $commentId
* @return mixed
*/
public
static
function
deleteComment
(
$userId
,
$from
,
$type
,
$commentId
)
{
return
self
::
call
(
'message.deleteComment'
,
compact
(
'userId'
,
'from'
,
'type'
,
'commentId'
));
}
/**
* 删除点赞
* @param $userId
* @param $from
* @param $type
* @param $sourceId
* @return mixed
*/
public
static
function
deleteLiked
(
$userId
,
$from
,
$type
,
$sourceId
)
{
return
self
::
call
(
'message.deleteLiked'
,
compact
(
'userId'
,
'from'
,
'type'
,
'sourceId'
));
}
}
\ No newline at end of file
init.zip
deleted
100644 → 0
View file @
8eb8cee6
File deleted
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment