/** * so when this si called this will remove all the static posts that doesn't exist anymore * ALSO this will reset the options to no again * @param $input * @return mixed */ public function remove_orphaned_static_files($input) { if ($input['remove_orphaned_static_files'] == 'y') { //clean up stuff include_once 'static_generator.php'; $static_generator_controller = new StaticGenerator(); $static_generator_controller->clean_up_static_files(0, "posts", ""); $input['remove_orphaned_static_files'] = 'n'; //reset to no } return $input; }
/** * call the callback after nggallery image upload * @param $image_info */ public function nggallery_image_upload_hook($image_info) { //get the gallery path gallerypath $nggdb = new nggdb(); $current_gallery = $nggdb->find_gallery($image_info['galleryID']); $current_filename = $image_info["filename"]; //now get the absolute path $ws_image_path = $options = get_option('siteurl') . "/" . $current_gallery->path . "/" . $current_filename; $static_generator = new StaticGenerator(); $options = get_option(MakeItStatic::CONFIG_TABLE_FIELD); $callback_urls = $options["nggallery_callback_url"]; $static_generator->callback_file($ws_image_path, $callback_urls, $current_filename, 'nggallery_image'); }
/** * Regenerate feed and gadgets * */ public static function GenStaticContent() { gpPlugin_incl('Admin/StaticGenerator.php'); StaticGenerator::Generate(); }