Skip to content
Snippets Groups Projects
Commit c023362f authored by imclean's avatar imclean Committed by podarok
Browse files

Issue #205944 by imclean, cjs@rabash, bdragon, distanceroller, alesr,...

Issue #205944 by imclean, cjs@rabash, bdragon, distanceroller, alesr, cangeceiro, johnzzon: gmap marker settings - assigning terms and displaying different markers based on these in a gmap view map
parent e196906e
No related branches found
No related tags found
No related merge requests found
...@@ -129,24 +129,18 @@ function gmap_taxonomy_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) { ...@@ -129,24 +129,18 @@ function gmap_taxonomy_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
$status = variable_get('gmap_taxonomy_vocabs', array()); $status = variable_get('gmap_taxonomy_vocabs', array());
$marker = ''; $marker = '';
if (isset($node->taxonomy) && is_array($node->taxonomy)) { if (isset($node->taxonomy) && is_array($node->taxonomy)) {
foreach ($node->taxonomy as $voc => $terms) { foreach ($node->taxonomy as $tid => $term) {
if (isset($status[$voc]) && $status[$voc]) { if (isset($status[$term->vid]) && $status[$term->vid]) {
$t = $terms; $result = db_query('SELECT marker, tid FROM {gmap_taxonomy_term} WHERE tid = %d', $tid);
if (!is_array($t)) { if ($m = db_fetch_object($result)) {
$t = array($t); $marker = $m->marker;
} $markertid = $tid;
foreach ($t as $term) { if (!empty($marker)) {
$result = db_query('SELECT marker, tid FROM {gmap_taxonomy_term} WHERE tid = %d', $term); db_query("INSERT INTO {gmap_taxonomy_node} (nid, vid, tid, marker) VALUES (%d, %d, %d, '%s')", $node->nid, $node->vid, $markertid, $marker);
if ($m = db_fetch_object($result)) {
$marker = $m->marker;
$markertid = $m->tid;
} }
} }
} }
} }
if (!empty($marker)) {
db_query("INSERT INTO {gmap_taxonomy_node} (nid, vid, tid, marker) VALUES (%d, %d, %d, '%s')", $node->nid, $node->vid, $markertid, $marker);
}
} }
break; break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment