Plugin Directory

Changeset 1348359


Ignore:
Timestamp:
02/11/2016 04:12:30 PM (10 years ago)
Author:
macmonir
Message:

updated voting.php

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nomination-and-voting/trunk/voting.php

    r1348338 r1348359  
    55Description: nomination and voting
    66Author: macmonir
    7 Version: 1.0
    8 Author URI: #
     7Version: 1.1
     8Author URI: macmonir.com
    99*/
    1010
     
    303303        /*print_r($nominees);
    304304        print_r($nominees_name);die();*/
    305         if($nominees)
    306         for($i=0;$i<count($nominees);$i++){
    307             $data = $wpdb->get_results("select nominee_name  from ".$wpdb->prefix."nv_nominee  where id='".$nominees[$i]."' ");
    308             $html.= '<option value="'.$nominees[$i].'">'.$data[0]->nominee_name.'</option>';
     305        $data = $wpdb->get_results("select *,wn.id as id from ".$wpdb->prefix."nv_nominee wn inner join ".$wpdb->prefix."nv_nomination wnm on wn.id=wnm.nomineeid where category='".$_POST['catid']."' group by nomineeid");
     306       
     307        if(count($data))
     308        foreach($data as $val){
     309            //$data = $wpdb->get_results("select nominee_name  from ".$wpdb->prefix."nv_nominee  where id='".$nominees[$i]."' ");
     310            $html.= '<option value="'.$val->id.'">'.$val->nominee_name.'</option>';
    309311        }
    310312        die($html);
     
    474476    add_action( 'save_post', 'wpnv_save_indvidual__voting_options' );
    475477    //metabox
    476     add_action( 'add_meta_boxes', 'wpnv_add_custom_box' );
     478    //add_action( 'add_meta_boxes', 'wpnv_add_custom_box' );
    477479   
    478480}
Note: See TracChangeset for help on using the changeset viewer.