We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

LG Member List - Custom field type extension

Development and Programming

Leevi Graham's avatar
Leevi Graham
1,143 posts
17 years ago
Leevi Graham's avatar Leevi Graham
Hi all, I originally tried using “custom_profile_data” tag within my “weblog:entries” tag, but this doesn’t seem to work (clearly “artwork_member_id” is the custom weblog field generated by the LG Member List)

That’s unfortunate. I’m not sure why the value would not be recognised as it is just stored as a number. I’ll try and get some tests sorted and figure it out.

Thanks for contributing the plugin!

       
Andrew Gunstone's avatar
Andrew Gunstone
101 posts
17 years ago
Andrew Gunstone's avatar Andrew Gunstone

Thanks Leevi…I was a bit surprised myself that the “custom_profile_data” tag didn’t work, but I am just guessing that it was a parsing-order issue. Any testing/thoughts from an expert would be greatly appreciated!

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
17 years ago
Leevi Graham's avatar Leevi Graham

Well I’m not sure how the parsing order would affect this. There is nothing special going on with the value of the custom field as it is just stored as an integer…

Are you using multiple selections?

Also what is the output of the custom field when you just put {artwork_member_id} in the page?

       
Andrew Gunstone's avatar
Andrew Gunstone
101 posts
17 years ago
Andrew Gunstone's avatar Andrew Gunstone

I was just speculating. No solid basis for my theory!!

Multiple selections is not allowed, and the output when using {artwork_member_id} is just the id (my testing case it was 2). All I was getting from the “custom_profile_data” tag was MY login details which is the default when no member_id is passed, or the id is not found.

Thanks for taking the time to look at this.

PS: I am using a couple of your other extensions/modules and they really are great. I am very impressed and inspired by them. I am a real convert to EE now (having developed my own PHP CMS’s in the past).

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
17 years ago
Leevi Graham's avatar Leevi Graham

What happens when you turn on SQL debugging? What is the sql statement for the member tag?

       
Andrew Gunstone's avatar
Andrew Gunstone
101 posts
17 years ago
Andrew Gunstone's avatar Andrew Gunstone

Okay…there were about 60 SQL statements. From what I can tell it is one of these three…

52
SELECT m.member_id, m.group_id, m.username, m.screen_name, m.email, m.signature, m.avatar_filename, m.avatar_width, m.avatar_height, m.photo_filename, m.photo_width, m.photo_height, m.url, m.location, m.occupation, m.interests, m.bio, m.join_date, m.last_visit, m.last_activity, m.last_entry_date, m.last_comment_date, m.last_forum_post_date, m.total_entries, m.total_comments, m.total_forum_topics, m.total_forum_posts, m.language, m.timezone, m.daylight_savings, m.bday_d, m.bday_m, m.bday_y, g.group_title FROM exp_members m, exp_member_groups g WHERE m.member_id = '2' AND g.site_id = '1' AND m.group_id = g.group_id
53
SELECT m_field_id, m_field_name, m_field_fmt FROM exp_member_fields
54
SELECT * FROM exp_member_data WHERE member_id = '2'

Interestingly enough, they all work correctly (when run directly in PHPMyAdmin)! The correct ID (ie. 2) is clearly being passed as well.

Weird.

       
Beebs's avatar
Beebs
207 posts
16 years ago
Beebs's avatar Beebs

Is there any update for the post#27 above? - that this excellent extension will only list member groups, rather than members name.

Or if I can simplify my request - if only I can select the member group.

I have presentation tomorrow and will include this excellent extension.

       
Andrew Gunstone's avatar
Andrew Gunstone
101 posts
16 years ago
Andrew Gunstone's avatar Andrew Gunstone

Hi all. I have just updated to the latest version of EE (1.6.6 Build 20081114) and have found an interesting problem with the LG Member List extension. I am working with the latest release of the extension (1.2.1).

When saving an entry that uses the LG Member List for one of the fields, it is now saving the field format in the database as “NULL” instead of “none”. As my default field format is “xhtml”, the member id’s are now being displayed as “13” instead of just “13”.

Any thoughts? Has anyone else come across this issue?

Cheers.

       
Ryan M.'s avatar
Ryan M.
1,511 posts
16 years ago
Ryan M.'s avatar Ryan M.

What’s the easiest way to test if anything has been selected for this field, or that it’s blank? I want to determine whether there has been a selection made before showing a part of a template. Seems like I have to check for empty as well as -1.

{if myfield == "-1" || myfield ==""}

means there hasn’t been a selection made…I think. But that is showing the part of the template I don’t want to display.

Just trying to simplify my template!

       
Ryan M.'s avatar
Ryan M.
1,511 posts
16 years ago
Ryan M.'s avatar Ryan M.

Fonzie effect again - post here then immediately come upon the answer. I had to do this:

{if "{myfield}" == "-1" || "{myfield}" == ""}

I can never remember when I have to bracket/quote my variables.

In English: If my field says “Don’t associate anyone with this post” or it’s empty, then do your thing.

       
Ryan M.'s avatar
Ryan M.
1,511 posts
16 years ago
Ryan M.'s avatar Ryan M.
Hi all. I have just updated to the latest version of EE (1.6.6 Build 20081114) and have found an interesting problem with the LG Member List extension. I am working with the latest release of the extension (1.2.1). When saving an entry that uses the LG Member List for one of the fields, it is now saving the field format in the database as “NULL” instead of “none”. As my default field format is “xhtml”, the member id’s are now being displayed as “13” instead of just “13”. Any thoughts? Has anyone else come across this issue? Cheers.

agun: this is a well documented problem with a change in the typography class in EE 1.6.5 and custom field extensions. Search these forums for this and you’ll find many threads.

You basically need to add this line:

$r .= $DSP->input_hidden('field_ft_'.$row['field_id'],$row['field_fmt']);

Add that line around line 502, right above

}
return $r;

Then change your field format on the field in question to something like “auto br” or “XHTML”, and check the box to update all your fields. Save the custom field. Then go back into the field, set it to “none” (which is what you wanted in the first place), check the box to update all your existing fields. That will re-set all your existing fields. You should be all set after this. As of this writing, most of Leevi’s extensions still don’t have this fix. Beware!

       
Joobs's avatar
Joobs
362 posts
16 years ago
Joobs's avatar Joobs

can anyone tell me how to get this working when i’ve selected multiple members from the list?

The query posted on Leevis site works when I select one member, but if I do a multi select it throws up an sql error…

       
Scheffey's avatar
Scheffey
24 posts
16 years ago
Scheffey's avatar Scheffey

Joobs, I realize this is months after you asked, but maybe someone else needs this info too.

The Member List extension returns the selected member IDs in a comma separated list. I would use some PHP to loop through that list and then do whatever you want with the IDs.

Here is a sample bit of code:

<?php 
$memberIDs = explode(",","{your_member_list_field}");
for($i=0;$i<sizeof($memberIDs);$i++) {
    // Do what you need with each ID inside this loop.
    // Reference each ID with the $memberIDs<i> variable.
}
?>

Depending on what you want to do with this, it could put you into a bit of a pickle since you have to run the PHP on output in order to get the IDs into the PHP array. This would prevent you from slugging it directly into an exp:query tag. The solution would vary based on what you want the end result to be.

       
1 2 3

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.