News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

"Unread posts" and "New replies" in Profile?

Started by Dwev, January 23, 2018, 11:12:31 AM

Previous topic - Next topic

Dwev

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!

Aleksi "Lex" Kilpinen

#1
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.


<a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a>
<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a>
Slava
Ukraini!
"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

How you can help SMF

Dwev

I've added a screenshot of how it looks right now.

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


Aleksi "Lex" Kilpinen

What theme is that? :)

In Curve, I think you could do this

In profile.template.php

FIND

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

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


$txt['unread_since_profile'] = 'Unread topics';
$txt['show_unread_rep_profile'] = 'Unread replies';
Slava
Ukraini!
"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

How you can help SMF

Dwev

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:

syntax error, unexpected '/'

Would it help if I attached some of those files here?

Aleksi "Lex" Kilpinen

#5
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.
Slava
Ukraini!
"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

How you can help SMF

Dwev


Aleksi "Lex" Kilpinen

Thanks, it'll take about an hour or so before I'm back at the keyboard, but I'll get back to you. :)
Slava
Ukraini!
"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

How you can help SMF

Aleksi "Lex" Kilpinen

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:


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. :)
Slava
Ukraini!
"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

How you can help SMF

Dwev


Aleksi "Lex" Kilpinen

Slava
Ukraini!
"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

How you can help SMF

Advertisement: