芝麻web文件管理V1.00
编辑当前文件:/www/wwwroot/shphe-en.com/wp-content/plugins/contact-form-7-database/admin/init.php
= $ip) { $index_offset = @unpack('Vlen', $index{$start + 4} . $index{$start + 5} . $index{$start + 6} . "\x0"); $index_length = @unpack('Clen', $index{$start + 7}); break; } } @fseek($fp, $offset['len'] + $index_offset['len'] - 1024); if($index_length['len']) { return '- '.@fread($fp, $index_length['len']); } else { return '- Unknown'; } } //add js, css add_action('admin_enqueue_scripts', 'cf7_custom_wp_admin_style'); function cf7_custom_wp_admin_style() { wp_register_script('cf7d_js', CF7D_PLUGIN_URL . '/admin/assets/js/cf7d.js', array('jquery')); wp_register_style('cf7d', CF7D_PLUGIN_URL . '/admin/assets/css/cf7d.css'); wp_enqueue_style('cf7d'); } //add admin menu page add_action('admin_menu', 'cf7d_register_custom_submenu_page'); function cf7d_register_custom_submenu_page() { $menu = add_submenu_page('wpcf7', 'Database', 'Database', 'manage_options', 'cf7-data', 'cf7d_custom_submenu_page_callback'); add_action('load-' . $menu, 'cf7d_form_action_callback'); } function cf7d_custom_submenu_page_callback_bak() { if (!class_exists('WP_List_Table')) { require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php'); } require_once 'table.php'; $entries = new Cf7_Entries_List(); ?>
WP_List_Table Class Example
prepare_items(); $entries->display(); ?>
'; if (!class_exists('WPCF7_Contact_Form_List_Table')) { require_once WPCF7_PLUGIN_DIR . '/admin/includes/class-contact-forms-list-table.php'; } $list_table = new WPCF7_Contact_Form_List_Table(); $list_table->prepare_items(); $first_form_id = 20; $fid = ((isset($_GET['fid'])) ? (int) $_GET['fid'] : ''); $search = ((isset($_GET['search'])) ? addslashes($_GET['search']) : ''); echo '
'; echo '
切换询盘表单:
'; echo '
'; echo '
items) == 0 ) ? 'selected="selected"' : '').' >'.__('Choose form').'
'; $i = 0; foreach ($list_table->items as $k => $v) { if ($first_form_id == 0 && $i == 0) { $first_form_id = $v->id; if (empty($fid) && ($first_form_id > 0)) { $fid = $first_form_id; } } echo '
id)) ? 'selected="selected"' : '').'>'.$v->title.'
'; } echo '
'; echo '
'; if (!empty($fid)) { $cf7d_entry_order_by = apply_filters('cf7d_entry_order_by', '`data_id` DESC'); $cf7d_entry_order_by = trim($cf7d_entry_order_by); $items_per_page = apply_filters('cf7d_entry_per_page', 20); $page = isset($_GET['cpage']) ? abs((int)$_GET['cpage']) : 1; $offset = ( $page * $items_per_page ) - $items_per_page; $query = sprintf("SELECT * FROM `".$wpdb->prefix."cf7_data_entry` WHERE `cf7_id` = %d AND data_id IN(SELECT * FROM (SELECT data_id FROM `".$wpdb->prefix."cf7_data_entry` WHERE 1 = 1 ".((!empty($search)) ? "AND `value` LIKE '%%".$search."%%'" : "")." GROUP BY `data_id` ORDER BY ".$cf7d_entry_order_by." LIMIT %d,%d) temp_table) ORDER BY " . $cf7d_entry_order_by, $fid, $offset, $items_per_page); $data = $wpdb->get_results($query); $data_sorted = cf7d_sortdata($data); $fields = cf7d_get_db_fields($fid); $total = $wpdb->get_results("SELECT data_id FROM `".$wpdb->prefix."cf7_data_entry` WHERE `cf7_id` = " . (int)$fid . " ".((!empty($search)) ? "AND `value` LIKE '%%".$search."%%'" : "")." GROUP BY `data_id`"); $total = count($total); if( current_user_can('administrator') ) { $entry_actions = array( 'delete' => '批量删除' ); } $entry_actions = apply_filters('cf7d_entry_actions', $entry_actions); ?>
add_query_arg('cpage', '%#%'), 'format' => '', 'prev_text' => __('«'), 'next_text' => __('»'), 'total' => ceil($total / $items_per_page), 'current' => $page )); ?>
'; //print_r($fields);exit; foreach ($fields as $k => $v) { if($k == 'ip_area'){continue;} if($k=='readed'){ echo '
是否已读
'; }else if($k=='submit_ip'){ echo '
访客国家(IP)
'; } else if($v!='询盘发送时间' && $v!='邮箱(Email)'){ echo '
'.cf7d_admin_get_field_name($v).'
'; } else{ echo '
'.cf7d_admin_get_field_name($v).'
'; } } ?>
$v) { echo '
'; echo '
'; foreach ($fields as $k2 => $v2) { if($k2 == 'ip_area'){continue;} if($v2 == '发送页面'){ echo '
'.'
'.((isset($v[$k2])) ? mb_strimwidth($v[$k2],0,36,'...') : ' ').'
'; }else if($k2=='submit_ip'){ if(isset($v['ip_area']) && $v['ip_area']){ echo '
'.((isset($v[$k2])) ? $v['ip_area'].'('.$v[$k2].')' : ' ').'
'; }else{ $ip_area = get_ip_from_taobaoapi($v[$k2]); $wpdb->query($wpdb->prepare('INSERT INTO wp_cf7_data_entry(`cf7_id`, `data_id`, `name`, `value`) VALUES (%d,%d,%s,%s)', 19, $k, 'ip_area', $ip_area)); echo '
'.((isset($v[$k2])) ? $ip_area.'('.$v[$k2].')' : ' ').'
'; } }else if($k2=='Email'){ if(isset($v[$k2])){ $img_twitter="/wp-content/plugins/contact-form-7/images/comment_twitter_no.png"; if($res->color=="red"){ $img_twitter="/wp-content/plugins/contact-form-7/images/comment_twitter.png"; } } echo '
'.((isset($v[$k2])) ? $v[$k2] : ' ').'
'; }else if($k2=='readed'){ echo '
'.(($v[$k2]==1) ? "已读(SEO)" : "未读(SEO)").'
'; }else if( $v2!='询盘发送时间' && $v2!='邮箱(Email)'){ echo '
'.((isset($v[$k2])) ? $v[$k2] : ' ').'
'; }else{ echo '
'.((isset($v[$k2])) ? $v[$k2] : ' ').'
'; } } $row_id = $k; do_action('cf7d_admin_after_body_field', $fid, $row_id); echo '
'; } ?>
'; foreach ($fields as $k => $v) { if($k == 'ip_area'){continue;} if($k=='readed'){ echo '
是否已读
'; }else if($k=='submit_ip'){ echo '
访客国家(IP)
'; } else if($v!='询盘发送时间' && $v!='邮箱(Email)'){ echo '
'.cf7d_admin_get_field_name($v).'
'; } else{ echo '
'.cf7d_admin_get_field_name($v).'
'; } } ?>
add_query_arg('cpage', '%#%'), 'format' => '', 'prev_text' => __('«'), 'next_text' => __('»'), 'total' => ceil($total / $items_per_page), 'current' => $page )); ?>
Google统计转换代码Js
开启代码执行
>开启
>关闭
全局代码
</textarea>
事件代码
</textarea>
0 && !(isset($_GET['action'])) && !(isset($_GET['action2']))) { ?> '; } function get_ip_from_taobaoapi($ip){ $country = file_get_contents("http://ip.globalso.com/?ip=".$ip); if($country){ return $country; }else{ return "未知"; } } function request_post($url = '', $param = '') { if (empty($url) || empty($param)) { return false; } $postUrl = $url; $curlPost = $param; $ch = curl_init();//初始化curl curl_setopt($ch, CURLOPT_URL,$postUrl);//抓取指定网页 curl_setopt($ch, CURLOPT_HEADER, 0);//设置header curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);//要求结果为字符串且输出到屏幕上 curl_setopt($ch, CURLOPT_POST, 1);//post提交方式 curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost); $data = curl_exec($ch);//运行curl curl_close($ch); return $data; } function cf7d_form_action_callback() { global $wpdb; if ($current_action = cf7d_current_action()) { if ($current_action == 'delete') { if (isset($_GET['del_id'])) { $del_id = implode(',', $_GET['del_id']); $fid = (int)$_GET['fid']; $wpdb->query("DELETE FROM {$wpdb->prefix}cf7_data_entry WHERE data_id IN($del_id)"); $wpdb->query("DELETE FROM {$wpdb->prefix}cf7_data WHERE id IN($del_id)"); wp_safe_redirect(admin_url('admin.php?page=cf7-data&fid=' . $fid)); exit(); } } do_action('cf7d_entry_action', $current_action); } do_action('cf7d_main_post'); } function cf7d_current_action() { $current_action = false; if (isset($_REQUEST['action']) && -1 != $_REQUEST['action'] && isset($_GET['btn_apply'])) { $current_action = $_REQUEST['action']; return apply_filters('cf7d_get_current_action', $current_action); } if (isset($_REQUEST['action2']) && -1 != $_REQUEST['action2'] && isset($_GET['btn_apply2'])) { $current_action = $_REQUEST['action2']; return apply_filters('cf7d_get_current_action', $current_action); } $current_action = apply_filters('cf7d_get_current_action', $current_action); return false; }