Top Banner
Copyright © ZhiShiSoft Co., Ltd. All rights www.thinksns.com www.zhishisoft.com ThinkSNS 钩子说明 智士软件(北京)有限公司
15

ThinkSNS 钩子说明

Mar 23, 2016

Download

Documents

yang weijie

ThinkSNS 钩子说明
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: ThinkSNS 钩子说明

Copyright © ZhiShiSoft Co., Ltd. All rights

reserved.

www.thinksns.com www.zhishisoft.com

ThinkSNS 钩子说明

智士软件(北京)有限公司

Page 2: ThinkSNS 钩子说明

© ZhiShiSoft Co., Ltd. ThinkSNS 钩子说明 Page 2

目录

1. 首页 ............................................................................................................................................. 5

'home_index_left_top' ..................................................................................................................... 5

'home_index_left_avatar_bottom' ................................................................................................... 5

'home_index_left_tab' ..................................................................................................................... 5

'home_index_left_middle' ............................................................................................................... 5

'home_index_left_bottom' ............................................................................................................... 5

'home_index_left_advert' ................................................................................................................ 5

'home_index_middle' ...................................................................................................................... 5

'home_index_middle_top' ............................................................................................................... 6

'home_index_middle_publish' ......................................................................................................... 6

'home_index_middle_advert' ........................................................................................................... 6

'home_index_weibo_tab' ................................................................................................................. 6

'home_index_right_top' ................................................................................................................... 6

'home_index_right_bottom' ............................................................................................................. 6

'home_index_right _advert' ............................................................................................................. 6

2. 设置 ............................................................................................................................................. 7

'home_account_tab' ......................................................................................................................... 7

'home_account_show' ...................................................................................................................... 7

'home_account_do' .......................................................................................................................... 7

'home_account_profile_base' .......................................................................................................... 7

'home_account_profile_intro' .......................................................................................................... 8

'home_account_profile_contact' ...................................................................................................... 8

'home_account_profile_bottom' ...................................................................................................... 8

'home_account_privacy' .................................................................................................................. 8

Page 3: ThinkSNS 钩子说明

© ZhiShiSoft Co., Ltd. ThinkSNS 钩子说明 Page 3

'home_account_privacy_bottom' ..................................................................................................... 8

'home_account_security_bottom' .................................................................................................... 8

'home_account_bind_bottom' .......................................................................................................... 8

3. 个人主页 ..................................................................................................................................... 8

'home_space_profile_base' .............................................................................................................. 8

'home_space_middle' ...................................................................................................................... 9

'home_space_tab' ............................................................................................................................. 9

'home_space_list' ............................................................................................................................. 9

'home_space_right_top' ................................................................................................................... 9

'home_space_right_middle' ............................................................................................................. 9

'home_space_right_bottom' ........................................................................................................... 10

'home_space_profile_intro' ........................................................................................................... 10

'home_space_profile_contact' ....................................................................................................... 10

'home_space_profile_middle' ........................................................................................................ 10

'home_space_profile_bottom' ........................................................................................................ 10

4. 广场 ........................................................................................................................................... 11

'home_square_tab' ......................................................................................................................... 11

'home_square_show' ...................................................................................................................... 11

'home_square_index_top' .............................................................................................................. 11

'home_square_index_middle' ........................................................................................................ 11

'home_square_index_tab' .............................................................................................................. 11

'home_square_index_list' .............................................................................................................. 12

'home_square_index_right_top' ..................................................................................................... 12

'home_square_index_right_bottom' .............................................................................................. 12

'home_square_topics_top' ............................................................................................................. 12

'home_square_topics_bottom' ....................................................................................................... 12

Page 4: ThinkSNS 钩子说明

© ZhiShiSoft Co., Ltd. ThinkSNS 钩子说明 Page 4

'home_square_topics_right_top' .................................................................................................... 12

'home_square_topics_right_bottom' .............................................................................................. 12

5. 微博 ........................................................................................................................................... 12

'weibo_type_before_publish' ......................................................................................................... 12

'weibo_type_publish' ..................................................................................................................... 13

'weibo_type_parse_tpl' .................................................................................................................. 13

'weibo_bottom_right' ..................................................................................................................... 13

'weibo_comment_publish' ............................................................................................................. 13

6. 搜索 ........................................................................................................................................... 14

'home_search_weibo_tab' .............................................................................................................. 14

7. 异步加载 ................................................................................................................................... 14

'hook_ajax' ..................................................................................................................................... 14

'hook_ajax_anonymous' ................................................................................................................ 14

8. 其他 ........................................................................................................................................... 14

'user_name_end' ............................................................................................................................ 14

Page 5: ThinkSNS 钩子说明

© ZhiShiSoft Co., Ltd. ThinkSNS 钩子说明 Page 5

1. 首页

'home_index_left_top'

说明 位于“ 首页”左边栏顶部,即个人头像上方。可直接输出 html。

'home_index_left_avatar_bottom'

说明 位于“ 首页”个人头像下方。可直接输出 html。

'home_index_left_tab'

'home_index_left_middle'

说明 位于“ 首页”左边栏导航和左边栏应用列表之间。可直接输出 html。

'home_index_left_bottom'

说明 位于“ 首页”左边栏应用列表和下方广告位之间。可直接输出 html。

'home_index_left_advert'

'home_index_middle'

参数 类型 含义

&$menu array 标签的数组格式如下:

$menu[] = array('act'=>'action_name', 'name'=>'操作名称')

说明

“首页”左边栏导航扩展,自定义新的切换标签,但丌可变更系统自带的链

接。操作名称(action_name)丌能重复。新链接的内容的展示参见钩子

'home_index_middle'。

参数 类型 含义

$advert array 广告的内容

说明 “首页”左边栏下方广告展示,将替换系统默认的展示方式。可直接输出

html。

参数 类型 含义

Page 6: ThinkSNS 钩子说明

© ZhiShiSoft Co., Ltd. ThinkSNS 钩子说明 Page 6

'home_index_middle_top'

说明 位于“ 首页”微博发布框上方。

'home_index_middle_publish'

说明 位于“首页”和“话题页”微博发布框的底部。直接输出 html。

'home_index_middle_advert'

'home_index_weibo_tab'

'home_index_right_top'

说明 位于“ 首页”右边栏顶部。可直接输出 html。

'home_index_right_bottom'

说明 位于“ 首页”右边栏话题榜和下方广告之间。可直接输出 html。

'home_index_right _advert'

$action_name string 操作名称,即 URL 的 act 参数。

说明 “首页”中栏,展示'home_index_left_tab'中自定义的切换标签对应的

页面。需对$action_name 的值进行判断。可直接输出 html。

参数 类型 含义

&$advert array 广告的内容

说明 “首页”中栏的中部广告展示。将替换系统默认的展示方式。可直接输出

html。

参数 类型 含义

&$ menu array 标签的数组格式如下:

$menu['微博类型']=>'微博类型名称'

说明 “首页”中栏、“话题页”和“搜微博页”的微博列表导航,可自定义新的

微博类型的切换标签。微博类型丌能重复。已默认“空”为“所有”类型。

Page 7: ThinkSNS 钩子说明

© ZhiShiSoft Co., Ltd. ThinkSNS 钩子说明 Page 7

2. 设置

'home_account_tab'

'home_account_show'

'home_account_do'

'home_account_profile_base'

说明 “个人资料-基本资料”表单扩展。可直接输出 html。

参数 类型 含义

$advert array 广告的内容

说明 “首页”右边栏下方广告的展示,将替换系统默认的展示方式。可直接输出

html。

参数 类型 含义

&$menu array 标签的数组格式如下:

$menu[] = array('act'=>'action_name', 'name'=>'操作名称')

说明

“设置页”的导航,可以自定义新的设置顷目的切换标签,操作名称

(action_name)丌能重复。自定义新设置顷目的页面的展示参见钩子

'home_account_show'。

参数 类型 含义

$action_name string 操作名称,即 URL 的 act 参数

说明

展示“ 设置页”自定义新设置顷目的页面,需对$action_name 的值进行

判断。自定义新设置顷目的执行参见钩子'home_account_do'。可直接输出

html。

参数 类型 含义

$action_name string 操作名称,即 URL 的 act 参数

说明 处理“ 设置页”提交的自定义表单的数据,必须以 post 的形式提交数据,

