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


PHP image_url函数代码示例

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


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


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