Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Multisite »

[SOLVED] Rotating Header and individual logos on multisite install with Atahualpa 3.7


  #1  
Old Feb 3, 2013, 04:49 PM
Codeman79
 
5 posts · Dec 2012
Hi,

I've been banging my head now for a couple of hours, and still didn't figure it out.

I am trying to implement a multisite network in a local test environment on Mac using Mamp. The goal is to get a multisite network working using Wordpress and Atahualpa only. For this reason I've been trying to implement the fixes and patches as shown here
http://forum.bytesforall.com/showthread.php?t=14544
and in other posts of LANtait.
Unfortunately none of them worked so far. I am not even sure, they work with the ATA 3.7.10?

Does anyone have a suggestion how to solve this issue?

I like the Atahualpa theme, kind of got used to it's features and actually don't want to start over learning a new theme, if I don't have to.

Thanks for your advice.
Regards,

Cody
  #2  
Old Feb 13, 2013, 01:46 PM
Codeman79
 
5 posts · Dec 2012
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

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rotating images on header and php arguments causing errors... (Atahualpa & Shopp) crosjn eCommerce & Atahualpa 3 Jun 13, 2011 12:23 PM
[SOLVED] Auto Updating Header Image Loss and Seperate Rotating on MultiSite, MultiNet LANtait Header configuration & styling 2 Jun 9, 2011 12:18 AM
Multisite install not adding new sites TexZenFool New Versions, & Updating 1 Jan 13, 2011 03:13 PM
Install logo on rotating header? aravere Header configuration & styling 2 Sep 25, 2010 05:17 AM


All times are GMT -6. The time now is 02:26 PM.


Powered by vBulletin® Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.