Skip to content

A plugin that allows you to take pictures and upload images from Smartphones and PCs

Notifications You must be signed in to change notification settings

margenn/adminer-camera-upload-plugin

Repository files navigation

AdminerCameraUpload

A plugin that allows you to take pictures and upload the images from adminer. It was base on file-upload plugin.

Works with all fields ending with "_photo" or any other regex.

It depends on webcam.min.js. You can find here: https://github.com/jhuckaby/webcamjs

Your site must be httpS to get this plugin working.


Using:


index.php

Create an index.php with the following content:

<?php
function adminer_object() {
	include_once "./plugins/plugin.php"; // required to run any plugin
	foreach (glob("./plugins/*.php") as $filename) { include_once $filename; } // autoloader
	$plugins = array(
		// specify plugins here.
		new AdminerCameraUpload()
	);
	return new AdminerPlugin($plugins);
}

include "./your-compiled-or-downloaded-adminer.php";

Folder structure

A typical deploy looks like this:

πŸ“‚ webserver_root
β”œβ”€β”€ πŸ“‚ adminer
β”‚   β”œβ”€β”€ πŸ“„ adminer.css
β”‚   β”œβ”€β”€ πŸ“„ index.php
β”‚   β”œβ”€β”€ πŸ“„ your-compiled-or-downloaded-adminer.php
β”‚   └── πŸ“‚ plugins
β”‚       β”œβ”€β”€ πŸ“„ plugin.php
β”‚       β”œβ”€β”€ πŸ“„ camera-upload.php # plugin goes here
β”‚       └── πŸ“‚ static
β”‚           └── πŸ“„ webcam.min.js
β”œβ”€β”€ πŸ“‚ photos # uploaded photos path (customizable)
β”‚   └── πŸ“‚ db
β”‚        └── πŸ“‚ table
β”‚            └── πŸ“‚ field
β”‚                β”œβ”€β”€ πŸ“„ field_241208_201430.jpg
β”‚                β”œβ”€β”€ πŸ“„ field_241208_201535.jpg
β”‚                β”œβ”€β”€ πŸ“„ field_241208_201621.jpg
β”‚                └── πŸ“„ ...

Test Table

Example of a table for testing purposes:

    CREATE TABLE test (
	    id int NOT NULL AUTO_INCREMENT COMMENT 'Primary key',
	    my_photo varchar(255),
	    PRIMARY KEY (id)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8

About

A plugin that allows you to take pictures and upload images from Smartphones and PCs

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages