日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程语言 > php >内容正文

php

适合做公安网的php,gonganbeian.php

發(fā)布時(shí)間:2025/4/5 php 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 适合做公安网的php,gonganbeian.php 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

/*

Plugin Name: Gongan Beian

Plugin URI: https://www.youngfree.cn/seo/2214.html

Description: 用于 Wordpress 博客申請(qǐng)交互式公安網(wǎng)站備案合規(guī)化。該插件可按公安備案要求記錄留言和評(píng)論用戶的 IP 和端口號(hào),以及精確到秒的時(shí)間。

Version: 1.0

Author: 楊景文

Author URI: https://www.yangjingwen.cn

*/

/* Copyright since 2017 楊景文 (email : admin@youngfree.cn)

This program 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 2 of the License, or

(at your option) any later version.

This program 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 this program; if not, write to the Free Software

Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

*/

//IP端口 獲取與存儲(chǔ)

add_action('wp_insert_comment','yjwgaba_insert_ipport',10,2);

function yjwgaba_insert_ipport($comment_ID,$commmentdata) {

#$userip = $_SERVER['HTTP_CLIENT_IP']; //

$ipport = $_SERVER['REMOTE_PORT'];

//ipport 是存儲(chǔ)在數(shù)據(jù)庫(kù)里的字段名字,取出數(shù)據(jù)的時(shí)候就會(huì)用到

#update_comment_meta($comment_ID,'yjwgaba_userip',$userip);

update_comment_meta($comment_ID,'yjwgaba_ipport',$ipport);

}

//為IP Port欄目添加CSS

function yjwgaba_ipport_css() {

?>

#yjwgaba_ipport { width: 50px; } /* CSS for ipport columns */

#yjwgaba_userip { width: 50px; } /* CSS for ip columns */

#author_ip { width: 80px; } /* CSS for ip columns */

}

add_action('admin_head', 'yjwgaba_ipport_css');

//后臺(tái)評(píng)論添加IP端口欄目

add_filter( 'manage_edit-comments_columns', 'yjwgaba_comments_columns' );

add_action( 'manage_comments_custom_column', 'output_yjwgaba_comments_columns', 10, 2 );

function yjwgaba_comments_columns( $columns ){

#unset($columns['Time']);

#$columns[ 'date' ] = ( 'Time2' ); //Time代表列的名字

#$columns[ 'yjwgaba_userip' ] = yjwgaba_( 'User IP' ); //User IP代表列的名字

$columns[ 'author_ip' ] = ( 'IP & Port & Time' ); //User IP代表列的名字

# $columns[ 'yjwgaba_ipport' ] = yjwgaba_( 'IP Port' ); //IP Port代表列的名字

return $columns;

}

function output_yjwgaba_comments_columns( $column_name, $comment_id ){

switch( $column_name ) {

#case "date" :

#echo get_the_time( $comment_id, 'date', true );

#echo get_comment_date(strtotime(get_the_time('Y-m-d G:i:s')));

#break;

case "author_ip" :

echo get_comment_author_IP( $comment_id, 'author_ip', true ).' : '.get_comment_meta( $comment_id, 'yjwgaba_ipport', true ).'
'.get_comment_date('Y-m-d G:i:s',$comment_id);

break;

#case "yjwgaba_userip" :

#echo get_comment_meta( $comment_id, 'yjwgaba_userip', true );

#break;

#case "yjwgaba_ipport" :

#echo get_comment_meta( $comment_id, 'yjwgaba_ipport', true );

#break;

}

}

?>

一鍵復(fù)制

編輯

Web IDE

原始數(shù)據(jù)

按行查看

歷史

總結(jié)

以上是生活随笔為你收集整理的适合做公安网的php,gonganbeian.php的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。