Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Simple Code Question

Options
  • 20-03-2013 11:17pm
    #1
    Registered Users Posts: 158 ✭✭


    I've been re-writing code all day and I reckon I've just hit the wall and my brain has given up. I just need help with one line of code regarding an image.

    Basically, it's the PM option

    I've re-written it about 30 times and just cannot get it to work.
    At present, I have two "pm" images. One for new pms and one for when there are no new pms which should be visible at all times unless a new pm arrives (which would then be replaced by the "new pm" image).
    This is the only version of code that seems to get the new image to replace the original one... only problem is the original image will not show up now either before the new pm or after it has been read. I know it's probably something simple but it would be great if someone could show me where I have gone wrong please.
    <!-- IF PRIVATE_MESSAGE_INFO_READ --><a href="{U_PRIVATEMSGS}"><img src="{T_THEME_PATH}/images/pm.gif" alt="{PRIVATE_MESSAGE_INFO}" hspace="3" /></a><!-- ENDIF --><!-- IF PRIVATE_MESSAGE_INFO_UNREAD --><a href="{U_PRIVATEMSGS}"><img src="{T_THEME_PATH}/images/new_pm.gif" alt="{PRIVATE_MESSAGE_INFO}" hspace="3" /></a><!-- ENDIF -->
    


Comments

  • Closed Accounts Posts: 34,809 ✭✭✭✭smash


    Should you not have an else instead of 2 if statements? And simplify it to something like this using css classes?

    <a href="{U_PRIVATEMSGS}" title="{PRIVATE_MESSAGE_INFO}" <!-- IF PRIVATE_MESSAGE_INFO_UNREAD -->class="unread"<!-- ELSE -->class="read"<!-- ENDIF -->></a>


  • Registered Users Posts: 158 ✭✭Denise90


    Didn't enter my scrambled head to use ELSE, thank you!


Advertisement