Show posts / show topics (threads) in profile

Started by Alex_Hypnose, June 28, 2018, 04:13:14 AM

Previous topic - Next topic

Alex_Hypnose

Hi,

For SMF 2.0.15 and using a custom theme - Flexive, I would like to implement a few changes in the Profile display template.

Under the Show Posts, it would be nice to have a Show threads / topics
So I would like to add a shortcut that links to forum/profile/?area=showposts;sa=topics;u=1 (unique for each user)

If also possible to switch the view from topic subject + content or just show the topic subject, it would be great!

Thanks!

Kindred

the first one is easy.   Look at how the link is made for the show topics link within the show posts section.

the second is easy, but not recommended. it actually defeats the very purpose of the list.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

Not so easy, that second item, given how show posts and show topics use the same template.

Kindred

hmmm...   ok, that does make it more difficult that I first thought

(incidentally, the reason I didn't tell you (the OP) exactly where is because I am on a mobile device and don't have easy access to the code at my fingertips)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

The first one is a relatively trivial edit to Profile.template.php probably in Themes/default/

Code (find) Select

echo '
<a href="', $scripturl, '?action=profile;area=showposts;u=', $context['id_member'], '">', $txt['showPosts'], '</a><br />
<a href="', $scripturl, '?action=profile;area=statistics;u=', $context['id_member'], '">', $txt['statPanel'], '</a>
</p>';


Code (replace) Select

echo '
<a href="', $scripturl, '?action=profile;area=showposts;u=', $context['id_member'], '">', $txt['showPosts'], '</a><br />
<a href="', $scripturl, '?action=profile;area=showposts;sa=topics;u=', $context['id_member'], '">', $txt['showTopics'], '</a><br />
<a href="', $scripturl, '?action=profile;area=statistics;u=', $context['id_member'], '">', $txt['statPanel'], '</a>
</p>';

Alex_Hypnose

You guys rock!

I made the edit in Themes/default/Profile.template.php and it shows "Topics" for now. Do I need to modify anything else to make it "Show Topics" or "Show threads"?

Thaaaanks!

Kindred

nothing in SMF is called "a thread" in the default languages... they are called topics.
If you want to change that, you would have to change the text strings in the language file(s)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

br360

Quote from: Alex_Hypnose on June 28, 2018, 03:37:32 PM
You guys rock!

I made the edit in Themes/default/Profile.template.php and it shows "Topics" for now. Do I need to modify anything else to make it "Show Topics" or "Show threads"?

Thaaaanks!

In your languages/Profile.english.php

Find:
$txt['showTopics'] = 'Topics';

Change that to
$txt['showTopics'] = 'Show Topics';

Alex_Hypnose

Many thanks. If someone has an idea in how to implement the switch the view from topic subject + content or just show the topic subject, please let me know. Great community!

Advertisement: