当前位置: 首页>>代码示例>>PHP>>正文


PHP convert_smilies函数代码示例

本文整理汇总了PHP中convert_smilies函数的典型用法代码示例。如果您正苦于以下问题:PHP convert_smilies函数的具体用法?PHP convert_smilies怎么用?PHP convert_smilies使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了convert_smilies函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: widget_lmee_notice

 function widget_lmee_notice($args)
 {
     extract($args);
     echo $before_widget;
     $lmee_popular_options = get_option('widget_lmee_popular');
     $title = '小家伙说的话(NOTICE)';
     //设置默认的标题
     echo $before_title . $title . $after_title;
     $page_ID = 515;
     //用来作为公告栏的页面或者文章id
     $num = 2;
     //显示公告的条数
     echo '<ul class="notice" style="padding: 1em 1.4em;">';
     $announcement = '';
     $comments = get_comments("number={$num}&post_id={$page_ID}");
     if (!empty($comments)) {
         foreach ($comments as $comment) {
             $announcement .= '<li>' . convert_smilies($comment->comment_content) . ' <span style="color:#999;">(' . get_comment_date('y/m/d', $comment->comment_ID) . ')</span></li>';
         }
     }
     if (empty($announcement)) {
         $announcement = '<li>欢迎来到 LMEE!</li>';
     }
     echo $announcement;
     echo '</ul>';
     if (is_user_logged_in()) {
         echo '<p style="text-align:right;"><a href="' . get_page_link($page_ID) . '#respond" rel="nofollow">发表公告</a></p>';
     }
     echo $after_widget;
 }
开发者ID:uglmee,项目名称:kikiku.com,代码行数:30,代码来源:Notice-for-lmee.php

示例2: mirana_recent_comments

function mirana_recent_comments($show_comments = 6)
{
    $my_email = get_bloginfo('admin_email');
    $i = 1;
    $comments = get_comments('number=50&status=approve&type=comment');
    foreach ($comments as $rc_comment) {
        if ($rc_comment->comment_author_email != $my_email) {
            ?>
				<li class="sidcomment">
					<a href="<?php 
            echo get_permalink($rc_comment->comment_post_ID);
            ?>
#comment-<?php 
            echo $rc_comment->comment_ID;
            ?>
" title="查看完整评论">
						<?php 
            echo get_avatar($rc_comment->comment_author_email, 28);
            ?>
						<?php 
            echo mb_strimwidth(strip_tags(apply_filters('the_content', convert_smilies($rc_comment->comment_content))), 0, 27, "...");
            ?>
					</a>
				</li>
				<?php 
            if ($i == $show_comments) {
                break;
            }
            $i++;
        }
    }
}
开发者ID:eric-xujun,项目名称:wordpress,代码行数:32,代码来源:comment.php

示例3: the_excerpt_rereloaded

function the_excerpt_rereloaded($words = 40, $link_text = 'Leia Mais', $allowed_tags = '', $container = 'p', $smileys = 'no' )
{
	global $post;
        
    if ( $allowed_tags == 'all' ) $allowed_tags = '<h3>,<br>,<p>,<i>,<em>,<b>,<strong>,<ul>,<ol>,<li>,<span>,<blockquote>,<img>';
    
    $text = preg_replace('/\[.*\]/', '', strip_tags($post->post_content, $allowed_tags));

    $text = explode(' ', $text);
    $tot = count($text);
    
    for ( $i=0; $i<$words; $i++ ) : $output .= $text[$i] . ' '; endfor;
    
    if ( $smileys == "yes" ) $output = convert_smilies($output);
 
    ?><p><?php echo force_balance_tags($output) ?><?php if ( $i < $tot ) : ?> ...<?php else : ?></p><?php endif; ?>
    <?php if ( $i < $tot ) : 
        if ( $container == 'p' || $container == 'div' ) : ?></p><?php endif; 
            if ( $container != 'plain' ) : ?><<?php echo $container; ?> class="more"><?php if ( $container == 'div' ) : ?><p><?php endif; endif; ?>
            
    <a href="<?php the_permalink(); ?>" title="<?php echo $link_text; ?>"><?php echo $link_text; ?></a><?php
    
            if ( $container == 'div' ) : ?></p><?php endif; if ( $container != 'plain' ) : ?></<?php echo $container; ?>><?php endif;
        if ( $container == 'plain' || $container == 'span' ) : ?></p><?php endif; 
        endif;
        
}
开发者ID:rodolfospalenza,项目名称:blogrs,代码行数:27,代码来源:the_excerpt_rereloaded.php

示例4: wpmtst_the_content

/**
 * Display the testimonial content.
 *
 * @param null $length
 *
 * @since 1.24.0
 * @since 2.4.0 Run content through selected filters only, instead
 *              of all filters added to the_excerpt() or the_content().
 *
 * @todo Use native auto-excerpt and trim_words instead.
 */
function wpmtst_the_content($length = null)
{
    if ($length) {
        $excerpt = false;
    } else {
        $excerpt = WPMST()->atts('excerpt');
        $length = WPMST()->atts('length');
    }
    // In View settings, {excerpt} overrides {length} overrides {full content}.
    if ($excerpt) {
        $content = get_the_excerpt();
        $content = apply_filters('the_excerpt', $content);
    } else {
        if ($length) {
            $content = wpmtst_get_field('truncated', array('char_limit' => $length));
        } else {
            $content = get_the_content();
        }
        // Applying all content filters breaks POS NextGEN Gallery.
        // So need to find a way to select which additional filters, if any, to apply.
        // For instance, All In One Rich Snippets.
        //$content = apply_filters( 'the_content', $content );
        $content = wptexturize($content);
        $content = convert_smilies($content);
        $content = wpautop($content);
        $content = shortcode_unautop($content);
        $content = do_shortcode($content);
    }
    echo $content;
}
开发者ID:serker72,项目名称:T3S,代码行数:41,代码来源:template-functions.php

示例5: widget_lmee_by_talk

 function widget_lmee_by_talk($args)
 {
     extract($args);
     echo $before_widget;
     $lmee_popular_options = get_option('widget_lmee_popular');
     $title = '灌水区-这里很热闹';
     //设置默认的标题
     echo $before_title . $title . $after_title;
     $page_ID = 789;
     //用来作为公告栏的页面或者文章id
     $num = 5;
     //显示公告的条数
     echo '<ul class="by_talk">';
     $announcement = '';
     $comments = get_comments("number={$num}&post_id={$page_ID}");
     if (!empty($comments)) {
         $flg = 1;
         foreach ($comments as $comment) {
             if ($flg == 1) {
                 $li_title = $comment->comment_content;
                 if (similar_text($li_title, "<") > 0) {
                     //echo "is";
                     $start = stripos($li_title, "<");
                     //从前往后查找
                     $__li_title = strrev($li_title);
                     //反转字符串
                     $length = strlen($li_title) - $start - stripos($__li_title, ">");
                     $_li_title = substr_replace($li_title, "含引用", $start, $length);
                     $_li_html = substr_replace($li_title, "", $start, $length);
                     $announcement .= '<li class="by-talk-first"><a href="' . get_page_link($page_ID) . '#comment-' . $comment->comment_ID . '" title="' . $_li_title . '" rel="nofollow" target="_blank">' . $_li_html . '</a><br /><span style="color:#999;text-align:right;">(' . get_comment_date('Y/m/d H:i', $comment->comment_ID) . ')</span></li><hr />';
                 } else {
                     //echo "un";
                     $announcement .= '<li class="by-talk-first"><a href="' . get_page_link($page_ID) . '#comment-' . $comment->comment_ID . '" title="' . $li_title . '" rel="nofollow" target="_blank">' . convert_smilies($comment->comment_content) . '</a><br /><span style="color:#999;text-align:right;">(' . get_comment_date('Y/m/d H:i', $comment->comment_ID) . ')</span></li><hr />';
                 }
                 $flg++;
             } else {
                 $li_title = $comment->comment_content;
                 if (similar_text($li_title, "<") > 0) {
                     //echo "is";
                     $start = stripos($li_title, "<");
                     //从前往后查找
                     $__li_title = strrev($li_title);
                     //反转字符串
                     $length = strlen($li_title) - $start - stripos($__li_title, ">");
                     $_li_title = substr_replace($li_title, "含引用", $start, $length);
                     $_li_html = substr_replace($li_title, "", $start, $length);
                     $announcement .= '<li><a href="' . get_page_link($page_ID) . '#comment-' . $comment->comment_ID . '" title="' . $_li_title . '" rel="nofollow" target="_blank">' . $_li_html . '</a><br /><span style="color:#999;text-align:right;">(' . get_comment_date('Y/m/d H:i', $comment->comment_ID) . ')</span></li><hr />';
                 } else {
                     //echo "un";
                     $announcement .= '<li><a href="' . get_page_link($page_ID) . '#comment-' . $comment->comment_ID . '" title="' . $li_title . '" rel="nofollow" target="_blank">' . convert_smilies($comment->comment_content) . '</a><br /><span style="color:#999;text-align:right;">(' . get_comment_date('Y/m/d H:i', $comment->comment_ID) . ')</span></li><hr />';
                 }
             }
         }
     }
     //if ( empty($announcement) ) $announcement = '<li>还没有人灌水奥!</li>';
     echo $announcement;
     echo '</ul>';
     echo "<p style='text-align:right;'>[<a href='" . get_page_link($page_ID) . "#respond' rel='nofollow'>说两句</a>]</p>";
     echo $after_widget;
 }
