Options -> DUI, select Unused images file that you want to delete then press delete button. 6. This is IMPORTANT step after delete unused images file you must Chmod monthly archives directory to previous value(most are 755). */ ### Load WP-Config File If This File Is Called Directly if (!function_exists('add_action')) { require_once('../../../wp-config.php'); } // Check an Unused image file function CheckUnusedImage($ImageFileName) { global $wpdb,$table_prefix; $result = intval($wpdb->get_var("SELECT COUNT(*) FROM ".$table_prefix."posts WHERE post_content LIKE '%/$ImageFileName%'")); return $result>0; } // Get list image file function GetImageFileName($ImageDir) { global $TotalImageCnt; $FileCnt = 0; $UnUsedImages = array(); if (is_dir($ImageDir)) { if ($DirHndl = opendir($ImageDir)) { $files = array(); while (($file = readdir($DirHndl))) { $path = pathinfo($file); if (eregi('(jpg)|(gif)|(png)|(jpeg)', $path['extension']) || eregi('(thumbnail)',$path['basename'])) $files[] = $file; } closedir($DirHndl); //print_r($files); if (count($files)) { foreach ($files as $fn) { if (!CheckUnusedImage($fn)) { $home = get_option('home'); $upload_path = get_option('upload_path'); $UnUsedImages[$FileCnt] = $fn.'::'.$home.'/'.$upload_path.'/'.$ImageDir.'/'.$fn; $FileCnt++; $TotalImageCnt++; } } } } } return $UnUsedImages; } // select directory function select_year_directory($year) { $Yeardirectory = array(); $month = array('01','02','03','04','05','06','07','08','09','10','11','12'); for ($i=0;$i<12;$i++) { $dir =getcwd(); if (is_dir($dir.'/'.$year.'/'.$month[$i])) { $Yeardirectory[$month[$i]] = GetImageFileName($year.'/'.$month[$i]); } } return $Yeardirectory; } // check image in directory function CheckInDir($Dir) { if ($dh = opendir($Dir)) { while ($el = readdir($dh)) { $path = $el; if (is_dir($path) && $el != '.' && $el != '..') { $year_result[$path] = select_year_directory($path); //echo $path.'
'; } } closedir($dh); } return $year_result; } //----------------------------------------------------------------------------------- // add management in option menu function add_DUI_option_menu() { if (function_exists('add_options_page')) { // is this check needed? add_options_page('DUI option', 'DUI', 8, basename(__FILE__), 'DUI_options'); } } // main option ----------- function DUI_options() { ?>

Delete Unused Images

'.$fdt[1].' Deleted
'; }else{ echo $fdt[0].'---> '.$fdt[1].' Cannot delete file.Please change directory premissions on '.$fdt[0].' to 777
'; } chdir("../../../"); } echo "
"; } } global $TotalImageCnt; chdir("../"); $upload_dir = get_option('upload_path'); chdir($upload_dir); $newdir = getcwd(); $TotalImageCnt=0; $result = CheckInDir($newdir); ?> There are total ".$TotalImageCnt." unused images file

