| [ Index ] |
PHP Cross Reference of Drupal 6 (gatewave) |
[Summary view] [Print] [Text view]
1 <?php 2 // $Id: views_handler_sort_random.inc,v 1.1 2008/09/03 19:21:28 merlinofchaos Exp $ 3 4 /** 5 * Handle a random sort. 6 */ 7 class views_handler_sort_random extends views_handler_sort { 8 function query() { 9 global $db_type; 10 switch ($db_type) { 11 case 'mysql': 12 case 'mysqli': 13 $formula = 'RAND()'; 14 break; 15 case 'pgsql': 16 $formula = 'RANDOM()'; 17 break; 18 } 19 if (!empty($formula)) { 20 $this->query->add_orderby(NULL, $formula, $this->options['order'], '_' . $this->field); 21 } 22 } 23 24 function options_form(&$form, &$form_state) { 25 parent::options_form($form, $form_state); 26 $form['order']['#access'] = FALSE; 27 } 28 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Thu Mar 24 11:18:33 2011 | Cross-referenced by PHPXref 0.7 |