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


PHP Text::urlink方法代码示例

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


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

示例1: getList

 public static function getList($blog, $limit = null)
 {
     $list = array();
     $sql = "\n                SELECT\n                    comment.id,\n                    comment.post,\n                    DATE_FORMAT(comment.date, '%d | %m | %Y') as date,\n                    comment.text,\n                    comment.user\n                FROM    comment\n                INNER JOIN user\n                    ON  user.id = comment.user\n                    AND (user.hide = 0 OR user.hide IS NULL)\n                WHERE comment.post IN (SELECT id FROM post WHERE blog = ?)\n                ORDER BY comment.date DESC, comment.id DESC\n                ";
     if (!empty($limit)) {
         $sql .= "LIMIT {$limit}";
     }
     $query = static::query($sql, array($blog));
     foreach ($query->fetchAll(\PDO::FETCH_CLASS, __CLASS__) as $comment) {
         $comment->user = \Goteo\Model\User::getMini($comment->user);
         // reconocimiento de enlaces y saltos de linea
         $comment->text = nl2br(Text::urlink($comment->text));
         $list[$comment->id] = $comment;
     }
     return $list;
 }
开发者ID:isbkch,项目名称:Goteo,代码行数:16,代码来源:comment.php

示例2: getAll

 public static function getAll($project, $lang = null)
 {
     $messages = array();
     $query = static::query("\n                SELECT\n                    message.id as id,\n                    message.user as user,\n                    message.project as project,\n                    message.thread as thread,\n                    message.date as date,\n                    IFNULL(message_lang.message, message.message) as message,\n                    message.blocked as blocked,\n                    message.closed as closed\n                FROM  message\n                LEFT JOIN message_lang\n                    ON  message_lang.id = message.id\n                    AND message_lang.lang = :lang\n                WHERE   message.project = :project\n                AND     message.thread IS NULL\n                ORDER BY date ASC, id ASC\n                ", array(':project' => $project, ':lang' => $lang));
     foreach ($query->fetchAll(\PDO::FETCH_CLASS, __CLASS__) as $message) {
         // datos del usuario
         $message->user = User::getMini($message->user);
         // reconocimiento de enlaces y saltos de linea
         $message->message = nl2br(Text::urlink($message->message));
         //hace tanto
         $message->timeago = Feed::time_ago($message->date);
         $query = static::query("\n                    SELECT  id\n                    FROM  message\n                    WHERE thread = ?\n                    ORDER BY date ASC, id ASC\n                    ", array($message->id));
         foreach ($query->fetchAll(\PDO::FETCH_CLASS) as $response) {
             $message->responses[] = self::get($response->id);
         }
         $messages[] = $message;
     }
     return $messages;
 }
开发者ID:anvnguyen,项目名称:Goteo,代码行数:19,代码来源:message.php

示例3: if

 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Affero General Public License for more details.
 *
 *  You should have received a copy of the GNU Affero General Public License
 *  along with Goteo.  If not, see <http://www.gnu.org/licenses/agpl.txt>.
 *
 */

use Goteo\Model\User\Interest,
    Goteo\Model\User\Skill,
    Goteo\Library\Text;

$user = $this['user'];

$user->about = nl2br(Text::urlink($user->about));

$interests = Interest::getAll();
$skills = Skill::getAll(null,true);
?>

<div class="widget user-about">
    
    
    <?php if (!empty($user->about)): ?>    
    <div class="about">        
        <h4><?php echo Text::get('profile-about-header'); ?></h4>
        <p><?php echo $user->about ?></p>
    </div>    
    <?php endif ?>
        
开发者ID:kenjs,项目名称:Goteo,代码行数:30,代码来源:about.html.php

示例4:

 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Affero General Public License for more details.
 *
 *  You should have received a copy of the GNU Affero General Public License
 *  along with Goteo.  If not, see <http://www.gnu.org/licenses/agpl.txt>.
 *
 */
use Goteo\Library\Text;
$project = $this['project'];
//tratamos los saltos de linea y los links en las descripciones del proyecto
$project->description = nl2br(Text::urlink($project->description));
$project->about = nl2br(Text::urlink($project->about));
$project->motivation = nl2br(Text::urlink($project->motivation));
$project->goal = nl2br(Text::urlink($project->goal));
$project->related = nl2br(Text::urlink($project->related));
$level = (int) $this['level'] ?: 3;
?>
    <?php 
if (count($project->gallery) > 1) {
    ?>
		<script type="text/javascript" >
			$(function(){
				$('#prjct-gallery').slides({
					container: 'prjct-gallery-container',
					paginationClass: 'slderpag',
					generatePagination: false,
					play: 0
				});
			});
		</script>
开发者ID:isbkch,项目名称:Goteo,代码行数:31,代码来源:summary.html.php

示例5:

 *
 *  You should have received a copy of the GNU Affero General Public License
 *  along with Goteo.  If not, see <http://www.gnu.org/licenses/agpl.txt>.
 *
 */
use Goteo\Library\Text, Goteo\Model\Blog\Post;
$post = Post::get($this['post'], LANG);
$level = (int) $this['level'] ?: 3;
if ($this['show'] == 'list') {
    $post->text = Text::recorta($post->text, 500);
}
if (empty($this['url'])) {
    $url = '/blog/';
} else {
    $url = $this['url'];
    $post->text = nl2br(Text::urlink($post->text));
}
?>
    <?php 
if (count($post->gallery) > 1) {
    ?>
		<script type="text/javascript" >
			$(function(){
				$('#post-gallery<?php 
    echo $post->id;
    ?>
').slides({
					container: 'post-gallery-container',
					paginationClass: 'slderpag',
					generatePagination: false,
					play: 0
开发者ID:anvnguyen,项目名称:Goteo,代码行数:31,代码来源:post.html.php


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