"; ?>
$monthArr) { foreach ($monthArr as $month => $UnUsedImagesArr) { if (count($UnUsedImagesArr)<>0) { echo ''.$year.'/'.$month.'
'; foreach ($UnUsedImagesArr as $UnUsedImages) { $IMF = explode("::",$UnUsedImages); echo ''.$IMF[0]. '    View
'; } echo '
'; } // end if } } } ?>

Doug Liman Blog Archive - 30ninjas | Director's Blogs
  • Holy shit this camera's heavy Holy shit this camera's heavy Now that I don’t have to spend as much time on Fair Game and while I’m getting my next film lined up (which I can’t talk about very much) I’m also turning my attention back to Covert Affairs
  • Naomi Watts Naomi Watts I’ve been quoted talking about Naomi, saying that I think this may be her finest performance yet. I think the reason I feel that way is because her role in this film as Valerie Plame is a truly challenging role because NOCs (Non-official cover – government intelligence operatives who assume covert roles in organizations without official ties to their government) are wallflowers by nature and are usually understated and quiet.
  • Running on the roof tops Running on the roof tops I filmed on the rooftops themselves with David Belle and another stunt double, who is also an incredible Parkour stunt-player. David Belle’s the founder of Parkour, or as we like to call him at 30ninjas: The God of Parkour.
  • Hey! Get to work down there. Hey! Get to work down there. It was a Monday morning in June when I flew with the crew from Amman, Jordan to Baghdad nonstop. The flight is about an hour and I am not afraid of flying (obviously, am a pilot) but I was terrified on that flight.

Doug Liman Blog: Comic Con Covert Affairs Panel, 2011

posted 07-21-11 by Doug Liman

Doug Liman Blog: Piper, Parkour and Paris — I Survive Shooting David Belle

posted 06-12-11 by Doug Liman

A couple weeks ago, I flew over to Paris with Piper to shoot Covert Affairs. We landed on a Wednesday morning and Piper went to the Hotel and I went straight out to my scout. This is my favorite kind of production …

Doug Liman Blog: You Asked — Is It Essential For a Director to Know How To Do Every Job?

posted 02-07-11 by Doug Liman

Director Doug Liman answers questions from readers about filmmaking. Beachgrl asks: Do you think it’s essential that a director know how to do every job?

Doug Liman Blog: Meet My Business Partner Dave Bartis (I Streaked at His Wedding and He’s Still Willing to Work With Me)

posted 01-31-11 by Doug Liman

Our company Hypnotic is actually pretty small, it’s really just myself, my partner Dave Bartis, Gene Klein and some support help. Miraculously, this year we’ll have gotten three shows on the air at the same time, which is a first for us. We’ve never had more than one show on the air at a time. [...]

Doug Liman Blog: Dear Judith Miller, Don’t Smear My Screenwriters

posted 12-15-10 by Doug Liman

Doug Liman Blog: Just when I thought I was done promoting Fair Game, Judith Miller took a swing at the film in an op-ed last week in the Wall Street Journal. I’m not about to let Miller smear my screenwriters or my movie

Doug Liman Blog: Promoting a Film Next to the Hornet’s Nest of Politics and Truth

posted 10-19-10 by Doug Liman

I’ve been in 6 cities, including Beijing, Busan Korea, Vancouver and San Francisco in the past 7 days doing press and going to film festivals for both Fair Game and The Butcher, The Chef and the Swordsman. This week I’ll be in Washington DC and Abu Dhabi. I have the schedule of a politician running [...]

Doug Liman Blog — Complete List Of All My Fair Game Posts

posted 10-19-10 by Doug Liman

It’s pretty clear from the title what this post is about. I’ve been blogging for about a year now and, while not every post is about Fair Game, most of them are. It turns out that they’re an excellent record of what I went through while making the film — from scouting our first locations [...]

Doug Liman Blog: Photo Gallery of Naomi Watts, Liev Schreiber, Valerie Plame, Joe Wilson, and Noah Emmerich at the Fair Game Premiere

posted 10-07-10 by Doug Liman

There were so many people at the premiere last night that both theaters were maxed out. We are all exhausted but extremely happy with how it went. Below are photos from the red carpet and the screening. Enjoy!

Doug Liman Blog: Photos of Feeding America, Matt Damon Shoot

posted 10-06-10 by Doug Liman

After all the work I did for Haiti, I thought I should also look closer to home for ways that I could help others. Considering that there were 43.6 million Americans living in poverty in 2009, it wasn’t hard to find important causes to support. When Feeding America, the nation’s leading domestic hunger-relief charity, approached [...]

Doug Liman Blog: Flanked by My Female Spies, I’m Ready For The Fair Game Red Carpet

posted 10-05-10 by Doug Liman

Doug Liman blogs about his plans for the Fair Game premiere and his leading ladies Naomi Watts, who plays Valerie Plame, and Piper Perabo, the star of Covert Affairs TV show on USA Network.