Hiding button in php

I currently have a button on my test site that I want to hide if the current_users id = number from mysql

the current code is…
[php]

<?php if (LOGGED_IN === true &&ACCOUNT_ID ===OWNER_ACCOUNT_ID): ?>
            <div class="button_edit_controls button_current">
                <button id="button_edit"><?php $abl->_("button.edit"); ?></button>
            </div>
<?php endif; ?>[/php]

I want to hide it if let’s say || $current_user->id==182 || $current_user->id==183 etc… but I just can’t get it to work?

Any ideas?

You can do this with CSS and a php if statement.

So create another css class which is identical to your current class button_edit_controls button_current but it has display:none as a tag within the definition

Then in your if statement you have

[php]
if …{
echo “

”.$abl->_(“button.edit”)."
";
}
else
{
echo "
";
}
[/php]

There are other ways to do it but that is what I would do

Didn’t work hmm

URL? If not post your full code and css.

If this doesn’t work then you need to give us more code to see.

[php]<?php if (LOGGED_IN == true && ACCOUNT_ID == OWNER_ACCOUNT_ID) { ?>


<?php $abl->_("button.edit"); ?>
<?php } ?>[/php]
Sponsor our Newsletter | Privacy Policy | Terms of Service