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
Tags 7.x-2.10-rc1
No related merge requests found
......@@ -129,24 +129,18 @@ function gmap_taxonomy_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
$status = variable_get('gmap_taxonomy_vocabs', array());
$marker = '';
if (isset($node->taxonomy) && is_array($node->taxonomy)) {
foreach ($node->taxonomy as $voc => $terms) {
if (isset($status[$voc]) && $status[$voc]) {
$t = $terms;
if (!is_array($t)) {
$t = array($t);
}
foreach ($t as $term) {
$result = db_query('SELECT marker, tid FROM {gmap_taxonomy_term} WHERE tid = %d', $term);
if ($m = db_fetch_object($result)) {
$marker = $m->marker;
$markertid = $m->tid;
foreach ($node->taxonomy as $tid => $term) {
if (isset($status[$term->vid]) && $status[$term->vid]) {
$result = db_query('SELECT marker, tid FROM {gmap_taxonomy_term} WHERE tid = %d', $tid);
if ($m = db_fetch_object($result)) {
$marker = $m->marker;
$markertid = $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);
}
}
}
}
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;
......
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