• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP image_url函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: get_articles_list

 public function get_articles_list($interval, $type = NULL)
 {
     if (!empty($type) and !in_array($type, $this->_special_type)) {
         $this->query['where'] = "`type` = '{$type}'";
         $this->query['order'] = '`creation`';
     } else {
         $this->query['order'] = '`creation` DESC';
     }
     $lang = Buffer::get(URL_LANG);
     if (!empty($lang)) {
         $this->query['where'] = empty($this->query['where']) ? "`lang` = '{$lang}'" : $this->query['where'] . " AND `lang` = '{$lang}'";
     }
     $from = ($interval - 1) * $this->_count;
     $to = $interval * $this->_count;
     $this->query['select'] = '`id`, `header`, `type`, `structure`, `creation`';
     $this->query['limit'] = ($from <= 0 and $to <= 0) ? '' : "{$from},{$to}";
     $non_format = $this->rows(TRUE);
     $result = array();
     foreach ($non_format as $item) {
         $structure = json_decode($item['structure'], TRUE);
         $structure['header'] = $item['header'];
         $structure['image'] = image_url('types/' . $item['type'] . '.jpg');
         $structure['link'] = base_url("articles/read/{$item['id']}");
         $structure['footer'] = get_string('url_naming', $item['type']);
         $result[] = $structure;
     }
     return $result;
 }
开发者ID:viking2000,项目名称:web-antarix,代码行数:28,代码来源:articles_model.php


示例2: parse_bbcode

/**
* Parse bbCode
*
* Takes a string as input and replace bbCode by (x)HTML tags
*
* @access    public
* @param    string    the text to be parsed
* @return    string
*/
function parse_bbcode($str, $clear = 0, $parse_smileys = FALSE)
{
    $bbcode_to_parse = _get_bbcode_to_parse_array();
    if (FALSE === $bbcode_to_parse) {
        return FALSE;
    }
    foreach ($bbcode_to_parse as $key => $val) {
        for ($i = 1; $i <= $bbcode_to_parse[$key][2]; $i++) {
            $str = preg_replace($key, $bbcode_to_parse[$key][$clear], $str);
        }
    }
    $str = break_lines($str);
    if ($parse_smileys) {
        // All this funky code applys smileys to anything OUTSIDE code blocks
        preg_match_all('/<code>.*?<\\/code>/s', $str, $code_blocks, PREG_PATTERN_ORDER);
        $block_num = 0;
        foreach ($code_blocks[0] as $block) {
            $str = str_replace($block, "{block_{$block_num}}", $str);
            $block_num++;
        }
        $str = parse_smileys($str, image_url("smileys/"));
        $block_num = 0;
        foreach ($code_blocks[0] as $block) {
            $str = str_replace("{block_{$block_num}}", $block, $str);
            $block_num++;
        }
    }
    $str = preg_replace('/<code>*\\s*/s', '<code>', $str);
    return preg_replace('/\\s*<\\/code>/s', '</code>', $str);
}
开发者ID:Tapha,项目名称:pyrocms,代码行数:39,代码来源:bbcode_helper.php


示例3: getThumbAttribute

 public function getThumbAttribute()
 {
     if ($this->Staff) {
         return image_url('sm', 'quarter', $this->Staff->image);
     }
     return "http://www.gravatar.com/avatar/" . md5(strtolower(trim($this->email))) . "?s=200";
 }
开发者ID:mcculley1108,项目名称:admin.faithpromise.org,代码行数:7,代码来源:User.php


示例4: parse

/**
 * Parse Textile
 *
 * Takes a string as input and parse the Textile
 *
 * @param	string	$str			The string to be parsed
 * @param	bool	$parse_smileys	Parse the smileys or not
 * @return	string
 */
function parse($str, $clear = 0, $parse_smileys = FALSE)
{
    $ci =& get_instance();
    if (!class_exists('Textile')) {
        $ci->load->library('Textile');
    }
    $str = htmlspecialchars_decode($str);
    $str = $ci->textile->TextileThis($str);
    if ($parse_smileys) {
        // All this funky code applys smileys to anything OUTSIDE code blocks
        preg_match_all('/<code>.*?<\\/code>/s', $str, $code_blocks, PREG_PATTERN_ORDER);
        $block_num = 0;
        foreach ($code_blocks[0] as $block) {
            $str = str_replace($block, "{block_{$block_num}}", $str);
            $block_num++;
        }
        $str = parse_smileys($str, image_url("smileys/"));
        $block_num = 0;
        foreach ($code_blocks[0] as $block) {
            $str = str_replace("{block_{$block_num}}", $block, $str);
            $block_num++;
        }
    }
    $str = preg_replace('/<code>*\\s*/s', '<code>', $str);
    return preg_replace('/\\s*<\\/code>/s', '</code>', $str);
}
开发者ID:uoltercarlos,项目名称:pyrocms,代码行数:35,代码来源:textile_helper.php


示例5: _display_colorbox_gallery

    function _display_colorbox_gallery($images, $mode = null)
    {
        $mode = $mode != '' ? 'colorbox-' . $mode : 'colorbox';
        if (!empty($images)) {
            foreach ($images as $image) {
                $image_url = image_url($image['image']);
                $image_thumb_url = image_process_nowm($image_url, 180, 120);
                ?>

                        <div class="image-container">
                            <a href="<?php 
                echo $image_url;
                ?>
" title="<?php 
                echo isset($image['title']) ? html_escape($image['title']) : '';
                ?>
" target="blank" rel="<?php 
                echo html_escape($mode);
                ?>
"><img src="<?php 
                echo $image_thumb_url;
                ?>
" /></a>
                        </div>

<?php 
            }
        }
    }
开发者ID:Qnatz,项目名称:starter-public-edition-4,代码行数:29,代码来源:colorbox.php


示例6: og_url

function og_url($id)
{
    if ($id) {
        return image_url($id);
    }
    return home_url() . '/images/icons/fb-icon.png';
}
开发者ID:radicaldesigns,项目名称:momcards,代码行数:7,代码来源:functions.php


示例7: run

 public function run($options)
 {
     $attributes = array();
     if (is_numeric($options['width'])) {
         $attributes['width'] = $options['width'];
     }
     if (is_numeric($options['height'])) {
         $attributes['height'] = $options['height'];
     }
     $this->load->model('photos/photos_m');
     $p = new $this->photos_m();
     $photos = $p->limit($options['limit'])->order_by('updated_on', 'DESC')->get_all();
     $result['images'] = FALSE;
     if (sizeof($photos) > 0) {
         foreach ($photos as $key => $image) {
             $arr = explode('.', $image->filename);
             $thumb = $arr[0] . '_thumb.' . $arr[1];
             $img = image("photos/{$image->album_id}/{$thumb}", NULL, $attributes);
             $url = image_url("photos/{$image->album_id}/{$thumb}");
             $url = str_replace('_thumb', '', $url);
             $images[] = anchor($url, $img);
         }
         $result['images'] = $images;
     }
     return $result;
 }
开发者ID:huglester,项目名称:pyrocms-widgets,代码行数:26,代码来源:recent_photos.php


示例8: display_picture

function display_picture($filename, $size = 'big', $target_size = null, $title = 'Click to display original image')
{
    $image_url = image_url($filename, $size);
    $target_image_url = image_url($filename, $target_size, true);
    $absolute_url = absolute_link($target_image_url, true);
    $image_options = empty($title) ? null : array('title' => $title, 'alt' => $title);
    return '<figure class="picture"><a title="' . __($title) . '" href="' . $absolute_url . '" itemprop="contentUrl">' . image_tag($image_url, $image_options) . '</a></figure><div class="picture_right"></div>';
}
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:8,代码来源:MyImageHelper.php


