php - is_user_logged_in not working in premiumpress theme -
i'm having problem function_is_user_logged_in. can seen on http://dev.cellarsale.co.za/index.php/listing/example-listing-2/ . i'm trying make "buy now" line disappear unlogged people.
it's not working on website part of code :
ob_start(); (...) <table> <tbody> (...) <?php if(is_user_logged_in()){ ?> <tr id="buynow" style="display: none;"> <td colspan="5" class="bidbox biddingbox"> <div class="wrap"> <span class="label label-default pull-right" onclick="jquery('.biddingbox').hide();" ><?php echo $core->_e(array('account','48')); ?></span> <hr /> <form method="post" action="" class="row clearfix" onsubmit="return checkbidding();"> <input type="hidden" name="auction_action" value="newbid" /> <input type="hidden" name="bidtype" value="bid" /> <input type='hidden' name='hidden_cp' id='hidden_cp' value='<?php echo $current_price; ?>' /> <div class="col-md-4"> <div class="txtb"><?php echo $core->_e(array('auction','89')); ?></div> </div> <div class="col-md-4"> <div class='input-group'> <input type='text' class='form-control' id='bid_amount' name="bidamount" placeholder='<?php echo ($current_price+1); ?>' /> <span class='input-group-addon'><?php echo $globals['core_theme']['currency']['symbol']; ?></span> </div> </div> <div class="col-md-2"> <button class="btn btn-lg btn-primary" type="submit"><?php echo $core->_e(array('auction','66')); ?></button> </div> </form> <script> function checkbidding(){ <?php if($userdata->id && ($userdata->id == $post->post_author && $userdata->id != 1) ){ ?> alert("<?php echo $core->_e(array('auction','72','flag_noedit')); ?>"); return false; <?php }elseif($userdata->id){ ?> var bidprice = jquery('#bid_amount').val(); var ecp = jquery('#hidden_cp').val(); var ecp = math.round(parsefloat(ecp)*100)/100; var bidprice = math.round(parsefloat(bidprice)*100)/100; if(jquery.isnumeric(bidprice) && bidprice > ecp){ return true; }else{ alert('<?php echo $core->_e(array('auction','73','flag_noedit')).' '.$globals['core_theme']['currency']['symbol']; ?>'+ecp+''); return false; } <?php }else{ ?> alert("<?php echo $core->_e(array('auction','56','flag_noedit')); ?>"); return false; <?php } ?> }; </script> <hr /> <h4><?php echo $core->_e(array('auction','20')); ?></h4> <?php echo $core->_e(array('auction','90')); ?> <hr /> <p><?php echo $core->_e(array('auction','65')); ?></p> <textarea><?php echo stripslashes($globals['core_theme']['auction_terms']); ?></textarea> </div> </td> </tr> <?php } ?> <?php } ?> </tbody> </table> <?php // return output $output = ob_get_contents(); ob_end_clean(); return $output;
i think ob_start() @ beginning might reason why it's not working thing used is_user_logged_in above , worked. tried put content in "if(is_userlogged_in)" : still working first part not 1 above.
i tried @ 1 point hide css check using code below:
it didn't work @ all, logged or unlogged people.
does has ideas please ?
Comments
Post a Comment