Runamok81
Forum Replies Created
-
thank you good sir!
Any ADI gurus that can weigh in on this? ??
[Topic marked as Resolved]
Well that was easier than expected! Just use PHPs concatenate and throw some commas in there. Whoo ha!
$_POST["input_42"] = $_POST["input_42"].",".$_POST["input_132"].",".$_POST["input_133"].",".$_POST["input_134"].",".$_POST["input_135"].",".$_POST["input_136"];
Thanks for pointing me in the right direction Jeremy!
That would be an option if I was using standard fields, but I’m actually using custom input types and those buggers don’t have the “save to taxonomy” checkbox! To workaround this, I’ve been lateraling the custom field’s input value into a standard field via pre_submission_handler. Since I’ve had success with this, I think I could expand it to work with multiple values.
That got me moving in the right direction!
If I check “save to taxonomy” and the “enhanced UI” buttons and then fill the box with some comma separated values, I can see that multiple (tag-style) values WILL populate to the same single taxonomy. Thanks Jeremy!Now that I know this method works, AND that I can’t have multiple fields saving to the same taxonomy, I realize that if I want to save multiple values to the same taxonomy it will have to be through a single input. Since I’m using multiple custom fields (single line text) to populate my taxonomy, I’m now trying to find a way to use a gform pre_submission_handler to concatenate my user inputs into a csv’d string and drop that into the “save to taxonomy” post value. I already do something similar in my functions.php for taxonomies that only get one value from the form. Note: All of this wouldn’t be needed to do this if the “save to taxonomy” box was available when using custom input types.
Here is my code which copies a value from one gform field into another, which in my case copies the value from a custom input field and pastes it into the “save to tax” box. The last commented out line is where I’m stuck…
/* Copies a value from one gform field into another. Used in combo with taxonomies to help build a search index * See here: https://www.gravityhelp.com/forums/topic/how-to-populate-a-hidden-field-with-een-other-field#post-81974 * [Save to Taxonomy field] = [GF Custom Field] */ add_action("gform_pre_submission_1", "pre_submission_handler"); function pre_submission_handler($form){ //reason $_POST["input_77"] = $_POST["input_89"]; //product $_POST["input_92"] = $_POST["input_90"]; //manufacturers??? //$_POST["input_92"] = $_POST["input_90"]+$_POST["input_92"]+$_POST["input_92"]; }
Long shot, but does any kind soul have any ideas on how to expand that code in a way which would string multiple $_POST values into a single csv’d $_POST value? If not, looks like I’m off to learn how/if PHP can cherry-pick values from an array and string them together…
Not sure if this helps you, but Gravity Forms is a powerful option to create posts. But it isn’t free. I use a GF post body field and insert merge tags into the content template. My post includes a link that pulls from the user input fields. Looks something like this.
<a href="https://maps.google.com/maps?q={Company address (Street Address):14.1}+{Company address (City):14.3},+{Company address (State / Province):14.4}+{Company address (Zip / Postal Code):14.5}+United+States" target="_blank">Map it!</a>
The same process may work for WPUF. Just find a way to get the address values into the URL and pass it to Google Maps.
Bump.
Just to be sure I am not asking something of CPT that is not possible, a follow up question…
Does anyone know if the WP schema allows for a single post to have multiple values in a single taxonomy? That is, can I have one post that is a member of the taxonomy colors with the values red, blue, green?
@professor 99
My site is actually intranet, so no contributor login available. I am satisfied in not using Relevannsi for the moment. Honestly, I do need to continue development so I have made a note to deliver firebug logs at a later point in time.Try installing the User Role Editor Plugin and removing the edit_published_posts capability from your users.
It turns out my issue was a plugin conflict with the popular Relevanssi “better search” plugin. Activating Relevanssi introduces the problem, deactivating it removes the problem. I confirmed the conflict on a few of my other sites.
Professor99, this issue is also present in the main fork.
I am experiencing a degradation in attachment functionality.
WP: 3.5
IIS: 6.0
PHP 5.3
Browsers: IE8, Chrome 23, FF 17Users can delete an attachment, but when they upload attachments they are not being rightfully attached and associated to their posts, instead they are going to the media gallery as unattached. From their perspective, the submit button simply changes to “please wait…” and nothing happens. Any advice on where to start troubleshooting this?
Forum: Plugins
In reply to: Need plugin suggestion: How to allow visitors to attach a file to post.Gave up on the snippets. I resolved the WPUF IE8 compatibility issues, and eventually settled on it. A combination of Gravity Forms and WPUF allows my users to register, and create a posts. When viewing their posts, they can upload attachments as proper post-attachments without visiting the backend. All users can see each other’s posts and attachments, but only the post author can upload attachments to a post.
Now we have a proper frontend user-based content and file upload system!
For those looking to achieve a similar setup….
My overall post creation and user attachment management system work like this. Users register and create their post via Gravity Forms. The GF Form appends the [wpuf-edit] shortcode into the post body. I made a some slight edits to wpuf-edit-post.php to HIDE the Title and Body form edit fields and leave only the add attachment.When browsing posts, the user can’t edit the title or body, but they CAN add attachments or participate in comments. No need to visit the backend, and all media resides in the media gallery proper as post attachments.
The root cause of my issues above was that my webserver (IIS6) does not have the silverlight mimetypes registered. No need to strip silverlight. After registering the silverlight mimetypes on IIS6, I used the original code and everything works! Thanks.
Professor99,
I believe I have this resolved. My webserver (IIS6) did not have the silverlight mimetypes registered of the box. This caused me to think silverlight was broken and explains why I resorted to stripping out silverlight in order to force flash on IE. My webserver didn’t recognize or want to serve files with a silverlight file extension. After I registered the silverlight mimetypes on IIS6.0 everything seems to work!
Here is some info on my setup. The PHP/MySQL versions are from the Microsoft WebPI 4 installer. WP is updated to 3.5
Server
——-
WordPress Version (3.5)
IIS Version (6.0) (+silverlight mimetypes)
PHP Version (5.3.18)
MySQL version (5.1.66-community)Client
——–
Platform (Windows 7 Enterprise x64)
Browser Version (IE8 reset to defaults)Another IE8 tip. Compatibility mode will break the plugin.
Hope this helps another soul who may be following in my footsteps!