|
@@ -1,7 +1,7 @@
|
1
|
1
|
<?php
|
2
|
2
|
/*
|
3
|
3
|
Plugin Name: FeedReplacement
|
4
|
|
-Plugin URI: http://www.gelatocms.com/plugins/feedreplacement/
|
|
4
|
+Plugin URI: http://plugins.gelatocms.com/feedreplacement/
|
5
|
5
|
Description:
|
6
|
6
|
Author: Victor Bracco
|
7
|
7
|
Author URI: http://www.vbracco.com.ar/
|
|
@@ -24,6 +24,8 @@ class feedreplacement extends plugins {
|
24
|
24
|
//lo mismo pero con el que esta en el header
|
25
|
25
|
$this->addAction('gelato_includes', 'feedreplacement_includeFeed');
|
26
|
26
|
|
|
27
|
+ //redirecting all trafic
|
|
28
|
+ $this->addAction('feed_header', 'feedreplacement_redirect');
|
27
|
29
|
|
28
|
30
|
//guarda la opcion si viene por POST
|
29
|
31
|
if ($user->isAdmin()) {
|
|
@@ -64,6 +66,15 @@ class feedreplacement extends plugins {
|
64
|
66
|
}
|
65
|
67
|
}
|
66
|
68
|
|
|
69
|
+ function feedreplacement_redirect(){
|
|
70
|
+ global $conf;
|
|
71
|
+ $feedreplacement_url = $conf->get_option('feedreplacement_url');
|
|
72
|
+ if (!preg_match("/feedburner|feedvalidator/i", $_SERVER['HTTP_USER_AGENT'])) {
|
|
73
|
+ header("Location: ".$feedreplacement_url);
|
|
74
|
+ header("HTTP/1.1 302 Temporary Redirect");
|
|
75
|
+ exit();
|
|
76
|
+ }
|
|
77
|
+ }
|
67
|
78
|
}
|
68
|
79
|
|
69
|
80
|
?>
|