Google Sitemap by BestWebSoft - Version 1.06

Version Description

  • Added language files for plugin.
Download this release

Release Info

Developer bestwebsoft
Plugin Icon 128x128 Google Sitemap by BestWebSoft
Version 1.06
Comparing to
See all releases

Version 1.06

css/stylesheet.css ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #gglstmp_auth p{
2
+ padding-left:10px;
3
+ }
4
+
5
+ #gglstmp_auth p.submit {
6
+ padding-left:0px;
7
+ }
8
+
9
+ #gglstmp_login label{
10
+ float: left;
11
+ width: 100px;
12
+ }
13
+
14
+ #gglstmp_pass label{
15
+ float: left;
16
+ width: 100px;
17
+ }
18
+
19
+ #gglstmp_add_menu{
20
+ line-height: 25px;
21
+ }
22
+
23
+ #gglstmp_del_menu{
24
+ line-height: 25px;
25
+ }
26
+
27
+ #gglstmp_robot{
28
+ line-height: 25px;
29
+ }
30
+
31
+ #gglstmp_new_sitemap{
32
+ line-height: 14px;
33
+ }
34
+
35
+ #gglstmp_info{
36
+ line-height: 25px;
37
+ }
38
+
39
+ #adminmenu #toplevel_page_bws_plugins div.wp-menu-image
40
+ {
41
+ background: url("../images/icon_16.png") no-repeat scroll center center transparent;
42
+ }
43
+ #adminmenu #toplevel_page_bws_plugins:hover div.wp-menu-image, #adminmenu #toplevel_page_bws_plugins.wp-has-current-submenu div.wp-menu-image
44
+ {
45
+ background: url("../images/icon_16_c.png") no-repeat scroll center center transparent;
46
+ }
47
+ .wrap #icon-options-general.icon32-bws
48
+ {
49
+ background: url("../images/icon_36.png") no-repeat scroll left top transparent;
50
+ }
51
+ #toplevel_page_bws_plugins .wp-submenu .wp-first-item
52
+ {
53
+ display:none;
54
+ }
google-sitemap-plugin.php ADDED
@@ -0,0 +1,466 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Google sitemap plugin
4
+ Plugin URI: http://bestwebsoft.com/plugin/
5
+ Description: Plugin to add google sitemap file in google webmaster tools account.
6
+ Author: BestWebSoft
7
+ Version: 1.06
8
+ Author URI: http://bestwebsoft.com/
9
+ License: GPLv2 or later
10
+ */
11
+
12
+ /* © Copyright 2011 BestWebSoft ( admin@bestwebsoft.com )
13
+
14
+ This program is free software; you can redistribute it and/or modify
15
+ it under the terms of the GNU General Public License, version 2, as
16
+ published by the Free Software Foundation.
17
+
18
+ This program is distributed in the hope that it will be useful,
19
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
+ GNU General Public License for more details.
22
+
23
+ You should have received a copy of the GNU General Public License
24
+ along with this program; if not, write to the Free Software
25
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26
+ */
27
+
28
+ //============================================ Function for adding style ====================
29
+ if( ! function_exists( 'gglstmp_add_my_stylesheet' ) ) {
30
+ function gglstmp_add_my_stylesheet() {
31
+ wp_register_style( 'google-sitemap-StyleSheets', plugins_url( 'css/stylesheet.css', __FILE__ ) );
32
+ wp_enqueue_style( 'google-sitemap-StyleSheets' );
33
+ }
34
+ }
35
+
36
+ //============================================ Function for adding page in admin menu ====================
37
+ if( ! function_exists( 'bws_add_menu_render' ) ) {
38
+ function bws_add_menu_render() {
39
+ global $title;
40
+ $active_plugins = get_option('active_plugins');
41
+ $all_plugins = get_plugins();
42
+
43
+ $array_activate = array();
44
+ $array_install = array();
45
+ $array_recomend = array();
46
+ $count_activate = $count_install = $count_recomend = 0;
47
+ $array_plugins = array(
48
+ array( 'captcha\/captcha.php', 'Captcha', 'http://wordpress.org/extend/plugins/captcha/', 'http://bestwebsoft.com/plugin/captcha-plugin/', '/wp-admin/plugin-install.php?tab=search&type=term&s=Captcha+bestwebsoft&plugin-search-input=Search+Plugins', 'admin.php?page=captcha.php' ),
49
+ array( 'contact-form-plugin\/contact_form.php', 'Contact Form', 'http://wordpress.org/extend/plugins/contact-form-plugin/', 'http://bestwebsoft.com/plugin/contact-form/', '/wp-admin/plugin-install.php?tab=search&type=term&s=Contact+Form+bestwebsoft&plugin-search-input=Search+Plugins', 'admin.php?page=contact_form.php' ),
50
+ array( 'facebook-button-plugin\/facebook-button-plugin.php', 'Facebook Like Button Plugin', 'http://wordpress.org/extend/plugins/facebook-button-plugin/', 'http://bestwebsoft.com/plugin/facebook-like-button-plugin/', '/wp-admin/plugin-install.php?tab=search&type=term&s=Facebook+Like+Button+Plugin+bestwebsoft&plugin-search-input=Search+Plugins', 'admin.php?page=facebook-button-plugin.php' ),
51
+ array( 'twitter-plugin\/twitter.php', 'Twitter Plugin', 'http://wordpress.org/extend/plugins/twitter-plugin/', 'http://bestwebsoft.com/plugin/twitter-plugin/', '/wp-admin/plugin-install.php?tab=search&type=term&s=Twitter+Plugin+bestwebsoft&plugin-search-input=Search+Plugins', 'admin.php?page=twitter.php' ),
52
+ array( 'portfolio\/portfolio.php', 'Portfolio', 'http://wordpress.org/extend/plugins/portfolio/', 'http://bestwebsoft.com/plugin/portfolio-plugin/', '/wp-admin/plugin-install.php?tab=search&type=term&s=Portfolio+bestwebsoft&plugin-search-input=Search+Plugins', '' ),
53
+ array( 'gallery-plugin\/gallery-plugin.php', 'Gallery', 'http://wordpress.org/extend/plugins/gallery-plugin/', 'http://bestwebsoft.com/plugin/gallery-plugin/', '/wp-admin/plugin-install.php?tab=search&type=term&s=Gallery+Plugin+bestwebsoft&plugin-search-input=Search+Plugins', '' ),
54
+ array( 'adsense-plugin\/adsense-plugin.php', 'Google AdSense Plugin', 'http://wordpress.org/extend/plugins/adsense-plugin/', 'http://bestwebsoft.com/plugin/google-adsense-plugin/', '/wp-admin/plugin-install.php?tab=search&type=term&s=Adsense+Plugin+bestwebsoft&plugin-search-input=Search+Plugins', 'admin.php?page=adsense-plugin.php' ),
55
+ array( 'custom-search-plugin\/custom-search-plugin.php', 'Custom Search Plugin', 'http://wordpress.org/extend/plugins/custom-search-plugin/', 'http://bestwebsoft.com/plugin/custom-search-plugin/', '/wp-admin/plugin-install.php?tab=search&type=term&s=Custom+Search+plugin+bestwebsoft&plugin-search-input=Search+Plugins', 'admin.php?page=custom_search.php' ),
56
+ array( 'quotes_and_tips\/quotes-and-tips.php', 'Quotes and Tips', 'http://wordpress.org/extend/plugins/quotes-and-tips/', 'http://bestwebsoft.com/plugin/quotes-and-tips/', '/wp-admin/plugin-install.php?tab=search&type=term&s=Quotes+and+Tips+bestwebsoft&plugin-search-input=Search+Plugins', 'admin.php?page=quotes-and-tips.php' )
57
+ );
58
+ foreach($array_plugins as $plugins) {
59
+ if( 0 < count( preg_grep( "/".$plugins[0]."/", $active_plugins ) ) ) {
60
+ $array_activate[$count_activate]['title'] = $plugins[1];
61
+ $array_activate[$count_activate]['link'] = $plugins[2];
62
+ $array_activate[$count_activate]['href'] = $plugins[3];
63
+ $array_activate[$count_activate]['url'] = $plugins[5];
64
+ $count_activate++;
65
+ }
66
+ else if( array_key_exists(str_replace("\\", "", $plugins[0]), $all_plugins) ) {
67
+ $array_install[$count_install]['title'] = $plugins[1];
68
+ $array_install[$count_install]['link'] = $plugins[2];
69
+ $array_install[$count_install]['href'] = $plugins[3];
70
+ $count_install++;
71
+ }
72
+ else {
73
+ $array_recomend[$count_recomend]['title'] = $plugins[1];
74
+ $array_recomend[$count_recomend]['link'] = $plugins[2];
75
+ $array_recomend[$count_recomend]['href'] = $plugins[3];
76
+ $array_recomend[$count_recomend]['slug'] = $plugins[4];
77
+ $count_recomend++;
78
+ }
79
+ }
80
+ ?>
81
+ <div class="wrap">
82
+ <div class="icon32 icon32-bws" id="icon-options-general"></div>
83
+ <h2><?php echo $title;?></h2>
84
+ <?php if( 0 < $count_activate ) { ?>
85
+ <div>
86
+ <h3><?php _e( 'Activated plugins', 'sitemap' ); ?></h3>
87
+ <?php foreach( $array_activate as $activate_plugin ) { ?>
88
+ <div style="float:left; width:200px;"><?php echo $activate_plugin['title']; ?></div> <p><a href="<?php echo $activate_plugin['link']; ?>" target="_blank"><?php echo __( "Read more", 'sitemap'); ?></a> <a href="<?php echo $activate_plugin['url']; ?>"><?php echo __( "Settings", 'sitemap'); ?></a></p>
89
+ <?php } ?>
90
+ </div>
91
+ <?php } ?>
92
+ <?php if( 0 < $count_install ) { ?>
93
+ <div>
94
+ <h3><?php _e( 'Installed plugins', 'sitemap' ); ?></h3>
95
+ <?php foreach($array_install as $install_plugin) { ?>
96
+ <div style="float:left; width:200px;"><?php echo $install_plugin['title']; ?></div> <p><a href="<?php echo $install_plugin['link']; ?>" target="_blank"><?php echo __( "Read more", 'sitemap'); ?></a></p>
97
+ <?php } ?>
98
+ </div>
99
+ <?php } ?>
100
+ <?php if( 0 < $count_recomend ) { ?>
101
+ <div>
102
+ <h3><?php _e( 'Recommended plugins', 'sitemap' ); ?></h3>
103
+ <?php foreach( $array_recomend as $recomend_plugin ) { ?>
104
+ <div style="float:left; width:200px;"><?php echo $recomend_plugin['title']; ?></div> <p><a href="<?php echo $recomend_plugin['link']; ?>" target="_blank"><?php echo __( "Read more", 'sitemap'); ?></a> <a href="<?php echo $recomend_plugin['href']; ?>" target="_blank"><?php echo __( "Download", 'sitemap'); ?></a> <a class="install-now" href="<?php echo get_bloginfo( "url" ) . $recomend_plugin['slug']; ?>" title="<?php esc_attr( sprintf( __( 'Install %s' ), $recomend_plugin['title'] ) ) ?>" target="_blank"><?php echo __( 'Install now from wordpress.org', 'sitemap' ) ?></a></p>
105
+ <?php } ?>
106
+ <span style="color: rgb(136, 136, 136); font-size: 10px;"><?php _e( 'If you have any questions, please contact us via plugin@bestwebsoft.com or fill in our contact form on our site', 'sitemap' ); ?> <a href="http://bestwebsoft.com/contact/">http://bestwebsoft.com/contact/</a></span>
107
+ </div>
108
+ <?php } ?>
109
+ </div>
110
+ <?php
111
+ }
112
+ }
113
+
114
+ //============================================ Function for adding menu and submenu ====================
115
+ if( ! function_exists( 'gglstmp_add_pages' ) ) {
116
+ function gglstmp_add_pages() {
117
+ add_menu_page( __( 'BWS Plugins', 'sitemap' ), __( 'BWS Plugins', 'sitemap' ), 'manage_options', 'bws_plugins', 'bws_add_menu_render', WP_CONTENT_URL."/plugins/google-sitemap-plugin/images/px.png", 1001);
118
+ add_submenu_page( 'bws_plugins', __( 'Google Sitemap Options', 'sitemap' ), __( 'Google Sitemap', 'sitemap' ), 'manage_options', "google-sitemap-plugin.php", 'gglstmp_settings_page');
119
+
120
+ global $url_home;
121
+ global $url;
122
+ global $url_send;
123
+ global $url_send_sitemap;
124
+ $url_home = home_url();
125
+ $url = urlencode( $url_home . "/" );
126
+ $url_send = "https://www.google.com/webmasters/tools/feeds/sites/";
127
+ $url_send_sitemap = "https://www.google.com/webmasters/tools/feeds/";
128
+ }
129
+ }
130
+
131
+ //============================================ Function for creating sitemap file ====================
132
+ if( ! function_exists( 'gglstmp_sitemapcreate' ) ) {
133
+ function gglstmp_sitemapcreate() {
134
+ global $wpdb;
135
+ $loc = $wpdb->get_results( "SELECT ID,post_modified,post_status,post_type,ping_status FROM wp_posts WHERE post_status = 'publish' AND ping_status = 'open' AND post_type <> 'nav_menu_item'" );
136
+ $xml = new DomDocument('1.0','utf-8');
137
+ $xml_stylesheet_path = "wp-content/plugins/google-sitemap-plugin/sitemap.xsl";
138
+ $xslt = $xml->createProcessingInstruction( 'xml-stylesheet', "type=\"text/xsl\" href=\"$xml_stylesheet_path\"" );
139
+ $xml->appendChild($xslt);
140
+ $urlset = $xml->appendChild( $xml->createElementNS( 'http://www.sitemaps.org/schemas/sitemap/0.9','urlset' ) );
141
+ foreach( $loc as $val ) {
142
+ $url = $urlset->appendChild( $xml->createElement( 'url' ) );
143
+ $loc = $url->appendChild( $xml->createElement( 'loc' ) );
144
+ $permalink = get_permalink( $val->ID );
145
+ $loc->appendChild( $xml->createTextNode( $permalink ) );
146
+ $lastmod = $url->appendChild( $xml->createElement( 'lastmod' ) );
147
+ $now = $val->post_modified;
148
+ $date = date( 'Y-m-d\TH:i:sP', strtotime( $now ) );
149
+ $lastmod->appendChild( $xml -> createTextNode( $date ) );
150
+ $changefreq = $url -> appendChild( $xml->createElement( 'changefreq' ) );
151
+ $changefreq->appendChild( $xml->createTextNode( 'monthly' ) );
152
+ $priority = $url->appendChild( $xml->createElement( 'priority' ) );
153
+ $priority->appendChild( $xml->createTextNode( 1.0 ) );
154
+ }
155
+ $xml->formatOutput = true;
156
+ $xml->save( ABSPATH . 'sitemap.xml' );
157
+ }
158
+ }
159
+
160
+ //============================================ Function for creating setting page ====================
161
+ if ( !function_exists ( 'gglstmp_settings_page' ) ) {
162
+ function gglstmp_settings_page () {
163
+ global $url_home;
164
+ global $url;
165
+ $url_robot = ABSPATH . "robots.txt";
166
+ $url_sitemap = ABSPATH . "sitemap.xml";
167
+ $message = "";
168
+ if( $_POST['new'] ) {
169
+ $message = "<p>".__( "Your sitemap file was created in the root directory of the site. ", 'sitemap' )."</p>";
170
+ gglstmp_sitemapcreate();
171
+ }
172
+ ?>
173
+ <div class="wrap">
174
+ <div class="icon32 icon32-bws" id="icon-options-general"></div>
175
+ <h2><?php _e( "Google Sitemap options", 'sitemap' ); ?></h2>
176
+ <div class="updated fade" <?php if( ! isset( $_REQUEST['new'] ) ) echo "style=\"display:none\""; ?>><p><strong><?php echo $message; ?></strong></p></div>
177
+ <?php //=============================== Creating sitemap file ====================================
178
+ if( file_exists( $url_sitemap ) ) {
179
+ echo "<p>". __( "The sitemap file is already exists. If you want to change it for a new sitemap file check the necessary box below. In other case all actions will be performed over an existing file.", 'sitemap' ) . "</p>";
180
+ }
181
+ else {
182
+ gglstmp_sitemapcreate();
183
+ echo "<p>".__( "Your sitemap file was created in the root directory of the site. ", 'sitemap' ) . "</p>";
184
+ }
185
+ //========================================== Recreating sitemap file ====================================
186
+ echo "<p>". __( "If you don't want to add this file automatically you may go through", 'sitemap' ) . " <a href=\"https://www.google.com/webmasters/tools/home?hl=en\">". __( "this", 'sitemap' ) . "</a> ". __( "link, sign in, select necessary site, select 'Sitemaps' and type in necessary field", 'sitemap' ) ." - '". $url_home."/sitemap.xml'.</p>";
187
+ if ( function_exists( 'curl_init' ) ) {
188
+ echo "<p>". __( "This hosting doesn't support CURL, so you can't add sitemap file automatically", 'sitemap' ). "</p>";
189
+ $curl_exist = 0;
190
+ }
191
+ else {
192
+ $curl_exist = 1;
193
+ }?>
194
+ <form action="admin.php?page=google-sitemap-plugin.php" method='post' id="gglstmp_auth" name="gglstmp_auth">
195
+ <p id="gglstmp_new_sitemap">
196
+ <input type='checkbox' name='new'> <?php _e( "I want to create new sitemap file", 'sitemap' ); ?>
197
+ </p>
198
+ <p id="gglstmp_robot">
199
+ <input type='checkbox' name='ch1_robots'> <?php _e( "I want to add sitemap file path in robots.txt", 'sitemap' ); ?>
200
+ </p>
201
+ <?php
202
+ if ( $curl_exist == 1 ) {
203
+ echo "<p>". __( "Type here your login and password from google webmaster tools account to add or delete site and sitemap file automatically or to get information about this site in google webmaster tools.", 'sitemap' ) . "</p>";
204
+ ?>
205
+ <p id="gglstmp_login">
206
+ <label for='email'><?php _e( "Login* :", 'sitemap' ); ?></label>
207
+ <input type='text' name='email'><br/>
208
+ </p>
209
+ <p id="gglstmp_pass">
210
+ <label for='passwd'><?php _e( "Password* :", 'sitemap' ); ?></label>
211
+ <input type='password' name='passwd'> <br/>
212
+ </p>
213
+ <p id="gglstmp_add_menu">
214
+ <input type='radio' name='menu' value="ad"> <?php _e( "I want to add this site to the google webmaster tools", 'sitemap' ); ?>
215
+ </p>
216
+ <p id="gglstmp_del_menu">
217
+ <input type='radio' name='menu' value="del"> <?php _e( "I want to delete this site from google webmaster tools", 'sitemap' ); ?>
218
+ </p>
219
+ <p id="gglstmp_info">
220
+ <input type='radio' name='menu' value="inf"> <?php _e( "I want to get info about this site in google webmaster tools", 'sitemap' ); ?>
221
+ </p>
222
+ <?php } ?>
223
+ <p class="submit">
224
+ <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
225
+ </p>
226
+ </form>
227
+ </div>
228
+ <?php
229
+ //============================ Adding location of sitemap file to the robots.txt =============
230
+ if( $_POST['ch1_robots'] ){
231
+ if ( file_exists( $url_robot ) ) {
232
+ $fp = fopen( ABSPATH . 'robots.txt', "a+" );
233
+ fwrite($fp, "\nSitemap: " . $url_home . "/sitemap.xml\n" );
234
+ fclose ( $fp );
235
+ }
236
+ else{
237
+ $fp = fopen( ABSPATH . 'robots.txt', "a+" );
238
+ fwrite( $fp, "# User-agent: *\n
239
+ # Disallow: /wp-admin/\n
240
+ # Disallow: /wp-includes/\n
241
+ # Disallow: /wp-trackback\n
242
+ # Disallow: /wp-feed\n
243
+ # Disallow: /wp-comments\n
244
+ # Disallow: /wp-content/plugins\n
245
+ # Disallow: /wp-content/themes\n
246
+ # Disallow: /wp-login.php\n
247
+ # Disallow: /wp-register.php\n
248
+ # Disallow: /feed\n
249
+ # Disallow: /trackback\n
250
+ # Disallow: /cgi-bin\n
251
+ # Disallow: /comments\n
252
+ # Disallow: *?s=
253
+ \nSitemap: " . $url_home . "/sitemap.xml" );
254
+ fclose ($fp);
255
+ }
256
+ }
257
+ //================================ Different checks for the valid entering data ===================
258
+ if( ( ( $_POST['email'] ) && ( $_POST['passwd'] ) ) && ( ( $_POST['menu'] != "ad" ) && ( $_POST['menu'] != "del" ) && ( $_POST['menu'] != "inf" ) ) ) {
259
+ ?>
260
+ <script type = "text/javascript"> alert( "<?php _e( 'You must choose at least one action', 'sitemap' ); ?>" ) </script>
261
+ <?php
262
+ }
263
+ else{
264
+ if( ( ( !$_POST['email'] ) || ( !$_POST['passwd'] ) ) && ( ( $_POST['menu'] == "ad" ) || ( $_POST['menu'] == "del" ) || ( $_POST['menu'] == "inf" ) ) ) {
265
+ ?> <script type = "text/javascript"> alert( "<?php _e( 'You must enter login and password', 'sitemap' ); ?>" ) </script>
266
+ <?php
267
+ }
268
+ else{
269
+ // =================== Connecting to the google account =================
270
+ $data = array( 'accountType' => 'GOOGLE',
271
+ 'Email' => $_POST['email'],
272
+ 'Passwd' => $_POST['passwd'],
273
+ 'source' =>'PHI-cUrl-Example',
274
+ 'service' =>'sitemaps'
275
+ );
276
+ $ch = curl_init();
277
+ curl_setopt( $ch, CURLOPT_URL, "https://www.google.com/accounts/ClientLogin" );
278
+ curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, 0 );
279
+ curl_setopt( $ch, CURLOPT_POST, true );
280
+ curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
281
+ curl_setopt( $ch, CURLOPT_POSTFIELDS, $data );
282
+ curl_setopt( $ch, CURLOPT_UNRESTRICTED_AUTH, true );
283
+ $hasil = curl_exec( $ch );
284
+ curl_close( $ch );
285
+ $httpResponseAr = explode( "\n", $hasil );
286
+ $httpParsedResponseAr = array();
287
+ foreach ( $httpResponseAr as $i => $rVal ) {
288
+ list( $qKey, $qVal ) = explode ( "=", $rVal );
289
+ $httpParsedResponseAr[$qKey] = $qVal;
290
+ }
291
+ $au = $httpParsedResponseAr["Auth"];
292
+ if ( ( !$au ) && ( $_POST['email'] ) && ( $_POST['passwd'] ) ) {
293
+ ?>
294
+ <script type = "text/javascript"> alert( "<?php _e( "Login and password don\'t match, try again, please", 'sitemap' ); ?>" ) </script>
295
+ <?php
296
+ }
297
+ else {
298
+ if( $_POST['menu'] == "inf" ) {
299
+ gglstmp_info_site( $au );//getting info about the site in google webmaster tools account
300
+ }
301
+ else if( $_POST['menu'] == "ad" ) {
302
+ gglstmp_add_site( $au ); //adding site and verifying its ownership
303
+ gglstmp_add_sitemap( $au );//adding sitemap file to the google webmaster tools account
304
+ }
305
+ else if( $_POST['menu'] == "del" ) {
306
+ gglstmp_del_site( $au );//deleting site from google webmaster tools
307
+ }
308
+ }
309
+ }
310
+ }
311
+ }
312
+ }
313
+
314
+ //============================================ Curl function ====================
315
+ if( ! function_exists( 'gglstmp_curl_funct' ) ) {
316
+ function gglstmp_curl_funct( $au, $url_send, $type_request, $content ) {
317
+ $headers = array ( "Content-type: application/atom+xml; charset=\"utf-8\"",
318
+ "Authorization: GoogleLogin auth=" . $au
319
+ );
320
+ $chx = curl_init();
321
+ curl_setopt( $chx, CURLOPT_URL, $url_send );
322
+ curl_setopt( $chx, CURLOPT_HTTPHEADER, $headers );
323
+ curl_setopt( $chx, CURLOPT_SSL_VERIFYPEER, 0 );
324
+ curl_setopt( $chx, CURLOPT_RETURNTRANSFER, true );
325
+ if ( $type_request == "GET" ) {
326
+ curl_setopt( $chx, CURLOPT_HTTPGET, true );
327
+ }
328
+ if ( $type_request == "POST" ) {
329
+ curl_setopt( $chx, CURLOPT_POST, true );
330
+ curl_setopt( $chx, CURLOPT_POSTFIELDS, $content );
331
+ }
332
+ if ( $type_request == "DELETE" ) {
333
+ curl_setopt( $chx, CURLOPT_CUSTOMREQUEST, 'DELETE' );
334
+ }
335
+ if ( $type_request == "PUT" ) {
336
+ curl_setopt( $chx, CURLOPT_CUSTOMREQUEST, 'PUT' );
337
+ curl_setopt( $chx, CURLOPT_POSTFIELDS, $content );
338
+ }
339
+ $hasilx = curl_exec( $chx );
340
+ curl_close( $chx );
341
+ return $hasilx;
342
+ }
343
+ }
344
+
345
+ //============================================ Function to get info about site ====================
346
+ if( ! function_exists( 'gglstmp_info_site' ) ) {
347
+ function gglstmp_info_site( $au ) {
348
+ global $url_home;
349
+ global $url;
350
+ global $url_send;
351
+ global $url_send_sitemap;
352
+ $hasilx = gglstmp_curl_funct( $au, $url_send . $url, "GET", false );
353
+ //========================= Getting info about site in google webmaster tools ====================
354
+ echo "<h2><br />". __( "Info about this site in google webmaster tools", 'sitemap') ."</h2><br />";
355
+ if ( $hasilx == "Site not found" ) {
356
+ echo __( "This site is not added to the google webmaster tools account", 'sitemap');
357
+ }
358
+ else {
359
+ $hasils = gglstmp_curl_funct( $au, $url_send . $url, "GET", false );
360
+ echo "<pre>";
361
+ $p = xml_parser_create();
362
+ xml_parse_into_struct( $p, $hasils, $vals, $index );
363
+ xml_parser_free( $p );
364
+ foreach ( $vals as $val ) {
365
+ if( $val["tag"] == "WT:VERIFIED" )
366
+ $ver = $val["value"];
367
+ }
368
+ $hasils = gglstmp_curl_funct( $au, $url_send_sitemap . $url . "/sitemaps/", "GET", false );
369
+ echo "<pre>";
370
+ $p = xml_parser_create();
371
+ xml_parse_into_struct( $p, $hasils, $vals, $index );
372
+ xml_parser_free( $p );
373
+ foreach ( $vals as $val ) {
374
+ if( "WT:SITEMAP-STATUS" == $val["tag"] )
375
+ $sit = $val["value"];
376
+ }
377
+ echo __( "Site url: ", 'sitemap') . $url_home . "<br />";
378
+ echo __( "Site verification: ", 'sitemap');
379
+ if( "true" == $ver )
380
+ echo __( "verificated", 'sitemap') . "<br />";
381
+ else
382
+ echo __( "non verificated", 'sitemap') . "<br />";
383
+ echo __( "Sitemap file: ", 'sitemap');
384
+ if( $sit )
385
+ echo __( "added", 'sitemap') . "<br />";
386
+ else
387
+ echo __( "not added", 'sitemap') . "<br />";
388
+ }
389
+ }
390
+ }
391
+
392
+ //============================================ Deleting site from google webmaster tools ====================
393
+ if( ! function_exists( 'gglstmp_del_site' ) ) {
394
+ function gglstmp_del_site( $au ) {
395
+ global $url, $url_send;
396
+ $hasil3 = gglstmp_curl_funct( $au, $url_send. $url, "DELETE", false );
397
+ }
398
+ }
399
+
400
+ //============================================ Adding site to the google webmaster tools ====================
401
+ if( ! function_exists( 'gglstmp_add_site' ) ) {
402
+ function gglstmp_add_site( $au ) {
403
+ global $url_home, $url, $url_send;
404
+ $content = "<atom:entry xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns:wt=\"http://schemas.google.com/webmasters/tools/2007\">"
405
+ ."<atom:content src=\"" . $url_home . "\" />"
406
+ ."</atom:entry>\n";
407
+ $hasil1 = gglstmp_curl_funct( $au, $url_send, "POST", $content );
408
+ preg_match( '/(google)[a-z0-9]*\.html/', $hasil1, $matches );
409
+ //===================== Creating html file for verifying site ownership ====================
410
+ $m1="../" . $matches[0];
411
+ if( ! ( file_exists ( $m1 ) ) ) {
412
+ $fp = fopen ("../" . $matches[0], "w+" );
413
+ fwrite( $fp, "google-site-verification: " . $matches[0] );
414
+ fclose ( $fp );
415
+ }
416
+ //============================= Verifying site ownership ====================
417
+ $content = "<atom:entry xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns:wt=\"http://schemas.google.com/webmasters/tools/2007\">"
418
+ ."<atom:category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/webmasters/tools/2007#site-info'/>"
419
+ ."<wt:verification-method type=\"htmlpage\" in-use=\"true\"/>"
420
+ ."</atom:entry>";
421
+ $hasil2 = gglstmp_curl_funct( $au, $url_send. $url, "PUT", $content );
422
+ }
423
+ }
424
+
425
+ //============================================ Adding sitemap file ====================
426
+ if( ! function_exists( 'gglstmp_add_sitemap' ) ) {
427
+ function gglstmp_add_sitemap( $au ) {
428
+ global $url_home;
429
+ global $url;
430
+ global $url_send_sitemap;
431
+ $content = "<atom:entry xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns:wt=\"http://schemas.google.com/webmasters/tools/2007\">"
432
+ ."<atom:id>" . $url_home . "/sitemap.xml</atom:id>"
433
+ ."<atom:category scheme=\"http://schemas.google.com/g/2005#kind\" term=\"http://schemas.google.com/webmasters/tools/2007#sitemap-regular\"/>"
434
+ ."<wt:sitemap-type>WEB</wt:sitemap-type>"
435
+ ."</atom:entry>";
436
+ $hasil1 = gglstmp_curl_funct( $au, $url_send_sitemap . $url . "/sitemaps/", "POST", $content );
437
+ }
438
+ }
439
+
440
+ //============================================ Adding setting link in activate plugin page ====================
441
+ if( ! function_exists( 'gglstmp_action_links' ) ) {
442
+ function gglstmp_action_links( $links, $file ) {
443
+ //Static so we don't call plugin_basename on every plugin row.
444
+ static $this_plugin;
445
+ if ( ! $this_plugin )
446
+ $this_plugin = plugin_basename( __FILE__ );
447
+ if ( $file == $this_plugin ) {
448
+ $settings_link = '<a href="admin.php?page=google-sitemap-plugin.php">' . __( 'Settings', 'sitemap' ) . '</a>';
449
+ array_unshift( $links, $settings_link );
450
+ }
451
+ return $links;
452
+ }
453
+ }
454
+
455
+ if ( ! function_exists ( 'gglstmp_plugin_init' ) ) {
456
+ function gglstmp_plugin_init() {
457
+ load_plugin_textdomain( 'sitemap', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
458
+ }
459
+ }
460
+
461
+ add_action( 'wp_head', 'gglstmp_add_my_stylesheet' );
462
+ add_action( 'admin_head', 'gglstmp_add_my_stylesheet' );
463
+ add_action( 'admin_init', 'gglstmp_plugin_init' );
464
+ add_action( 'admin_menu', 'gglstmp_add_pages' );
465
+ add_filter( 'plugin_action_links', 'gglstmp_action_links', 10, 2 );
466
+ ?>
images/icon_16.png ADDED
Binary file
images/icon_16_c.png ADDED
Binary file
images/icon_36.png ADDED
Binary file
images/px.png ADDED
Binary file
languages/sitemap-ru_RU.mo ADDED
Binary file
languages/sitemap-ru_RU.po ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: google-sitemap-plugin\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2011-12-27 20:06+0200\n"
6
+ "PO-Revision-Date: 2011-12-27 20:06+0200\n"
7
+ "Last-Translator: BWS <zos@bestwebsoft.com>\n"
8
+ "Language-Team: bestwebsoft.com <plugin@bestwebsoft.com>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-KeywordsList: __;_e\n"
13
+ "X-Poedit-Basepath: ..\n"
14
+ "X-Poedit-Language: Russian\n"
15
+ "X-Poedit-Country: RUSSIAN FEDERATION\n"
16
+ "X-Poedit-SourceCharset: utf-8\n"
17
+ "X-Poedit-SearchPath-0: .\n"
18
+
19
+ #: google-sitemap-plugin.php:45
20
+ msgid "If you have any questions, please contact us via plugin@bestwebsoft.com or fill in our contact form on our site"
21
+ msgstr "Если у вас есть какие-то впросы, обращайтесь на plugin@bestwebsoft.com или заполните контактную форму на нашем сайте"
22
+
23
+ #: google-sitemap-plugin.php:55
24
+ msgid "BWS Plugins"
25
+ msgstr "Плагины BWS"
26
+
27
+ #: google-sitemap-plugin.php:56
28
+ msgid "Google Sitemap Options"
29
+ msgstr "Опции карты сайта Google"
30
+
31
+ #: google-sitemap-plugin.php:56
32
+ msgid "Google Sitemap"
33
+ msgstr "Карта сайта Google"
34
+
35
+ #: google-sitemap-plugin.php:107
36
+ #: google-sitemap-plugin.php:121
37
+ msgid "Your sitemap file was created in the root directory of the site. "
38
+ msgstr "Карта сайта для вашего сайта создана в корне основной директории."
39
+
40
+ #: google-sitemap-plugin.php:113
41
+ msgid "Google Sitemap options"
42
+ msgstr "Опции карты сайта Google"
43
+
44
+ #: google-sitemap-plugin.php:117
45
+ msgid "The sitemap file is already exists. If you want to change it for a new sitemap file check the necessary box below. In other case all actions will be performed over an existing file."
46
+ msgstr "Карта сайта уже существует. Если вы хотите изменить ее на новую карту сайта, выберите соответствующее действие внизу. Все остальные действия перезапишут существующий файл."
47
+
48
+ #: google-sitemap-plugin.php:124
49
+ msgid "If you don't want to add this file automatically you may go through"
50
+ msgstr "Если вы не хотите добавить файл карты сайта автоматически в Google webmaster tools, Вы можете сделать это через"
51
+
52
+ #: google-sitemap-plugin.php:124
53
+ msgid "this"
54
+ msgstr "эту"
55
+
56
+ #: google-sitemap-plugin.php:124
57
+ msgid "link, sign in, select necessary site, select 'Sitemaps' and type in necessary field"
58
+ msgstr "ссылку, залогиниться, выбрать сайт, выбрать 'Sitemaps' и заполнить обязательное поле"
59
+
60
+ #: google-sitemap-plugin.php:126
61
+ msgid "This hosting doesn't support CURL, so you can't add sitemap file automatically"
62
+ msgstr "Ваш хостинг не поддерживает CURL, поэтому вы не можете добавить карту сайта в Google аккаунт автоматически."
63
+
64
+ #: google-sitemap-plugin.php:134
65
+ msgid "I want to create new sitemap file"
66
+ msgstr "Я хочу создать новую карту сайта"
67
+
68
+ #: google-sitemap-plugin.php:137
69
+ msgid "I want to add sitemap file path in robots.txt"
70
+ msgstr "Я хочу добавить карту сайта в robots.txt"
71
+
72
+ #: google-sitemap-plugin.php:141
73
+ msgid "Type here your login and password from google webmaster tools account to add or delete site and sitemap file automatically or to get information about this site in google webmaster tools."
74
+ msgstr "Введите сюда свой логин и пароль для Google аккаунта, чтобы иметь возможность добавлять или удалять сайт и карту сайта автоматически в ваш аккаунт или же получить информацию об этом сайте из Google webmaster tools"
75
+
76
+ #: google-sitemap-plugin.php:144
77
+ msgid "Login* :"
78
+ msgstr "Логин* :"
79
+
80
+ #: google-sitemap-plugin.php:148
81
+ msgid "Password* :"
82
+ msgstr "Пароль* :"
83
+
84
+ #: google-sitemap-plugin.php:152
85
+ msgid "I want to add this site to the google webmaster tools"
86
+ msgstr "Я хочу добавить этот сайт в Google webmaster tools"
87
+
88
+ #: google-sitemap-plugin.php:155
89
+ msgid "I want to delete this site from google webmaster tools"
90
+ msgstr "Я хочу удалить этот сайт из Google webmaster tools"
91
+
92
+ #: google-sitemap-plugin.php:158
93
+ msgid "I want to get info about this site in google webmaster tools"
94
+ msgstr "Я хочу получить информацию об этом сайте из Google webmaster tools"
95
+
96
+ #: google-sitemap-plugin.php:162
97
+ msgid "Save Changes"
98
+ msgstr "Сохранить изменения"
99
+
100
+ #: google-sitemap-plugin.php:198
101
+ msgid "You must choose at least one action"
102
+ msgstr "Вы должны выбрать одно из действий"
103
+
104
+ #: google-sitemap-plugin.php:203
105
+ msgid "You must enter login and password"
106
+ msgstr "Вы должны ввести логин и пароль"
107
+
108
+ #: google-sitemap-plugin.php:232
109
+ msgid "Login and password don\\'t match, try again, please"
110
+ msgstr "Логин и пароль введены неправильно, попробуйте еще раз"
111
+
112
+ #: google-sitemap-plugin.php:292
113
+ msgid "Info about this site in google webmaster tools"
114
+ msgstr "Я хочу получить информацию об этом сайте из Google webmaster tools"
115
+
116
+ #: google-sitemap-plugin.php:294
117
+ msgid "This site is not added to the google webmaster tools account"
118
+ msgstr "Я хочу добавить этот сайт в Google webmaster tools"
119
+
120
+ #: google-sitemap-plugin.php:315
121
+ msgid "Site url: "
122
+ msgstr "Урл сайта:"
123
+
124
+ #: google-sitemap-plugin.php:316
125
+ msgid "Site verification: "
126
+ msgstr "Верификация сайта:"
127
+
128
+ #: google-sitemap-plugin.php:318
129
+ msgid "verificated"
130
+ msgstr "верифицровано"
131
+
132
+ #: google-sitemap-plugin.php:320
133
+ msgid "non verificated"
134
+ msgstr "не верефицирован"
135
+
136
+ #: google-sitemap-plugin.php:321
137
+ msgid "Sitemap file: "
138
+ msgstr "Файл карты сайта:"
139
+
140
+ #: google-sitemap-plugin.php:323
141
+ msgid "added"
142
+ msgstr "добавлен"
143
+
144
+ #: google-sitemap-plugin.php:325
145
+ msgid "not added"
146
+ msgstr "не добавлен"
147
+
148
+ #: google-sitemap-plugin.php:386
149
+ msgid "Settings"
150
+ msgstr "Настройки"
151
+
152
+ #~ msgid "Activated plugins"
153
+ #~ msgstr "Активированные плагины"
154
+
155
+ #~ msgid "Installed plugins"
156
+ #~ msgstr "Установленные плагины"
157
+
158
+ #~ msgid "Recommended plugins"
159
+ #~ msgstr "Рекомендованные к установке плагины"
160
+
161
+ #~ msgid "Install %s"
162
+ #~ msgstr "Установлено %s"
163
+
164
+ #~ msgid "Install Now"
165
+ #~ msgstr "Установить сейчас"
166
+
167
+ #~ msgid "Update"
168
+ #~ msgstr "Сохранить"
readme.txt ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Google sitemap plugin ===
2
+ Contributors: bestwebsoft
3
+ Donate link: http://bestwebsoft.com/
4
+ Tags: sitemap, google sitemap, google api, google webmaster tools, stmap, gogle sitemap, sitemp, google api sitemap, api sitemap, webmaster sitemap, webmaster tols, google stmp
5
+ Requires at least: 2.9
6
+ Tested up to: 3.3
7
+ Stable tag: 1.06
8
+
9
+ This plugin allows you to add sitemap file to google webmaster tools.
10
+
11
+ == Description ==
12
+
13
+ Google sitemap plugin allows you to create and add sitemap file to google webmaster tools, get info about your site in google webmaster tools.
14
+
15
+ == Installation ==
16
+
17
+ 1. Upload `google sitemap` folder to the `/wp-content/plugins/` directory.
18
+ 2. Activate the plugin through the 'Plugins' menu in WordPress.
19
+ 3. Site wide Settings are located in "Settings", "Sitemap".
20
+
21
+ == Frequently Asked Questions ==
22
+
23
+ = How can I use this plugin =
24
+
25
+ After opening plugin settings page your sitemap file will be created automatically. If you're already have sitemap file and you don't want to replace it just do not select field "I want to create new sitemap file".
26
+ If you don't want to add sitemap file in google webmaster tools automatically just follow short instruction. In other case you need to enter your login and password and choose necceseray action.
27
+ To add path to your sitemap file in robots.txt you don't need to enter login and password, you need just select necessary field and press "Update button".
28
+
29
+ = How to create sitemap.xml file =
30
+
31
+ After opening the settings page sitemap.xml file will be created automatically in the root of the site.
32
+
33
+ = How to replace existing sitemap.xml file =
34
+
35
+ Select "I want to create new sitemap file " and after pressing "Update" button sitemap file will be recreated.
36
+
37
+ = How to add site in google webmaster tools =
38
+
39
+ Select "I want to add this site to the google webmaster tools" and press "Update" button. After this your site will be added to the google webmaster tools, verificated and then your sitemap file will be added.
40
+
41
+ = How I can delete site from google webmaster tools =
42
+
43
+ Select "I want to delete this site from google webmaster tools" and press "Update" button. After this your site will be deleted from google webmaster tools
44
+
45
+ = How I can get information about my site in google webmaster tools =
46
+
47
+ Select "I want to get info about this site in google webmaster tools" and press "Update" button.
48
+
49
+ = How I can deactivate the plugin =
50
+
51
+ In the WordPress admin panel go to "Plugins", find "Google sitemap" plugin and press "Deactivate".
52
+
53
+ == Screenshots ==
54
+
55
+ 1. Google sitemap Settings page.
56
+ 2. Google sitemap Settings page at the hosting which doesn't support CURL.
57
+
58
+ == Changelog ==
59
+
60
+ = 1.06 =
61
+ * Added language files for plugin.
62
+
63
+ = 1.05 =
64
+ * Added sitemap.xsl stylesheet.
65
+
66
+ = 1.04 =
67
+ * Added ability to add sitemap.xml path in robots.txt.
68
+
69
+ = 1.03 =
70
+ * Added ability to get info about site in google webmaster tools.
71
+
72
+ = 1.02 =
73
+ * Added ability to delete site from google webmaster tools.
74
+
75
+ = 1.01 =
76
+ * Added ability to add site in google webmaster tools, verificate it and add sitemap file.
77
+
78
+ == Upgrade Notice ==
79
+
80
+ = 1.06 =
81
+ Added language files for plugin.
82
+
83
+ = 1.05 =
84
+ Added sitemap.xsl stylesheet.
85
+
86
+ = 1.04 =
87
+ Added ability to add sitemap.xml path in robots.txt.
88
+
89
+ = 1.03 =
90
+ Added ability to get info about site in google webmaster tools.
91
+
92
+ = 1.02 =
93
+ Added ability to delete site from google webmaster tools.
94
+
95
+ = 1.01 =
96
+ Added ability to add site in google webmaster tools, verificate it and add sitemap file.
screenshot-1.jpg ADDED
Binary file
screenshot-2.jpg ADDED
Binary file
sitemap.xsl ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xsl:stylesheet version="2.0"
3
+ xmlns:html="http://www.w3.org/TR/REC-html40"
4
+ xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
5
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
6
+ <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
7
+ <xsl:template match="/">
8
+ <html xmlns="http://www.w3.org/1999/xhtml">
9
+ <head>
10
+ <title>XML Sitemap</title>
11
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
12
+ <style type="text/css">
13
+ body {
14
+ font-family:"Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana;
15
+ font-size:13px;
16
+ float: left;
17
+ }
18
+
19
+ h1 {
20
+ text-align:center;
21
+ }
22
+
23
+ #intro {
24
+ background-color:#CFEBF7;
25
+ border:1px #2580B2 solid;
26
+ padding:5px 13px 5px 13px;
27
+ margin:10px;
28
+ }
29
+
30
+ #intro p {
31
+ line-height: 16.8667px;
32
+ }
33
+
34
+ td {
35
+ font-size:11px;
36
+ text-align: center;
37
+ }
38
+
39
+ th {
40
+ text-align:left;
41
+ font-size:11px;
42
+ text-align: center;
43
+ }
44
+
45
+ tr.high {
46
+ background-color:whitesmoke;
47
+ }
48
+
49
+ #footer {
50
+ padding:2px;
51
+ margin:10px;
52
+ font-size:8pt;
53
+ color:gray;
54
+ text-align: center;
55
+ }
56
+
57
+ #footer a {
58
+ color:gray;
59
+
60
+ }
61
+
62
+ a {
63
+ color:black;
64
+ }
65
+ </style>
66
+ </head>
67
+ <body>
68
+ <h1>XML Sitemap</h1>
69
+ <div id="intro">
70
+ <p>
71
+ This is a XML Sitemap which is supposed to be processed by <a href="http://www.google.com">Google</a> search engine.<br />
72
+ It was generated using the <a href="http://bestwebsoft.com">BestWebSoft Software</a>.<br />
73
+ </p>
74
+ </div>
75
+ <div id="content">
76
+ <table cellpadding="5">
77
+ <tr style="border-bottom:1px black solid;">
78
+ <th>URL</th>
79
+ <th>Priority</th>
80
+ <th>Change Frequency</th>
81
+ <th>LastChange (GMT)</th>
82
+ </tr>
83
+ <xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
84
+ <xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
85
+ <xsl:for-each select="sitemap:urlset/sitemap:url">
86
+ <tr>
87
+ <xsl:if test="position() mod 2 != 1">
88
+ <xsl:attribute name="class">high</xsl:attribute>
89
+ </xsl:if>
90
+ <td>
91
+ <xsl:variable name="itemURL">
92
+ <xsl:value-of select="sitemap:loc"/>
93
+ </xsl:variable>
94
+ <a href="{$itemURL}">
95
+ <xsl:value-of select="sitemap:loc"/>
96
+ </a>
97
+ </td>
98
+ <td>
99
+ <xsl:value-of select="concat(sitemap:priority*100,'%')"/>
100
+ </td>
101
+ <td>
102
+ <xsl:value-of select="concat(translate(substring(sitemap:changefreq, 1, 1),concat($lower, $upper),concat($upper, $lower)),substring(sitemap:changefreq, 2))"/>
103
+ </td>
104
+ <td>
105
+ <xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,5)))"/>
106
+ </td>
107
+ </tr>
108
+ </xsl:for-each>
109
+ </table>
110
+ </div>
111
+ <div id="footer">
112
+ Generated with Google sitemap plugin by <a href="http://bestwebsoft.com">BestWebSoft</a>
113
+ </div>
114
+ </body>
115
+ </html>
116
+ </xsl:template>
117
+ </xsl:stylesheet>