开发者ID:uglmee,项目名称:kikiku.com,代码行数:60,代码来源:By-talk-for-lmee.php

示例6: widget

    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        echo $before_widget;
        if (!empty($title)) {
            echo $before_title . $title . $after_title;
        }
        $number = strip_tags($instance['number']) ? absint($instance['number']) : 5;
        ?>
 

<div id="message" class="message-widget">
	<ul>
		<?php 
        $show_comments = $number;
        $my_email = get_bloginfo('admin_email');
        $i = 1;
        $comments = get_comments('number=200&status=approve&type=comment');
        foreach ($comments as $my_comment) {
            if ($my_comment->comment_author_email != $my_email) {
                ?>
					<li>
						<a href="<?php 
                echo get_permalink($my_comment->comment_post_ID);
                ?>
#comment-<?php 
                echo $my_comment->comment_ID;
                ?>
" title="发表在 > <?php 
                echo get_the_title($my_comment->comment_post_ID);
                ?>
" >
							<?php 
                echo '<img class="avatar" src="' . get_bloginfo('template_directory') . '/img/gravatar.png" alt="avatar" data-original="' . preg_replace(array('/^.+(src=)(\\"|\')/i', '/(\\"|\')\\sclass=(\\"|\').+$/i'), array('', ''), get_avatar($my_comment->comment_author_email, 64)) . '" />';
                ?>
							<strong><div class="comment_author"><?php 
                echo $my_comment->comment_author;
                ?>
</div></strong>
							<?php 
                echo convert_smilies($my_comment->comment_content);
                ?>
						</a>
					</li>
					<?php 
                if ($i == $show_comments) {
                    break;
                }
                $i++;
            }
        }
        ?>
	</ul>
</div>

<?php 
        echo $after_widget;
    }
开发者ID:areszn,项目名称:wordpress,代码行数:59,代码来源:widgets.php

示例7: wpsight_format_content

 function wpsight_format_content($content)
 {
     if (!$content) {
         return;
     }
     $content = do_shortcode(shortcode_unautop(wpautop(convert_chars(convert_smilies(wptexturize($content))))));
     return apply_filters('wpsight_format_content', $content);
 }
开发者ID:phucanh92,项目名称:vietlong,代码行数:8,代码来源:helpers.php

示例8: widget

    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        echo $before_widget;
        if (!empty($title)) {
            echo $before_title . $title . $after_title;
        }
        $number = strip_tags($instance['number']) ? absint($instance['number']) : 5;
        ?>

<div id="message" class="message-widget">
	<ul>
		<?php 
        $show_comments = $number;
        $my_email = get_bloginfo('admin_email');
        $i = 1;
        $comments = get_comments('number=200&status=approve&type=comment');
        foreach ($comments as $my_comment) {
            if ($my_comment->comment_author_email != $my_email) {
                ?>
				<li>
					<a href="<?php 
                echo get_permalink($my_comment->comment_post_ID);
                ?>
#comment-<?php 
                echo $my_comment->comment_ID;
                ?>
" title="发表在 > <?php 
                echo get_the_title($my_comment->comment_post_ID);
                ?>
" >
						<?php 
                echo get_avatar($my_comment->comment_author_email, 64);
                ?>
						<span class="comment_author"><strong><?php 
                echo $my_comment->comment_author;
                ?>
</strong></span>
						<?php 
                echo convert_smilies($my_comment->comment_content);
                ?>
					</a>
				</li>
				<?php 
                if ($i == $show_comments) {
                    break;
                }
                $i++;
            }
        }
        ?>
	</ul>
</div>

<?php 
        echo $after_widget;
    }
开发者ID:beichengandnight,项目名称:daikuanzj,代码行数:58,代码来源:widgets.php

示例9: carelib_get_404_content

/**
 * Output the 404 entry title.
 *
 * @since  1.0.0
 * @access public
 * @return string $content The modified content.
 */
function carelib_get_404_content()
{
    $content = wpautop(esc_attr__('It looks like nothing was found at this location. Maybe try one of the links below or a search?', 'carelib'));
    $content .= get_search_form(false);
    $content .= carelib_get_the_widget('WP_Widget_Recent_Posts');
    // Translators: %1$s is a smile emoji.
    $after_title = wpautop(sprintf(__('Try looking in the monthly archives. %1$s', 'carelib'), convert_smilies(':)')));
    $content .= carelib_get_the_widget('WP_Widget_Archives', 'dropdown=1', 'after_title=</h2> ' . $after_title);
    $content .= carelib_get_the_widget('WP_Widget_Tag_Cloud');
    return apply_filters("{$GLOBALS['carelib_prefix']}_404_content", $content);
}
开发者ID:wpsitecare,项目名称:carelib,代码行数:18,代码来源:template-404.php

示例10: wp_footer

 function wp_footer()
 {
     if (!is_admin() && !is_feed() && !is_robots() && !is_trackback()) {
         $text = get_option('shfs_insert_footer', '');
         $text = convert_smilies($text);
         $text = do_shortcode($text);
         if ($text != '') {
             echo $text, "\n";
         }
     }
 }
开发者ID:prashantbarca,项目名称:prashant.at,代码行数:11,代码来源:shfs.php

示例11: widget

 /**
  * 小工具的渲染方法,这里就是输出评论
  */
 function widget($args, $instance)
 {
     global $wpdb, $comments, $comment;
     $cache = wp_cache_get('f_comment', 'widget');
     if (!is_array($cache)) {
         $cache = array();
     }
     if (!isset($args['widget_id'])) {
         $args['widget_id'] = $this->id;
     }
     if (isset($cache[$args['widget_id']])) {
         echo $cache[$args['widget_id']];
         return;
     }
     extract($args, EXTR_SKIP);
     $output = '';
     $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Comments') : $instance['title'], $instance, $this->id_base);
     if (empty($instance['number']) || !($number = absint($instance['number']))) {
         $number = 5;
     }
     //获取评论,过滤掉管理员自己
     $comments = $wpdb->get_results("SELECT * FROM {$wpdb->comments} WHERE user_id !=1 and comment_approved = '1' and comment_type not in ('pingback','trackback') ORDER BY comment_date_gmt DESC LIMIT {$number}");
     $output .= $before_widget;
     if ($title) {
         $output .= $before_title . $title . $after_title;
     }
     $output .= '<div class="all-comments">';
     if ($comments) {
         // Prime cache for associated posts. (Prime post term cache if we need it for permalinks.)
         $post_ids = array_unique(wp_list_pluck($comments, 'comment_post_ID'));
         _prime_post_caches($post_ids, strpos(get_option('permalink_structure'), '%category%'), false);
         foreach ((array) $comments as $comment) {
             if ($comment->comment_author_email != $my_email) {
                 //头像
                 $avatar = get_avatar($comment, 36);
                 //作者名称
                 $author = get_comment_author();
                 //评论内容
                 $content = apply_filters('get_comment_text', $comment->comment_content);
                 $content = mb_strimwidth(strip_tags($content), 0, '65', '...', 'UTF-8');
                 $content = convert_smilies($content);
                 //评论的文章
                 $post = '<a href="' . esc_url(get_comment_link($comment->comment_ID)) . '">' . $avatar . $author . '<span class="muted">' . timeago($comment->comment_date_gmt) . ':<br>' . $content . '</span></a>';
                 //这里就是输出的html,可以根据需要自行修改
                 $output .= $post;
             }
         }
     }
     $output .= '</div>';
     $output .= $after_widget;
     echo $output;
     $cache[$args['widget_id']] = $output;
     wp_cache_set('my_widget_recent_comments', $cache, 'widget');
 }
开发者ID:YocoZhang,项目名称:my-blog-site,代码行数:57,代码来源:wid-comment.php

示例12: widget

    function widget($args, $instance)
    {
        extract($args);
        ?>
		<?php 
        echo $before_widget;
        ?>
		<?php 
        echo $before_title . $instance['title'] . $after_title;
        ?>
		<ul>
		<?php 
        $show_comments = $instance['num'];
        //评论数量
        $my_email = get_bloginfo('admin_email');
        //获取博主自己的email
        $i = 1;
        $comments = get_comments('number=50&status=approve&type=comment');
        foreach ($comments as $rc_comment) {
            //只显示非博主的评论
            if ($rc_comment->comment_author_email != $my_email) {
                ?>
                <li><?php 
                echo get_avatar($rc_comment->comment_author_email, 32);
                ?>
<a href="<?php 
                echo get_permalink($rc_comment->comment_post_ID);
                ?>
#comment-<?php 
                echo $rc_comment->comment_ID;
                ?>
"><?php 
                echo $rc_comment->comment_author;
                ?>
: </br><?php 
                echo convert_smilies($rc_comment->comment_content);
                ?>
</a></li>
                <?php 
                if ($i == $show_comments) {
                    break;
                }
                //评论数量达到退出遍历
                $i++;
            }
        }
        ?>
</ul>
		<?php 
        echo $after_widget;
        ?>
		<?php 
    }
开发者ID:w392807287,项目名称:FirstRepository,代码行数:53,代码来源:latestComment.class.php

示例13: list_most_recent_comments

function list_most_recent_comments($args = null)
{
    // These are in addition to the args of get_most_recent_comments() and get_comments()
    $defaults = array('excerpt_words' => 0, 'excerpt_chars' => 0, 'comment_format' => 0);
    $r = wp_parse_args($args, $defaults);
    $comments = get_most_recent_comments($r);
    $output = "<ul>\n";
    if ($comments) {
        $idx = 0;
        foreach ($comments as $comment) {
            $comment_author = stripslashes($comment->comment_author);
            if (empty($comment_author)) {
                $comment_author = __('anonymous');
            }
            $comment_content = strip_tags($comment->comment_content);
            $comment_content = stripslashes($comment_content);
            if (0 != $r['excerpt_words']) {
                $words = explode(' ', $comment_content);
                $comment_content = implode(' ', array_slice($words, 0, $r['excerpt_words']));
            } elseif (0 != $r['excerpt_chars']) {
                $comment_content = substr($comment_content, 0, $r['excerpt_chars']);
            }
            $comment_permalink = get_comment_link($comment->comment_ID);
            if (1 == $r['comment_format']) {
                $post_title = stripslashes($comment->post_title);
                $post_id = stripslashes($comment->post_id);
                $url = $comment->comment_author_url;
                $idx++;
                if (1 == $idx % 2) {
                    $before = '<li class="statsclass1">';
                } else {
                    $before = '<li class="statsclass2">';
                }
                $output .= "{$before}<a href='{$comment_permalink}'>{$comment_author}</a> on <a href='" . get_permalink($comment->ID) . "'>{$post_title}</a>{$after}";
            } else {
                $idx++;
                if (1 == $idx % 2) {
                    $before = "<li class='statsclass1'>";
                } else {
                    $before = "<li class='statsclass2'>";
                }
                $output .= "{$before}<strong>{$comment_author}:</strong> <a href='{$comment_permalink}' title='" . sprintf(__('View the entire comment by %s'), $comment_author) . "'>{$comment_content}</a>{$after}";
            }
        }
        $output = convert_smilies($output);
    } else {
        $output .= '<li>' . __('None Found') . '</li>';
    }
    $output .= "</ul>\n";
    echo $output;
}
开发者ID:gopinathshiva,项目名称:wordpress-vip-plugins,代码行数:51,代码来源:recent-comments.php

