本文整理汇总了PHP中base_storager::image_path方法的典型用法代码示例。如果您正苦于以下问题:PHP base_storager::image_path方法的具体用法?PHP base_storager::image_path怎么用?PHP base_storager::image_path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类base_storager
的用法示例。
在下文中一共展示了base_storager::image_path方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: input_image
function input_image($params)
{
$params['type'] = 'image';
$ui = new base_component_ui($this);
$domid = $ui->new_dom_id();
$input_name = $params['name'];
$input_value = $params['value'];
$image_src = base_storager::image_path($input_value, 's');
if (!$params['width']) {
$params['width'] = 50;
}
if (!$params['height']) {
$params['height'] = 50;
}
$imageInputWidth = $params['width'] + 24;
$url = ""index.php?app=desktop&act=alertpages&goto=" . urlencode("index.php?app=image&ctl=admin_manage&act=image_broswer") . """;
$html = '<div class="image-input clearfix" style="width:' . $imageInputWidth . 'px;" gid="' . $domid . '">';
$html .= '<div class="flt"><div class="image-input-view" style="display:table-cell;text-align:center;vertical-align: middle;width:';
$html .= $params['width'] . 'px;height:' . $params['height'] . 'px;font-size:' . $params['height'] * 0.875 . 'px;overflow:hidden;">';
$html .= '<img src="' . $image_src . '" onload="$(this).zoomImg(' . $params['width'] . ',' . $params['height'] . ');"/>';
$html .= '</div></div>';
$html .= '<div class="image-input-handle" onclick="new imgDialog(' . $url . ',{handle:this});" style="width:20px;height:' . $params['height'] . 'px;">选择' . $ui->img(array('src' => 'bundle/arrow-down.gif', 'app' => 'desktop'));
$html .= '</div>';
$html .= '<input type="hidden" name="' . $input_name . '" value="' . $input_value . '"/>';
$html .= '</div>';
return $html;
}
示例2: input_image
function input_image($params)
{
$params['type'] = 'image';
$ui = new base_component_ui($this);
$domid = $ui->new_dom_id();
$input_name = $params['name'];
$input_value = $params['value'];
$image_src = base_storager::image_path($input_value, 's');
if (!$params['width']) {
$params['width'] = 50;
}
if (!$params['height']) {
$params['height'] = 50;
}
$imageInputWidth = $params['width'] + 24;
$url = ""index.php?app=desktop&act=alertpages&goto=" . urlencode("index.php?app=image&ctl=admin_manage&act=image_broswer") . """;
$html = '<div class="image-input clearfix" style="width:' . $imageInputWidth . 'px;" gid="' . $domid . '">';
$html .= '<div class="flt"><div class="image-input-view" style="font-size:12px;text-align:center;width:';
$html .= $params['width'] . 'px;line-height:' . $params['height'] . 'px;height:' . $params['height'] . 'px;overflow:hidden;">';
if (!$image_src) {
$image_src = app::get('desktop')->res_url . '/transparent.gif';
}
$html .= '<img src="' . $image_src . '" onload="$(this).zoomImg(' . $params['width'] . ',' . $params['height'] . ',function(mw,mh,v){this.setStyle("marginTop",(mh-v.height)/2)});"/>';
$html .= '</div></div>';
$html .= '<div class="image-input-handle" onclick="Ex_Loader("modedialog",function(){new imgDialog(' . $url . ',{handle:this});}.bind(this));" style="width:20px;height:' . $params['height'] . 'px;">' . app::get('desktop')->_('选择') . "" . $ui->img(array('src' => 'bundle/arrow-down.gif', 'app' => 'desktop'));
$html .= '</div>';
$html .= '<input type="hidden" name="' . $input_name . '" value="' . $input_value . '"/>';
$html .= '</div>';
return $html;
}
示例3: get_goods_spec
public function get_goods_spec()
{
$gid = $this->_request->get_post('gid');
if (!$gid) {
exit('error!');
}
$this->pagedata['goodshtml']['name'] = kernel::single("b2c_goods_detail_name")->show($gid, $arrGoods);
if ($arrGoods['spec'] && is_array($arrGoods['spec'])) {
foreach ($arrGoods['spec'] as $row) {
$option = $row['option'];
if ($option && is_array($option)) {
foreach ($option as $img) {
foreach ((array) explode(',', $img['spec_goods_images']) as $imageid) {
$return[$imageid] = base_storager::image_path($imageid, 's');
}
}
}
}
}
$arrGoods['spec2image'] = json_encode($return);
$this->pagedata['goods'] = $arrGoods;
$this->pagedata['goodshtml']['spec'] = kernel::single("b2c_goods_detail_spec")->show($gid, $arrGoods);
$imageDefault = app::get('image')->getConf('image.set');
$this->pagedata['image_default_id'] = $imageDefault['S']['default_image'];
$this->page('site/index/spec.html', true);
}
示例4: shopex_brand_list
function shopex_brand_list()
{
$params = $this->params;
//api 调用合法性检查
$this->check($params);
$params['page_no'] = isset($params['page_no']) ? $params['page_no'] : 1;
$params['page_size'] = isset($params['page_size']) ? $params['page_size'] : 20;
$page_no = intval($params['page_no']) - 1;
$page_size = intval($params['page_size']);
$page_offset = $page_no * $page_size;
if ($params['page_no'] == -1) {
$item_total = $this->brand_model->count();
$data['item_total'] = $item_total;
$this->send_success($data);
} else {
$item_total = $this->brand_model->count();
$brands = $this->brand_model->getList("*", array(), $page_offset, $page_size);
}
foreach ($brands as $key => $value) {
//将brand_logo图片id 转化为可直接访问的地址
$brand_logo = base_storager::image_path($value['brand_logo']);
$data[$key] = array('brand_name' => $value['brand_name'], 'brand_url' => $value['brand_url'], 'brand_desc' => $value['brand_desc'], 'brand_logo' => substr($brand_logo, 0, -13), 'brand_alias' => $value['brand_keywords'], 'disabled' => $value['disabled'] ? 'true' : 'false', 'order_by' => $value['ordernum'], 'brand_setting' => serialize($value['brand_setting']), 'last_modify' => time());
}
$data['item_total'] = $item_total;
$this->send_success($data);
}
示例5: get_goods_spec
public function get_goods_spec()
{
$gid = $this->_request->get_get('gid');
if (!$gid) {
echo '';
exit;
}
$this->pagedata['goodshtml']['name'] = kernel::single("b2c_goods_detail_name")->show($gid, $arrGoods);
if ($arrGoods['spec'] && is_array($arrGoods['spec'])) {
foreach ($arrGoods['spec'] as $row) {
$option = $row['option'];
if ($option && is_array($option)) {
foreach ($option as $img) {
foreach ((array) explode(',', $img['spec_goods_images']) as $imageid) {
$return[$imageid] = base_storager::image_path($imageid, 's');
}
}
}
}
}
$this->pagedata['spec2image'] = json_encode($return);
$imageDefault = app::get('image')->getConf('image.set');
$this->pagedata['defaultImage'] = $imageDefault['S']['default_image'];
$arrGoods['spec2image'] = json_encode($return);
$this->pagedata['goods'] = $arrGoods;
$this->pagedata['goodshtml']['spec'] = kernel::single("b2c_goods_detail_spec")->show($gid, $arrGoods);
$imageDefault = app::get('image')->getConf('image.set');
$this->pagedata['image_default_id'] = $imageDefault['S']['default_image'];
$this->pagedata['goodshtml']['button'] = kernel::single('b2c_goods_detail_button')->show($gid, $arrGoods);
$this->pagedata['form_url'] = $this->gen_url(array('app' => 'b2c', 'ctl' => 'site_cart', 'act' => 'add', 'arg0' => 'goods', 'arg1' => 'quick'));
$this->page('site/gallery/spec_dialog.html', true);
}
示例6: brand
/**
* 品牌数据.
*/
public function brand($params)
{
$mdl_brand = app::get('b2c')->model('brand');
$filter = array('disabled' => 'false');
foreach ($params as $key => $value) {
switch ($key) {
case 'brand_id':
case 'brand_initial':
$filter[$key] = explode(',', $value);
break;
case 'brand_name':
$filter[$key . '|has'] = $value;
break;
}
}
$brand_list = $mdl_brand->getList('brand_id,brand_name,brand_initial,brand_logo', $filter);
if (!$brand_list) {
$this->failure();
}
foreach ($brand_list as &$brand) {
$brand['brand_logo'] = base_storager::image_path($brand['brand_logo']);
$brand['detail_url'] = app::get('site')->router()->gen_url(array('app' => 'b2c', 'ctl' => 'site_list', 'args' => array($brand['brand_id'])));
}
$this->success($brand_list);
}
示例7: detail_qrcode
public function detail_qrcode($gid)
{
$mobile_url = vmc::singleton('mobile_router')->gen_url(array('app' => 'b2c', 'ctl' => 'mobile_product', 'act' => 'index', 'args' => array('g' . $gid), 'full' => 1));
$qrcode_image = vmc::singleton('wechat_qrcode')->create($mobile_url);
$url = base_storager::image_path($qrcode_image['image_id']);
return "<img src='{$url}' />";
}
示例8: modifier_avatar
public function modifier_avatar($col)
{
$img_src = base_storager::image_path($col);
if (!$img_src) {
return '';
}
return "<a href='{$img_src}' target='_blank'><img class='img-thumbnail' src='{$img_src}' style='height:30px;'></a>";
}
示例9: modifier_logo
public function modifier_logo($col)
{
if (!$col) {
return '';
}
$img_url = base_storager::image_path($col, 'xs');
return '<img class="img-thumbnail img-circle" width="30" src="' . $img_url . '">';
}
示例10: column_content_pic
public function column_content_pic($row)
{
$img_src = base_storager::image_path($row['@row']['image_id'], 'xs');
if (!$img_src) {
return '';
}
return "<img class='img-thumbnail' src='{$img_src}' style='height:30px;'>";
}
示例11: modifier_avatar
public function modifier_avatar($col)
{
if (!$col) {
return '';
}
$url = base_storager::image_path($col);
return "<img src={$url} class='img-circle' width=20 height=20>";
}
示例12: show
function show($gid, &$aGoods = null, $other_params = array())
{
$render = $this->app->render();
if (!$aGoods) {
#$o = kernel::single('b2c_goods_model');
$aGoods = $this->getGoods($gid);
}
$render->pagedata['specimagewidth'] = $this->app->getConf('spec.image.width');
$render->pagedata['specimageheight'] = $this->app->getConf('spec.image.height');
$render->pagedata['goods'] = $aGoods;
$render->pagedata['other_params'] = json_encode($other_params);
$cur = app::get('ectools')->model('currency');
$cur_info = $_COOKIE["S"]["CUR"] ? $cur->getcur($_COOKIE["S"]["CUR"]) : $cur->getFormat();
if ($cur_info['cur_sign']) {
$cur_info['sign'] = $cur_info['cur_sign'];
}
$ret = array('decimals' => $this->app->getConf('system.money.decimals'), 'dec_point' => $this->app->getConf('system.money.dec_point'), 'thousands_sep' => $this->app->getConf('system.money.thousands_sep'), 'fonttend_decimal_type' => $this->app->getConf('system.money.operation.carryset'), 'fonttend_decimal_remain' => $this->app->getConf('system.money.decimals'), 'sign' => $cur_info['sign']);
if (isset($cur_info['cur_default']) && $cur_info['cur_default'] === "false") {
$ret['cur_rate'] = $cur_info['cur_rate'];
}
unset($cur_info);
if ($aGoods['spec'] && is_array($aGoods['spec'])) {
foreach ($aGoods['spec'] as $row) {
$option = $row['option'];
if ($option && is_array($option)) {
foreach ($option as $img) {
foreach ((array) explode(',', $img['spec_goods_images']) as $imageid) {
if ($imageid) {
$return[$imageid] = array('small' => base_storager::image_path($imageid, 's'), 'middle' => base_storager::image_path($imageid, 'm'), 'big' => base_storager::image_path($imageid, 'b'));
}
}
}
}
}
}
$render->pagedata['goods']['spec2image'] = json_encode($return);
$render->pagedata['spec_default_pic'] = $this->app->getConf('spec.default.pic');
if ($aGoods['spec'] && is_array($aGoods['spec'])) {
foreach ($aGoods['spec'] as $row) {
$option = $row['option'];
if ($option && is_array($option)) {
foreach ($option as $img) {
foreach ((array) explode(',', $img['spec_goods_images']) as $imageid) {
if ($imageid) {
$return[$imageid] = array('small' => base_storager::image_path($imageid, 's'), 'middle' => base_storager::image_path($imageid, 'm'), 'big' => base_storager::image_path($imageid, 'b'));
}
}
}
}
}
}
list($usec, $sec) = explode(" ", microtime());
$microtime = substr($usec, strpos($usec, '.') + 1) . $sec;
$render->pagedata['goodsspec_classname'] = "goods-spec-" . $gid . "-" . $microtime;
$render->pagedata['goods']['spec2image'] = json_encode($return);
$render->pagedata['money_format'] = json_encode($ret);
return $render->fetch('site/product/spec_list.html');
}
示例13: column_img
/**
* finder img列的链接修改.
*
* @param array 某行具体数据的数组
*
* @return string 链接html
*/
public function column_img($row)
{
$row = $row['@row'];
if ($row['storage'] == 'network') {
return '<a class="btn btn-xs btn-default" href="' . $row['ident'] . '" target="_blank">网络图片</a>';
}
return '<a href="' . base_storager::image_path($row['image_id']) . '" target="_blank">
<img class="img-thumbnail" src="' . base_storager::image_path($row['image_id'], 'xs') . '" style="height:50px" /></a>';
}
示例14: gimages_upload
function gimages_upload()
{
$image = $this->app->model('image');
$image_name = $_FILES['files']['name'][0];
$image_id = $image->store($_FILES['files']['tmp_name'][0], null, null, $image_name);
$image->rebuild($image_id, array('L', 'M', 'S', 'XS'));
$this->_set_tag($image_id, array('商品相册图'));
echo json_encode(array('url' => base_storager::image_path($image_id, 's'), 'image_id' => $image_id));
}
示例15: column_goods_pic
function column_goods_pic($row)
{
$o = app::get('b2c')->model('goods');
$g = $o->db_dump(array('goods_id' => $row['goods_id']), 'image_default_id');
$img_src = base_storager::image_path($g['image_default_id'], 's');
if (!$img_src) {
return '';
}
return "<a href='{$img_src}' class='img-tip pointer' target='_blank' onmouseover='bindFinderColTip(event);'><span> pic</span></a>";
}