示例9: image_tag

/**
 * Returns an <img> tag with a specified image
 *
 * @param string $image image source
 * @param array $params [optional] html parameters
 * @param boolean $notheme [optional] whether this is a themed image or a top level path
 * @param string $module whether this is a module image or in the core image set
 * @param boolean $relative whether the path is relative or absolute
 *
 * @return string
 */
function image_tag($image, $params = array(), $notheme = false, $module = 'core', $relative = true)
{
    $params['src'] = image_url($image, $notheme, $module, $relative);
    if (!isset($params['alt'])) {
        $params['alt'] = $image;
    }
    return "<img " . parseHTMLoptions($params) . '>';
}
开发者ID:founderio,项目名称:thebuggenie,代码行数:19,代码来源:ui.inc.php


示例10: index

 public function index()
 {
     $php_min = '5.3';
     if (!is_php($php_min)) {
         $this->output->set_output('PHP ' . $php_min . ' is required for Lex parser.');
         return;
     }
     $countries = $this->_get_country_data();
     $countries_10 = array_slice($countries, 0, 10);
     $this->template->set('br', '<br />')->set('hr', '<hr />')->set('name', 'John')->set('array_1', array('one', 'two', 'three'))->set('array_2', array('one', 'two', 'three', array('four', 'five')))->set('string_123', 'one, two, three')->set('json_123', json_encode(array('one', 'two', 'three')))->set('very_long_text', 'Very long text. Very long text. Very long text. Very long text.')->set('value_0', 0)->set('value_1', 1)->set('value_2', 2)->set('value_3', 3)->set('boolean_true', true)->set('value_null', null)->set('string_10', '10')->set('object_123', (object) array('one', 'two', 'three'))->set('dog', "I'll \"walk\" the <b>dog</b> now.")->set('dog_entities', htmlentities("I'll \"walk\" the <b>dog</b> now.", ENT_QUOTES, 'UTF-8'))->set('countries', $countries)->set('countries_10', $countries_10)->set('with_a_new_line', "a new\nline")->set('my_image', image_url('playground.jpg'))->set('string_markdown', 'Formatted **text**')->set('string_textile', 'Formatted _text_')->set('dangerous_value', 'A dangerous value <script>alert("Hi, I am dangerous.")</script>')->build('lex_parser');
 }
开发者ID:bhavesh561988,项目名称:starter-public-edition-4,代码行数:11,代码来源:Lex_parser_controller.php


示例11: my_image_url

 public static function my_image_url($src = null, $width = null, $height = null, $no_crop = null, $keep_canvas_size = null)
 {
     $src = isset($src) && $src != '' ? $src : image_url('lib/blank.png');
     if ($no_crop !== null) {
         $no_crop = empty($no_crop) ? 0 : 1;
     }
     if ($keep_canvas_size !== null) {
         $keep_canvas_size = empty($keep_canvas_size) ? 0 : 1;
     }
     return http_build_url(site_url('playground/image-process'), array('query' => http_build_query(array('src' => $src, 'w' => $width, 'h' => $height, 'no_crop' => $no_crop, 'keep_canvas_size' => $keep_canvas_size))), HTTP_URL_JOIN_QUERY);
 }
开发者ID:roniwahyu,项目名称:starter-public-edition-3,代码行数:11,代码来源:Platform.php


示例12: index

 public function index()
 {
     $php_min = '5.3';
     if (!is_php($php_min)) {
         $this->output->set_output('PHP ' . $php_min . ' is required for Lex parser.');
         return;
     }
     $countries = $this->_get_country_data();
     $countries_10 = array_slice($countries, 0, 10);
     $lex_parser_layout_test = $this->curl->create(site_url('playground/lex-parser-layout-test'))->get()->execute();
     $this->template->set('br', '<br />')->set('hr', '<hr />')->set('name', 'John')->set('array_1', array('one', 'two', 'three'))->set('array_2', array('one', 'two', 'three', array('four', 'five')))->set('string_123', 'one, two, three')->set('json_123', json_encode(array('one', 'two', 'three')))->set('very_long_text', 'Very long text. Very long text. Very long text. Very long text.')->set('value_0', 0)->set('value_1', 1)->set('value_2', 2)->set('value_3', 3)->set('boolean_true', true)->set('value_null', null)->set('string_10', '10')->set('object_123', (object) array('one', 'two', 'three'))->set('float_value', 250.5)->set('dog', "I'll \"walk\" the <b>dog</b> now.")->set('dog_entities', htmlentities("I'll \"walk\" the <b>dog</b> now.", ENT_QUOTES, 'UTF-8'))->set('countries', $countries)->set('countries_10', $countries_10)->set('with_a_new_line', "a new\nline")->set('my_image', image_url('playground.jpg'))->set('string_markdown', 'Formatted **text**')->set('string_textile', 'Formatted _text_')->set('dangerous_value', 'A dangerous value <script>alert("Hi, I am dangerous.")</script>')->set('my_blog', array('posts' => array(array('title' => 'Blog Post One'), array('title' => 'Blog Post Two'))))->set('lex_parser_layout_test', $lex_parser_layout_test)->set_partial('lex_partial', 'lex_partial')->set_metadata('description', 'Lex parser testing page')->set_metadata('keywords', 'CodeIgniter Lex Template Parser')->build('lex_parser');
 }
开发者ID:roniwahyu,项目名称:starter-public-edition-3,代码行数:12,代码来源:Lex_parser_controller.php


示例13: SetHeader

 function SetHeader()
 {
     $this->SetFont('Arial', 'B', 16);
     $this->Image(image_url() . '/ufma.png', 10, 10);
     parent::Ln(7);
     $this->Cell(0, 7, specialChars('UNIVERSIDADE FEDERAL DO MARANHÃO'), 0, 0, 'C');
     parent::Ln(7);
     $this->SetFont('Arial', '', 11);
     $this->Cell(0, 7, specialChars('Fundação Instituída nos termos da Lei 5.152 de 21/10/1966'), 0, 0, 'C');
     parent::Ln(7);
     $this->Cell(0, 7, specialChars('São Luís - Maranhão'), 0, 0, 'C');
     parent::Ln(7);
 }
开发者ID:sidneyaraujomelo,项目名称:sigprog,代码行数:13,代码来源:pdf_mc_table.php


示例14: make_thumbnail_slideshow

function make_thumbnail_slideshow($images)
{
    if (!count($images)) {
        return '';
    }
    $output = '<div class="popup_slideshow"><ul class="popup_slideimages">';
    $count = 0;
    foreach ($images as $image) {
        $count += 1;
        $caption = $image['name'];
        $class = $count != 1 ? '' : ' class="popup-img-active"';
        $output .= "<li{$class}>" . image_tag(image_url($image['filename'], 'medium'), array('alt' => $caption, 'title' => $caption)) . '</li>';
    }
    $output .= '</ul></div>';
    return $output;
}
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:16,代码来源:PopupHelper.php


示例15: parse_string

 public function parse_string($template, $data = array(), $return = FALSE, $config = array())
 {
     if (!is_array($config)) {
         $config = array();
     }
     $config = array_merge($this->config, $config);
     if ($config['image_url'] == '') {
         $config['image_url'] = image_url('lib/smileys/');
     }
     $ci = $this->ci;
     $is_mx = false;
     if (!$return) {
         list($ci, $is_mx) = $this->detect_mx();
     }
     $template = parse_smileys($template, (string) $config['image_url'], $config['smileys']);
     return $this->output($template, $return, $ci, $is_mx);
 }
开发者ID:patilstar,项目名称:HMVC-WITH-CI,代码行数:17,代码来源:Parser_smileys.php


示例16: index

 public function index()
 {
     $php_min = '5.2.7';
     if (!is_php($php_min)) {
         $this->output->set_output('PHP ' . $php_min . ' is required for Twig parser.');
         return;
     }
     $countries = $this->_get_country_data();
     $countries_10 = array_slice($countries, 0, 10);
     // Miscellaneous Tests
     $twig_test_name = 'test.html.twig';
     $twig_test_path = $this->load->path($twig_test_name);
     $twig_test_source = @(string) file_get_contents($twig_test_path);
     $twig_test_1 = $this->parser->parse_string($twig_test_source, array(), true, 'twig');
     $twig_test_2 = $this->load->view($twig_test_name, array(), true);
     $this->template->set('br', '<br />')->set('hr', '<hr />')->set('name', 'John')->set('array_1', array('one', 'two', 'three'))->set('array_2', array('one', 'two', 'three', array('four', 'five')))->set('string_123', 'one, two, three')->set('string_empty', '')->set('json_123', json_encode(array('one', 'two', 'three')))->set('very_long_text', 'Very long text. Very long text. Very long text. Very long text.')->set('value_0', 0)->set('value_1', 1)->set('value_2', 2)->set('value_3', 3)->set('boolean_true', true)->set('value_null', null)->set('string_10', '10')->set('object_123', (object) array('one', 'two', 'three'))->set('float_value', 250.5)->set('dog', "I'll \"walk\" the <b>dog</b> now.")->set('dog_entities', htmlentities("I'll \"walk\" the <b>dog</b> now.", ENT_QUOTES, 'UTF-8'))->set('countries', $countries)->set('countries_10', $countries_10)->set('with_a_new_line', "a new\nline")->set('my_image', image_url('playground.jpg'))->set('string_markdown', 'Formatted **text**')->set('string_textile', 'Formatted _text_')->set('dangerous_value', 'A dangerous value <script>alert("Hi, I am dangerous.")</script>')->set('my_blog', array('posts' => array(array('title' => 'Blog Post One'), array('title' => 'Blog Post Two'))))->set('twig_test_name', $twig_test_name)->set('twig_test_source', $twig_test_source)->set('twig_test_1', $twig_test_1)->set('twig_test_2', $twig_test_2)->set_partial('twig_partial', 'twig_partial')->set_metadata('description', 'Twig parser testing page')->set_metadata('keywords', 'CodeIgniter Twig Template Parser')->build('twig_parser');
 }
开发者ID:roniwahyu,项目名称:starter-public-edition-3,代码行数:17,代码来源:Twig_parser_controller.php


示例17: resize

 public function resize($img_path, $width = NULL, $height = NULL)
 {
     $setting = $this->config->item('image_tool');
     if (isset($setting['root_folder']) and (strpos($setting['root_folder'], '/') !== 0 or strpos($setting['root_folder'], './') === FALSE)) {
         $root_folder = $setting['root_folder'] . '/';
     } else {
         $root_folder = 'data/';
     }
     if (strpos($img_path, $root_folder) === 0) {
         $img_path = str_replace($root_folder, '', $img_path);
     }
     if (!file_exists(IMAGEPATH . $root_folder . $img_path) or !is_file(IMAGEPATH . $root_folder . $img_path) or strpos($img_path, '/') === 0) {
         $img_path = 'no_photo.png';
     }
     if (empty($width) and empty($height)) {
         return image_url($root_folder . $img_path);
     }
     $thumbs_path = IMAGEPATH . 'thumbs';
     if (!is_dir($thumbs_path)) {
         $this->_createFolder($thumbs_path);
     }
     if (is_dir(IMAGEPATH . $root_folder . $img_path) and !is_dir($thumbs_path . '/' . $img_path)) {
         $this->_createFolder($thumbs_path . '/' . $img_path);
     }
     $info = pathinfo($img_path);
     $extension = $info['extension'];
     $old_path = IMAGEPATH . $root_folder . $img_path;
     $new_path = IMAGEPATH . 'thumbs/' . substr($img_path, 0, strrpos($img_path, '.')) . '-' . $width . 'x' . $height . '.' . $extension;
     $new_image = 'thumbs/' . substr($img_path, 0, strrpos($img_path, '.')) . '-' . $width . 'x' . $height . '.' . $extension;
     if (file_exists($old_path) and !file_exists($new_path)) {
         $this->load->library('image_lib');
         $this->image_lib->clear();
         $config['image_library'] = 'gd2';
         $config['source_image'] = $old_path;
         $config['new_image'] = $new_path;
         $config['width'] = $width;
         $config['height'] = $height;
         $this->image_lib->initialize($config);
         if (!$this->image_lib->resize()) {
             return FALSE;
         }
     }
     return image_url($new_image);
 }
