hello.php

来自「在综合英文版XOOPS 2.09, 2.091, 2.092 的基础上正式发布X」· PHP 代码 · 共 74 行

PHP
74
字号
<?php/*Plugin Name: Hello DollyPlugin URI: http://wordpress.org/#Description:_LANG_PG_HELLO_DOLLYAuthor: Matt MullenwegAuthor URI: http://photomatt.net/*/// These are the lyrics to Hello Dolly$lyrics = "Hello, DollyWell, hello, DollyIt's so nice to have you back where you belongYou're lookin' swell, DollyI can tell, DollyYou're still glowin', you're still crowin'You're still goin' strongWe feel the room swayin'While the band's playin'One of your old favourite songs from way back whenSo, take her wrap, fellasFind her an empty lap, fellasDolly'll never go away againHello, DollyWell, hello, DollyIt's so nice to have you back where you belongYou're lookin' swell, DollyI can tell, DollyYou're still glowin', you're still crowin'You're still goin' strongWe feel the room swayin'While the band's playin'One of your old favourite songs from way back whenGolly, gee, fellasFind her a vacant knee, fellasDolly'll never go awayDolly'll never go awayDolly'll never go away again";// Here we split it into lines$lyrics = explode("\n", $lyrics);// And then randomly choose a lineglobal $chosen;$chosen = wptexturize( $lyrics[ mt_rand(0, count($lyrics) ) ] );// Now we set that function up to execute when the admin_footer action is calledadd_action('admin_footer', 'hello_dolly');if (!defined('WP_PLUGIN_HELLO')) {define('WP_PLUGIN_HELLO',1);// This just echoes the chosen line, we'll position it laterfunction hello_dolly() {	global $chosen;	echo "<p id='dolly'>$chosen</p>";}// We need some CSS to position the paragraphfunction dolly_css() {	echo "	<style type='text/css'>	#dolly {		position: absolute;		top: 5px;margin: 0; padding: 0;		right: 3em;		font-size: 20px;		color: #666;	}	</style>	";}}add_action('admin_head', 'dolly_css');?>

⌨️ 快捷键说明

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