Plugin Directory

Changeset 458842


Ignore:
Timestamp:
11/03/2011 12:57:29 AM (14 years ago)
Author:
wenzizone
Message:

modify

File:
1 edited

Legend:

Unmodified
Added
Removed
  • custom-copyright/trunk/custom-copyright.php

    r458636 r458842  
    2727along with BackTo Top. If not, see <http://www.gnu.org/licenses/>.
    2828*/
     29define('WZ_CC_VERSION', 'V0.1');
    2930
    3031if (!class_exists('Customcopyright')) {
    3132    class Customcopyright {
    32         var $wz_cc_init_option = array('top' => true);
     33        var $wz_cc_init_option = array( 'pHeader' => true,
     34                                            'pFooter' => false );
    3335        //构造函数
    3436        function Customcopyright() {
    3537            define('WZ_CC_OPTIONS', 'CustomCopyrightAdminOptions');
    36            
     38
    3739            add_action('activate_' . basename(dirname(__FILE__)) . 'custom-copyright.php', array(&$this, 'wz_cc_onActive'));
    3840            add_filter('the_content', array(&$this, 'mycustomcopyright'));
    3941            add_action('admin_menu', array(&$this, 'wz_cc_add_custom_copyright_options_page'));
    4042        }
    41        
     43
    4244        //插件激活时加载
    4345        function wz_cc_onActive() {
     
    4749        //插件删除时加载
    4850        function deActive() {
    49        
     51
    5052        }
    5153        //获取参数配置
     
    9092            }
    9193        }
    92        
     94
    9395        function addContent($content=''){
    9496            $content.="<p>Devlounge Was Here</p>";
     
    9799
    98100        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
    100151        }
    101152    } //end class
Note: See TracChangeset for help on using the changeset viewer.