Advertisement:

Author Topic: If Location is Present this Mod Will Display it!  (Read 21285 times)

Offline augrunt

  • Semi-Newbie
  • *
  • Posts: 19
If Location is Present this Mod Will Display it!
« on: February 06, 2006, 04:53:49 AM »
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

Code: [Select]
//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
Code: [Select]
// Show online and offline buttons?
and Above
Code: [Select]
// Show the member's gender icon?

Offline Dannii

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,211
  • Mind the volcano!
    • My homepage
Re: If Location is Present this Mod Will Display it!
« Reply #1 on: February 06, 2006, 05:42:39 AM »
Code: [Select]
<i />What is that foward slash doing there?
"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."

Offline augrunt

  • Semi-Newbie
  • *
  • Posts: 19
Re: If Location is Present this Mod Will Display it!
« Reply #2 on: February 06, 2006, 05:44:44 AM »
Code: [Select]
<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.

Offline DrDom

  • Semi-Newbie
  • *
  • Posts: 53
Re: If Location is Present this Mod Will Display it!
« Reply #3 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.

 

Offline augrunt

  • Semi-Newbie
  • *
  • Posts: 19
Re: If Location is Present this Mod Will Display it!
« Reply #4 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...

Offline DrDom

  • Semi-Newbie
  • *
  • Posts: 53
Re: If Location is Present this Mod Will Display it!
« Reply #5 on: February 06, 2006, 03:46:12 PM »
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.
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.

Offline mynameisjonas

  • Newbie
  • *
  • Posts: 4
Re: If Location is Present this Mod Will Display it!
« Reply #6 on: May 23, 2007, 11:18:43 AM »
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?