We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Plugin: Extract URL Plus

Development and Programming

Daniel Walton's avatar
Daniel Walton
553 posts
18 years ago
Daniel Walton's avatar Daniel Walton

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

       
ms's avatar
ms
274 posts
about 18 years ago
ms's avatar ms

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

       
tpayton's avatar
tpayton
172 posts
about 18 years ago
tpayton's avatar tpayton

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
       
Daniel Walton's avatar
Daniel Walton
553 posts
17 years ago
Daniel Walton's avatar Daniel Walton

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="http://{fullurl}" title="Download {fullfilename}">{filename}</a> ({filesize})
{/exp:extract_url_plus}
       
bjsteiger's avatar
bjsteiger
87 posts
17 years ago
bjsteiger's avatar bjsteiger

With this can you tell it which path to pull: for example

http://www.domain.com/path1/path2/myphoto.jgp

I am needing to pull only the first path1

thanks bjs

       
Daniel Walton's avatar
Daniel Walton
553 posts
17 years ago
Daniel Walton's avatar Daniel Walton

Not yet, though I may look into this along with some minor bug fixes for a later version. Watch this space.

       
sherrills's avatar
sherrills
26 posts
17 years ago
sherrills's avatar sherrills

I’m trying to use this plugin with phpThumb. phpThumb is a thumbnail generator that creates thumbnail images via a URL.

Basically I allow a user to upload an image.

This is the code i’m using now to try and display that image - obviously src is wrong

<a href="http://{url_title_path=" title="{title}"> {custom_tag}&w=108&h=94</a>

How would i use extract URL to display the path before the {custom_tag} parameter?

In other words, can extract URL spit out something like:

<a href="http://{url_title_path=" title="{title}"> /images/uploads/filename.jpg&w=108&h=94</a>
       
Daniel Walton's avatar
Daniel Walton
553 posts
17 years ago
Daniel Walton's avatar Daniel Walton

Sorry Sherills, not quite sure I follow?

{custom_tag} contains your url?

If so, try:

{exp:extract_url_plus url="{custom_tag}"}
<a href="http://{url_title_path=" title="{title}">_    /{path}{fullfilename}&w=108&h=94_</a>
{/exp:extract_url_plus}
       
sherrills's avatar
sherrills
26 posts
17 years ago
sherrills's avatar sherrills

I’m sorry, I wasn’t very clear.

I am currently using the “extract_url” plugin in conjunction with phpThumb (a thumbnail generator), but the basic “extract_url” (not extract_url_plus) seems very limited in what it can do.

Here is exactly what my code currently looks like:

<a href="http://{url_title_path=" title="{title}">/phpThumb/phpThumb.php?src={exp:extract_url}{art_upload}{/exp:extract_url}&w=108&h=94</a>

{art_upload} is simply a custom field in which a user can submit his/her artwork - so it’s an image file.

With this current set up, when I view the source of the image that is created, the path looks like this:

http://www.mydomain.com/phpThumb/phpThumb.php?src=http://www.mysite.com/images/uploads/filename.jpg&w=108&h=94

Instead what I want it to display is:

http://www.mydomain.com/phpThumb/phpThumb.php?src=/images/uploads/filename.jpg&w=108&h=94

So that the src is local instead of the full path. Is this possible with extract_url_plus and if so, what would that look like?

Thanks so much for helping with this.

       
Daniel Walton's avatar
Daniel Walton
553 posts
17 years ago
Daniel Walton's avatar Daniel Walton

Ah right - in that case my example above should be all that you require I believe 😊

       
sherrills's avatar
sherrills
26 posts
17 years ago
sherrills's avatar sherrills

I tried using the following and it didn’t work, I get a “No URL Found” message.

Here’s my exact code:

{exp:extract_url_plus url="{art_upload}"} <a href="http://{url_title_path=" title="{title}">http://www.visualdiner.com/phpThumb/phpThumb.php?src=/images/uploads/{fullfilename}&w=108&h=94</a>{/exp:extract_url_plus}

I know that’s not right - but how would it look?

       
Daniel Walton's avatar
Daniel Walton
553 posts
17 years ago
Daniel Walton's avatar Daniel Walton

Sherills,

Are you using the latest version?

       
sherrills's avatar
sherrills
26 posts
17 years ago
sherrills's avatar sherrills

I’m using version 1.3.1

       
sherrills's avatar
sherrills
26 posts
17 years ago
sherrills's avatar sherrills

Is 1.3.1 the latest version? If not where can i get the latest?

Also, was there anything wrong with my code?

{exp:extract_url_plus url="{art_upload}"} <a href="http://{url_title_path=" title="{title}">http://www.visualdiner.com/phpThumb/phpThumb.php?src=/images/uploads/{fullfilename}&w=108&h=94</a>{/exp:extract_url_plus}
       
hothousegraphix's avatar
hothousegraphix
851 posts
17 years ago
hothousegraphix's avatar hothousegraphix

Hi, I just installed this extension because I’m interested in using only the file name (and it’s extension) that is associated with a custom field I’ve created for uploading images.

Currently my custom field tag returns the full path to the file; e.g http://www.my site.com/images/uploads/16.jpg.

I would rather not use the full path to the image. I was hoping that I could use this plugin to grab only the filename and file extension and append the last segment of a relative path to make the path dynamic; e.g.

/index.php/images/uploads/{exp:extract_url_plus show=</pre>

<p>The trouble I’m experiencing is that when I place these tags within my EE weblog tag the plugin returns <b>% filename.% extension (% filesize)</b> rather then the actual data.</p>

<pre><code>//testing with
{exp:weblog:entries orderby="date" sort="desc" limit="12" weblog="myBlog" }
{exp:extract_url_plus show="% filename.% extension (% filesize)"}
{custom_upload_field}
{/exp:extract_url_plus}
{/exp:weblog:entries}

Would it be possible to tell me if I’m formatting this correctly.

When I test the plugin on a URL directly (not a variable) it works as I expect it to. When I drop in a custom field variable it does not.

I’m using the following version Extract URL Plus (v.1.3.1).

       
1 2 3 4

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.