Hi,
I'm trying to dynamically change parts of an array.
This is the array:
It's a Joomla! 1.5.x website.
The I get the array by using the following code:
I want to change parts of the array because the array is used to display the following code:
I want to change this into:
I've been trying several things and I found a 1001 pages that tell me how to "unset" certain bits of the array, for instance http://www.eboga.org/cms/joomla/how-to-remove-mootoolsjs-and-captionjs-from-joomla15.html. I found but I can't get that to work either.
I just can't figure out how to dynamically "add" the domain to the file location. I either end up over writing the "text/javascript" bit with the domain or I end up with just one edited line and all the other lines are removed from the array.
Any help or any pointers into the right direction would be greatly appreciated.
I'm trying to dynamically change parts of an array.
This is the array:
Code:
Array ( [/components/com_jcomments/js/jcomments-v2.1.js?v=7] => text/javascript [/components/com_jcomments/libraries/joomlatune/ajax.js?v=3] => text/javascript [/media/system/js/mootools.js] => text/javascript [/media/system/js/caption.js] => text/javascript )
It's a Joomla! 1.5.x website.
The I get the array by using the following code:
Code:
$headerstuff = $this->getHeadData();
$scripts = $headerstuff['scripts'];
print_r ($scripts);
I want to change parts of the array because the array is used to display the following code:
Code:
<link rel="stylesheet" href="/components/com_jcomments/tpl/custom/style.css?v=12" type="text/css" />
<script type="text/javascript" src="/components/com_jcomments/js/jcomments-v2.1.js?v=7"></script>
<script type="text/javascript" src="/components/com_jcomments/libraries/joomlatune/ajax.js?v=3"></script>
<script type="text/javascript" src="/media/system/js/mootools.js"></script>
<script type="text/javascript" src="/media/system/js/caption.js"></script>
I want to change this into:
Code:
<link rel="stylesheet" href="[URL unfurl="true"]http://www.mydomain.com/components/com_jcomments/tpl/custom/style.css?v=12"[/URL] type="text/css" />
<script type="text/javascript" src="[URL unfurl="true"]http://www.mydomain.com/components/com_jcomments/js/jcomments-v2.1.js?v=7"></script>[/URL]
<script type="text/javascript" src="[URL unfurl="true"]http://www.mydomain.com/components/com_jcomments/libraries/joomlatune/ajax.js?v=3"></script>[/URL]
<script type="text/javascript" src="[URL unfurl="true"]http://www.mydomain.com/media/system/js/mootools.js"></script>[/URL]
<script type="text/javascript" src="[URL unfurl="true"]http://www.mydomain.com/media/system/js/caption.js"></script>[/URL]
I've been trying several things and I found a 1001 pages that tell me how to "unset" certain bits of the array, for instance http://www.eboga.org/cms/joomla/how-to-remove-mootoolsjs-and-captionjs-from-joomla15.html. I found but I can't get that to work either.
I just can't figure out how to dynamically "add" the domain to the file location. I either end up over writing the "text/javascript" bit with the domain or I end up with just one edited line and all the other lines are removed from the array.
Any help or any pointers into the right direction would be greatly appreciated.