Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
- This topic has 18 replies, 3 voices, and was last updated 9 years, 4 months ago by
Steven Zahm.
-
AuthorPosts
-
03/31/2014 at 10:55 am #284015
Eric Bobrow
Guest[Posting this again, since I’m not seeing it show up in the forum topic list – is this because you have to manually approve the postings?]
Hi Steven –
I’d like to add some instructions and perhaps some additional graphics or a video to the Edit My Directory Entry page.
Where is the file located that generates this page in the admin area?
At minimum, I’d like to add some explanatory text to point out important things to the user when they create or edit their directory entry. If I can do that by editing a PHP file, then I think I can also add in the code that would put in graphics or a video player too.
By the way, I’m doing this because I haven’t been able to use the Form and Link add-ons to edit the logged in user’s entry from the public area of the site. This may be caused by another issue I am trying to work out with my membership plugin, so I will look at that later. Right now, all I’d like is to be able to customize the Edit My Directory Entry page in the admin area.
Thanks in advance for pointing me in the right direction!
Eric
03/31/2014 at 1:58 pm #284057Steven Zahm
Keymaster@ Eric
The file you need to edit is
manage.php
found here:
../wp-content/plugins/connections-link/submenus/
I recommend inserting your code starting on line 25.
Front end editing of linked user account and Connections entry is not yet possible. Form 2.0 and Link 2.0 will enable this ability.
Hope that helps!
05/22/2014 at 1:57 pm #291872Eric Bobrow
GuestHi Steven –
I’m returning to this little project again, and have made a bit of progress.
I was able to edit the manage.php file and successfully echo text near the top of the page so now I’ll be able to put in custom directions for the user to refer to as they fill in the form.
I would like to auto-fill in some of the form fields to make this even easier. I have access in PHP to the contact’s name and email address, and possibly their city and country, and would like to put these in to the form fields for them.
In the manage.php I don’t see where these fields are created for the form. It looks like perhaps this is handled in another PHP file related to meta_boxes. Can you point me in the right direction so I can look at whatever files are creating the form code?
If for some reason it is not going to be possible to use PHP for this, my fall-back will be to use jQuery and fill in the fields using Javascript after the page loads. However, I’d prefer to use PHP if possible.
Eric
05/22/2014 at 2:00 pm #291873Eric Bobrow
ParticipantHi Steven –
I’m returning to this little project again, and have made a bit of progress.
I was able to edit the manage.php file and successfully echo text near the top of the page so now I’ll be able to put in custom directions for the user to refer to as they fill in the form.
I would like to auto-fill in some of the form fields to make this even easier. I have access in PHP to the contact’s name and email address, and possibly their city and country, and would like to put these in to the form fields for them.
In the manage.php I don’t see where these fields are created for the form. It looks like perhaps this is handled in another PHP file related to meta_boxes. Can you point me in the right direction so I can look at whatever files are creating the form code?
If for some reason it is not going to be possible to use PHP for this, my fall-back will be to use jQuery and fill in the fields using Javascript after the page loads. However, I’d prefer to use PHP if possible.
Eric
05/23/2014 at 11:28 am #291958Steven Zahm
Keymaster@ Eric
Pre-population, I like it… I just added a filter to both Form 2.0 and Link 2.0 that will easily allow this to be accomplished.
Assuming you’re using Link 1.0.5, change line 37 to this:
$entry = apply_filters( 'cnl_admin_add_entry_object', new cnEntry() );
Now you’ll be able to hook into the
cnl_admin_add_entry_object
filter for pre-population and be ready for Link 2.0 to boot.Here’s an example on how to use the filter:
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' ); $entry->setFirstName( 'First' ); $entry->setLastName( 'Last' ); // Setup the email data to prepopulate. $email = array(); $email[1] = array(); $email[2] = array(); $email[1]['type'] = 'personal'; $email[1]['address'] = 'personal@email.add'; $email[2]['type'] = 'work'; $email[2]['address'] = 'work@email.add'; // 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'] = 'Reading'; $address[1]['state'] = 'PA'; $address[1]['country'] = 'United States of America'; // Store the address data in the cache $entry->setAddresses( $address ); return $entry; }
Of course you’ll need to add the code necessary to pull the data from your source for pre-population and some conditional to determine when the to pre-populate because you would want to do it for every single entry with the same data.
Can you tell me where exactly you added the code that renders the instruction text? If it makes sense from a big picture view, I can add an action that can be hooked into to render anything one could dream of before the form.
05/23/2014 at 11:30 am #291959Steven Zahm
Keymaster@ Eric
Oh, I want to point out … with Link 2.0, if Form 2.0 is installed and activate, that’ll allow front-end editing for users’ entries.
05/23/2014 at 12:53 pm #291962Eric Bobrow
ParticipantSteven –
I’m delighted to see your detailed answer on this question, however I’m unclear exactly where to place these code snippets. Right now, I’m editing manage.php (in plugins/connections-link/submenus) as you instructed earlier, starting on line 25.
Where exactly do these code snippets get added?
Also, when will Link 2.0 and Form 2.0 be released? I’d love to beta test them, it would simplify things a lot.
Here is my current process that I’ve set up:
1) Visitor comes to standard WordPress page on the site with a signup form created by Digital Access Pass [DAP] (a robust membership plugin), and enters their first and last name and email address, then hits the Submit button.
2) DAP then does a bunch of work:
a) it adds them as a WP user, creating a secure password for them
b) it adds them to its own member list (which is maintained using other tables inside the WP database)
c) it logs them in to the site (both WP and DAP) with their new account
d) it redirects them to a Member Home Page which can display information on their account
e) it sends them an email with their login name and password, so they can log back into the site later
f) it connects to my Infusionsoft CRM account through its API and adds them as a contact into Infusionsoft and tags them as a member of this website directory list. If they are already in my system, then it simply tags their record. Infusionsoft can then start a campaign or a series of actions or add them to an autoresponder email sequence.3) The Member Home Page has a link offering people the opportunity to Add a Directory Entry. This is programmed to take them to
http://www.archicaduser.com/wp-admin/users.php?page=connections_link4) In the manage.php script, I am able to pull the email from DAP for the currently logged in user, then query Infusionsoft for other data such as their first and last name, which I will use to prepopulate the directory form fields.
5) Once I’ve got the prepopulation working, I intend to email my list from Infusionsoft, encouraging them to sign up for the User Directory. I’ll provide a customized link in the email that will send them to a signup page on the website with a coded URL containing their contact info as arguments. These arguments will be used to prepopulate the DAP signup form.
After they submit the form, DAP will do all the work listed in step 2 above. They’ll go to the Member Home Page, then to the Add My Directory entry page. The PHP code will pull their contact info from DAP and Infusionsoft to prepopulate the Directory form with their address as well as email and name.
6) This process may be scripted to automatically flow through and do the DAP signup submit action for them, since they are coming to the page after clicking a link saying “Click here to add yourself to the ArchiCAD User Directory”.
I want to make this as easy as possible – simply click the link, and get added to the site member list and have the form partially filled out, ready for a quick review and for people to add more info as they wish.
I hope this is clear enough so that you understand what I’m trying to do. I’ve got most of the mechanics working, except for the pre-population of the Directory form. Once you explain where these code snippets go, I’ll be able to finish this up.
By the way, I love the idea that you would provide a hook for customizing the Directory form so that developers can add Instructions for their site members to refer to while filling in the form. It would be awesome if this could go beyond simple text, and allow HTML code, because then one could even insert a video to greet the visitor and give them motivation and instructions.
Eric
05/23/2014 at 5:34 pm #291978Steven 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…
05/23/2014 at 6:06 pm #291979Eric Bobrow
ParticipantThanks for responding with such care.
I’ll use Code Snippets, that sounds like a great tool.
Assuming I do this, where would I actually call the function cnl_alter_add_entry_object
and what would I need to set up ahead of time to have the right data available?Although I can sort of hack around PHP code, I don’t understand what filters do. And I’m used to thinking about a function as something one defines in one place, then calls from one or more other places in the interface.
So right now I think I need to add some code to the manage.php file that would successfully call the cnl_alter_add_entry_object function that you just wrote up in the earlier comment. Is that right?
If so, what sort of array of data would I need to set up before the call, and how would the function be called?
Here is the testing code I added to manage.php starting at line 25:
// ——————————————————–
// CODE ADDED BY ERIC BOBROW
// ACCESS USER INFO FROM DIGITAL ACCESS PASS (DAP) DATABASEinclude_once “/dap/dap-config.php”;
$user = null;if( Dap_Session::isLoggedIn() ) {
$session = Dap_Session::getSession();
$user = $session->getUser();
$email = $user->getEmail();
$firstName = $user->getFirst_name();
$lastName = $user->getLast_name();
$userName = $user->getUser_name();
}echo ‘<p id=”test-mod”>’;
echo $firstName;
echo ‘ – Welcome to the ArchiCAD User Directory!</p>’;// ACCESS USER INFO FROM INFUSIONSOFT API
include_once “isdk.php”;
$myApp = new iSDK;# $email = ‘eric@bobrow.com’;
if ($myApp->cfgCon(“demo”)) {
echo ‘<p>Infusionsoft connection successful.</p>’;
$returnFields = array(‘Id’, ‘FirstName’, ‘LastName’, ‘City’, ‘State’, ‘Country’);
$data = $myApp->findByEmail($email, $returnFields);
echo ‘<p>Email address: ‘ , $email , ‘<br />’;
echo ‘First Name: ‘ , $data[“0”][“FirstName”] , ‘<br />’;
echo ‘Last Name: ‘ , $data[“0”][“LastName”] , ‘<br />’;
echo ‘City: ‘ , $data[“0”][“City”] , ‘<br />’;
echo ‘State: ‘ , $data[“0”][“State”] , ‘<br />’;
echo ‘Country: ‘ , $data[“0”][“Country”] , ‘</p>’;} else {
echo ‘<p>Infusionsoft connection error.</p>’;
}// END OF ADDED CODE
// ——————————————————–Right now I haven’t written up the instructions, I’ve just gotten the connections to DAP and Infusionsoft working and know how to echo the returned data at the top of the Connections page.
Yes, the email address on file for my license of your plugin bundle is the one that you can use to send me things. I’m very interested in working with you to get my site optimized, and will be very happy to give you constructive feedback about your interface and features – I have a lot of experience with user interface design.
Eric
Attachments:
You must be logged in to view attached files.05/23/2014 at 7:47 pm #291981Eric Bobrow
ParticipantHi Steven –
I installed Code Snippets and copied and pasted the snippet you provided above, creating a snippet and activating it. I was hoping that in the Connections: Add My Directory Entry page that it might pre-populate the fields with the dummy data you put into the snippet (i.e. an address of Reading PA), however there did not appear to be any data in the Directory Entry.
If it would be helpful, and you’d be willing to spend the time to set this up, I’ll give you a WP Admin account plus FTP access. I would be happy to pay you for this, as long as the cost was reasonable. Alternatively, please keep responding here in the forum and I’ll do my best to follow your instructions!
Eric
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.