SimplePortal

Customization => Custom Coding => Topic started by: Kosedragen on October 03, 2008, 06:54:24 PM

Title: "Show unread since last visit" in User block?
Post by: Kosedragen on October 03, 2008, 06:54:24 PM
Hello. I'm kind of new to SimplePortal, and I have used it for just this one day. However, I was wondering wether it was possible to put "show unread posts since last visit" under the user block. Like on the picture here:
(http://i161.photobucket.com/albums/t226/Kosedragen/ulesteposter.png)

Bruker = User.
Vis uleste poster = show unread posts.

... Or maybe the same, but with unread topics instead?

It's Norwegian :3

Thanks for any response :D

Realized this post fits better here.
Title: Re: "Show unread since last visit" in User block?
Post by: Nathaniel on October 03, 2008, 08:03:31 PM
Find this code ('SPortal.php'):
Code: [Select]
if (!$context['user']['is_guest'])
echo '<div align="center"><img src="' . $settings['images_url'] . '/arrow.gif" alt="Arrow" /> <a href="'.$scripturl.'?action=profile">', $txt['sp-userprofile'], '</a>&nbsp;&nbsp;&nbsp;<img src="' . $settings['images_url'] . '/arrow.gif" alt="Arrow" /> <a href="', $scripturl, '?action=logout;sesc=', $sc, '">', $txt['sp-userlogout'], '</a></div>';

Replace with this code:
Code: [Select]
if (!$context['user']['is_guest'])
{
echo '<a href="', $scripurl, '?action=unread">Vis uleste poster</a><br />
<div align="center"><img src="' . $settings['images_url'] . '/arrow.gif" alt="Arrow" /> <a href="'.$scripturl.'?action=profile">', $txt['sp-userprofile'], '</a>&nbsp;&nbsp;&nbsp;<img src="' . $settings['images_url'] . '/arrow.gif" alt="Arrow" /> <a href="', $scripturl, '?action=logout;sesc=', $sc, '">', $txt['sp-userlogout'], '</a></div>';
}
Title: Re: "Show unread since last visit" in User block?
Post by: Kosedragen on October 04, 2008, 06:37:58 AM
Thank you :D But doesn't that mean I'll have to reinstall SP? Does it remember my settings or would I have to save them somewhere?
Title: Re: "Show unread since last visit" in User block?
Post by: Nathaniel on October 04, 2008, 06:38:52 AM
No, you can change that code in the file that it running on your website. You don't need to reinstall SP.
Title: Re: "Show unread since last visit" in User block?
Post by: Kosedragen on October 04, 2008, 06:48:50 AM
Really? I know I can view the file, but I have never seen somewhere I could edit it..? (I'm still kind of newbish xp)

EDIT: Right, I just found the options making me able to turn the files writeable, but I have no idea what to write in the message that pops up when I try to save the settings.

EDIT2: Nevermind this. The code worked perfectly, my host told me how to do it : D Thank you so much!
But I'd like to make it have those dots too, like it was on the same list with "New messages" and those. Is that hard to do?

EDIT3: I found out it was too hard for me atleast ^^ Can I bother you with this trifle?
Title: Re: "Show unread since last visit" in User block?
Post by: ccbtimewiz on October 05, 2008, 07:21:01 PM
Attach SPortal.php
Title: Re: "Show unread since last visit" in User block?
Post by: Kosedragen on October 06, 2008, 06:20:01 AM
Will do.. If only I could. It tells me I'm not allowed to upload php-files even though I've seen people upload thousands of php-files.

EDIT: Pssh, did the simplest thing available right now; uploaded it as .txt
Title: Re: "Show unread since last visit" in User block?
Post by: ???1031 on October 06, 2008, 07:04:12 AM
Stange I don't know why it is not allowed to upload php files...

Bye
DIN1031
Title: Re: "Show unread since last visit" in User block?
Post by: Kosedragen on October 06, 2008, 07:16:29 AM
Yeah, I found it strange too. But the .txt-file will do just fine, wont it?

EDIT: Just search for the phrase "vis nye poster" and you'll find the code LHVWB gave me :3
Title: Re: "Show unread since last visit" in User block?
Post by: ???1031 on October 06, 2008, 08:09:34 AM
So this is a version with the dot in it ;)

(attached to this post)

Bye
DIN1031
Title: Re: "Show unread since last visit" in User block?
Post by: Kosedragen on October 06, 2008, 08:19:23 AM
No, it's the one without >< But I would LIKE the dot in that version. In order to make it look like it is listed with the other stats under user. Now it just looks like a random link thrown up in the block >:
Title: Re: "Show unread since last visit" in User block?
Post by: ???1031 on October 06, 2008, 10:47:48 AM
No i attached the version with the dot in it xD

Bye
DIN1031
Title: Re: "Show unread since last visit" in User block?
Post by: Kosedragen on October 06, 2008, 12:30:41 PM
Oh I didn't notice xD Thanks mate!

EDIT: Ouch, close but no sigar >: I meant on the list under "new messages". Look at the attachment ^^; And you used the arrow instead of dot x3
Title: Re: "Show unread since last visit" in User block?
Post by: ???1031 on October 06, 2008, 02:08:36 PM
Now i think it's okay :).

(attached the updated version) ;)

Bye
DIN1031
Title: Re: "Show unread since last visit" in User block?
Post by: Kosedragen on October 06, 2008, 02:13:43 PM
PERFECT! : D Problem solved, thank you very much.
SimplePortal 2.3.8 © 2008-2024, SimplePortal