BBPress Steven Zahm : Replies Created

Forum Replies Created

Viewing 10 posts - 9,881 through 9,890 (of 15,332 total)
  • Author
    Posts
  • in reply to: Cannot restore #306946
    Steven Zahm
    Keymaster

    @ Axel

    Can you do a fresh export phpMyAdmin?

    • View the Structure.
    • Select all wp_connections* tables.
    • Scroll to the bottom.
    • In the With Selected drop down, select Export.
    • Do a Quick export in the SQL format.

    Can you also attach a screenshot showing just the wp_connections* tables from your localhost?

    Could I get a temp admin WP account and access to the production server phpMyAdmin? Login details can be sent via the contact link at the bottom of the page. Please paste a link to this forum thread so I can relate the login to this thread.

    Thanks!

    in reply to: Search function #306945
    Steven Zahm
    Keymaster

    @ Robert

    Apologies, I forgot a key instruction. You need to add initial_results='false' to the shortcodes so you have something like this:
    [connections initial_results='false']

    in reply to: Search function #306894
    Steven Zahm
    Keymaster

    @ Robert

    I just emailed the dev. He’ll stop by this forum thread so you and he can make contact.

    in reply to: cMaps and list_type incompatible? #306893
    Steven Zahm
    Keymaster

    @ Robert

    Great to hear!

    If you have a moment, I would truly appreciate a review as they really do make a difference. Many thanks in advance!
    https://wordpress.org/support/view/plugin-reviews/connections

    in reply to: Search function #306890
    Steven Zahm
    Keymaster

    @ Robert

    It is possible not to show any entries until a search is performed…

    Install the Code Snippets plugin.
    Add a new snippet with the following code:

    function cn_initial_search_filter( $posts, $WP_Query ) {
        global $wp_query;
    
        if ( ! class_exists('cnTemplatePart') ) return $posts;
    
        $shortcode = 'connections';
        $pattern   = get_shortcode_regex();
    
        // Grab the array containing all query vars registered by Connections.
        $registeredQueryVars = cnRewrite::queryVars( array() );
    
        foreach ( $posts as $post ) {
    
            // If we're in the main query, proceed!
            if ( isset( $WP_Query->queried_object_id ) && $WP_Query->queried_object_id == $post->ID ) {
    
                /*
                 * $matches[0] == An array of all shortcode that were found with its options.
                 * $matches[1] == Unknown.
                 * $matches[2] == An array of all shortcode tags that were found.
                 * $matches[3] == An array of the shortcode options that were found.
                 * $matches[4] == Unknown.
                 * $matches[5] == Unknown.
                 * $matches[6] == Unknown.
                 */
    
                if ( preg_match_all( '/'. $pattern .'/s', $post->post_content, $matches )
                    && array_key_exists( 2, $matches )
                    && in_array( $shortcode, $matches[2] ) )
                {
    
                    // Parse the shortcode atts.
                    $atts = shortcode_parse_atts( $matches[3][ array_search( $shortcode, $matches[2] ) ] );
    
                    // Remove the cn-image query vars.
                    $wp_query->query_vars = array_diff_key( (array) $wp_query->query_vars, array_flip( array( 'src', 'w', 'h', 'q', 'a', 'zc', 'f', 's', 'o', 'cc', 'ct' ) ) );
    
                    // Show the just the search form w/o showing the intial results?
                    // If a Connections query var is set, show the results instead.
                    if ( isset( $atts['initial_results'] )
                        && strtolower( $atts['initial_results'] ) == 'false'
                        && ! (bool) array_intersect( $registeredQueryVars, array_keys( (array) $wp_query->query_vars ) )
                       )
                    {
    
                        // Add return = true to $atts so template part are returned instead of echoed.
                        $atts['return'] = true;
    
                        // Enqueue the CSS and JS. We need to use the action because we're hooked 
                        // way to early in WP to use wp_enqueue_style() and wp_enqueue_script().
                        add_action( 'wp_enqueue_scripts', array( 'cnScript', 'enqueueStyles' ) );
    
                        // Add action to enqueue Chosen.
                        add_action( 'wp_enqueue_scripts', 'cn_enqueue_chosen' );
                        add_action( 'wp_print_footer_scripts', 'cn_init_chosen', 999 );
    
                        // Passing the shortcode $atts incase there are any template part specific shortcode options set.
                        $category  = cnTemplatePart::category( $atts );
                        $search    = cnTemplatePart::search( $atts );
                        $formOpen  = cnTemplatePart::formOpen( $atts );
                        $formClose = cnTemplatePart::formClose( $atts );
    
                        // Create the final output.
                        $replace = $formOpen . $category . $search . $formClose;
    
                        // All returns and tabs should be removed so wpautop() doesn't insert <p> and <br> tags in the form output.
                        //$replace = str_replace( array( "rn", "r", "n", "t" ), array( ' ', ' ', ' ', ' ' ), $replace );
    
                        // This needs to be wrapped in a div with an id of #cn-list so the CSS styles will be applied.
                        $replace = '<div id="cn-list">' . $replace . '</div>';
    
                    } else {
    
                        // Rewrite the $atts array to prep it to be imploded.
                        array_walk( $atts, create_function( '&$i,$k','$i="$k=\"$i\"";' ) );
    
                        $replace = '[' . $shortcode . ' ' . implode( ' ', $atts ) . ']';
                    }
    
                    // Replace the shortcode in the post with something a new one based on you changes to $atts.
                    $post->post_content = str_replace( $matches[0][ array_search( $shortcode, $matches[2] ) ], $replace, $post->post_content );
                }
    
            }
    
        }
    
        return $posts;
    }
    
    function cn_enqueue_chosen() {
    
        // If SCRIPT_DEBUG is set and TRUE load the non-minified JS files, otherwise, load the minified files.
        $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
    
        wp_enqueue_script( 'jquery-chosen', CN_URL . "vendor/chosen/chosen.jquery$min.js", array( 'jquery' ), '1.1.0', true );
    }
    
    function cn_init_chosen() {
    
    ?>
    
    <script type="text/javascript">/* <![CDATA[ */
        jQuery('select[name^=cn-cat]').chosen();
    /* ]]> */</script>
    
    <?php
    
    }
    
    add_filter( 'the_posts', 'cn_initial_search_filter', 1000, 2 );
    

    Save and activate the new snippet.

    That should do it.

    re: Related, let’s say we offer searching on Company Name, City and Zipcode. Is there a way we can have those search options in a pulldown or radio button format?
    That too is possible but would require custom coding that into the template. I can recommend i dev if you would like to pursue that. Let me know.

    Hope this helps!

    in reply to: Nothing in manage #306887
    Steven Zahm
    Keymaster

    @ Brian

    Great to hear it’s resolved. Apologies for the trouble!

    If you have a moment, I would really appreciate a review as they really do make a difference. Many thanks in advance!
    https://wordpress.org/support/view/plugin-reviews/connections

    in reply to: Cannot restore #306886
    Steven Zahm
    Keymaster

    @ Axel

    re: Import.
    I use both those methods and well as using BackupBuddy quite regularly. My best guess is you need to drop the existing connections tables in the destination db before you import the tables from the source db.

    re: Unfortunately Connections does not have an export / import functionality, so I am stuck.
    Connections does not need such a feature because plugins like BackupBuddy and Duplicator that can transfer site’s data. It would just add to the plugins bulk. It is also better to rely on an import/export that has been put through their paces, such as those plugins. If it were to be built-in, it would use the same process as those plugins and phpMyAdmin. So in this instance it would not help because the same error would occur.

    Hope that helps! Let me know how it goes.

    in reply to: Filter and search stopped working #306884
    Steven Zahm
    Keymaster

    @ Andres

    Looks like you’re using W3TC, great plugin, I used to use it on this site. Unfortunately it seems to just slow things down for me. Different caching plugins seem to work better on some hosts. Any way…

    Make sure you do not cache pages with query strings. I forget what the setting is called. Or, exclude the directory page from being cached.

    Hope that helps!

    in reply to: cMaps and list_type incompatible? #306883
    Steven Zahm
    Keymaster

    @ Robert

    Yes, this is how that works. You can chose different templates to use per list type. You have two options. The first, add template=cmap to the shortcode. That will force usage of the cMap template. The second, go to the Connections : Templates admin page and click the Individual template type and Activate the cMap template. Then do the same for the Organization template type.

    Hope that helps!

    in reply to: Nothing in manage #306844
    Steven Zahm
    Keymaster

    @ Brian

    Well, I think images that are 1000px in width at 72dpi should be plenty big enough. I think the size I’ll use as a max will be 1500 x 1500px. So when images that are uploaded are larger than that, it’ll auto scale down. That should prevent this issue from occurring.

    Hope that helps!

Viewing 10 posts - 9,881 through 9,890 (of 15,332 total)