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


PHP Configure::GetValueConfigByKey方法代码示例

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


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

示例1: index

 public function index($image_id)
 {
     $arrReturn = array();
     $arrImage = array();
     $imageObj = VIImage::select('images.id', 'images.name', 'images.short_name', 'images.description', 'images.keywords', 'images.artist', 'images.author_id', 'image_details.path', 'image_details.width', 'image_details.height', 'image_details.ratio')->join('image_details', 'image_details.image_id', '=', 'images.id')->where('images.id', $image_id)->first();
     if (is_object($imageObj)) {
         if ($imageObj->ratio > 1) {
             $width = 450;
             $height = $width / $imageObj->ratio;
         } else {
             $height = 450;
             $width = $height * $imageObj->ratio;
         }
         $arrImage = ['image_id' => $imageObj->id, 'name' => $imageObj->name, 'short_name' => $imageObj->short_name, 'description' => $imageObj->description, 'keywords' => $imageObj->keywords, 'artist' => $imageObj->artist, 'author_id' => $imageObj->author_id, 'width' => $width, 'height' => $height, 'path' => '/pic/with-logo/' . $imageObj->short_name . '-' . $imageObj->id . '.jpg', 'path_thumb' => '/pic/thumb/' . $imageObj->short_name . '-' . $imageObj->id . '.jpg'];
         $htmlChooseDownload = $this->loadChooseDownload($imageObj->id);
         $product = Product::with(['type', 'sizeLists', 'optionGroups' => function ($query) {
             $query->select('option_groups.id', 'name', 'key');
         }, 'options' => function ($query) {
             $query->select('options.id', 'name', 'key', 'option_group_id');
         }]);
         $product = $product->where('active', 1)->get();
         $arrProduct = array();
         if (is_object($product)) {
             $arrProduct = $product->toArray();
         }
         // echo '<pre>';
         // print_r($arrProduct[0]['option_groups']);
         // echo '</pre>';
         $htmlOrder = $this->loadOrder($arrImage, $arrProduct);
         $htmlSignin = View::make('frontend.account.signin')->with([])->render();
         $arrKeywords = explode(',', $imageObj->keywords);
         $arrReturn['htmlKeywords'] = View::make('frontend.images.view-keywords')->with('arrKeywords', $arrKeywords)->render();
         $action = Input::has('a') ? Input::get('a') : '';
         $arrReturn['htmlMainImage'] = View::make('frontend.images.main-image')->with(['imageObj' => $arrImage, 'htmlChooseDownload' => $htmlChooseDownload, 'htmlOrder' => $htmlOrder, 'htmlSignin' => $htmlSignin, 'action' => $action, 'htmlKeywords' => $arrReturn['htmlKeywords']])->render();
         $arrReturn['htmlSameArtist'] = $this->loadSameArtist($imageObj->author_id);
         $arrReturn['htmlSimilarImages'] = $this->getSimilarImage(array($imageObj->id));
         $this->layout->metaTitle = $imageObj->name;
         //save to recently_view_images table
         //App::make('AccountController')->addToRecentlyViewImages($imageObj->id);
         if (Auth::user()->check()) {
             BackgroundProcess::actionSearch(['type' => 'recently-view', 'image_id' => $imageObj->id, 'user_id' => Auth::user()->get()->id]);
         }
     } else {
         return App::abort(404);
     }
     $arrReturn['imageObj'] = $arrImage;
     $categories = $this->layout->categories;
     $arrReturn['htmlCategories'] = View::make('frontend.account.view-categories')->with('categories', $categories)->render();
     $lightboxes = array();
     if (Auth::user()->check()) {
         $lightboxes = Lightbox::where('user_id', '=', Auth::user()->get()->id)->get()->toArray();
         foreach ($lightboxes as $key => $lightbox) {
             $lightboxes[$key]['total'] = LightboxImages::where('lightbox_id', '=', $lightbox['id'])->count();
         }
     }
     $arrReturn['lightboxes'] = $lightboxes;
     $arrReturn['mod_download'] = Configure::GetValueConfigByKey('mod_download');
     $arrReturn['mod_order'] = Configure::GetValueConfigByKey('mod_order');
     $arrReturn['arrProduct'] = $arrProduct;
     $this->layout->content = View::make('frontend.images.index')->with($arrReturn);
 }
开发者ID:nguyendaivu,项目名称:imagestock,代码行数:61,代码来源:ISImagesController.php

示例2: searchImage


