I’m looking for a feature member plugin to use with ExpressionEngine so that a random username, picture and small snippet of information could be placed on a main page everytime it was viewed. I know this simple little thing has to have been implemented already but I’ve yet to come across it. Could someone point it out to me please?
Just the forum interpreting the code for some reason. rob1‘s suggestion is a good one, though. I went ahead and updated my example to change the variable name.
I think the Member Info Plugin should do what you want, Cindy.
For a specific member, you can just hard-code the member ID in the Plugin tag.
For the author on a specific entry, just put the plugin tag inside your {exp:weblog:entries} tag and use the {author_id} variable to set the member ID.
You should be able to use the Member Info plugin still and just use the {member_id} global variable to supply the current user’s ID.
As for limiting the Bio display, try the “word limiter” or “Filter HTML” plugins. You may need to worry about the parse order of the plugins when you nest them.
If I hard code the member ID the code works or if I just have the member_id tag by itself it will return the correct number. But when I put the two together I get a blank.
Can you think of what I need to look at to fix this?
Hmm, I bet the Plugin is getting parsed before the {member_id} Global Variable is populated with a value.
You can get around this using some PHP if you want. You’ll need to set your Template to enable PHP parsing and specify “input” parsing. Then at the top of your Template you can add something like:
I have a related question: how can I display the most recent weblog entry by random author? So rather than bio I’d like to querry for title, summery etc. for a specific weblog, in addition to author screen name and photo.
I was looking for a way to display entries by random authors and found this thread. I didn’t know that EE allows us to nest exp:weblog tags inside exp:query tags but I gave it a try anyway. Now it looks like it’s doing what I need.
First I use SQL to query for random usernames from the exp_members table checking if they have entries using the last_entry_date column, then I just use the username tag inside the exp:weblog tag.
{exp:query sql="SELECT username FROM exp_members WHERE group_id='17' AND last_entry_date > 0 ORDER BY rand() LIMIT 3"}
How can you make the query return ONLY members whose data are NOT empty? Specifically, I only want to display members who have data in both “bio” and “avatar_filename”. I’ve tried the !=”” route, but no luck.
Thanks!
EDIT
I figured it out. I was using double quotes (!=”“) instead of single quotes (!=’‘). Duh!