Changeset 458842
- Timestamp:
- 11/03/2011 12:57:29 AM (14 years ago)
- File:
-
- 1 edited
-
custom-copyright/trunk/custom-copyright.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
custom-copyright/trunk/custom-copyright.php
r458636 r458842 27 27 along with BackTo Top. If not, see <http://www.gnu.org/licenses/>. 28 28 */ 29 define('WZ_CC_VERSION', 'V0.1'); 29 30 30 31 if (!class_exists('Customcopyright')) { 31 32 class Customcopyright { 32 var $wz_cc_init_option = array('top' => true); 33 var $wz_cc_init_option = array( 'pHeader' => true, 34 'pFooter' => false ); 33 35 //构造函数 34 36 function Customcopyright() { 35 37 define('WZ_CC_OPTIONS', 'CustomCopyrightAdminOptions'); 36 38 37 39 add_action('activate_' . basename(dirname(__FILE__)) . 'custom-copyright.php', array(&$this, 'wz_cc_onActive')); 38 40 add_filter('the_content', array(&$this, 'mycustomcopyright')); 39 41 add_action('admin_menu', array(&$this, 'wz_cc_add_custom_copyright_options_page')); 40 42 } 41 43 42 44 //插件激活时加载 43 45 function wz_cc_onActive() { … … 47 49 //插件删除时加载 48 50 function deActive() { 49 51 50 52 } 51 53 //获取参数配置 … … 90 92 } 91 93 } 92 94 93 95 function addContent($content=''){ 94 96 $content.="<p>Devlounge Was Here</p>"; … … 97 99 98 100 function wz_cc_adminpage() { 99 echo "test;"; 101 $wz_cc_options = $this->wz_cc_getAdminOptions(); 102 ?> 103 <div class="wrap"> 104 <form method="post" id="back2top_form" 105 action="<?php echo $GLOBALS['HTTP_SERVER_VARS']['REQUEST_URI']; ?>"> 106 <h1> 107 根据标题添加版权信息插件 108 <?php echo WZ_CC_VERSION;?> 109 设置 110 </h1> 111 <p> 112 作者:<a href="http://www.wenzizone.cm">深夜的蚊子</a>,欢迎访问我的<a 113 href="http://www.wenzizone.com">博客</a>。 114 </p> 115 <p> 116 <table> 117 <tr> 118 <td><input type="radio" id="p-header" name="wz_cc_position" 119 value="p-header" 120 <?php if($wz_cc_options['pHeader'] == 'true') echo 'checked="checked"'; ?>>在文章顶部添加</td> 121 <td><input type="radio" id="p-footer" name="wz_cc_position" 122 value="p-footer" 123 <?php if($wz_cc_options['pFooter'] == 'true') echo 'checked="checked"'; ?>>在文章底部添加</td> 124 </tr> 125 <tr> 126 <td valign="top" width="30%"><strong><?php _e('Header Text:', 'wp-posturl'); ?> 127 </strong><br /> 128 129 <?php _e('This text will be inserted at beginning of your post if not empty.', 'wp-posturl'); ?><br /><br /> 130 <?php _e('Allowed Variables:', 'wp-posturl'); ?> 131 <ul> 132 <li><?php _e('<code>%site_url%</code> - the URL of your site', 'wp-posturl'); ?></li> 133 <li><?php _e('<code>%site_name%</code> - the name of your site', 'wp-posturl'); ?></li> 134 <li><?php _e('<code>%post_url%</code> - the URL of a post', 'wp-posturl'); ?></li> 135 <li><?php _e('<code>%post_title%</code> -the title of a post', 'wp-posturl'); ?></li> 136 </ul> 137 </td> 138 <td><textarea name="header_text" id="header_text" cols="64" 139 rows="10"> 140 <?php echo htmlspecialchars(stripslashes($posturl_options['header_text']), ENT_QUOTES); ?></textarea><br /> 141 </td> 142 </tr> 143 </table> 144 <p> 145 <input type="submit" name="save-options" value="保存配置" /> <input 146 type="submit" name="reset-options" value="重置配置" /> 147 </p> 148 </form> 149 </div> 150 <?php 100 151 } 101 152 } //end class
Note: See TracChangeset
for help on using the changeset viewer.