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


PHP loader::view方法代码示例

本文整理汇总了PHP中loader::view方法的典型用法代码示例。如果您正苦于以下问题:PHP loader::view方法的具体用法?PHP loader::view怎么用?PHP loader::view使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在loader的用法示例。


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

示例1: copyselectedurl

 function copyselectedurl($config = array())
 {
     need_login('ajax_page');
     global $base_root;
     $ids = $this->getPost('sel_id');
     if (!$ids || count($ids) == 0) {
         ajax_box(lang('copyimg:pls_sel_photo_want_to_copy'));
     } else {
         $site_url = $this->setting->get_conf('site.url');
         $mdl_photo =& loader::model('photo');
         $ids = array_keys($ids);
         $html = '';
         $urls = '';
         $ubb = '';
         foreach ($ids as $id) {
             $pic = $mdl_photo->get_info($id);
             $img_path = img_path($pic['path']);
             $html_code = $config['tpl'];
             $html_code = str_replace('{thumbpath}', img_path($pic['thumb']), $html_code);
             $html_code = str_replace('{imgpath}', $img_path, $html_code);
             $html_code = str_replace('{imgname}', $pic['name'], $html_code);
             $html_code = str_replace('{detailurl}', $base_root . site_link('photos', 'view', array('id' => $pic['id'])), $html_code);
             $html .= $html_code . $config['split'];
             $urls .= $img_path . "\r\n";
             $ubb .= '[IMG]' . $img_path . "[/IMG]\r\n";
         }
         $this->output->set('img_url', $urls);
         $this->output->set('img_html', $html);
         $this->output->set('img_ubb', $ubb);
         loader::view('copyimg:copyurlall');
     }
 }
开发者ID:vluo,项目名称:myPoto,代码行数:32,代码来源:utils.cct.php

示例2: render

 function render($type = 'normal')
 {
     if ($type == 'normal') {
         $tpl = IN_CTL . '/' . IN_ACT;
     } else {
         $tpl = IN_CTL . '/' . IN_ACT . '_' . $type;
     }
     loader::view($tpl);
 }
开发者ID:vluo,项目名称:myPoto,代码行数:9,代码来源:pagecore.php

示例3: diy

 function diy()
 {
     $id = $this->getGet('id');
     $path = ROOTDIR . TPLDIR . DIRECTORY_SEPARATOR . $id . '.htm';
     if ($id && preg_match('/^[0-9a-z_\\-\\.]+$/i', $id) && file_exists($path)) {
         $this->output->set('page_crumb', '');
         $page_title = $this->setting->get_conf('site.title');
         $page_keywords = $this->setting->get_conf('site.keywords');
         $page_description = $this->setting->get_conf('site.description');
         $this->page_init($page_title, $page_keywords, $page_description);
         loader::view($id);
     } else {
         header("HTTP/1.1 404 Not Found");
         showError(lang('404_not_found'));
     }
 }
开发者ID:vluo,项目名称:myPoto,代码行数:16,代码来源:default.ctl.php

示例4: save_reply

 function save_reply()
 {
     if (!$this->setting->get_conf('system.enable_comment')) {
         form_ajax_failed('text', lang('album_comment_closed'));
     }
     $comment['email'] = safe_convert($this->getPost('email'));
     $comment['author'] = safe_convert($this->getPost('author'));
     $comment['content'] = safe_convert($this->getPost('content'));
     $comment['ref_id'] = intval($this->getPost('ref_id'));
     $comment['type'] = intval($this->getPost('type'));
     $comment['reply_author'] = safe_convert($this->getPost('reply_author'));
     $comment['pid'] = intval($this->getPost('pid'));
     $this->plugin->trigger('before_post_comment');
     if ($this->setting->get_conf('system.enable_comment_captcha') && !$this->user->loggedin()) {
         $captcha =& loader::lib('captcha');
         if (!$captcha->check($this->getPost('captcha'))) {
             form_ajax_failed('text', lang('invalid_captcha_code'));
         }
     }
     if ($comment['email'] && !check_email($comment['email'])) {
         form_ajax_failed('text', lang('error_email'));
     }
     if (!$comment['author']) {
         form_ajax_failed('text', lang('error_comment_author'));
     }
     if (!$comment['content']) {
         form_ajax_failed('text', lang('empty_content'));
     }
     if (!$comment['ref_id'] || !$comment['type'] || !$comment['pid'] || !$comment['reply_author']) {
         form_ajax_failed('text', lang('miss_argument'));
     }
     $comment['post_time'] = time();
     $comment['author_ip'] = get_real_ip();
     if ($this->setting->get_conf('system.comment_audit') == 1 && !$this->user->loggedin()) {
         $comment['status'] = 0;
     } else {
         $comment['status'] = 1;
     }
     if ($reply_id = $this->mdl_comment->save($comment)) {
         $comment['id'] = $reply_id;
         $this->output->set('info', $comment);
         $this->plugin->trigger('reply_comment', $reply_id);
         form_ajax_success('text', loader::view('comments/view', false));
     } else {
         form_ajax_failed('text', lang('reply_failed'));
     }
 }
开发者ID:vluo,项目名称:myPoto,代码行数:47,代码来源:comments.ctl.php

示例5: get_page_setting

