• Resolved eggproject

    (@eggproject)


    Hello i little speak english… i use gtranslator…

    I use wp3.3.1 multsite and plugin
    plug-in went wrong multisite case

    my bugfix+compatible domain mapping plugin:
    bwps.php
    add new function-n that BWPS class:
    function multidimensional_search($parents, $searched) {
    if (empty($searched) || empty($parents)) {
    return false;
    }

    foreach ($parents as $key => $value) {
    $exists = true;
    foreach ($searched as $skey => $svalue) {
    $exists = ($exists && IsSet($parents[$key][$skey]) && $parents[$key][$skey] == $svalue);
    }
    if($exists){ return $key; }
    }

    return false;
    }

    function get_blog_list($start = 0, $num = 10)
    {
    global $wpdb;
    $blogs = $wpdb->get_results( $wpdb->prepare(“SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND archived = ‘0’ AND mature = ‘0’ AND spam = ‘0’ AND deleted = ‘0’ ORDER BY registered DESC”, $wpdb->siteid), ARRAY_A );
    foreach ( (array) $blogs as $details ) {
    $blog_list[ $details[‘blog_id’] ] = $details;
    $blog_list[ $details[‘blog_id’] ][‘postcount’] = $wpdb->get_var( “SELECT COUNT(ID) FROM ” . $wpdb->get_blog_prefix( $details[‘blog_id’] ). “posts WHERE post_status=’publish’ AND post_type=’post'” );
    }
    unset( $blogs );
    $blogs = $blog_list;

    if ( false == is_array( $blogs ) )
    return array();

    $ret;
    if ( $num == ‘all’ )
    $ret = array_slice( $blogs, $start, count( $blogs ) );
    else
    $ret = array_slice( $blogs, $start, $num );

    if(defined(“SUNRISE”) && SUNRISE == “on”)
    {// domain mapping plugin compatible
    $sql = array();
    $sql[] = “select blog_id,domain from “.$wpdb->prefix.”domain_mapping where “;
    foreach($ret as $val)
    {
    $sql[] = “blog_id = “.$val[‘blog_id’];
    $sql[] = “OR”;
    }
    array_pop($sql);//remove last OR
    $sql = implode(” “,$sql);
    $res = $wpdb->get_results($sql,ARRAY_A);
    foreach($res as $domainMapping)
    {
    $tmpId = $this->multidimensional_search($ret,array(“blog_id”=>$domainMapping[‘blog_id’]));
    $ret[$tmpId][‘domain’] = $domainMapping[‘domain’];
    }
    }
    return $ret;
    }

    and edit saveOptions function:
    old:
    $blogs = get_blog_list( 0, ‘all’ ); //need to find a non-deprecated alternative

    new:
    $blogs = $this->get_blog_list( 0, ‘all’ ); //need to find a non-deprecated alternative

    and
    database.php
    64 row:
    old
    $blogs = get_blog_list( 0, ‘all’ ); //need to find a non-deprecated alternative

    new
    $blogs = $BWPS->get_blog_list( 0, ‘all’ ); //need to find a non-deprecated alternative

    I tried this in the official forums to register but does not work … after him one day but managed to not get your registration email

    http://wordpress.org/extend/plugins/better-wp-security/

The topic ‘[Plugin: Better WP Security] wp 3.3.1 multisite bugfix’ is closed to new replies.