apgmxs_permissions

The Google Monthly XML Sitemap apgmxs permissions function.

Description

apgmxs_permissions(); 

Usage

  1. if ( !function_exists( 'apgmxs_permissions' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-monthly-xml-sitemap/monthly-xml-sitemap.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = apgmxs_permissions(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/monthly-xml-sitemap.php  
  1. function apgmxs_permissions() { 
  2.  
  3. $apgmxs_news_active = get_option('apgmxs_news_active'); 
  4.  
  5. $apgmxs_path = get_option('apgmxs_path'); 
  6. if ( !is_dir($apgmxs_path) ) mkdir($apgmxs_path) or die("Could not create directory " . $apgmxs_path); 
  7. $apgmxs_news_file_path = $apgmxs_path . "/sitemap-ap-monthly-index.xml"; 
  8.  
  9. if ($apgmxs_news_active && is_file($apgmxs_news_file_path) && is_writable($apgmxs_news_file_path)) $apgmxs_permission += 0; 
  10. elseif ($apgmxs_news_active && !is_file($apgmxs_news_file_path) && is_writable($apgmxs_path)) { 
  11. $fp = fopen($apgmxs_news_file_path, 'w'); 
  12. fwrite($fp, "<?xml version=\"1.0\" encoding=\"UTF-8\"?><urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" />"); 
  13. fclose($fp); 
  14. if (is_file($apgmxs_news_file_path) && is_writable($apgmxs_news_file_path)) $apgmxs_permission += 0; 
  15. else $apgmxs_permission += 2; 
  16. elseif ($apgmxs_news_active) $apgmxs_permission += 2; 
  17. else $apgmxs_permission += 0; 
  18.  
  19. return $apgmxs_permission;