On this Url https://mappingforyou.eu/gallery/osmmap.php?/category/35&v=2
a "category" variable was set to 35. I'd like the page to set that category to 35 permanently. How should I do ?
I'm using https://github.com/Piwigo/piwigo-openstreetmap .
The files are map2.tpl and functions_map. php
Please help.
PS : last time my post was closed without explanation and I was prevented from posting again. This doesn't occur on gis stackechange, but this occurs here and I can't figure out why. I'm here for the purpose of learning and I'm a beginner so please at least give an explanation
function osm_get_gps($page)
{
// Limit search by category, by tag, by smartalbum
$LIMIT_SEARCH="";
$INNER_JOIN="";
if (isset($page['section']))
{
if ($page['section'] === 'categories' and isset($page['category']) and isset($page['category']['id']) )
{
$LIMIT_SEARCH = "FIND_IN_SET(".$page['category']['id'].", c.uppercats) AND ";
$INNER_JOIN = "INNER JOIN ".CATEGORIES_TABLE." AS c ON ic.category_id = c.id";
}
if ($page['section'] === 'tags' and isset($page['tags']) and isset($page['tags'][0]['id']) )
{
$items = get_image_ids_for_tags( array_reduce( $page['tags'], 'osm_get_page_tag_id' ) );
if ( !empty($items) )
{
$LIMIT_SEARCH = "ic.image_id IN (".implode(',', $items).") AND ";
}
}
if ($page['section'] === 'tags' and isset($page['category']) and isset($page['category']['id']) )
{
$LIMIT_SEARCH = "FIND_IN_SET(".$page['category']['id'].", c.uppercats) AND ";
$INNER_JOIN = "INNER JOIN ".CATEGORIES_TABLE." AS c ON ic.category_id = c.id";
}
}
$forbidden = get_sql_condition_FandF(
array
(
'forbidden_categories' => 'ic.category_id',
'visible_categories' => 'ic.category_id',
'visible_images' => 'i.id'
),
"\n AND"
);
/* Get all GPX tracks */
$query="SELECT i.path FROM ".IMAGES_TABLE." AS i
INNER JOIN (".IMAGE_CATEGORY_TABLE." AS ic ".$INNER_JOIN.") ON i.id = ic.image_id
WHERE ".$LIMIT_SEARCH." `path` LIKE '%.gpx' ".$forbidden." ";
return array_from_query($query, 'path');
}
function osm_get_items($page)
{
// Limit search by category, by tag, by smartalbum
$LIMIT_SEARCH="";
$INNER_JOIN="";
if (isset($page['section']))
{
if ($page['section'] === 'categories' and isset($page['category']) and isset($page['category']['id']) )
{
$LIMIT_SEARCH = "FIND_IN_SET(".$page['category']['id'].", c.uppercats) AND ";
$INNER_JOIN = "INNER JOIN ".CATEGORIES_TABLE." AS c ON ic.category_id = c.id";
}
if ($page['section'] === 'tags' and isset($page['tags']) and isset($page['tags'][0]['id']) )
{
$items = get_image_ids_for_tags( array_reduce( $page['tags'], 'osm_get_page_tag_id' ) );
if ( !empty($items) )
{
$LIMIT_SEARCH = "ic.image_id IN (".implode(',', $items).") AND ";
}
}
if ($page['section'] === 'tags' and isset($page['category']) and isset($page['category']['id']) )
{
$LIMIT_SEARCH = "FIND_IN_SET(".$page['category']['id'].", c.uppercats) AND ";
$INNER_JOIN = "INNER JOIN ".CATEGORIES_TABLE." AS c ON ic.category_id = c.id";
}
}