Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Chas Large on February 07, 2010, 03:23:42 PM

Title: Show Members location on Members List
Post by: Chas Large on February 07, 2010, 03:23:42 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=2433)

Location on Memberslist SMF2.0

This mod adds a column to the members list to show the members location if they have
filled in that field in their profile.

History
v1.5 Updated for 2.0.1+
v1.4 Updated for 2.0
V1.3 Changes for SMF 2.0 RC3
V1.2 Corrections to Package file
V1.1 Corrections to installer
V1.0 Installed and tested on two forums

Please use the support link if required.

Regards

Chas Large
November 2011
Title: Re: Show Members location on Members List
Post by: sAce on February 10, 2010, 03:05:24 AM
http://custom.simplemachines.org/mods/index.php?mod=931 for 1.x users
Title: Re: Show Members location on Members List
Post by: Chas Large on March 08, 2010, 05:11:38 AM
That will be cool S-Ace, I don't write mods for 1.x.xx.
Chas
Title: Re: Show Members location on Members List
Post by: Snogmarr on March 15, 2010, 08:10:41 PM
The database value you're trying to insert does not exist: sort

I get this error?


errorlog

The database value you're trying to insert does not exist: sort
Function: MLAll
Title: Re: Show Members location on Members List
Post by: Chas Large on March 16, 2010, 02:45:36 AM
Quote from: xnathansxdadx on March 15, 2010, 08:10:41 PM
The database value you're trying to insert does not exist: sort

I get this error?


errorlog

The database value you're trying to insert does not exist: sort
Function: MLAll
Odd, the location is a standard SMF field. My mod does not add anything to the dB, it just displays what might already be there. I assume you have members with the location field filled in?
What version of SMF are you running?
Can you post your Memberlist.php and Memberlist.template.php files here so I can check the install?
Title: Re: Show Members location on Members List
Post by: Snogmarr on March 16, 2010, 05:03:23 AM
Thanks
Title: Re: Show Members location on Members List
Post by: Chas Large on March 18, 2010, 07:40:46 AM
The mod had not completely installed. From the changes in the code on your files compared to an original RC2 install, you have a mod which has prevented this mod from being installed correctly. I'm surprised you didn't get any "not found" errors when the parser tried to install the mod as the code it looks for is not there, it's been altered.

I've manually added the missing parts and tested the file but it seems these other mods which prevent it displaying correctly on my test forum however, it may display correctly on yours.

Please try the corrected files and let me know if it works. It may just be that your other mods prevent this from working correctly.
Title: Re: Show Members location on Members List
Post by: Snogmarr on March 18, 2010, 09:30:35 AM
 I get this?

It works and searches btw lol
Title: Re: Show Members location on Members List
Post by: Chas Large on March 18, 2010, 09:47:01 AM
Ah yes, I can see you have a mod that displays members as icons etc, my mod won't work with that without a lot of rework. Mind depends on showing just the normal vertical list.

It's best to ask the designer of your mod to add the location to each of the icon areas.

Please revert back to the original files and use the install instructions for my mod to remove the code manually.
Title: Re: Show Members location on Members List
Post by: Snogmarr on March 18, 2010, 10:17:50 AM
Wanna Bet?

NB:
How does a mod that does not affect the memberlist
Affect the memberlist as in the mod that displays icons?
Title: Re: Show Members location on Members List
Post by: Chas Large on March 18, 2010, 10:30:12 AM
Quote from: xnathansxdadx on March 18, 2010, 10:17:50 AM
Wanna Bet?

NB:
How does a mod that does not affect the memberlist
Affect the memberlist as in the mod that displays icons?
I'm sorry, I do not understand the question.

My mod only adds a column of existing information from the SMF database to the existing default vertical memberlist. It does not change the data or add the data to anything else.

