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 " ;
@@ -607,4 +607,18 @@ function osm_bounds_from_url($str)
607607 return $ b ;
608608}
609609
610+ /**
611+ * What is the id of this page tag ?
612+ *
613+ * Note : this function is called to grab every tags in a page
614+ *
615+ * @param array basket to collect id
616+ * @param array page tag
617+ * @return basket
618+ */
619+ function osm_get_page_tag_id ($ basket , $ page_tag ) {
620+ $ basket [] = $ page_tag ['id ' ];
621+ return $ basket ;
622+ }
623+
610624?>
You can’t perform that action at this time.
0 commit comments