Page 1 of 1

Add a slash before the address link to the image

Posted: 26 Feb 2015, 14:04
by rmk
Hi,

add a slash before the address link to the image in the description of the marker. Image

The path on the site looks wrong Image

Simply link to another site is working properly. The problem is with a link to an image on another site. Slash (/) turns into a double link, which is still prescribed my site

version Joomla 3.3.6

Re: Add a slash before the address link to the image

Posted: 27 Feb 2015, 01:04
by jumla3x_guy
Have you tried:

Code: Select all

<img src="images/logo-top.jpg" alt="" />

Re: Add a slash before the address link to the image

Posted: 27 Feb 2015, 11:20
by rmk
Picture is in another site.

Code: Select all

<img src="http://another-site/images/logo-top.jpg" alt="" />

Re: Add a slash before the address link to the image

Posted: 01 Mar 2015, 00:08
by Jan
Hi, try to see the database, the table Phoca Maps Markers - find the marker and see the description of it - which data you have here?

Are they with the slash or not?

Jan

Re: Add a slash before the address link to the image

Posted: 01 Mar 2015, 00:55
by rmk
Hi,

in database not slash. Slash only appears on the site after the publication and the only link to the image (in the control panel no slash)

Re: Add a slash before the address link to the image

Posted: 03 Mar 2015, 13:56
by Jan
Hi, please test:

OPEN:

administrator\components\com_phocamaps\helpers\phocamaps.php

and change
FROM:

Code: Select all

public static function fixImagePath($description) {
		
		$description = str_replace('<img src="'.JURI::root(true).'/', '', $description);// no double
		$description = str_replace('<img src="', '<img src="'.JURI::root(true).'/', $description);
		return $description;
	}
TO:

Code: Select all

public static function fixImagePath($description) {
		
		$description = str_replace('<img src="'.JURI::root(true).'/', '', $description);// no double
		$description = str_replace('<img src="', '<img src="'.JURI::root(true).'/', $description);
		
		// correct possible problems with full paths
		$description = str_replace('<img src="'.JURI::root(true).'/http://', '<img src="http://', $description);
		$description = str_replace('<img src="/http://', '<img src="http://', $description);
		return $description;
	}
Now, the external image should be displayed for you.

Please let me know if this helped, so I can add it to next version.

Thank you, Jan

Re: Add a slash before the address link to the image

Posted: 04 Mar 2015, 11:04
by rmk
Hi,

These changes have helped me. Now all is well. Thank you very much.

P.S.
I regret that I did not see your reply earlier and has already managed to convert 7 sites (rewrote markers and added all the pictures in the root of the site)

Re: Add a slash before the address link to the image

Posted: 06 Mar 2015, 15:20
by Jan
Ok, thank you for the information.

Jan

Re: Add a slash before the address link to the image

Posted: 23 Feb 2016, 23:00
by Jan
Hi, set in version 3.0.3

Jan