//.........这里部分代码省略.........
     $number_people = Input::has('number_people') ? Input::get('number_people') : 'any';
     $color = Input::has('color') ? Input::get('color') : '';
     $images = VIImage::select('images.short_name', 'images.id', 'images.name', 'images.main_color', DB::raw('count(lightbox_images.id) as count_favorite'))->leftJoin('lightbox_images', 'images.id', '=', 'lightbox_images.image_id')->groupBy('images.id')->with('downloads');
     switch ($sort_method) {
         case 'new':
             $images = $images->with('statistic')->orderBy('images.id', 'desc')->withType('main')->withOrientation($orientation);
             break;
         case 'relevant':
             $images = $images->with('statistic')->orderBy('images.id', 'desc')->withType('main')->withOrientation($orientation);
             break;
         case 'popular':
             $images = $images->join('statistic_image', 'statistic_image.image_id', '=', 'images.id')->with('statistic')->orderBy('view', 'desc')->orderBy('download', 'desc')->withType('main')->withOrientation($orientation);
             break;
         case 'undiscovered':
             $images = $images->join('statistic_image', 'statistic_image.image_id', '=', 'images.id')->with('statistic')->orderBy('view', 'asc')->orderBy('download', 'asc')->withType('main')->withOrientation($orientation);
             break;
         default:
             $images = $images->with('statistic')->orderBy('images.id', 'desc')->withType('main')->withOrientation($orientation);
             break;
     }
     if ($search_type == 'search' && $keyword != '') {
         $images = $images->search($keyword);
     }
     if ($exclude_keyword != '') {
         $images = $images->notSearchKeyWords($exclude_keyword);
     }
     if ($exclude_people) {
         $images = $images->where('number_people', '=', 0);
     }
     if ($include_people) {
         if ($gender != 'any') {
             $images = $images->where('gender', '=', $gender);
         }
         if ($age != 'any') {
             $age = explode('-', $age);
             $from = intval($age[0]);
             $to = intval($age[1]);
             $images = $images->where('age_from', '<=', $to)->where('age_to', '>=', $from);
         }
         if ($ethnicity != 'any') {
             $images = $images->where('ethnicity', '=', $ethnicity);
         }
         if ($number_people != 'any') {
             if ($number_people < 4) {
                 $images = $images->where('number_people', '=', $number_people);
             } else {
                 $images = $images->where('number_people', '>=', $number_people);
             }
         }
     }
     if (!(Input::has('editorial') && Input::has('non_editorial'))) {
         if (Input::has('editorial')) {
             $images = $images->where('editorial', '=', 1);
         }
         if (Input::has('non_editorial')) {
             $images = $images->where('editorial', '=', 0);
         }
     }
     if ($type != 0) {
         $images = $images->where('type_id', '=', $type);
     }
     if ($category != 0) {
         $images = $images->join('images_categories', 'images_categories.image_id', '=', 'images.id')->where('images_categories.category_id', '=', $category);
     }
     $total_image = $images->count();
     $images = $images->get()->toArray();
     $images = $this->searchColorFromArray($color, $images);
     $total_image = count($images);
     $images = array_slice($images, $skip, $take);
     //pr(DB::getQueryLog());die;
     $total_page = ceil($total_image / $take);
     //for recently searched images
     if ((trim($keyword_searched) != '' || $short_name != '') && count($images) > 0) {
         if ($keyword_searched == '') {
             $keyword_searched = str_replace('-', ' ', $short_name);
         }
         if (Auth::user()->check()) {
             BackgroundProcess::actionSearch(['type' => 'recently-search', 'keyword' => $keyword_searched, 'image_id' => $images[0]['id'], 'user_id' => Auth::user()->get()->id, 'query' => Request::server('REQUEST_URI')]);
         }
         BackgroundProcess::actionSearch(['type' => 'popular-search', 'keyword' => $keyword_searched, 'image_id' => $images[0]['id'], 'query' => Request::server('REQUEST_URI')]);
     }
     $lightboxes = array();
     if (Auth::user()->check()) {
         $lightboxes = Lightbox::where('user_id', '=', Auth::user()->get()->id)->get()->toArray();
         foreach ($lightboxes as $key => $lightbox) {
             $lightboxes[$key]['total'] = LightboxImages::where('lightbox_id', '=', $lightbox['id'])->count();
         }
     }
     $image_action_title = 'Like this item';
     if (Auth::user()->check()) {
         $image_action_title = 'Save to lightbox';
     }
     $arr_sort_method = array('new' => 'New', 'popular' => 'Popular', 'relevant' => 'Relevant', 'undiscovered' => 'Undiscovered');
     $arrReturn = array('images' => $images, 'total_page' => $total_page, "total_image" => $total_image, "sort_style" => $sort_style, "search_type" => $search_type, "categories" => $this->layout->categories, "lightboxes" => $lightboxes, "image_action_title" => $image_action_title, "arr_sort_method" => $arr_sort_method, "sort_method" => $sort_method, 'mod_download' => Configure::GetValueConfigByKey('mod_download'), 'mod_order' => Configure::GetValueConfigByKey('mod_download'));
     if (Request::ajax()) {
         return $arrReturn;
     }
     $this->layout->in_search = 1;
     $this->layout->content = View::make('frontend.search')->with($arrReturn);
 }
开发者ID:nguyendaivu,项目名称:imagestock,代码行数:101,代码来源:HomeController.php


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