ppypp伦理天堂,91手机在线视频,免费在线观看黄色毛片,夜夜穞天天穞狠狠穞AV美女按摩

聯系官方銷售客服

1835022288

028-61286886

投訴 已解決 調用自定義組圖的實際圖片寬度 6 806
迅睿CMS版本:4.5.6 懸賞:1元
 <?php if ($zutu) { $key=0; foreach ($zutu as $c) { ?>

                                    { 
                        {php $cc = current($zutu);}
                        href: "{dr_get_file($cc)}",
                        src: "{dr_get_file($c)}", 
                        img: "{dr_get_file($c)}", 
                        width: "237", height: "150", 
                        title: "{$t['title']}" 
                    },
                    <?php $key++;} } ?>

我想調用該圖片的寬度的數值,寫成100%和auto都不行,系統里有沒有這個變量可以調出來?

解決方案
  • <?php $size = getimagesize(dr_get_file($c)); ?>
    
    width: "{$size[0]}", height: "{$size[1]}",

    你这又是用循环又是用单一输出,思维太混了,影响页面速度啊

  • 回复@迅睿框架联合创始人

    <?php if ($zutu) { $key=0; foreach ($zutu as $c) { ?>
                          { index: {$key+1}, 
                            href: "{dr_get_file($c)}",
                            src: "{dr_get_file($c)}", 
                            img: "{dr_thumb($c, 200, 200)}", 
                            {php  $size = getimagesize(dr_thumb($c)); }
                            width: "{$size[0]}", height: "150",
                            title: "{$t['title']}" 
                        },
    <?php $key++;} } ?>

    调出来了,感谢大神,确实现在这个代码的执行效率太慢,页面打开明显慢多了,怎么优化一下速度呢?

  • <?php if ($zutu) { $key=0; foreach ($zutu as $c) { ?>
                          { index: {$key+1}, 
                            href: "{dr_get_file($c)}",
                            src: "{dr_get_file($c)}", 
                            img: "{dr_thumb($c, 200, 200)}", 
                            {php  $at=$ci->get_attachment($c);if ($at && $at.attachinfo) { $size=[$at['attachinfo']['width'], $at['attachinfo']['height']];} { $size = getimagesize(dr_get_file($c))}; }
                            width: "{$size[0]}", height: "150",
                            title: "{$t['title']}" 
                        },
    <?php $key++;} } ?>
  • 回复@小波工作室 这个代码执行出现系统故障! 但是我找不出错在哪里?

  • 回复@小波工作室

    FCPATH/App/Module/Extends/Home/Module.php : 510 — Phpcmf\View->display ( arguments )

    503 'params' => ['catid' => $catid],

    504 'parent' => $parent,

    505 'related' => $related,

    506 'urlrule' => \Phpcmf\Service::L('Router')->show_url($this->module, $data, '[page]'),

    507 'fix_html_now_url' => defined('SC_HTML_FILE') ? dr_url_prefix(\Phpcmf\Service::L('Router')->show_url($this->module, $data, $page), $this->module['dirname'], SITE_ID, \Phpcmf\Service::IS_MOBILE_TPL()) : '', // 修复静态下的当前url变量

    508 ]);

    509 \Phpcmf\Service::V()->module($this->module['dirname']);

    510 !$rt && (\Phpcmf\Service::V()->display(isset($data['template']) && strpos($data['template'], '.html') !== FALSE && is_file(\Phpcmf\Service::V()->get_dir().$data['template']) ? $data['template'] : ($this->module['category'][$data['catid']]['setting']['template']['show'] ? $this->module['category'][$data['catid']]['setting']['template']['show'] : 'show.html')));

    511 return $data;

    512 }

    513

    514 // 模块草稿、审核、定时、内容页

    515 protected function _MyShow($type, $id = 0, $page = 1) {

    516

    517 if (IS_POST) {

    APPPATH/Controllers/Show.php : 23 — Phpcmf\Home\Module->_Show ( arguments )

    16 }

    17 $this->_Show(

    18 (int)$id,

    19 [

    20 'field' => dr_safe_replace(\Phpcmf\Service::L('Input')->get('field')),

    21 'value' => dr_safe_replace(\Phpcmf\Service::L('Input')->get('value')),

    22 ],

    23 max(1, (int)\Phpcmf\Service::L('Input')->get('page'))

    24 );

    25 }

    26

    27 public function time() {

    28 $this->_module_init();

    29 $this->_MyShow(

    30 'time',

    SYSTEMPATH/CodeIgniter.php : 832 — Phpcmf\Controllers\Show->index ()

    825 {

    826 // If this is a console request then use the input segments as parameters

    827 $params = defined('SPARKED') ? $this->request->getSegments() : $this->router->params();

    828

    829 if (method_exists($class, '_remap')) {

    830 $output = $class->_remap($this->method, ...$params);

    831 } else {

    832 $output = $class->{$this->method}(...$params);

    833 }

    834

    835 $this->benchmark->stop('controller');

    836

    837 return $output;

    838 }

    839

    SYSTEMPATH/CodeIgniter.php : 419 — CodeIgniter\CodeIgniter->runController ( arguments )

    412 if (! method_exists($controller, '_remap') && ! is_callable([$controller, $this->method], false)) {

    413 throw PageNotFoundException::forMethodNotFound($this->method);

    414 }

    415

    416 // Is there a "post_controller_constructor" event?

    417 Events::trigger('post_controller_constructor');

    418

    419 $returned = $this->runController($controller);

    420 } else {

    421 $this->benchmark->stop('controller_constructor');

    422 $this->benchmark->stop('controller');

    423 }

    424

    425 // If $returned is a string, then the controller output something,

    426 // probably a view, instead of echoing it directly. Send it along

    SYSTEMPATH/CodeIgniter.php : 326 — CodeIgniter\CodeIgniter->handleRequest ( arguments )

    319 $this->response->pretend($this->useSafeOutput)->send();

    320 $this->callExit(EXIT_SUCCESS);

    321

    322 return;

    323 }

    324

    325 try {

    326 return $this->handleRequest($routes, $cacheConfig, $returnResponse);

    327 } catch (RedirectException $e) {

    328 $logger = Services::logger();

    329 $logger->info('REDIRECTED ROUTE at ' . $e->getMessage());

    330

    331 // If the route is a 'redirect' route, it throws

    332 // the exception with the $to as the message

    333 $this->response->redirect(base_url($e->getMessage()), 'auto', $e->getCode());

    FCPATH/Fcms/Init.php : 523 — CodeIgniter\CodeIgniter->run ()

    516 $env = new DotEnv(COREPATH);

    517 $env->load();

    518

    519 helper('url');

    520

    521 $app = new \Phpcmf\Extend\CodeIgniter(new App());

    522 $app->initialize();

    523 $app->run();

  • 回复@游子2018 试试这样写

    <?php
    if($zutu)
    {
       $key=0;
       foreach($zutu as $c)
       {
    ?>
    {
    index: {$key+1},
    href: "{dr_get_file($c.file)}",
    src: "{dr_get_file($c.file)}",
    img: "{dr_thumb($c.file, 200, 200)}",
    <?php
    $at = $ci->get_attachment($c.file);
    if ($at && $at.attachinfo)
    {
        $size=[$at['attachinfo']['width'], $at['attachinfo']['height']];
    }
    else
    {
        $size = getimagesize(dr_get_file($c.file));
    }
    ?>
    width: "{$size[0]}",
    height: "{$size[1]}",
    title: "{$t['title']}"
    },
    <?php
          $key++;
       }
    }
    ?>
    满意答案
    短信币+1
    +1元
    高端程序员往往采用最朴素的编程方式,若不是贫穷,谁愿意弄的自己一身才华!
  • @LandQ:完美解决,实在高!
代码语言