hello
here is a new version
this version is using cvs version 1.4.2.3

changements :
- added my name in the readme file
- added the "strip_tags" filter to the "message" output
- added 3 functions
- get the html page profile from the linden web site
- extracts the image key from this profile page
- extracts the username from this profile page
- code cleaned using the "code-style.pl" drupal script

i hope this will help

Comments

kbahey’s picture

Status: Needs review » Needs work

Patches should be about one functional change, not a mix of unrelated changes.

You need to describe things better: what is a profile page, why is it HTML, ...etc. What value will these key be? ...etc.

ssm2017 Binder’s picture

what is a profile :
In SecondLife and OpenSim worlds, we are using "profiles".
a "profile" is a page that contains informations about a user.
we can see profiles "inworld" and we can also see profiles on the linden website.

about the profile picture key :

profiles can have a picture to represent the avatar.

every element in these worlds are represented by a unique key called uuid
( http://www.lslwiki.net/lslwiki/wakka.php?wakka=key )

the profile picture is represented by a uuid.

Linden is not providing an easy way to get the uuid from a profile.
The only way that lsl scripters are using is to get the picture from the linden's website

here is an example code in lsl : http://www.lslwiki.net/lslwiki/wakka.php?wakka=LibraryDisplayProfilePic

to get this 'image key' we need to buffer the html page and look for the key inside.

im using this function in some of my scripts and i think that this is a good idea to put it inside this framework to prevent the future coders to dont rewrite it all the time.

about the profile username :
sometimes, we need to get the username from a user uuid key.
sometimes, it is not possible to get it from inworld because of absence of script, lag, bugs...
this function is helping me sometimes to get the username from the profile in the website
if im asking the username to an inworld script and it answered a blank string, im asking to the website.

the 3 functions i/o :

secondlife_get_linden_user_profile($user_key) :
input : a string containing the user uuid key
output : a string containing the html page

secondlife_extract_picture_key($profile_page) :
input : a string containing the profile html page
output : the image profile uuid key

secondlife_extract_username($profile_page) :
input : a string containing the profile html page
output : the profile user name

ssm2017 Binder’s picture

StatusFileSize
new462 bytes

here is the first of the few separated patches for this post
this one is filtering the output with php strip_tags function because we dont need html tags in secondlife/opensim

ssm2017 Binder’s picture

StatusFileSize
new1.43 KB

here is the second one about the html profile extraction ( see comment #2 )

ssm2017 Binder’s picture

StatusFileSize
new5.33 KB

the last one is for code cleaning

mile23’s picture

Getting the profile/image from LL doesn't seem to be working. I suggest it be set off into a separate module, so the 6.x version of secondlife module can be stable.

ssm2017 Binder’s picture

hello
thank you for reporting
ll updated their website recently but the link to the profile and picture is still the same

i am using this feature in the sluser module and i have tested it again with success few minutes ago after reading your report

can you see your picture on the profile web page using : http://world.secondlife.com/resident/YOUR_UUID
some pictures are not displayed in the website like mine (depending on the picture itself about transparency and png/tga...)
as you can see here : http://world.secondlife.com/resident/bf362c0b-67ec-49c7-a852-77968e3f7f56 the picture is not appearing on my profile but it is appearing on another one : http://world.secondlife.com/resident/f4725c76-46f0-46a7-b9f3-9f49bd967aaf

this problem is not "secondlife framework" related but a ll issue.

if you think that this code is bugged, instead of answering to a feature request, please report it as a bug

feel free to contact me inworld : ssm2017 Binder
if i can try to help you to solve your issue, i will do it with pleasure

ssm2017 Binder’s picture

Status: Needs work » Closed (fixed)

this was added to the branch here http://drupal.org/cvs?commit=224024