Uutiset:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu
Advertisement:

Join date in postbit?

Aloittaja D.Rich99, heinäkuu 30, 2019, 03:32:47 IP

« edellinen - seuraava »

D.Rich99

How do I add join date to the postbit?

Thank you for any help.


D.Rich99

#2
Thank you, but I am not looking for a mod, I would like someone to teach me how to do it myself.

This way I can also make other edits to the postbit, such as controling the order in which information (such as postcount) is displayed.

Those mods you posted put join date under the avatar, I would like it after postcount.

Shambles

Wouldn't scrutinising those mods not give you a head start on techniques?

D.Rich99

You can probably tell from my postcount that I'm extremely new to SMF and I have no idea how to 'scrutinise' a mod.

Could someone at least tell me which template I need to edit and how to call the join date?

Thank you.

Shambles

Download one or more of those mods, unzip it/them and look at the code changes proposed within.

The unzipped files are just text files - have a browse of them :)

Sir Osis of Liver

It's in Display.template.php, look for 'poster'.  But you have to add 'registered_date' to the correct array, that takes a bit of doing.
When in Emor, do as the Snamors.
                              - D. Lister

Arantor

Which is why you look at the mods and the code in them to see how they do it.

This is how I started writing mods and I wrote a few...
Holder of controversial views, all of which my own.


D.Rich99

What I did was install one of those mods and then look at display.template.php.

I found the following;
// Show the join date in post
if (!empty($modSettings['show_join_date_post']) && !empty($message['member']['joined']))
echo '
       <li class="date_registered">', $txt['date_registered'], ': ', $message['member']['joined'], '</li>';

I copy/pasted it to to under the postcount part, and now it appears as I wanted it.

Good job there were existing compatible mods though, because without that code I'd literally have no idea what to do.

Shambles


Advertisement: