News:

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

Main Menu

Adding unread link

Started by DisturbedGoddess, August 21, 2011, 12:16:41 AM

Previous topic - Next topic

DisturbedGoddess

I installed a custom theme that does not have the

"Show unread posts since last visit."
Or
"Show new replies to your posts."

Is there a way i can add them myself?

This is the theme i am using
http://custom.simplemachines.org/themes/index.php?lemma=2204

Sir Osis of Liver


This is the code that lists the pm info, unread posts link, new replies link, and date/time.  Use the bits you need.



// Only tell them about their messages if they can read their messages!
//if ($context['allow_pm'])
//echo $txt['msg_alert_you_have'], ' <a href="', $scripturl, '?action=pm">', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt['msg_alert_messages'] : $txt['message_lowercase'], '</a>', $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'] , '.<br />';

echo '
<a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a><br />
<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />
', $context['current_time'],'<br />';
}


Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

DisturbedGoddess

Ahh thanks, what file do i put it in, and where exactly in the file?

Sir Osis of Liver


It goes in index.template.php.  Look for function template_body_above() - that's the header.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

DisturbedGoddess

okay obviously im not doing it right i keep getting this error

QuoteTemplate Parse Error!
There was a problem loading the /Themes/ERed_20rc3/index.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.

Sir Osis of Liver


Attach your index.template.php

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

DisturbedGoddess


Sir Osis of Liver


Ok, I put the entire userinfo block, including the header login, on the left side under the logo.  You can edit out what you don't need, and adjust the postioning with the top: and left: parameters.  This theme doesn't have a "userinfo" style in /css/index.css, but you can add it to format the block.

This is an RC3 theme, and you're running it in 2.0, so you can expect some problems.  I noticed a formatting glitch in admin, but everything seems to work. 

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

DisturbedGoddess

ahh cool thank you, So far it seems to be working fine :)

Advertisement: