<?php

global $wpdb;
$api_key = $wpdb->get_var("SELECT api_key FROM " . gallery_bank_licensing());
$album_css = $wpdb->get_results("SELECT * FROM " . gallery_bank_settings());
$gb_activation_status = get_option("gallery-bank-activation");
$activation_status = $gb_activation_status == "" ? "404" : $gb_activation_status;
if (count($album_css) != 0) {
    $setting_keys = array();
    for ($flag = 0; $flag < count($album_css); $flag++) {
        array_push($setting_keys, $album_css[$flag]->setting_key);
    }
    $index = array_search("admin_full_control", $setting_keys);
    $admin_full_control = intval($album_css[$index]->setting_value);
    $index = array_search("admin_read_control", $setting_keys);
    $admin_read_control = intval($album_css[$index]->setting_value);
    $index = array_search("admin_write_control", $setting_keys);
    $admin_write_control = intval($album_css[$index]->setting_value);
    $index = array_search("editor_full_control", $setting_keys);
    $editor_full_control = intval($album_css[$index]->setting_value);
    $index = array_search("editor_read_control", $setting_keys);
    $editor_read_control = intval($album_css[$index]->setting_value);
    $index = array_search("editor_write_control", $setting_keys);
    $editor_write_control = intval($album_css[$index]->setting_value);
    $index = array_search("author_full_control", $setting_keys);
    $author_full_control = intval($album_css[$index]->setting_value);
    $index = array_search("author_read_control", $setting_keys);
    $author_read_control = intval($album_css[$index]->setting_value);
    $index = array_search("author_write_control", $setting_keys);
    $author_write_control = intval($album_css[$index]->setting_value);
    $index = array_search("contributor_full_control", $setting_keys);
function gallery_bank_updation_check()
{
    global $wpdb;
    $updation_keys = $wpdb->get_row("SELECT * FROM " . gallery_bank_licensing());
    $url = get_option("gallery-bank-updation-check-url");
    $response = wp_remote_post($url, array("method" => "POST", "timeout" => 45, "redirection" => 5, "httpversion" => "1.0", "blocking" => true, "headers" => array(), "body" => array("ux_product_key" => "17130", "ux_domain" => $updation_keys->url, "ux_order_id" => $updation_keys->order_id, "ux_api_key" => $updation_keys->api_key, "param" => "check_license", "action" => "license_validator")));
    if (is_wp_error($response)) {
        delete_option("gallery-bank-activation");
    } else {
        $response["body"] == "" ? update_option("gallery-bank-activation", $updation_keys->api_key) : delete_option("gallery-bank-activation");
    }
}
                if ($album_covers[$flag1]->thumbnail_url != "") {
                    process_album_upload($album_covers[$flag1]->thumbnail_url, $cover_width, $cover_height);
                }
            }
            die;
        } else {
            if ($_REQUEST["param"] == "restore_settings") {
                $sql = "TRUNCATE TABLE " . gallery_bank_settings();
                $wpdb->query($sql);
                include GALLERY_BK_PLUGIN_DIR . "/lib/include_settings.php";
                die;
            } else {
                if ($_REQUEST["param"] == "update_licensing_settings") {
                    $api_key = esc_attr($_REQUEST["ux_api_key"]);
                    $order_id = esc_attr($_REQUEST["ux_order_id"]);
                    $wpdb->query($wpdb->prepare("UPDATE " . gallery_bank_licensing() . " SET api_key = %s, order_id = %s ", $api_key, $order_id));
                    update_option("gallery-bank-activation", $api_key);
                    die;
                }
            }
        }
    }
}
function process_image_upload($image, $width, $height)
{
    $temp_image_path = GALLERY_MAIN_UPLOAD_DIR . $image;
    $temp_image_name = $image;
    list(, , $temp_image_type) = getimagesize($temp_image_path);
    if ($temp_image_type === NULL) {
        return false;
    }
예제 #4
0
<?php

global $wpdb;
$wpdb->query($wpdb->prepare("UPDATE " . gallery_bank_licensing() . " SET version = %s, type = %s, url = %s ", "3.8.7", "Gallery Bank Eco Edition", "" . site_url() . ""));
$licensing = $wpdb->get_row("SELECT * FROM " . gallery_bank_licensing());
?>

<!--suppress ALL -->
<form id="gallery_bank_licensing" class="layout-form" method="post">
    <div class="fluid-layout">
        <div class="layout-span12">
            <ul class="breadcrumb">
                <li>
                    <i class="icon-home"></i>
                    <a href="admin.php?page=gallery_bank"><?php 
_e("Gallery Bank", gallery_bank);
?>
</a>
                    <span class="divider">/</span>
                    <a href="#"><?php 
_e("Gallery Bank Licensing Module", gallery_bank);
?>
</a>
                </li>
            </ul>
            <div class="custom-message green" id="licensing_success_message" style="display: none;margin-bottom: 10px;">
				<span>
					<strong id="licensing_message"></strong>
				</span>
            </div>
            <div class="custom-message red" id="error_licensing_message" style="display: none;margin-bottom: 10px;">
<?php

global $wpdb, $current_user;
if (!is_user_logged_in()) {
    return;
}
$sql = "DROP TABLE " . gallery_bank_albums();
$wpdb->query($sql);
$sql = "DROP TABLE " . gallery_bank_pics();
$wpdb->query($sql);
$sql = "DROP TABLE " . gallery_bank_settings();
$wpdb->query($sql);
$sql = "DROP TABLE " . gallery_bank_licensing();
$wpdb->query($sql);
delete_option("gallery-bank-pro-edition");
delete_option("gallery-bank-updation-check-url");
delete_option("gallery-bank-activation");
delete_option("allow_tracking_gb");
예제 #6
0
function create_table_licensing()
{
    global $wpdb;
    $sql = "CREATE TABLE " . gallery_bank_licensing() . "(\r\n            licensing_id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,\r\n            version VARCHAR(10) NOT NULL,\r\n            type VARCHAR(100) NOT NULL,\r\n            url TEXT NOT NULL,\r\n            api_key TEXT,\r\n            order_id VARCHAR(100),\r\n            PRIMARY KEY (licensing_id)\r\n            ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE utf8_general_ci";
    dbDelta($sql);
    $wpdb->query($wpdb->prepare("INSERT INTO " . gallery_bank_licensing() . "(version, type, url) VALUES(%s, %s, %s)", "3.8.7", "Gallery Bank Eco Edition", "" . site_url() . ""));
}