本文整理汇总了PHP中gallery_bank_albums函数的典型用法代码示例。如果您正苦于以下问题:PHP gallery_bank_albums函数的具体用法?PHP gallery_bank_albums怎么用?PHP gallery_bank_albums使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了gallery_bank_albums函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save_album
function save_album()
{
global $wpdb;
$album_count = $wpdb->get_var("SELECT count(album_id) FROM " . gallery_bank_albums());
if ($album_count < 3) {
global $wpdb;
include_once GALLERY_BK_PLUGIN_DIR . "/views/header.php";
include_once GALLERY_BK_PLUGIN_DIR . "/views/edit-album.php";
} else {
?>
<script type="text/javascript">
window.location.href="admin.php?page=gallery_bank";
</script>
<?php
}
}
示例2: gallery_bank_albums
break;
case "name":
$album = $wpdb->get_results("SELECT * FROM " . gallery_bank_albums() . " order by album_name asc");
break;
case "date":
$album = $wpdb->get_results("SELECT * FROM " . gallery_bank_albums() . " order by album_date asc");
break;
case "asc":
$album = $wpdb->get_results("SELECT * FROM " . gallery_bank_albums() . " order by album_id asc");
break;
case "desc":
$album = $wpdb->get_results("SELECT * FROM " . gallery_bank_albums() . " order by album_id desc");
break;
}
} else {
$album = $wpdb->get_results("SELECT * FROM " . gallery_bank_albums() . " order by album_order asc ");
}
$album_css = $wpdb->get_results("SELECT * FROM " . gallery_bank_settings());
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("cover_thumbnail_width", $setting_keys);
$cover_thumbnail_width = $album_css[$index]->setting_value;
$index = array_search("cover_thumbnail_height", $setting_keys);
$cover_thumbnail_height = $album_css[$index]->setting_value;
$index = array_search("cover_thumbnail_opacity", $setting_keys);
$cover_thumbnail_opacity = $album_css[$index]->setting_value;
$index = array_search("cover_thumbnail_border_size", $setting_keys);
$cover_thumbnail_border_size = $album_css[$index]->setting_value;
示例3: gallery_bank_pics
$albumCover = $wpdb->get_row($wpdb->prepare("SELECT album_cover,thumbnail_url,video FROM " . gallery_bank_pics() . " WHERE album_cover=1 and album_id = %d", $album_id));
break;
case "grid" || "list":
if (isset($widget)) {
$galleryWidget = $widget;
} else {
$galleryWidget = "";
}
if ($img_in_row == "") {
$img_in_row = 0;
}
if ($show_albums == "all" || $show_albums == "") {
$album = $wpdb->get_results("SELECT * FROM " . gallery_bank_albums() . " order by album_order asc");
} else {
if (preg_match("/^\\d+(?:,\\d+)*\$/", $show_albums)) {
$album = $wpdb->get_results("SELECT * FROM " . gallery_bank_albums() . " where album_id in ({$show_albums}) order by album_order asc");
}
}
break;
}
/** Switch for global settings **/
switch ($album_type) {
case "images":
$index = array_search("thumbnails_width", $setting_keys);
if ($widget == "true") {
$thumbnails_width = intval($thumb_width);
} else {
$thumbnails_width = intval($album_css[$index]->setting_value);
}
$index = array_search("thumbnails_height", $setting_keys);
if ($widget == "true") {
示例4: gallery_bank_pics
} else {
$wpdb->query($wpdb->prepare("UPDATE " . gallery_bank_pics() . " SET title = %s, description = %s, date = CURDATE(), tags = %s, album_cover = %d WHERE pic_id = %d", $field[4], $field[5], $field[6], 0, $field[1]));
}
}
die;
} else {
if ($_REQUEST["param"] == "delete_pic") {
$delete_array = html_entity_decode($_REQUEST["delete_array"]);
$albumId = intval($_REQUEST["albumid"]);
$wpdb->query("DELETE FROM " . gallery_bank_pics() . " WHERE pic_id in ({$delete_array})");
die;
} else {
if ($_REQUEST["param"] == "Delete_album") {
$album_id = intval($_REQUEST["album_id"]);
$wpdb->query($wpdb->prepare("DELETE FROM " . gallery_bank_pics() . " WHERE album_id = %d", $album_id));
$wpdb->query($wpdb->prepare("DELETE FROM " . gallery_bank_albums() . " WHERE album_id = %d", $album_id));
die;
} else {
if ($_REQUEST["param"] == "update_option") {
update_option("gallery-bank-info-popup", "no");
die;
}
}
}
}
}
}
}
}
}
function process_image_upload($image, $width, $height)
示例5: gallery_bank_albums
<?php
global $wpdb;
$sql = "TRUNCATE TABLE " . gallery_bank_albums();
$wpdb->query($sql);
$sql = "TRUNCATE TABLE " . gallery_bank_pics();
$wpdb->query($sql);
include_once GALLERY_BK_PLUGIN_DIR . "/lib/include_settings.php";
示例6: save_album
function save_album()
{
global $wpdb, $current_user, $user_role_permission;
if (is_super_admin()) {
$gb_role = "administrator";
} else {
$gb_role = $wpdb->prefix . "capabilities";
$current_user->role = array_keys($current_user->{$gb_role});
$gb_role = $current_user->role[0];
}
$album_count = $wpdb->get_var("SELECT count(album_id) FROM " . gallery_bank_albums());
if ($album_count <= 3) {
include_once GALLERY_BK_PLUGIN_DIR . "/views/header.php";
include_once GALLERY_BK_PLUGIN_DIR . "/views/edit-album.php";
} else {
header("Location:admin.php?page=gallery_bank");
}
}
示例7: _e
</th>
<th style="width:15%"><?php
_e("Date", gallery_bank);
?>
</th>
<th style="width:14%"><?php
_e("Short-Codes", gallery_bank);
?>
</th>
<th style="width:17%"></th>
</tr>
</thead>
<tbody>
<?php
for ($flag = 0; $flag < count($album); $flag++) {
$count_pic = $wpdb->get_var($wpdb->prepare("SELECT count(" . gallery_bank_albums() . ".album_id) FROM " . gallery_bank_albums() . " join " . gallery_bank_pics() . " on " . gallery_bank_albums() . ".album_id = " . gallery_bank_pics() . ".album_id where " . gallery_bank_albums() . ".album_id = %d ", $album[$flag]->album_id));
$albumCover = $wpdb->get_row($wpdb->prepare("SELECT album_cover,thumbnail_url,video FROM " . gallery_bank_pics() . " WHERE album_cover=1 and album_id = %d", $album[$flag]->album_id));
?>
<tr>
<td>
<a href="admin.php?page=save_album&album_id=<?php
echo $album[$flag]->album_id;
?>
" title="<?php
echo stripcslashes(htmlspecialchars_decode($album[$flag]->album_name));
?>
" >
<div class="imgLiquidFill dynamic_cover_css">
<?php
if (count($albumCover) != 0) {
if ($albumCover->album_cover == 0) {
示例8: create_table_albums
function create_table_albums()
{
$sql = "CREATE TABLE " . gallery_bank_albums() . "(\r\n album_id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,\r\n album_name VARCHAR(100),\r\n author VARCHAR(100),\r\n album_date DATE,\r\n description TEXT ,\r\n album_order INTEGER(10),\r\n PRIMARY KEY (album_id)\r\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_general_ci";
dbDelta($sql);
}
示例9: rand
<?php
global $wpdb;
global $current_user;
$unique_id = rand(100, 10000);
if (isset($_REQUEST["row"])) {
$img_in_row = intval($_REQUEST["row"]);
} else {
$img_in_row = 3;
}
$album_id = intval($_REQUEST["album_id"]);
$album = $wpdb->get_var($wpdb->prepare("SELECT album_name FROM " . gallery_bank_albums() . " WHERE album_id = %d", $album_id));
$album_css = $wpdb->get_results("SELECT * FROM " . gallery_bank_settings());
/***** Global Queries ******/
$pics = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . gallery_bank_pics() . " WHERE album_id = %d order by sorting_order asc", $album_id));
/***** Global Settings ******/
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("thumbnails_width", $setting_keys);
$thumbnails_width = $album_css[$index]->setting_value;
$index = array_search("thumbnails_height", $setting_keys);
$thumbnails_height = $album_css[$index]->setting_value;
$index = array_search("thumbnails_opacity", $setting_keys);
$thumbnails_opacity = $album_css[$index]->setting_value;
$index = array_search("thumbnails_border_size", $setting_keys);
$thumbnails_border_size = $album_css[$index]->setting_value;
$index = array_search("thumbnails_border_radius", $setting_keys);
$thumbnails_border_radius = $album_css[$index]->setting_value;
示例10: gallery_bank_pics
$pics_order = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . gallery_bank_pics() . " WHERE album_id = %d order by title asc", $album_id));
break;
case "date":
$pics_order = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . gallery_bank_pics() . " WHERE album_id = %d order by date asc", $album_id));
break;
case "asc":
$pics_order = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . gallery_bank_pics() . " WHERE album_id = %d order by pic_id asc", $album_id));
break;
case "desc":
$pics_order = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . gallery_bank_pics() . " WHERE album_id = %d order by pic_id desc", $album_id));
break;
}
} else {
$pics_order = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . gallery_bank_pics() . " WHERE album_id = %d order by sorting_order asc", $album_id));
}
$album = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . gallery_bank_albums() . " where album_id = %d", $album_id));
$album_css = $wpdb->get_results("SELECT * FROM " . gallery_bank_settings());
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("thumbnails_width", $setting_keys);
$thumbnails_width = $album_css[$index]->setting_value;
$index = array_search("thumbnails_height", $setting_keys);
$thumbnails_height = $album_css[$index]->setting_value;
$index = array_search("thumbnails_opacity", $setting_keys);
$thumbnails_opacity = $album_css[$index]->setting_value;
$index = array_search("thumbnails_border_size", $setting_keys);
$thumbnails_border_size = $album_css[$index]->setting_value;
$new_thumb_width = $thumbnails_width + $thumbnails_border_size * 4;
示例11: gallery_bank_albums
<?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");
示例12: widget
function widget($args, $instance)
{
global $wpdb, $responsiveGallery;
$albums = $wpdb->get_var($wpdb->prepare("SELECT count(*) FROM " . gallery_bank_albums() . " WHERE album_id = %d", $instance["galleryid"]));
extract($args, EXTR_SKIP);
echo $before_widget;
$title = empty($instance["title"]) ? " " : apply_filters("widget_title", $instance["title"]);
if ($instance["responsive"] == 1) {
$responsiveGallery = "responsive = \"true\"";
} else {
$responsiveGallery = "img_in_row=\"" . $instance["imgInRow"] . "\"";
}
if ($albums > 0) {
if ($instance["galleryid"] != 0) {
echo $before_title . $title . $after_title;
if ($instance["displayImages"] == "all") {
switch ($instance["textFormat"]) {
case "title_only":
$shortcode_for_albums = "[gallery_bank type=\"images\" format=\"" . $instance["galleryFormat"] . "\" \r\n\t\t\t\t\t\t\ttitle=\"true\" desc=\"false\" " . $responsiveGallery . " \r\n\t\t\t\t\t\t\tanimation_effect=\"" . $instance["animationEffect"] . "\" thumb_width=\"" . $instance["thumbWidth"] . "\" \r\n\t\t\t\t\t\t\tthumb_height=\"" . $instance["thumbHeight"] . "\" album_id=\"" . $instance["galleryid"] . "\" display=\"all\" widget=\"true\"]";
break;
case "title_desc":
$shortcode_for_albums = "[gallery_bank type=\"images\" format=\"" . $instance["galleryFormat"] . "\" \r\n\t\t\t\t\t\t\ttitle=\"true\" desc=\"true\" " . $responsiveGallery . " \r\n\t\t\t\t\t\t\tthumb_width=\"" . $instance["thumbWidth"] . "\" thumb_height=\"" . $instance["thumbHeight"] . "\" \r\n\t\t\t\t\t\t\tanimation_effect=\"" . $instance["animationEffect"] . "\" album_id=\"" . $instance["galleryid"] . "\" display=\"all\" widget=\"true\"]";
break;
case "no_text":
$shortcode_for_albums = "[gallery_bank type=\"images\" format=\"" . $instance["galleryFormat"] . "\" \r\n\t\t\t\t\t\t\ttitle=\"false\" desc=\"false\" " . $responsiveGallery . " \r\n\t\t\t\t\t\t\tthumb_width=\"" . $instance["thumbWidth"] . "\" thumb_height=\"" . $instance["thumbHeight"] . "\" \r\n\t\t\t\t\t\t\tspecial_effect=\"" . $instance["specialEffect"] . "\" animation_effect=\"" . $instance["animationEffect"] . "\" \r\n\t\t\t\t\t\t\talbum_id=\"" . $instance["galleryid"] . "\" display=\"all\" widget=\"true\"]";
break;
}
} else {
switch ($instance["textFormat"]) {
case "title_only":
$shortcode_for_albums = "[gallery_bank type=\"images\" format=\"" . $instance["galleryFormat"] . "\" \r\n\t\t\t\t\t\t\ttitle=\"true\" desc=\"false\" " . $responsiveGallery . " \r\n\t\t\t\t\t\t\tanimation_effect=\"" . $instance["animationEffect"] . "\" thumb_width=\"" . $instance["thumbWidth"] . "\" \r\n\t\t\t\t\t\t\tthumb_height=\"" . $instance["thumbHeight"] . "\" album_id=\"" . $instance["galleryid"] . "\" display=\"selected\" \r\n\t\t\t\t\t\t\tno_of_images=\"" . $instance["numberOfImages"] . "\" sort_by=\"" . $instance["sortBy"] . "\" widget=\"true\"]";
break;
case "title_desc":
$shortcode_for_albums = "[gallery_bank type=\"images\" format=\"" . $instance["galleryFormat"] . "\" \r\n\t\t\t\t\t\t\ttitle=\"true\" desc=\"true\" " . $responsiveGallery . " \r\n\t\t\t\t\t\t\tthumb_width=\"" . $instance["thumbWidth"] . "\" thumb_height=\"" . $instance["thumbHeight"] . "\" \r\n\t\t\t\t\t\t\tanimation_effect=\"" . $instance["animationEffect"] . "\" album_id=\"" . $instance["galleryid"] . "\" display=\"selected\" \r\n\t\t\t\t\t\t\tno_of_images=\"" . $instance["numberOfImages"] . "\" sort_by=\"" . $instance["sortBy"] . "\" widget=\"true\"]";
break;
case "no_text":
$shortcode_for_albums = "[gallery_bank type=\"images\" format=\"" . $instance["galleryFormat"] . "\" \r\n\t\t\t\t\t\t\ttitle=\"false\" desc=\"false\" " . $responsiveGallery . " \r\n\t\t\t\t\t\t\tthumb_width=\"" . $instance["thumbWidth"] . "\" thumb_height=\"" . $instance["thumbHeight"] . "\" \r\n\t\t\t\t\t\t\tspecial_effect=\"" . $instance["specialEffect"] . "\" animation_effect=\"" . $instance["animationEffect"] . "\" \r\n\t\t\t\t\t\t\talbum_id=\"" . $instance["galleryid"] . "\" display=\"selected\" no_of_images=\"" . $instance["numberOfImages"] . "\" \r\n\t\t\t\t\t\t\tsort_by=\"" . $instance["sortBy"] . "\" widget=\"true\"]";
break;
}
}
echo do_shortcode($shortcode_for_albums);
echo $after_widget;
}
}
}
示例13: _e
</div>
<div class="layout-control-group" id="ux_select_album" style="display: block;">
<label class="custom-layout-label"><?php
_e("Choose Album", gallery_bank);
?>
: </label>
<select id="ux_ddl_select_album" class="layout-span7">
<?php
global $wpdb, $current_user;
$gb_role = $wpdb->prefix . "capabilities";
$current_user->role = array_keys($current_user->{$gb_role});
$gb_role = $current_user->role[0];
if ($gb_role == "administrator") {
$albums = $wpdb->get_results("SELECT * FROM " . gallery_bank_albums() . " order by album_order asc ");
} else {
$albums = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . gallery_bank_albums() . " where author = %s order by album_order asc ", $current_user->display_name));
}
for ($flag = 0; $flag < count($albums); $flag++) {
?>
<option value="<?php
echo intval($albums[$flag]->album_id);
?>
"><?php
echo esc_html($albums[$flag]->album_name);
?>
</option>
<?php
}
?>
</select>
</div>
示例14: add_gallery_bank_icon
function add_gallery_bank_icon($meta = TRUE)
{
global $wp_admin_bar, $wpdb;
if (!is_user_logged_in()) {
return;
}
$last_album_id = $wpdb->get_var("SELECT album_id FROM " . gallery_bank_albums() . " order by album_id desc limit 1");
$id = count($last_album_id) == 0 ? 1 : $last_album_id + 1;
$wp_admin_bar->add_menu(array("id" => "gallery_bank_links", "title" => __("<img src=\"" . GALLERY_BK_PLUGIN_URL . "/assets/images/icon.png\" width=\"25\"\n height=\"25\" style=\"vertical-align:text-top; margin-right:5px;\" />Gallery Bank"), "href" => __(site_url() . "/wp-admin/admin.php?page=gallery_bank")));
$wp_admin_bar->add_menu(array("parent" => "gallery_bank_links", "id" => "dashboard_links", "href" => site_url() . "/wp-admin/admin.php?page=gallery_bank", "title" => __("Dashboard", gallery_bank)));
$wp_admin_bar->add_menu(array("parent" => "gallery_bank_links", "id" => "add_new_album_links", "href" => site_url() . "/wp-admin/admin.php?page=save_album&album_id=" . $id, "title" => __("Add New Album", gallery_bank)));
$wp_admin_bar->add_menu(array("parent" => "gallery_bank_links", "id" => "sorting_links", "href" => site_url() . "/wp-admin/admin.php?page=gallery_album_sorting", "title" => __("Album Sorting", gallery_bank)));
$wp_admin_bar->add_menu(array("parent" => "gallery_bank_links", "id" => "global_settings_links", "href" => site_url() . "/wp-admin/admin.php?page=global_settings", "title" => __("Global Settings", gallery_bank)));
$wp_admin_bar->add_menu(array("parent" => "gallery_bank_links", "id" => "system_status_links", "href" => site_url() . "/wp-admin/admin.php?page=gallery_bank_system_status", "title" => __("System Status", gallery_bank)));
$wp_admin_bar->add_menu(array("parent" => "gallery_bank_links", "id" => "purchase_pro_version_links", "href" => site_url() . "/wp-admin/admin.php?page=gallery_bank_purchase", "title" => __("Purchase Pro Version", gallery_bank)));
}