Coder Social home page Coder Social logo

sgiovagnoli / yourls-upload-and-shorten Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fredl99/yourls-upload-and-shorten

0.0 2.0 0.0 43 KB

YOURLS plugin: Upload files to your webserver and create short-URLs to them in one step.

Home Page: https://fredl99.github.io/YOURLS-Upload-and-Shorten/

PHP 100.00%

yourls-upload-and-shorten's Introduction

YOURLS Plugin: Upload and Shorten

Plugin for YOURLS (version 1.7 or newer)

Description

This plugin lets you upload a file to your webserver and automagically creates a YOURLS short-URL for it. Then you can share that file by its short link as well as its full URL.

Features

  • Different ways to change the filename during the upload
  • Make a note about it for yourself in the YOURLS database (by default the title field is filled with the original filename and the alteration method)
  • Keep track of views/downloads via YOURLS´s history function
  • Localization support (currently: English, Spanish, German, Simplified Chinese, more to come with the help of volounteers...)

Requirements

What you need:

  • A webserver with PHP support
  • A functional installation of YOURLS
  • This Plugin ;-)
  • A bit of understanding what it does and what you can do with it ;-)

Installation

  • Navigate to the folder ./user/plugins/ inside your YOURLS-install directory

  • Use any of these two ways to install:

    • Either clone this repo using git
    • or create a new folder named ´Upload-and-Shorten´, then download all files from here into that directory.
  • Prepare your configuration:

    • If necessary create a directory where your files can be accessed from the webserver (i.e '/full/path/to/httpd/directory/')
    • Depending on your webserver´s setup you may have to modify the permissions of that directory:
      • Make sure your webserver has read+write permissions for it. Explaining that is beyond the scope of this readme, please refer to the manual of your server, operating system or hosting provider. On a Linux box something like
        chown :www-data /full/path/to/httpd/directory && chmod g+rwx /full/path/to/httpd/directory
        should do the trick, but please don't rely on it.
        A correct server configuration is important for its functionality, but essential for its safety!
    • Now open ./user/config.php in your YOURLS-directory with any text editor and ...
      • add these definition lines and save the file:
        # Paths for plugin: "Upload-and-Shorten":
        # The web URL path where YOURLS short-links will redirect to:
        define( 'SHARE_URL', 'http://my.domain.tld/directory/' );
        # The physical path where the plugin drops your files into:
        define( 'SHARE_DIR', '/full/path/to/httpd/directory/' ); (Adjust paths to your needs...)
  • Go to the Plugins Administration Page (eg. http://sho.rt/admin/plugins.php) and activate the plugin.

  • Have fun!

  • Consider helping with translations.

Bugs & Issues

No critical misbehaviour known, most issues are caused by configuration errors. Beware of scripts and plugins which validate URLs or intercept the data flow. Namely the plugin "Check URL" can interfere with this plugin, This issue has been fixed for basic setups, see issue #11. However, there might still occur interferences with plugins which check target URLs or manipulate the database by themselves. So, when you notice a strange behaviour always think about this and if you report an issue please include a list of installed and activated plugins.

Localization (l10n)

This plugin supports localization (translations into your language). For this to work you need at least YOURLS v1.7 from March 1, 2015. It will basically work fine with earlier versions, except that translations won't work because of a minor bug in the YOURLS-code. Just upgrade to the latest YOURLS version and it will do.

Per default it talks English. Translation files for German, Spanish and Simplified Chinese are included in the folder l10n/. Remember to define your locale in user/config.php like this:
define( 'YOURLS_LANG', 'de_DE' );

Looking for translators

If you're willing to provide translations, please read this. If necessary you can contact me for further instructions. Any help is appreciated, at most by your fellow countrymen!

Donations

There are many ways to integrate this plugin into your daily routines. The more you use it the more you will discover. The more you discover the more you will like it.
If you do, remember someone spends his time for improving it. If you want say thanks for that, just buy him a coffee. That will certainly motivate him to make further enhancements. Just for You! ...
and him :)

License

Free for personal use only.
If you want to make money with it you have to contact me first.

Thanks for your attention.

yourls-upload-and-shorten's People

Contributors

fredl99 avatar lenkimo avatar sgiovagnoli avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.