本文整理汇总了PHP中image函数的典型用法代码示例。如果您正苦于以下问题:PHP image函数的具体用法?PHP image怎么用?PHP image使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了image函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: plug_cubes
function plug_cubes($d)
{
req('pop');
$w = currentwidth();
$r = $_SESSION['rqt'];
$cols = 4;
$c = $cols * 3;
$n = count($r);
$nl = ceil($n / $c);
$l = $w / $c;
$cats = array_keys_r($r, 1, 'k');
$clr = cub_clr($cats);
foreach ($r as $k => $v) {
if ($v[11] > 1 && $v[3]) {
$lx = $l * ($v[11] - 1);
//$pub=minimg($v[3],"h").lka(htac($k),$v[2]);
//$pub=make_thumb_d($v[3],round($lx).'/'.round($lx));//
$pub = image('/imgc/' . $v[3], round($lx), round($lx));
$pub = lka(htac($k) . '" title="' . $v[2], $pub);
$ret .= divs(cub_sz($lx, $clr[$v[1]]), $pub);
}
}
//for($ic=0;$ic<$c;$ic++){}
//for($ib=0;$ib<$nl;$ib++){$i++;}
return $ret;
}
示例2: output_pages_from_cache
function output_pages_from_cache($http, $otp)
{
$npg = $_SESSION['prmb'][6];
$page = $_SESSION['page'];
$min = ($page - 1) * $npg;
$max = $page * $npg;
if (is_array($otp)) {
foreach ($otp as $id => $nb) {
if (is_numeric($id)) {
$i++;
if ($i >= $min && $i < $max) {
$mg = $http . '/imgc/' . first_img($nb[3]);
if (is_link($mg)) {
$ret .= btn('imgl', image($mg, '', 50));
}
$ret .= bal('h2', lka($http . '/' . $id, $nb[2]));
$ret .= btn('txtx', $nb[1]) . ' ';
if (rstr(27)) {
$ret .= btn('txtsmall', mkday($nb[0], 1)) . ' ' . pub_link($nb[9]) . ' ';
}
if (rstr(25)) {
$ret .= btn('txtsmall', art_length($nb[8]));
}
$ret .= br() . br();
}
}
}
}
$n_pages = nb_page($i, $npg, $page);
return $n_pages . $ret . $n_pages;
}
示例3: image
function image($src, $width, $height, $format = 'png')
{
$new_file_src = '/data/thumbs' . $src . $width . 'x' . $height . '.' . $format;
$new_file = DIR . $new_file_src;
if (is_file($new_file)) {
return $new_file_src;
}
$file = DIR . $src;
if (is_file($file)) {
$new_file_path_parts = pathinfo($new_file);
if (!is_dir($new_file_path_parts['dirname'])) {
mkdir($new_file_path_parts['dirname'], 0777, true);
}
system('convert ' . $file . ' -resize ' . $width . 'x' . $height . '\\> ' . $new_file);
//Первый кадр анимированного гифа
if (!is_file($new_file)) {
$check_anim = substr($new_file, 0, -(strlen($format) + 1)) . '-0.' . $format;
if (is_file($check_anim)) {
rename($check_anim, $new_file);
} else {
return image('/data/jnb.jpg', $width, $height);
}
}
return $new_file_src;
} else {
return image('/data/jnb.jpg', $width, $height);
}
}
示例4: index
function index()
{
$this->datasis->modulo_id($this->modulo, 1);
$this->rapyd->load("datagrid", "dataform", "fields");
$control = $this->uri->segment(4);
$checkbox = '<input type="checkbox" name="genera[]" value="<#modulo#>" CHECKED>';
$grid = new DataGrid('Seleccione los módulos que desea generar');
$grid->db->select('modulo, descripcion');
$grid->db->from('`reglascont`');
$grid->db->groupby('modulo');
$grid->db->orderby('modulo,regla');
$grid->column("Módulo", "modulo");
$grid->column("Descripción", "descripcion");
$grid->column('Generar', $checkbox, 'align="center"');
$grid->build();
$form = new DataForm('contabilidad/generar/procesar');
$form->title('Rango de fecha para la Generación');
$form->fechai = new dateonlyField("Fecha Desde", "fechai", "d/m/Y");
$form->fechaf = new dateonlyField("Fecha Hasta", "fechaf", "d/m/Y");
$form->fechaf->size = $form->fechai->size = 10;
$form->fechai->insertValue = $this->input->post('fechai') ? $this->input->post('fechai') : date("Ymd");
$form->fechaf->insertValue = $this->input->post('fechaf') ? $this->input->post('fechaf') : date("Ymd");
$form->tabla = new containerField('tabla', $grid->output);
if ($control) {
$form->control = new containerField('control', 'Contabilidad Generada');
}
//$form->submit("btn_submit","Generar Depurado");
$form->build_form();
$data['script'] = "<script type='text/javascript'>\n\t\tvar handlerFunc = function(t) {\n\t\t\tdocument.getElementById('preloader').style.display='none';\n\t\t\tnew Effect.Opacity('contenido', {duration:0.5, from:0.3, to:1.0});\n\t\t\talert(t.responseText);\n\t\t}\n\n\t\tvar errFunc = function(t) {\n\t\t\tdocument.getElementById('preloader').style.display='none';\n\t\t\tnew Effect.Opacity('contenido', {duration:0.5, from:0.3, to:1.0});\n\t\t\talert('Error ' + t.status + ' -- ' + t.statusText);\n\t\t}\n\n\t\tfunction generar() {\n\t\t\tnew Effect.toggle('preloader', 'appear');\n\t\t\tnew Effect.Opacity('contenido', {duration:0.5, from:1.0, to:0.3});\n\t\t\tnew Ajax.Request('" . site_url('contabilidad/generar/procesar') . "',{\n\t\t\t method: 'post',\n\t\t\t parameters : Form.serialize('df1'),\n\t\t\t onSuccess:handlerFunc,\n\t\t\t onFailure:errFunc});\n\t\t}\n\t\t</script>";
$data['extras'] = "<div id='preloader' style='display: none;\tposition:absolute; left:40%; top:40%; font-family:Verdana, Arial, Helvetica, sans-serif;'>\n\t\t\t<center>" . image("loading4.gif") . "<br>" . image("loadingBarra.gif") . "<br>\n\t\t\t<b>Generando . . . </b>\n\t\t\t</center>\n\t\t</div>";
$data['content'] = $form->output . "<input type=button value='Generar' onclick='generar()'>";
$data["head"] = $this->rapyd->get_head() . script("prototype.js") . script("scriptaculous.js") . script("effects.js");
$data['title'] = "<h1>Generar Contabilidad</h1>";
$this->load->view('view_ventanas', $data);
}
示例5: showlist
/**
* 显示文章列表
*/
public function showlist()
{
global $G;
$articlelist = array();
$catid = intval($_GET['catid']);
$where = "status=0";
$where .= $catid ? " AND catid='{$catid}'" : '';
$where .= $_GET['pic'] ? " AND pic<>''" : '';
$pagesize = intval($_GET['pagesize']);
$pagesize = $pagesize > 0 ? $pagesize : 20;
$orderby = $_GET['orderby'];
$orderby = in_array($orderby, array('id', 'time', 'viewnum', 'commentnum')) ? $orderby : 'id';
$asc = $_GET['asc'] == 1 ? 'ASC' : 'DESC';
$articlelist = $this->t('post_title')->where($where)->order($orderby, $asc)->page($G['page'], $pagesize)->select();
if ($articlelist) {
$newlist = array();
foreach ($articlelist as $list) {
$list['pic'] = image($list['pic']);
$list['pubtime'] = @date('Y-m-d', $list['pubtime']);
$newlist[] = $list;
}
$articlelist = $newlist;
} else {
$articlelist = array();
}
$this->showAppData($articlelist);
}
示例6: jqdatag
function jqdatag()
{
$grid = $this->defgrid();
$param['grids'][] = $grid->deploy();
$bodyscript = $this->bodyscript($param['grids'][0]['gridname']);
#Set url
$grid->setUrlput(site_url($this->url . 'setdata/'));
$WestPanel = '
<div id="LeftPane" class="ui-layout-west ui-widget ui-widget-content">
<div class="otros">
<table id="west-grid">
<tr><td>
<td><div class="tema1 a1"><a style="width:190px" href="#" id="a1"><span class="ui-button-text">' . image('print.png', 'Formato PDF', array('title' => 'Formato PDF', 'border' => '0')) . ' Imprimir</span></a></div></td>
</td></tr>
</table>
</div>
</div> <!-- #LeftPane -->';
$grid->wbotonadd(array('id' => 'a1', 'img' => 'assets/default/images/print.png', 'alt' => 'Formato PDF', 'label' => 'Imprimir'));
$WestPanel = $grid->deploywestp();
$adic = array(array('id' => 'fedita', 'title' => 'Agregar cambio forma de pago'), array('id' => 'fshow', 'title' => 'Mostrar registro'), array('id' => 'fborra', 'title' => 'Anula Factura'));
$SouthPanel = $grid->SouthPanel($this->datasis->traevalor('TITULO1'), $adic);
$param['WestPanel'] = $WestPanel;
//$param['EastPanel'] = $EastPanel;
$param['SouthPanel'] = $SouthPanel;
$param['tema1'] = 'darkness';
$param['bodyscript'] = $bodyscript;
$param['tabs'] = false;
$param['encabeza'] = $this->titp;
$this->load->view('jqgrid/crud2', $param);
}
示例7: udc_imz
function udc_imz($f, $n = '2')
{
list($w, $hb) = fwidth($f);
$w = round($w / $n);
$h = round($h / $n);
return divs('width:' . $w . 'px;', image('/' . $f, $w, $h));
}
示例8: indexAction
/**
* 会员资料
*/
public function indexAction()
{
$id = (int) $this->get('userid');
$name = $this->get('username');
if (empty($id) && empty($name)) {
$this->msg(lang('m-spa-0'));
}
$data = $id ? $this->member->find($id) : $this->member->getOne('username=?', $name);
if (empty($data)) {
$this->msg(lang('m-spa-1', array('1' => $id ? '#' . $id : $name)));
}
$model = $this->membermodel[$data['modelid']];
$data['nickname'] = $data['nickname'] ? $data['nickname'] : $data['username'];
if ($model) {
$table = $this->model($model['tablename']);
$_data = $table->find($data['id']);
$data = array_merge($data, $_data);
//合并主表和附表
$data = $this->getFieldData($model, $data);
}
$data['avatar'] = image($data['avatar']);
if ($this->memberconfig['uc_use'] == 1 && function_exists('uc_api_mysql')) {
$uc = uc_api_mysql('user', 'get_user', array('username' => $data['username']));
if ($uc != 0) {
$data['uid'] = $uc[0];
$data['avatar'] = UC_API . '/avatar.php?uid=' . $data['uid'] . '&size=middle';
}
}
unset($data['password']);
$this->view->assign($data);
$this->view->assign(array('meta_title' => lang('m-spa-2', array('1' => $data['nickname'])) . '-' . $this->site['SITE_NAME'], 'userid' => $data['id'], 'tablename' => $model['tablename'], 'modelname' => $model['modelname'], 'groupname' => $this->membergroup[$data['groupid']]['name'], 'page' => $this->get('page') ? $this->get('page') : 1));
$this->view->display('member/space');
}
示例9: textile
function textile($text, $lite = '')
{
if (get_magic_quotes_gpc() == 1) {
$text = stripslashes($text);
}
$text = incomingEntities($text);
$text = encodeEntities($text);
$text = fixEntities($text);
$text = cleanWhiteSpace($text);
$text = getRefs($text);
$text = noTextile($text);
$text = image($text);
$text = links($text);
$text = span($text);
$text = superscript($text);
$text = footnoteRef($text);
$text = code($text);
$text = glyphs($text);
$text = retrieve($text);
if ($lite == '') {
$text = lists($text);
$text = table($text);
$text = block($text);
}
/* clean up <notextile> */
$text = preg_replace('/<\\/?notextile>/', "", $text);
/* turn the temp char back to an ampersand entity */
$text = str_replace("x%x%", "&", $text);
$text = str_replace("<br />", "<br />\n", $text);
return trim($text);
}
示例10: uploadimage
public function uploadimage()
{
if ($_GET['from'] == 'swfupload') {
$uid = intval($_GET['uid']);
$username = trim($_GET['username']);
$token = sha1($uid . $username . formhash());
if (!$uid || !$username || $token != $_GET['token']) {
$this->showAjaxError(-1, 'nologin');
}
} else {
$uid = $GLOBALS['G']['uid'];
if (!$uid) {
$this->showAjaxError(-1, 'nologin');
}
}
$upload = new UploadImage();
if ($photo = $upload->saveImage()) {
$photo['uid'] = $GLOBALS['G']['uid'];
$photo['uptime'] = time();
$photo['photoid'] = M('photo')->insert($photo, true);
if ($_GET['from'] == 'umeditor') {
$returns = array("state" => 'SUCCESS', "name" => $photo['name'], "url" => $photo['attachment'], "size" => $photo['filesize'], "type" => $photo['type']);
} elseif ($_GET['from'] == 'redactor') {
$img = image($photo['attachment']);
exit('<img src="' . $img . '">');
} else {
$returns = $photo;
$returns['url'] = C('ATTACHURL') . $photo['thumb'];
}
$this->showAjaxReturn($returns);
}
}
示例11: custom_menu_tree
function custom_menu_tree($menus = array())
{
$html = '';
// Build all application menus in a tree format
foreach ($menus as $menu) {
// Check if this menu has children
$count_menu_children = count(get_value($menu, 'children'));
// Build a single line menu
$html .= '<li id="menu-item-' . get_value($menu, 'id_menu') . '" class="dd-item dd3-item" data-id="' . get_value($menu, 'id_menu') . '" order="' . get_value($menu, 'order_') . '">';
$html .= '<div class="dd-handle dd3-handle"></div>';
$html .= '<div class="dd3-content">';
$class = get_value($menu, 'dtt_inative') != '' ? 'text-error' : '';
$img = image(get_value($menu, 'url_img'));
$label = get_value($menu, 'url_img') == '' && get_value($menu, 'label') == '' ? '[NO NAME]' : lang(get_value($menu, 'label'));
$html .= '<a href="javascript:void(0)" class="menu-label ' . $class . '" data-toggle="modal" data-target="#modal-menu-' . get_value($menu, 'id_menu') . '">' . $img . ' ' . $label . '</a>';
$html .= '<i class="text-success fa fa-fw fa-check-circle" style="display: none; margin-left: 5px"></i>';
$html .= '<a href="javascript:void(0)" class="menu-delete pull-right hidden"><i class="fa fa-trash fa-fw"></i></a>';
$html .= '</div>';
// If current menu has children items, then build all again
if ($count_menu_children > 0) {
$html .= '<ol class="dd-list">' . custom_menu_tree(get_value($menu, 'children')) . '</ol>';
}
$html .= '</li>';
}
return $html;
}
示例12: get_post_thumb_src
function get_post_thumb_src($size = 'post-thumbnail', $default = false)
{
global $post;
if (function_exists('has_post_thumbnail') && has_post_thumbnail()) {
$image_id = get_post_thumbnail_id($post->ID);
$image_src = wp_get_attachment_image_src($image_id, $size);
$image_src = apply_filters('wp_get_attachment_image_src', $image_src[0]);
return $image_src;
}
$thumb_meta = get_post_meta($post->ID, '特色图片', true);
if ($thumb_meta) {
return $thumb_meta;
}
preg_match_all('/<img.+src=[\'\\"]([^\'\\"]+)[\'\\"].* \\/>/i', $post->post_content, $images);
if (!empty($images)) {
foreach ($images[1] as $image) {
if (strpos($image, 'http') === 0) {
$image_src = $image;
break;
} else {
$image_src = false;
}
}
}
if (!$image_src) {
$image_src = $default;
}
if (function_exists('image')) {
return image($image_src);
}
return $image_src;
}
示例13: parse_content
protected function parse_content($array)
{
if (is_array($array) and !empty($array)) {
if (!empty($array['seo'])) {
$url = _URL . "content/detail/{$array['seo']}";
} else {
$url = _URL . "content/detail/{$array['id']}/" . url_title($array['title'], "-", true);
}
$explode_title = explode(' ', $array['title']);
$content = array();
$content['id'] = $array['id'];
$content['title'] = $array['title'];
$content['subtitle'] = $array['subtitle'];
$content['seo'] = $array['seo'];
$content['created'] = mysql_date($array['created'], 'd/m/y', true);
$content['user_id'] = $array['created_by'];
$content['name'] = $array['name'];
$content['image'] = $array['image'];
$content['image_url'] = image("files/content/" . $array['image'], 'alt="' . $array['title'] . '"');
$content['content'] = $array['content'];
$content['meta_keyword'] = $array['meta_keyword'];
$content['meta_description'] = $array['meta_description'];
$content['hits'] = $array['hits'];
$content['url'] = $url;
return $content;
}
}
示例14: edit
public function edit()
{
$shopid = intval($_GET['shopid']);
if ($this->checkFormSubmit()) {
$shopnew = $_GET['shopnew'];
if ($shopnew['shopname'] && $shopnew['province'] && $shopnew['city'] && $shopnew['address'] && $shopnew['description']) {
if ($this->account['admincp']) {
$this->t('shop')->where(array('shopid' => $shopid))->update($shopnew);
} else {
$this->t('shop')->where(array('uid' => $this->uid, 'shopid' => $shopid))->update($shopnew);
}
$links = array(array('text' => 'go_back', 'url' => '/?m=home&c=shop'), array('text' => 'reedit', 'url' => '/?m=home&c=shop&a=edit&shopid=' . $shopid));
$this->showSuccess('modi_succeed', '', $links, '', true);
} else {
$this->showError('undefined_action');
}
} else {
global $G, $lang;
if ($this->account['admincp']) {
$shop = $this->t('shop')->where(array('shopid' => $shopid))->selectOne();
} else {
$shop = $this->t('shop')->where(array('uid' => $this->uid, 'shopid' => $shopid))->selectOne();
}
$pic = image($shop['pic']);
include template('shop_form');
}
}
示例15: 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;
}