function get_page_setting($type)
{
    $arr = array(12, 30, 56);
    $setting_mdl =& loader::model('setting');
    if ($type == 'album') {
        $default = $setting_mdl->get_conf('display.album_pageset', 12);
    } else {
        $default = $setting_mdl->get_conf('display.photo_pageset', 12);
    }
    $current = isset($_COOKIE['Mpic_pageset_' . $type]) ? $_COOKIE['Mpic_pageset_' . $type] : $default;
    $output =& loader::lib('output');
    $output->set('pageset_menu', $arr);
    $output->set('pageset_menu_current', $current);
    $output->set('pageset_menu_type', $type);
    $str = loader::view('block/pageset_menu', false);
    return array($current, $str);
}
开发者ID:vluo,项目名称:myPoto,代码行数:17,代码来源:ui.php

示例6: _priv_page

 function _priv_page($id, $album_info = null)
 {
     if (is_null($album_info)) {
         $album_info = $this->mdl_album->get_info($id);
     }
     $this->output->set('album_info', $album_info);
     $ajax = $this->getGet('ajax');
     if ($ajax == 'true') {
         $this->output->set('ajax', true);
         if ($this->mdl_album->check_album_priv($id, $album_info)) {
             ajax_box(lang('has_validate'), null, 0.5, site_link('photos', 'index', array('aid' => $id)));
         }
     } else {
         $this->output->set('ajax', false);
         $page_title = lang('title_need_validate') . ' - ' . lang('system_notice') . ' - ' . $this->setting->get_conf('site.title');
         $page_keywords = $this->setting->get_conf('site.keywords');
         $page_description = $this->setting->get_conf('site.description');
         $this->page_init($page_title, $page_keywords, $page_description, $id);
     }
     loader::view('photos/priv_page');
 }
开发者ID:vluo,项目名称:myPoto,代码行数:21,代码来源:photos.ctl.php

示例7: save

 function save()
 {
     @set_time_limit(0);
     @ignore_user_abort(true);
     $type = $this->getGet('t');
     $album_id = intval($this->getRequest('aid'));
     if (!$album_id) {
         showError(lang('pls_sel_album'));
     }
     if ($type == 'multi') {
         need_login('ajax');
         /*$files_count = intval($this->getPost('muilti_uploader_count'));
           for($i=0;$i<$files_count;$i++){
               $filename = $this->getPost("muilti_uploader_{$i}_tmpname");
               $realname = $this->getPost("muilti_uploader_{$i}_name");
               $purename = file_pure_name($filename);
               $purerealname = file_pure_name($realname);
               $photorow = $this->mdl_photo->get_photo_by_name_aid($album_id,$purename);
               if($photorow){
                   $this->mdl_photo->update($photorow['id'],array('name'=>$purerealname));
               }
           }
           */
         $this->mdl_album->update_photos_num($album_id);
         $this->mdl_album->check_repare_cover($album_id);
         $gourl = site_link('photos', 'index', array('aid' => $album_id));
         form_ajax_success('box', lang('upload_photo_success'), null, 1, $gourl);
     } else {
         need_login('page');
         $this->output->set('album_id', $album_id);
         $album_info = $this->mdl_album->get_info($album_id);
         $this->output->set('album_info', $album_info);
         $page_title = lang('upload_photo') . ' - ' . $this->setting->get_conf('site.title');
         $page_keywords = $this->setting->get_conf('site.keywords');
         $page_description = $this->setting->get_conf('site.description');
         $this->page_init($page_title, $page_keywords, $page_description);
         $imglib =& loader::lib('image');
         $supportType = $imglib->supportType();
         $empty_num = 0;
         $error = '';
         $allowsize = allowsize($this->setting->get_conf('upload.allow_size'));
         if (isset($_FILES['imgs'])) {
             foreach ($_FILES['imgs']['name'] as $k => $upfile) {
                 if (!empty($upfile)) {
                     $filesize = $_FILES['imgs']['size'][$k];
                     $tmpfile = $_FILES['imgs']['tmp_name'][$k];
                     $filename = $upfile;
                     $fileext = file_ext($filename);
                     if ($_FILES['imgs']['error'][$k] == 1) {
                         $error .= lang('failed_larger_than_server', $filename) . '<br />';
                         continue;
                     }
                     if ($allowsize && $filesize > $allowsize) {
                         $error .= lang('failed_larger_than_usetting', $filename) . '<br />';
                         continue;
                     }
                     if ($filesize == 0) {
                         $error .= lang('failed_if_file', $filename) . '<br />';
                         continue;
                     }
                     if (!in_array($fileext, $supportType)) {
                         $error .= lang('failed_not_support', $filename) . '<br />';
                         continue;
                     }
                     if (!$this->mdl_photo->save_upload($album_id, $tmpfile, $filename, true, array('cate_id' => $album_info['cate_id']))) {
                         $error .= lang('file_upload_failed', $filename) . '<br />';
                     }
                 } else {
                     $empty_num++;
                 }
             }
         } else {
             $error = lang('need_sel_upload_file');
         }
         if (isset($_FILES['imgs']) && $empty_num == count($_FILES['imgs']['name'])) {
             $this->output->set('msginfo', '<div class="failed">' . lang('need_sel_upload_file') . '</div>');
         } else {
             $this->mdl_album->update_photos_num($album_id);
             $this->mdl_album->check_repare_cover($album_id);
             if ($error) {
                 $this->output->set('msginfo', '<div class="failed">' . $error . '</div>');
             } else {
                 $this->output->set('msginfo', '<div class="success">' . lang('upload_photo_success') . '<a href="' . site_link('photos', 'index', array('aid' => $album_id)) . '">' . lang('view_album') . '</a></div>');
             }
         }
         $crumb_nav = array();
         $crumb_nav[] = array('name' => lang('upload_photo'));
         $this->page_crumb($crumb_nav);
         loader::view('upload/normal');
     }
 }
开发者ID:vluo,项目名称:myPoto,代码行数:91,代码来源:upload.ctl.php


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