- return "{$this->blog_id}/$group";
- }
-
- function hash($data) {
- if ( function_exists('hash_hmac') ) {
- return hash_hmac('md5', $data, $this->secret);
- } else {
- return md5($data . $this->secret);
- }
- }
-
- function load_group_from_db($group) {
- global $wpdb;
-
- if ('category' == $group) {
- $this->cache['category'] = array ();
- if ($dogs = $wpdb->get_results("SELECT * FROM $wpdb->categories")) {
- foreach ($dogs as $catt)
- $this->cache['category'][$catt->cat_ID] = $catt;
-
- foreach ($this->cache['category'] as $catt) {
- $curcat = $catt->cat_ID;
- $fullpath = '/'.$this->cache['category'][$catt->cat_ID]->category_nicename;
- while ($this->cache['category'][$curcat]->category_parent != 0) {
- $curcat = $this->cache['category'][$curcat]->category_parent;
- $fullpath = '/'.$this->cache['category'][$curcat]->category_nicename.$fullpath;
- }
- $this->cache['category'][$catt->cat_ID]->fullpath = $fullpath;
- }
- }
- } else
- if ('options' == $group) {
- $wpdb->hide_errors();
- if (!$options = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options WHERE autoload = 'yes'")) {
- $options = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options");
- }
- $wpdb->show_errors();
-
- if ( ! $options )
- return;
-
- foreach ($options as $option) {
- $this->cache['options'][$option->option_name] = $option->option_value;
- }
- }