News:

Wondering if this will always be free?  See why free is better.

Main Menu

Location and age not seen on SMF 1.1.1

Started by harunyam, December 23, 2006, 07:52:57 PM

Previous topic - Next topic

greyknight17

If you still have problems doing this, attach /Themes/babylon/Display.template.php here in your next reply.

kreativekarma

Hey guys! I am putting in a request to update this mod for the new 2.0 beta 3. :)

Rumbaar

Well Location is already able to be included, and the code behind the inclusion of age I'm sure is quite easy to add to the Display.template.php file.  But I feel that should be included in the option field anyways with SMF 2.* without a mod.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

goaskanna

#23
Would this mod work with 1.1.5? Also, would it be easy to take out the age and just have the location?

Thanks

Anna

EDIT: Found the fix for removing the age and it works on 1.1.5 :D

kreativekarma

I know I asked before and I know you said that I could modify the Display.template.php file but I have no clue what I am doing. So if someone would help, I would really appreciate it. My people are crying for age/location to be displayed in the beta.

Rumbaar

#25
Okay, updated to SMF 2.x 3.1 Public.  It's easy, use a decent text editor like Notepad++.
Load.php
Find:
'local_time' => timeformat(time() + ($profile['time_offset'] - $user_info['time_offset']) * 3600, false),
);

Add after:
// Set the age...
   if (!empty($profile['birthdate']) && $profile['birthdate'] !== '0001-01-01') {
      list ($birth_year, $birth_month, $birth_day) = sscanf($profile['birthdate'], '%d-%d-%d');
$datearray = getdate(forum_time());
$memberContext[$user] += array(
'age' => $birth_year <= 4 ? $txt['not_applicable'] : $datearray['year'] - $birth_year - (($datearray['mon'] > $birth_month || ($datearray['mon'] == $birth_month && $datearray['mday'] >= $birth_day)) ? 0 : 1),
'today_is_birthday' => $datearray['mon'] == $birth_month && $datearray['mday'] == $birth_day
);
}


In display.template.php file (where you want it to display)
Add anywhere to the file first:
loadLanguage('Profile');
Add for DOB:
// Show the member's birthday
if ($message['member']['birth_date'] != '')
echo '
', $txt['dob'], ': ', $message['member']['birth_date'], '<br />';

Add for location:
// Show the member's location
if ($message['member']['location'] != '')
echo '
', $txt['location'], ': ', $message['member']['location'], '<br />';

Add for age:
// Show the member's age
if (isset($message['member']['age']))
echo '
', $txt['age'], ': ', $message['member']['age'], '<br />';
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

kreativekarma


Rumbaar

A mistype, but as per the original post by Daniel15 it is Sources/Load.php.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

toothmkr57

I can't seem to get this to work on 1.1.11  I even tried the manual edit... what could I be doing wrong?

Rumbaar

What piece of code did you use in this thread?

These instructions for a manual edit should work in a 1.1.x version of SMF:
http://custom.simplemachines.org/mods/index.php?action=parse;mod=638;attach=28409;smf_version=1.1.11
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

toothmkr57

I specifically wanted the location added in, so I used this
// Show the member's location
if ($message['member']['location'] != '')
echo '
', $txt[227], ': ', $message['member']['location'], '<br />';


Rumbaar

What isn't working?  Have you added the $txt[] strings?

But the mod seems compatible with 1.1.11, so you weren't able to use the mod package?
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

toothmkr57

no i haven't added any strings.  I am a noob at this.. and yes i applied the mod as is, first and it didn't do anything.

Rumbaar

Didn't do anything, even on the default theme?  If you are using a custom theme, you will have to make sure you add to that theme's applicable template file.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

toothmkr57


Rumbaar

and there were no errors when you installed it onto a 1.1.11 forum?
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

toothmkr57


Advertisement: