[wp-cvs] wordpress/wp-admin upgrade-functions.php,1.90,1.91
Ryan Boren
rboren at users.sourceforge.net
Sat Feb 12 19:34:53 GMT 2005
Update of /cvsroot/cafelog/wordpress/wp-admin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9282/wp-admin
Modified Files:
upgrade-functions.php
Log Message:
Copy searchform and images when creating site theme from default theme. http://mosquito.wordpress.org/view.php?id=852
Index: upgrade-functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/upgrade-functions.php,v
retrieving revision 1.90
retrieving revision 1.91
diff -C2 -d -r1.90 -r1.91
*** upgrade-functions.php 8 Feb 2005 08:01:59 -0000 1.90
--- upgrade-functions.php 12 Feb 2005 19:34:50 -0000 1.91
***************
*** 593,604 ****
$default_dir = ABSPATH . 'wp-content/themes/default';
! // Copy files from the default theme to the site theme.
! $files = array('index.php', 'comments.php', 'comments-popup.php', 'footer.php', 'header.php', 'sidebar.php', 'style.css');
!
! foreach ($files as $file) {
! if (! @copy("$default_dir/$file", "$site_dir/$file"))
! return;
! chmod("$site_dir/$file", 0777);
}
--- 593,608 ----
$default_dir = ABSPATH . 'wp-content/themes/default';
! // Copy files from the default theme to the site theme.
! //$files = array('index.php', 'comments.php', 'comments-popup.php', 'footer.php', 'header.php', 'sidebar.php', 'style.css');
! $theme_dir = @ dir("$default_dir");
! if ($theme_dir) {
! while(($theme_file = $theme_dir->read()) !== false) {
! if (is_dir("$default_dir/$theme_file"))
! continue;
! if (! @copy("$default_dir/$theme_file", "$site_dir/$theme_file"))
! return;
! chmod("$site_dir/$theme_file", 0777);
! }
}
***************
*** 618,621 ****
--- 622,642 ----
fclose($f);
}
+
+ // Copy the images.
+ umask(0);
+ if (! mkdir("$site_dir/images", 0777)) {
+ return false;
+ }
+
+ $images_dir = @ dir("$default_dir/images");
+ if ($images_dir) {
+ while(($image = $images_dir->read()) !== false) {
+ if (is_dir("$default_dir/images/$image"))
+ continue;
+ if (! @copy("$default_dir/images/$image", "$site_dir/images/$image"))
+ return;
+ chmod("$site_dir/images/$image", 0777);
+ }
+ }
}
More information about the cvs
mailing list