Page 1 of 1

Code error

Posted: Thu Feb 19, 2009 8:03 pm
by TaijovuNeji
Hi everybody

I'm adm of one forum .. but I have a question... I'm trying to put two images in terms of a code.. but have one condition to show this images .. and that gives me this error: syntax error, unexpected ','

Here is the code:

Code: Select all

// Go to PM center... [pm]
    if ($context['user']['is_logged'] && $context['allow_pm'])
        echo '<a href="', $scripturl, '?action=pm"><font color="#FFFFFF">',$context['user']['unread_messages'] == 0 ? '<img src="http://i659.photobucket.com/albums/uu314/marcusroots/Topic%20Organizer%20DM/Correio.gif">', $context['user']['unread_messages'] > 0 ? '<img src="http://img403.imageshack.us/img403/5578/correiona9.gif">''</font></a>';

What I'm doing wrong?
I thank anyone who can help me

Re: Code error

Posted: Fri Feb 20, 2009 3:35 am
by vmmene
In place of this statement
echo '<a href="', $scripturl, '?action=pm"><font color="#FFFFFF">',$context['user']['unread_messages'] == 0

use this statement it will solve your problem

'<a href="', $scripturl, '?action=pm"><font color="#FFFFFF">' . ($context['user']['unread_messages'] == 0 ?). '<img src="http://i659.photobucket.com/albums/uu31 ... orreio.gif">.' .($context['user']['unread_messages'] > 0 ?). '<img src="http://img403.imageshack.us/img403/5578 ... </font></a>';