[maplab-users] Weblink to a column in a dbf file

Yifter Kidane Fikru fikru.yifter at unicatt.it
Tue Jun 1 10:16:35 EDT 2004


Dear all,
 
If you have a layer with dbf containing a column which is a link to other document (file or address), and would like to see this link in the query result, just do this:
 
edit your query.phtml somewhere:
 
// loop and add a cell for each result
                foreach ( $aRow as $xCell ) 
  {
      $szReturnValue .= "<td bgcolor=\"#ffffff\"><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">".$xCell."</font></td>\n";
  }
                $szReturnValue .= "</tr>\n";
            }
 
and replace it with:
 
// loop and add a cell for each result
                foreach ( $aRow as $xCell ) 
  {
   if (ereg("http", $xCell)) {
   $szReturnValue .= "<td bgcolor=\"#ffffff\"><font face=\"Arial, Helvetica, sans-serif\" size=\"2\"><A HREF=\"$xCell\" >Link</A></font></td>\n";
   }
   else
   $szReturnValue .= "<td bgcolor=\"#ffffff\"><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">".$xCell."</font></td>\n";
  }
                $szReturnValue .= "</tr>\n";
            }
 
the regula expression should be able to pick necessary elements from the link field, so that it turns true to make links.
 
I hope some of you might find this useful, as it can be extended to make anyother fields linked to other sources.
 
Ciao,
 
Fikru



More information about the Maplab-users mailing list