/[drupal]/contributions/modules/moat/moat.module
ViewVC logotype

Diff of /contributions/modules/moat/moat.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.4, Tue Jan 22 12:11:21 2008 UTC revision 1.5, Tue Jan 22 13:31:51 2008 UTC
# Line 254  function moat_ping_server($tag) { Line 254  function moat_ping_server($tag) {
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'");

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.2