当前位置: 首页>>代码示例>>PHP>>正文


PHP CF7DBPlugin类代码示例

本文整理汇总了PHP中CF7DBPlugin的典型用法代码示例。如果您正苦于以下问题:PHP CF7DBPlugin类的具体用法?PHP CF7DBPlugin怎么用?PHP CF7DBPlugin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CF7DBPlugin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: CF7DBPlugin_init

function CF7DBPlugin_init($file)
{
    require_once 'CF7DBPlugin.php';
    $aPlugin = new CF7DBPlugin();
    // Install the plugin
    // NOTE: this file gets run each time you *activate* the plugin.
    // So in WP when you "install" the plugin, all that does it dump its files in the plugin-templates directory
    // but it does not call any of its code.
    // So here, the plugin tracks whether or not it has run its install operation, and we ensure it is run only once
    // on the first activation
    if (!$aPlugin->isInstalled()) {
        $aPlugin->install();
    } else {
        // Perform any version-upgrade activities prior to activation (e.g. database changes)
        $aPlugin->upgrade();
    }
    // Add callbacks to hooks
    $aPlugin->addActionsAndFilters();
    if (!$file) {
        $file = __FILE__;
    }
    // Register the Plugin Activation Hook
    register_activation_hook($file, array(&$aPlugin, 'activate'));
    // Register the Plugin Deactivation Hook
    register_deactivation_hook($file, array(&$aPlugin, 'deactivate'));
}
开发者ID:sonvq,项目名称:vayvonlive,代码行数:26,代码来源:CF7DBPlugin_init.php

示例2: handleShortcode

 /**
  * @param $atts array of short code attributes
  * @param $content string not used
  * @return string export link
  */
 public function handleShortcode($atts, $content = null)
 {
     $atts = $this->decodeAttributes($atts);
     $params = array();
     $params[] = admin_url('admin-ajax.php');
     $params[] = '?action=cfdb-export';
     $special = array('urlonly', 'linktext', 'role');
     foreach ($atts as $key => $value) {
         if (!in_array($key, $special)) {
             $params[] = sprintf('&%s=%s', urlencode($key), urlencode($value));
         } else {
             if ($key == 'role') {
                 require_once 'CF7DBPlugin.php';
                 $plugin = new CF7DBPlugin();
                 $isAuth = $plugin->isUserRoleEqualOrBetterThan($value);
                 if (!$isAuth) {
                     // Not authorized. Print no link.
                     return '';
                 }
             }
         }
     }
     $url = implode($params);
     if (isset($atts['urlonly']) && $atts['urlonly'] == 'true') {
         return $url;
     }
     $linkText = __('Export', 'contact-form-7-to-database-extension');
     if (isset($atts['linktext'])) {
         $linkText = $atts['linktext'];
     }
     return sprintf('<a href="%s">%s</a>', $url, $linkText);
 }
开发者ID:sonvq,项目名称:vayvonlive,代码行数:37,代码来源:CFDBShortcodeExportUrl.php

示例3: get_option

/**
 * Mock WP get_options
 * @param $optionName
 * @return null
 */
function get_option($optionName)
{
    $optionName = substr($optionName, strlen('CF7DBPlugin_'));
    $plugin = new CF7DBPlugin();
    $options = $plugin->getOptionMetaData();
    if (isset($options[$optionName])) {
        if (strpos($optionName, 'Can') === 0) {
            return "Anyone";
        }
        switch ($optionName) {
            case 'SubmitDateTimeFormat':
                return 'F j, Y g:i a';
            case 'date_format':
                return 'F j, Y';
            case 'time_format':
                return 'g:i a';
        }
        $count = count($options[$optionName]);
        if ($count == 1) {
            return null;
        }
        return $options[$optionName][1];
    }
    return null;
}
开发者ID:femgineer,项目名称:website,代码行数:30,代码来源:WP_Mock_Functions.php

示例4: nextRow

 /**
  * @return array|bool associative array of the row values or false if no more row exists
  */
 public function nextRow()
 {
     if ($this->dataIterator->nextRow()) {
         $row = array();
         $row['submit_time'] = $this->dataIterator->row['submit_time'];
         $fields_with_file = null;
         if (isset($this->dataIterator->row['fields_with_file']) && $this->dataIterator->row['fields_with_file'] != null) {
             $fields_with_file = explode(',', $this->dataIterator->row['fields_with_file']);
             if ($this->plugin == null) {
                 require_once 'CF7DBPlugin.php';
                 $this->plugin = new CF7DBPlugin();
             }
         }
         foreach ($this->dataIterator->displayColumns as $aCol) {
             $row[$aCol] = $this->dataIterator->row[$aCol];
             // If it is a file, add in the URL for it by creating a field name appended with '_URL'
             if ($fields_with_file && in_array($aCol, $fields_with_file)) {
                 $row[$aCol . '_URL'] = $this->plugin->getFileUrl($row['submit_time'], $this->formName, $aCol);
             }
         }
         return $row;
     } else {
         return false;
     }
 }
开发者ID:rconnelly,项目名称:vacationware,代码行数:28,代码来源:CFDBFormIterator.php

示例5: fscfMenuLinks

 /**
  * Function courtesy of Mike Challis, author of Fast Secure Contact Form.
  * Displays Admin Panel links in FSCF plugin menu
  * @return void
  */
 public function fscfMenuLinks()
 {
     $displayName = $this->plugin->getPluginDisplayName();
     echo '
     <p>
   ' . $displayName . ' | <a href="admin.php?page=' . $this->plugin->getDBPageSlug() . '">' . __('Database', 'contact-form-7-to-database-extension') . '</a>  | <a href="admin.php?page=CF7DBPluginSettings">' . __('Database Options', 'contact-form-7-to-database-extension') . '</a>  | <a href="admin.php?page=' . $this->plugin->getShortCodeBuilderPageSlug() . '">' . __('Build Short Code', 'contact-form-7-to-database-extension') . '</a> | <a href="http://cfdbplugin.com/">' . __('Reference', 'contact-form-7-to-database-extension') . '</a>
    </p>
   ';
 }
开发者ID:SpatialMetabolomics,项目名称:metaspace-website,代码行数:14,代码来源:CFDBIntegrationFSCF.php

示例6: ajax_action_submit_contact_form

function ajax_action_submit_contact_form()
{
    $content = file_get_contents("php://input");
    if ($content) {
        $contactData = json_decode($content, true);
        $data = array('title' => '联系我们', 'posted_data' => $contactData);
        $data = (object) $data;
        require_once ABSPATH . 'wp-content/plugins/contact-form-7-to-database-extension/CF7DBPlugin.php';
        $plugin = new CF7DBPlugin();
        $plugin->saveFormData($data);
    }
    die;
}
开发者ID:jackey,项目名称:xy,代码行数:13,代码来源:functions.php

示例7: Copyright

<?php

/*
    "Contact Form to Database Extension" Copyright (C) 2011 Michael Simpson  (email : michael.d.simpson@gmail.com)

    This file is part of Contact Form to Database Extension.

    Contact Form to Database Extension is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Contact Form to Database Extension is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Contact Form to Database Extension.
    If not, see <http://www.gnu.org/licenses/>.
*/
if (!defined('ABSPATH') && !defined('WP_UNINSTALL_PLUGIN')) {
    exit;
}
require_once 'CF7DBPlugin.php';
$aPlugin = new CF7DBPlugin();
$aPlugin->uninstall();
开发者ID:rconnelly,项目名称:vacationware,代码行数:27,代码来源:uninstall.php

示例8: saveFormData

 public function saveFormData($form_id)
 {
     try {
         $title = get_the_title($form_id);
         $converter = new CFDBPostDataConverter();
         $converter->addExcludeField('post_nonce_field');
         $converter->addExcludeField('form-type');
         $converter->addExcludeField('fms-ajax');
         $converter->addExcludeField('action');
         $data = $converter->convert($title);
         // CFDBPostDataConverter won't capture files how they are organized here
         if (is_array($_FILES) && !empty($_FILES)) {
             foreach ($_FILES as $key => $file) {
                 if (is_array($file['tmp_name'])) {
                     for ($idx = 0; $idx < count($file['tmp_name']); ++$idx) {
                         if (is_uploaded_file($file['tmp_name'][$idx])) {
                             $fileKey = $idx > 0 ? $key . $idx : $key;
                             $data->posted_data[$fileKey] = $file['name'][$idx];
                             $data->uploaded_files[$fileKey] = $file['tmp_name'][$idx];
                         }
                     }
                 }
             }
         }
         return $this->plugin->saveFormData($data);
     } catch (Exception $ex) {
         $this->plugin->getErrorLog()->logException($ex);
     }
     return true;
 }
开发者ID:spielhoelle,项目名称:amnesty,代码行数:30,代码来源:CFDBIntegrationFMS.php

示例9: saveFormData

 /**
  * @param $form_data
  * @return bool
  */
 public function saveFormData($form_data) {
     try {
         $data = $this->convertData($form_data);
         return $this->plugin->saveFormData($data);
     } catch (Exception $ex) {
         $this->plugin->getErrorLog()->logException($ex);
     }
     return true;
 }
开发者ID:jknowles94,项目名称:Work-examples,代码行数:13,代码来源:CFDBIntegrationVerySimpleContactForm.php

示例10: saveFormData

 /**
  * @param $post_id int
  * @param $all_values array
  * @param $extra_values array
  * @return object
  */
 public function saveFormData($post_id, $all_values, $extra_values)
 {
     try {
         $data = $this->convertData($post_id, $all_values);
         return $this->plugin->saveFormData($data);
     } catch (Exception $ex) {
         $this->plugin->getErrorLog()->logException($ex);
     }
     return true;
 }
开发者ID:SpatialMetabolomics,项目名称:metaspace-website,代码行数:16,代码来源:CFDBIntegrationJetPack.php

示例11: saveFormData

 /**
  * @param $dataForms array
  * @param $postID array
  * @param $post array
  * @param $submissionsData array
  * @param $dataContentEmail array
  * @param $nameFileByIdentifier array
  * @param $requiredField array
  * @param $fileAttach array
  * @return bool
  */
 public function saveFormData($dataForms, $postID, $post, $submissionsData, $dataContentEmail, $nameFileByIdentifier, $requiredField, $fileAttach)
 {
     try {
         $data = $this->convertData($dataForms, $postID, $post, $submissionsData, $dataContentEmail, $nameFileByIdentifier, $requiredField, $fileAttach);
         return $this->plugin->saveFormData($data);
     } catch (Exception $ex) {
         $this->plugin->getErrorLog()->logException($ex);
     }
     return true;
 }
开发者ID:femgineer,项目名称:website,代码行数:21,代码来源:CFDBIntegrationWRContactForm.php

示例12: saveVssfFormData

 /**
  * Very Simple Signup Form
  * @param $form_data
  * @return bool
  */
 public function saveVssfFormData($form_data)
 {
     try {
         $title = 'Very Simple Signup Form';
         $data = $this->convertData($form_data, $title);
         return $this->plugin->saveFormData($data);
     } catch (Exception $ex) {
         $this->plugin->getErrorLog()->logException($ex);
     }
     return true;
 }
开发者ID:spielhoelle,项目名称:amnesty,代码行数:16,代码来源:CFDBIntegrationVerySimpleContactForm.php

示例13: saveFormData

 /**
  * @param $form array
  * @param $referrer array
  * @param $process_id string
  * @return bool
  */
 public function saveFormData($form, $referrer, $process_id)
 {
     try {
         // debug
         //            $this->plugin->getErrorLog()->log('$form: ' . print_r($form, true));
         //            $this->plugin->getErrorLog()->log('$referrer: ' . print_r($referrer, true));
         //            $this->plugin->getErrorLog()->log('$process_id: ' . print_r($process_id, true));
         //            global $processed_data;
         //            $this->plugin->getErrorLog()->log('$processed_data: ' . print_r($processed_data, true));
         $data = $this->convertData($form);
         return $this->plugin->saveFormData($data);
     } catch (Exception $ex) {
         $this->plugin->getErrorLog()->logException($ex);
     }
     return true;
 }
开发者ID:femgineer,项目名称:website,代码行数:22,代码来源:CFDBIntegrationCalderaForms.php

示例14: saveFormData

 /**
  * @param $form array
  * @param $referrer array
  * @param $process_id string
  * @param int $entry_id
  * @return bool
  */
 public function saveFormData($form, $referrer, $process_id, $entry_id)
 {
     if (!class_exists('Caldera_Forms')) {
         // Caldera not installed
         return true;
     }
     try {
         // debug
         //            $this->plugin->getErrorLog()->log('$form: ' . print_r($form, true));
         //            $this->plugin->getErrorLog()->log('$referrer: ' . print_r($referrer, true));
         //            $this->plugin->getErrorLog()->log('$process_id: ' . print_r($process_id, true));
         //            $this->plugin->getErrorLog()->log('$entry_id: ' . print_r($entry_id, true));
         $data = $this->convertData($form, $entry_id);
         return $this->plugin->saveFormData($data);
     } catch (Exception $ex) {
         $this->plugin->getErrorLog()->logException($ex);
     }
     return true;
 }
开发者ID:BennyHudson,项目名称:dan-zack,代码行数:26,代码来源:CFDBIntegrationCalderaForms.php

示例15: saveFormData

 public function saveFormData($bool, $new_post, $form_params)
 {
     //        $msg = '$new_post=' . print_r($new_post, true) . "\n" .
     //                '$form_params=' . print_r($form_params, true);
     //        $this->plugin->getErrorLog()->log($msg);
     try {
         if (is_array($new_post)) {
             $postedData = array();
             foreach ($new_post as $key => $value) {
                 $postedData[$key] = urldecode($value);
             }
             $title = 'Enfold';
             if (is_array($form_params) && isset($form_params['heading']) && $form_params['heading']) {
                 $title = strip_tags($form_params['heading']);
             }
             $data = (object) array('title' => $title, 'posted_data' => $postedData, 'uploaded_files' => array());
             $this->plugin->saveFormData($data);
         }
     } catch (Exception $ex) {
     }
     return true;
 }
开发者ID:BennyHudson,项目名称:jackshelbourn,代码行数:22,代码来源:CFDBIntegrationEnfoldTheme.php


注:本文中的CF7DBPlugin类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。