Advertisement
CharlestonSW

AT&T Locator Issue

Jan 30th, 2015
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. HIS
  2. ORDER BY
  3. (SELECT count(sl_id) FROM wp_slp_tagalong WHERE wp_store_locator.sl_id=wp_slp_tagalong.sl_id) DESC ,
  4. ,
  5. sl_distance ASC
  6.  
  7.  
  8. DEV
  9. ORDER BY
  10. (SELECT count(sl_id) FROM wp_slp_tagalong WHERE wp_store_locator.sl_id=wp_slp_tagalong.sl_id) DESC ,
  11. sl_distance ASC,
  12. sl_distance ASC
  13.  
  14.  
  15. class.data.php
  16. // ORDER BY
  17. //
  18. case 'orderby_default':
  19. // FILTER: slp_ajaxsql_orderby
  20. $order = apply_filters('slp_ajaxsql_orderby','');
  21. if (!empty($order)) {
  22. $sqlStatement .= ' ORDER BY ' . $order . ' ';
  23. }
  24. break;
  25.  
  26.  
  27. class.ajaxhandler.php
  28. add_filter('slp_ajaxsql_orderby',array($this,'filter_SetDefaultOrderByDistance'),100);
  29. function filter_SetDefaultOrderByDistance($orderby) {
  30. return $this->slplus->database->extend_OrderBy($orderby,' sl_distance ASC ');
  31. }
  32.  
  33.  
  34. class.data.php
  35. function extend_OrderBy($startwith,$add) {
  36. return $startwith.(empty($startwith)?'':',').$add;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement