| 254 |
* Export |
* Export |
| 255 |
********/ |
********/ |
| 256 |
|
|
| 257 |
|
// Outputs RDF logo on the taxonomy links if there's an URI for the tag |
| 258 |
|
function moat_link_alter(&$node, &$links) { |
| 259 |
|
$nid = $node->nid; |
| 260 |
|
// Image path |
| 261 |
|
$path = drupal_get_path('module', 'moat'); |
| 262 |
|
// Need to duplicate the array to insert new links at the right place |
| 263 |
|
$newlinks = array(); |
| 264 |
|
foreach ($links as $module => $link) { |
| 265 |
|
$newlinks[$module] = $link; |
| 266 |
|
if (strstr($module, 'taxonomy_term') && strpos($module, 'rdf')===FALSE) { |
| 267 |
|
$uri = db_result(db_query("SELECT DISTINCT mm.uri as uri FROM {moat_meanings} mm, {term_data} td WHERE mm.tid = td.tid AND mm.nid = '$nid' AND td.name = '".$link['title']."$tag'")); |
| 268 |
|
if($uri) { |
| 269 |
|
$rdflink = $link; |
| 270 |
|
$rdflink['href'] = $uri; |
| 271 |
|
$rdflink['title'] = theme('image', $path.'/rdf-icon.png', $uri); |
| 272 |
|
$rdflink['html'] = true; |
| 273 |
|
$newlinks[$module.'_rdf'] = $rdflink; |
| 274 |
|
} |
| 275 |
|
} |
| 276 |
|
} |
| 277 |
|
$links = $newlinks; |
| 278 |
|
} |
| 279 |
|
|
| 280 |
// This method is called by the sioc:module to provide a sioc:topic link to the URIs |
// This method is called by the sioc:module to provide a sioc:topic link to the URIs |
| 281 |
function moat_get_uris($nid) { |
function moat_get_uris($nid) { |
| 282 |
$res = db_query("SELECT uri FROM {moat_meanings} WHERE nid='$nid'"); |
$res = db_query("SELECT uri FROM {moat_meanings} WHERE nid='$nid'"); |