Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道当用户从论坛登录时,是否可以制作一个 PHP 代码来检查来自 Xenforo 的会话。当用户当前未登录论坛时,我试图使按钮显示为“登录和注册”。
当用户登录论坛时。按钮将变为类似:“Welcome Back! Name Here”
谢谢
如果您想使用 XenForo 模板语法:
<xen:if is="!{$visitor.user_id}">Login and Register</xen:if>
对于 PHP:
$visitor = XenForo_Visitor::getInstance(); if (!{$visitor.user_id}) { //Login and Register }