File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ function osm_get_gps($page)
6666 }
6767 if ($ page ['section ' ] === 'tags ' and isset ($ page ['tags ' ]) and isset ($ page ['tags ' ][0 ]['id ' ]) )
6868 {
69- $ items = get_image_ids_for_tags ( array ( $ page ['tags ' ][ 0 ][ ' id ' ] ) );
69+ $ items = get_image_ids_for_tags ( array_reduce ( $ page ['tags ' ], ' osm_get_page_tag_id ' ) );
7070 if ( !empty ($ items ) )
7171 {
7272 $ LIMIT_SEARCH = "ic.image_id IN ( " .implode (', ' , $ items ).") AND " ;
@@ -111,7 +111,7 @@ function osm_get_items($page)
111111 }
112112 if ($ page ['section ' ] === 'tags ' and isset ($ page ['tags ' ]) and isset ($ page ['tags ' ][0 ]['id ' ]) )
113113 {
114- $ items = get_image_ids_for_tags ( array ( $ page ['tags ' ][ 0 ][ ' id ' ] ) );
114+ $ items = get_image_ids_for_tags ( array_reduce ( $ page ['tags ' ], ' osm_get_page_tag_id ' ) );
115115 if ( !empty ($ items ) )
116116 {
117117 $ LIMIT_SEARCH = "ic.image_id IN ( " .implode (', ' , $ items ).") AND " ;
@@ -605,4 +605,18 @@ function osm_bounds_from_url($str)
605605 return $ b ;
606606}
607607
608+ /**
609+ * What is the id of this page tag ?
610+ *
611+ * Note : this function is called to grab every tags in a page
612+ *
613+ * @param array basket to collect id
614+ * @param array page tag
615+ * @return basket
616+ */
617+ function osm_get_page_tag_id ($ basket , $ page_tag ) {
618+ $ basket [] = $ page_tag ['id ' ];
619+ return $ basket ;
620+ }
621+
608622?>
You can’t perform that action at this time.
0 commit comments