You appear to have a mod that displays members as icons with the data in rows underneath each one. My mod was not designed to interface with that or any other mod. So If you've got it to work somehow then congratulations.
Title: Re: Show Members location on Members List
Post by: JimM on March 18, 2010, 08:41:17 PM
There are occasions where a mod that you have previously installed conflicts with the mod that you are trying to install.  This is obviously the case here.  Chas Large's mod adds edits that display the location on the standard memberlist.  You already have a mod installed to display the memberlist differently and that is the reason you are having difficulty with this mod. 
Title: Re: Show Members location on Members List
Post by: mike s on May 31, 2010, 12:36:16 PM
i was very happy to see this mod, but unfortunately, I have my location split into three separate Custom fields (city, province or state, country) and I have turned off the Location field. I was never happy with a single line format for location with no structure, but it is what it is.

Is there any way you would consider enhancing this mod to include custom fields as well?? I know there's another mod for that but its not updated for RC3. Thanks for reading this.

Mike.
Title: Re: Show Members location on Members List
Post by: Chas Large on June 01, 2010, 05:32:09 AM
Quote from: mike s on May 31, 2010, 12:36:16 PM
i was very happy to see this mod, but unfortunately, I have my location split into three separate Custom fields (city, province or state, country) and I have turned off the Location field. I was never happy with a single line format for location with no structure, but it is what it is.

Is there any way you would consider enhancing this mod to include custom fields as well?? I know there's another mod for that but its not updated for RC3. Thanks for reading this.

Mike.
That would depend on where the custom fields are located in the database. If they're part of the custom profile fields provided by SMF then it's probably possible. If they're provided by another mod then no. We're not allowed to produce a mod the relies on another mod already being installed.

If you can give me some more information about these fields, what their names are, how they're created then I could probably work out a manual edit for you to apply to your system.
Title: Re: Show Members location on Members List
Post by: mike s on June 02, 2010, 01:49:02 AM
yes, I just use the SMF provided custom fields to produce 3 fields called City, Province/State and Country.

having them separate makes it nicer for our board which relies on location a fair bit.

thanks, Much appreciated!
Title: Re: Show Members location on Members List
Post by: Chas Large on June 02, 2010, 02:58:37 AM
OK, give me a couple of days to do some work on this.
Title: Re: Show Members location on Members List
Post by: mike s on June 08, 2010, 09:46:05 AM
any luck??
Title: Re: Show Members location on Members List
Post by: Arantor on June 08, 2010, 10:43:26 AM
Unfortunately there's no particularly efficient way to do this since the values in the database are not only in another table, but in a format that's not overly efficient to add here. Doable but will add load to your server unless you have already limited the number of people who can view the memberlist (which, to be frank, isn't the most efficient thing to start with)
Title: Re: Show Members location on Members List
Post by: Chas Large on June 09, 2010, 03:05:21 AM
As Aranto said it's not a quick doable mod. I'm working on a possible SSI solution to this but it's giving me a bit of a headache at the moment. For now I'd have to say it's going to be quite a while. Just Notify yourself of changes to this topic so when I have something definite, I'll post it.
Title: Re: Show Members location on Members List
Post by: mike s on June 09, 2010, 11:02:34 AM
Thanks Chas... sorry I had no idea it was a major change to your mod. Perhaps thats why the other mod never got updated. Appreciate your time but dont do it unless its somethign that compels you. :)

regards, Mike.
Title: Re: Show Members location on Members List
Post by: nend on June 09, 2010, 11:11:58 AM
Might have to take a look at this. I did something similar with my 1.1.11 board. I plan to do the same with my 2.0 board. The memberlist is too plain. Can you do something similar to the attach image. If not no big deal, I did it for 1.1.11, I am sure I can do it for 2.0. ;)
Title: Re: Show Members location on Members List
Post by: Chas Large on June 09, 2010, 01:55:23 PM
@nend, there's already a mod that does this in 2.0. My mod is a very simple addition of data already in the dB to the original table.

