nascent666
Forum Replies Created
-
Forum: Plugins
In reply to: [WP Calendar] [Plugin: WP Calendar] Template shortcodes?I figured it out myself, but I didn’t add the attributes to the shortcode itself:
<?php function get_cat_info(){ $market = getmarket(); //function that reads querystring $catname = $market."-events"; $idObj = get_category_by_slug($catname); $id = $idObj->term_id; return $id; }; function events_calendar_func( $atts ){ $id = get_cat_info(); global $fsCalendar; $content = "{events_calendar; categories=\"$id\";}"; return $fsCalendar->hookFilterContent($content); }; add_shortcode( 'events_calendar', 'events_calendar_func' ); ?>
Now I can put this in the template page:
<?php echo do_shortcode('[events_calendar]'); ?>
I marked this as resolved since both issues were addressed. Thanks!
I installed it and I’m able to delete single and multiple records. Also, I tried [cfdb-table form=”eNewsletter”] in a test Post and I don’t have any linking issues like wreston. I didn’t thoroughly test anything else.
I looked at your code and did some research. I looked at sprintf and saw all the type specifiers. I tried %f and that seemed to work for me. I was able to delete without any problems and none stayed in my database.
Can someone else confirm?
it produces…
~submit_time~ = 1301410875.556900
It added two zeros at the end, but it doesn’t seem to affect the deleting.
ok…tried it, but it’s still not deleting. It’s missing the decimal point and the four numbers after. However, this doesn’t have the single quotes in it like the %s had.
delete from ~wp_CF7DBPlugin_SUBMITS~ where ~form_name~ = 'eNewsletter' and ~submit_time~ = 1301331622
%d = xxxxxxxxxx
%s = ‘xxxxxxxxxx.xxxx’So I guess now wehave to figure out where the single quotes are coming from with the %s.
Well…I tried 1.8.2 and I get inconsistent delete results. Sometimes it deletes all the ones I want, sometimes it deletes 1 of 3, or 2 of 4, but it always seems to leave two in the database.
The delete all seems to work, though.
Not sure if it’s the plugin or my SQL database at this point, but I am able to delete the items in phpMyAdmin by using the SQL DELELE statement without quotes for the submit_time.
Also, when I do the print_r in the code, I do see single quotes again, but I’m not sure where they are coming from.
delete from ~wp_CF7DBPlugin_SUBMITS~ where ~form_name~ = 'eNewsletter' and ~submit_time~ = '1301319511.9545'
I tried upgrading and completely removing the tables and doing a fresh install. I get the same results with any configuration/installment method.
I also reverted back to my modified 1.8.1 version and tested it and I get inconsistent results there, too. So maybe removing the single quotes around the %s wasn’t enough.
When I do a print_r for just the $wpdb variable, this is SOME of what I see…
... wpdb Object ( [last_query] => delete from ~wp_CF7DBPlugin_SUBMITS~ where ~form_name~ = 'eNewsletter' and ~submit_time~ = '1301319511.9545' ... [charset] => utf8 [collate] => ... [func_call] => $db->query("delete from ~wp_CF7DBPlugin_SUBMITS~ where ~form_name~ = 'eNewsletter' and ~submit_time~ = '1301319511.9545'") ) ...
Maybe the collate needs to be set? I’m using utf8_inicode_ci. Other than that, I’m stumped.
Forum: Plugins
In reply to: [WP Calendar] [Plugin: WP Calendar] DB Error when inserting an EventFollow up…
I think there is a bug in your CREATE TABLE within fsCalendar.php. I think it needs to be:
.... publishauthor BIGINT NULL, publishdate INT NULL, ....
In order for me to add an Event, I needed to change the structure of your table, wp_fsevents. I changed the fields, publishauthor and publishdate to allow NULL.
From your code before, I removed the single quotes and I can now delete multiple rows.
$wpdb->query( $wpdb->prepare( "delete from ~$tableName~ where ~form_name~ = '%s' and ~submit_time~ = %s", $currSelection, $name));
It shows the three records with the same submit_time with or without the quotes.
MySQL 5.0.67-community-nt
I think you stumbled upon something. If I try to delete with quotes, like
delete from wp_cf7dbplugin_submits where submit_time = '1300981171.0724'
then it doesn’t work. BUT, if you remove the quotes, it deletes the records:
delete from wp_cf7dbplugin_submits where submit_time = 1300981171.0724
Follow-up
I tried this statement directly in phpmyadmin and it didn’t delete there:
DELETE FROM ~wp_cf7dbplugin_submits~ WHERE ~submit_time~ = '1300798323.9905'
but if I do a SELECT * FROM, I see the three results.
If I do
DELETE FROM ~wp_cf7dbplugin_submits~ WHERE ~form_name~ = 'eNewsletter'
then all of the records get deleted. It’s definitely related to the submit_time
WP doesn’t like the echo there. Doesn’t show anything but a blank page, so there must be a php syntax error.
However, I tried print_r as in:
print_r ($wpdb->prepare( ..... );
and I got this when trying to delete two entries:
delete from ~wp_CF7DBPlugin_SUBMITS~ where ~form_name~ = 'eNewsletter' and ~submit_time~ = '1300798323.9905'delete from ~wp_CF7DBPlugin_SUBMITS~ where ~form_name~ = 'eNewsletter' and ~submit_time~ = '1300798309.3054'
Note: I replaced the backticks with ~ in this example so the code tags won’t show.
They have the decimals:
<input type="checkbox" name="1300798323.9905" value="row"/> <input type="checkbox" name="1300798309.3054" value="row"/> <input type="checkbox" name="1300798290.1642" value="row"/>
I’ve only created test accounts from 1.8 and above. All these are from 1.8.1 since I cleared the database before making these.
Almost there. I installed 1.8.1 and when I went to the listing or records, I was able to delete a single one. Then when it refreshed the page, I couldn’t delete anymore consistently. Also, it doesn’t seem to delete, say 2 out of 3.
Once, I chose 3 of 5 records and it only deleted one, which I think was the oldest record, but that seemed to be a fluke since I couldn’t replicate that.
Not sure if it’s me at this point or the plugin.
BTW…I’m using FireFox 3.6.15
Forum: Plugins
In reply to: [Plugin: Contact Form 7] form not working in footer, works in contentI had the same problem. Watch the placement of the wp_footer() function. They say to place it right before the closing </body>, but I had to move that right before my code for the form to work:
<?php wp_footer(); ?> <?php echo do_shortcode( '[contact-form 1 "eNewsletter"]' ); ?>