f (!empty($uidarr)) {
$uids = array();
$update = array();
foreach ($uidarr as $_uid => $n) {
$uids[] = $_uid;
$update[$_uid] = array('articles-' => $n);
'mysql' != $conf['cache']['type'] and cache_delete('user-' . $_uid);
}
user_big_update(array('uid' => $uids), $update);
}
!empty($operate_create) && function_exists('operate_big_insert') and operate_big_insert($operate_create);
return TRUE;
}
// 大数据量容易超时 删除用户时使用,删除主题 回复 栏目统计 附件 全站统计
function well_thread_delete_all_by_uid($uid)
{
// 用户主题数
$user = user_read_cache($uid);
set_time_limit(0);
// 删除所有回复
if ($user['comments']) {
$postist = comment_pid_find_by_uid($uid, 1, $user['comments'], FALSE);
$pidarr = array();
foreach ($postist as $val) {
$pidarr[] = $val['pid'];
}
unset($postist);
!empty($pidarr) and comment_delete_by_pids($pidarr);
}
if ($user['articles']) {
// 如果主题、附件和回复数量太大会超时
$tidlist = thread_tid_find_by_uid($uid, 1, $user['articles'], FALSE, 'tid', array('tid'));
$tidarr = array();
foreach ($tidlist as $val) {
$tidarr[] = $val['tid'];
}
unset($tidlist);
!empty($tidarr) and well_thread_delete_all($tidarr);
}
return TRUE;
}
// 搜索标题
function well_thread_find_by_keyword($keyword, $d = NULL)
{
if (empty($keyword)) return NULL;
$db = $_SERVER['db'];
$d = $d ? $d : $db;
if (!$d) return FALSE;
$threadlist = db_sql_find("SELECT * FROM `{$d->tablepre}website_thread` WHERE subject LIKE '%$keyword%' LIMIT 60;", 'tid', $d);
if ($threadlist) {
$threadlist = arrlist_multisort($threadlist, 'tid', FALSE);
foreach ($threadlist as &$thread) {
well_thread_format($thread);
// 关键词标色
//$thread['subject'] = comment_highlight_keyword($thread['subject'], $keyword);
}
}
return $threadlist;
}
// 查找 最后评论 lastpid
function well_thread_find_lastpid($tid)
{
$arr = comment_pid_read(array('tid' => $tid), array('pid' => -1), array('pid'));
$lastpid = empty($arr) ? 0 : $arr['pid'];
return $lastpid;
}
// 更新最后的 uid
function well_thread_update_last($tid)
{
if (empty($tid)) return FALSE;
$lastpid = well_thread_find_lastpid($tid);
if (empty($lastpid)) return FALSE;
$lastpost = comment_read($lastpid);
if (empty($lastpost)) return FALSE;
$r = well_thread_update($tid, array('lastuid' => $lastpost['uid']));
return $r;
}
function well_thread_maxid()
{
$n = db_maxid('website_thread', 'tid');
return $n;
}
// 主题状态 0:通过 1~9 审核:1待审核 10~19:10退稿 11逻辑删除
function well_thread_format(&$thread)
{
global $gid, $uid, $forumlist;
$conf = _SERVER('conf');
if (empty($thread)) return;
$thread['create_date_fmt'] = humandate($thread['create_date']);
$thread['last_date_fmt'] = humandate($thread['last_date']);
$thread['create_date_fmt_ymd'] = date('Y-m-d', $thread['create_date']);
$thread['last_date_fmt_ymd'] = date('Y-m-d', $thread['last_date']);
$user = user_read_cache($thread['uid']);
$onlinelist = online_user_list_cache();
$user['online_status'] = isset($onlinelist[$user['uid']]) ? 1 : 0;
$thread['username'] = $user['username'];
$thread['user_avatar_url'] = array_value($user, 'avatar_url');
$thread['user'] = user_safe_info($user);
unset($user);
$forum = array_value($forumlist, $thread['fid']);
$thread['forum_name'] = array_value($forum, 'name');
$thread['forum_url'] = array_value($forum, 'url');
if ($thread['last_date'] == $thread['create_date']) {
$thread['last_date_fmt'] = '';
$thread['lastuid'] = 0;
$thread['lastusername'] = '';
} else {
$lastuser = $thread['lastuid'] ? user_read_cache($thread['lastuid']) : array();
$thread['lastusername'] = $thread['lastuid'] ? $lastuser['username'] : lang('guest');
$thread['lastuser'] = $thread['lastuid'] ? user_safe_info($lastuser) : array();
unset($lastuser);
}
$thread['url'] = url('read-' . $thread['tid'], '', FALSE);
if ($conf['url_rewrite_on'] > 1) {
!empty($forum['well_alias']) and $thread['url'] = url(urlencode($forum['well_alias'])."-$thread[create_date]a$thread[tid]", '', FALSE);
} else {
$thread['url'] = url("read-$thread[create_date]a$thread[tid]", '', FALSE);
}
$thread['user_url'] = url('user-' . $thread['uid']);
$thread['sticky_class'] = '';
if ($thread['sticky'] > 0) {
if (1 == $thread['sticky']) {
$thread['sticky_class'] = 'success';
} elseif (2 == $thread['sticky']) {
$thread['sticky_class'] = 'warning';
} elseif (3 == $thread['sticky']) {
$thread['sticky_class'] = 'danger';
}
}
$nopic = view_path() . 'img/nopic.png';
if ($thread['icon']) {
$attach_dir_save_rule = array_value($conf, 'attach_dir_save_rule', 'Ym');
$day = date($attach_dir_save_rule, $thread['icon']);
$thread_format_icon_default = 1;
if (1 == $thread_format_icon_default) {
// 本地文件绝对路径
$destfile = $conf['upload_path'] . 'thumbnail/' . $day . '/' . $thread['uid'] . '_' . $thread['tid'] . '_' . $thread['icon'] . '.jpeg';
// 本地
$thread['icon_fmt'] = is_file($destfile) ? file_path($thread['attach_on']) . 'thumbnail/' . $day . '/' . $thread['uid'] . '_' . $thread['tid'] . '_' . $thread['icon'] . '.jpeg' : $nopic;
if (1 == $conf['attach_on'] && 1 == $thread['attach_on']) {
// 云储存
$thread['icon_fmt'] = file_path($thread['attach_on']) . 'thumbnail/' . $day . '/' . $thread['uid'] . '_' . $thread['tid'] . '_' . $thread['icon'] . '.jpeg';
} elseif (2 == $conf['attach_on'] && 2 == $thread['attach_on']) {
// 图床 未上传成功 本地图片在的话使用本地,不在则默认
$thread['icon_fmt'] = $thread['image_url'] ? $thread['image_url'] : $thread['icon_fmt'];
}
}
} else {
$thread['icon_fmt'] = $nopic;
}
// 回复页面
$thread['pages'] = ceil($thread['posts'] / $conf['comment_pagesize']);
$thread['tag_fmt'] = $thread['tag'] ? xn_json_decode($thread['tag']) : '';
// 权限判断
$thread['allowupdate'] = ($uid == $thread['uid']) || forum_access_mod($thread['fid'], $gid, 'allowupdate');
$thread['allowdelete'] = (group_access($gid, 'allowuserdelete') and $uid == $thread['uid']) || forum_access_mod($thread['fid'], $gid, 'allowdelete');
$thread['allowtop'] = forum_access_mod($thread['fid'], $gid, 'allowtop');
$thread = well_thread_safe_info($thread);
}
function well_thread_format_last_date(&$thread)
{
if ($thread['last_date'] != $thread['create_date']) {
$thread['last_date_fmt'] = humandate($thread['last_date']);
} else {
$thread['create_date_fmt'] = humandate($thread['create_date']);
}
}
// 对 $threadlist 权限过滤
function well_thread_list_access_filter(&$threadlist, $gid)
{
global $forumlist;
if (empty($threadlist)) return NULL;
foreach ($threadlist as $tid => $thread) {
if (empty($forumlist[$thread['fid']]['accesson'])) continue;
if ($thread['sticky'] > 0) continue;
if (!forum_access_user($thread['fid'], $gid, 'allowread')) {
unset($threadlist[$tid]);
}
}
}
function well_thread_safe_info($thread)
{
unset($thread['userip'], $thread['user']['threads'], $thread['user']['posts'], $thread['user']['credits'], $thread['user']['golds'], $thread['user']['money']);
empty($thread['user']) || $thread['user'] = user_safe_info($thread['user']);
return $thread;
}
// 过滤安全数据
function well_thread_filter(&$val)
{
unset($val['userip'], $val['fid'], $val['flagid'], $val['type'], $val['user'], $val['create_date']);
}
//------------------------ 其他方法 ------------------------
// 集合主题tid,统一拉取,避免多次查询thread表
function thread_unified_pull($arr)
{
global $gid, $fid;
$stickylist = array_value($arr, 'stickylist', array());
$tidlist = array_value($arr, 'tidlist', array());
//$fid = array_value($arr, 'fid');
// 合并过滤空数组
//$tidlist = array_filter($stickylist + $tidlist);
$tidarrlist = $tidlist = $stickylist + $tidlist;
// 版块自定义
list($flaglist, $flagtids) = flag_thread_by_fid($fid);
empty($flagtids) || $tidarrlist += $flagtids;
unset($flagtids);
// 在这之前合并所有二维数组 tid值为键/array('tid值' => tid值)
$tidarr = empty($tidarrlist) ? array() : arrlist_values($tidarrlist, 'tid');
// 在这之前使用array_merge()前合并所有一维数组 tid/array(1,2,3)
if (empty($tidarr)) return NULL;
$tidarr = array_unique($tidarr);
// 主题相关统一遍历后再归类
$arrlist = well_thread_find($tidarr, count($tidarr));
// 过滤没有权限访问的主题 / filter no permission thread
well_thread_list_access_filter($arrlist, $gid);
$threadlist = array();
foreach ($arrlist as $_tid => &$_thread) {
$_thread = well_thread_safe_info($_thread);
// 归类列表数据
isset($tidlist[$_thread['tid']]) and $threadlist[$_tid] = $_thread;
// flag thread
if (!empty($flaglist)) {
foreach ($flaglist as $key => $val) {
if (isset($val['tids']) && in_array($_thread['tid'], $val['tids'])) {
$flaglist[$key]['list'][array_search($_thread['tid'], $val['tids'])] = $_thread;
ksort($flaglist[$key]['list']);
}
}
}
}
// 按之前tidlist排序
$threadlist = array2_sort_key($threadlist, $tidlist, 'tid');
unset($arrlist, $tidlist);
$arr = array('threadlist' => $threadlist, 'flaglist' => $flaglist);
return $arr;
}
// read.php 详情页其他主题调用,集合tid统一拉取数据,最后归类
function thread_other_pull($thread)
{
global $forumlist, $gid;
$fid = array_value($thread, 'fid');
$forum = array_value($forumlist, $fid);
if (empty($forum)) return NULL;
//$tid = array_value($thread, 'tid');
//$tag_fmt = array_value($thread, 'tag_fmt');
$arrlist = array();
$tidlist = array();
// 版块自定义
list($flaglist, $flagtids) = flag_thread_by_fid($fid);
empty($flagtids) || $tidlist += $flagtids;
unset($flagtids);
// 在这之前合并所有二维数组 tid值为键/array('tid值' => tid值)
$tidarr = empty($tidlist) ? array() : arrlist_values($tidlist, 'tid');
// 在这之前使用array_merge()前合并所有一维数组 tid/array(1,2,3)
if (empty($tidarr)) return NULL;
$tidarr = array_unique($tidarr);
// 主题相关统一遍历后再归类
$threadlist = well_thread_find($tidarr, count($tidarr));
// 过滤没有权限访问的主题 / filter no permission thread
well_thread_list_access_filter($threadlist, $gid);
foreach ($threadlist as &$_thread) {
$_thread = well_thread_safe_info($_thread);
// flag thread
if (!empty($flaglist)) {
foreach ($flaglist as $key => $val) {
if (isset($val['tids']) && in_array($_thread['tid'], $val['tids'])) {
$flaglist[$key]['list'][array_search($_thread['tid'], $val['tids'])] = $_thread;
ksort($flaglist[$key]['list']);
}
}
}
}
unset($threadlist);
if (!empty($flaglist)) {
foreach ($flaglist as &$val) {
$i = 0;
if (!isset($val['list'])) continue;
foreach ($val['list'] as &$v) {
++$i;
$v['i'] = $i;
}
}
$arrlist['flaglist'] = $flaglist;
unset($flaglist);
}
return $arrlist;
}
//--------------------------cache--------------------------
// 已格式化 从缓存中读取,避免重复从数据库取数据
function well_thread_read_cache($tid)
{
global $conf;
$key = 'website_thread_' . $tid;
static $cache = array(); // 用静态变量只能在当前 request 生命周期缓存,跨进程需要再加一层缓存:redis/memcached/xcache/apc
if (isset($cache[$key])) return $cache[$key];
if ('mysql' == $conf['cache']['type']) {
$r = well_thread_read($tid);
} else {
$r = cache_get($key);
if (NULL === $r) {
$r = well_thread_read($tid);
$r and cache_set($key, $r, 1800);
}
}
$cache[$key] = $r ? $r : NULL;
return $cache[$key];
}
?>
“微信、支付宝静态扫码支付有限额了”等4则编程频道|福州电脑网
“微信、支付宝静态扫码支付有限额了”等4则
系统教程1380
更新时间:2026-04-10 02:38:20 2024年6月6日发(作者:)
博采
|
陈 红
ch-567
微信、支付宝静态扫码支付有限额了
条码(条形码、二维码等)支付规范自4月1日起实施。该规范规
定,静态条码防范能力为D级,无论使用何种交易验证方式,同一客
户银行或支付机构单日累计交易金额应不超过500元。
使用动态条码支付的,风险等级根据交易验证方式的不同分为
A、B、C三级,同一客户单日累计交易限额分别为自主约定、5000
元、1000元。
静态条码:
就是长期不变有效的条码。我们经常可以看到一些便利店、烟
店,甚至是流动车、地摊、出租车上都贴有这种静态条码,只要拿出手机扫码一下就可以完成支
付交易。
动态条码:
是指在使用条码收付款时,手机电子屏上的动态条码。动态条码是更新的,不容易被替换盗
用。比如让商家扫描我们的条码支付形式,就是动态条码。
(摘自《人民日报》)
政策法规
给星巴克带来“致
癌”标签的是何物
美国加利福尼亚州洛杉
矶县高等法院日前裁定,在
加州销售的咖啡产品须标注
致癌警示信息,原因是咖啡豆在烘焙过程中产生可能致
癌的丙烯酰胺。此事引发全球媒体广泛关注和争论。那
么,丙烯酰胺是什么?真的会致癌吗?我们又该怎么
做?
丙烯酰胺是食物在煎、炸、烘烤等高温加热过程中
产生的一种化学物质。炸薯条、烤面包、烘焙咖啡豆时
都可能产生一定量的丙烯酰胺。
动物实验表明,丙烯酰胺具有潜在的神经
毒性、遗传毒性和致癌性。世界卫生组织下属的
国际癌症研究机构将丙烯酰胺定义为2A类致癌
物,即对动物致癌的证据充分,对人致癌的证据
不足。
尽管加州法官要求,在加州销售的咖啡产品
需标注致癌风险警示标识,但美国癌症研究学会
日前专门发表博客文章指出,咖啡不需要被贴上
“致癌”标签。事实上,咖啡含有多种生物活性
物质,可能有抗氧化、抗癌等功效。
无论是咖啡还是薯条等其他含有丙烯酰胺的食物,
谈论致癌性都不能脱离“剂量”这一重要参数。以咖啡
为例,中国国家食品安全风险评估中心的数据显示,每
千克煮咖啡中丙烯酰胺平均含量为13微克。而此前曾有
研究显示,丙烯酰胺的致癌剂量大约为每天每千克体重
摄入2.6微克至16微克。
实际上,要想减少丙烯酰胺对身体的潜在危害,并
非杜绝咖啡就能简单实现。专家建议,人们在日常生活
中,应少用煎、炸、烤等烹饪方法,尽量避免连续长时
间或高温烹饪食品,以减少丙烯酰胺的产生。
(摘自新华网)
58
|
2018.04
Copyright©博看网 . All Rights Reserved.
博采
为什么1元叫1块,1角叫1毛
人民币上明明都标注了的一元,为何我们老是叫它
一块?人民币上明明是一角、五角,为啥又要叫一毛、
五毛呢?
人民币有主币、辅币之分
主币,又称本位币,是一国货币制度中的基本通
货,是国家法定的计价、结算单位;辅币,即辅助货
币,是指本位币单位以下的小额货币,辅助大面额货币
的流通,供日常零星交易和找零使用。《中国人民银行
法》第16条规定:“人民币的单位为元,人民币辅币单
位为角、分。”
因此,我们看到的一元即为主币,一角即为辅币。
“块”之称谓从何而来
对于我国的主币单位,人们口语中常习惯使用
“块”这个量词。“块”作为主币量词,大致经历这样
一个过程:从写作“塊”,释为“土块也”;引申为块
状物的通称,如石块;引申为量词,如《宋史·瀛国公
纪》“杨太后闻昺死,抚膺大恸曰:我忍死艰关至此
者,正为赵氏一块肉尔,今无望矣”。
而外国银圆进入中国,“块”则开始被视作银块
称量使用,“一块洋钿”“两块大洋”即是其客观表
现,量词“块”长期与银圆相联系计量使用,关系逐渐
凝固,而被当作主币单位量词使用,后来纸币取代了银
圆,但“块”的这种用法被保持下来,成为今天人们使
用的一种非正规的主币单位量词。
角本义为兽角,《说文》“角,兽角也,象形。”
外国银圆进入中国时,与银圆配套分等的小银圆也流入
了中国,民间称其为角子、银角子、银毫,辅币单位
“角”应是由名词“角子”发展而来,与数词结合而表
示小额货币数量的“一角”“二角”等,且清后期以来
一直行用于民间。
清后期一些材料中可看到对角币和货币单位“角”
的记载,如同治六年(1867)锺大焜《请变法铸钱议》
“查广东香港钱法与外洋无异。每钱一文,只重二三
分,积十钱二十钱则用当十当二十铜小番,再上则用银
角番、银半番。”龙湛霖于光绪十二年七月上奏:“现
在沿海各市面,凡贸易至百十文以上,从无用现钱者,
皆以一角、二角之洋钱代之,即取其轻重有定,成色有
定,甚便于零用也。”
后来清政府自铸龙洋时,一元以下的小银币也
被称为角子或小洋,有的并在币面注明“一角”“二
角”“五角”等。
“毛”本是读“毫”,为记账方便,往往将“毫”
省笔为“毛”。久而久之,习非成是。现在仍然有的地
方读“毫”不读“毛”。如香港特别行政区使用的一毫
硬币。
(摘自《人民日报》)
百科知识
首次揭秘:又一“国之重器”正在研发
根据爱因斯坦的相对论,宇宙中巨大的天体运动会让时空发生扭曲并像波浪一样传播,这就
是引力波。2016年,多国科学家首次探测到了引力波。
我国的引力波探测计划也在积极实施,“天琴”引力波探测装置正在研发。中国科学院院士罗俊表示,这个装
置是在距离地球约10万公里高的轨道上放三颗卫星,中间用激光联系起来。引力波过来,一边空间会拉伸,一边空
间会收缩,这个拉伸距离只有皮米级(一个原子的大小)。这个装置立体看像一个竖琴,而引力波是拨动琴弦的上
帝之手,所以这个项目取名字叫“天琴”。
未来,把这样一套装置放在宇宙空间里,就能测量出时空变化。“天琴”计划将在2030年前后,发射3颗卫
星,组成空间引力波观测系统,对宇宙中广泛存在的豪赫兹的中频引力波展开探测。
罗俊院士提出的“天琴”计划,是未来中国人探测引力波的关键技术之一。
目前,华中科技大学物理学院副院长涂良成正带着团队研发一台精密感受地球引力的仪器。未来,它可以装在
飞机上,从空中给地球做CT,探索地球的内部情况,可以用来探测地底下的油气资源。
(摘自新华网)
Copyright©博看网 . All Rights Reserved.
|
59
本文发布于:2024-06-06,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:引力波条码使用咖啡单位
发布评论