所以我敲我的頭在牆上的最後2天 所以我的問題是,這條線
ELSEIF($ current_user-> ID == $ bhistory [「用戶id」])
我希望用戶得到錯誤,如果他們的$ bhistory
的最後的我的問題是,它不工作,用戶的最後的$ bhistory,他們仍然可以點擊並再次成爲最後一個$ bhistory。
也請能有人解釋英語
的foreach這行代碼($ bidding_history爲$ KK => $ bhistory){
<?php
global $current_user;
$current_user = wp_get_current_user();
// MAKE BID OPTIONS
if($auction_type != 2){
// BIDDING DATA
$BIDDINGSTRING = "";
// CHECK IF THIS IS AN AFFILIATE PRODUCT OR NOT
$aff_p = get_post_meta($post->ID,'buy_link',true);
if(strlen($aff_p) > 1){
$link_l = get_home_url()."/out/".$post->ID."/buy_link/";
$btn_l = "<a href='".$link_l."' class='btn btn-primary right'>".$CORE->_e(array('auction','53'))."</a>";
// STOP BIDDING ON OWN ITEMS & IF LAST BIDDER
}elseif ($current_user->ID == $bhistory['userid']){
$btn_l = "<button class='btn' href='javascript:void(0);' onclick=\"alert('".$CORE->_e(array('auction','54'))."');\" id='bid_button'>".$CORE->_e(array('auction','70'))."</button>";
}else{ if($userdata->ID == $post->post_author) {
$btn_l = "<button class='btn' href='javascript:void(0);' onclick=\"alert('".$CORE->_e(array('auction','54','flag_noedit'))."');\" id='bid_button'>".$CORE->_e(array('auction','70'))."</button>";
}else{
$btn_l = "<button class='btn' href='javascript:void(0);' onclick=\"UpdateBidding();\" id='bid_button'>".$CORE->_e(array('auction','70'))."</button>";
}
}
小號
http://php.net/foreach – 2015-01-26 22:08:17