php - 现在在线和网上现在 MYBB onlinetoday,如何编辑这个插件来显示更大的1

  显示原文与译文双语对照的内容
0 0

我正在使用这个插件

http://mods.mybb.com/download/online-today-1.2.2

下面的部分是查询


 $queries[] = $db->simple_select(
"users u LEFT JOIN".TABLE_PREFIX."sessions s ON (u.uid=s.uid)", 
"s.sid, s.ip, s.time, s.location, u.uid, u.username, u.invisible, u.usergroup, u.displaygroup",
"u.lastactive> $timesearch ORDER BY u.username ASC, s.time DESC"
 );
 $queries[] = $db->simple_select(
"sessions s LEFT JOIN".TABLE_PREFIX."users u ON (s.uid=u.uid)",
"s.sid, s.ip, s.uid, s.time, s.location, u.username, u.invisible, u.usergroup, u.displaygroup",
"s.time>'$timesearch' ORDER BY u.username ASC, s.time DESC"
 );

现在我想修改这个查询,以便只获取大于 0个帖子计数的用户。 至少 1个帖子

谢谢你

php,mybb

时间: 原作者:

0 0

请尝试以下代码:


 $queries[] = $db->simple_select(
"users u LEFT JOIN".TABLE_PREFIX."sessions s ON (u.uid=s.uid)", 
"s.sid, s.ip, s.time, s.location, u.uid, u.username, u.invisible, u.usergroup, u.displaygroup",
"u.lastactive> $timesearch AND u.postnum> 0 ORDER BY u.username ASC, s.time DESC"
 );
 $queries[] = $db->simple_select(
"sessions s LEFT JOIN".TABLE_PREFIX."users u ON (s.uid=u.uid)",
"s.sid, s.ip, s.uid, s.time, s.location, u.username, u.invisible, u.usergroup, u.displaygroup",
"s.time>'$timesearch' AND u.postnum> 0 ORDER BY u.username ASC, s.time DESC"
 );

我刚刚添加了一个 WHERE 子句,它检查 postnum 字段以确保它是 GREATER 比 0.

原作者:
...