Advertisement:

Coding for Features (Location, Website) HELP!

Aloittaja augrunt, helmikuu 06, 2006, 03:46:17 AP

« edellinen - seuraava »

augrunt

While Asking For Help I Decided To Post My "Edit" of the Location: Code.
There is still something missing and i cant find the answer or where to place it but here goes.


This is the Code I'm using... For Example Purposes... I'll show you how it displays, feel free to play with it, it resembles exactly how vBulletin displays it.
echo $txt[227], ': ', '<i />', $context['member']['location'], $message['member']['location'], '</i><br /><br />';

It appears like this.......                 Location: Somewhere in Antartica
Also thanks to where u put it, it displays above the avatar and causes a break...

Place it above
// Show the member's gender icon?

This is all found in the *Your Theme/Display.template.php

Now I've found out that because the code doesn't specify what to do if theres no record in Location the only fix is to make Location Field MANDATORY... now we all know people r gonna start putting fake countries to start by passing it, and it's fine... no one wants to let anyone know where they are sometimes.

But if we study the Gender Code... it works differently, if theres NO Gender specified it doesn't display the text.

                         // Show the member's gender icon?
                        if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '')
                                echo '
                                                                ', $txt[231], ': ', $message['member']['gender']['image'], '<br />';


This piece of code is the answer, i cant figure it out on how to put it with the other code.
if (!empty($settings['show_gender'])

Lend me some help

augrunt

okay i've come up with a solution...

if someone can find the correct location... i mean the correct "area" that the settings r in, instead of [show_location] <--- because that probably isnt it... we can fix this.

if (!empty($settings['location']) && $message['member']['location'] != '')
                                echo '
                                                                ', $txt[227], ': ', $message['member']['location'],


So far it doesnt display anything, but if it works it should dynamically place Location When and IF the user decides to place his Location.

Systematically since its a tiny bit easier, ill be working on having it set to Location: N/A in the mean time...


Advertisement: