Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Member listing problem
Avatar
Anthony Latour
Rookie
Free Members
sp_UserOfflineSmall Offline
Aug 15, 2013 - 10:20 am

2 questions:

1- If i go to "Profile, profile options" and choose to show the profile with the "forum profile page". When I go on the forum and click a member, I don't see any information, all I get is "guest" information, no email, etc... If I choose the "pop up window" option, everything is fine, i know see the informations.

I mostly do not want to use the popup because the site will be used a lot on mobile devices... (Mobile theme? *wink wink* :) )

2- On the member listing page, it is VERY important for me to be able to search users with their WP Login although they use "Firstname Lastname" on the forum... What could I edit and where to just change the sql query?

Thank you very much, great work on this forum.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Aug 15, 2013 - 10:49 am

Your first issue I am totally unable to replicate either on our live site or my local test and development systems. I think I need to see this in action to even begin to diagnose what your problem might be.

Our first mobile theme will be offered for beta very, very shortly. I think we said within a month of the release of 5.3.0 and I believe we are well on target for that. We are using an alpha on this site in fact.

Your second question I am going to have to research and take a closer look at. I found an anomaly here in that the SP member search uses display name only and the SP admin users search uses the WP login name which is a bit odd.

The majority of people do not want to use or see the login name so we do actually keep it hidden at all times from all users (except for forum admins). If you want to open this up in the members search then obviously that is fine with us but I will need to see if I can find a filter that you can use as we will not change core code for this.

If you want me to look closer at your first point then as I say - I will need to take a look so if you would like to make me an account and then PM credentials to both myself and to 'Mr Papa'. Please include in the PM a link to your site, a link to this thread and brief reminder of the problem. And one of us will take a look for you.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Aug 15, 2013 - 12:04 pm

Just paid a quick visit to your site and the profile as page option seems to working as expected... But I did reset the tabs and menus as I see they had become scrambled.

About the search - let us confirm please...

  1. Are you referring to the front-end/public 'members listing'?
  2. if this changes then this will allow any user who has permission to view the membership list to also search on login name. So - are you sure?

 

 

andy-signature.png
YELLOW
SWORDFISH
Avatar
Anthony Latour
Rookie
Free Members
sp_UserOfflineSmall Offline
Aug 16, 2013 - 12:23 am

1st : Thank you so much for your support!

2nd : Yes and yes. (Listing at .com/discussions/members/) Site is for employees only. Everything is "public" between the employees. WP login is the employee number and I installed a plugin which changes the public name to Firstname Lastname on registration, but users still need to be able to search themselves by WP login "number" in my case.

Thanks again!

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Aug 16, 2013 - 4:52 am

OK. You will need to add some filter code to your Simple:Press theme. The file you need is called spFunctions.php and you will find it in the /templates folder of your SP theme. As always we recommend that you create your own SP theme so that any customisation is not lost during a future update. (http://codex.simple-press.com/.....g-a-theme/).

I would suggest you click on the 'raw code' button - copy the resultant code to your clipboard and then paste it into the file to avoid potential typing errors. Anywhere in that file will do as ling as it is within the php tags top and bottom.

add_filter('sph_members_list_query', 'add_login_name', 1, 2);
function add_login_name($q, $ob) {
    $search = (!empty($_POST['msearch']) && !isset($_POST['allmembers'])) ? sp_esc_str($_POST['msearch']) : '';
    $ug = (!empty($_GET['ug'])) ? sp_esc_int($_GET['ug']) : $ug_select;
    if(!empty($search)) {
        $where = 'posts > -2 ';
        if(!empty($ug)) {
            $where .= 'AND '.SFMEMBERSHIPS.'.usergroup_id = '.$ug.' ';
        }
        $where .= 'AND ('.SFMEMBERS.'.display_name LIKE "'.$search.'%" OR '.SFUSERS.'.user_login LIKE "'.$search.'%")';
        $q->where = $where;
    }
    return $q;
}

Give that a try.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Anthony Latour
Rookie
Free Members
sp_UserOfflineSmall Offline
Aug 16, 2013 - 11:23 am

my hero! Thank you!

Thanks for your great work and really looking forward to that mobile theme.

Anthony

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Aug 16, 2013 - 12:16 pm

I guess that means it worked. That's good news - thanks for the update.

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625