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


PHP Get::articleAnchor方法代码示例

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


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

示例1: recentComment

 /**
  * Widget Recent Comment
  * ---------------------
  *
  * [1]. Widget::recentComment();
  * [2]. Widget::recentComment(5);
  *
  */
 public static function recentComment($total = 7, $avatar_size = 50, $summary = 100, $d = 'monsterid')
 {
     $T1 = TAB;
     $T2 = str_repeat(TAB, 2);
     $T3 = str_repeat(TAB, 3);
     $T4 = str_repeat(TAB, 4);
     $T5 = str_repeat(TAB, 5);
     $config = Config::get();
     $speak = Config::speak();
     $comments = Get::comments();
     $html = O_BEGIN . '<div class="widget widget-recent widget-recent-comment"' . ($comments ? ' id="widget-recent-comment-' . self::$id['recent_comment'] . '"' : "") . '>' . NL;
     self::$id['recent_comment']++;
     if ($comments) {
         $comments_id = array();
         foreach ($comments as $comment) {
             $parts = explode('_', File::B($comment));
             $comments_id[] = $parts[1];
         }
         rsort($comments_id);
         $html .= $T1 . '<ul class="recent-comment-list">' . NL;
         for ($i = 0, $count = count($comments_id); $i < $total; ++$i) {
             if ($i === $count) {
                 break;
             }
             $comment = Get::comment($comments_id[$i]);
             $article = Get::articleAnchor($comment->post);
             $html .= $T2 . '<li class="recent-comment">' . NL;
             if ($avatar_size !== false && $avatar_size > 0) {
                 $html .= $T3 . '<div class="recent-comment-avatar">' . NL;
                 $html .= $T4 . '<img alt="" src="' . $config->protocol . 'www.gravatar.com/avatar/' . md5($comment->email) . '?s=' . $avatar_size . '&amp;d=' . urlencode($d) . '" width="' . $avatar_size . '" height="' . $avatar_size . '"' . ES . NL;
                 $html .= $T3 . '</div>' . NL;
             }
             $html .= $T3 . '<div class="recent-comment-header">' . NL;
             if (trim($comment->url) === "" || $comment->url === '#') {
                 $html .= $T4 . '<span class="recent-comment-name">' . $comment->name . '</span>' . NL;
             } else {
                 $html .= $T4 . '<a class="recent-comment-name" href="' . $comment->url . '" rel="nofollow">' . $comment->name . '</a>' . NL;
             }
             $html .= $T3 . '</div>' . NL;
             $html .= $T3 . '<div class="recent-comment-body"><p>' . Converter::curt($comment->message, $summary, '&hellip;') . '</p></div>' . NL;
             $html .= $T3 . '<div class="recent-comment-footer">' . NL;
             $html .= $T4 . '<span class="recent-comment-time">' . NL;
             $html .= $T5 . '<time datetime="' . $comment->date->W3C . '">' . $comment->date->FORMAT_3 . '</time> <a title="' . ($article ? strip_tags($article->title) : $speak->notify_error_not_found) . '" href="' . $comment->permalink . '" rel="nofollow">#</a>' . NL;
             $html .= $T4 . '</span>' . NL;
             $html .= $T3 . '</div>' . NL;
             $html .= $T2 . '</li>' . NL;
         }
         $html .= $T1 . '</ul>' . NL;
     } else {
         $html .= Config::speak('notify_empty', strtolower($speak->comments));
     }
     $html .= '</div>' . O_END;
     $html = Filter::apply('widget', $html);
     return Filter::apply('widget:recent.comment', Filter::apply('widget:recent', $html));
 }
开发者ID:razordaze,项目名称:mecha-cms,代码行数:63,代码来源:widget.php

示例2: str_replace

             $articles[] = $file;
             $anchor = Get::articleAnchor($file);
             $kw = str_replace('-', ' ', $keywords);
             if (strpos(strtolower($anchor->title), $kw) !== false || strpos(File::N($anchor->path), $kw) !== false) {
                 $articles[] = $file;
             }
         }
         unset($files);
     }
     // Matched with a keyword
     $keywords = explode('-', $keywords);
     foreach ($keywords as $keyword) {
         if ($files = Get::articles('DESC', 'keyword:' . $keyword)) {
             foreach ($files as $file) {
                 $articles[] = $file;
                 $anchor = Get::articleAnchor($file);
                 if (strpos(strtolower($anchor->title), $keyword) !== false || strpos(File::N($anchor->path), $keyword) !== false) {
                     $articles[] = $file;
                 }
             }
             unset($files);
         }
     }
     $articles = array_unique($articles);
     // Remove search result(s) duplicate
     Session::set('search.query', $query);
     Session::set('search.results', $articles);
 }
 $title = sprintf($config->search->title, $query);
 if (!empty($articles) && ($results = Mecha::eat($articles)->chunk($offset, $config->search->per_page)->vomit())) {
     $_articles = Mecha::walk($results, function ($path) use($excludes) {
开发者ID:yiannisSt,项目名称:mecha-cms,代码行数:31,代码来源:launch.php

示例3: strtolower

<?php

$aa = Get::articleAnchor($response->post);
echo $messages;
?>
<p><strong><?php 
echo $response->name;
?>
</strong><?php 
echo $aa ? ' ' . strtolower($speak->to) . ' <a href="' . $response->permalink . '" target="_blank">' . $aa->title . '</a>' : "";
?>
</p>
<p><?php 
echo $response->message;
?>
</p>
  <p><strong><?php 
echo $speak->date;
?>
:</strong> <?php 
echo Date::format($response->time, 'Y/m/d H:i:s');
?>
</p>
<form class="form-kill form-comment" id="form-kill" action="<?php 
echo $config->url_current . $config->url_query;
?>
" method="post">
<?php 
echo Jot::button('action', $speak->yes);
?>
 <?php 
开发者ID:razordaze,项目名称:mecha-cms,代码行数:31,代码来源:kill.comment.php


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