0

I'll try get you up to speed and keep it in scope .. I have a Joomla site with a SEF extension that only supports absolute image linking (relative links result in bad URLs). The SEF extension developers are looking into the issue.

Problem being, the site is live and I would really like a 'quick fix' until then (without disabling hundreds of SEF URLs).

Right, I've sorted out all of the sites image URLs except for one module from RocketTheme. Here's the code snippet that produces the image URL:

<img src="<?php echo $item->thumb;?>" alt="<?php echo $item->title; ?>"<?php echo $size; ?> />

I've tried changing it to the following, although a relative URL is still produced:

<img src="http://digital-diy.com/<?php echo $item->thumb;?>" alt="<?php echo $item->title; ?>"<?php echo $size; ?> />

Could someone please help me with producing an absolute URL from the above code?

1 Answer 1

3

Assuming that the $item->thumb variable contains a string along the lines of ../../images/some_image.png, you could do this:

$components = pathinfo($item->thumb); $image = $components['basename'];

That will give you the name of the file.

http://php.net/manual/en/function.pathinfo.php

Sign up to request clarification or add additional context in comments.

1 Comment

Also, check out this question: stackoverflow.com/questions/5653859/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.