• Resolved lancelot-du-lac

    (@lancelot-du-lac)


    Hello All,

    I patched connections.php for support multisite with a new feature to use main table as global.
    here the patch:

    /***************************************************************/
    /* goal: To run Connections on a multisite as single site mode,
    /* add to wp-config.php: define('CONCT_MULTISITE_GLOBAL', true);
    /*
    /***************************************************************/
    /* Changes between lines 225 to 240 */
    
    if ( ! defined('CONCT_MULTISITE_GLOBAL') ) define ('CONCT_MULTISITE_GLOBAL', false);
    if ( is_multisite() && CONCT_MULTISITE_GLOBAL ) $cnct_prefix = $wpdb->base_prefix; else $cnct_prefix = $wpdb->prefix;
    
    define('CN_ENTRY_TABLE', $cnct_prefix . 'connections');
    define('CN_ENTRY_ADDRESS_TABLE', $cnct_prefix . 'connections_address');
    define('CN_ENTRY_PHONE_TABLE', $cnct_prefix . 'connections_phone');
    define('CN_ENTRY_EMAIL_TABLE', $cnct_prefix . 'connections_email');
    define('CN_ENTRY_MESSENGER_TABLE', $cnct_prefix . 'connections_messenger');
    define('CN_ENTRY_SOCIAL_TABLE', $cnct_prefix . 'connections_social');
    define('CN_ENTRY_LINK_TABLE', $cnct_prefix . 'connections_link');
    define('CN_ENTRY_TABLE_META', $cnct_prefix . 'connections_meta');
    define('CN_TERMS_TABLE', $cnct_prefix . 'connections_terms');
    define('CN_TERM_TAXONOMY_TABLE', $cnct_prefix . 'connections_term_taxonomy');
    define('CN_TERM_RELATIONSHIP_TABLE', $cnct_prefix . 'connections_term_relationships');

    See discussion with simllar request for wppa (Wp Photo Album Plus) http://wordpress.org/support/topic/plugin-wp-photo-album-plus-multisite-support-switch-local-to-global-set-option-request?replies=10 and finally accepted as new option.

    Request: Can you integrate this feature in next release ?

    To see patch in action :
    http://www.cieuxinternational.org/en/community/interreligious/
    http://www.cieuxinternational.org/paris-11/en/local-commitee/

    http://wordpress.org/extend/plugins/connections/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Steven

    (@shazahm1hotmailcom)

    @lancelot-du-lac

    I don’t have a problem adding this … actually this will work perfectly with some of the changes I made for the paths to better support multi-site in the next release. However, I do want to use a different global name so it fits better with *my* naming convention. I’m going to use CN_MULTISITE_ENABLED

    Plugin Author Steven

    (@shazahm1hotmailcom)

    I just added the following for the next release:

    /*
    * Goal: To run Connections on a multisite as single site mode.
    * Add to wp-config.php: define('CN_MULTISITE_ENABLED', TRUE);
    *
    * @credit lancelot-du-lac
    * @url http://wordpress.org/support/topic/plugin-connections-support-multisite-in-single-mode
    */
    if ( ! defined('CN_MULTISITE_ENABLED') ) define('CN_MULTISITE_ENABLED', FALSE);
    $prefix = ( is_multisite() && CN_MULTISITE_ENABLED ) ? $wpdb->base_prefix : $wpdb->prefix;
    
    define('CN_ENTRY_TABLE', $prefix . 'connections');
    define('CN_ENTRY_ADDRESS_TABLE', $prefix . 'connections_address');
    define('CN_ENTRY_PHONE_TABLE', $prefix . 'connections_phone');
    define('CN_ENTRY_EMAIL_TABLE', $prefix . 'connections_email');
    define('CN_ENTRY_MESSENGER_TABLE', $prefix . 'connections_messenger');
    define('CN_ENTRY_SOCIAL_TABLE', $prefix . 'connections_social');
    define('CN_ENTRY_LINK_TABLE', $prefix . 'connections_link');
    define('CN_ENTRY_DATE_TABLE', $prefix . 'connections_date');
    
    define('CN_ENTRY_TABLE_META', $prefix . 'connections_meta');
    define('CN_TERMS_TABLE', $prefix . 'connections_terms');
    define('CN_TERM_TAXONOMY_TABLE', $prefix . 'connections_term_taxonomy');
    define('CN_TERM_RELATIONSHIP_TABLE', $prefix . 'connections_term_relationships');
    Plugin Author Steven

    (@shazahm1hotmailcom)

    @lancelot-du-lac

    If you have a moment, can you contact me via the form on the following page? I like to have a discussion with you about the template you’re using on those sites.

    http://connections-pro.com/help-desk/

    Thread Starter lancelot-du-lac

    (@lancelot-du-lac)

    Great – I apply these changes

    thx

    Thread Starter lancelot-du-lac

    (@lancelot-du-lac)

    Hi, I downloaded your last update connections.0.7.3…

    I did not yet watch all the new features. But it is promising.

    Thank you for the geocode, very useful.

    The key for me was to get my global configuration of the multisite.
    For this, the directories for customization ‘connections_templates’ and ‘connection_images’ must be shared, and therefore the boolean variable CN_MULTISITE_ENABLED must also act on the definition of these two directories.

    This gives something like this in connections.php :

    if ( ! defined('CN_MULTISITE_ENABLED') ) define('CN_MULTISITE_ENABLED', FALSE);
    			if( is_multisite() && !CN_MULTISITE_ENABLED )
    			{
    				define('CN_IMAGE_PATH', WP_CONTENT_DIR . '/blogs.dir/' . $blog_id . '/connection_images/');
    				define('CN_IMAGE_BASE_URL', network_site_url('/wp-content/blogs.dir/' . $blog_id . '/connection_images/'));
    				define('CN_CUSTOM_TEMPLATE_PATH', WP_CONTENT_DIR . '/blogs.dir/' . $blog_id . '/connections_templates');
    				define('CN_CUSTOM_TEMPLATE_URL', network_site_url('/wp-content/blogs.dir/' . $blog_id . '/connections_templates/'));
    			} else {
    				define('CN_IMAGE_PATH', WP_CONTENT_DIR . '/connection_images/');
    				define('CN_IMAGE_BASE_URL', content_url() . '/connection_images/');
    				define('CN_CUSTOM_TEMPLATE_PATH', WP_CONTENT_DIR . '/connections_templates');
    				define('CN_CUSTOM_TEMPLATE_URL', content_url() . '/connections_templates');
    			}
    
    			$prefix = ( is_multisite() && CN_MULTISITE_ENABLED ) ? $wpdb->base_prefix : $wpdb->prefix;
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Connections] Support multisite in single mode’ is closed to new replies.