找回密码
 立即注册
搜索

discuz的变量有哪些?

[复制链接]
汤杨 发表于 2024-1-13 15:56 | 显示全部楼层 |阅读模式
在帖子阅读页模板文件中 (viewthread.htm) 用到的局部变量是 $postlist ,

该变量主要用于输出帖子的楼层信息(包含主楼),

该变量主要作用于 viewthread_node.htm 文件,以 $post 变量进行循环输出。

$_G['postlist'] => $post 变量注释:

$post => Array(
[pid] => 楼层ID
[fid] => 版块ID
[tid] => 帖子ID
[first] => 1=楼主贴 0=普通楼层
[author] => 作者用户名
[authorid] => 作者UID
[subject] => 主题标题
[dateline] => 发布时间
[message] => 帖子内容
[useip] => 作者IP
[invisible] => 楼层状态 0=普通
[anonymous] => 匿名用户 0=非匿名
[usesig] => 是否启用签名 0=否 1=是
[htmlon] => 是否启用HTML代码 0=关闭 1=启用
[bbcodeoff] => 是否启用BBCODE 0=关闭 1=启用
[smileyoff] => 是否屏蔽表情 -1=否
[parseurloff] => 是否禁用链接标识 0=否
[attachment] => 附件数量
[rate] => 评分数
[ratetimes] => 评分次数
[status] => 0
[tags] => Array 帖子TAG列表
[0] => Array
[0] => TAG id
[1] => TAG name
[comment] => 是否有点评 0=否
[replycredit] => 回复奖励 0=否
[position] => 当前楼层序号
[relateitem] => Array 相关帖子
[uid] => 作者UID
[videophoto] => 视频认证信息
[spacename] => 空间名称
[spacedescription] => 空间介绍
[domain] => 空间域名
[addsize] => 额外空间容量
[addfriend] => 额外好友数量
[menunum] => 应用显示个数
[theme] => 空间风格
[spacecss] => 空间自定义CSS
[blockposition] => 个人空间自定义模块参数
[recentnote] => 最近一次行为记录
[privacy] => Array home隐私设置
[feedfriend] => 接受feed的好友缓存
[acceptemail] => 接受新通知邮件及设置邮件接收参数
[magicgift] => 道具红包卡相关信息
[stickblogs] => 置顶的日志ID
[realname] => 真实姓名
[gender] => 性别
[birthyear] => 出生年份
[birthmonth] => 出生月份
[birthday] => 出生日
[constellation] => 星座
[zodiac] => 生肖(可能会被新版弃用)
[telephone] => 座机
[mobile] => 手机
[idcardtype] => 证件类型(返回字符串,如:身份证)
[idcard] => 证件号码
[address] => 街道地址
[zipcode] => 邮政编码
[nationality] => 国籍(可能会被新版弃用)
[birthprovince] => 出生省份
[birthcity] => 出生城市
[birthdist] => 出生区/县
[birthcommunity] => 出生小区
[resideprovince] => 居住省份
[residecity] => 居住城市
[residedist] => 居住行政区/县
[residecommunity] => 居住小区
[residesuite] => 居住小区、写字楼门牌号
[graduateschool] => 毕业学校
[education] => 学历
[company] => 公司
[occupation] => 职业
[revenue] => 年收入
[affectivestatus] => 情感状态
[lookingfor] => 交友目的
[bloodtype] => 血型
[height] => 身高
[weight] => 体重
[alipay] => 支付宝帐号
[icq] => ICQ
[qq] => QQ
[yahoo] => YAHOO
[msn] => MSN
[taobao] => 淘宝帐号
[site] => 主页
[bio] => 个人介绍
[interest] => 兴趣爱好
[field1] => 自定义字段1
[field2] => 自定义字段2
[field3] => 自定义字段3
[field4] => 自定义字段4
[field5] => 自定义字段5
[field6] => 自定义字段6
[field7] => 自定义字段7
[field8] => 自定义字段8
[extcredits1] => 积分字段1
[extcredits2] => 积分字段2
[extcredits3] => 积分字段3
[extcredits4] => 积分字段4
[extcredits5] => 积分字段5
[extcredits6] => 积分字段6
[extcredits7] => 积分字段7
[extcredits8] => 积分字段8
[friends] => 好友数量
[posts] => 帖子数量
[threads] => 主题数量
[digestposts] => 精华贴数量
[doings] => 记录数
[blogs] => 日志数
[albums] => 相册数
[sharings] => 分享数
[attachsize] => 附件占用空间
[views] => 访问量
[oltime] => 在线时间
[todayattachs] => 今日附件数量
[todayattachsize] => 今日附件占用容量
[feeds] => 广播数量
[follower] => 听众数量
[following] => 收听数量
[newfollower] => 新增听众数量
[regip] => 注册IP
[lastip] => 最后活动IP
[lastvisit] => 最后访问时间
[lastactivity] => 最后活动时间
[lastpost] => 最后回复时间
[lastsendmail] => 上次发送email时间
[buyercredit] => 买家信用等级
[sellercredit] => 卖家信用等级
[favtimes] => 个人空间收藏次数
[sharetimes] => 个人空间分享次数
[profileprogress] => 个人资料完成度
[publishfeed] => 用户自定义发送哪些类型的feed
[customshow] => 自定义帖子显示模式
[customstatus] => 自定义头衔
[medals] => 勋章信息
[groupterms] => 公共用户组
[authstr] => 找回密码验证串
[groups] => 用户所有群组
[attentiongroup] => 用户偏好
[email] => Email地址
[username] => 用户名
[password] => 密码MD5
[emailstatus] => 邮箱认证状态 0=未认证 1=已认证
[avatarstatus] => 头像状态 0=未上传 1=已上传
[videophotostatus] => 视频认证状态 0=未认证 1=已认证
[adminid] => 管理组ID
[groupid] => 用户组ID
[groupexpiry] => 用户组有效期
[extgroupids] => 扩展用户组
[regdate] => 注册时间
[credits] => 总积分
[notifysound] => 短信声音
[timeoffset] => 时区校正
[newpm] => 是否有新短消息 1=是 0=否
[newprompt] => 是否有新提醒 1=是 0=否
[allowadmincp] => 是否拥有管理权限
[onlyacceptfriendpm] => 是否只接收好友短消息
[conisbind] => 用户是否绑定QC
[signature] => 签名信息
[office] => 帖子位置(置顶、提升等使用)
[newpostanchor] => 楼层标识描点(用于跳楼功能 HTML代码输出)
[lastpostanchor] =>
[number] => 活动人数
[dbdateline] => 发布时间(时间戳)
[usernameenc] => 用户名
[readaccess] => 阅读权限
[authortitle] => 用户组名
[stars] => 星星数量
[upgradecredit] =>
[lastdate] => 最后活动时间
[authoras] => admin
[avatar] => 用户头像(IMG标签输出)
[groupicon] => 用户组图标
[banned] => 是否禁止访问 0=否 1=是
[warned] => 警告次数
[attachments] => Array 帖子附件数组
[aid] => Array
[aid] => 图片ID
[tid] => 帖子ID
[pid] => 楼层ID
[uid] => 作者UID
[dateline] => 上传时间(非时间戳)
[filename] => 文件名
[filesize] => 附件占用(字节)
[attachment] => 附件相对路径
[remote] => 是否远程附件 0=否 1=是
[description] => 附件描述
[readperm] => 阅读权限
[price] => 售价
[isimage] => 是否图片 0=否 1=是
[width] => 图片宽度(分标率)
[thumb] => 是否存在缩略图 0=否 1=是
[picid] => 相册图片id
[ext] => 文件后缀
[imgalt] => 文件名注释
[attachicon] => 附件类型图标
[attachsize] => 附件占用(KB 计算后)
[attachimg] => 是否为图片
[payed] => 购买次数
[url] => 附件存放目录
[dbdateline] => 上传时间(时间戳)
[downloads] => 下载次数
[attachlist] => 附件数组 同[attachments]
[imagelist] => 输出图片附件AID数组
[allowcomment] => 允许帖子点评 0=禁止 1=楼主 2=回复
[custominfo] => Array
[menu] => 楼层个人信息弹出层菜单(HTML代码)
[mobiletype] => 是否手机发布



举个例子:

如果要在某个位置在显示当前作者的用户名,则写 $post['author'] 。

文章来源:大郎网
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|汤杨网 ( 闽ICP备11012075号-7 )

GMT+8, 2024-4-20 06:48 , Processed in 0.047523 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表