If Location is Present this Mod Will Display it!

Started by augrunt, February 06, 2006, 04:53:49 AM

Previous topic - Next topic

augrunt

Yep, I've just perfected the code. This code will give you the ability to display you're members locations.

I've made it because i've recently set my Location to "Required".

So i had to think of a way to clean the mess off my board... all the Location: were starting to get to me. So i figured out what the code was... how it worked with the others and i came up with this


//augrunt's modifications... If the Location has been Entered in by a Member, If not it'll be blank. This took a while to figure out, enjoy!
if (!isset($message['location']) && $message['member']['location'] != '')
                                echo '
                                                                ', $txt[227], ': ', '<i />', $message['member']['location'], '</i><br /><br />';


Note: I added that //augrunt so it can explain to u how it works, please don't remove it, i love checking site's code to see if there using 1 of my modifications, i only recently moved to PHP.

Instructions:

This code goes in "your-theme/display.template.php"

Below
// Show online and offline buttons?

and Above
// Show the member's gender icon?

Dannii

"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

augrunt

Quote from: eldacar on February 06, 2006, 05:42:39 AM
<i />
What is that foward slash doing there?

Trust me its best to keep it like that, its how all the other code is written... i think if u do it like <i> it likes this it causes a database error. and my motto is, if it works like that dont touch it.

DrDom

This has been covered a few times in the last couple of years, I'm sure you would have found it using the search function.
Never the less, you have now posted it for others to see and use, which has to be a good thing.


augrunt

no it hasnt... this code hides the location if it isnt present... the other one displays *Location:* if nothing was there... belive me i looked i only code something if its unique...

DrDom

Quote from: DrDom on February 06, 2006, 09:36:18 AM
This has been covered a few times in the last couple of years, I'm sure you would have found it using the search function.
Never the less, you have now posted it for others to see and use, which has to be a good thing.
Quote from: augrunt on February 06, 2006, 10:32:23 AM
no it hasnt... this code hides the location if it isnt present... the other one displays *Location:* if nothing was there... belive me i looked i only code something if its unique...

Link 1 October 17 2004
Link 2 May 23 2005
I couldnt be bothered to look for more, but i feel confident there will be.

mynameisjonas

thanks for this mod! it's exactly what i need.
just one question though, can you get it to just display the actual location, without "Location:" before?

Advertisement: