prefix .'ald_gallery'; $ald_image_table = $wpdb->prefix .'ald_images'; $ald_gallery_path = admin_url('admin.php?page=ald-gallery', 'http' ); $ald_gallery_db_version = '2.0'; function install_ald_gallery(){ global $ald_gallery_db_version; global $wpdb; global $ald_gallery_table; global $ald_image_table; $charset_collate1 = $wpdb->get_charset_collate(); $charset_collate2 = $wpdb->get_charset_collate(); $gallery_table = "CREATE TABLE IF NOT EXISTS $ald_gallery_table( gallery_id mediumint(9) NOT NULL AUTO_INCREMENT, gallery_name tinytext NOT NULL, gallery_text text NOT NULL, PRIMARY KEY (gallery_id) )$charset_collate1;"; $img_table = "CREATE TABLE IF NOT EXISTS $ald_image_table( img_id mediumint(9) NOT NULL AUTO_INCREMENT, img_name tinytext NOT NULL, img_text text NOT NULL, img_url varchar(100) DEFAULT '' NOT NULL, gallery_id mediumint(9) NOT NULL, PRIMARY KEY (img_id) )$charset_collate2;"; require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); dbDelta( $gallery_table ); dbDelta( $img_table ); add_option( 'ald_gallery_db_version', $ald_gallery_db_version ); } if (isset($_GET['activate']) && $_GET['activate'] == 'true') add_action('init', 'install_ald_gallery'); add_action('admin_menu', 'ald_gallry_plugin_menu'); function ald_gallry_plugin_menu() { add_menu_page( __( 'ALD Gallery', 'ald-gallery' ), 'ALD Gallery', 'manage_options', 'ald-gallery', 'ald_gallery_index', plugins_url( 'ald-image-gallery/img/image-gallery.svg' ), 6 ); } add_action('admin_menu', 'ald_register_add_new_ald_gallery_page'); function ald_register_add_new_ald_gallery_page() { add_submenu_page( 'ald-gallery', 'Add New Gallery', 'Add New Gallery', 'manage_options', 'add-new-ald-gallery', 'add_new_ald_gallery' ); } function admin_scripts_js() { wp_enqueue_style( 'jquery-ui-style', '//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css' ); wp_enqueue_style( 'ald-image-gallery-admin-style', plugins_url('css/admin-panel-style.css', __FILE__) ); wp_enqueue_media(); wp_enqueue_script( 'ald-image-gallery-admin-script', plugins_url('js/ald-image-gallery.admin.js', __FILE__), array('jquery','jquery-ui-dialog'), ald_gallery_db_version, true ); } function external_css() { wp_enqueue_style( 'ald-style', plugins_url('css/ald-style.css', __FILE__) ); wp_enqueue_style( 'lightcase-style', plugins_url('lightcase/src/css/lightcase.css', __FILE__) ); } function external_js() { wp_enqueue_script( 'ald-script', plugins_url('js/ald-script.js', __FILE__), array('jquery'), ald_gallery_db_version, true ); wp_enqueue_script( 'lightcase-script', plugins_url('lightcase/src/js/lightcase.js', __FILE__), array('jquery'), null, true ); wp_enqueue_script( 'lightcase-touch-script', plugins_url('lightcase/vendor/jQuery/jquery.events.touch.js', __FILE__), array('jquery'), null, true ); } add_action( 'admin_enqueue_scripts', 'admin_scripts_js' ); add_action( 'wp_enqueue_scripts', 'external_css' ); add_action( 'wp_enqueue_scripts', 'external_js' ); // Add New Gallery require_once __DIR__ . '/inc/add-new-gallery.php'; require_once __DIR__ . '/inc/gallery-list-class.php'; function ald_gallery_index(){ $current_user = wp_get_current_user(); global $ald_gallery_path; global $ald_gallery_table; global $ald_image_table; ?>

Gallery Informations Add a Gallery

Welcome, display_name; ?>

Gallery deleted successfully.

Sorry. gallery didn't deleted. Please try again later.


prepare_items(); $galleryListTable->display(); ?>
0) { ?>

Gallery Images

Image added successfully.

Sorry. image didn't added. Please try again later.

Image deleted successfully.


Back to Gallery List
Image Name
Images Url
Image Caption
get_results( "SELECT * FROM $ald_image_table where gallery_id=$gallery order by img_id desc"); ?>
ID Image Name Image Caption Images Delete
img_id); ?> img_name);?> img_text);?> Delete