Search code examples
htmlcsssmfsmf-forum

Hiding margin-top after login


I have a following line of codes:

<div align="center" style="margin-bottom: 5px; margin-top: 35px;">
<!-- AD CODE HERE -->
</div>

Please follow my site: http://www.electronicsforum.in/

When it is a guest user it shows a pop-up message 'Please Login/register'. I have no issue with this.
But after login I want to hide the margin-top of the div.


Solution

  • This code below fixes the issue at www.electronicsforum.in

    global $context;
    if ($context['user']['is_logged']) {
    echo'<div align="center" style="margin-bottom:5px; margin-top: 5px;"> ---Ad Code Here 1-- </div>';
    }
    else
    {
    echo'<div align="center" style="margin-bottom: 5px; margin-top: 35px;"> ---Ad Code Here else-- </div>';
    }