TinyPortal

Development => Support => Topic started by: keith021773 on September 14, 2007, 02:40:08 AM

Title: How to edit User Block?
Post by: keith021773 on September 14, 2007, 02:40:08 AM
Hello everyone..    Quick question coming at you..   I hope this is the right board, if not, please move it for me..   Thanks!

I would like to have 2 sets of "Show Unread Posts" in my user block.  One for all of the unread posts except for one board and the other Unread posts for one board.   I have found out how to do that but I don't know how to edit the user block for tinyportal to do it..

What file would that block be in for me to edit?   Hopefully, if you tell me the file I can figure out the rest..   Hopefully....    LOL
Title: Re: How to edit User Block?
Post by: Max on September 14, 2007, 02:58:24 AM

The file is located in your default directory...

Default/TPortalBlocks.temp search for "// Tportal userbox"  a few lines down is the code your looking for ;)

if(isset($context['TPortal']['userbox']['unread'])){
echo '<br />'.$bullet.'<a href="', $scripturl, '?action=unread">' .$txt['tp-unread'].'</a>
<br />'.$bullet.'<a href="', $scripturl, '?action=unreadreplies">'.$txt['tp-replies'].'</a>
<br />'.$bullet.'<a href="', $scripturl, '?action=profile;u='.$context['user']['id'].';sa=showPosts">'.$txt['tp-showownposts'].'</a>';
}


Title: Re: How to edit User Block?
Post by: keith021773 on September 14, 2007, 05:18:11 AM
Thanks all...     With the code that you gave me above.    How can I change it to this...

For:

Show unread posts     (http://www.daddyplace.com/index.php?action=unread;c=1,8,2,6)

Show unread Gaming Posts    (http://www.daddyplace.com/index.php?action=unread;c=3)

I'm using catagories instead of boards..

And everything else in the User block staying the same.

First off..  Will this work?    I am hopeing that it will, it will make things SO much easier on my members who aren't gamers..
Title: Re: How to edit User Block?
Post by: IchBin on September 14, 2007, 05:42:07 AM
Take a look at the code Keith. You can add your necessary text to the end of the links.
Title: Re: How to edit User Block?
Post by: keith021773 on September 14, 2007, 02:47:18 PM
Ok..  I got the code in and it works..   But I would like to change the wording of it from Show unread posts to Show unread gaming posts.     I don't see where to put that in?

Here is the code I have..


if(isset($context['TPortal']['userbox']['unread'])){
echo '<br />'.$bullet.'<a href="', $scripturl, '?action=unread;c=1,8,2,6">' .$txt['tp-unread'].'</a>
                                <br />'.$bullet.'<a href="', $scripturl, '?action=unread;c=3">' .$txt['tp-unread'].'</a>
<br />'.$bullet.'<a href="', $scripturl, '?action=unreadreplies">'.$txt['tp-replies'].'</a>
<br />'.$bullet.'<a href="', $scripturl, '?action=profile;u='.$context['user']['id'].';sa=showPosts">'.$txt['tp-showownposts'].'</a>';



For the first one I would like it to say.       Show New Posts
For the second one I would like it to say    Show New Gaming Posts

And the rest is fine..    Thanks again all!!!
Title: Re: How to edit User Block?
Post by: IchBin on September 14, 2007, 03:26:53 PM
I'm not sure which file, but its in one of the TP language files. Check the Themes/default/TPortalindex.english.php file for the txt strings. Once you find the lines you can just change what they mean.

$txt['tp-unread']
Title: Re: How to edit User Block?
Post by: keith021773 on September 14, 2007, 03:48:36 PM
Your right IchBin and Thank you very much again, my friend!

In addition to the $txt['tp-unread'] I also made one called $txt['tp-unreadgaming'] for the New Gaming Posts I was talking about..

Thanks again all..   Problem solved and moving on to the next one that pops up.    LOL

You guys rock!