Advertisement
Guest User

Untitled

a guest
May 28th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1.  function get_results_key() {
  2.     global $user;
  3.  
  4.     if (!isset($this->_results_key)) {
  5.       $key_data = array(
  6.         'build_info' => $this->view->build_info,
  7.         'roles' => array_keys($user->roles),
  8.         'super-user' => $user->uid == 1, // special caching for super user.
  9.         'language' => $GLOBALS['language'],
  10.       );
  11.       foreach (array('exposed_info', 'page', 'sort', 'order') as $key) {
  12.         if (isset($_GET[$key])) {
  13.           $key_data[$key] = $_GET[$key];
  14.         }
  15.       }
  16.  
  17.       $this->_results_key = $this->view->name . ':' . $this->display->id . ':results:' . md5(serialize($key_data));
  18.     }
  19.  
  20.     return $this->_results_key;
  21.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement