[maplab-users] links from map to jpg

charley cheng chengcharlie2003 at yahoo.ca
Wed Sep 1 12:15:03 EDT 2004


Hi! Kevin,
== is comparsion operator , || is logical operator Or
I modified a little bit of your code and put few explaination. Hope it will work. If not, please let me know.
Have a nice day!
 
Charlie
 


kgrootendorst at baird.com wrote:


Hi Charley, 
(I had to send this twice, because the maplab list bounced the first message back to me) 

Thanks for your help.  Unfortunately, I do not have the function working yet, but I feel I am close. 
In your posting, are the characters "==" and "||" valid php syntax? 
Also, your posting is just a portion of your query.phtml file right?  Or is that your entire query.phtml file? 

Below is my code, for the areas where I describe my columns of the attribute table.   Do you see any thing that appears incorrect? 
The URL (with photo name) to my jpegs is contained in the column "MS_PATH", the column "photo" contains only the photo name. 

// loop and use key for titles 

// $Key is equal to the attribute name, which is also the header of column
            foreach ($aRows[0] as $key => $value) 
            { 
              // The purpose of this if loop is to find the only attribute name we want to dispaly

                                  if (strcasecmp($key, "Long_DD") == "Long_DD"; 
                         strcasecmp($key, "Lat_DD") == "Lat_DD"; 
                         strcasecmp($key, "photo") == "photo"; 
                                                   
                        //******************************** 
                $szReturnValue .= "<td bgcolor=\"E2EFF5\"><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">".$key."</font></td>\n"; 
            } 

************************* 
// $xcell is the attribute value, in this case,when the $key attribute name is equal to "Long_DD" and "Lat_DD" only display the value of attribute.


 

                if (strcasecmp($key, "Long_DD") == "Long_DD"; 
                    strcasecmp($key, "Lat_DD") == "Lat_DD" ) 
                {$szReturnValue .= "<td bgcolor=\"#ffffff\"><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">". $xCell."</font></td>\n";} 


//when the attribute name is equal to photo, hyber link the according to the value of attribute, the attribute value of photo should be simliar as http://localhost/photoalbum/image.jpg  

//photoalbum folder with images is put at your web server.

                else if (strcasecmp($key, "photo") == "photo"; 
                         
                        
                
                {$szReturnValue .= "<td bgcolor=\"#ffffff\"> <a href=\"".$xCell."\"> Click here to document</a></td>\n";}           
                } 
                $szReturnValue .= "</tr>\n"; 
            } 

******************** 

Thanks! 

Kevin


______________________________
Baird 
Innovation, Excellence, & Service 
Oceans, Lakes & Rivers
Kevin Grootendorst 
905-845-5385 phone    905-845-0698 fax
627 Lyons Lane, Suite 200
Oakville, Ontario, Canada L6J 5Z7 
mailto:kgrootendorst at baird.com    http://www.baird.com/ 
______________________________




---------------------------------
Post your free ad now! Yahoo! Canada Personals
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/maplab-users/attachments/20040901/28f01dc8/attachment.htm


More information about the Maplab-users mailing list