Advertisement:

Author Topic: "Unread posts" and "New replies" in Profile?  (Read 955 times)

Offline Dwev

  • Jr. Member
  • **
  • Posts: 218
"Unread posts" and "New replies" in Profile?
« on: January 23, 2018, 11:12:31 AM »
In the theme we're using there are no links to "Unread posts" and "New replies" in the header.

So I would like to add them to /profile

Would anybody be able (and be so kind) to tell me how I can achieve this?

Any help is very much appreciated!

Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 18,187
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • LexArma on GitHub
    • aleksi-kilpinen on LinkedIn
    • There's No Place Like 127.0.0.1
Re: "Unread posts" and "New replies" in Profile?
« Reply #1 on: January 23, 2018, 11:25:55 AM »
Where in the profile? Perhaps show a screencap of the desired location?
The links in themselves are easy.

Basically add these links where you want them.

Code: [Select]
<a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a>
<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a>
« Last Edit: January 23, 2018, 11:47:55 AM by Aleksi "Lex" Kilpinen »
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.

How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Offline Dwev

  • Jr. Member
  • **
  • Posts: 218
Re: "Unread posts" and "New replies" in Profile?
« Reply #2 on: January 23, 2018, 11:59:31 AM »
I've added a screenshot of how it looks right now.

I think between Show Posts and Show Stats would be perfect.


Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 18,187
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • LexArma on GitHub
    • aleksi-kilpinen on LinkedIn
    • There's No Place Like 127.0.0.1
Re: "Unread posts" and "New replies" in Profile?
« Reply #3 on: January 23, 2018, 12:02:51 PM »
What theme is that? :)

In Curve, I think you could do this

In profile.template.php

FIND
Code: [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>';

REPLACE WITH
Code: [Select]
echo '
<a href="', $scripturl, '?action=profile;area=showposts;u=', $context['id_member'], '">', $txt['showPosts'], '</a><br />
<a href="', $scripturl, '?action=unread">', $txt['unread_since_profile'], '</a><br />
<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_rep_profile], '</a><br />
<a href="', $scripturl, '?action=profile;area=statistics;u=', $context['id_member'], '">', $txt['statPanel'], '</a>
</p>';

Then add to modifications.english.php

Code: [Select]
$txt['unread_since_profile'] = 'Unread topics';
$txt['show_unread_rep_profile'] = 'Unread replies';
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.

How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Offline Dwev

  • Jr. Member
  • **
  • Posts: 218
Re: "Unread posts" and "New replies" in Profile?
« Reply #4 on: January 23, 2018, 05:16:16 PM »
The theme is our own, based on bootstrap (can be seen in action here).

I put your first code in Profile.template.php of Themes/default/ and the second bit of code in Themes/default/languages/Modifications.english-utf8.php.

But both "unread_since_profile" and "show_unread_rep_profile" show as black (instead of the normal red) in the editor and the site throws the following error when I try to open the Profile-page:

Code: [Select]
syntax error, unexpected '/'
Would it help if I attached some of those files here?

Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 18,187
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • LexArma on GitHub
    • aleksi-kilpinen on LinkedIn
    • There's No Place Like 127.0.0.1
Re: "Unread posts" and "New replies" in Profile?
« Reply #5 on: January 23, 2018, 10:15:18 PM »
I could look at them, specifically both of the mentioned files - They should be correct,
and I did try those codes on the original files and didn't notice anything off.
« Last Edit: January 23, 2018, 10:38:56 PM by Aleksi "Lex" Kilpinen »
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.

How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Offline Dwev

  • Jr. Member
  • **
  • Posts: 218
Re: "Unread posts" and "New replies" in Profile?
« Reply #6 on: January 24, 2018, 02:42:06 AM »
Both included with this post.

Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 18,187
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • LexArma on GitHub
    • aleksi-kilpinen on LinkedIn
    • There's No Place Like 127.0.0.1
Re: "Unread posts" and "New replies" in Profile?
« Reply #7 on: January 24, 2018, 03:06:37 AM »
Thanks, it'll take about an hour or so before I'm back at the keyboard, but I'll get back to you. :)
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.

How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 18,187
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • LexArma on GitHub
    • aleksi-kilpinen on LinkedIn
    • There's No Place Like 127.0.0.1
Re: "Unread posts" and "New replies" in Profile?
« Reply #8 on: January 24, 2018, 05:28:51 AM »
I'm so sorry, I made a typo in my original code here. I left out one small '

The edit to profile.template should be this:

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

Your modifications.english-utf8 seems fine to me. :)
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.

How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Offline Dwev

  • Jr. Member
  • **
  • Posts: 218
Re: "Unread posts" and "New replies" in Profile?
« Reply #9 on: January 24, 2018, 07:37:38 AM »
Yes, that did the job!

You're my hero!!!   ;D ;D ;D

Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 18,187
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • LexArma on GitHub
    • aleksi-kilpinen on LinkedIn
    • There's No Place Like 127.0.0.1
Re: "Unread posts" and "New replies" in Profile?
« Reply #10 on: January 24, 2018, 07:38:16 AM »
You are welcome :)
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.

How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas