本文整理汇总了PHP中RGFormsModel::get_lead_meta_table_name方法的典型用法代码示例。如果您正苦于以下问题:PHP RGFormsModel::get_lead_meta_table_name方法的具体用法?PHP RGFormsModel::get_lead_meta_table_name怎么用?PHP RGFormsModel::get_lead_meta_table_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RGFormsModel
的用法示例。
在下文中一共展示了RGFormsModel::get_lead_meta_table_name方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fix_lead_meta_form_id_values
private static function fix_lead_meta_form_id_values()
{
global $wpdb;
$lead_meta_table_name = RGFormsModel::get_lead_meta_table_name();
$lead_table_name = RGFormsModel::get_lead_table_name();
$sql = "UPDATE {$lead_meta_table_name} lm,{$lead_table_name} l SET lm.form_id = l.form_id\n\t\t\t\tWHERE lm.form_id=0 AND lm.lead_id = l.id;\n\t\t\t\t";
$wpdb->get_results($sql);
}
示例2: gform_delete_meta
function gform_delete_meta($entry_id, $meta_key = '')
{
global $wpdb, $_gform_lead_meta;
$table_name = RGFormsModel::get_lead_meta_table_name();
$meta_filter = empty($meta_key) ? '' : $wpdb->prepare('AND meta_key=%s', $meta_key);
$wpdb->query($wpdb->prepare("DELETE FROM {$table_name} WHERE lead_id=%d {$meta_filter}", $entry_id));
//clears cache.
$_gform_lead_meta = array();
}
示例3: delete_authorizenet_meta
public static function delete_authorizenet_meta()
{
// delete lead meta data
global $wpdb;
$table_name = RGFormsModel::get_lead_meta_table_name();
$wpdb->query($wpdb->prepare("DELETE FROM {$table_name} WHERE meta_key in ('subscription_regular_amount','subscription_trial_amount','subscription_payment_count','subscription_payment_date')"));
}
示例4: setup
public static function setup($force_setup = false)
{
global $wpdb;
$version = GFCommon::$version;
if (get_option("rg_form_version") != $version || $force_setup) {
$error = "";
if (!self::has_database_permission($error)) {
?>
<div class='error' style="padding:15px;"><?php
echo $error;
?>
</div>
<?php
}
require_once ABSPATH . '/wp-admin/includes/upgrade.php';
if (!empty($wpdb->charset)) {
$charset_collate = "DEFAULT CHARACTER SET {$wpdb->charset}";
}
if (!empty($wpdb->collate)) {
$charset_collate .= " COLLATE {$wpdb->collate}";
}
//------ FORM -----------------------------------------------
$form_table_name = RGFormsModel::get_form_table_name();
$sql = "CREATE TABLE " . $form_table_name . " (\r\n id mediumint(8) unsigned not null auto_increment,\r\n title varchar(150) not null,\r\n date_created datetime not null,\r\n is_active tinyint(1) not null default 1,\r\n PRIMARY KEY (id)\r\n ) {$charset_collate};";
dbDelta($sql);
//------ META -----------------------------------------------
$meta_table_name = RGFormsModel::get_meta_table_name();
$sql = "CREATE TABLE " . $meta_table_name . " (\r\n form_id mediumint(8) unsigned not null,\r\n display_meta longtext,\r\n entries_grid_meta longtext,\r\n PRIMARY KEY (form_id)\r\n ) {$charset_collate};";
dbDelta($sql);
//droping outdated form_id index (if one exists)
self::drop_index($meta_table_name, 'form_id');
//------ FORM VIEW -----------------------------------------------
$form_view_table_name = RGFormsModel::get_form_view_table_name();
$sql = "CREATE TABLE " . $form_view_table_name . " (\r\n id bigint(20) unsigned not null auto_increment,\r\n form_id mediumint(8) unsigned not null,\r\n date_created datetime not null,\r\n ip char(15),\r\n count mediumint(8) unsigned not null default 1,\r\n PRIMARY KEY (id),\r\n KEY form_id (form_id)\r\n ) {$charset_collate};";
dbDelta($sql);
//------ LEAD -----------------------------------------------
$lead_table_name = RGFormsModel::get_lead_table_name();
$sql = "CREATE TABLE " . $lead_table_name . " (\r\n id int(10) unsigned not null auto_increment,\r\n form_id mediumint(8) unsigned not null,\r\n post_id bigint(20) unsigned,\r\n date_created datetime not null,\r\n is_starred tinyint(1) not null default 0,\r\n is_read tinyint(1) not null default 0,\r\n ip varchar(39) not null,\r\n source_url varchar(200) not null default '',\r\n user_agent varchar(250) not null default '',\r\n currency varchar(5),\r\n payment_status varchar(15),\r\n payment_date datetime,\r\n payment_amount decimal(19,2),\r\n transaction_id varchar(50),\r\n is_fulfilled tinyint(1),\r\n created_by bigint(20) unsigned,\r\n transaction_type tinyint(1),\r\n status varchar(20) not null default 'active',\r\n PRIMARY KEY (id),\r\n KEY form_id (form_id),\r\n KEY status (status)\r\n ) {$charset_collate};";
dbDelta($sql);
//------ LEAD NOTES ------------------------------------------
$lead_notes_table_name = RGFormsModel::get_lead_notes_table_name();
$sql = "CREATE TABLE " . $lead_notes_table_name . " (\r\n id int(10) unsigned not null auto_increment,\r\n lead_id int(10) unsigned not null,\r\n user_name varchar(250),\r\n user_id bigint(20),\r\n date_created datetime not null,\r\n value longtext,\r\n PRIMARY KEY (id),\r\n KEY lead_id (lead_id),\r\n KEY lead_user_key (lead_id,user_id)\r\n ) {$charset_collate};";
dbDelta($sql);
//------ LEAD DETAIL -----------------------------------------
$lead_detail_table_name = RGFormsModel::get_lead_details_table_name();
$sql = "CREATE TABLE " . $lead_detail_table_name . " (\r\n id bigint(20) unsigned not null auto_increment,\r\n lead_id int(10) unsigned not null,\r\n form_id mediumint(8) unsigned not null,\r\n field_number float not null,\r\n value varchar(" . GFORMS_MAX_FIELD_LENGTH . "),\r\n PRIMARY KEY (id),\r\n KEY form_id (form_id),\r\n KEY lead_id (lead_id)\r\n ) {$charset_collate};";
dbDelta($sql);
//------ LEAD DETAIL LONG -----------------------------------
$lead_detail_long_table_name = RGFormsModel::get_lead_details_long_table_name();
$sql = "CREATE TABLE " . $lead_detail_long_table_name . " (\r\n lead_detail_id bigint(20) unsigned not null,\r\n value longtext,\r\n PRIMARY KEY (lead_detail_id)\r\n ) {$charset_collate};";
dbDelta($sql);
//droping outdated form_id index (if one exists)
self::drop_index($lead_detail_long_table_name, 'lead_detail_key');
//------ LEAD META -----------------------------------
$lead_meta_table_name = RGFormsModel::get_lead_meta_table_name();
$sql = "CREATE TABLE " . $lead_meta_table_name . " (\r\n id bigint(20) unsigned not null auto_increment,\r\n lead_id bigint(20) unsigned not null,\r\n meta_key varchar(255),\r\n meta_value longtext,\r\n PRIMARY KEY (id),\r\n KEY meta_key (meta_key),\r\n KEY lead_id (lead_id)\r\n ) {$charset_collate};";
dbDelta($sql);
//fix checkbox value. needed for version 1.0 and below but won't hurt for higher versions
self::fix_checkbox_value();
//auto-setting license key based on value configured via the GF_LICENSE_KEY constant or the gf_license_key variable
global $gf_license_key;
$license_key = defined("GF_LICENSE_KEY") && empty($gf_license_key) ? GF_LICENSE_KEY : $gf_license_key;
if (!empty($license_key)) {
update_option("rg_gforms_key", md5($license_key));
}
//auto-setting recaptcha keys based on value configured via the constant or global variable
global $gf_recaptcha_public_key, $gf_recaptcha_private_key;
$private_key = defined("GF_RECAPTCHA_PRIVATE_KEY") && empty($gf_recaptcha_private_key) ? GF_RECAPTCHA_PRIVATE_KEY : $gf_recaptcha_private_key;
if (!empty($private_key)) {
update_option("rg_gforms_captcha_private_key", $private_key);
}
$public_key = defined("GF_RECAPTCHA_PUBLIC_KEY") && empty($gf_recaptcha_public_key) ? GF_RECAPTCHA_PUBLIC_KEY : $gf_recaptcha_public_key;
if (!empty($public_key)) {
update_option("rg_gforms_captcha_public_key", $public_key);
}
//Auto-importing forms based on GF_IMPORT_FILE AND GF_THEME_IMPORT_FILE
if (defined("GF_IMPORT_FILE") && !get_option("gf_imported_file")) {
GFExport::import_file(GF_IMPORT_FILE);
update_option("gf_imported_file", true);
}
//adds empty index.php files to upload folders. only for v1.5.2 and below
if (version_compare(get_option("rg_form_version"), "1.6", "<")) {
self::add_empty_index_files();
}
update_option("rg_form_version", $version);
}
//Import theme specific forms if configured. Will only import forms once per theme.
if (defined("GF_THEME_IMPORT_FILE")) {
$themes = get_option("gf_imported_theme_file");
if (!is_array($themes)) {
$themes = array();
}
//if current theme has already imported it's forms, don't import again
$theme = get_template();
if (!isset($themes[$theme])) {
//importing forms
GFExport::import_file(get_stylesheet_directory() . "/" . GF_THEME_IMPORT_FILE);
//adding current theme to the list of imported themes. So that forms are not imported again for it.
$themes[$theme] = true;
update_option("gf_imported_theme_file", $themes);
//.........这里部分代码省略.........
示例5: mf_get_form_meta
function mf_get_form_meta($meta_key, $meta_value)
{
global $wpdb;
$table_name = RGFormsModel::get_lead_meta_table_name();
$entry = GFAPI::get_entry($meta_value);
//retrieve the most current records for each additional form/entry id/form_id combination
$results = $wpdb->get_results($sql = $wpdb->prepare("select * from " . "(SELECT * FROM {$table_name}\n WHERE meta_value=%d AND meta_key=%s\n order by id desc) custom \n group by meta_value, form_id, lead_id", $meta_value, $meta_key));
return $results;
}