问题:超出24小时以内发信息的数量,不能发信息。php
方法:在ucenter的基本设置里改。能够更改了更新缓存,前台没效果,可是数据库已经改了。sql
原来他更新缓存没有更新到那个缓存,我直接到data下面的cache下面把settings.php改过来或者删除再更新缓存就能够成功了。只是ucenter和discuz结合以后出现的缓存问题,可是直接ucenter是不用这样子,settings.php也自动是最新的。数据库
如下是一些资料:缓存
实际上不少人遇到这个问题 但很快就能解决 由于这个设置是在 ucenter 基本设置中 设置的 只须要将 25设置成0 或者设置成你想要的数量便可。可有的时候遇到 权限混乱的 服务器 真心就尴尬了服务器
若是出现了 已经将24小时 发送限制取消了 仍是没法正常发送 请查看
uc_client/data/cache/settings.php 文件app
总体上来讲 这个的排查很漫长 这里提供下 总体的 实现逻辑,转自disucz开发人员 专贴:ide
1、在ucenter中进行短消息的相关设置,每一项设置都会对应一个变量,
发短消息最少注册天数(pmsendregdays )
同一用户在24小时内容许发起两人会话的最大数(privatepmthreadlimit )
同一用户在24小时内容许发起群聊会话的最大数(chatpmthreadlimit )
参与同一群聊会话的最大用户数(chatpmmemberlimit )
发短消息灌水预防(pmfloodctrl )
启用短消息中心(pmcenter )
开启发送短消息验证码(sendpmseccode )函数
在uc_server\control\admin\setting.php文件的onls函数中,经过fetch
1 | $this->set_setting('privatepmthreadlimit',intval($privatepmthreadlimit)); |
将设置值更新到数据库中ui
1
2
3
4
|
functionset_setting($k,$v,$encode= FALSE) {
$v=is_array($v) ||$encode?addslashes(serialize($v)) :$v;
$this->db->query("REPLACE INTO ".UC_DBTABLEPRE."settings SET k='$k', v='$v'");
}
|
可见,这些设置提交后,只会保存到ucenter的设置表settings中,还不会影响论坛的操做。
2、当论坛更新缓存时,程序会按照顺序执行各个函数,
1 | updatecache(function_cache.php) -> build_cache_setting(cache_setting.php)-> uc_app_ls(client.php)-> init_cache(base.php)-> cache(base.php)-> updatedata(cache.php)-> _get_settings(cache.php)-> get_setting(base.php) |
在get_setting函数中取出设置的参数值,
1 | $settings=$this->db->fetch_all("SELECT * FROM ".UC_DBTABLEPRE."settings $sqladd"); |
在updatedata函数中写入到uc_client/data/cache/settings.php文件中。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
functionupdatedata($cachefile='') {
if($cachefile) {
foreach((array)$this->map[$cachefile]as$modules) {
$s="<?php\r\n";
foreach((array)$modulesas$m) {
$method="_get_$m";
$s.='$_CACHE[\''.$m.'\'] = '.var_export($this->$method(), TRUE).";\r\n";
}
$s.="\r\n?>";
@file_put_contents(UC_DATADIR."./cache/$cachefile.php",$s);
}
}else{
foreach((array)$this->mapas$file=>$modules) {
$s="<?php\r\n";
foreach($modulesas$m) {
$method="_get_$m";
$s.='$_CACHE[\''.$m.'\'] = '.var_export($this->$method(), TRUE).";\r\n";
}
$s.="\r\n?>";
@file_put_contents(UC_DATADIR."./cache/$file.php",$s);
}
}
}
|
3、当会员发送短消息的时候,在uc_client\control\pm.php文件的 onsendpm 函数中,所使用的$this->settings['pmsendregdays'] 等,就是uc_client/data/cache/settings.php文件中的值。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
if($this->settings['pmsendregdays']) {
if($user['regdate'] >$this->time -$this->settings['pmsendregdays'] * 86400) {
returnPMSENDREGDAYS;
}
}
if($this->settings['chatpmmemberlimit']) {
if($type== 1 && ($countmsgto> ($this->settings['chatpmmemberlimit'] - 1))) {
returnCHATPMMEMBERLIMIT_ERROR;
}
}
if($this->settings['pmfloodctrl']) {
if(!$_ENV['pm']->ispminterval($this->user['uid'],$this->settings['pmfloodctrl'])) {
returnPMFLOODCTRL_ERROR;
}
}
if($this->settings['privatepmthreadlimit']) {
if(!$_ENV['pm']->isprivatepmthreadlimit($this->user['uid'],$this->settings['privatepmthreadlimit'])) {
returnPRIVATEPMTHREADLIMIT_ERROR;
}
}
if($this->settings['chatpmthreadlimit']) {
if(!$_ENV['pm']->ischatpmthreadlimit($this->user['uid'],$this->settings['chatpmthreadlimit'])) {
returnCHATPMTHREADLIMIT_ERROR;
}
}
|
这就是ucenter中进行短消息设置时,影响前台短消息发送的过程。有种常见的问题是,其余操做都没有问题,就是uc_client\data\cache目录权限不对,形成设置的缓存不能更新,致使会员发送短消息时出现各类问题。