开发者ID:tastyigniter,项目名称:tastyigniter,代码行数:44,代码来源:Image_tool_model.php


示例18: field_html

function field_html($args)
{
    switch ($args[2]) {
        case 'textarea':
            return text_area($args);
        case 'checkbox':
            // Checkbox
            return check_box($args);
        case 'background_variant':
            // Dropmenu
            return background_variant($args);
        case 'image_url':
            // Image URL
            return image_url($args);
        case 'text':
        default:
            return text_field($args);
    }
}
开发者ID:nishant368,项目名称:newlifeoffice-new,代码行数:19,代码来源:admin-page.php


示例19: image_tag

function image_tag($img, $size, $resize = null, $classes = '')
{
    $img = get_image($img);
    // get the dimension values for the image tag
    if (null == $resize) {
        $width = $size;
        $height = ceil($size / $img['ratio']);
    } else {
        $width = $size * ($resize / $size);
        $height = ceil($width / $img['ratio']);
    }
    // set a classes value
    if (strlen($classes) > 0 ? $class = "class='" . $classes . "'" : ($class = '')) {
    }
    $img_url = image_url($img, 300);
    $image_tag = "<img id='img" . $img['image_id'] . "' " . $class . " itemprop='image' src='" . $img_url . "' alt='thumbail of " . $img['image_name'] . "' width='" . $width . "' height='" . $height . "'/>";
    $image_tag .= "<script type='text/javascript'>";
    $image_tag .= "   rimg_ids[rimg_ids.length]=new Array(" . $img['image_id'] . "," . $size . ");";
    $image_tag .= "</script>";
    return $image_tag;
}
开发者ID:toni-leigh,项目名称:shlinks,代码行数:21,代码来源:image_helper.php


示例20: list__poly_block

function list__poly_block(array $options = array())
{
    Builder::add_css("widgets/list/poly_block");
    if (empty($options)) {
        return '';
    }
    $body = '';
    foreach ($options as $item) {
        $img_link = '#';
        $total_link = '#';
        $header = '';
        $content = '';
        if (!empty($item['content'])) {
            $content = $item['content'];
        }
        if (!empty($item['header'])) {
            $header = $item['header'];
        }
        if (!empty($item['img_title'])) {
            $img_link = image_url($item['img_title']);
        }
        if (!empty($item['link'])) {
            $total_link = base_url($item['link']);
        }
        $body .= <<<EOT
            <div class="view view-tenth">
                    <img src="{$img_link}" />
                    <div class="mask">
                        <h2>{$header}</h2>
                        <p>{$content}</p>
                        <a href="{$total_link}" class="info">Подробнее</a>
                    </div>
                </div>
EOT;
    }
    return "<article class=\"list-poly_block\">{$body}<div class=\"clear\"></div></article>";
}
开发者ID:viking2000,项目名称:web-antarix,代码行数:37,代码来源:poly_block.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP imagealphablending函数代码示例发布时间:2022-05-15
下一篇:
PHP image_type_to_mime_type函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap