SimplePortal

Customization => Custom Coding => Topic started by: xxwckdxx on December 03, 2008, 12:52:40 AM

Title: Add something to the user information block(solved)
Post by: xxwckdxx on December 03, 2008, 12:52:40 AM
i see the code for how many unread messages but is there a way to make it so if the value is one or more it will display the "new" image next to it? to make it more noticable?

Code: [Select]
if(allowedTo('pm_read'))
echo '
<img src="' . $settings['images_url'] . '/dot.gif" alt="', $txt['sp-dot'], '" /> ', $txt['sp-usertmessage'], ': <a href="' . $scripturl . '?action=pm">' . $context['user']['messages'], '</a><br />
<img src="' . $settings['images_url'] . '/dot.gif" alt="', $txt['sp-dot'], '" /> ', $txt['sp-usernmessage'], ': ' . $context['user']['unread_messages'], '<br /><br />'

thats the code i have copied from the source
Title: Re: Add something to the user information block(solved)
Post by: xxwckdxx on December 03, 2008, 11:31:06 PM
figured it out myself
Title: Re: Add something to the user information block(solved)
Post by: [SiNaN] on December 04, 2008, 07:16:25 AM
Glad that you could get it solved. Would be good if you can share your solution, as other may need this in the future.
Title: Re: Add something to the user information block(solved)
Post by: xxwckdxx on December 04, 2008, 10:43:57 AM
this is what i changed the code to and i uploaded the gif image i made to the root directory

Code: [Select]
if(allowedTo('pm_read'))
echo '
<img src="' . $settings['images_url'] . '/dot.gif" alt="', $txt['sp-dot'], '" /> ', $txt['sp-usertmessage'], ': <a href="' . $scripturl . '?action=pm">' . $context['user']['messages'], '</a><br />
<img src="' . $settings['images_url'] . '/dot.gif" alt="', $txt['sp-dot'], '" /> ', $txt['sp-usernmessage'], ': ' . $context['user']['unread_messages'], '&nbsp';
//Do we have some new pms? Show the newest.
if(!empty($context['user']['unread_messages'])) {
echo '<center><a href="'.$scripturl.'?action=pm" alt="You have recieved a new Private Message"><img src="'.$scripturl.'/newmessage.gif"></a></center>';
}

Title: Re: Add something to the user information block(solved)
Post by: xxwckdxx on December 04, 2008, 10:45:40 AM
heres what it looks like
Title: Re: Add something to the user information block(solved)
Post by: mrtrc266 on December 11, 2008, 06:02:53 PM
What file are you editing?
Title: Re: Add something to the user information block(solved)
Post by: xxwckdxx on December 11, 2008, 07:45:47 PM
/Sources/SPortal1-1.php

i also updated it now so it plays a "You've Got Mail" wav file when there is new mail
Title: Re: Add something to the user information block(solved)
Post by: mrtrc266 on December 11, 2008, 09:47:32 PM
Seems like it work ok but my newmessage.gif is pulling from here on just showing a little red X

http://monsters-mansion.com/index.phpnewmessage.gif

any ideas on how to fix it?

Title: Re: Add something to the user information block(solved)
Post by: xxwckdxx on December 11, 2008, 09:57:41 PM
change
Code: [Select]
<img src="'.$scripturl.'/newmessage.gif"></a></center>';

to
Code: [Select]
<img src="/newmessage.gif"></a></center>';
that should work
Title: Re: Add something to the user information block(solved)
Post by: mrtrc266 on December 12, 2008, 01:07:02 AM
That worked :)

Thank you very much
Title: Re: Add something to the user information block(solved)
Post by: mrtrc266 on December 12, 2008, 01:49:08 AM
BTW

Quote
i also updated it now so it plays a "You've Got Mail" wav file when there is new mail

for your audible PM are you saying that you added that to your code or you got the Audible PM Mod?

I have the mod but can't get it to work in my custom theme
Title: Re: Add something to the user information block(solved)
Post by: xxwckdxx on December 12, 2008, 10:20:23 AM
i downloaded it changed my mind of using that one because it used a flash file for the sound so i added my own code and found a .wav file to use
Title: Re: Add something to the user information block(solved)
Post by: mrtrc266 on December 12, 2008, 02:07:38 PM
If and when you get a code block put together that would be great! I'd love to try it.

Thanks in advance.
Title: Re: Add something to the user information block(solved)
Post by: xxwckdxx on December 12, 2008, 11:46:20 PM
ill try to post it tommorow sometime just reformatted my comp got to reinstall everything :)
Title: Re: Add something to the user information block(solved)
Post by: mrtrc266 on December 13, 2008, 12:29:18 AM
Cool Cool, I'll be lookin forward to it :D

Thanks again
Title: Re: Add something to the user information block(solved)
Post by: xxwckdxx on December 13, 2008, 01:00:21 PM
change the code i gave u to

Code: [Select]
//Do we have some new pms? Show the newest.
if(!empty($context['user']['unread_messages'])) {
echo '<center><a href="'.$scripturl.'?action=pm" alt="You have recieved a new Private Message"><img src="/newmessage.gif"></a></center><EMBED SRC="/gotmail.wav" AUTOSTART="true" HIDDEN="true" LOOP="false">';
}

and then download http://CockerSpanielPad.com/gotmail.zip then put the wav file in the same place as u put newmessage.gif
SimplePortal 2.3.8 © 2008-2024, SimplePortal