1 of 3
1
Plugin: Extract URL Plus
Posted: 09 August 2006 06:56 AM   [ Ignore ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1097
Joined  03-22-2006

This plugin has been rebuilt. Please visit this thread for version 2.

Written solely for the purpose of getting filenames from custom fields populated by the upload form in publish, this plugin can be used to display file type, path, domain, description and many other properties of the URL it finds.

Example usage:

{exp:extract_url_plus show="% filename.% extension (% filesize)"}
    Some text
, etc etc
    
<a href="http://www.example.com/directory/myphoto.jpg">My file</a>
    
Some more text?
{/exp:extract_url_plus}

REMOVE SPACE BETWEEN % AND VARIABLE NAME

This would return:

myphoto.jpg (4.87KB)

Available formatting variables to use within the “show” parameter are listed:

% fullurl     - The full url (e.g., “http://www.example.com/directory/myphoto.jpg”)
% protocol     - (e.g., “http” / “https” / “ftp” / “ftps”)
% subdomain     - (e.g., “www”)
% domain         - (e.g., “example”)
% tld         - (e.g., “com”)
% ip           - If the hostname is an IP address, it is available in this variable.
% path         - (e.g., “directory/”)
% filename     - (e.g., “myphoto”)
% extension     - (e.g., “jpg”)
% fullfilename   - (e.g., “myphoto.jpg”)
% hostname     - If an IP address, this will be identical to the &#xip; variable, if not it might contain e.g., “www.ecample.com”
% description   - A brief description of the file, based on extension type. This can be customised in the plugin file if needed
% filesize     - Shows a readable filesize with unit denomination. To use this feature you may need to open the plugin file and edit the line that looks like: var $docpath = ‘/var/www/html/’;

If you are upgrading from an older version:
The plugin will still honour the show parameter with a single variable, without the % sign.

Version 1.3.1

File Attachments
pi.extract_url_plus.zip  (File Size: 4KB - Downloads: 378)
 Signature 

(a.k.a the_butcher)

Profile
 
 
Posted: 15 August 2006 01:14 PM   [ Ignore ]   [ # 1 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6412
Joined  04-15-2006

Hi there,

Just came across this thread due to your other thread where people were asking for this functionality. Just to say thanks for the plugin but I was reading the documentation by going to the plugins section on my site and it said :

show=“xyz”

I was just wondering what this means? Do I have to place something specific in there for it to work such as the field name?

Thanks for any help with this and thanks for creating the plugin in the first place!

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 15 August 2006 02:55 PM   [ Ignore ]   [ # 2 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1097
Joined  03-22-2006

Sorry im a bit lame when it comes to documentation! You put in that parameter what you want to show from the matched file, eg.. filename/extension/domain eg.. show=“extension”

 Signature 

(a.k.a the_butcher)

Profile
 
 
Posted: 15 August 2006 02:57 PM   [ Ignore ]   [ # 3 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6412
Joined  04-15-2006

Hi there,

Don’t worry about the documentation side of things, do that myself a lot as well!! grin

Thanks for the explanation. Terrific little plugin and will definitely find a use for it on upcoming projects.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 16 August 2006 07:16 AM   [ Ignore ]   [ # 4 ]  
Research Assistant
RankRankRank
Total Posts:  978
Joined  06-13-2005

I tried this plugin (to understand what it can)

I wrote:

<b>filename: </b>

{exp:extract_url_plus show="filename"}
http
://www.example.com/files/testing/test.zip
{/exp:extract_url_plus}

<br/><br/>

according to:

{exp:extract_url_plus show=“xyz”} etc.. {/exp:extract_url_plus}


But I got:

filename: www.example.com

Not ‘test’.

 Signature 

tulks.com

Profile
 
 
Posted: 17 August 2006 01:17 PM   [ Ignore ]   [ # 5 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1097
Joined  03-22-2006

I was wondering when “& # 47 ;” would rear it’s ugly head again.. anyway, problem fixed and i’ve added some more options for the show=”” parameter just for fun.

 Signature 

(a.k.a the_butcher)

Profile
 
 
Posted: 17 August 2006 01:42 PM   [ Ignore ]   [ # 6 ]  
Research Assistant
RankRankRank
Total Posts:  978
Joined  06-13-2005

I uploaded your new 1.2 plugin, no other actions, I looked at it in the Plugin Manager only (intalled correctly, 1.2).

The same code (above), a new result:

domain: No URL Found

path: No URL Found

filename: No URL Found

extension: No URL Found

description: No URL Found

 Signature 

tulks.com

Profile
 
 
Posted: 17 August 2006 02:04 PM   [ Ignore ]   [ # 7 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1097
Joined  03-22-2006

My bad, try it now.

 Signature 

(a.k.a the_butcher)

Profile
 
 
Posted: 17 August 2006 02:20 PM   [ Ignore ]   [ # 8 ]  
Research Assistant
RankRankRank
Total Posts:  978
Joined  06-13-2005

yes, now absolutely correctly.

Maybe you find a couple of minutes to give 2 examples where it can be used (to activate my fantasy smile )

Thanks a lot.

 Signature 

tulks.com

Profile
 
 
Posted: 02 October 2006 01:29 PM   [ Ignore ]   [ # 9 ]  
Research Assistant
RankRankRank
Total Posts:  332
Joined  10-11-2004

Many thanks to the_butcher.  I thought I was going to have to do a hack to achieve and what joy to find you had taken all the pain out of the task.
grin

Profile
 
 
Posted: 01 November 2006 09:47 AM   [ Ignore ]   [ # 10 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1709
Joined  03-26-2006

Can I ask…is there a way to make this extension do a ‘relative’ URL extraction, or a file name with extension?

For example:

{exp:extract_url_plus show="relative"}{img_file}{/exp:extract_url_plus}


Would output: /images/img.jpg rather than http://www.mysite.com/images/img.jpg. I guess just lopping off the host? This will make this plugin a little friendlier with phpthumb.

Also, what about the full file?

{exp:extract_url_plus show="fullfilename"}{img_file}{/exp:extract_url_plus}


Would output: img.jpg rather than img. I can work around this using the show=“extension” coupled with show=“filename”, but the code is a little ungainly.

 Signature 

ryan masuga
—————
Masuga Design | Member, EE Pro Network
My EE Add-Ons | {devot:ee}
Twitter: masuga | masugadesign | devot_ee

Profile
 
 
Posted: 01 November 2006 09:59 AM   [ Ignore ]   [ # 11 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1097
Joined  03-22-2006

I’ve thought to myself, previously, that it would be alot more functional to pass the plugin say a “display” parameter with a value such as “path filename” which would then show exactly that, path followed by filename. One day, i will do it!

For now though i will quickly bodge in those two other show values, Give me a second.

 Signature 

(a.k.a the_butcher)

Profile
 
 
Posted: 16 April 2007 09:27 PM   [ Ignore ]   [ # 12 ]  
Summer Student
Avatar
Total Posts:  17
Joined  09-14-2006

How do I have this show more than one parameter? Like so:

{exp:extract_url_plus show="filename|extension"}http://www.website.com/images/image.jpg{/exp:extract_url_plus}

which would give: image.jpg

I cannot seem to get multiple parameters to work. Is this possible? What’s the correct syntax?

Profile
 
 
Posted: 17 April 2007 07:44 AM   [ Ignore ]   [ # 13 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1097
Joined  03-22-2006

I have updated, please re-download above.

 Signature 

(a.k.a the_butcher)

Profile
 
 
Posted: 17 April 2007 08:31 AM   [ Ignore ]   [ # 14 ]  
Summer Student
Avatar
Total Posts:  17
Joined  09-14-2006

the_butcher!

Three cheers to you! Now that is what I call service. Great work!!!!

Profile
 
 
Posted: 15 May 2007 09:25 AM   [ Ignore ]   [ # 15 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1097
Joined  03-22-2006

Updated bug with full stops (.) in file names mucking up the % extension variable.

 Signature 

(a.k.a the_butcher)

Profile
 
 
Posted: 27 May 2007 04:32 AM   [ Ignore ]   [ # 16 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  768
Joined  03-16-2002

***EDIT***

Upss ... ignore this post, please. I wrote:

I’d love to see a mode that doesn’t only look for URLs inside HTML tag parameters but in the full text of a field: ...

Seems, the plugin already should do what I’m looking for, but somehow doesn’t find my URLs, while others are working. Needs further investigation, will report…

-Markus

Profile
 
 
Posted: 01 June 2007 05:18 PM   [ Ignore ]   [ # 17 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  228
Joined  11-16-2004

Fantastic plugin, especially for making an template based edit form in conjunction with the File extension.

Anyway, I found a wee little bug. Apparently if the file name has a space in it, it returns nothing for filename.

Any hopes of a fix?

Thanks,

- T. Payton

 Signature 

T. Payton
OneCreative | Albuquerque, NM

Profile
 
 
Posted: 27 June 2007 04:28 AM   [ Ignore ]   [ # 18 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1097
Joined  03-22-2006

Updated.

Added a new parameter - url

If needed, and instead of utilising the plugin like in the example at top of topic, you can also use like so:

{exp:extract_url_plus url="http://www.example.com/directory/myphoto.jpg"}
    
<a href="{fullurl}" title="Download {fullfilename}">{filename}</a> ({filesize})
{/exp:extract_url_plus}

 Signature 

(a.k.a the_butcher)

Profile
 
 
   
1 of 3
1
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64535 Total Logged-in Users: 22
Total Topics: 81114 Total Anonymous Users: 14
Total Replies: 436444 Total Guests: 191
Total Posts: 517558    
Members ( View Memberlist )
Newest Members:  marlusbluespotmusicvolandspinhirnetheminiokostiamasterjeMBossbchaleyalvonsius