芝麻web文件管理V1.00
编辑当前文件:/www/wwwroot/shphe-en.com/wp-content/plugins/contact-form-7-database/admin/edit-value.php
更多
查看详情
$v) { $label = $v; $loading = __('Loading...'); echo sprintf("
%s:
", $label, $label, $k, $k, $loading); } } else { foreach ($field_settings as $k => $v) { if (isset($fields[$k])) { $show = $field_settings[$k]['show']; $label = $field_settings[$k]['label']; if($label == '客户国家(IP)'){ $label = '访客IP'; } $loading = __('Loading...'); echo sprintf("
%s:
", $label, $label, $k, $k, $loading); unset($fields[$k]); } } $fields['t']='参考翻译'; if (count($fields) > 0) { foreach ($fields as $k => $v) { $label = $v; if($label == 'ip_area'){ $label = '访客国家'; } if($label == 'readed'){ $label = '阅读状态'; } echo sprintf("
%s:
", $label, $label, $k, $k, $loading); } } } echo '
'.iq_get_countries().'
'; ?>
prepare("SELECT * FROM ".$wpdb->prefix."cf7_data_entry WHERE `data_id` = %d", $rid); $rows = $wpdb->get_results($sql); $return = array(); //print_r($rows);exit; foreach ($rows as $k => $v) { if($v->name == 'readed'){ $return[$v->name] = $v->value==1?'已读':'未读'; }else{ $return[$v->name] = stripslashes($v->value); } } //print_r($return);exit; $tUrl = "http://fanyi.youdao.com/openapi.do?keyfrom=goodao998&key=1378723725&type=data&doctype=json&version=1.1&q=".urlencode(wp_trim_words($return['Message'],55)); $d = json_decode(file_get_contents($tUrl),true); $return["t"]=$d['translation'][0]; //更新已读 $wpdb->query("update `".$wpdb->prefix."cf7_data_entry` set `value`=1 WHERE `data_id` = '".$rid."' AND `name`='readed'"); exit(json_encode($return)); } } //update when button clicked add_action('cf7d_main_post', 'cf7d_submit_changed_values_cb'); function cf7d_submit_changed_values_cb() { global $wpdb; if (isset($_POST['cf7d_save_value_field'])) { $fid = (int)$_POST['fid']; $rid = (int)$_POST['rid']; foreach ($_POST['field'] as $key => $value) { $wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."cf7_data_entry SET `value` = %s WHERE `name` = %s AND `data_id` = %d", $value, $key, $rid)); } } } function iq_get_countries() { global $countrylist; $countrylist = array(); if (!class_exists('GeoIP')) { include_once("./iq-block-country/geoip.inc"); } if (class_exists('GeoIP')) { /* Create an array with all countries that the database knows */ $geo = new GeoIP (); $countrycodes = $geo->GEOIP_COUNTRY_CODE_TO_NUMBER; $countries = $geo->GEOIP_COUNTRY_NAMES; $countrylist = array (); foreach ( $countrycodes as $key => $value ) { if (!empty($value)) { $countrylist [$key] = $countries [$value]; } } array_multisort($countrylist); return $countrylist; } return $countylist; }