Welcome, Guest! Log In | Create Account

XCL 2.2 Profile Module prototype

Discussion area about developing XOOPS Cube and XOOPS Cube Legacy.

Moderator: EN moderators

XCL 2.2 Profile Module prototype

Postby kilica » Wed Feb 11, 2009 1:57 pm

ATTENTION: THE PROFILE MODULE IS PRE ALPHA VERSION !!! DON'T USE IT EXCEPT TRIAL ENVIRONMENT.

XCL2.2 Profile module prototype version
=======================================
As next XCL(2.2)'s user function, I have uploaded prototype version of Profile module and User module.
About this feature, see the following tracker url.
https://sourceforge.net/tracker/index.p ... tid=943472

Now this modules are just trial version. So many functions are not work. I would like to your comment and request about this module(Though I hope to keep this module simple...(^ ^).

Profile module manages user's profiles like gender, birthday, hobby, etc.

The site owner can define these profile field easily.
Each user can edit his profile defined by the site owner on Profile module, or other modueles.

This Profile module provides XCube Service for other modules. So, other modules can use Profile module's data through the way of XCube Service.
- Modules can request profile field list.
- Modules can request profile data of certain user.
- Modules can set profile data of certain user. For example, a Q&A module can set the number the user answers to the Profile module.
See the following "Profile_Service" section.

How to use:
-----------
At first, install the Profile module typically.
After installation, you should add profile field definitions on admin menu of the Profile module. See "Profile Field Definition" section below.
Then, users can edit his profile on the Profile module.

The User module within the zip file are almost the same as XCL 2.1.6.
But on the UserInfo, it displays profile fields.
And on the Edituser, its edit form contains profile fields.
Oh, the profile fields of Edituser don't work now other than named 'homepage_url'.

Profile Field Definition:
-------------------------
field name: mysql's field name. So spaces, some mark are invalid on this field.
label: The profile field's label. Users see this label as field name.
type: Type of input. Now you can select "string", "text", "int", "date", "checkbox" or "selectbox". It is just on a trial basis.
validation: This field provide no function now...
required: If you check this, the field will be required to input.
show form: If you check this, the field will be shown on the profile edit form.
weight: The order of the fields. The lower score appears first.
description: The description of the field.
access: Permitted groups access to this field. The site owner can specify which user group can see this field.
options: Options of select box. But select box don't work now...

Profile_Service:
----------------
Profile_Service is based on XCube_Service.
Other modules can use this service to manage profiles.

Now Profile_Service provides 4 functions.

getDefinitions(int uid, int groupid, bool show_form): get profile field definitions. If uid or groupid are specified, you can get the fields of the user/group can access. If show_form is true, you can get the fields "show_form" is true only.

getProfile(int uid): get profile data of the given user's.

getProfileArr(string field_name, string value): get the profile data of all users. Request of field_name and value is condition of filtering data.

setProfile(string field_name, string value, int uid): insert/update the profile data of the given user's.

Developers can see the sample code on
- modules/user/actions/EditUserAction.class.php
- modules/user/actions/UserInfoAction.class.php
User avatar
kilica
Site Admin
 
Posts: 57
Joined: Wed Sep 24, 2008 6:06 am

Re: XCL 2.2 Profile Module prototype

Postby xoopserver » Thu Feb 12, 2009 4:27 pm

Hi Kilica,

After unzip archive i got two folders "user" and "profile"
the folder "profile" is empty :?:
Or am I missing something?
Thank you ^^
xoopserver
 
Posts: 165
Joined: Wed Sep 24, 2008 6:32 am
Location: Geneva, Switzerland

Re: XCL 2.2 Profile Module prototype

Postby kilica » Fri Feb 13, 2009 2:33 am

Hi xoopserver,
xoopserver wrote:After unzip archive i got two folders "user" and "profile"
the folder "profile" is empty :?:


It's mystery.
Now I downloaded the file and found the files in "profile" folder.
Could you download it again ?

>all
How about your case ?
Please tell me your downloaded file in "profile" folder.
User avatar
kilica
Site Admin
 
Posts: 57
Joined: Wed Sep 24, 2008 6:06 am

Re: XCL 2.2 Profile Module prototype

Postby minahito » Fri Feb 13, 2009 4:10 am

kilica wrote:>all
How about your case ?
Please tell me your downloaded file in "profile" folder.


I have no problem. The "profile" folder contains 11 folders and 2 files.
User avatar
minahito
Site Admin
 
Posts: 162
Joined: Sat Sep 20, 2008 6:13 am
Location: Japan

Re: XCL 2.2 Profile Module prototype

Postby xoopserver » Fri Feb 13, 2009 6:59 pm

Hi Kilica,

I unzip the archive on Mac.
The folder "profile" has custom permissions
after change it to r&w everything is fine ^^
I'm going to test the module :D
Thank you!
xoopserver
 
Posts: 165
Joined: Wed Sep 24, 2008 6:32 am
Location: Geneva, Switzerland

Re: XCL 2.2 Profile Module prototype

Postby xoopserver » Sun Feb 15, 2009 3:02 pm

MAC OSX 1.5
XAMPP

Can't go to install step 2

Error message "invalid login"
xoopserver
 
Posts: 165
Joined: Wed Sep 24, 2008 6:32 am
Location: Geneva, Switzerland

Re: XCL 2.2 Profile Module prototype

Postby xoopserver » Sun Feb 15, 2009 5:30 pm

WIN XP
Xoopserver 5

Installation ok !

Error :
Code: Select all
ProfileService.class.php
DefinitionsEditForm.class.php


Cannot add extra fields !

Admin Side
Code: Select all
Warning [PHP]: htmlspecialchars() expects parameter 1 to be string, array given in file W:\www\distribution_unmg\modules\legacy\kernel\Legacy_TextFilter.class.php line 139


Front Side
Code: Select all
Fatal error: Call to a member function gets() on a non-object in W:\www\distribution_unmg\modules\profile\service\ProfileService.class.php on line 163
xoopserver
 
Posts: 165
Joined: Wed Sep 24, 2008 6:32 am
Location: Geneva, Switzerland

Re: XCL 2.2 Profile Module prototype

Postby kilica » Mon Feb 16, 2009 3:02 pm

xoopserver wrote:Error :
Code: Select all
ProfileService.class.php
DefinitionsEditForm.class.php


Cannot add extra fields !

Admin Side
Code: Select all
Warning [PHP]: htmlspecialchars() expects parameter 1 to be string, array given in file W:\www\distribution_unmg\modules\legacy\kernel\Legacy_TextFilter.class.php line 139


Front Side
Code: Select all
Fatal error: Call to a member function gets() on a non-object in W:\www\distribution_unmg\modules\profile\service\ProfileService.class.php on line 163


Thanks xoopserver.
I'm very, very sorry. There were just basic mistakes in the file.
I forgot to add sql file, and setting in xoops_version.php

I attach the new file at this post.
Please,
1. uninstall the profile module on admin menu.
2. unzip the attached file to override all the profile module files.
3. install the profile module again.
User avatar
kilica
Site Admin
 
Posts: 57
Joined: Wed Sep 24, 2008 6:06 am

Re: XCL 2.2 Profile Module prototype

Postby kilica » Tue Mar 10, 2009 10:00 am

10key reported profile module bug. When user opens edituser.php or user.php, It occurs fatal error.
So I fixed the bug and attach the new files on this post.

Download it and replace profile/sevice/ProfileService.class.php.
User avatar
kilica
Site Admin
 
Posts: 57
Joined: Wed Sep 24, 2008 6:06 am

Re: XCL 2.2 Profile Module prototype

Postby kilica » Mon Mar 23, 2009 2:55 pm

I developed profile module last weekend.
Now selectbox is functional and update profiles on the user module.

To update latest version, override all files with the attachment files on this post and update user module and profile module at admin menu.
Attachments
profile.zip
(408.03 KiB) Downloaded 113 times
User avatar
kilica
Site Admin
 
Posts: 57
Joined: Wed Sep 24, 2008 6:06 am

Next

Return to Developer talk

Who is online

Users browsing this forum: No registered users and 1 guest