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


PHP BBCode::receive_event方法代码示例

本文整理汇总了PHP中BBCode::receive_event方法的典型用法代码示例。如果您正苦于以下问题:PHP BBCode::receive_event方法的具体用法?PHP BBCode::receive_event怎么用?PHP BBCode::receive_event使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BBCode的用法示例。


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

示例1: strip

 private function strip($in)
 {
     $bb = new BBCode();
     $tfe = new TextFormattingEvent($in);
     $bb->receive_event($tfe);
     return $tfe->stripped;
 }
开发者ID:kmcasto,项目名称:shimmie2,代码行数:7,代码来源:test.php

示例2: comment_to_html

 protected function comment_to_html($comment, $trim = false)
 {
     global $user;
     $tfe = new TextFormattingEvent($comment->comment);
     // sending this event to all ~50 exts has a lot of overhead
     if (SPEED_HAX) {
         $bb = new BBCode();
         $bb->receive_event($tfe);
     } else {
         send_event($tfe);
     }
     $i_uid = int_escape($comment->owner_id);
     $h_name = html_escape($comment->owner_name);
     $h_poster_ip = html_escape($comment->poster_ip);
     $h_timestamp = autodate($comment->posted);
     $h_comment = $trim ? substr($tfe->stripped, 0, 50) . "..." : $tfe->formatted;
     $i_comment_id = int_escape($comment->comment_id);
     $i_image_id = int_escape($comment->image_id);
     $anoncode = "";
     if ($h_name == "Anonymous" && $this->anon_id >= 0) {
         $anoncode = "<sup>{$this->anon_id}</sup>";
         $this->anon_id++;
     }
     $h_userlink = "<a href='" . make_link("user/{$h_name}") . "'>{$h_name}</a>{$anoncode}";
     $stripped_nonl = str_replace("\n", "\\n", substr($tfe->stripped, 0, 50));
     $stripped_nonl = str_replace("\r", "\\r", $stripped_nonl);
     $h_dellink = $user->is_admin() ? "<br>({$h_poster_ip}, {$h_timestamp}, <a " . "onclick=\"return confirm('Delete comment by {$h_name}:\\n{$stripped_nonl}');\" " . "href='" . make_link("comment/delete/{$i_comment_id}/{$i_image_id}") . "'>Del</a>)" : "";
     if ($trim) {
         return "\n\t\t\t\t{$h_userlink}: {$h_comment}\n\t\t\t\t<a href='" . make_link("post/view/{$i_image_id}") . "'>&gt;&gt;&gt;</a>\n\t\t\t\t{$h_dellink}\n\t\t\t";
     } else {
         //$avatar = "";
         //if(!empty($comment->owner->email)) {
         //	$hash = md5(strtolower($comment->owner->email));
         //	$avatar = "<img src=\"http://www.gravatar.com/avatar/$hash.jpg\"><br>";
         //}
         $oe = $this->comments_shown++ % 2 == 0 ? "even" : "odd";
         return "\n\t\t\t\t<a name='{$i_comment_id}'></a>\n\t\t\t\t<div class='{$oe} comment'>\n\t\t\t\t<!--<span class='timeago' style='float: right;'>{$h_timestamp}</span>-->\n\t\t\t\t{$h_userlink}: {$h_comment}\n\t\t\t\t{$h_dellink}\n\t\t\t\t</div>\n\t\t\t";
     }
 }
开发者ID:nsuan,项目名称:shimmie2,代码行数:39,代码来源:theme.php


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