@mike S, I love a challenge and will work on the addition of Custom Profile fields to the memberlist or indeed create another that lists them, there may not be much room in the original table, it's already a bit squashed.
Title: Re: Show Members location on Members List
Post by: mike s on June 09, 2010, 02:15:40 PM
thanks Chas.. for what its worth I do appreciate your efforts!
Title: Re: Show Members location on Members List
Post by: wickedgood on January 10, 2011, 05:08:59 PM
How can I add "location" to the member search area?

Its already in the admin area but nothing for regular members.

Title: Re: Show Members location on Members List
Post by: Chas Large on January 10, 2011, 05:36:44 PM
Quote from: wickedgood on January 10, 2011, 05:08:59 PM
How can I add "location" to the member search area?

Its already in the admin area but nothing for regular members.
You'll either need to find another mod that will add this option to the search page or hack the code to add it yourself. This mod will not do that for you, sorry.
Title: Re: Show Members location on Members List
Post by: wickedgood on January 11, 2011, 08:14:42 AM
Chas - Thanks for the great mod! :)

I realized the mod didn't modify the search after I installed it. Its a step in the right direction though.
Title: Re: Show Members location on Members List
Post by: nevsutt on October 31, 2012, 07:26:39 AM
I installed this mod but the location is listed in the Email column
Title: Re: Show Members location on Members List
Post by: Chas Large on October 31, 2012, 07:37:03 AM
Quote from: nevsutt on October 31, 2012, 07:26:39 AM
I installed this mod but the location is listed in the Email column
I suspect other mods have interfered with this installation. Try uninstalling the mod and reinstalling it manually.
Title: Re: Show Members location on Members List
Post by: nevsutt on October 31, 2012, 08:27:20 AM
Thanks But I did install it manually in 2.0.2
Title: Re: Show Members location on Members List
Post by: Chas Large on October 31, 2012, 08:40:28 AM
Just installed on a 2.0.2 forum using the default (Curve) theme and it installed OK, see the before and after screen shots attached.

Are you using the default theme? If not did the installer throw any errors for the theme you are using?
Title: Re: Show Members location on Members List
Post by: nevsutt on October 31, 2012, 08:45:30 AM
Theres an installer??
I did it manually
Title: Re: Show Members location on Members List
Post by: Chas Large on October 31, 2012, 09:02:45 AM
Yes, it's called the Package Manager.

Admin > Package Manager > Download Packages > Scroll to the bottom

Upload the zip file, click Install Mod and magic happens :)
Title: Re: Show Members location on Members List
Post by: nevsutt on October 31, 2012, 09:18:39 AM
Yep now wheres the zip file
Title: Re: Show Members location on Members List
Post by: FrizzleFried on October 31, 2012, 09:32:03 AM
Link to it on the first post...

...and it does work out of the box.  I just installed it 5 minutes ago.
Title: Re: Show Members location on Members List
Post by: nevsutt on October 31, 2012, 09:38:03 AM
Thanks but isnt that for 1.5  Im running 2.0.2
Title: Re: Show Members location on Members List
Post by: Chas Large on October 31, 2012, 10:12:33 AM
Quote from: nevsutt on October 31, 2012, 09:38:03 AM
Thanks but isnt that for 1.5  Im running 2.0.2
That 1.5 is the latest version of the mod. Under that the page shows:
Compatible With:
    2.0 RC2, 2.0 RC3, 2.0 RC4, 2.0, 2.0.1, 2.0.2
