function drawImagesFilterByTagsList($_tagId, $_gpsLoc = array(), $_foldersList = array()) { $_imgList = searchImages($_tagId, $_gpsLoc, $_foldersList); for ($i = 0; $i < count($_imgList); $i++) { $_imgList[$i]['src'] = 'thumbs/' . $_imgList[$i]['folder_id'] . '/thumb_' . $_imgList[$i]['id'] . '_200.jpg'; $_imgList[$i]['link'] = 'image.php?img_id=' . $_imgList[$i]['id']; } $datas = calcThumbsJustified(840, $_imgList); $curImg = 0; foreach ($datas as $line) { foreach ($line as $cropInfos) { echo '<div class="thumbImg thumbBlocJustified" data-imgid="' . $_imgList[$curImg]['id'] . '" id="thumbFile_' . $_imgList[$curImg]['id'] . '" style="width:' . $cropInfos['imgWidth'] . 'px;"><span title="ajouter à la sélection" onclick="choiceThumb(' . $_imgList[$curImg]['id'] . ')" class="glyphicon glyphicon-ok-circle thumbSelector"></span><a href="' . $_imgList[$curImg]['link'] . '" onclick="viewImgFullScreen(true, ' . $_imgList[$curImg]['id'] . ');return false;"><img style="margin-left:' . $cropInfos['cropSize'] / 2 . 'px;" src="thumbs/' . $_imgList[$curImg]['folder_id'] . '/thumb_' . $_imgList[$curImg]['id'] . '_200.jpg"></a><div class="thumb_tags"></div><span class="thumbTitle"><a href="' . $_imgList[$curImg]['link'] . '"><span title="éditer" class="glyphicon glyphicon-pencil btnEditImg"></span></a> ' . $_imgList[$curImg]['filename'] . '<br>' . $_imgList[$curImg]['exif_date_crea'] . '</span></div>'; $curImg++; } } }
/* Only load the class if the name contains accepted characters */ if (preg_match('/[a-z]/i', $class)) { require_once __DIR__ . '/app/' . $class . '.php'; } } /* GET /user/13214/edit/ */ Router::addRoute('GET', '/events/(?<event_id>[0-9]+)/?', function ($args) { $event_id = $args['event_id']; $feedContents = file_get_contents('http://www.skiddle.com/api/v1/events/' . $event_id . '/?api_key=838cec44cf59198b22731f4be213988a'); $feedArray = json_decode($feedContents, true); echo json_encode($feedArray['results']); }); Router::addRoute('GET', '/images/\\?search=(?<search>[A-Za-z0-9\\% ]+)&count=(?<count>[0-9]+)', function ($args) { $search = $_GET['search']; $count = $_GET['count']; echo json_encode(searchImages($search, $count)); }); //List all the events Router::addRoute('GET', '/events/?', function () { $feedContents = file_get_contents('http://www.skiddle.com/api/v1/events/?api_key=838cec44cf59198b22731f4be213988a&eventcode=FEST&offset=0'); $feedArray = json_decode($feedContents, true); echo json_encode($feedArray['results']); }); /* GET /user/ */ Router::addRoute('GET', '/user/?', function () { echo 'List all users'; }); /* GET / */ Router::addRoute('GET', '/?', function () { echo 'Home'; });