BBPress Steven Zahm : Replies Created

Forum Replies Created

Viewing 10 posts - 11,141 through 11,150 (of 15,332 total)
  • Author
    Posts
  • in reply to: adding content with link #292069
    Steven Zahm
    Keymaster

    @ Alaa

    Add a link to the bio field and use a template which displays the bio field. Does that answer the question?

    in reply to: Format/Layout problem #292061
    Steven Zahm
    Keymaster

    @ Oliver

    Assuming the only page you want to hide it on is this one:
    http://www.gymnasium-brake.de/personen/kollegium-2/

    This should work:

    .page-id-204 #cn-list span.organization-unit {
        display: none;
    }

    If that is not the page you want to hide it on, just change 204 to the correct page ID.

    Steven Zahm
    Keymaster

    @ Eric

    re: paths
    The paths would be relative to Code Snippets, not Link. I suggest not putting the API files within a plugin folder. Any update will delete the files. Your best course of action is to write your own plugin rather than using Code Snippets that way the API files can reside in your custom plugin. Code Snippets is fantastic for prototyping, testing actions/filters and adding one-off actions/filters but there are limits.

    Creating a plugin is easy. Just add the plugin header text to the top of a php file, paste in the snippets I gave you after the plugin header text, deactivate the snippets you added, create a new folder in the plugins folder, copy your php file to that new folder and activate your new plugin.

    re: instruction action
    The action will only work with the betas, not the version you have installed.

    re: I only want the data to prepopulate when a new directory entry is being added
    Right, you’ll have to add conditional code to make sure that happens only when adding a new entry.

    re: default for new entries was to make them either Private or Unlisted. I’d like to set the default to be Public
    As of Connections 0.8.6, the default is to be Public.

    re: Also, I’d like to set this up for Individuals only, rather than providing the choice of Organization too

    function cn_limit_entry_type_to_individual( $atts ){
     
        $atts['entry_type'] = array(
            __( 'Individual', 'connections' ) => 'individual'
            );
     
        $atts['default'] = array(
            'type'       => 'individual',
            'visibility' => 'public'
            );
     
        return $atts;
    }
     
    // Filter to limit to the organization entry type.
    add_filter( 'cn_metabox_publish_atts', 'cn_limit_entry_type_to_individual' );
    Steven Zahm
    Keymaster

    @ Xavier

    Good to hear. Really odd that the JDK would interfered with JS though. Never run into that before.

    Steven Zahm
    Keymaster

    @ Eric

    I add two new action which you can hook into to output the instructions. Here’s snippet that will work with the beta of Link:

    add_action( 'cnl_admin_before_metaboxes', 'cnl_custom_content_before' );
    
    function cnl_custom_content_before( $action ) {
    	
    	switch ( $action ) {
    		
    		case 'add':
    		
    			echo '<div><p>Special Instructions when adding an entry</p></div>';
    			break;
    		
    		case 'edit':
    		
    			echo '<div><p>Special Instructions when editing an entry</p></div>';
    			break;
    	}
    	
    }
    Steven Zahm
    Keymaster

    @ Eric

    The second line is correct. That filter is the equivalent of Form. Two filters need added; one for Form, the other for Link. Both filters call the same function.

    For those two filters, you need to make a change to Link, the one I mentioned here on line 37. I’ll try to get both the betas for Form and Link over to you today.

    As to how to use the snippet…

    A quick look at the code you gave… you should be able to past it after the two cache filter lines. Remove the echos. You can not echo within a filter. Replace my dummy data with the variables from you code. Something like this:

    add_filter( 'cnl_admin_add_entry_object', 'cnl_alter_add_entry_object' );
    add_filter( 'cnf_add_entry_object', 'cnl_alter_add_entry_object' );
    
    function cnl_alter_add_entry_object( $entry ) {
    	
    	// Add the filters necessary to save data in the cache.
    	add_filter( 'cn_email_cached', '__return_true' );
    	add_filter( 'cn_address_cached', '__return_true' );
    
    	include_once '/dap/dap-config.php';
    
    	if ( Dap_Session::isLoggedIn() ) {
    
    		$session   = Dap_Session::getSession();
    		$user      = $session->getUser();
    		$email     = $user->getEmail();
    
    		// ACCESS USER INFO FROM INFUSIONSOFT API
    		include_once 'isdk.php';
    		$myApp = new iSDK;
    
    		if ( $myApp->cfgCon( 'demo' ) ) {
    
    			$returnFields = array('Id', 'FirstName', 'LastName', 'City', 'State', 'Country');
    			$data = $myApp->findByEmail( $email, $returnFields );
    
    			$entry->setFirstName( $data['0']['FirstName'] );
    			$entry->setLastName( $data['0']['LastName'] );
    			
    			// Setup the email data to prepopulate.
    			$email    = array();
    			$email[1] = array();
    			
    			$email[1]['type']    = 'personal';
    			$email[1]['address'] = $email;
    			
    			// Store the email address in the cache.
    			$entry->setEmailAddresses( $email );
    			
    			// Setup the address data to prepopulate.
    			$address    = array();
    			$address[1] = array();
    			
    			$address[1]['type']    = 'home';
    			$address[1]['city']    = $data['0']['City'];
    			$address[1]['state']   = $data['0']['State'];
    			$address[1]['country'] = $data['0']['Country'];
    			
    			// Store the address data in the cache
    			$entry->setAddresses( $address );
    
    		} else {
    			
    			echo '<p>Infusionsoft connection error.</p>';
    		}
    		
    	}
    
    	return $entry;
    }
    Steven Zahm
    Keymaster

    @ Xavier

    I just visited your site in Chrome, Firefox and IE; latest versions. In all three browsers cMap seems to functioning correctly. I’m guessing the issue has been resolved? Let me know.

    Steven Zahm
    Keymaster

    @ Eric

    Lets see…

    re: starting on line 25
    Ok, I was contemplating on adding an action to one could target either the add or edit. That way different instructions can be given based on the users action.

    re: Where exactly do these code snippets get added?
    There’s several options. You could write you’re own plugin and drop the snippets in it. Another option is to drop it in the theme’s functions.php file. My personal favorite is installing Code Snippets. You could add the code I gave you as a new snippet. That’s the method I was using to test the filter to make sure it worked as expected.

    re: when will Link 2.0 and Form 2.0 be released?
    Best I can say… sooner rather than later. I see you purchase the Pro Pack — I can send you advanced copies. Having someone using them will help to find any remaining issues that I need to address before the official release. Is the email address on you account where I should send them?

    re: 3) The Member Home Page has a link offering people the opportunity to Add a Directory Entry.

    With the beta Form and Link, you could send them to a page with Form instead. Although, it sounds link you could create a “bridge” with DAP and automatically add them to Connections too. I am willing to bet they have an action that you could hook into post registration and programmatically add them to Connections. The you would only need to add a “View My Entry” link. When they visit it while logged in, they’ll be presented with an option to edit their entry.

    re: By the way, I love the idea that you would provide a hook for customizing the Directory form

    With the action hooks, you could echo out anything you want… Can you attach a screen capture of your manage page with the instructions? Just so I can see. Before I send you the betas, I’ll add the action(s).

    regards…

    in reply to: changing slim-plus.php #291976
    Steven Zahm
    Keymaster

    @ cheryl

    Ok, you would use this shortcode to remove the bio:
    [connections str_bio_head=""]

    That should do it.

    in reply to: changing slim-plus.php #291968
    Steven Zahm
    Keymaster

    @ cheryl

    Yes, it will. What text do you want to change? All of it can be changed in an update safe way. Please see this FAQ and this QuickTip.

Viewing 10 posts - 11,141 through 11,150 (of 15,332 total)