Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2007-12-05 21:08:40

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,485
Website GitHub

Re: smd_remote_file: Manage remote URL downloads via TXP's Files tab

A minor mod to take the plugin to v0.31. Mainly of use to those people at the bleeding edge of TXP development who keep their changesets up-to-date.

Mary kindly patched the core (r2720) to address point 1) of my last post. As a consequence, this rev of the plugin now checks if the file has already been denied access and gracefully does nothing in this eventuality, handing back to TXP to take action.

When 4.0.6 is released with this changeset a permanent feature I’ll revisit the plugin and strip out the unnecessary status-checking functionality for good.

Last edited by Bloke (2007-12-05 21:11:02)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#17 2007-12-13 00:19:06

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,485
Website GitHub

Re: smd_remote_file: Manage remote URL downloads via TXP's Files tab

An enhancement to the ifmissing attribute: you can now use an image to indicate a missing file download image(!)

Specify ifmissing="?image:42" if you want to refer to the image by id, or use something like ifmissing="?image:PicNotHere.jpg" to use an image name. Note the image has to be in the TXP database and if you reference an image that doesn’t exist, you’ll get nothing back. The online help details the new option.

IMPORTANT: In light of this change, I adjusted the naming of the argument used in v0.31 and below. Instead of ifmissing="?file" being the default, it is now ifmissing="?ref". The ‘?file’ version is no longer used, since it might imply you could replace the missing file with another file from the Files tab, which is not the case! Sorry for the inconvenience.

Enjoy v0.32 and shout if you spot anything, good or bad.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#18 2008-02-03 01:13:48

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,485
Website GitHub

Re: smd_remote_file: Manage remote URL downloads via TXP's Files tab

A new version is out to coincide with the release of TXP v4.0.6.

!! v0.4 (compressed) is for TXP 4.0.6 and higher ONLY !!

Running it on any prior version will result in an ugly warning message on the Files tab.

Enhancements in this version:

  • Better upload support. When editing a .link remote file you can now upload an additional URL directly from the edit screen, optionally overwriting all other URLs if you wish
  • Reduced the timeout to try and avoid horrible error messages when remote servers take too long to respond to a file size request. Not sure if it’s fixed as the server I’m testing it against is working fine :-\
  • Removed the hack that checks the file status, since Mary kindly updated the core to handle it
  • Slightly improved error messages thanks to some language updates in the core

Known issue:

  • If editing a “normal” file (not a .link) and you hit the Upload button without specifying a file, the URL upload box does not appear on the File List page. Hitting the Files tab again or performing some other action re-instates it. *shrug* no idea why but it’s not a major hassle. If anyone has any clues, please let me know.

Enjoy, and report anything squiffy here as always.

Last edited by Bloke (2008-02-03 01:14:44)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#19 2008-04-02 10:32:28

aswihart
Member
From: Pittsburgh, PA
Registered: 2006-07-22
Posts: 345
Website

Re: smd_remote_file: Manage remote URL downloads via TXP's Files tab

Just got around to trying out smd_remote_file, great work Stef. Not sure why but my remote file links still have the .link attached to them, I even tried adding the attribute show_link="0" to no avail. Any ideas?

BTW, I have your plugin working with Amazon S3 now, just like I had dreamed (hehe). Now I include S3-hosted files in article-specific file download lists using upm_file along with the download count tracker built-in to Textpattern. See my Final Rotation movie page for an example. Now I just need to figure out how to load the FLV player with different files by clicking on links (along with the regular links to the files). Thanks a lot!

Last edited by aswihart (2008-04-02 10:44:28)

Offline

#20 2008-04-02 16:07:11

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,485
Website GitHub

Re: smd_remote_file: Manage remote URL downloads via TXP's Files tab

aswihart wrote:

Not sure why but my remote file links still have the .link attached to them,

Y’know, the other day I spotted that too and thought it must have been my setup but I just checked and it’s gotta be something that screwed up in the latest version (or maybe something subtle changed in TXP4.0.6 that I have to compensate for). Thing is, when I modded the plugin to make it work with 4.0.6 I didn’t touch that bit of the code. Hmmm, I’ll see if I can figure out what I’ve done wrong and post a fix sharpish.

Thanks for the confirmation that it’s not just me going slowly mad. Unlike the guy in Final Rotation :-)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#21 2008-04-02 16:54:01

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,485
Website GitHub

Re: smd_remote_file: Manage remote URL downloads via TXP's Files tab

Heh, or it could be me being a total tool.

Try v0.41 [ compressed ] which adds the smd_file_download_name tag. Sometimes I’m such a dilbert; fancy offering an option to remove the .link from the URL and forgetting to add an option to allow you to remove the .link from the file name that you display to visitors, duh!

Under TXP4.0.6 you should now be able to use smd_file_download_link and smd_file_download_name; both tags in their default configuration will remove the .link. Add show_link="1" to re-instate it (or use the built-in file_download_* tags).

Sorry about my dimness. Let me know if that gets you going.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#22 2008-04-02 18:35:57

aswihart
Member
From: Pittsburgh, PA
Registered: 2006-07-22
Posts: 345
Website

Re: smd_remote_file: Manage remote URL downloads via TXP's Files tab

Works great Bloke, thanks so much for this awesome plugin.

Offline

#23 2008-04-09 09:01:53

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,485
Website GitHub

Re: smd_remote_file: Manage remote URL downloads via TXP's Files tab

Minor bug fix for handling of the .link extension in smd_file_download_link. Sometimes the .link was left behind.

v0.42 [ compressed ]


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#24 2008-05-01 10:31:01

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

Re: smd_remote_file: Manage remote URL downloads via TXP's Files tab

Bloke – which file services have you used (apart from fileden) with this plugin?

does it only work with the services that allow a direct link to the file (as opposed to the ones that make you wait 30 seconds, etc)?

Offline

#25 2008-05-01 10:52:03

aswihart
Member
From: Pittsburgh, PA
Registered: 2006-07-22
Posts: 345
Website

Re: smd_remote_file: Manage remote URL downloads via TXP's Files tab

I would think you could use it with anything, the ones that “make you wait 30 seconds” or whatever usually have a direct link somewhere on that “waiting” page that you could copy and paste.

Offline

#26 2008-05-01 10:54:46

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,485
Website GitHub

Re: smd_remote_file: Manage remote URL downloads via TXP's Files tab

nardo wrote:

does it only work with the services that allow a direct link to the file (as opposed to the ones that make you wait 30 seconds, etc)?

Yes I believe so; I’ve only used fileden in anger because they allow direct URLs. I would suspect any services with a time-out system in place would fail, however, sites that allow you to protect your files with a password should work, and prompt for p/w on download. Untested.

EDIT: As aswihart says, if you can hack the URL out of the ‘please wait’ page then even better. If it’s that simple why doesn’t everyone do it :-)

Last edited by Bloke (2008-05-01 10:59:38)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#27 2008-05-02 22:46:09

aswihart
Member
From: Pittsburgh, PA
Registered: 2006-07-22
Posts: 345
Website

Re: smd_remote_file: Manage remote URL downloads via TXP's Files tab

Bloke, just wanted to say, this is the dream plugin for me, you really outdid yourself. I spend an extra few cents each month with Amazon S3 to host a few movie files for my site. The number of files will continue to grow over time, meanwhile, I may actually downgrade my web hosting to the very minimal one with very low storage space. Most place give you like 10 gigs, I use “A Small Orange” (amazing customer service) and they give me just 400mb on a $5 / month plan. I’m thinking with your plugin I could get by with the “Tiny plan” that gives 75mb for $25 / year, not a huge savings probably, but cool nonetheless.

Do you think you could extend the plugin or write another one to work with remote images as well, retaining all the images functionality in Txp? That would be really sweet.

Last edited by aswihart (2008-05-02 22:47:30)

Offline

#28 2008-05-05 12:10:55

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,485
Website GitHub

Re: smd_remote_file: Manage remote URL downloads via TXP's Files tab

aswihart wrote:

this is the dream plugin for me, you really outdid yourself.

:-) Glad it’s useful. Certainly helps me out, as I have a fairly low bandwidth hosting plan too.

Do you think you could extend the plugin or write another one to work with remote images as well

I did consider it, and may still find a way to extend it for images as well. I wasn’t sure the bandwidth saving would be worth it — which is one of the reasons I went for the big fish of the Files tab first — but I guess with image-heavy or photography sites the bandwidth mounts up.

The only tricky part is that images don’t have the concept of file_download and with so many image/gallery plugins out there it would mean either a dedicated tag (which would be a direct replacement for <txp:image> and thus potentially rather limiting) or intercepting any image calls to the database from any image plugin. Not sure if that’s possible but I’ll certainly look into it when I have time and see if it’s feasible.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#29 2008-06-09 15:49:10

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: smd_remote_file: Manage remote URL downloads via TXP's Files tab

oh sweet sugary balls bloke this is a great plugin! i’ve been away for a while but this was worth coming back to!

Offline

#30 2008-06-09 22:31:39

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,485
Website GitHub

Re: smd_remote_file: Manage remote URL downloads via TXP's Files tab

iblastoff wrote:

this is a great plugin! i’ve been away for a while but this was worth coming back to!

Thanks, and no probs. Glad it’s useful.

Good to see you back. I’ve been recommending your plugins to a whole bunch of people who have contacted me these past few months about image management and improving the admin experience.

P.S. you may have missed smd_query and smd_vars. Might be worth a look, even if it’s to scoff at the code or suggest improvements.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB