Add age and location in topic view

Started by Rumpa, October 16, 2014, 09:43:06 AM

Previous topic - Next topic

Rumpa

Hi I write a mod for SMF 2.0.9 which is add age and location in topic view.

I attached file please some one tell me where I made wrong.

Branko.

 ...e.g. Modifications.english.php is reserved only for txt strings

Look for "how and where" in Join date and location in Posts and Personal Messages and location on post
Strong people don't put others down, they lift them up.
A clever person solves a problem. A wise person avoids it.

Rumpa

in load.php exactly which portion to edit


Branko.

#4
Quote from: Rumpa on October 16, 2014, 05:53:59 PM
in load.php exactly which portion to edit

Show Joined, Location, Username In Topic View

...also Administration Center>Features and Options>Custom Profile Fields>Add Profile Field> Create and configure it with Show on Topic View
Strong people don't put others down, they lift them up.
A clever person solves a problem. A wise person avoids it.

Rumpa

#5
In
$themedir/Display.template.php

search   
// Show avatars, images, etc.?

add after
//Show member age
if (!empty($modSettings['show_member_age_topic']) && !empty($message['member']['age']))
echo '<li class="postcount">', $txt['age'], ': ', $message['member']['age'], '</li>';




Is this code is correct?

Branko.

This code require settings in Modification Settings>Show member age topic and an array in ManageSettings.php
My opinion, put it after gender:
Find:
// Show the member's gender icon?
if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '' && !isset($context['disabled_fields']['gender']))
echo '
<li class="gender">', $txt['gender'], ': ', $message['member']['gender']['image'], '</li>';


Something like this:
// Show the member's gender icon?
if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '' && !isset($context['disabled_fields']['gender']))
echo '
<li class="gender">', $txt['gender'], ': ', $message['member']['gender']['image'], '</li>';

// Show the member age
if (isset($message['member']['age']))
echo '
<li>', $txt['age'], ': ', $message['member']['age'], '</li>';


The order will be as follows:
1.Avatar
2.Posts
3.Karma
4.Gender
5.Age
6.Location
7.Personal text
8.Messaging icons
...etc ...etc
Strong people don't put others down, they lift them up.
A clever person solves a problem. A wise person avoids it.

Rumpa

Thanks @Branko.

I have done.

I specify you to my mod.

Branko.

It's not necessary, it's just a little help for all the people who contribute to the popularity of the SMF.
I'm glad to hear that you finished your work, good luck.  :)
Strong people don't put others down, they lift them up.
A clever person solves a problem. A wise person avoids it.

Rumpa

Quote from: Branko. on October 20, 2014, 08:01:58 AM
It's not necessary, it's just a little help for all the people who contribute to the popularity of the SMF.
I'm glad to hear that you finished your work, good luck.  :)

Thanks for your help. 

Advertisement: