wordpress 非插件调用评论表情的方法

  • 2016-4-30 21:02
  • PHP二次开发
  • 阅读(2806)
  • 评论(0)
  • 来源:互联网
  • 摘要: !–smilies– ?php function wp_smilies() { global $wpsmiliestrans; if (!get_option('use_smilies') or ( empty($wpsmiliestrans))) return; $smilies = array_unique($wpsmiliestrans); $link = ''; foreach ($s ...

    <!–smilies–>
    <?php
    
    function wp_smilies() {
    
        global $wpsmiliestrans;
    
        if (!get_option('use_smilies') or ( empty($wpsmiliestrans)))
            return;
    
        $smilies = array_unique($wpsmiliestrans);
    
        $link = '';
    
        foreach ($smilies as $key => $smile) {
    
            $file = get_bloginfo('wpurl') . '/wp-includes/images/smilies/' . $smile;
    
            $value = " " . $key . " ";
    
            $img = "<img src=" {
                $file
            }" alt=" {
                $smile
            }" />";
    
            $imglink = htmlspecialchars($img);
    
            $link .= "<a href=\"#commentform\" title=\"{$smile}\" onclick=\"document.getElementByIdx_x('comment').value += '{$value}'\">{$img}</a>&nbsp;";
        }
    
        echo '<div class="wp_smilies">' . $link . '</div>';
    }
    ?>
    
    <?php wp_smilies(); ?>


    PHP技术交流QQ群:422137578

    除非注明,文章均为 PHP二次开发 原创,转载请注明本文地址:http://www.php2.cc/article-2206-1.html

    相关阅读

    最新评论

    用户名:  *

    邮 箱:  *

    网 址: 注意加上“http://”哦!