Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt November 11, 2024
realmaverickuk Posted April 23, 2011 Posted April 23, 2011 Hello, I ran into this issue today when I installed IP.SEO. I needed my sitemap plugins in my 3rd party app to be executed in a SPECIFIC order, however it turns out that IP.SEO executes them according to the order of their position in the directory of the linux file system (so the user essentially has no choice in the order of sitemap plugin execution). What would be best is if the plugins were executed in alphabetical order. I.e. 1_plugin.php 2_plugin.php A_plugin.php B_plugin.php etc. I changed the generator.php code from: protected function runApplicationPlugins($app, $appPluginsPath) { $appPluginsDirectory = opendir($appPluginsPath); while($pluginFile = readdir($appPluginsDirectory)) { to: protected function runApplicationPlugins($app, $appPluginsPath) { $appPluginsDirectory = opendir($appPluginsPath); while($pluginFile = readdir($appPluginsDirectory)) { $allPlugins[] = $pluginFile; } sort($allPlugins); //sorts the plugins for alphabetical execution foreach ($allPlugins as $pluginFile) { in order to accomplish this. Obviously the above would require error handling to ensure that there the $allPlugins array actually had items before sorting. I think this is a necessary change in order to allow the user to execute each sitemap plugin in the order they choose. This change obviously will not effect users who do not mind the order of execution, but at the same time allows 3rd party developers greater control over the IP.SEO sitemap generation.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.