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


PHP Upload::get_url方法代码示例

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


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

示例1: header

        $limit = 500;
    }
} else {
    $user = '';
}
header('Content-Type: text/html; charset=utf-8');
$media = $db->get_results("select type, id, version, unix_timestamp(date) as date, mime, user as uid, user_login as user from media, users where type in {$type_in} {$user} and version = 0 and user_id = media.user order by date desc limit {$limit}");
$images = array();
if ($media) {
    foreach ($media as $image) {
        if (!$show_all) {
            switch ($image->type) {
                case 'comment':
                    $karma = $db->get_var("select comment_karma from comments where comment_id = {$image->id}");
                    break;
                case 'post':
                    $karma = $db->get_var("select post_karma from posts where post_id = {$image->id}");
                    break;
                default:
                    $karma = 0;
            }
        }
        if ($show_all || $karma > -10) {
            $image->url = Upload::get_url($image->type, $image->id, $image->version, $image->date, $image->mime);
            $images[] = $image;
        }
    }
}
if ($images) {
    Haanga::Load("backend/gallery.html", compact('images'));
}
开发者ID:GallardoAlba,项目名称:Meneame,代码行数:31,代码来源:gallery.php

示例2: min

    $globals['time_enabled_comments'] = min($globals['time_enabled_comments_status'][$link->status], $globals['time_enabled_comments']);
}
// Check for comment post
if ($_POST['process'] == 'newcomment') {
    $new = new Comment();
    $new_comment_error = $new->save_from_post($link);
}
$username = $comment->type == 'admin' ? 'admin' : $comment->username;
if ($comment->type != 'admin') {
    $globals['search_options'] = array('w' => 'comments', 'u' => $comment->username);
}
$comment->check_visibility();
if (!$comment->hide_comment) {
    $globals['description'] = _('Autor') . ": {$username}, " . _('Resumen') . ': ' . text_to_summary($comment->content, 250);
    if ($globals['media_public'] && $comment->media_size > 0) {
        $globals['thumbnail'] = Upload::get_url('comment', $comment->id, 0, $comment->media_date, $comment->media_mime);
    } elseif ($comment->avatar) {
        $globals['thumbnail'] = get_avatar_url($comment->author, $comment->avatar, 80);
    }
    $title = text_to_summary($comment->content, 120);
} else {
    $title = '';
}
if (isset($globals['canonical_server_name']) && !empty($globals['canonical_server_name'])) {
    $globals['extra_head'] = '<link rel="canonical" href="http://' . $globals['canonical_server_name'] . $comment->get_relative_individual_permalink() . '" />';
}
do_header($title . ' | ' . $globals['site_name']);
//do_subheader(_('comentario de') . ' ' . $username);
/*** SIDEBAR ****/
echo '<div id="sidebar">';
do_banner_right();
开发者ID:brainsqueezer,项目名称:fffff,代码行数:31,代码来源:comment.php

示例3: prepare_summary_text

 function prepare_summary_text($length = 0)
 {
     global $globals, $current_user;
     if ($this->single_link) {
         $this->html_id = $this->order;
     } else {
         $this->html_id = $this->id;
     }
     $this->can_edit = (!isset($this->basic_summary) || !$this->basic_summary) && ($this->author == $current_user->user_id && $globals['now'] - $this->date < $globals['comment_edit_time'] || ($this->author != $current_user->user_id || $this->type == 'admin') && $current_user->user_level == 'god');
     if ($length > 0) {
         $this->truncate($length);
     }
     $this->txt_content = $this->to_html($this->content);
     if ($this->media_size > 0) {
         $this->media_thumb_dir = Upload::get_cache_relative_dir($this->id);
         $this->media_url = Upload::get_url('comment', $this->id, 0, $this->media_date, $this->media_mime);
     }
 }
开发者ID:GallardoAlba,项目名称:Meneame,代码行数:18,代码来源:comment.php

示例4: prepare_summary_text

 function prepare_summary_text($length = 0)
 {
     global $current_user, $globals;
     if (empty($this->basic_summary) && ($this->author == $current_user->user_id && time() - $this->date < $globals['posts_edit_time'] || $current_user->user_level == 'god' && time() - $this->date < $globals['posts_edit_time_admin'])) {
         // Admins can edit up to 10 days
         $this->can_edit = true;
     } else {
         $this->can_edit = false;
     }
     if ($length > 0) {
         $this->content = text_to_summary($this->content, $length);
     }
     $this->content = $this->to_html($this->content) . $expand;
     if ($this->media_size > 0) {
         $this->media_thumb_dir = Upload::get_cache_relative_dir($this->id);
         $this->media_url = Upload::get_url('post', $this->id, 0, $this->media_date, $this->media_mime);
     }
 }
开发者ID:brainsqueezer,项目名称:fffff,代码行数:18,代码来源:post.php

示例5: has_thumb

 function has_thumb()
 {
     global $globals;
     if (!empty($this->thumb_url)) {
         return $this->thumb_url;
     }
     if ($this->media_size > 0) {
         // New format
         $base = $globals['base_static_noversion'];
         $this->thumb_uri = Upload::get_cache_relative_dir($this->id) . "/media_thumb-link-{$this->id}.{$this->media_extension}?{$this->media_date}";
         $this->thumb_url = $base . $this->thumb_uri;
         $this->media_url = Upload::get_url('link', $this->id, 0, $this->media_date, $this->media_mime);
         $this->thumb_x = $this->thumb_y = $globals['thumb_size'];
         return $this->thumb_url;
     }
     $this->thumb_url = false;
     return false;
 }
开发者ID:brainsqueezer,项目名称:fffff,代码行数:18,代码来源:link.php


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