~antivirtel/brs-wp/trunk

« back to all changes in this revision

Viewing changes to wp-content/plugins/google/lib/class_wdgpo_public_pages.php

  • Committer: Bortnyák Roland
  • Date: 2011-11-19 15:41:19 UTC
  • Revision ID: antivirtel@gmail.com-20111119154119-2yncj84gb2gaqs2t
Google +1 (WPMU) 1.2-re frissítése.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
                        echo '{lang: "' . $lang . '"}';
31
31
                }
32
32
                echo '</script>';
33
 
        }
34
 
/*
35
 
        function css_load_styles () {
36
 
                wp_enqueue_style('wdgpo_voting_style', WDGPO_PLUGIN_URL . '/css/plusone.css');
37
 
        }
38
 
*/
 
33
 
 
34
                if (!$this->data->get_option('analytics_integration')) return;
 
35
                $category = $this->data->get_option('analytics_category');
 
36
                $category = $category ? esc_js($category) : 'Google +1';
 
37
                echo <<<EOGaq
 
38
<script type="text/javascript">
 
39
function wdgpo_plusone_click (el) {
 
40
        if (typeof window._gaq != "undefined") {
 
41
                 _gaq.push(['_trackEvent', '{$category}', el.state, document.title]);
 
42
        }
 
43
}
 
44
</script>
 
45
EOGaq;
 
46
        }
39
47
 
40
48
        function inject_plusone_buttons ($body) {
41
49
                if (
53
61
                return $body;
54
62
        }
55
63
 
 
64
        function inject_gplus_page_id () {
 
65
                $page_id = $this->data->get_option('gplus_page_id');
 
66
                if (!$page_id) return false;
 
67
                echo '<link href="https://plus.google.com/' . $page_id . '/" rel="publisher" />';
 
68
        }
 
69
 
56
70
        function add_hooks () {
57
 
                add_action('wp_print_scripts', array($this, 'js_load_scripts'));
58
 
                //add_action('wp_print_styles', array($this, 'css_load_styles'));
 
71
                $action = $this->data->get_option('footer_render') ? 'wp_footer' : 'wp_print_scripts';
 
72
                add_action($action, array($this, 'js_load_scripts'));
59
73
 
60
74
                // Automatic +1 buttons
61
75
                if ('manual' != $this->data->get_option('position')) {
63
77
                        add_filter('the_content', array($this, 'inject_plusone_buttons'), 10);
64
78
                }
65
79
 
 
80
                // Google+ Page
 
81
                if ($this->data->get_option('gplus_page_id')) {
 
82
                        add_action('wp_head', array($this, 'inject_gplus_page_id'));
 
83
                }
 
84
 
66
85
                $this->codec->register();
67
86
        }
68
87
}
 
 
b'\\ No newline at end of file'