Need to remove JURI::root url from my custom module element

Need help with a WYSIWYG-editor in Joomla! 1.0.x? This is the place to be.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
sharojit
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sun May 25, 2014 4:29 am
Location: khulna, Bangladesh
Contact:

Need to remove JURI::root url from my custom module element

Post by sharojit » Mon Jun 23, 2014 4:54 pm

Need to remove the

Code: Select all

<img src="/path/http://farm4.staticflickr.com/3647/3435384001_9ed9864bb4_s.jpg" alt="title">
the

Code: Select all

 /path/ 
url in-front of the image url in my custom module.

Help will be helpful.

User avatar
H13
Joomla! Ace
Joomla! Ace
Posts: 1545
Joined: Sun Dec 10, 2006 6:39 pm
Location: Czech Republic
Contact:

Re: Need to remove JURI::root url from my custom module elem

Post by H13 » Fri Jun 27, 2014 3:27 pm

Hi, just try to use standard PHP method:

Code: Select all

$img = '<img src="/path/http://farm4.staticflickr.com/3647/3435384001_9ed9864bb4_s.jpg" alt="title">';

$imgNew = str_replace('/path/', '', $img);
(didn't test the code, so maybe there can be typo error)

Now the $imgNew variable should be:

Code: Select all

<img src="http://farm4.staticflickr.com/3647/3435384001_9ed9864bb4_s.jpg" alt="title">
Jan
- Phoca Cart - Joomla eCommerce App - https://www.phoca.cz/phocacart
- Phoca Gallery - powerful image gallery
- Phoca Restaurant Menu - https://www.phoca.cz/phocamenu
- Phoca Download - download manager for Joomla

sharojit
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sun May 25, 2014 4:29 am
Location: khulna, Bangladesh
Contact:

Re: Need to remove JURI::root url from my custom module elem

Post by sharojit » Thu Jul 10, 2014 6:06 pm

Hi Jan,

Thanks for your great reply & sorry for my delay. I was in hospital so that i missed. I will try this out asap

Thanks again for your reply.

Regards,
Sharojit

User avatar
H13
Joomla! Ace
Joomla! Ace
Posts: 1545
Joined: Sun Dec 10, 2006 6:39 pm
Location: Czech Republic
Contact:

Re: Need to remove JURI::root url from my custom module elem

Post by H13 » Fri Jul 11, 2014 10:01 pm

Ok
- Phoca Cart - Joomla eCommerce App - https://www.phoca.cz/phocacart
- Phoca Gallery - powerful image gallery
- Phoca Restaurant Menu - https://www.phoca.cz/phocamenu
- Phoca Download - download manager for Joomla

sharojit
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sun May 25, 2014 4:29 am
Location: khulna, Bangladesh
Contact:

Re: Need to remove JURI::root url from my custom module elem

Post by sharojit » Sat Jul 12, 2014 7:19 pm

Hey the main code is:

Code: Select all

<!--- load page Content -->
<div id="mate-flickr<?php echo $module->id; ?>" class="mate-flickr <?php echo $params->get('moduleclass_sfx') ?>">
	<ul id="mate-flickr" class="thumbs"></ul>	
</div>

<!--- Load Script -->
<script type="text/javascript">
jQuery(document).ready(function(){
	
	jQuery('#mate-flickr').jflickrfeed({
		limit: <?php echo $limit ?>,
		qstrings: {
			id: '<?php echo $id ?>'
		},
		itemTemplate: '<li>'+
						'<a class="colorbox" href="{{image}}" title="{{title}}">' +
							'<img src="{{image}}" alt="{{title}}" />' +
						'</a>' +
					  '</li>'
	}, function(data) {
		jQuery('#mate-flickr a').colorbox();
	});
	
});
</script>
And the HTML output is:

Code: Select all

<div id="mate-flickr116" class="mate-flickr ">
	<ul id="mate-flickr" class="thumbs"><li><a class="colorbox cboxElement" href="/practise/mod/http://farm4.staticflickr.com/3647/3435384001_9ed9864bb4.jpg" title="DSC_0660"><img src="/practise/mod/http://farm4.staticflickr.com/3647/3435384001_9ed9864bb4.jpg" alt="DSC_0660"></a></li></ul>	
</div>

<script type="text/javascript">
jQuery(document).ready(function(){
	
	jQuery('#mate-flickr').jflickrfeed({
		limit: 9,
		qstrings: {
			id: '00000000000'
		},
		itemTemplate: '<li>'+
						'<a class="colorbox" href="/practise/mod/{{image}}" title="{{title}}">' +
							'<img src="/practise/mod/{{image}}" alt="{{title}}" />' +
						'</a>' +
					  '</li>'
	}, function(data) {
		jQuery('#mate-flickr a').colorbox();
	});
	
});
</script>
I need to remove the "/practise/mod/" in-front of the "{{image}}" Can you help me with. I cannot solved the problem yet.

User avatar
H13
Joomla! Ace
Joomla! Ace
Posts: 1545
Joined: Sun Dec 10, 2006 6:39 pm
Location: Czech Republic
Contact:

Re: Need to remove JURI::root url from my custom module elem

Post by H13 » Wed Jul 16, 2014 2:48 pm

Hi, unfortunately, I am not javascript expert and this code is inside javascript, so in fact the same function like used in php should be used but the javascript functions :idea:

Jan
- Phoca Cart - Joomla eCommerce App - https://www.phoca.cz/phocacart
- Phoca Gallery - powerful image gallery
- Phoca Restaurant Menu - https://www.phoca.cz/phocamenu
- Phoca Download - download manager for Joomla


Locked

Return to “WYSIWYG Editors - 1.0.x”