function __construct() { qw_add_filter('init_queries', array($this, 'init_queries')); qw_event_hook('enqueue_css', NULL, array($this, 'css')); qw_event_hook('enqueue_scripts', NULL, array($this, 'scripts')); qw_event_hook('qw_ajax_activitylist', NULL, array($this, 'activitylist')); qw_event_hook('qw_ajax_messagelist', NULL, array($this, 'messagelist')); qw_event_hook('qw_ajax_mark_all_activity', NULL, array($this, 'mark_all_activity')); qw_event_hook('qw_ajax_mark_all_messages', NULL, array($this, 'mark_all_messages')); qw_event_hook('qw_ajax_activity_count', NULL, array($this, 'activity_count')); qw_event_hook('qw_ajax_messages_count', NULL, array($this, 'messages_count')); // qw_event_hook('language', NULL, array($this, 'language')); qw_event_hook('register_language', NULL, array($this, 'language')); // added hooks for options and option tabs qw_add_action('qw_theme_option_tab', array($this, 'option_tab')); qw_add_action('qw_theme_option_tab_content', array($this, 'option_tab_content')); qw_add_action('qw_reset_theme_options', array($this, 'reset_theme_options')); qw_event_hook('doctype', NULL, array($this, 'navigation')); }
function qw_hook_exist($event) { return qw_event_hook($event, null, null, true); }
function post_meta_who($post, $class) { if (qw_hook_exist(__FUNCTION__)) { $args = func_get_args(); array_unshift($args, $this); return qw_event_hook(__FUNCTION__, $args, NULL); } if (isset($post['who'])) { $this->output('<span class="' . $class . '-who">'); if (strlen(@$post['who']['prefix'])) { $this->output('<span class="' . $class . '-who-pad">' . $post['who']['prefix'] . '</span>'); } if (isset($post['who']['data'])) { $handle = strip_tags($post['who']['data']); if ($post['who']['data'] == strip_tags($post['who']['data'])) { $this->output('<span class="' . $class . '-who-data">' . $handle . '</span>'); } else { $name = ra_name($handle); $this->output('<span class="' . $class . '-who-data"><a href="' . qa_path_html('user/' . $handle) . '">' . $name . '</a></span>'); } } if (isset($post['who']['title'])) { $this->output('<span class="' . $class . '-who-title">' . $post['who']['title'] . '</span>'); } // You can also use $post['level'] to get the author's privilege level (as a string) if (isset($post['who']['points'])) { $post['who']['points']['prefix'] = '(' . $post['who']['points']['prefix']; $post['who']['points']['suffix'] .= ')'; $this->output_split($post['who']['points'], $class . '-who-points'); } if (strlen(@$post['who']['suffix'])) { $this->output('<span class="' . $class . '-who-pad">' . $post['who']['suffix'] . '</span>'); } $this->output('</span>'); } }