Changeset 211826
- Timestamp:
- 03/01/2010 11:32:56 AM (16 years ago)
- Location:
- wp-photocontest/trunk
- Files:
-
- 2 edited
-
lib/wp-photocontest.class.php (modified) (3 diffs)
-
view.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-photocontest/trunk/lib/wp-photocontest.class.php
r194957 r211826 161 161 $outnum_photo = (array) $this->db->get_row( $this->db->prepare( "SELECT count(distinct(img_id)) as total_nr,img_id FROM ".$this->db->prefix."photocontest_votes ORDER BY img_id GROUP BY img_id")); 162 162 163 $out = $this->db->get_results( $this->db->prepare( "SELECT pr.wp_uid AS userid, pr.sum_votes AS sumvotes, wpu.user_login AS userlogin, pr.img_id AS img_id, pr.img_path AS img_path, pr.img_name AS img_name, pr.insert_time AS insert_time, pr.visibile AS visibile FROM ".$this->db->prefix."photocontest AS pr join ".$this->db->prefix."users as wpu on (pr.wp_uid = wpu.ID) AND pr.contest_id= %d ORDER BY pr.sum_votes DESC, pr.wp_uid ASC, pr.insert_time ASC LIMIT %d, %d", $contest_id, ($p * 10),(($p + 1) * 10) ) ); 163 //$out = $this->db->get_results( $this->db->prepare( "SELECT pr.wp_uid AS userid, pr.sum_votes AS sumvotes, wpu.user_login AS userlogin, pr.img_id AS img_id, pr.img_path AS img_path, pr.img_name AS img_name, pr.insert_time AS insert_time, pr.visibile AS visibile FROM ".$this->db->prefix."photocontest AS pr join ".$this->db->prefix."users as wpu on (pr.wp_uid = wpu.ID) AND pr.contest_id= %d ORDER BY pr.sum_votes DESC, pr.wp_uid ASC, pr.insert_time ASC LIMIT %d, %d", $contest_id, ($p * 10),(($p + 1) * 10) ) ); 164 165 $out = $this->db->get_results( $this->db->prepare( "SELECT pr.wp_uid AS userid, pr.wp_email AS useremail, pr.sum_votes AS sumvotes, pr.img_id AS img_id, pr.img_path AS img_path, pr.img_name AS img_name, pr.insert_time AS insert_time, pr.visibile AS visibile FROM ".$this->db->prefix."photocontest AS pr WHERE pr.contest_id= %d ORDER BY pr.sum_votes DESC, pr.wp_uid ASC, pr.insert_time ASC LIMIT %d, %d", $contest_id, ($p * 10),(($p + 1) * 10) ) ); 164 166 165 167 $i=0; … … 186 188 $v = (array) $v; 187 189 $data_array[$i] = $v; 190 if ($v['userid']>0) 191 { 192 $user_details = $this->db->get_results( $this->db->prepare( "SELECT * FROM ".$this->db->prefix."users as wpu WHERE wpu.ID= %d", $v['userid'] ) ); 193 foreach ($user_details as $user_k=>$user_v) 194 { 195 $user_v = (array) $user_v; 196 $data_array[$i]['userlogin'] = $user_v['display_name']; 197 } 198 } 199 else 200 { 201 $data_array[$i]['userlogin'] = $v['useremail']; 202 } 188 203 $data_array[$i]['format_date'] = wppc_niceDateTime($v['insert_time'],'date'); 189 204 $data_array[$i]['format_time'] = wppc_niceDateTime($v['insert_time'],'time'); … … 334 349 } 335 350 336 function get_page_scrolling ($post_id, $num_photo, $lastpage, $npages, $order , $base_url='page')351 function get_page_scrolling ($post_id, $num_photo, $lastpage, $npages, $order='chrono', $base_url='page') 337 352 { 338 353 if ($base_url == 'admin') -
wp-photocontest/trunk/view.php
r194948 r211826 169 169 default: 170 170 $content_title = __('Recently added', 'wp-photocontest'); 171 $scrolling = $wppc_prp->get_page_scrolling($post_id, $number_of_photos, $p, $number_of_pages, $order);171 $scrolling = $wppc_prp->get_page_scrolling($post_id, $number_of_photos, $p, $number_of_pages, "chrono"); 172 172 break; 173 173 }
Note: See TracChangeset
for help on using the changeset viewer.