version 1.1
This free project is our only one step towards making a better web by spending serious effort and time. Please support us by linking back to us and sharing on social media.
mLIB is a PHP, MYSQL and jQuery based media upload library. It can be used to upload files and select them for use on fly. This plugin is better suited for admin part of any CMS which lacks a good media uploader. Features :
http://your-site-here.com/mlib/mlib-config.phpconsidering your-site-here.com is your website.
main_domain = 'http://your-site-here.com/';please note that URL must end with slash at the end.
<script src="http://your-site-here.com/mlib/mlib-includes/js/jquery-3.7.0.min.js" type="text/javascript"></script> <script src="http://your-site-here.com/mlib/mlib-includes/js/init.js" type="text/javascript"></script>
$('.picurlbtn').mlibready({returnto:'#picurl', maxselect:1});
Option | Default | Notes |
---|---|---|
allowed | "jpg,png,gif,jpeg" | File extensions that you want to allow. Each extension is separated by comma(,). All extensions must be enclosed by single or double quotes. |
minselect | 1 | Minimum no of files that must be selected. Selection will not trigger until at least these no of files are selected. |
maxselect | 999999999999 | Maximum no of files that must be selected. Selection will not trigger if less no of files are selected. |
folderID | Any alphanumeric value can be used. Used for uniqly categorising the uploads. For example, content uploaded under "fruits" will not appear in "grains" folderID. | |
returnto | This is the target element where output after selecting the files will be returned. If input element is used, output will be applied as value else as innerHTML will be changed. | |
returnas | 0 | ID of Import Option(return type) to be applied on the selected files before returning data to target element. |
runfunction | This is the name of JavaScript function that should be run after applying the output to target element. That function will receive 2 arguments automatically. First argument holds the html information of selected files while second argument holds the css selector of element as defined in returnto. | |
maxFilesize | 1000 | Maximum size of each file in MB(MegaBytes) that can be uploaded. |
parallelUploads | 4 | No of files that can be uploaded in parallel. |
Option | Notes |
---|---|
%%id%% | ID used in the database for the file |
%%url%% | only URL of the file |
%%thumb%% | thumbnail URL OR icon URL of non-image files |
%%sthumb%% | thumbnail file name |
%%fullsize%% | size of the file in Kb, Mb, Gb |
%%bytesize%% | size of the file in bytes |
%%title%% | title of the file |
%%caption%% | caption of the file |
%%type%% | file extention |
%%url%% | Full url to the uploaded file |
%%surl%% | Filename of the uploaded file |
%%time%% | Unix timestamp of file when it was uploaded |
%%date%% | Shows day, date and time of file in readable format when it was uploaded |
<a href="%%url%%" target="_blank"><img src="%%thumb%%" /></a>
CKEDITOR.editorConfig = function( config ) { config.extraPlugins = 'medialib'; };
<script src="http://your-website.com/ckeditor/ckeditor.js"></script>
<textarea name="cktextarea"></textarea> <script>editor = CKEDITOR.replace('cktextarea');</script>
<script src="http://your-website.com/mlib/mlib-includes/js/mce_mlib.js"></script>
<script> tinymce.init({ selector: '#mytextarea', plugins: 'mce_mlib', toolbar: 'mce_mlib' }); </script> <textarea name="mytextarea" id="mytextarea"></textarea>