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

uou must remove the space between the % and the name of variable. (the forums here don’t like ” &#xth;is “)

       
hothousegraphix's avatar
hothousegraphix
851 posts
17 years ago
hothousegraphix's avatar hothousegraphix

Thank you very much, that was it.

       
eware3000's avatar
eware3000
11 posts
17 years ago
eware3000's avatar eware3000

Hi, I’m having the same problem as sherrills (above) and am also using this in conjunction with phpThumb. I’m sot sure I saw a solution for the problem.

The old extract url works fine with phpThumb, it just gives you the full url to the image. But for better performance, I’d like to use relative paths instead of absolute.

Here is my code:

/images/phpThumb/phpThumb.php?src={exp:extract_url_plus show=

The custome field {myimage) contains a url.

What I want is for extract url to strip the image url from “http://www.mysite.com/uploads/images/myimage.jpg” to “/uploads/images/myimge.jpg”

Am I using this correctly?

       
Daniel Walton's avatar
Daniel Walton
553 posts
17 years ago
Daniel Walton's avatar Daniel Walton
{exp:extract_url_plus url="http://www.mysite.com/uploads/images/myimage.jpg"}
/images/phpThumb/phpThumb.php?src=/{path}{fullfilename}
{/exp:extract_url_plus}
       
eware3000's avatar
eware3000
11 posts
17 years ago
eware3000's avatar eware3000

butcher.

How am I to know the exact url? (extract_url_plus url=”…..”)These are image people have uploaded.

{exp:extract_url_plus url="http://www.mysite.com/uploads/images/myimage.jpg"}
/images/phpThumb/phpThumb.php?src=/{path}{fullfilename}
{/exp:extract_url_plus}
       
Daniel Walton's avatar
Daniel Walton
553 posts
17 years ago
Daniel Walton's avatar Daniel Walton

Just put url=”{your_custom_field}”

       
eware3000's avatar
eware3000
11 posts
17 years ago
eware3000's avatar eware3000

Here’s my code:

{exp:extract_url_plus url="{myimage}"}
/images/phpThumb/phpThumb.php?src=/{path}{myimage}
{/exp:extract_url_plus}

This says No url Found.

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

Hmm, perhaps try the alternative implementation:

{exp:extract_url_plus show="/images/phpThumb/phpThumb.php?src=/% path % fullfilename"}
{myimage}
{/exp:extract_url_plus}

(Removing spaces between % and variable name)

       
Joobs's avatar
Joobs
362 posts
17 years ago
Joobs's avatar Joobs

I am having problems getting filesize to work, it seems to return nothing. I have got the filesizer plugin to work, but I would really like to use this one instead because I want to extract the filename too.

Do you have any ideas why this is? Could it be a server problem?

I’ve changed the docpath in the file to my document root…

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

Do you have an odd setup? I can’t see why this would normally fail.

Can you provide a URL to an example file, your document root, and where in your file system the file resides - a PM will do if you’re uncomfortable revealing that kind of information on a public board.

       
Joobs's avatar
Joobs
362 posts
17 years ago
Joobs's avatar Joobs

Does the filesize work if you give an exact url (http://www.site.com/files/file.pdf), or do you need to use realtive URLS (/files/file.pdf)?

I think the php filesize() method only works with relative URLs and i’ve been testing your plugin using absolute URLs. So that might be the problem?

Now i have started using relative URLs I am getting “No URL Found” error, so I guess I have setup the paths incorrectly.

currently the directory+filename is a custom field “https://ellislab.com/asset/images/team-photo/file.pdf” and outputs “/files/file.pdf”. This works fine with EE for linking to images etc, but extract_url_plus doesnt seem to like it.

I’ll experiment for a bit…

edit Does this plugin require the http://domain.com to be in the file path in order to work? I can get it working (including filesize) using

{exp:extract_url_plus show="% path % fullname % filesize"}
http://www.domain.com{custom_field}
{/exp:extract_url_plus}

but strangely having an absolute URL of http://www.domain.com/files/file.pdf doesnt return the file size?

       
Joobs's avatar
Joobs
362 posts
17 years ago
Joobs's avatar Joobs

Another question, Is it possible to show no decimal places? setting filesize_precision to 0 seems to go back to the default of 2.

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

Hi joobs,

You must give the plugin a full url, it won’t recognise a path, e.g., “/files/file.pdf”.

If you supply “http://www.example.com/files/file.pdf” and you’ve set the document root to say “/var/www/html/”, the plugin will assume the file lives at “/var/www/html/files/file.pdf” and check first if it exists and what the size is if it does.

       
APGWest's avatar
APGWest
295 posts
17 years ago
APGWest's avatar APGWest

Hey butcher,

Awesome plugin(!!) but spaces in the filename still cause a “No URL Found” to show.

Is there a way that we can show a generic image for, say, Word docs? I’m using this along with Mark’s File plugin and am displaying both images and Word docs and would like an icon for the Word docs.

Thanks again for an awesome tool!!

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

Hi svh1,

Can’t help regarding the spaces thing (filenames should not include spaces). As for the word doc icon? Sure just make one and dump it in with the rest of the icons that come with the file extension.

       
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.