Hi,
spending some time trial&error-coding, I finally figured it out.
Maybe you folks from the ATA team might want to include this in the next update, since it only changes the multisite functionality.
I went ahead and replaced in Functions/bfa_rotating_header_images.php this:
PHP Code:
if (file_exists(ABSPATH."/wpmu-settings.php")) {
################### images in WP upload folder (on WPMU)
$files = bfa_m_find_in_dir(get_option('upload_path'),
'atahualpa_header_[0-9]+\.(jpe?g|png|gif|bmp)$');
if ($files) {
foreach($files as $value) {
$bfa_header_images[] = "'" . str_replace(get_option('upload_path'),
get_option('fileupload_url'), $value) . "'";
}
}
}
with that:
PHP Code:
if (is_multisite() ) {
include_once (TEMPLATEPATH . '/functions/bfa_m_find_in_dir.php'); // this line no need if you have changed it in ata/functions.php
################### images in WP upload folder (on WPMU)
$home = home_url();
$files = "";
$imgpath = ABSPATH . get_option('upload_path').'/header/';
$imgdir = $home . get_option('upload_path').'/header/';
$dh = opendir($imgpath);
while (FALSE !== ($filename = readdir($dh))) {
if( preg_match('/\.jpg/i', $filename) || preg_match('/\.gif/i', $filename) || preg_match('/\.png/i', $filename) ) {
$files[] = $filename;
}
}
if(isset($bfa_ata['header_image_sort_or_shuffle'])) {
if ($bfa_ata['header_image_sort_or_shuffle'] == "Sort") {
sort($files); }
else {
shuffle($files); }
}
closedir($dh);
foreach($files as $value) {
$bfa_header_images[] = '\'' . $imgdir . $value . '\'';
}
}
In addition for each site I...
1. created a directory of folders in wp-content with this structure: blogs.dir/your site/files/header
2. set the upload path for the site in the super admin backend ->sites->edit->settings to
wp-content/blogs-dir/your site/files/
If your structure is somthing like mainsite/subsite, then you just place this instead of "your site".
Now you have separate locations for the header images of each site with rotation in place.
Oh, and regarding the individual logos, in bfa_header_config.php I just deleted this:
PHP Code:
if ( file_exists(ABSPATH."/wpmu-settings.php") )
{
// two ways to figure out the upload path on WPMU, first try easy version 1, :
$upload_path1 = ABSPATH . get_option('upload_path');
// Try the hard way, version 2:
$upload_path2 = str_replace('themes/' . get_option('stylesheet') .
'/functions', '', $_SERVER['DOCUMENT_ROOT']) .
'/wp-content/blogs.dir/' . $wpdb->blogid . '/files';
// see if user has uploaded his own "logosymbol.gif" somewhere into his upload folder, version 1:
$wpmu_logosymbol = bfa_m_find_in_dir($upload_path1,$bfa_ata['logo']); $upload_path = $upload_path1;
// try version 2 if no logosymbol.gif was found:
if ( !$wpmu_logosymbol )
$wpmu_logosymbol = bfa_m_find_in_dir($upload_path2,$bfa_ata['logo']); $upload_path = $upload_path2;
// if we found logosymbol.gif one way or another, figure out the public URL
if ( $wpmu_logosymbol )
{
$new_logosymbol = str_replace($upload_path,
get_option('fileupload_url'), $wpmu_logosymbol);
echo $new_logosymbol[0] . '" alt="'; bloginfo('name');
}
// otherwise: print the one in the theme folder
else
{
echo $templateURI . '/images/' . $bfa_ata['logo'] .
'" alt="'; bloginfo('name');
}
}
and the else and brackets here
PHP Code:
else
{
echo $templateURI . '/images/' . $bfa_ata['logo'] . '" alt="';
bloginfo('name');
}
..., and use the original images folder of the main theme to store the logos.
It works!
Regards,
Cody