需对$action_name 的值进行判断。可直接输出 html。

Page 8: ThinkSNS 钩子说明

© ZhiShiSoft Co., Ltd. ThinkSNS 钩子说明 Page 8

'home_account_profile_intro'

说明 “个人资料-个人情况”表单扩展。可直接输出 html。

'home_account_profile_contact'

说明 “个人资料-联系方式”表单扩展。可直接输出 html。

'home_account_profile_bottom'

说明 “个人资料页”最下方。可直接输出 html。

'home_account_privacy'

说明 “隐私设置-隐私设置”表单扩展。可直接输出 html。

'home_account_privacy_bottom'

说明 “隐私设置页”最下方。可直接输出 html。

'home_account_security_bottom'

说明 “帐号安全页”最下方。可直接输出 html。

'home_account_bind_bottom'

说明 “外部绑定页”最下方。可直接输出 html。

3. 个人主页

'home_space_profile_base'

参数 类型 含义

$uid int 被浏览的用户 ID

&$user_info array 用户基本资料内容,数组格式如下:

$user_info['字段名称']=>'内容'

说明 “个人空间”用户基本资料。

Page 9: ThinkSNS 钩子说明

© ZhiShiSoft Co., Ltd. ThinkSNS 钩子说明 Page 9

'home_space_middle'

'home_space_tab'

'home_space_list'

'home_space_right_top'

'home_space_right_middle'

参数 类型 含义

$uid int 被浏览的用户 ID

说明 “个人空间”用户基本资料下方。可直接输出 html。

参数 类型 含义

$uid int 被浏览的用户 ID

&$menu array 标签的数组格式如下:

$menu['类别']=>'标签名称'

说明

“个人空间”下方列表导航,可自定义新的切换标签,类别丌能重复,

已默认“空”为“微博”类别。类别对应的列表内容的展示参见

'home_space_list'。

参数 类型 含义

$uid int 被浏览的用户 ID

$type string 列表类别

说明 “个人空间”下方列表,需对$type 的值进行判断。可直接输出 html

参数 类型 含义

$uid int 被浏览的用户 ID

说明 位于“个人空间”右侧栏顶部。可直接输出 html

参数 类型 含义

$uid int 被浏览的用户 ID

Page 10: ThinkSNS 钩子说明

© ZhiShiSoft Co., Ltd. ThinkSNS 钩子说明 Page 10

'home_space_right_bottom'

'home_space_profile_intro'

'home_space_profile_contact'

'home_space_profile_middle'

'home_space_profile_bottom'

说明 位于“个人空间”右侧栏统计和个人标签之间。可直接输出 html

参数 类型 含义

$uid int 被浏览的用户 ID

说明 位于“ 个人空间”右侧栏最下方。可直接输出 html

参数 类型 含义

$uid int 被浏览的用户 ID

&$user_intro array 用户个人情况内容,数组格式如下:

$user_info[]=array('name'=>'字段名称', 'value'=>'内容')

说明 “ 详细资料页”的用户个人情况。

参数 类型 含义

$uid int 被浏览的用户 ID

&$user_contact array 用户联系方式内容,数组格式如下:

$user_info[]=array('name'=>'字段名称', 'value'=>'内容')

说明 “详细资料页”的用户联系方式。

参数 类型 含义

$uid int 被浏览的用户 ID

说明 位于“ 详细资料页”基本资料和个人情况之间。可直接输出 html。

参数 类型 含义

Page 11: ThinkSNS 钩子说明

© ZhiShiSoft Co., Ltd. ThinkSNS 钩子说明 Page 11

4. 广场

'home_square_tab'

'home_square_show'

'home_square_index_top'

'home_square_index_middle'

'home_square_index_tab'

$uid int 被浏览的用户 ID

说明 位于“ 详细资料页”最下方。

参数 类型 含义

&$menu array 标签的数组格式如下:

$menu[]=array('act'=>'action_name','name'=>'操作名称'))

说明

“广场”的导航,可以自定义新的栏目的切换标签,操作名称

(action_name)丌能重复。自定义新栏目的展示参见钩子

'home_square_show'。

参数 类型 含义

$action_name string 操作名称,即 URL 的 act 参数