示例14: sdm_get_item_description_output

function sdm_get_item_description_output($id)
{
    $item_description = get_post_meta($id, 'sdm_description', true);
    $isset_item_description = isset($item_description) && !empty($item_description) ? $item_description : '';
    //$isset_item_description = apply_filters('the_content', $isset_item_description);
    $isset_item_description = do_shortcode($isset_item_description);
    $isset_item_description = wptexturize($isset_item_description);
    $isset_item_description = convert_smilies($isset_item_description);
    $isset_item_description = convert_chars($isset_item_description);
    $isset_item_description = wpautop($isset_item_description);
    $isset_item_description = shortcode_unautop($isset_item_description);
    $isset_item_description = prepend_attachment($isset_item_description);
    return $isset_item_description;
}
开发者ID:RodolfoFuentes,项目名称:SiteAbogado,代码行数:14,代码来源:sdm-utility-functions.php

示例15: the_content_rss

 function the_content_rss($more_link_text = '(more...)', $stripteaser = 0, $more_file = '', $cut = 0, $encode_html = 0, $echo = true)
 {
     if (!empty($GLOBALS['post']->post_password)) {
         // if there's a password
         $output = "<p>This post is a password protected content.</p>";
         return _echo($output, $echo);
     }
     $content = get_the_content($more_link_text, $stripteaser, $more_file);
     $content = apply_filters('the_content', $content);
     $content = preg_replace('/<style.*?>.*?<\\/style.*?>/ms', '', $content);
     if ($cut && !$encode_html) {
         $encode_html = 2;
     }
     if ($encode_html == 1) {
         $content = htmlspecialchars($content);
         $cut = 0;
     } elseif ($encode_html == 0) {
         $content = preg_replace('/(<br .*?>|<\\/tr>|<\\/table>|<\\/li>|<\\/h\\d>|<\\/p>)/ms', "_rss_cr_", $content);
         $content = htmlspecialchars(make_url_footnote($content));
         $content = preg_replace('/_rss_cr_/ms', '&lt;br /&gt;', $content);
     } elseif ($encode_html == 2) {
         $content = preg_replace('/(<br .*?>|<\\/tr>|<\\/table>|<\\/li>|<\\/h\\d>|<\\/p>)/ms', "_rss_cr_", $content);
         $content = htmlspecialchars(strip_tags($content));
         $content = preg_replace('/_rss_cr_/ms', '&lt;br /&gt;', $content);
     } elseif ($encode_html == 3) {
         $content = convert_smilies($content);
         $cut = 0;
     }
     $excerpt = '';
     if ($cut) {
         $blah = explode(' ', $content);
         if (count($blah) > $cut) {
             $k = $cut;
             $use_dotdotdot = 1;
         } else {
             $k = count($blah);
             $use_dotdotdot = 0;
         }
         for ($i = 0; $i < $k; $i++) {
             $excerpt .= $blah[$i] . ' ';
         }
         $excerpt .= $use_dotdotdot ? '...' : '';
         $content = $excerpt;
     }
     $content = str_replace(']]>', ']]&gt;', $content);
     return _echo(wp_convert_rss_charset($content), $echo);
 }
开发者ID:nobunobuta,项目名称:xoops_mod_WordPress,代码行数:47,代码来源:template-functions-post.php


注:本文中的convert_smilies函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。