Server IP : 15.235.198.142 / Your IP : 216.73.216.190 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ballsack 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/rhodeworks/wp-content/plugins/nextgen-gallery/src/Legacy/admin/ |
Upload File : |
<?php /** * creates all tables for the gallery called during register_activation hook */ function nggallery_install( $installer ) { global $wpdb; $nggpictures = $wpdb->prefix . 'ngg_pictures'; $nggallery = $wpdb->prefix . 'ngg_gallery'; $nggalbum = $wpdb->prefix . 'ngg_album'; // Create pictures table. $sql = 'CREATE TABLE ' . $nggpictures . " ( pid BIGINT(20) NOT NULL AUTO_INCREMENT , image_slug VARCHAR(255) NOT NULL , post_id BIGINT(20) DEFAULT '0' NOT NULL , galleryid BIGINT(20) DEFAULT '0' NOT NULL , filename VARCHAR(255) NOT NULL , description MEDIUMTEXT NULL , alttext MEDIUMTEXT NULL , imagedate DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', exclude TINYINT NULL DEFAULT '0' , sortorder BIGINT(20) DEFAULT '0' NOT NULL , meta_data LONGTEXT, extras_post_id BIGINT(20) DEFAULT '0' NOT NULL, PRIMARY KEY (pid), KEY extras_post_id_key (extras_post_id) );"; $installer->upgrade_schema( $sql ); // Create gallery table. $sql = 'CREATE TABLE ' . $nggallery . " ( gid BIGINT(20) NOT NULL AUTO_INCREMENT , name VARCHAR(255) NOT NULL , slug VARCHAR(255) NOT NULL , path MEDIUMTEXT NULL , title MEDIUMTEXT NULL , galdesc MEDIUMTEXT NULL , pageid BIGINT(20) DEFAULT '0' NOT NULL , previewpic BIGINT(20) DEFAULT '0' NOT NULL , author BIGINT(20) DEFAULT '0' NOT NULL , extras_post_id BIGINT(20) DEFAULT '0' NOT NULL, PRIMARY KEY (gid), KEY extras_post_id_key (extras_post_id) )"; $installer->upgrade_schema( $sql ); // Create albums table. $sql = 'CREATE TABLE ' . $nggalbum . " ( id BIGINT(20) NOT NULL AUTO_INCREMENT , name VARCHAR(255) NOT NULL , slug VARCHAR(255) NOT NULL , previewpic BIGINT(20) DEFAULT '0' NOT NULL , albumdesc MEDIUMTEXT NULL , sortorder LONGTEXT NOT NULL, pageid BIGINT(20) DEFAULT '0' NOT NULL, extras_post_id BIGINT(20) DEFAULT '0' NOT NULL, PRIMARY KEY (id), KEY extras_post_id_key (extras_post_id) )"; $installer->upgrade_schema( $sql ); // check one table again, to be sure. if ( ! $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', [ $wpdb->esc_like( $nggpictures ) ] ) ) ) { update_option( 'ngg_init_check', __( 'NextGEN Gallery : Tables could not created, please check your database settings', 'nggallery' ) ); } } /** * @param string $capability name of the capability which should be de-registered */ function ngg_remove_capability( $capability ) { // this function remove the $capability only from the classic roles. $check_order = [ 'subscriber', 'contributor', 'author', 'editor', 'administrator' ]; foreach ( $check_order as $role ) { $role = get_role( $role ); if ( ! is_null( $role ) ) { $role->remove_cap( $capability ); } } }