apgmxs_admin_page

The Google Monthly XML Sitemap apgmxs admin page function.

Description

apgmxs_admin_page(); 

Usage

  1. if ( !function_exists( 'apgmxs_admin_page' ) ) { 
  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_admin_page(); 
  7.  

Defined (1)

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

/monthly-xml-sitemap.php  
  1. function apgmxs_admin_page() { 
  2. $msg = ""; 
  3.  
  4. // Check form submission and update options 
  5. if ('apgmxs_submit' == $_POST['apgmxs_submit']) { 
  6. update_option('apgmxs_news_active', $_POST['apgmxs_news_active']); 
  7. update_option('apgmxs_excludecat', $_POST['apgmxs_excludecat']); 
  8. update_option('apgmxs_excludepostlist', $_POST['apgmxs_excludepostlist']); 
  9.  
  10. // Excluded category 
  11. $exCats = array(); 
  12. if(isset($_POST["post_category"])) { 
  13. foreach((array) $_POST["post_category"] AS $vv) if(!empty($vv) && is_numeric($vv)) $exCats[] = intval($vv); 
  14. update_option('apgmxs_excludecatlist', $exCats);  
  15.  
  16. // Sitemap generation 
  17.  
  18. $apgmxs_news_active = get_option('apgmxs_news_active'); 
  19. $apgmxs_path = get_option('apgmxs_path'); 
  20. $apgmxs_urls = get_option('apgmxs_urls'); 
  21. $apgmxs_excludepostlist = get_option('apgmxs_excludepostlist'); 
  22.  
  23. $apgmxs_permission = apgmxs_permissions(); 
  24. $apgmxs_file_list = apgmxs_getDirectoryList($apgmxs_path); 
  25. if ($apgmxs_permission == 1) $msg = "Error: there is a problem with <em>sitemap-ap-monthly-index.xml</em>. It doesn't exist or is not writable. <a href=\"http://www.andreapernici.com/wordpress/google-news-sitemap/\" target=\"_blank\" >For help see the plugin's homepage</a>."; 
  26. elseif ($apgmxs_permission == 2) $msg = "Error: there is a problem with <em>sitemap-ap-monthly-index.xml</em>. It doesn't exist or is not writable. <a href=\"http://www.andreapernici.com/wordpress/google-news-sitemap/\" target=\"_blank\" >For help see the plugin's homepage</a>."; 
  27. elseif ($apgmxs_permission == 3) $msg = "Error: there is a problem with <em>sitemap-ap-monthly-index</em>. It doesn't exist or is not writable. <a href=\"http://www.andreapernici.com/wordpress/google-news-sitemap/\" target=\"_blank\" >For help see the plugin's homepage</a>."; 
  28. ?> 
  29.  
  30. <style type="text/css"> 
  31. a.sm_button { 
  32. padding:4px; 
  33. display:block; 
  34. padding-left:25px; 
  35. background-repeat:no-repeat; 
  36. background-position:5px 50%; 
  37. text-decoration:none; 
  38. border:none; 
  39.  
  40. .sm-padded .inside { 
  41. margin:12px!important; 
  42. .sm-padded .inside ul { 
  43. margin:6px 0 12px 0; 
  44.  
  45. .sm-padded .inside input { 
  46. padding:1px; 
  47. margin:0; 
  48. </style>  
  49.  
  50.  
  51.  
  52. <div class="wrap" id="sm_div"> 
  53. <h2>Google Monthly XML Sitemap</h2>  
  54. by <strong>Andrea Pernici</strong> 
  55. <p> 
  56.  <a target="_blank" title="Google Monthly XML Sitemap Plugin Release History" href="http://andreapernici.com/wordpress/google-monthly-xml-sitemap/">Changelog</a>  
  57. | <a target="_blank" title="Google Monthly XML Sitemap Support" href="http://andreapernici.com/wordpress/google-monthly-xml-sitemap/">Support</a> 
  58. </p> 
  59. <?php if ($msg) { ?> 
  60. <div id="message" class="error"><p><strong><?php echo $msg; ?></strong></p></div> 
  61. <?php } ?> 
  62.  
  63. <div style="width:824px;">  
  64. <div style="float:left;background-color:white;padding: 10px 10px 10px 10px;margin-right:15px;border: 1px solid #ddd;">  
  65. <div style="width:350px;height:130px;">  
  66. <h3>Donate</h3>  
  67. <em>If you like this plugin and find it useful, help keep this plugin free and actively developed by going to the <a href="http://andreapernici.com/donazioni" target="_blank"><strong>donate</strong></a> page on my website.</em>  
  68. <p><em>Also, don't forget to follow me on <a href="http://twitter.com/andreapernici/" target="_blank"><strong>Twitter</strong></a>.</em></p>  
  69. </div>  
  70. </div>  
  71.  
  72. <div style="float:left;background-color:white;padding: 10px 10px 10px 10px;border: 1px solid #ddd;">  
  73. <div style="width:415px;height:130px;">  
  74. <h3>Google Guidelines and Credits</h3>  
  75. <p><em>For any doubt refer to the plugin page <a href="http://www.andreapernici.com/wordpress/google-monthly-xml-sitemap/">here</a>.</em></p> 
  76. <p><em>Plugin by <a href="http://www.andreapernici.com">Andrea Pernici</a> to save lots of system resources.</em> </p> 
  77. </div>  
  78. </div>  
  79. </div> 
  80. <div style="clear:both";></div>  
  81. </div> 
  82.  
  83.  
  84.  
  85. <div id="wpbody-content">  
  86.  
  87. <div class="wrap" id="sm_div"> 
  88.  
  89. <div id="poststuff" class="metabox-holder has-right-sidebar">  
  90. <div class="inner-sidebar">  
  91. <div id="side-sortables" class="meta-box-sortabless ui-sortable" style="position:relative;">  
  92. <div id="sm_pnres" class="postbox">  
  93. <h3 class="hndle"><span>Info plugin:</span></h3>  
  94. <div class="inside">  
  95. <a class="sm_button sm_pluginHome" href="http://www.andreapernici.com/wordpress/google-monthly-xml-sitemap/">Plugin Homepage</a>  
  96. <a class="sm_button sm_pluginSupport" href="http://wordpress.org/extend/plugins/google-monthly-xml-sitemap/">Forum</a> 
  97. <a class="sm_button sm_donatePayPal" href="http://andreapernici.com/donazioni">Donations</a> 
  98. </div>  
  99. </div> 
  100. <div id="sm_elencositemap" class="postbox"> 
  101. <h3 class="hndle"><span>Generated Sitemap</span></h3>  
  102. <div class="inside"> 
  103. <?php $apgmxs_i=0; 
  104. while ($apgmxs_file_list[$apgmxs_i]) {  
  105. echo '<a target="_blank" href="'.$apgmxs_urls.'/'.$apgmxs_file_list[$apgmxs_i].'">'.$apgmxs_file_list[$apgmxs_i].'</a><br />'; 
  106. $apgmxs_i++; 
  107. } ?> 
  108. </div> 
  109. </div> 
  110. </div> 
  111. </div> 
  112.  
  113.  
  114.  
  115.  
  116. <div class="has-sidebar sm-padded" >  
  117.  
  118. <div id="post-body-content" class="has-sidebar-content">  
  119.  
  120. <div class="meta-box-sortabless">  
  121.  
  122. <div id="sm_rebuild" class="postbox">  
  123. <h3 class="hndle"><span>Google Monthly XML Sitemap settings</span></h3> 
  124. <div class="inside">  
  125.  
  126. <form name="form1" method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>&updated=true"> 
  127. <input type="hidden" name="apgmxs_submit" value="apgmxs_submit" /> 
  128. <ul> 
  129. <li> 
  130. <label for="apgmxs_news_active"> 
  131. <input name="apgmxs_news_active" type="checkbox" id="apgmxs_news_active" value="1" <?php echo $apgmxs_news_active?'checked="checked"':''; ?> /> 
  132. Create Monthly Sitemap. 
  133. </label> 
  134. </li> 
  135. </ul> 
  136. <b>Sitemap will be generated in <?php echo $apgmxs_urls;?>/sitemap-ap-monthly-index.xml</b><br /> 
  137. <b>Il percorso della sitemap sul server saraà il seguente <?php echo $apgmxs_path;?></b> 
  138. </div> 
  139. </div> 
  140. <!-- Excluded Items -->  
  141.  
  142. <div id="sm_excludes" class="postbox">  
  143. <h3 class="hndle"><span>Escludi elementi</span></h3>  
  144.  
  145. <div class="inside">  
  146.  
  147. <b>Exclude Category:</b>  
  148.  
  149. <?php  
  150. $excludedCats = get_option('apgmxs_excludecatlist'); 
  151. if (!is_array($excludedCats)) $excludedCats = array(); 
  152. ?> 
  153. <div style="border-color:#CEE1EF; border-style:solid; border-width:2px; height:10em; margin:5px 0px 5px 40px; overflow:auto; padding:0.5em 0.5em;">  
  154. <ul>  
  155. <?php wp_category_checklist(0, 0, $excludedCats, false); ?>  
  156.  
  157. </ul>  
  158.  
  159. </div>  
  160.  
  161. <b>Exlclude Articles:</b>  
  162. <div style="margin:5px 0 13px 40px;">  
  163. <label for="apgmxs_excludepost">Exclude the following articles or pages: <small>put comma separated ID (ex. 1, 2, 3)</small><br />  
  164. <input name="apgmxs_excludepostlist" id="apgmxs_excludepostlist" type="text" style="width:400px;" value="<?php echo $apgmxs_excludepostlist;?>" /></label><br />  
  165. </div>  
  166.  
  167. </div>  
  168. </div>  
  169. <!-- Excluded --> 
  170. <p class="submit"> <input type="submit" value="Save & Rebuild" /></p> 
  171. </form> 
  172.  
  173.  
  174. </div> 
  175. </div> 
  176. </div> 
  177. </div> 
  178. </div>  
  179. </div> 
  180. <?php