mirror of
https://github.com/ZeJMaN/LBCAlerte_ynh.git
synced 2025-07-25 21:00:48 +02:00
Upgrade LBCAlerte to version 3.3
Add upgrade script
This commit is contained in:
24
sources/app/api/annonce/index.php
Normal file
24
sources/app/api/annonce/index.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
$order_by = null;
|
||||
$sort = isset($_GET["sort"]) ? $_GET["sort"] : "";
|
||||
$order = isset($_GET["order"]) ? $_GET["order"] : "asc";
|
||||
|
||||
if ($sort) {
|
||||
$order_by = $sort." ".$order;
|
||||
}
|
||||
|
||||
$ads = $storage->fetchAll($order_by);
|
||||
|
||||
$baseurl = $config->get("general", "baseurl", "");
|
||||
$adPhoto = new App\Storage\AdPhoto($userAuthed);
|
||||
$return = array();
|
||||
foreach ($ads AS $ad) {
|
||||
$params = $ad->toArray();
|
||||
foreach ($params["photos"] AS $i => $photo) {
|
||||
$params["photos"][$i]["local"] = $baseurl.$adPhoto->getPublicDestination($photo["local"]);
|
||||
}
|
||||
$return[$ad->getId()] = $params;
|
||||
}
|
||||
|
||||
return $return;
|
Reference in New Issue
Block a user