當前位置: 首頁>>代碼示例>>PHP>>正文


PHP gallery::setPath方法代碼示例

本文整理匯總了PHP中gallery::setPath方法的典型用法代碼示例。如果您正苦於以下問題:PHP gallery::setPath方法的具體用法?PHP gallery::setPath怎麽用?PHP gallery::setPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在gallery的用法示例。


在下文中一共展示了gallery::setPath方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: substr

?>
        </div>

        <div class="row">
        		<h3>Gallerie fotografiche</h3>
        </div>
        <div class="row">
    <?php 
$string = file_get_contents("./json/photos.json");
$json_a = json_decode($string, true);
usort($json_a, 'sort_by_date');
foreach ($json_a as $ph => $photo) {
    $data = $util->shortDate($photo['data']);
    $folder = $photo['folder'];
    $title = $photo['title'];
    $gallery->setPath('./photos/' . $folder . '/');
    //path to the image folder
    $images = $gallery->getImages(array('jpg', 'png'));
    //array of possible image extensions (useful if you have mixed galleries)
    ?>
                    <div class="col-xs-12">                    	
                        <h4><?php 
    echo $title;
    ?>
<a name='<?php 
    echo $folder;
    ?>
'></a> (<?php 
    echo substr($data, strlen($data) - 9);
    ?>
)</h4>
開發者ID:cbolk,項目名稱:renbukai-website,代碼行數:31,代碼來源:gallery.php

示例2: sort_by_date

date_default_timezone_set('Europe/Rome');
include "./utils/class.utils.php";
include "./utils/class.seminar.php";
include "./utils/class.gallery.php";
function sort_by_date($a, $b)
{
    $dA = strtotime($a['data']);
    $dB = strtotime($b['data']);
    return $dB - $dA;
}
$util = new utils();
$s = new seminar();
$s->setSource("./seminari.json");
$gallery = new gallery();
$data = $util->shortDate($json_a[0]['data']);
$gallery->setPath('./stages/');
//path to the image folder
$image = $gallery->getImages(array('jpg', 'png', 'gif'));
//array of possible image extensions
?>
<html>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>associazione renbukai</title>
    <link rel="apple-touch-icon-precomposed" href="assets/favicon_t.png" />
    <link rel="shortcut icon" href="assets/favicon.png">
    <!-- bootstrap -->
    <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
    <link rel="stylesheet" href="//blueimp.github.io/Gallery/css/blueimp-gallery.min.css">
    <link rel="stylesheet" href="css/bootstrap-image-gallery.min.css">
開發者ID:cbolk,項目名稱:renbukai-website,代碼行數:31,代碼來源:seminar_new.php


注:本文中的gallery::setPath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。