1 | <?php |
---|
2 | /** |
---|
3 | * BouncingOrange SPIP SEO plugin |
---|
4 | * |
---|
5 | * @category SEO |
---|
6 | * @package SPIP_SEO |
---|
7 | * @author Pierre ROUSSET (p.rousset@gmail.com) |
---|
8 | * @copyright Copyright (c) 2009 BouncingOrange (http://www.bouncingorange.com) |
---|
9 | * @license http://opensource.org/licenses/gpl-2.0.php General Public License (GPL 2.0) |
---|
10 | */ |
---|
11 | |
---|
12 | function seo_insert_head($flux) { |
---|
13 | |
---|
14 | /* CONFIG */ |
---|
15 | $config = unserialize($GLOBALS['meta']['seo']); |
---|
16 | if ($config['insert_head']['activate'] == 'yes') { |
---|
17 | $contexte = $GLOBALS['contexte']; |
---|
18 | unset($contexte['lang']); |
---|
19 | if (count($contexte) == 0) { |
---|
20 | $type_object = 'sommaire'; |
---|
21 | } elseif (isset($contexte['id_article'])) { |
---|
22 | $id_object = $contexte['id_article']; |
---|
23 | $type_object = 'article'; |
---|
24 | } elseif (isset($contexte['id_rubrique'])) { |
---|
25 | $id_object = $contexte['id_rubrique']; |
---|
26 | $type_object = 'rubrique'; |
---|
27 | } |
---|
28 | /* META TAGS */ |
---|
29 | if ($config['meta_tags']['activate'] == 'yes') { |
---|
30 | $flux .= generer_meta_tags(); |
---|
31 | } |
---|
32 | /* META GOOGLE WEBMASTER TOOLS */ |
---|
33 | if ($config['webmaster_tools']['activate'] == 'yes' && $type_object == 'sommaire') { |
---|
34 | $flux .= generer_webmaster_tools(); |
---|
35 | } |
---|
36 | |
---|
37 | /* CANONICAL URL */ |
---|
38 | if ($config['canonical_url']['activate'] == 'yes') { |
---|
39 | $flux .= generer_urls_canoniques(); |
---|
40 | } |
---|
41 | |
---|
42 | /* GOOGLE ANALYTICS */ |
---|
43 | if ($config['analytics']['activate'] == 'yes') { |
---|
44 | $flux .= generer_google_analytics(); |
---|
45 | } |
---|
46 | |
---|
47 | /* ALEXA */ |
---|
48 | if ($config['alexa']['activate'] == 'yes' && $type_object == 'sommaire') { |
---|
49 | $flux .= generer_alexa(); |
---|
50 | } |
---|
51 | } |
---|
52 | |
---|
53 | return $flux; |
---|
54 | } |
---|
55 | |
---|