List - Only show user when user data not empty

18 years 4 months ago #2761 by phil_roy
Hi all,

I have a site that uses the phpBB integrated component and I've been getting some help to hook up phpBB and CB. CB will be new to my site and there is around about 640 registered users but because many of them are not active the default user list in CB shows a lot of people who haven't been on the site for ages.

I want to make my default users list to only feature those that add something in to their CB profile. CB is not and will not be used for registration, phpBB will...so it's only if people go to the CB section and add more data in there...above and beyond phpBB...that I really think need to be shown there.

My current list is under test here...

www.nzmac.com/index.php?option=com_comprofiler&task=usersList

The only filter on it at the moment is to hide the anonymous user that appears in phpBB. I want to be able to add a filter to my default list that says...

Show all users who are NOT named "anonymous" AND (have a thumbnail OR entered "About Me" info OR wrote an article OR entered "User Map" info)

So it would be something like....

username is NOT = "anonymous" AND
(is NOT EMPTY thumbnail OR
is NOT EMPTY "About Me" OR
is NOT EMPTY "Articles" OR
is NOT EMPTY "User Map")

...but that is as far as I can figure out how to do an advanced filter for a user list. Help!

Cheers,

Phil

Post edited by: phil_roy, at: 2005/12/24 02:46

Please Log in to join the conversation.

18 years 4 months ago #2762 by trail
Thats just about right!

Just use the fieldnames as shown in your backend instead of 'About Me' it should be something like 'cb_aboutme' but that depends on your own setting.. check for those exact fieldnames in field manager and i think you are on a roll !!

U can also do an additional check on last login date.. if they didnt log in for 6 months, dont list them..

something that goes like
WHERE registerdate > DATE_SUB(NOW(), INTERVAL 6 MONTH)

check for actual tablenames

Post edited by: Trail, at: 2005/12/24 07:40

DJ Trail.
CB Co-Founder & Test-Lead.
Plugins: My Age , Starsign Matchmaking Horoscope , My Visitor , My Highscores , My ProfileID ,
My Components: Import & Invite Karma Casino (Use Test / Test)
My Modules: Many :)

Please Log in to join the conversation.

18 years 4 months ago #2763 by phil_roy
Hmmm, OK, but I think it's compliacted by the fact that not all the info (using the phpBB hack someone developed) comes into the CB but stays in mos_users.

So I've had a read of the MySQL manual and have come up with the following...

SELECT (FROM mos_users WHERE username != ‘Anonymous’ AND WHERE user_lastvisit > DATE_SUB(NOW(), INTERVAL 6 MONTH)) AND (FROM mos_comprofiler WHERE avatar != ‘NULL’ OR cb_aboutme != ‘NULL’ OR cb_geomangeocode != ‘NULL’)

What do you think? Also...I can't figure out how to add in....is NOT EMPTY "Articles".

Thanks for your help.

Phil

Please Log in to join the conversation.

18 years 3 months ago #2871 by phil_roy
OK, I'm close, so thought I'd share how I got the syntax right so far for people. I couldn't figure how to make a complex statement so here's what I did...

* Go into your list and apply just one of the filters under 'simple' mode...for example, that 'thumbnail' is NOT NULL (meaning empty)
* Save the list
* Go back into it and change the filter list to 'advanced' mode...and there's the syntax you need!

So I just did that one at a time and built up most of the code. This is what I have so far...

(username !='Anonymous') AND (`avatar` IS NOT NULL OR `cb_geomangeocode` IS NOT NULL OR `cb_aboutme` IS NOT NULL)

I can't get the last online thing to work at all (to pick up they must have been online in the last 6 months) and I have no idea how I can say "OR the articles tab isn't empty"

Phil

Please Log in to join the conversation.

18 years 3 months ago #3023 by phil_roy
Anyone? Really stuck on that last two...tried things like "authortab", "cb.authortab" and "cb_authortab" but no joy....also not sure how to do the date thing at all.

Phil

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.626 seconds

Facebook Twitter LinkedIn