News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

How to display user location under avatars

Started by MOCA CPU, August 20, 2012, 09:27:03 PM

Previous topic - Next topic

MOCA CPU

Hi all, new here

Running version 2.0.2

I was under the impression that there was a setting in 2.0.2 that allows the admin to set yes or no to display a users location under his or her avatar.  For the life of me I cannot find it. 

Can someone please point me in the right direction, or have I been misinformed?

Any assistance greatly appreciated


Texan78

There is one in in your Admin CP > Features and Options >Profile Fields to activate if you want to allow members to enter their location.

If the member chooses to enter their location then it will show by default.

If a member leaves it blank then no location will show.


MOCA CPU

Quote from: Texan78 on August 20, 2012, 11:33:44 PM
There is one in in your Admin CP > Features and Options >Profile Fields to activate if you want to allow members to enter their location.

If the member chooses to enter their location then it will show by default.

If a member leaves it blank then no location will show.

Thanks, but when I go to Features and options I only get:

General - Layout - Signatures

No Profile Fields?

Matthew K.

You may have to activate "Advanced Profile Fields" under Admin -> Configuration -> Core Features

MOCA CPU

Quote from: Labradoodle-360 on August 21, 2012, 12:30:59 AM
You may have to activate "Advanced Profile Fields" under Admin -> Configuration -> Core Features

Really appreciate your assistance.  Thank you

Ok, have done that.

So now they can enter their location etc but when they do I thought that their location would now show up under their avatar on any posts they make but it does not.  It only shows their location if you click on their profile.  Can I get the location to show up under their avatars on their posts?

Bigguy

Clicking "Show on Topic View:" Should do it for you. :)

MOCA CPU

Quote from: Bigguy on August 21, 2012, 01:24:29 AM
Clicking "Show on Topic View:" Should do it for you. :)

Showing my ignorance here where is that?  Sorry to be such a pain

Edit:  Ok I see where you can set that when making a new custom field but how can you edit the existing standard profile fields?

Bigguy

Not sure what file that would be in but it would require a code change.

hcfwesker

Quote from: moca on August 21, 2012, 01:29:09 AMOk I see where you can set that when making a new custom field but how can you edit the existing standard profile fields?

first you need to explain what you want to edit.  Unless you mean you want to edit the field you already created to make it show on topic view.  When viewing the list of your created profile fields, there should be a "Modify" link all the way to the right.

Bigguy

He wanted to edit the existing profile field about location so it shows under the avatar in each post. What I said was just create a new one and set it up that way. Untick the one that is there by default and your all set to go.

hcfwesker


Bigguy

That would probably do as well, thank you. :)

MOCA CPU

Quote from: Bigguy on August 21, 2012, 06:27:52 PM
He wanted to edit the existing profile field about location so it shows under the avatar in each post. What I said was just create a new one and set it up that way. Untick the one that is there by default and your all set to go.

Thanks.

This sounds like the easier option.  I'll go with that.  Saves adding a mod.

Many Thanks Guys

Bigguy


ModelBoatMayhem

I've install Age and location Mod but nothing displays?!?!?
Any ideas please?

That's my firm opinion.... but what do I know?!

floridaflatlander

I put


/// Show location
if (!empty ($message['member']['location']))
echo '
<li>', $txt['location'], ':  <b>', $message['member']['location'], '</b></li>';


under

// Show avatars, images, etc.?
if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
echo '
<li class="avatar">
<a href="', $scripturl, '?action=profile;u=', $message['member']['id'], '">
', $message['member']['avatar']['image'], '
</a>
</li>';

on the default Display.template.php, I found this some where on here

ModelBoatMayhem

Thanks for that FFL but it hasn't worked.

I've edited the file and rebooted the server but still nothing..... anything else i should have done?

( code included in case I've done it wrong! )



// Show avatars, images, etc.?
            if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) &&

!empty($message['member']['avatar']['image']))
                echo '
                                <li class="avatar">
                                    <a href="', $scripturl, '?action=profile;u=',

$message['member']['id'], '">
                                        ', $message['member']['avatar']['image'], '
                                    </a>
                                </li>';

             // Show location
if (!empty ($message['member']['location']))
echo '
<li>', $txt['location'], ':  <b>', $message['member']['location'], '</b></li>';

            // Show how many posts they have made.
            if (!isset($context['disabled_fields']['posts']))
                echo '
                                <li class="postcount">', $txt['member_postcount'], ': ',

$message['member']['posts'], '</li>';
That's my firm opinion.... but what do I know?!

floridaflatlander

Quote from: ModelBoatMayhem on October 29, 2012, 07:27:42 AM
Thanks for that FFL but it hasn't worked.




// Show location
if (!empty ($message['member']['location']))
echo '
<li>', $txt['location'], ':  <b>', $message['member']['location'], '</b></li>';


I hate to ask this do you have a location entered in your user profile?

It's been a long since I did this, but is this the location that smf ask if you want to display in admin > features/options > Profile fields or is this a custom field you created?

Also as a note I added the <b> and </b> above.


ModelBoatMayhem

#18

No "Custom Profile Fields",  I just want to display "Location" from "Standard Profile Fields".

It displayed OK previously with 1x  but not after the upgrade to 2.0.2 last week....
( Edited in new code  )
That's my firm opinion.... but what do I know?!

floridaflatlander

and you added the above code in the php file "themes/default/Display.template.php" ?

Advertisement: