';
if(file_exists( $real_file )) {
$f = fopen($real_file, 'r');
echo fread($f, @filesize($real_file));
} else echo "Config File does not exist";
echo ' ';
fclose($f);
}
function generate_config() {
$planet_config = "[Planet]" .
"\nname = " . get_option('wp_planetplanet_name') .
"\nlink = " . get_option('wp_planetplanet_link') .
"\nowner_name = " . get_option('wp_planetplanet_owner_name') .
"\nowner_email = " . get_option('wp_planetplanet_owner_email') .
"\ncache_directory = examples/cache" .
"\nnew_feed_items = 2" .
"\nlog_level = DEBUG" .
"\nfeed_timeout = 20" .
"\ntemplate_files = examples/fancy/index.html.tmpl examples/atom.xml.tmpl examples/rss20.xml.tmpl examples/rss10.xml.tmpl examples/opml.xml.tmpl examples/foafroll.xml.tmpl" .
"\noutput_dir = " . get_option('wp_planetplanet_output_dir') .
"\nitems_per_page = 60" .
"\ndays_per_page = 0" .
"\ndate_format = %B %d, %Y %I:%M %p" .
"\nnew_date_format = %B %d, %Y" .
"\nencoding = utf-8" .
"\n[examples/fancy/index.html.tmpl]" .
"\ndays_per_page = 7" .
"\nactivity_threshold = 0" .
"\n[DEFAULT]" .
"\nfacewidth = 65" .
"\nfaceheight = 85" .
"\n";
foreach (get_bookmarks() as $value) {
if ($value->link_rss != '') $planet_config = $planet_config .
"\n[$value->link_rss]" .
"\nname = $value->link_name" .
"\n#face = face.png" .
"\n#facewidth = 70" .
"\n#faceheight = 74".
"\n";
}
return $planet_config;
}
function edit_options() {
if ( isset( $_POST['writeplanetconfig'] ) ) {
if(write_planet_config())
echo 'Config Write Failed
';
$real_file = get_real_file_to_edit( PLUGINDIR . "/wp-planetplanet/planet_config.ini");
if(file_exists( $real_file ))
echo 'Check that the webserver has access to write to the planet_config.ini file';
else
echo 'Check that the webserver has access to write to the wp-planetplanet directory.';
echo '
';
}
}
?>
Manage PlanetPlanet Options
PlanetPlanet Config File
";
echo "Exists: ";
if( file_exists( $real_file ) ) {
echo "Yes
";
echo "Writeable ";
if ( is_writeable($real_file) ) echo "Yes";
else echo "No";
} else
echo " No";
?>