Title: Re: Show Members location on Members List
Post by: FrizzleFried on October 31, 2012, 10:22:22 AM
Again... I am running it out of the box with zero issues on default install (2.0.2)...
Title: Re: Show Members location on Members List
Post by: nevsutt on November 01, 2012, 08:02:32 AM
Thanks Guys I got it sorted after importing backup files
Title: Re: Show Members location on Members List
Post by: Chas Large on November 04, 2012, 06:08:54 AM
Quote from: nevsutt on November 01, 2012, 08:02:32 AM
Thanks Guys I got it sorted after importing backup files
Well done. :)
Title: Re: Show Members location on Members List
Post by: CheeseHead05 on July 18, 2013, 11:48:08 PM
For some odd reason, when I install this mod and go to see if it actually shows members' location on member list, it doesn't show up...any suggestions?
Title: Re: Show Members location on Members List
Post by: Chas Large on July 19, 2013, 03:09:43 AM
Quote from: CheeseHead05 on July 18, 2013, 11:48:08 PM
For some odd reason, when I install this mod and go to see if it actually shows members' location on member list, it doesn't show up...any suggestions?
Version of SMF? Do you see any errors during install? Does it display correctly using the default theme? Often these issues are theme related. Do you have any other mods that affect the members list?
Title: Re: Show Members location on Members List
Post by: Joey on March 06, 2014, 11:33:27 AM
FYI: with this mod installed on 2.0.7 if you do a search for members /index.php?action=mlist;sa=search
and check the box Search by position..... you come up with the error...

Database Error: Operand should contain 1 column(s)


SELECT COUNT(*)
FROM *******smf_members AS mem
LEFT JOIN nlgcomsmf_membergroups AS mg ON (mg.id_group = CASE WHEN mem.id_group = 0 THEN mem.id_post_group ELSE mem.id_group END)
WHERE (location, '' LIKE '%joey%' OR IFNULL(group_name, '') LIKE '%joey%')
AND mem.is_activated = 1
Apply Filter: Only show the errors from this file
File: ******************/Sources/Memberlist.php
Line: 527
 
if you uninstall the mod the search works ok any one have en idea whats going on ???



525:  AND mem.is_activated = {int:is_activated}',
526: $query_parameters
==>527: );
528: list ($numResults) = $smcFunc['db_fetch_row']($request);
529: $smcFunc['db_free_result']($request);
Title: Re: Show Members location on Members List
Post by: Chas Large on March 06, 2014, 04:11:10 PM
I can confirm an error occurs Joey, never tested that parameter before, however the error I get is:

Operand should contain 1 column(s)
File: /home/fiftyplu/public_html/forum/Sources/Memberlist.php
Line: 516

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 2.0.7, whilst your database is at version 2.0.1. The above error might possibly go away if you execute the latest version of upgrade.php.


I'll look into it but I doubt I'll be able to fix it as my mod merely added another column into the list and did nothing to the search function.
Title: Re: Show Members location on Members List
Post by: Chas Large on March 06, 2014, 04:17:37 PM
Ah, the error you see is in the error log, I see that too now.


http://www.fiftyplusforum.co.uk/forum/index.php?action=mlist;sa=search

Database Error: Operand should contain 1 column(s)

SELECT COUNT(*)
FROM smf_members AS mem
LEFT JOIN smf_membergroups AS mg ON (mg.id_group = CASE WHEN mem.id_group = 0 THEN mem.id_post_group ELSE mem.id_group END)
WHERE (member_name LIKE '%joey%' OR real_name LIKE '%joey%' OR location, '' LIKE '%joey%' OR IFNULL(group_name, '') LIKE '%joey%' OR email_address LIKE '%joey%')
AND mem.is_activated = 1

File: /home/fiftyplu/public_html/forum/Sources/Memberlist.php
Line: 516
Title: Re: Show Members location on Members List
Post by: Joey on March 06, 2014, 05:55:55 PM
Good deal hope you or some one can help find a fix it's a nice Mod... would hate to lose it.. Thanks Joey
Title: Re: Show Members location on Members List
Post by: Chas Large on March 07, 2014, 09:52:14 AM
Thanks Joey for spotting the bug. All fixed, version 1.6 tested with TWO installs on 2.0.7 and works perfectly. ;D
Title: Re: Show Members location on Members List
Post by: FrizzleFried on May 05, 2014, 02:34:09 PM
EDIT: My apologies... wrong topic.
Title: Re: Show Members location on Members List
Post by: margarett on May 05, 2014, 02:36:15 PM
Are you sure you posted in the correct topic? :P