?> " class="nice_link"><?php _e("Repost", 'ProjectTheme'); ?> </a> <?php /* Add close button if available (winners count = 0 OR paid_user = 1) */ ?> <?php if ($post->post_author == $uid) { $pid = get_the_ID(); $paid_user = get_post_meta($pid, 'paid_user', true); $winners = Bid::get_field_by_pid($pid, 'winner', $single = false, array('winner=1')); if (count($winners) == 0 || $paid_user == 1) { ?> <a href="<?php bloginfo('siteurl'); ?> /?p_action=close_project&pid=<?php the_ID(); ?> " class="orange_btn3"><?php echo __("Close Project", "ProjectTheme"); ?> </a> <?php } }
function ProjectTheme_get_buttons_my_deliv_2() { $pid = get_the_ID(); global $post, $current_user; get_currentuserinfo(); $post = get_post($pid); $uid = $current_user->ID; ?> <div class="my-deliv_2"> <?php if ($pay_this_me == 1) { ?> <a href="<?php echo ProjectTheme_get_pay4project_page_url(get_the_ID()); ?> " class="post_bid_btn"><?php echo __("Pay This", "ProjectTheme"); ?> </a> <?php } ?> <?php if (1) { ?> <?php if ($pay_this_me != 1) { ?> <a href="<?php the_permalink(); ?> " class="green_btn3"><?php echo __("Read More", "ProjectTheme"); ?> </a> <?php } ?> <?php if ($unpaid == 1) { $finalised_posted = get_post_meta(get_the_ID(), 'finalised_posted', true); if ($finalised_posted == "1") { $finalised_posted = 3; } else { $finalised_posted = "1"; } $finalised_posted = apply_filters('ProjectTheme_publish_prj_posted', $finalised_posted); ?> <a href="<?php echo ProjectTheme_post_new_with_pid_stuff_thg(get_the_ID(), $finalised_posted); ?> " class="green_btn3"><?php echo __("Publish", "ProjectTheme"); ?> </a> <?php } ?> <?php if ($post->post_author == $uid) { ?> <a href="<?php bloginfo('siteurl'); ?> /?p_action=edit_project&pid=<?php the_ID(); ?> " class="green_btn3"><?php echo __("Edit Project", "ProjectTheme"); ?> </a> <?php } ?> <?php if ($post->post_author == $uid) { ?> <?php if ($closed == "1") { ?> <a href="<?php bloginfo('siteurl'); ?> /?p_action=repost_project&pid=<?php the_ID(); ?> " class="green_btn3"><?php echo __("Repost Project", "ProjectTheme"); ?> </a> <?php } /*} else { */ ?> <?php $winner = get_post_meta(get_the_ID(), 'winner', true); if (empty($winner)) { ?> <a href="<?php bloginfo('siteurl'); ?> /?p_action=delete_project&pid=<?php the_ID(); ?> " class="green_btn3"><?php echo __("Delete", "ProjectTheme"); ?> </a> <?php } ?> <?php /* Add close button if available (winners count = 0 OR paid_user = 1) */ ?> <?php if ($post->post_author == $uid) { $pid = get_the_ID(); $paid_user = get_post_meta($pid, 'paid_user', true); $winners = Bid::get_field_by_pid($pid, 'winner', $single = false, array('winner=1')); if (count($winners) == 0 || $paid_user == 1) { ?> <a href="<?php bloginfo('siteurl'); ?> /?p_action=close_project&pid=<?php the_ID(); ?> " class="orange_btn3"><?php echo __("Close Project", "ProjectTheme"); ?> </a> <?php } } ?> <?php } ?> <?php } ?> </div> <?php }
update_post_meta($pid, 'delivered', "0"); Bid::update_meta_by_id($bid->id, 'outstanding', "1"); Bid::update_meta_by_id($bid->id, 'delivered', "0"); Bid::update_meta_by_id($bid->id, 'mark_coder_delivered', "0"); Bid::update_meta_by_id($bid->id, 'mark_coder_delivered_date', "0"); Bid::update_meta_by_id($bid->id, 'mark_seller_accepted', "0"); Bid::update_meta_by_id($bid->id, 'mark_seller_accepted_date', "0"); update_post_meta($pid, 'mark_coder_delivered', "0"); update_post_meta($pid, 'mark_seller_accepted', "0"); update_post_meta($pid, 'mark_coder_delivered_date', "0"); update_post_meta($pid, 'mark_seller_accepted_date', "0"); update_post_meta($pid, 'paid_user', "0"); update_post_meta($pid, 'paid_user_date', "0"); $expected_delivery = $bid->days_done * 3600 * 24 + current_time('timestamp', 0); Bid::update_meta_by_id($bid->id, 'expected_delivery', $expected_delivery); $all_expected_delivery = Bid::get_field_by_pid($pid, 'expected_delivery'); update_post_meta($pid, 'expected_delivery', max($all_expected_delivery)); //------------------------------------------------------------------------------ if ($bids) { } //$uid = $bid->uid; //foreach($bids as $bid){ $uid = $bid->uid; projectTheme_prepare_rating($pid, $bid->uid, $post_p->post_author); projectTheme_prepare_rating($pid, $post_p->post_author, $bid->uid); do_action('ProjectTheme_do_action_on_choose_winner', $bid->id); $newtm = current_time('timestamp'); $query = "UPDATE " . $wpdb->prefix . "project_bids set date_choosen='{$newtm}', winner='1' where id='{$bid->id}'"; $wpdb->query($query); ProjectTheme_send_email_on_win_to_bidder($pid, $uid); ProjectTheme_send_email_on_win_to_owner($pid, $uid);