googleadsense.php

来自「F2blog v1.1 beta 12.27更新说明 1、后台编辑器增加了文本」· PHP 代码 · 共 48 行

PHP
48
字号
<?php
/*
Plugin Name: GoogleAdSense
Plugin URI: http://forum.f2blog.com/forum-21-1.html
Description: Add Google AdSense to your blog.
Version: 0.1
Author: zach14c
Author URI: http://forum.f2blog.com/profile-uid-22.html
*/

include_once(substr(dirname(__FILE__), 0) . "/common.php");
// Install Plugin
function GoogleAdSense_install() {
	global $GoogleAdSense_plugin_config;
	$arrPlugin['Name'] = $GoogleAdSense_plugin_config["Name"]; 
	$arrPlugin['Desc'] = "Google Ad"; 
	$arrPlugin['Type'] = "Side";     
	$arrPlugin['Code'] = "";         
	$arrPlugin['Path'] = "";         
	$arrPlugin['DefaultField'] = array("dummy"); 
	$arrPlugin['DefaultValue'] = array("1"); 

	$ActionMessage = install_plugins($arrPlugin);
	return $ActionMessage;
}

//Unstall Plugin
function GoogleAdSense_unstall() {
	global $GoogleAdSense_plugin_config;
	$ActionMessage = unstall_plugins($GoogleAdSense_plugin_config["Name"]);
	return $ActionMessage;
}
    
function GoogleAdSense($sidename, $sidetitle, $htmlcode, $isInstall) {
	global $GoogleAdSense_plugin_config;
	$ad_js = readfromfile($GoogleAdSense_plugin_config["JSFile"]);
?>	
<!-- Google Ad-Sense -->
<div class="sidepanel" id="Side_GoogleAd">
  <h4 class="Ptitle" style="cursor: pointer;"><?=$sidetitle?></h4>
  <div class="Pcontent" id="content_statistics" style="display:">
    <?=$ad_js?>
  </div> 
</div> 
<?		
}
add_action('GoogleAdSense','GoogleAdSense',4);
?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?