Output filename only. 
Posted: 22 September 2008 09:53 AM   [ Ignore ]
Jr. Member
RankRank
Total Posts:  35
Joined  2008-05-16

Hello, I am trying to connect the module to a slideshow. Therefore I need to be able to output just the filename, not the whole path. How can I do that?

Profile
 
 
Posted: 22 September 2008 10:59 AM   [ Ignore ]   [ # 1 ]
Jr. Member
RankRank
Total Posts:  35
Joined  2008-05-16

I am trying this now. However it doesn’t work. It still outputs the full path :S

<img src="<?=$path = explode("/","{image_url}"); $filename=$path[count($path)-1]; echo($filename);?>" title="{title}" description="{caption}"/>

I really hope I can get this to work. It would open up some possibilities for the next project.

This does get the string into the path variable. But it doesnt explode it.

Profile
 
 
Posted: 22 September 2008 12:37 PM   [ Ignore ]   [ # 2 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

This could get sloppy, but what if you used the Find & Replace plugin?
You could have it remove the main part of the path… smile

Otherwise, I don’t believe there’s any built-in variables for this - not even for the Native EE Photo Gallery…

 Signature 
Profile
 
 
Posted: 23 September 2008 12:28 AM   [ Ignore ]   [ # 3 ]
Jr. Member
RankRank
Total Posts:  35
Joined  2008-05-16

Hi Pie Man, that did it! Thanks!

Profile