Giter Site home page Giter Site logo

tipirdamaz / migallery Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 4.0 2.78 MB

PHP Photo Gallery Script with multi image uploader, image resizer, image cropper, image rotater and image sorter features.

License: MIT License

Hack 0.03% PHP 34.62% CSS 7.53% JavaScript 57.83%
image image-cropping image-gallery image-processing image-rotate image-sorting image-uploader multi-upload photo-gallery php

migallery's Introduction

MIGallery - Image Gallery Script

PHP Photo Gallery Script with multi image uploader, image resizer, image cropper, image rotater and image sorter features.

alt text

Overview

PHP Image Gallery Script with multi-uploading, cropping, rotating and sorting features. This script has been developed for multiple image uploads. It can be used not only for image gallery but also for multi-image upload for many different types of projects.

Images can be cropped, rotated before uploading. It can be sorted by dragging with the mouse on computers or by finger dragging on mobile devices, and information can be added for each picture.

FileAPI javascript tools are used for client side cropping, rotating and uploading images.

Uploaded images can be reordered later, new images can be added between them.

After installation, a picture table and a simple gallery table associated with this table are also created in the database.

In order to manage the created image gallery, simple page templates have been prepared.

In order to be easy to integrate into projects, a simple design has been made using bootstrap.

When it is installed, this script automatically creates a gallery as seen in the demonstration in the project directory. There are 4 pages on the project directory of this gallery. These pages are prepared as templates with a simple design for convenience to developers.

mi-uploader.php : create and edit gallery, upload and edit images for admin or authorized users
gallery-man.php : gallery management for admin or authorized users
gallery-list.php: list of image galleries for all users
gallery-view.php: view images of gallery for all users

You can use these pages by appropriately incorporating them into your project and improving their designs.

It is prepared as a template available to develop for different projects.

The codes are written as clearly and comprehensibly as possible. Necessary explanations have been added to the methods. Error logging and debug mode have been added to make it easier to find errors during the development phase.

DIRECTORY STRUCTURE

/project                : Your project folder
    /bootstrap-...      : bootstrap files
    /css                : css files
    /icons              : icon files
    /js                 : jquery files

    mi-install.php      : Install database tables and create CONFIG_FILE and DEFINITIONS_FILE (defined in the definitions0.php) files.
    mi-session.php      : php session management
    mi-init.php         : mysql connection
    mi-final.php        : close mysql connection
    mi-footer.php       : page footer
    mi-navbar.php       : navigation bar

    mi-uploader.php     : create and edit gallery, upload and edit images for admin or authorized users
    gallery-man.php     : gallery management for admin or authorized users
    gallery-list.php    : list of image galleries for all users
    gallery-view.php    : view images of gallery for all users
    
    /migallery
        definitions0.php: php definitions (default, you can change it manually)
        definitions1.php: php definitions (Default definitions during setup. If you do not change the default paths, the db / definitions.php file will be created after installation.)
        session.php     : php session management
        init.php        : mysql connection
        final.php       : close mysql connection

        uploader-thumb-existing.php    : print existing thumbnails during gallery editing
        uploader-thumb-template.php    : thumbnail html template of browsed and added images
        ajax-gallery-...               : Ajax request files of gallery management
        ajax-image-...                 : Ajax request files of image management

        MIGallery.class.php     : Main class of gallery and image management
        Translator.class.php    : Language translator class
        FileAPI.class.php       : File upload response class
        Pagination.class.php    : Pagination class
    
        install-ajax-...        : Ajax request files of installation

        /css                : css files
        /js                 : javascript files
        /plugins            : some javascript plugins
        /lang               : language files
            /xml            : language xml files
            /js             : language js files
        /db                 : The default directory for writable dynamic content. It can be changed during the installation.
            config.php      : After installation, config.php (default name, can be changed from the definitions0.php) file is created.
            definitions.php : After installation, definitions.php (default name, can be changed from the definitions0.php) file is created.
            error.log       : Errors are written to this file.
            /tmp            : First, images are uploaded here and created full, slide, thumb and thumb_c sizes
                /slide      : slide size with aspect ratio
                /thumb      : thumbnail size with aspect ratio
                /thumb_c    : thumbnail size with cropped
            /img            : Then images move here
                /slide
                /thumb
                /thumb_c
            /xml            : xml files of image informations. It was created to reduce database queries. Used in gallery-view.php file.
        
When the image is uploaded, first full size (not original size, maximum dimensions specified in the installation), thumbnail and slide images are created in the tmp directory. 
After the gallery is saved, the gallery id is taken and a new folder with this name is created in img directory and the images are moved here.
For example, when the file named abcdef123456789.jpg is uploaded, it is moved to the tmp directory.
Let's say gallery info is inserted to database with 128 id. After that, the file is moved to the img/128/128-abcdef123456789.jpg folder.

DEBUGGING

If you want to turn on debug mode, set $config['debug'] = true; from CONFIG_FILE file.

Features

  • Responsive design
  • Compatible with mobile devices
  • Automatic and easy installation
  • Multi (88) language support
  • Seo friendly
  • Clean Code
  • Debug mode and error logging
  • Sorting galleries by mouse or touch
  • Sorting images by mouse or touch
  • Multi upload
  • Add/edit image info
  • Image cropping
  • Image rotating
  • Image sorting
  • Add, substract and reorder images while editing the gallery

Requirements

  • PHP: 5.5+, 7, 8
  • MySQL: 4.x, 5.x
  • JQuery: 1.7+, 2, 3
  • Bootstrap: 4, 5
  • Browser Compatibility: Edge, Chrome, Safari, Opera, Firefox

Instructions

Type {your_domain}/project/mi-install.php in the address line and install it.

Screenshots

alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text

Live Demo

Live Demo

Donate

BTC : 1CASunNSibqCsR5Y6kniSW2t22Rt5Bwtgu

alt text

ETH : 0x3ea58816d52d3a18a447b41a9e65aefb32700551

alt text

USDT : 0x3ea58816d52d3a18a447b41a9e65aefb32700551

alt text

migallery's People

Contributors

tipirdamaz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.