/>
! (more info)
! CloudFront distribution hostname: (Leave blank if not using)
! CloudFront CNAMEs: (Separate with spaces or commas)
***************
*** 214,217 ****
!
--- 216,219 ----
!
diff -c tantan-s3/wordpress-s3/class-plugin-public.php tantan-s3a/wordpress-s3/class-plugin-public.php
Warning: missing newline at end of file tantan-s3/wordpress-s3/class-plugin-public.php
*** tantan-s3/wordpress-s3/class-plugin-public.php Tue Jan 27 09:53:18 2009
--- tantan-s3a/wordpress-s3/class-plugin-public.php Tue Dec 8 13:20:31 2009
***************
*** 19,29 ****
if (!$this->options) $this->options = get_option('tantan_wordpress_s3');
if ($this->options['wp-uploads'] && ($amazon = get_post_meta($postID, 'amazonS3_info', true))) {
! $accessDomain = $this->options['virtual-host'] ? $amazon['bucket'] : $amazon['bucket'].'.s3.amazonaws.com';
! return 'http://'.$accessDomain.'/'.$amazon['key'];
} else {
return $url;
}
}
}
! ?>
--- 19,38 ----
if (!$this->options) $this->options = get_option('tantan_wordpress_s3');
if ($this->options['wp-uploads'] && ($amazon = get_post_meta($postID, 'amazonS3_info', true))) {
! if ($this->options['cloudfront']) {
! $cfname = $this->options['cloudfront'];
! if ($this->options['cnames']) {
! $cnames = preg_split("/[\s,]+/", $this->options['cnames']);
! $cfname = array_rand(array_flip($cnames), 1);
! }
! return 'http://'.$cfname.'/'.$amazon['key'];
! } else {
! $accessDomain = $this->options['virtual-host'] ? $amazon['bucket'] : $amazon['bucket'].'.s3.amazonaws.com';
! return 'http://'.$accessDomain.'/'.$amazon['key'];
! }
} else {
return $url;
}
}
}
! ?>
diff -c tantan-s3/wordpress-s3/class-plugin.php tantan-s3a/wordpress-s3/class-plugin.php
*** tantan-s3/wordpress-s3/class-plugin.php Tue Jan 27 09:53:18 2009
--- tantan-s3a/wordpress-s3/class-plugin.php Tue Dec 8 13:15:33 2009
***************
*** 98,106 ****
$message = "Saved Amazon S3 authentication information. ";
}
if (function_exists('dns_get_record') && $_POST['options']['virtual-host']) {
! $record = dns_get_record($_POST['options']['bucket']);
! if (($record[0]['type'] != 'CNAME') || ($record[0]['target'] != $_POST['options']['bucket'].'s3.amazonaws.com')) {
! $error = "Warning: Your DNS doesn't seem to be setup correctly to virtually host the domain ".$_POST['options']['bucket'].". ".
"Double check and make sure the following entry is added to your DNS. ".
"More info >".
"
".
--- 98,123 ----
$message = "Saved Amazon S3 authentication information. ";
}
if (function_exists('dns_get_record') && $_POST['options']['virtual-host']) {
! if ($_POST['options']['cloudfront']) {
! if ($_POST['options']['cnames']) {
! $cnames = preg_split("/[\s,]+/", $_POST['options']['cnames']);
! foreach ($cnames as $cname) {
! $record = dns_get_record($cname);
! if (($record[0]['type'] != 'CNAME') || ($record[0]['target'] != $_POST['options']['cloudfront'])) {
! $error = "Warning: Your DNS doesn't seem to be setup correctly to virtually host the domain ".$_POST['options']['cloudfront'].". ".
! "Double check and make sure the following entry is added to your DNS. ".
! "More info >".
! "
".
! "You can ignore this message if you're sure everything is setup correctly.";
! }
! }
! }
! } else {
! $record = dns_get_record($_POST['options']['bucket']);
! if (($record[0]['type'] != 'CNAME') || ($record[0]['target'] != $_POST['options']['bucket'].'s3.amazonaws.com')) {
! $error = "Warning: Your DNS doesn't seem to be setup correctly to virtually host the domain ".$_POST['options']['bucket'].". ".
"Double check and make sure the following entry is added to your DNS. ".
"More info >".
"