Example #1
0
function insert_cform($no = '', $custom = '', $c = '')
{
    global $post;
    $no = $no == '1' ? '' : $no;
    ### safety net
    $no = check_form_name($no);
    if (isset($_GET['pid'])) {
        $pid = $_GET['pid'];
    } else {
        if ($post->ID == 0) {
            $pid = false;
        } else {
            $pid = $post->ID;
        }
    }
    if (!$pid) {
        echo cforms($custom, $no . $c);
    } else {
        echo check_for_taf($no, $pid) ? cforms($custom, $no . $c) : '';
    }
}
Example #2
0
 $keys = array_keys($_POST);
 foreach ($keys as $key) {
     if (preg_match('/sendbutton(.*)/', $key, $no)) {
         break;
     }
 }
 $no = $no[1];
 if (function_exists('wp_get_current_user')) {
     $user = wp_get_current_user();
 }
 require_once dirname(__FILE__) . '/lib_validate.php';
 $comment_post_ID = (int) $_POST['comment_post_ID'];
 $cfpre = strpos(get_permalink($_POST['comment_post_ID']), '?') !== false ? '&' : '?';
 if ($all_valid) {
     if (isset($_POST['send2author']) && $_POST['send2author'] == '1') {
         cforms('', $no);
         header("HTTP/1.0 301 Temporary redirect");
         header("Location: " . get_permalink($comment_post_ID) . $cfpre . 'cfemail=sent#cforms' . $no . 'form');
         exit;
     }
     //
     // Filter first?
     //
     $sep = strpos(__FILE__, '/') === false ? '\\' : '/';
     $CFfunctions = dirname(__FILE__) . $sep . 'my-functions.php';
     if (file_exists($CFfunctions)) {
         include_once $CFfunctions;
     }
     if (function_exists('my_cforms_filter')) {
         $_POST = my_cforms_filter($_POST);
     }
Example #3
0
function insert_cform($no = '', $custom = '', $c = '')
{
    global $post;
    $pid = cfget_pid();
    if (!$pid) {
        echo cforms($custom, $no . $c);
    } else {
        echo check_for_taf($no, $pid) ? cforms($custom, $no . $c) : '';
    }
}
Example #4
0
function insert_custom_cform($fields = '', $no = '')
{
    global $post;
    if (isset($_GET['pid'])) {
        $pid = $_GET['pid'];
    } else {
        if ($post->ID == 0) {
            $pid = false;
        } else {
            $pid = $post->ID;
        }
    }
    if (!$pid) {
        cforms($fields, $no . '+');
    } else {
        echo check_for_taf($no, $pid) ? cforms($fields, $no . '+') : '';
    }
}