Code error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
TaijovuNeji
Forum Newbie
Posts: 1
Joined: Thu Feb 19, 2009 7:54 pm

Code error

Post 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
vmmene
Forum Newbie
Posts: 8
Joined: Mon Feb 09, 2009 3:26 am

Re: Code error

Post 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>';
Post Reply