Improved Elgg Profile plugin/改进的Profile插件 v0.2

Release Notes

What's new from 0.1:

  • add nique meta data check.That I was wrote in another plugin that is private,now I moved that codes into ImprovedProfile.

New config way:

  • Which profile field config in a ElggObject with a 'profilefield' subtype,title,valuetype,category and isUnique metadata
  • function profilefield($title,$valuetype,$category,$isUnique = FALSE,$options = '') in lib.php for make field objects
  • $CONFIG->profile now is a array of profilefield object 

Pulldown type support

  • Appoint the second param of profilefield() as 'pulldown' and pass an array of options to the profilefield() funtion at the last param,it'll return a pulldown type profile field.In edit page,u got a pulldown with those options.

Birthday

  • In edit page,birthday field was split into three pulldown with year,month and day.
  • In userdetail page,it show as a text type.
  • Especially,it compute your Chinese Lunar calendar birthday and show after the Gegorian calendar birthday : )

Category

  • Profile items was shown in sections with category title in userdetials and edit page.

string_to_array()

  • In lib.php there is a mod of string_of_array(),which split string also by ',' and ' '.

Triggers

  • In edit action,before save data to database and after save done,there are plugin hooks.

对0.1的改进

  • 增加了检查数据格式和检查不能重复的字段的代码。那些代码我原来写在另一个私人用途的插件里了,现在移过来了

特性列表:

  • 调用lib.php里的profilefield()方法得到一个详细信息条目对象,可以这个对象指定名称、类型、分类、是否全站唯一,如果是下拉列表类型还可以传递一个数组作为可选值。
  • profilefield()方法生成的'profilefield'对象的数组已经取代了原有的字符串数组作为$CONFIG->profile中保存的配置
  • 支持下拉菜单类型的条目,只需要在调用profilefield()生成一个条目对象的时候指定第二个参数为'pulldown'并给最后一个形参传递一个可选值数组
  • 添加了生日,在编辑页面显示为三个下拉列表,分别选择年、月、日
  • 在个人信息页面,公历生日后面会显示计算得到的农历生日
  • 现在可以给个人信息条目指定分类,并且在个人信息和编辑页面每个分类之间会有简单的分隔
  • tag类型的条目现在用全角逗号和空格也可以分割字符串,这是为了照顾中国用户的使用习惯做的改动。
  • 在action/edit里,保存数据之前和之后各添加了一个插件勾。

Snow.Hellsing

This cat has travelled far far away and dont know when will come back.I still remember my promises.Sorry,guys.

Stats

  • Category: Uncategorized
  • License: GNU General Public License (GPL) version 2
  • Updated: 2014-11-17
  • Downloads: 10189
  • Recommendations: 0

Other Projects

View Snow.Hellsing's plugins