public function view($id) { $this->load->model('gallery'); $this->lang->load('modules/gallery'); if (!($gallery = $this->gallery->findId($id))) { show_404(); } $this->site->set('metaTitle', $gallery->title); $this->site->set('ogType', 'article'); $this->site->set('ogTitle', $gallery->title); $this->site->set('ogImage', uploadPath($gallery->image, 'gallery')); $this->load->view('master', array('view' => 'gallery/view', 'gallery' => $gallery)); }
public function view($id) { $this->load->model('service'); $this->lang->load('modules/service'); if (!($service = $this->service->findId($id))) { show_404(); } $this->site->set('metaTitle', !empty($service->metaTitle) ? $service->metaTitle : $service->title); $this->site->set('metaDescription', $service->metaDescription); $this->site->set('metaKeywords', $service->metaKeywords); $this->site->set('ogType', 'article'); $this->site->set('ogTitle', $service->title); $this->site->set('ogDescription', $service->summary); $this->site->set('ogImage', uploadPath($service->image, 'news')); $this->load->view('master', array('view' => 'service/view', 'service' => $service)); }
function uploadPath($sc, $dbg, $rootDir, $relativePath) { handleResponse("mkdir {$relativePath}", $dbg, $sc->call("createDirectory", array('relativePath' => $relativePath), "POST")); $fullDir = $rootDir . DIRECTORY_SEPARATOR . $relativePath; foreach (glob($fullDir . DIRECTORY_SEPARATOR . "*") as $fileName) { echo $fileName . "\n"; if (is_file($fileName)) { $r = handleResponse("utoken {$fileName}", $dbg, $sc->call("getUploadToken", array('relativePath' => $relativePath . DIRECTORY_SEPARATOR . basename($fileName), 'fileSize' => filesize($fileName)), "POST")); handleResponse("ufile {$fileName}", $dbg, uploadFile($r->data->uploadLocation, $fileName, 1024 * 1024)); } else { if (is_dir($fileName)) { uploadPath($sc, $dbg, $rootDir, $relativePath . DIRECTORY_SEPARATOR . basename($fileName)); } } } }
public function view($id) { $this->load->model('content'); $this->lang->load('modules/content'); if (!($content = $this->content->findId($id))) { show_404(); } $this->site->set('metaTitle', !empty($content->metaTitle) ? $content->metaTitle : $content->title); $this->site->set('metaDescription', $content->metaDescription); $this->site->set('metaKeywords', $content->metaKeywords); $this->site->set('ogType', 'article'); $this->site->set('ogTitle', $content->title); if (!empty($content->summary)) { $this->site->set('ogDescription', $content->summary); } if (!empty($content->image)) { $this->site->set('ogImage', uploadPath($content->image, 'content')); } $this->load->view('master', array('view' => 'content/view', 'content' => $content)); }
<div class="socials"> <?php foreach ($this->social->all() as $social) { ?> <a href="<?php echo $social->link; ?> " title="<?php echo htmlspecialchars($social->title); ?> " target="_blank"> <img src="<?php echo uploadPath($social->image, 'social'); ?> " alt="<?php echo htmlspecialchars($social->title); ?> " /> </a> <?php } ?> </div>
<?php foreach ($newscast as $news) { ?> <div class="col-md-6"> <div class="news"> <div class="row"> <div class="col-md-4"> <a href="<?php echo clink(array('@news', $news->slug, $news->id)); ?> " title="<?php echo htmlspecialchars($news->title); ?> "> <img class="img-responsive" src="<?php echo uploadPath($news->image, 'news'); ?> " alt="<?php echo htmlspecialchars($news->title); ?> " /> </a> </div> <div class="col-md-8"> <p class="title"><a href="<?php echo clink(array('@news', $news->slug, $news->id)); ?> "><?php echo $news->title; ?> </a></p>
</div> <div class="galleries"> <div class="row"> <?php foreach ($galleries as $gallery) { ?> <div class="column col-md-3"> <div class="gallery"> <a href="<?php echo clink(array('@gallery', $gallery->slug, $gallery->id)); ?> "> <img class="img-responsive" src="<?php echo uploadPath($gallery->image, 'gallery'); ?> " alt="<?php echo htmlspecialchars($gallery->title); ?> " /> <span><?php echo $gallery->title; ?> </span> </a> </div> </div> <?php } ?>
function _listaArquivos() { $arquivos = getFilesByPath(uploadPath() . 'arquivo'); $arrFile = array('' => 'Selecione...'); foreach ($arquivos as $item) { $arrFile[$item] = $item; } return $arrFile; }
function upload_file($key, $folder = "") { $fileName = Input::get($key); if (Input::hasFile($key)) { $file = Input::file($key); $newFilename = uniqid() . "_" . time() . "." . $file->getClientOriginalExtension(); $file->move(uploadPath($folder), $newFilename); $fileName = $folder . $newFilename; } return $fileName; }
/** * retorna o caminho absoluto da imagem no servidor * @param int $id * @return string */ function getMediaPathById($id) { if (!$id) { return; } $media = getProductById($id); return uploadPath() . $media['media_category'] . "/" . $media['id_usuario'] . "/" . $media['media_url']; }
<div class="row"> <?php foreach ($services as $service) { ?> <div class="col-md-4"> <div class="service"> <div class="image"> <a href="<?php echo clink(array('@service', $service->slug, $service->id)); ?> " title="<?php echo htmlspecialchars($service->title); ?> "> <img src="<?php echo uploadPath($service->image, 'service'); ?> " alt="<?php echo $service->title; ?> " /> </a> </div> <div class="detail"> <div class="title"><a href="<?php echo clink(array('@service', $service->slug, $service->id)); ?> " title="<?php echo htmlspecialchars($service->title); ?> "><?php
</div> <div class="galleries"> <div class="row"> <?php foreach ($gallery->images as $image) { ?> <div class="column col-md-3"> <div class="gallery"> <a class="fancybox" rel="gallery" href="<?php echo uploadPath($image->image, 'gallery/normal'); ?> "> <img class="img-responsive" src="<?php echo uploadPath($image->image, 'gallery/thumb'); ?> " /> </a> </div> </div> <?php } ?> </div> <div class="buttons"> <a class="btn btn-primary btn-sm" href="javascript:history.back();"><span class="glyphicon glyphicon-circle-arrow-left"></span> <?php echo lang('gallery-go-back'); ?>
<?php foreach ($videos as $video) { ?> <div class="col-md-6"> <div class="video"> <div class="row"> <div class="col-md-4"> <a class="fancybox fancybox.iframe" href="//www.youtube-nocookie.com/embed/<?php echo $video->video; ?> ?rel=0" title="<?php echo $video->title; ?> "> <img class="img-responsive" src="<?php echo uploadPath($video->image, 'video'); ?> " alt="<?php echo $video->title; ?> " /> </a> </div> <div class="col-md-8"> <div class="title"><a class="fancybox fancybox.iframe" href="//www.youtube-nocookie.com/embed/<?php echo $video->video; ?> ?rel=0"><?php echo $video->title; ?> </a></div>
<section id="content"> <div class="panel"> <div class="panel-header"><?php echo $this->module->arguments->title; ?> </div> <div class="panel-body clearfix typography"> <div class="reference-list clearfix"> <?php foreach ($references as $item) { ?> <div class="item"> <img src="<?php echo uploadPath($item->image, 'reference'); ?> " alt="<?php echo htmlspecialchars($item->title); ?> " /> <div class="title"><?php echo $item->title; ?> </div> </div> <?php } ?> </div>