installed_path = $sInstalledPath; $this->custom_path = $sCustomPath; } function exec() { if (file_exists($this->custom_path)){ $md5_custom = md5_file($this->custom_path); } if (file_exists($this->installed_path)){ $md5_installed = md5_file($this->installed_path); } if ($md5_custom ==false || $md5_installed == false){ return; } if ($md5_custom != $md5_installed) { lr_installLogo($this->custom_path, $this->installed_path); } } } function lr_init() { $aImgList = array(); $aImgList[ABSPATH . 'wp-admin/images/logo-login.png'] = LOGO_DIR . 'logo-login.png'; $aImgList[ABSPATH . 'wp-admin/images/logo-login.gif'] = LOGO_DIR . 'logo-login.gif'; $aImgList[ABSPATH . 'wp-admin/images/wp-logo-vs.png'] = LOGO_DIR . 'wp-logo-vs.png'; $aImgList[ABSPATH . 'wp-admin/images/wp-logo.png'] = LOGO_DIR . 'wp-logo.png'; $aImgList[ABSPATH . 'wp-admin/images/wordpress-logo.png'] = LOGO_DIR . 'wordpress-logo.png'; $aImgList[ABSPATH . 'wp-includes/images/admin-bar-sprite.png'] = LOGO_DIR . 'admin-bar-sprite.png'; foreach ($aImgList as $sInstalledPath => $sCustomPath) { if (file_exists($sCustomPath)) { $oLogo = new LRLogoImg($sCustomPath, $sInstalledPath); $oLogo->exec(); } } } function lr_installLogo($src, $dst) { if (is_writable($dst)) { if (file_exists($src)) { if (!copy($src, $dst)) { if (WP_DEBUG) { echo "Failed to copy $src..."; } } } else { if (WP_DEBUG) { echo 'File not exist'; } } } else { if (WP_DEBUG) { echo 'Please make wp-admin directory writable!'; } } } ?>