scamrwordpressadmin
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Connecting to OpenVMS on VAXThank you! I will find out if OpenVMS can do so.
Hi Tobias,
I was wondering about that – so thanks for the push that direction. I wrote a function which will now pull a variable directly from a table cell, using your TablePress Extension shortcode. Works like a charm!
For others who might run into this, here is what I did. I suspect there are more elegant solutions out there, but this works for me.
Create a function that first finds the tablepress ID for the table I want to reference.
Then, create a string that represents the shortcode to be run, adding in the tablepress ID in the midst, and return that value.Lastly, create a variable that is assigned this new shortcode string. Use the variable where the shortcode would be used.
function nameofthishike_get_var()
{
global $my_nameofthishike_var;
$my_tablecellid_var=tablepressid_get_var();
$my_hike_shortcode_var=sprintf(“[table-cell id=”.$my_tablecellid_var.” cell=H2/]”);
$my_nameofthishike_var=sprintf($my_hike_shortcode_var);
return $my_nameofthishike_var;
}<?php $nameofthishike=nameofthishike_get_var();?>
Hi.
The TablePress extension pulls the data out just great!I could use some pointers however. I would like to be able to send in the ID as a variable, so that I can reuse the shortcode on different event pages.
ie: [table-cell id=xx cell=H2 /], where the xx would be sent in depending upon the table I need to reference.
Thanks in advance for the pointers. I’ve been slogging through support forums all day, and just keep finding things that don’t seem to work.
Regards,
Kathy
In researching this further, I ran across your Tablepress Extension for accessing individual table cells. I will play with that a bit, and update this thread with the results.
Extension can be found here: https://tablepress.org/extensions/table-cell-shortcode/
Thanks Michael,
Your pointer was very useful and helped me create a dropdown menu choice for the contact form.
As always, your help is extremely appreciated.
Cheers
Kathy
Forum: Plugins
In reply to: [Contact Form 7] CF7 menu with pipes – Mail TO: hs syntax errorDeleted everything in the TO: field on the mail form, and then retyped it back in. Now all works fine. Not sure what is different, but it’s working, so closing this one out.
Forum: Hacks
In reply to: If Field A exists, THEN If Field B exists, we have duplicate entry@bcworkz – Thanks So Much!! for all of the great info. Lots to learn – but it’ll be fun pulling it all together. I appreciate all the time you spent in your reply. Have a great day.
Forum: Fixing WordPress
In reply to: How to stop address line at top of page from printing@dartiss – Thank You so much! That was it. I appreciate your response and the link as well. Have a great day!
Forum: Hacks
In reply to: If Field A exists, THEN If Field B exists, we have duplicate entryHi bcworkz,
Thank so much for all the input/advice.
You are so right about user input and data consistency. Right now, the user selects the hike name via a drop-down. However, the full text string is stored, I didn’t use an ID. I really like that idea! The user Name, email and phone # all are auto populated because the user has to be logged in, in order to sign up for a hike. So I at least started on the right track. ??
The sign-up form is created with the Contact Form 7 plug-in. I’ll have to see if/how I can add sub-filters (for large #s of hikes), and how I would do the hidden fields when a hike is chosen. There are several pieces of data I’d like to populate the table with based upon the hike choice – so I can query on them later – as you pointed out!
I really like your idea of popping up a dialog box when the drop-down selection changes, IF the user had previously signed up for that hike. Much better user experience. Looks like I’ll be learning Ajax.
Altering the db schema isn’t an issue – better to get it right *before* the data starts getting loaded and the db used!
Again, many thanks. Looks like I have lots to learn – so I’d best get started. If you have any reference materials on these topics that you have found useful, and you wouldn’t mind – would you shoot me over the link/names of them. Might save me time vs digging through non-useful materials.
Cheers and have a great week.
Forum: Plugins
In reply to: [Contact Form 7] Can you use conditional statements in contact formHas anyone tried this?
I’d like to auto populate some fields in the contact form, based upon how the user answers a question. Is this possible?Forum: Plugins
In reply to: [Contact Form DB] Recommendation: one form name vs multiple formsThanks Michael! Work using (B) is underway!
I currently have 2 forms, one the user interacts with, selecting the event name via dropdown, and then the user’s name, phone, email are auto populated from their login. Behind the scenes (user can’t see) I have a second form with the event name and event particulars pre-populated. This is because I want the user to just select the event name from drop-down and then have the event date, and other particulars auto populate when a query is run. I don’t want to rely on the user to enter that info correctly.
I set up a query using
[cfdb-table form="form1,form2"]
, and when I query on an event, I do get the info from both tables. The only problem is that the results are on two separate rows in the query results table, each displaying that form’s particular info. Is there a way to combine the info from both tables into one line?Forum: Plugins
In reply to: [Contact Form DB] How to pass variables into shortcodeThat worked like a charm! Thanks so much!
Forum: Plugins
In reply to: [Contact Form DB] How to pass variables into shortcodeI have the Advanced Custom Fields plug in, and have defined my fields there. The field shows up on the Event form when I create an event, and I can fill in the form name there. Then, in single-event.php, I do:
<?php $cfdbformname=get_field("sign_up_custom_form_name");?>' then I have tried a couple of things. 1) just calling it outright: ' [cfdb-table form=$cfdbformname class="hikersgoingclass" ..etc
and 2) creating a variable with the shortcode, and calling that:
<?php $cfdbtableshortcode = '[cfdb-table form=$cfdbformname class="hikersgoingclass"
.. etc
<?php echo do_shortcode($cfdbtableshortcode);?>
I must admit I’m not sure where/when to use single vs double quotes, so I might have those wrong.
Forum: Plugins
In reply to: [Contact Form DB] How to pass variables into shortcodeHi Michael. Sorry that I wasn’t more clear.
You are correct, I can use the $_GET for example, to fill the variable.
So, for example, my variable is $cfdbformname. The value is “San Tan – Moonlight Trail (Short) – 2 Nov 2016”
I call the shortcode like this:
[cfdb-table form=$cfdbformname class="hikersgoingclass"
…etcBut when the shortcode runs, it sees the form variable as $cfdbformname and not the actual value of the variable, like this:
[cfdb-table form=$cfdbformname class="hikersgoingclass"
…etc instead of[cfdb-table form="San Tan - Moonlight Trail (Short) - 2 Nov 2016" class="hikersgoingclass"
Forum: Plugins
In reply to: [Plugin: Events Calendar Pro] How to use multiple event templatesRESOLVED:
1. Using the Advanced Custom Fields Plug-In, I created a custom field called is-there-a-hike. This has a field type of Select, and the options are 1 : YES and 0 : NO. The default value is set to 1 (yes), so I only have to change it in the no hike scenarios. Then in the Location section for this custom field (still in the ACF custom field), the “Show this field group if” is set as “Post Type is equal to tribe_events”. This way this custom field ONLY shows up if I am creating a calendar event – but it won’t show for any regular page or post work.
I set the Order No (under options right below the Location box) to 0 – so that it will be the first custom field to show for an event. That way, if there is no hike, I can select no on that field and be done quickly.
2. In my custom single-event.php file. This is stored in my child theme in a folder called tribe-events. DO NOT modify the original Tribe-events file.
Create a IF/THEN loop so that IF the is_there_a_hike custom field is set to 1 (YES), the information shows, and IF the variable is set to 0 (NO) then the info is hidden.
<!-- SHOW CONTENT ONLY IF THERE IS A HIKE --> <?php $ishike=get_field("is_there_a_hike")?> <!-- get value from custom field --> <?php if ($ishike == 1) {?> <!-- stuff you want to show when there is a hike (variable is set to 1 (yes)) goes here --> <?php } ; ?> <!-- END IF, SHOW SECTION ONLY IF HIKE THAT DAY -->
I’m sure there are more glamorous ways to do this, but it works pretty slick.