SimplePortal
Customization => Custom Coding => Topic started 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?
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
-
figured it out myself
-
Glad that you could get it solved. Would be good if you can share your solution, as other may need this in the future.
-
this is what i changed the code to and i uploaded the gif image i made to the root directory
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'], ' ';
//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>';
}
-
heres what it looks like
-
What file are you editing?
-
/Sources/SPortal1-1.php
i also updated it now so it plays a "You've Got Mail" wav file when there is new mail
-
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?
-
change
<img src="'.$scripturl.'/newmessage.gif"></a></center>';
to <img src="/newmessage.gif"></a></center>';
that should work
-
That worked :)
Thank you very much
-
BTW
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
-
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
-
If and when you get a code block put together that would be great! I'd love to try it.
Thanks in advance.
-
ill try to post it tommorow sometime just reformatted my comp got to reinstall everything :)
-
Cool Cool, I'll be lookin forward to it :D
Thanks again
-
change the code i gave u to
//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