Changing the way Google Maps is integrated

Hi!
I'm trying to add a sentence to the Google Maps link. e.g.
Show the place of this photo on a Google Map
I got this working in two ways but both break the whole page if google_maps is deactivated.
Here is how I got it working:
`<?php if (function_exists('printImageMap')){ ?>Show the place of this photo on a<?php } printImageMap(); ?>`
or
`<?php if (function_exists('printImageMap')) {echo "Show the place of this photo on a ";} printImageMap(); ?>`

In the first case, when google_maps is deactivated I get a "PHP Parse error: syntax error, unexpected '{' "
In the second I get "PHP Fatal error: Call to undefined function printimagemap()".

So obviously my manipulation of the if-clause breaks it when returning false. Can you help me fixing this?
Also if this can be easily fixed, can it be internationalized? I tried using gettext with the echo version of the above but that didn't work.
Obviously my knowledge of php is next to no existant.
Sorry if this should have fitted better in the plug ins section.

Comments

  • Maybe you need to do a little refresher course on PHP. If you want to condition statements with an if statement, all the statements you wish executed must be within the braces. In your case above, only the echo statement is conditioned by the function_exists test.

    BTW: you really should look at the function documentation. You can include the text to display as a parameter to the function.

    The themeing guide discusses localization.
Sign In or Register to comment.