Forum Replies Created

Viewing 15 replies - 16 through 30 (of 83 total)
  • Thread Starter pixelnate

    (@pixelnate)

    Thanks for the warning.

    Thread Starter pixelnate

    (@pixelnate)

    I told you where that happens already, between lines 431 and 523.

    To tell you the truth, I read your response about five times and never saw that there. Sorry, it’s been a very long week, and it’s only Wednesday.

    I agree that setting up the fields as dynamic and feeding an array to gravity forms would work great, except that the dataset we are using begins life as a spreadsheet. Your plugin already parses the data in the csv file, and puts it in all the same tables as gravity forms does, the only thing it doesn’t do is trigger the notification emails, so it is the perfect basis for the additions I need to make.

    What I have decided to do is add all the $_field_num=>$_valu pairs generated by the switch on line 437 to an array, then I can take those values, replace them in the notification email set up in wysiwyg editor for gravity forms form and then use mail() to send the emails to people that should be receiving them.

    Since you are accusing me of creating spam (ahem) I’ll let you in on what we are doing. This religious organization that we work with is trying to connect high school students in local church youth groups with the church youth group of the college that they are planning to attend.

    On the front end a high school student can enter their information in a form and when that info is submitted a notification email is sent back to the student welcoming them and giving them information about the youth group. Another email is sent to the youth group leader at the college informing them of a student interested in joining their group and provide contact info for the student so that they call the student and welcome them personally to the group.

    At high school youth group gatherings the youth group leaders/ministers sometimes collect the same information about the students, with their knowledge, then send a spreadsheet to the organization running the website. We use your awesome plugin (the only one of its type in the WordPress univers) to get that batch of student information into the database, but by default, there are no notifications sent to the student or youth group minister at the college. Sure, the owner of the website could select all those new records in the admin and choose to “re-send” notifications to the relevant parties, but they want it to be automatic. That’s where I come in, and it’s the reason we are having this conversation about adding notifications to the parsecsv.lib.php file. πŸ™‚

    Thanks for your help.

    P.S. It just dawned on me that I might just be able to put the IDs of each of the new records into an array and then trigger Gravity Forms’ built-in resend_notifications() function on each of those entries that way. Or better yet, just take the last $rowcount number of records in the lead_id column and “resend” the notifications to them.

    I am glad we had this talk.

    Thread Starter pixelnate

    (@pixelnate)

    The array for each row gets emptied and then repopulated after the row has been entered into the database

    This is what I need to know about. Where does this happen, in the parsecsv.lib.php file? What i am looking to do is pull out a couple of values out of each record (both of them email addresses) and then set up a function that will use the resend_notification() function in Gravity Forms to send the notification emails out to the people affected in each record. What I need to know is where in the process I need to add my extra plumbing? i could send out each notification manually after the CSV has been parsed, but the client wants it automated.

    BTW, thanks for responding so quickly.

    Thread Starter pixelnate

    (@pixelnate)

    bump

    I found this link that looks promising. I’ll be trying it out this weekend, and will report my findings.

    Did you ever come up with a solution for this dcooney? I want to do something similar, like how they do print template on tastykitchen.com . The print layouts are completely separate files.

    I could be wrong, but I believe that is_multi_author() is a function introduced in WordPress 3.2.

    Thread Starter pixelnate

    (@pixelnate)

    I could kiss you, you sexy half-elf support rogue. It works brilliantly!

    – Wannabe Knight Elf Mohawk

    Thread Starter pixelnate

    (@pixelnate)

    This is my full code. It hits the db twice, once to find the total number of posts and once to put them in an array for use in the loop. That could probably be refactored into in a single query, but I am not the best php progger and there are hotter issues on my plate at the moment. I hope it helps, or at least gets you closer to solving your issue.

    $total = "
    	SELECT *,
    	m1.meta_value AS start_date,
    	IF( m2.meta_value=0, m1.meta_value, m2.meta_value ) as last_day
    	FROM {$wpdb->prefix}posts
    	INNER JOIN {$wpdb->prefix}postmeta m1
    	  ON ( {$wpdb->prefix}posts.ID = m1.post_id )
    	INNER JOIN {$wpdb->prefix}postmeta m2
    	  ON ( {$wpdb->prefix}posts.ID = m2.post_id )
    	WHERE {$wpdb->prefix}posts.post_type = 'events'
    	AND {$wpdb->prefix}posts.post_status = 'publish'
    	AND ( m1.meta_key = '_startdate' AND m1.meta_value)
    	AND ( IF( m2.meta_value=0, m1.meta_value, m2.meta_value ) > DATE_FORMAT( NOW(), '%Y%m%d%H%i') )
    	AND ( m2.meta_key = '_enddate' AND m2.meta_value >= '0' )
    	GROUP BY {$wpdb->prefix}posts.ID
    	ORDER BY start_date
    	ASC;
    ";
    
    $totalevents = $wpdb->get_results( $total, OBJECT );
    
    $ppp = intval( get_query_var( 'posts_per_page' ) );
    
    $wp_query->found_posts = count( $totalevents );
    
    $wp_query->max_num_pages = ceil( $wp_query->found_posts/$ppp );
    
    $on_page = intval( get_query_var( 'paged' ) );
    
    if( $on_page == 0 ){ $on_page = 1; }
    
    $offset = ( $on_page-1 ) * $ppp;
    
    $wp_query->request = "
    	SELECT *,
    	m1.meta_value AS start_date,
    	IF( m2.meta_value=0, m1.meta_value, m2.meta_value ) as last_day
    	FROM {$wpdb->prefix}posts
    	INNER JOIN {$wpdb->prefix}postmeta m1
    	  ON ( {$wpdb->prefix}posts.ID = m1.post_id )
    	INNER JOIN {$wpdb->prefix}postmeta m2
    	  ON ( {$wpdb->prefix}posts.ID = m2.post_id )
    	WHERE {$wpdb->prefix}posts.post_type = 'events'
    	AND {$wpdb->prefix}posts.post_status = 'publish'
    	AND ( m1.meta_key = '_startdate' AND m1.meta_value)
    	AND ( IF( m2.meta_value=0, m1.meta_value, m2.meta_value ) > DATE_FORMAT( NOW(), '%Y%m%d%H%i') )
    	AND ( m2.meta_key = '_enddate' AND m2.meta_value >= '0' )
    	GROUP BY {$wpdb->prefix}posts.ID
    	ORDER BY start_date
    	ASC
    	LIMIT $ppp
    	OFFSET $offset;
    ";
    
    $events = $wpdb->get_results($wp_query->request, OBJECT);
    
    if ( $events ) : foreach ( $events as $post ) : setup_postdata( $post );
    
    	// YOUR LOOP GOES HERE
    
    	endforeach;
    endif; ?>
    Thread Starter pixelnate

    (@pixelnate)

    Anyone else having problems like this?

    Thread Starter pixelnate

    (@pixelnate)

    cURL is enabled for PHP and the site is hosted on the God awful MediaTemple grid service.

    I am seeing the same problem. The embed codes don’t work on other WP sites. The code generates an error that reads:

    “You need to install or upgrade Flash Player to view this content, install or upgrade by clicking here.”

    C’mon Rodrigo, what’s going on here?

    Do you think you would like to take over the development of this plugin? The developer seems to have abandoned it.

    Thread Starter pixelnate

    (@pixelnate)

    As it turns out, there was an answer in this forum that worked perfectly. And it works with both the default next/previous links as well as the Pagenavi plugin.

    http://wordpress.org/support/topic/custom-select-query-w-pagination?replies=11

Viewing 15 replies - 16 through 30 (of 83 total)