说明 展示“广场”自定义新栏目的页面,需对$action_name 的值进行判断。

可直接输出 html。

说明 位于“广场首页”顶部,即“今日看点”上方。可直接输出 html。

说明 位于“广场首页”下的微博列表的上方。可直接输出 html。

参数 类型 含义

&$menu array 标签的数组格式如下:

$menu['类别']=>'标签名称'

Page 12: ThinkSNS 钩子说明

© ZhiShiSoft Co., Ltd. ThinkSNS 钩子说明 Page 12

'home_square_index_list'

'home_square_index_right_top'

'home_square_index_right_bottom'

'home_square_topics_top'

'home_square_topics_bottom'

'home_square_topics_right_top'

'home_square_topics_right_bottom'

5. 微博

'weibo_type_before_publish'

说明 “广场首页”下方微博列表导航,可自定义新的切换标签,类别丌能重

复。类别对应的列表内容的展示参见'home_square_index_list'。

参数 类型 含义

$type string 列表类别

说明 “广场首页”下方列表内容,需对$type 的值进行判断。可直接输出 html。

说明 位于“ 广场首页”右侧栏顶部。可直接输出 html。

说明 位于“广场首页”右侧栏最下方。可直接输出 html。

说明 位于“热门话题”顶部。可直接输出 html。

说明 位于“热门话题”最下方。可直接输出 html。

说明 位于“热门话题”右侧栏顶部。可直接输出 html。

说明 位于“热门话题”右侧栏最下方。可直接输出 html。

参数 类型 含义

Page 13: ThinkSNS 钩子说明

© ZhiShiSoft Co., Ltd. ThinkSNS 钩子说明 Page 13

'weibo_type_publish'

'weibo_type_parse_tpl'

'weibo_bottom_right'

'weibo_comment_publish'

$type string 微博类型

说明 微博发布前,对微博类型和扩展数据进行检测,微博类型和扩展数据可

自定义,需对$type 的值进行判断。

参数 类型 含义

$id int 微博 ID

$data array 微博基本数据

说明

微博发布后,处理微博类型和数据,微博类型和扩展数据可自定义。系

统将会存储提交的自定义的微博类型,但自定义的扩展数据需自行建表

存储。自定义的扩展数据的解析参见'weibo_type_parse_tpl'。

参数 类型 含义

$id int 微博 ID

$data array 微博基本数据

&$expend string 微博扩展数据解析后的 html

说明 对微博的扩展数据进行模板解析。

参数 类型 含义

$id int 微博 ID

$data array 微博基本数据

说明 一条微博的右下方。可直接输出 html。

参数 类型 含义

$comment_id int 评论 ID

Page 14: ThinkSNS 钩子说明

© ZhiShiSoft Co., Ltd. ThinkSNS 钩子说明 Page 14

6. 搜索

'home_search_weibo_tab'

7. 异步加载

'hook_ajax'

'hook_ajax_anonymous'

8. 其他

'user_name_end'

$data array 评论基本数据

说明 微博评论发布后的处理。

参数 类型 含义

&$menu array 标签的数组格式如下:

$menu['微博类型']=>'微博类型名称'

说明 “搜微博页”的微博列表导航,可增加自定义的微博类型的切换标签,微博

类型丌能重复,已默认“空”为“全部”类型。

说明

登陆状态下的异步加载,可通过 Addons::ajaxUrl($param) 方法获得异步加载

的 URL,$param 为参数数组。非登陆状态下丌会生效。需验证传递的数据。

可直接输出 html。

说明

非登陆状态下的异步加载,可通过 Addons::ajaxUrl($param) 方法自动生成异

步加载的 URL,$param 为参数数组。登陆状态下丌会生效。需验证传递的数

据。可直接输出 html。

参数 类型 含义

$uid int 用户 ID

&$user_name_end string 用户名末尾附带的内容的 html。

Page 15: ThinkSNS 钩子说明

© ZhiShiSoft Co., Ltd. ThinkSNS 钩子说明 Page 15

说明

在“用户名”末尾附带额外信息,建议使用拼接字符串的方式操作

$user_name_end,即$user_name_end .= 'html' ,以免覆盖其他调用

生成信息。