Lester Chan's Forums

Please login or register.

Login with username, password and session length
Pages: [1]   Go Down

Author Topic: Highest rated from multiple categories  (Read 4189 times)

0 Members and 1 Guest are viewing this topic.

dirs

  • Newbie
  • *
  • Offline Offline
  • Posts: 5
    • View Profile
Highest rated from multiple categories
« on: 21 August 2007, 05:48 »
Hi, today I've needed select an Array of highest rated categories and for this I've make some improvements on the function get_highest_rated_category.

I put this:

Code: [Select]
if(is_array($category_id)) {
  $cat_filter = "IN (".join(",", $category_id).")";
  } else {
  $cat_filter = "= $category_id";
}

Before the
Code: [Select]
$highest_rated = $wpdb->get_results
and change
Code: [Select]
$wpdb->post2cat.category_id = $category_idto
Code: [Select]
$wpdb->post2cat.category_id $cat_filter
Then for call the function for select from multiples categories i use (template):

Code: [Select]
<?php get_highest_rated_category(array(29,30,31,32), 'both'100?>
Thanks for read it, i hope this information be helpful.
Logged

GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Offline Offline
  • Posts: 10,040
    • View Profile
    • WWW
Re: Highest rated from multiple categories
« Reply #1 on: 21 August 2007, 05:57 »
THANK YOU for your contribution, I will add it in. Can I have your name and url to add in the source code?
Logged

++ lesterchan.net - Lester Chan's Website

I DO NOT provide support for any modifications of any plugin to meet your needs/requirements, unless it is a paid job and I have the time to do it due to the large number of request.

dirs

  • Newbie
  • *
  • Offline Offline
  • Posts: 5
    • View Profile
Re: Highest rated from multiple categories
« Reply #2 on: 21 August 2007, 16:09 »
THANK YOU for your contribution, I will add it in. Can I have your name and url to add in the source code?

Yeah :)
Dirceu P. Júnior
http://pomoti.com (pt-br)
Logged

GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Offline Offline
  • Posts: 10,040
    • View Profile
    • WWW
Re: Highest rated from multiple categories
« Reply #3 on: 21 August 2007, 18:02 »
noted =)

Thank you
Logged

++ lesterchan.net - Lester Chan's Website

I DO NOT provide support for any modifications of any plugin to meet your needs/requirements, unless it is a paid job and I have the time to do it due to the large number of request.

Ttech

  • Official Support
  • Global Moderator
  • *****
  • Offline Offline
  • Posts: 4,294
    • View Profile
    • WWW
Re: Highest rated from multiple categories
« Reply #4 on: 21 August 2007, 23:50 »
Cool... :)
Logged
Learning and Helping one day at a time.




DevNode.org Operator - The IRC network for Programers
Pages: [1]   Go Up
« previous next »
 

Page created in 0.031 seconds with 24 queries.