Forum Moderators: coopster
echo "var marker = createMarker(point, '<div id=\"infowindow\" style=\"white-space: nowrap;\"><b>" . $row ['type'] . "</b><br>" . $row['desc'] . "<br>Latitude " .$row['lat'] . "<br>Longitude " . $row['lon'] . "<br><img src=" . $row ['thumbnail'] . " width=300 height=225><br>Submitted by " . $row['name'] .
"</div>');\n";
echo "var marker = createMarker(point, '<div id=\"infowindow\" style=\"white-space: nowrap;\"><b>" . $row ['type'] . "</b><br>" . $row['desc'] . "<br>Latitude " .$row['lat'] . "<br>Longitude " . $row['lon'];
if ($row ['thumbnail']!= "") { /* ...or whatever condition... */
echo "<br><img src=" . $row ['thumbnail'] . " width=300 height=225>"
} echo "<br>Submitted by " . $row['name'] .
"</div>');\n";
I hope this helps,
Salsa
_________
echo "var marker = createMarker(point, '<div id=\"infowindow\" style=\"white-space: nowrap;\"><b>" . $row ['type'] . "</b><br>" . $row['desc'] . "<br>Latitude " .$row['lat'] . "<br>Longitude " . $row['lon']; if (!empty($row['thumbnail']))
{echo "<br><img src=" . $row ['thumbnail'] . " width=300 height=225>";}echo "<br>Submitted by " . $row['name'] . "</div>');\n";
A slightly cleaner and more efficient way to do what you are doing would be to build a variable something like this:
$output = "";
$output = "var marker = createMarker(point, '<div id=\"infowindow\" style=\"white-space: nowrap;\"><b>" . $row ['type'] . "</b><br>" . $row['desc'] . "<br>Latitude " .$row['lat'] . "<br>Longitude " . $row['lon'];
if ($row ['thumbnail']!= "") { /* ...or whatever condition... */
$output .= "<br><img src=" . $row ['thumbnail'] . " width=300 height=225>"; $output .= "<br>Submitted by " . $row['name'] . "</div>');\n";
echo $output
echo "var marker = createMarker(point, '<div id=\"infowindow\" style=\"white-space: nowrap;\"><b>" . $row ['type'] . "</b><br>" . $row['desc'] . "<br>Latitude: " .$row['lat'] . "<br>Longitude: " . $row['lon']; if (!empty($row['thumbnail']))
{echo "<br><a href=" .$row ['slideshow'] . " target=_blank><img src=" . $row ['thumbnail'] . " width=300 height=225></a>";}echo "<br>Submitted by: " . $row['name'] . "</div>');\n";