本文整理汇总了PHP中WDWLibrary::message方法的典型用法代码示例。如果您正苦于以下问题:PHP WDWLibrary::message方法的具体用法?PHP WDWLibrary::message怎么用?PHP WDWLibrary::message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WDWLibrary
的用法示例。
在下文中一共展示了WDWLibrary::message方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
public function display($params, $from_shortcode = 0, $bwg = 0)
{
global $wp;
$current_url = $wp->query_string;
global $WD_BWG_UPLOAD_DIR;
require_once WD_BWG_DIR . '/framework/WDWLibrary.php';
require_once WD_BWG_DIR . '/framework/WDWLibraryEmbed.php';
$theme_row = $this->model->get_theme_row_data($params['theme_id']);
if (!isset($params['order_by'])) {
$order_by = 'asc';
} else {
$order_by = $params['order_by'];
}
if (!isset($params['popup_enable_pinterest'])) {
$params['popup_enable_pinterest'] = 0;
}
if (!isset($params['popup_enable_tumblr'])) {
$params['popup_enable_tumblr'] = 0;
}
if (!isset($params['show_search_box'])) {
$params['show_search_box'] = 0;
}
if (!isset($params['search_box_width'])) {
$params['search_box_width'] = 180;
}
if (!isset($params['popup_enable_info'])) {
$params['popup_enable_info'] = 1;
}
if (!isset($params['popup_info_always_show'])) {
$params['popup_info_always_show'] = 0;
}
if (!isset($params['popup_info_full_width'])) {
$params['popup_info_full_width'] = 0;
}
if (!isset($params['popup_enable_rate'])) {
$params['popup_enable_rate'] = 0;
}
if (!isset($params['thumb_click_action']) || $params['thumb_click_action'] == 'undefined') {
$params['thumb_click_action'] = 'open_lightbox';
}
if (!isset($params['thumb_link_target'])) {
$params['thumb_link_target'] = 1;
}
if (!isset($params['popup_hit_counter'])) {
$params['popup_hit_counter'] = 0;
}
if (!$theme_row) {
echo WDWLibrary::message(__('There is no theme selected or the theme was deleted.', 'bwg'), 'error');
return;
}
$gallery_row = $this->model->get_gallery_row_data($params['gallery_id']);
if (!$gallery_row) {
echo WDWLibrary::message(__('There is no gallery selected or the gallery was deleted.', 'bwg'), 'error');
return;
}
$image_rows = $this->model->get_image_rows_data($params['gallery_id'], 1, $params['sort_by'], $order_by, $bwg);
$images_count = count($image_rows);
if (!$image_rows) {
echo WDWLibrary::message(__('There are no images in this gallery.', 'bwg'), 'error');
}
$page_nav = $this->model->page_nav($params['gallery_id'], 1, $bwg);
$rgb_page_nav_font_color = WDWLibrary::spider_hex2rgb($theme_row->page_nav_font_color);
$image_browser_images_conteiner = WDWLibrary::spider_hex2rgb($theme_row->image_browser_full_bg_color);
$bwg_image_browser_image = WDWLibrary::spider_hex2rgb($theme_row->image_browser_bg_color);
$image_title = $params['image_browser_title_enable'];
$enable_image_description = $params['image_browser_description_enable'];
$option_row = $this->model->get_option_row_data();
$image_right_click = $option_row->image_right_click;
if (!isset($params['popup_fullscreen'])) {
$params['popup_fullscreen'] = 0;
}
if (!isset($params['popup_autoplay'])) {
$params['popup_autoplay'] = 0;
}
$params_array = array('action' => 'GalleryBox', 'current_view' => $bwg, 'gallery_id' => $params['gallery_id'], 'theme_id' => $params['theme_id'], 'open_with_fullscreen' => $params['popup_fullscreen'], 'open_with_autoplay' => $params['popup_autoplay'], 'image_width' => $params['popup_width'], 'image_height' => $params['popup_height'], 'image_effect' => $params['popup_effect'], 'wd_sor' => $params['sort_by'], 'wd_ord' => $order_by, 'enable_image_filmstrip' => $params['popup_enable_filmstrip'], 'image_filmstrip_height' => $params['popup_filmstrip_height'], 'enable_image_ctrl_btn' => $params['popup_enable_ctrl_btn'], 'enable_image_fullscreen' => $params['popup_enable_fullscreen'], 'popup_enable_info' => $params['popup_enable_info'], 'popup_info_always_show' => $params['popup_info_always_show'], 'popup_info_full_width' => $params['popup_info_full_width'], 'popup_hit_counter' => $params['popup_hit_counter'], 'popup_enable_rate' => $params['popup_enable_rate'], 'slideshow_interval' => $params['popup_interval'], 'enable_comment_social' => $params['popup_enable_comment'], 'enable_image_facebook' => $params['popup_enable_facebook'], 'enable_image_twitter' => $params['popup_enable_twitter'], 'enable_image_google' => $params['popup_enable_google'], 'enable_image_pinterest' => $params['popup_enable_pinterest'], 'enable_image_tumblr' => $params['popup_enable_tumblr'], 'watermark_type' => $params['watermark_type'], 'current_url' => $current_url);
$items_per_page = array('images_per_page' => 1, 'load_more_image_count' => 1);
if ($params['watermark_type'] == 'none') {
$params_array['watermark_font'] = '';
$params_array['watermark_color'] = '';
$params_array['watermark_font_size'] = '';
$params_array['watermark_opacity'] = '';
$text_align = '';
$vertical_align = '';
$params_array['watermark_width'] = '';
$show_watermark = FALSE;
}
if ($params['watermark_type'] != 'none') {
$params_array['watermark_link'] = urlencode($params['watermark_link']);
$params_array['watermark_opacity'] = $params['watermark_opacity'];
$params_array['watermark_position'] = $params['watermark_position'] != 'undefined' ? $params['watermark_position'] : 'top-center';
$position = explode('-', $params_array['watermark_position']);
$vertical_align = $position[0];
$text_align = $position[1];
}
if ($params['watermark_type'] == 'text') {
$show_watermark = TRUE;
$watermark_text_image = TRUE;
$params_array['watermark_text'] = $params['watermark_text'];
$params_array['watermark_font_size'] = $params['watermark_font_size'];
$params_array['watermark_font'] = $params['watermark_font'];
//.........这里部分代码省略.........
示例2: display
public function display($params, $from_shortcode = 0, $bwg = 0)
{
global $wp;
$current_url = $wp->query_string;
global $WD_BWG_UPLOAD_DIR;
require_once WD_BWG_DIR . '/framework/WDWLibrary.php';
$options_row = $this->model->get_options_row_data();
$play_icon = $options_row->play_icon;
if (!isset($params['extended_album_image_title'])) {
$params['extended_album_image_title'] = 'none';
}
if (!isset($params['extended_album_view_type'])) {
$album_view_type = 'thumbnail';
} else {
$album_view_type = $params['extended_album_view_type'];
}
if (!isset($params['popup_fullscreen'])) {
$params['popup_fullscreen'] = 0;
}
if (!isset($params['popup_autoplay'])) {
$params['popup_autoplay'] = 0;
}
if (!isset($params['popup_enable_pinterest'])) {
$params['popup_enable_pinterest'] = 0;
}
if (!isset($params['popup_enable_tumblr'])) {
$params['popup_enable_tumblr'] = 0;
}
if (!isset($params['show_search_box'])) {
$params['show_search_box'] = 0;
}
if (!isset($params['search_box_width'])) {
$params['search_box_width'] = 180;
}
if (!isset($params['popup_enable_info'])) {
$params['popup_enable_info'] = 1;
}
if (!isset($params['popup_info_always_show'])) {
$params['popup_info_always_show'] = 0;
}
if (!isset($params['popup_info_full_width'])) {
$params['popup_info_full_width'] = 0;
}
if (!isset($params['popup_enable_rate'])) {
$params['popup_enable_rate'] = 0;
}
if (!isset($params['thumb_click_action']) || $params['thumb_click_action'] == 'undefined') {
$params['thumb_click_action'] = 'open_lightbox';
}
if (!isset($params['thumb_link_target'])) {
$params['thumb_link_target'] = 1;
}
if (!isset($params['popup_hit_counter'])) {
$params['popup_hit_counter'] = 0;
}
if (!isset($params['order_by'])) {
$params['order_by'] = ' ASC ';
}
if (!isset($params['show_sort_images'])) {
$params['show_sort_images'] = 0;
}
if (!isset($params['show_tag_box'])) {
$params['show_tag_box'] = 0;
}
if (!isset($params['extended_album_enable_page'])) {
$params['extended_album_enable_page'] = 1;
}
$sort_direction = ' ' . $params['order_by'] . ' ';
$theme_row = $this->model->get_theme_row_data($params['theme_id']);
if (!$theme_row) {
echo WDWLibrary::message(__('There is no theme selected or the theme was deleted.', 'bwg'), 'error');
return;
}
$type = isset($_REQUEST['type_' . $bwg]) ? esc_html($_REQUEST['type_' . $bwg]) : 'album';
$bwg_search = isset($_POST['bwg_search_' . $bwg]) && esc_html($_POST['bwg_search_' . $bwg]) != '' ? esc_html($_POST['bwg_search_' . $bwg]) : '';
$album_gallery_id = isset($_REQUEST['album_gallery_id_' . $bwg]) ? esc_html($_REQUEST['album_gallery_id_' . $bwg]) : $params['album_id'];
if (!$album_gallery_id || $type == 'album' && !$this->model->get_album_row_data($album_gallery_id)) {
echo WDWLibrary::message(__('There is no album selected or the album was deleted.', 'bwg'), 'error');
return;
}
if ($type == 'gallery') {
$items_per_page = $params['extended_album_images_per_page'];
$items_per_page_arr = array('images_per_page' => $params['extended_album_images_per_page'], 'load_more_image_count' => $params['extended_album_images_per_page']);
$items_col_num = $params['extended_album_image_column_number'];
if (isset($_POST['sortImagesByValue_' . $bwg])) {
$sort_by = esc_html($_POST['sortImagesByValue_' . $bwg]);
if ($sort_by == 'random') {
$params['sort_by'] = 'RAND()';
} else {
if ($sort_by == 'default') {
$params['sort_by'] = $params['sort_by'];
} else {
$params['sort_by'] = $sort_by;
}
}
}
$image_rows = $this->model->get_image_rows_data($album_gallery_id, $items_per_page, $params['sort_by'], $bwg, $sort_direction);
$images_count = count($image_rows);
if (!$image_rows) {
echo WDWLibrary::message(__('There are no images in this gallery.', 'bwg'), 'error');
//.........这里部分代码省略.........
示例3: resize_image_thumb
public function resize_image_thumb()
{
global $WD_BWG_UPLOAD_DIR;
global $wpdb;
$flag = FALSE;
$img_ids = $wpdb->get_results('SELECT * FROM ' . $wpdb->prefix . 'bwg_image');
foreach ($img_ids as $img_id) {
if (isset($_POST['check_' . $img_id->id]) || isset($_POST['check_all_items'])) {
$flag = TRUE;
$file_path = str_replace("thumb", ".original", htmlspecialchars_decode(ABSPATH . $WD_BWG_UPLOAD_DIR . $img_id->thumb_url, ENT_COMPAT | ENT_QUOTES));
$new_file_path = htmlspecialchars_decode(ABSPATH . $WD_BWG_UPLOAD_DIR . $img_id->thumb_url, ENT_COMPAT | ENT_QUOTES);
$options = $wpdb->get_row('SELECT * FROM ' . $wpdb->prefix . 'bwg_option');
list($img_width, $img_height, $type) = @getimagesize(htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES));
if (!$img_width || !$img_height) {
return FALSE;
}
$max_width = $options->upload_thumb_width;
$max_height = $options->upload_thumb_height;
$scale = min($max_width / $img_width, $max_height / $img_height);
@ini_set('memory_limit', '-1');
if (!function_exists('imagecreatetruecolor')) {
error_log('Function not found: imagecreatetruecolor');
return FALSE;
}
$new_width = $img_width * $scale;
$new_height = $img_height * $scale;
$dst_x = 0;
$dst_y = 0;
$new_img = @imagecreatetruecolor($new_width, $new_height);
switch ($type) {
case 2:
$src_img = @imagecreatefromjpeg($file_path);
$write_image = 'imagejpeg';
$image_quality = isset($options->jpeg_quality) ? $options->jpeg_quality : 75;
break;
case 1:
@imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0));
$src_img = @imagecreatefromgif($file_path);
$write_image = 'imagegif';
$image_quality = null;
break;
case 3:
@imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0));
@imagealphablending($new_img, false);
@imagesavealpha($new_img, true);
$src_img = @imagecreatefrompng($file_path);
$write_image = 'imagepng';
$image_quality = isset($options->png_quality) ? $options->png_quality : 9;
break;
default:
$src_img = null;
break;
}
$success = $src_img && @imagecopyresampled($new_img, $src_img, $dst_x, $dst_y, 0, 0, $new_width, $new_height, $img_width, $img_height) && $write_image($new_img, $new_file_path, $image_quality);
// Free up memory (imagedestroy does not delete files):
@imagedestroy($src_img);
@imagedestroy($new_img);
@ini_restore('memory_limit');
}
}
if ($flag == false) {
echo WDWLibrary::message('You must select at least one item.', 'error');
} else {
echo WDWLibrary::message('Thumb Succesfully Resized', 'updated');
}
}
示例4: delete
public function delete($id)
{
global $wpdb;
$isDefault = $wpdb->get_var('SELECT default_theme FROM ' . $wpdb->prefix . 'bwg_theme WHERE id=' . $id);
if ($isDefault) {
echo WDWLibrary::message("You can't delete default theme", 'error');
} else {
$query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'bwg_theme WHERE id="%d"', $id);
if ($wpdb->query($query)) {
echo WDWLibrary::message('Item Succesfully Deleted.', 'updated');
$message = 3;
} else {
$message = 2;
}
}
$page = WDWLibrary::get('page');
$query_url = wp_nonce_url(admin_url('admin.php'), 'themes_bwg', 'bwg_nonce');
$query_url = add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), $query_url);
WDWLibrary::spider_redirect($query_url);
}
示例5: display
public function display($params, $from_shortcode = 0, $bwg = 0)
{
require_once WD_BWG_DIR . '/framework/WDWLibrary.php';
require_once WD_BWG_DIR . '/framework/WDWLibraryEmbed.php';
global $WD_BWG_UPLOAD_DIR;
$from = isset($params['from']) ? esc_html($params['from']) : 0;
$options_row = $this->model->get_options_row_data();
if (!isset($params['order_by'])) {
$order_by = 'asc';
} else {
$order_by = $params['order_by'];
}
if (!isset($params['slideshow_title_full_width'])) {
$params['slideshow_title_full_width'] = 0;
}
$image_right_click = $options_row->image_right_click;
if (!$from) {
$theme_id = isset($params['theme_id']) ? esc_html($params['theme_id']) : 1;
$theme_row = $this->model->get_theme_row_data($theme_id);
if (!$theme_row) {
echo WDWLibrary::message(__('There is no theme selected or the theme was deleted.', 'bwg'), 'error');
return;
}
$gallery_id = isset($params['gallery_id']) ? esc_html($params['gallery_id']) : 0;
$sort_by = isset($params['sort_by']) ? esc_html($params['sort_by']) : 'order';
$slideshow_effect = isset($params['slideshow_effect']) ? esc_html($params['slideshow_effect']) : 'fade';
$enable_slideshow_autoplay = isset($params['enable_slideshow_autoplay']) ? esc_html($params['enable_slideshow_autoplay']) : 0;
$enable_slideshow_shuffle = isset($params['enable_slideshow_shuffle']) ? esc_html($params['enable_slideshow_shuffle']) : 0;
$enable_slideshow_ctrl = isset($params['enable_slideshow_ctrl']) ? esc_html($params['enable_slideshow_ctrl']) : 0;
$enable_slideshow_filmstrip = FALSE;
$slideshow_filmstrip_height = 0;
$slideshow_filmstrip_width = 0;
$enable_image_title = isset($params['slideshow_enable_title']) ? esc_html($params['slideshow_enable_title']) : 0;
$slideshow_title_position = explode('-', isset($params['slideshow_title_position']) ? esc_html($params['slideshow_title_position']) : 'bottom-right');
$enable_image_description = isset($params['slideshow_enable_description']) ? esc_html($params['slideshow_enable_description']) : 0;
$slideshow_description_position = explode('-', isset($params['slideshow_description_position']) ? esc_html($params['slideshow_description_position']) : 'bottom-right');
$enable_slideshow_music = isset($params['enable_slideshow_music']) ? esc_html($params['enable_slideshow_music']) : 0;
$slideshow_music_url = isset($params['slideshow_music_url']) ? esc_html($params['slideshow_music_url']) : '';
$image_width = isset($params['slideshow_width']) ? esc_html($params['slideshow_width']) : '800';
$image_height = isset($params['slideshow_height']) ? esc_html($params['slideshow_height']) : '600';
$slideshow_interval = isset($params['slideshow_interval']) ? esc_html($params['slideshow_interval']) : 5;
$watermark_type = isset($params['watermark_type']) ? esc_html($params['watermark_type']) : 'none';
$watermark_text = isset($params['watermark_text']) ? esc_html($params['watermark_text']) : '';
$watermark_font_size = isset($params['watermark_font_size']) ? esc_html($params['watermark_font_size']) : 12;
$watermark_font = isset($params['watermark_font']) ? esc_html($params['watermark_font']) : 'Arial';
$watermark_color = isset($params['watermark_color']) ? esc_html($params['watermark_color']) : 'FFFFFF';
$watermark_opacity = isset($params['watermark_opacity']) ? esc_html($params['watermark_opacity']) : 30;
$watermark_position = explode('-', isset($params['watermark_position']) ? esc_html($params['watermark_position']) : 'bottom-right');
$watermark_link = isset($params['watermark_link']) ? esc_html($params['watermark_link']) : '';
$watermark_url = isset($params['watermark_url']) ? esc_html($params['watermark_url']) : '';
$watermark_width = isset($params['watermark_width']) ? esc_html($params['watermark_width']) : 90;
$watermark_height = isset($params['watermark_height']) ? esc_html($params['watermark_height']) : 90;
} else {
$theme_id = isset($params['theme_id']) ? esc_html($params['theme_id']) : 0;
$theme_row = $this->model->get_theme_row_data($theme_id);
if (!$theme_row) {
echo WDWLibrary::message(__('There is no theme selected or the theme was deleted.', 'bwg'), 'error');
return;
}
$gallery_id = isset($params['gallery_id']) ? esc_html($params['gallery_id']) : 0;
$sort_by = 'order';
$slideshow_effect = isset($params['effect']) ? esc_html($params['effect']) : 'fade';
$enable_slideshow_autoplay = $options_row->slideshow_enable_autoplay;
$enable_slideshow_shuffle = isset($params['shuffle']) ? esc_html($params['shuffle']) : 0;
$enable_slideshow_ctrl = $options_row->slideshow_enable_ctrl;
$enable_slideshow_filmstrip = FALSE;
$slideshow_filmstrip_height = 0;
$slideshow_filmstrip_width = 0;
$enable_image_title = $options_row->slideshow_enable_title;
$slideshow_title_position = explode('-', $options_row->slideshow_title_position);
$enable_image_description = $options_row->slideshow_enable_description;
$slideshow_description_position = explode('-', $options_row->slideshow_description_position);
$enable_slideshow_music = $options_row->slideshow_enable_music;
$slideshow_music_url = $options_row->slideshow_audio_url;
$image_width = isset($params['width']) ? esc_html($params['width']) : '800';
$image_height = isset($params['height']) ? esc_html($params['height']) : '600';
$slideshow_interval = isset($params['interval']) ? esc_html($params['interval']) : 5;
$watermark_type = $options_row->watermark_type;
$watermark_text = $options_row->watermark_text;
$watermark_font_size = $options_row->watermark_font_size;
$watermark_font = $options_row->watermark_font;
$watermark_color = $options_row->watermark_color;
$watermark_opacity = $options_row->watermark_opacity;
$watermark_position = explode('-', $options_row->watermark_position);
$watermark_link = $options_row->watermark_link;
$watermark_url = $options_row->watermark_url;
$watermark_width = $options_row->watermark_width;
$watermark_height = $options_row->watermark_height;
}
$gallery_row = $this->model->get_gallery_row_data($gallery_id);
if (!$gallery_row) {
echo WDWLibrary::message(__('There is no gallery selected or the gallery was deleted.', 'bwg'), 'error');
return;
}
$image_rows = $this->model->get_image_rows_data($gallery_id, $sort_by, $order_by, $bwg);
if (!$image_rows) {
echo WDWLibrary::message(__('There are no images in this gallery.', 'bwg'), 'error');
}
$current_image_id = $image_rows ? $image_rows[0]->id : 0;
$play_pause_button_display = 'undefined';
//.........这里部分代码省略.........
示例6: display
//.........这里部分代码省略.........
echo $key;
?>
"]["avg_rating"] = "<?php
echo $image_row->avg_rating;
?>
";
data["<?php
echo $key;
?>
"]["rate"] = "<?php
echo $image_row->rate;
?>
";
data["<?php
echo $key;
?>
"]["rate_count"] = "<?php
echo $image_row->rate_count;
?>
";
data["<?php
echo $key;
?>
"]["hit_count"] = "<?php
echo $image_row->hit_count;
?>
";
<?php
}
?>
</script>
<?php
if (!$image_id_exist) {
echo WDWLibrary::message(__('The image has been deleted.', 'bwg'), 'wd_error');
die;
}
?>
<div class="bwg_image_wrap">
<?php
if ($enable_image_ctrl_btn) {
?>
<div class="bwg_btn_container">
<div class="bwg_ctrl_btn_container">
<?php
if ($option_row->show_image_counts) {
?>
<span class="bwg_image_count_container bwg_ctrl_btn">
<span class="bwg_image_count"><?php
echo $current_image_key + 1;
?>
</span> /
<span><?php
echo count($image_rows);
?>
</span>
</span>
<?php
}
?>
<i title="<?php
echo __('Play', 'bwg');
?>
" class="bwg_ctrl_btn bwg_play_pause fa fa-play"></i>
<?php
if ($enable_image_fullscreen) {
if (!$open_with_fullscreen) {
示例7: setdefault
public function setdefault($id)
{
global $wpdb;
$save = $wpdb->update($wpdb->prefix . 'bwg_theme', array('default_theme' => 0), array('default_theme' => 1));
$save = $wpdb->update($wpdb->prefix . 'bwg_theme', array('default_theme' => 1), array('id' => $id));
if ($save !== FALSE) {
echo WDWLibrary::message('Item Succesfully Set As Default.', 'updated');
} else {
echo WDWLibrary::message('Error. Please install plugin again.', 'error');
}
$this->display();
}
示例8: display
public function display($params, $from_shortcode = 0, $bwg = 0)
{
global $wp;
$current_url = $wp->query_string;
global $WD_BWG_UPLOAD_DIR;
require_once WD_BWG_DIR . '/framework/WDWLibrary.php';
if (!isset($params['image_title'])) {
$params['image_title'] = 'none';
}
$from = isset($params['from']) ? esc_html($params['from']) : 0;
$sort_direction = ' ASC ';
if ($from) {
$options_row = $this->model->get_options_row_data();
$params['gallery_id'] = $params['id'];
$params['images_per_page'] = $params['count'];
$params['sort_by'] = $params['show'] == 'random' ? 'RAND()' : 'order';
if ($params['show'] == 'last') {
$sort_direction = ' DESC ';
}
$params['image_enable_page'] = 0;
$params['image_title'] = $options_row->image_title_show_hover;
$params['thumb_height'] = $params['height'];
$params['thumb_width'] = $params['width'];
$params['image_column_number'] = $params['count'];
$params['popup_width'] = $options_row->popup_width;
$params['popup_height'] = $options_row->popup_height;
$params['popup_effect'] = $options_row->popup_type;
$params['popup_enable_filmstrip'] = $options_row->popup_enable_filmstrip;
$params['popup_filmstrip_height'] = $options_row->popup_filmstrip_height;
$params['popup_enable_ctrl_btn'] = $options_row->popup_enable_ctrl_btn;
$params['popup_enable_fullscreen'] = $options_row->popup_enable_fullscreen;
$params['popup_interval'] = $options_row->popup_interval;
$params['popup_enable_comment'] = $options_row->popup_enable_comment;
$params['popup_enable_facebook'] = $options_row->popup_enable_facebook;
$params['popup_enable_twitter'] = $options_row->popup_enable_twitter;
$params['popup_enable_google'] = $options_row->popup_enable_google;
$params['watermark_type'] = $options_row->watermark_type;
$params['watermark_link'] = $options_row->watermark_link;
$params['watermark_opacity'] = $options_row->watermark_opacity;
$params['watermark_position'] = $options_row->watermark_position;
$params['watermark_text'] = $options_row->watermark_text;
$params['watermark_font_size'] = $options_row->watermark_font_size;
$params['watermark_font'] = $options_row->watermark_font;
$params['watermark_color'] = $options_row->watermark_color;
$params['watermark_url'] = $options_row->watermark_url;
$params['watermark_width'] = $options_row->watermark_width;
$params['watermark_height'] = $options_row->watermark_height;
}
$theme_row = $this->model->get_theme_row_data($params['theme_id']);
if (!$theme_row) {
echo WDWLibrary::message(__('There is no theme selected or the theme was deleted.', 'bwg'), 'error');
return;
}
if (isset($params['type'])) {
$type = $params['type'];
} else {
$type = "";
}
$gallery_row = $this->model->get_gallery_row_data($params['gallery_id']);
if (!$gallery_row && $type == '') {
echo WDWLibrary::message(__('There is no gallery selected or the gallery was deleted.', 'bwg'), 'error');
return;
}
$image_rows = $this->model->get_image_rows_data($params['gallery_id'], $params['images_per_page'], $params['sort_by'], $bwg, $type, $sort_direction);
if (!$image_rows) {
echo WDWLibrary::message(__('There are no images in this gallery.', 'bwg'), 'error');
}
if ($params['image_enable_page'] && $params['images_per_page']) {
$page_nav = $this->model->page_nav($params['gallery_id'], $params['images_per_page'], $bwg, $type);
}
$rgb_page_nav_font_color = WDWLibrary::spider_hex2rgb($theme_row->page_nav_font_color);
$rgb_thumbs_bg_color = WDWLibrary::spider_hex2rgb($theme_row->thumbs_bg_color);
?>
<style>
#bwg_container1_<?php
echo $bwg;
?>
#bwg_container2_<?php
echo $bwg;
?>
.bwg_standart_thumbnails_<?php
echo $bwg;
?>
* {
-moz-box-sizing: border-box;
box-sizing: border-box;
}
#bwg_container1_<?php
echo $bwg;
?>
#bwg_container2_<?php
echo $bwg;
?>
.bwg_standart_thumb_spun1_<?php
echo $bwg;
?>
{
-moz-box-sizing: content-box;
box-sizing: content-box;
background-color: #<?php
//.........这里部分代码省略.........
示例9: save_order
public function save_order($flag = TRUE)
{
global $wpdb;
$album_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'bwg_album');
if ($album_ids_col) {
foreach ($album_ids_col as $album_id) {
if (isset($_POST['order_input_' . $album_id])) {
$order_values[$album_id] = (int) $_POST['order_input_' . $album_id];
} else {
$order_values[$album_id] = (int) $wpdb->get_var($wpdb->prepare('SELECT `order` FROM ' . $wpdb->prefix . 'bwg_album WHERE `id`="%d"', $album_id));
}
}
asort($order_values);
$i = 1;
foreach ($order_values as $key => $order_value) {
$wpdb->update($wpdb->prefix . 'bwg_album', array('order' => $i), array('id' => $key));
$i++;
}
if ($flag) {
echo WDWLibrary::message('Ordering Succesfully Saved.', 'updated');
}
}
$this->display();
}
示例10: display
public function display($params, $from_shortcode = 0, $bwg = 0)
{
global $wp;
$current_url = $wp->query_string;
global $WD_BWG_UPLOAD_DIR;
require_once WD_BWG_DIR . '/framework/WDWLibrary.php';
if (!isset($params['extended_album_image_title'])) {
$params['extended_album_image_title'] = 'none';
}
$theme_row = $this->model->get_theme_row_data($params['theme_id']);
if (!$theme_row) {
echo WDWLibrary::message(__('There is no theme selected or the theme was deleted.', 'bwg'), 'error');
return;
}
$type = isset($_POST['type_' . $bwg]) ? esc_html($_POST['type_' . $bwg]) : 'album';
$album_gallery_id = isset($_POST['album_gallery_id_' . $bwg]) ? esc_html($_POST['album_gallery_id_' . $bwg]) : $params['album_id'];
if (!$album_gallery_id) {
echo WDWLibrary::message(__('There is no album selected or the album was deleted.', 'bwg'), 'error');
return;
}
if ($type == 'gallery') {
$items_per_page = $params['extended_album_images_per_page'];
$items_col_num = $params['extended_album_image_column_number'];
$image_rows = $this->model->get_image_rows_data($album_gallery_id, $items_per_page, $params['sort_by'], $bwg);
$page_nav = $this->model->gallery_page_nav($album_gallery_id, $items_per_page, $bwg);
$album_gallery_div_id = 'bwg_album_extended_' . $bwg;
$album_gallery_div_class = 'bwg_standart_thumbnails_' . $bwg;
} else {
$items_per_page = $params['extended_albums_per_page'];
$items_col_num = 1;
$album_galleries_row = $this->model->get_alb_gals_row($album_gallery_id, $items_per_page, $params['sort_by'], $bwg);
$page_nav = $this->model->album_page_nav($album_gallery_id, $items_per_page, $bwg);
$album_gallery_div_id = 'bwg_album_extended_' . $bwg;
$album_gallery_div_class = 'bwg_album_extended_thumbnails_' . $bwg;
}
$bwg_previous_album_id = isset($_POST['bwg_previous_album_id_' . $bwg]) ? esc_html($_POST['bwg_previous_album_id_' . $bwg]) : 0;
$bwg_previous_album_page_number = isset($_POST['bwg_previous_album_page_number_' . $bwg]) ? esc_html($_POST['bwg_previous_album_page_number_' . $bwg]) : 0;
$rgb_page_nav_font_color = WDWLibrary::spider_hex2rgb($theme_row->page_nav_font_color);
$rgb_album_extended_thumbs_bg_color = WDWLibrary::spider_hex2rgb($theme_row->album_extended_thumbs_bg_color);
$rgb_album_extended_div_bg_color = WDWLibrary::spider_hex2rgb($theme_row->album_extended_div_bg_color);
$rgb_thumbs_bg_color = WDWLibrary::spider_hex2rgb($theme_row->thumbs_bg_color);
?>
<style>
#bwg_container1_<?php
echo $bwg;
?>
#bwg_container2_<?php
echo $bwg;
?>
.bwg_album_extended_thumbnails_<?php
echo $bwg;
?>
* {
-moz-box-sizing: border-box;
box-sizing: border-box;
}
#bwg_container1_<?php
echo $bwg;
?>
#bwg_container2_<?php
echo $bwg;
?>
.bwg_album_extended_thumbnails_<?php
echo $bwg;
?>
{
display: block;
-moz-box-sizing: border-box;
box-sizing: border-box;
background-color: rgba(<?php
echo $rgb_album_extended_thumbs_bg_color['red'];
?>
, <?php
echo $rgb_album_extended_thumbs_bg_color['green'];
?>
, <?php
echo $rgb_album_extended_thumbs_bg_color['blue'];
?>
, <?php
echo $theme_row->album_extended_thumb_bg_transparent / 100;
?>
);
font-size: 0;
text-align: <?php
echo $theme_row->album_extended_thumb_align;
?>
;
max-width: inherit;
}
#bwg_container1_<?php
echo $bwg;
?>
#bwg_container2_<?php
echo $bwg;
?>
.bwg_album_extended_thumbnails_<?php
echo $bwg;
?>
a {
cursor: pointer;
//.........这里部分代码省略.........
示例11: display
//.........这里部分代码省略.........
$params['popup_width'] = $options_row->popup_width;
$params['popup_height'] = $options_row->popup_height;
$params['popup_effect'] = $options_row->popup_type;
$params['popup_enable_filmstrip'] = $options_row->popup_enable_filmstrip;
$params['popup_filmstrip_height'] = $options_row->popup_filmstrip_height;
$params['popup_enable_ctrl_btn'] = $options_row->popup_enable_ctrl_btn;
$params['popup_enable_fullscreen'] = $options_row->popup_enable_fullscreen;
$params['popup_enable_info'] = $options_row->popup_enable_info;
$params['popup_info_always_show'] = $options_row->popup_info_always_show;
$params['popup_info_full_width'] = $options_row->popup_info_full_width;
$params['popup_hit_counter'] = $options_row->popup_hit_counter;
$params['popup_enable_rate'] = $options_row->popup_enable_rate;
$params['popup_interval'] = $options_row->popup_interval;
$params['popup_enable_comment'] = $options_row->popup_enable_comment;
$params['popup_enable_facebook'] = $options_row->popup_enable_facebook;
$params['popup_enable_twitter'] = $options_row->popup_enable_twitter;
$params['popup_enable_google'] = $options_row->popup_enable_google;
$params['popup_enable_pinterest'] = $options_row->popup_enable_pinterest;
$params['popup_enable_tumblr'] = $options_row->popup_enable_tumblr;
$params['watermark_type'] = $options_row->watermark_type;
$params['watermark_link'] = $options_row->watermark_link;
$params['watermark_opacity'] = $options_row->watermark_opacity;
$params['watermark_position'] = $options_row->watermark_position;
$params['watermark_text'] = $options_row->watermark_text;
$params['watermark_font_size'] = $options_row->watermark_font_size;
$params['watermark_font'] = $options_row->watermark_font;
$params['watermark_color'] = $options_row->watermark_color;
$params['watermark_url'] = $options_row->watermark_url;
$params['watermark_width'] = $options_row->watermark_width;
$params['watermark_height'] = $options_row->watermark_height;
}
$theme_row = $this->model->get_theme_row_data($params['theme_id']);
if (!$theme_row) {
echo WDWLibrary::message(__('There is no theme selected or the theme was deleted.', 'bwg'), 'error');
return;
}
$album_gallery_id = isset($_POST['album_gallery_id_' . $bwg]) ? esc_html($_POST['album_gallery_id_' . $bwg]) : $params['album_id'];
$album_row_data = $this->model->get_album_row_data($album_gallery_id);
if (!$album_gallery_id || $type == 'album' && !$album_row_data) {
echo WDWLibrary::message(__('There is no album selected or the album was deleted.', 'bwg'), 'error');
return;
}
if ($type == 'gallery') {
$items_per_page = $params['compuct_album_images_per_page'];
$items_col_num = $params['compuct_album_image_column_number'];
if (isset($_POST['sortImagesByValue_' . $bwg])) {
$sort_by = esc_html($_POST['sortImagesByValue_' . $bwg]);
if ($sort_by == 'random') {
$params['sort_by'] = 'RAND()';
} else {
if ($sort_by == 'default') {
$params['sort_by'] = $params['sort_by'];
} else {
$params['sort_by'] = $sort_by;
}
}
}
$image_rows = $this->model->get_image_rows_data($album_gallery_id, $items_per_page, $params['sort_by'], $bwg, $sort_direction);
$images_count = count($image_rows);
if (!$image_rows) {
echo WDWLibrary::message(__('There are no images in this gallery.', 'bwg'), 'error');
}
$page_nav = $this->model->gallery_page_nav($album_gallery_id, $items_per_page, $bwg);
$album_gallery_div_id = 'bwg_album_compact_' . $bwg;
$album_gallery_div_class = 'bwg_standart_thumbnails_' . $bwg;
} else {
示例12: save_db
public function save_db()
{
global $wpdb;
$id = 1;
if (isset($_POST['old_images_directory'])) {
$old_images_directory = esc_html(stripslashes($_POST['old_images_directory']));
}
if (isset($_POST['images_directory'])) {
$images_directory = esc_html(stripslashes($_POST['images_directory']));
if (!is_dir(ABSPATH . $images_directory)) {
echo WDWLibrary::message('Uploads directory doesn\'t exist. Old value is restored.', 'error');
if ($old_images_directory) {
$images_directory = $old_images_directory;
} else {
$upload_dir = wp_upload_dir();
if (!is_dir($upload_dir['basedir'] . '/photo-gallery')) {
mkdir($upload_dir['basedir'] . '/photo-gallery', 0777);
}
$images_directory = str_replace(ABSPATH, '', $upload_dir['basedir']);
}
}
} else {
$upload_dir = wp_upload_dir();
if (!is_dir($upload_dir['basedir'] . '/photo-gallery')) {
mkdir($upload_dir['basedir'] . '/photo-gallery', 0777);
}
$images_directory = str_replace(ABSPATH, '', $upload_dir['basedir']);
}
$resize_image = isset($_POST['resize_image']) ? esc_html(stripslashes($_POST['resize_image'])) : 1;
$masonry = isset($_POST['masonry']) ? esc_html(stripslashes($_POST['masonry'])) : 'horizontal';
$image_column_number = isset($_POST['image_column_number']) ? esc_html(stripslashes($_POST['image_column_number'])) : 5;
$images_per_page = isset($_POST['images_per_page']) ? esc_html(stripslashes($_POST['images_per_page'])) : 30;
$thumb_width = isset($_POST['thumb_width']) ? esc_html(stripslashes($_POST['thumb_width'])) : 120;
$thumb_height = isset($_POST['thumb_height']) ? esc_html(stripslashes($_POST['thumb_height'])) : 90;
$upload_thumb_width = isset($_POST['upload_thumb_width']) ? esc_html(stripslashes($_POST['upload_thumb_width'])) : 300;
$upload_thumb_height = isset($_POST['upload_thumb_height']) ? esc_html(stripslashes($_POST['upload_thumb_height'])) : 300;
$image_enable_page = isset($_POST['image_enable_page']) ? esc_html(stripslashes($_POST['image_enable_page'])) : 1;
$image_title_show_hover = isset($_POST['image_title_show_hover']) ? esc_html(stripslashes($_POST['image_title_show_hover'])) : 'none';
$album_column_number = isset($_POST['album_column_number']) ? esc_html(stripslashes($_POST['album_column_number'])) : 5;
$albums_per_page = isset($_POST['albums_per_page']) ? esc_html(stripslashes($_POST['albums_per_page'])) : 30;
$album_title_show_hover = isset($_POST['album_title_show_hover']) ? esc_html(stripslashes($_POST['album_title_show_hover'])) : 'hover';
$album_thumb_width = isset($_POST['album_thumb_width']) ? esc_html(stripslashes($_POST['album_thumb_width'])) : 120;
$album_thumb_height = isset($_POST['album_thumb_height']) ? esc_html(stripslashes($_POST['album_thumb_height'])) : 90;
$album_enable_page = isset($_POST['album_enable_page']) ? esc_html(stripslashes($_POST['album_enable_page'])) : 1;
$extended_album_height = isset($_POST['extended_album_height']) ? esc_html(stripslashes($_POST['extended_album_height'])) : 150;
$extended_album_description_enable = isset($_POST['extended_album_description_enable']) ? esc_html(stripslashes($_POST['extended_album_description_enable'])) : 1;
$image_browser_width = isset($_POST['image_browser_width']) ? esc_html(stripslashes($_POST['image_browser_width'])) : 800;
$image_browser_title_enable = isset($_POST['image_browser_title_enable']) ? esc_html(stripslashes($_POST['image_browser_title_enable'])) : 1;
$image_browser_description_enable = isset($_POST['image_browser_description_enable']) ? esc_html(stripslashes($_POST['image_browser_description_enable'])) : 1;
$blog_style_width = isset($_POST['blog_style_width']) ? esc_html(stripslashes($_POST['blog_style_width'])) : 800;
$blog_style_title_enable = isset($_POST['blog_style_title_enable']) ? esc_html(stripslashes($_POST['blog_style_title_enable'])) : 1;
$blog_style_images_per_page = isset($_POST['blog_style_images_per_page']) ? esc_html(stripslashes($_POST['blog_style_images_per_page'])) : 5;
$blog_style_enable_page = isset($_POST['blog_style_enable_page']) ? esc_html(stripslashes($_POST['blog_style_enable_page'])) : 1;
$slideshow_type = isset($_POST['slideshow_type']) ? esc_html(stripslashes($_POST['slideshow_type'])) : 'fade';
$slideshow_interval = isset($_POST['slideshow_interval']) ? esc_html(stripslashes($_POST['slideshow_interval'])) : 5;
$slideshow_width = isset($_POST['slideshow_width']) ? esc_html(stripslashes($_POST['slideshow_width'])) : 800;
$slideshow_height = isset($_POST['slideshow_height']) ? esc_html(stripslashes($_POST['slideshow_height'])) : 600;
$slideshow_enable_autoplay = isset($_POST['slideshow_enable_autoplay']) ? esc_html(stripslashes($_POST['slideshow_enable_autoplay'])) : 1;
$slideshow_enable_shuffle = isset($_POST['slideshow_enable_shuffle']) ? esc_html(stripslashes($_POST['slideshow_enable_shuffle'])) : 1;
$slideshow_enable_ctrl = isset($_POST['slideshow_enable_ctrl']) ? esc_html(stripslashes($_POST['slideshow_enable_ctrl'])) : 1;
$slideshow_enable_filmstrip = isset($_POST['slideshow_enable_filmstrip']) ? esc_html(stripslashes($_POST['slideshow_enable_filmstrip'])) : 1;
$slideshow_filmstrip_height = isset($_POST['slideshow_filmstrip_height']) ? esc_html(stripslashes($_POST['slideshow_filmstrip_height'])) : 70;
$slideshow_enable_title = isset($_POST['slideshow_enable_title']) ? esc_html(stripslashes($_POST['slideshow_enable_title'])) : 0;
$slideshow_title_position = isset($_POST['slideshow_title_position']) ? esc_html(stripslashes($_POST['slideshow_title_position'])) : 'top-right';
$slideshow_enable_description = isset($_POST['slideshow_enable_description']) ? esc_html(stripslashes($_POST['slideshow_enable_description'])) : 1;
$slideshow_description_position = isset($_POST['slideshow_description_position']) ? esc_html(stripslashes($_POST['slideshow_description_position'])) : 'bottom-right';
$slideshow_enable_music = isset($_POST['slideshow_enable_music']) ? esc_html(stripslashes($_POST['slideshow_enable_music'])) : 0;
$slideshow_audio_url = isset($_POST['slideshow_audio_url']) ? esc_html(stripslashes($_POST['slideshow_audio_url'])) : '';
$popup_width = isset($_POST['popup_width']) ? esc_html(stripslashes($_POST['popup_width'])) : 800;
$popup_height = isset($_POST['popup_height']) ? esc_html(stripslashes($_POST['popup_height'])) : 600;
$popup_type = isset($_POST['popup_type']) ? esc_html(stripslashes($_POST['popup_type'])) : 'fade';
$popup_interval = isset($_POST['popup_interval']) ? esc_html(stripslashes($_POST['popup_interval'])) : 5;
$popup_enable_filmstrip = isset($_POST['popup_enable_filmstrip']) ? esc_html(stripslashes($_POST['popup_enable_filmstrip'])) : 1;
$popup_filmstrip_height = isset($_POST['popup_filmstrip_height']) ? esc_html(stripslashes($_POST['popup_filmstrip_height'])) : 50;
$popup_enable_ctrl_btn = isset($_POST['popup_enable_ctrl_btn']) ? esc_html(stripslashes($_POST['popup_enable_ctrl_btn'])) : 1;
$popup_enable_fullscreen = isset($_POST['popup_enable_fullscreen']) ? esc_html(stripslashes($_POST['popup_enable_fullscreen'])) : 1;
$popup_enable_comment = isset($_POST['popup_enable_comment']) ? esc_html(stripslashes($_POST['popup_enable_comment'])) : 1;
$popup_enable_email = isset($_POST['popup_enable_email']) ? esc_html(stripslashes($_POST['popup_enable_email'])) : 0;
$popup_enable_captcha = isset($_POST['popup_enable_captcha']) ? esc_html(stripslashes($_POST['popup_enable_captcha'])) : 0;
$popup_enable_download = isset($_POST['popup_enable_download']) ? esc_html(stripslashes($_POST['popup_enable_download'])) : 0;
$popup_enable_fullsize_image = isset($_POST['popup_enable_fullsize_image']) ? esc_html(stripslashes($_POST['popup_enable_fullsize_image'])) : 0;
$popup_enable_facebook = isset($_POST['popup_enable_facebook']) ? esc_html(stripslashes($_POST['popup_enable_facebook'])) : 1;
$popup_enable_twitter = isset($_POST['popup_enable_twitter']) ? esc_html(stripslashes($_POST['popup_enable_twitter'])) : 1;
$popup_enable_google = isset($_POST['popup_enable_google']) ? esc_html(stripslashes($_POST['popup_enable_google'])) : 1;
$watermark_type = isset($_POST['watermark_type']) ? esc_html(stripslashes($_POST['watermark_type'])) : 'none';
$watermark_position = isset($_POST['watermark_position']) ? esc_html(stripslashes($_POST['watermark_position'])) : 'bottom-right';
$watermark_width = isset($_POST['watermark_width']) ? esc_html(stripslashes($_POST['watermark_width'])) : 600;
$watermark_height = isset($_POST['watermark_height']) ? esc_html(stripslashes($_POST['watermark_height'])) : 600;
$watermark_url = isset($_POST['watermark_url']) ? esc_html(stripslashes($_POST['watermark_url'])) : WD_BWG_URL . '/images/watermark.png';
$watermark_text = isset($_POST['watermark_text']) ? esc_html(stripslashes($_POST['watermark_text'])) : 'web-dorado.com';
$watermark_link = isset($_POST['watermark_link']) ? esc_html(stripslashes($_POST['watermark_link'])) : 'http://www.web-dorado.com';
$watermark_opacity = isset($_POST['watermark_opacity']) ? esc_html(stripslashes($_POST['watermark_opacity'])) : 30;
$watermark_font_size = isset($_POST['watermark_font_size']) ? esc_html(stripslashes($_POST['watermark_font_size'])) : 20;
$watermark_font = isset($_POST['watermark_font']) ? esc_html(stripslashes($_POST['watermark_font'])) : '';
$watermark_color = isset($_POST['watermark_color']) ? esc_html(stripslashes($_POST['watermark_color'])) : '';
$built_in_watermark_type = isset($_POST['built_in_watermark_type']) ? esc_html(stripslashes($_POST['built_in_watermark_type'])) : 'none';
$built_in_watermark_position = isset($_POST['built_in_watermark_position']) ? esc_html(stripslashes($_POST['built_in_watermark_position'])) : 'middle-center';
$built_in_watermark_size = isset($_POST['built_in_watermark_size']) ? esc_html(stripslashes($_POST['built_in_watermark_size'])) : 15;
$built_in_watermark_url = isset($_POST['built_in_watermark_url']) ? esc_html(stripslashes($_POST['built_in_watermark_url'])) : WD_BWG_URL . '/images/watermark.png';
$built_in_watermark_text = isset($_POST['built_in_watermark_text']) ? esc_html(stripslashes($_POST['built_in_watermark_text'])) : 'web-dorado.com';
//.........这里部分代码省略.........
示例13: delete_all
public function delete_all()
{
global $wpdb;
$flag = FALSE;
$tag_ids_col = $wpdb->get_col("SELECT term_id FROM " . $wpdb->prefix . "terms");
foreach ($tag_ids_col as $tag_id) {
if (isset($_POST['check_' . $tag_id])) {
wp_delete_term($tag_id, 'bwg_tag');
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'bwg_image_tag WHERE tag_id="%d"', $tag_id));
$flag = TRUE;
}
}
if ($flag) {
echo WDWLibrary::message('Items Succesfully Deleted.', 'updated');
} else {
echo WDWLibrary::message('You must select at least one item.', 'error');
}
$this->display();
}
示例14: save_db
public function save_db()
{
global $wpdb;
$id = 1;
if (isset($_POST['old_images_directory'])) {
$old_images_directory = esc_html(stripslashes($_POST['old_images_directory']));
}
if (isset($_POST['images_directory'])) {
$images_directory = esc_html(stripslashes($_POST['images_directory']));
if (!is_dir(ABSPATH . $images_directory)) {
echo WDWLibrary::message('Uploads directory doesn\'t exist. Old value is restored.', 'error');
if ($old_images_directory) {
$images_directory = $old_images_directory;
} else {
$upload_dir = wp_upload_dir();
if (!is_dir($upload_dir['basedir'] . '/photo-gallery')) {
mkdir($upload_dir['basedir'] . '/photo-gallery', 0777);
}
$images_directory = str_replace(ABSPATH, '', $upload_dir['basedir']);
}
}
} else {
$upload_dir = wp_upload_dir();
if (!is_dir($upload_dir['basedir'] . '/photo-gallery')) {
mkdir($upload_dir['basedir'] . '/photo-gallery', 0777);
}
$images_directory = str_replace(ABSPATH, '', $upload_dir['basedir']);
}
$resize_image = isset($_POST['resize_image']) ? esc_html(stripslashes($_POST['resize_image'])) : 1;
$masonry = isset($_POST['masonry']) ? esc_html(stripslashes($_POST['masonry'])) : 'vertical';
$mosaic = isset($_POST['mosaic']) ? esc_html(stripslashes($_POST['mosaic'])) : 'vertical';
$resizable_mosaic = isset($_POST['resizable_mosaic']) ? esc_html(stripslashes($_POST['resizable_mosaic'])) : 0;
$mosaic_total_width = isset($_POST['mosaic_total_width']) ? esc_html(stripslashes($_POST['mosaic_total_width'])) : 100;
$image_column_number = isset($_POST['image_column_number']) ? esc_html(stripslashes($_POST['image_column_number'])) : 5;
$images_per_page = isset($_POST['images_per_page']) ? esc_html(stripslashes($_POST['images_per_page'])) : 30;
$thumb_width = isset($_POST['thumb_width']) ? esc_html(stripslashes($_POST['thumb_width'])) : 120;
$thumb_height = isset($_POST['thumb_height']) ? esc_html(stripslashes($_POST['thumb_height'])) : 90;
$upload_thumb_width = isset($_POST['upload_thumb_width']) ? esc_html(stripslashes($_POST['upload_thumb_width'])) : 300;
$upload_thumb_height = isset($_POST['upload_thumb_height']) ? esc_html(stripslashes($_POST['upload_thumb_height'])) : 300;
$upload_img_width = isset($_POST['upload_img_width']) ? esc_html(stripslashes($_POST['upload_img_width'])) : 1200;
$upload_img_height = isset($_POST['upload_img_height']) ? esc_html(stripslashes($_POST['upload_img_height'])) : 1200;
$image_enable_page = isset($_POST['image_enable_page']) ? esc_html(stripslashes($_POST['image_enable_page'])) : 1;
$image_title_show_hover = isset($_POST['image_title_show_hover']) ? esc_html(stripslashes($_POST['image_title_show_hover'])) : 'none';
$album_column_number = isset($_POST['album_column_number']) ? esc_html(stripslashes($_POST['album_column_number'])) : 5;
$albums_per_page = isset($_POST['albums_per_page']) ? esc_html(stripslashes($_POST['albums_per_page'])) : 30;
$album_title_show_hover = isset($_POST['album_title_show_hover']) ? esc_html(stripslashes($_POST['album_title_show_hover'])) : 'hover';
$album_thumb_width = isset($_POST['album_thumb_width']) ? esc_html(stripslashes($_POST['album_thumb_width'])) : 120;
$album_thumb_height = isset($_POST['album_thumb_height']) ? esc_html(stripslashes($_POST['album_thumb_height'])) : 90;
$album_enable_page = isset($_POST['album_enable_page']) ? esc_html(stripslashes($_POST['album_enable_page'])) : 1;
$extended_album_height = isset($_POST['extended_album_height']) ? esc_html(stripslashes($_POST['extended_album_height'])) : 150;
$extended_album_description_enable = isset($_POST['extended_album_description_enable']) ? esc_html(stripslashes($_POST['extended_album_description_enable'])) : 1;
$image_browser_width = isset($_POST['image_browser_width']) ? esc_html(stripslashes($_POST['image_browser_width'])) : 800;
$image_browser_title_enable = isset($_POST['image_browser_title_enable']) ? esc_html(stripslashes($_POST['image_browser_title_enable'])) : 1;
$image_browser_description_enable = isset($_POST['image_browser_description_enable']) ? esc_html(stripslashes($_POST['image_browser_description_enable'])) : 1;
$blog_style_width = isset($_POST['blog_style_width']) ? esc_html(stripslashes($_POST['blog_style_width'])) : 800;
$blog_style_title_enable = isset($_POST['blog_style_title_enable']) ? esc_html(stripslashes($_POST['blog_style_title_enable'])) : 1;
$blog_style_images_per_page = isset($_POST['blog_style_images_per_page']) ? esc_html(stripslashes($_POST['blog_style_images_per_page'])) : 5;
$blog_style_enable_page = isset($_POST['blog_style_enable_page']) ? esc_html(stripslashes($_POST['blog_style_enable_page'])) : 1;
$slideshow_type = isset($_POST['slideshow_type']) ? esc_html(stripslashes($_POST['slideshow_type'])) : 'fade';
$slideshow_interval = isset($_POST['slideshow_interval']) ? esc_html(stripslashes($_POST['slideshow_interval'])) : 5;
$slideshow_width = isset($_POST['slideshow_width']) ? esc_html(stripslashes($_POST['slideshow_width'])) : 800;
$slideshow_height = isset($_POST['slideshow_height']) ? esc_html(stripslashes($_POST['slideshow_height'])) : 600;
$slideshow_enable_autoplay = isset($_POST['slideshow_enable_autoplay']) ? esc_html(stripslashes($_POST['slideshow_enable_autoplay'])) : 1;
$slideshow_enable_shuffle = isset($_POST['slideshow_enable_shuffle']) ? esc_html(stripslashes($_POST['slideshow_enable_shuffle'])) : 1;
$slideshow_enable_ctrl = isset($_POST['slideshow_enable_ctrl']) ? esc_html(stripslashes($_POST['slideshow_enable_ctrl'])) : 1;
$slideshow_enable_filmstrip = isset($_POST['slideshow_enable_filmstrip']) ? esc_html(stripslashes($_POST['slideshow_enable_filmstrip'])) : 1;
$slideshow_filmstrip_height = isset($_POST['slideshow_filmstrip_height']) ? esc_html(stripslashes($_POST['slideshow_filmstrip_height'])) : 70;
$slideshow_enable_title = isset($_POST['slideshow_enable_title']) ? esc_html(stripslashes($_POST['slideshow_enable_title'])) : 0;
$slideshow_title_position = isset($_POST['slideshow_title_position']) ? esc_html(stripslashes($_POST['slideshow_title_position'])) : 'top-right';
$slideshow_title_full_width = isset($_POST['slideshow_title_full_width']) ? esc_html(stripslashes($_POST['slideshow_title_full_width'])) : 0;
$slideshow_enable_description = isset($_POST['slideshow_enable_description']) ? esc_html(stripslashes($_POST['slideshow_enable_description'])) : 1;
$slideshow_description_position = isset($_POST['slideshow_description_position']) ? esc_html(stripslashes($_POST['slideshow_description_position'])) : 'bottom-right';
$slideshow_enable_music = isset($_POST['slideshow_enable_music']) ? esc_html(stripslashes($_POST['slideshow_enable_music'])) : 0;
$slideshow_audio_url = isset($_POST['slideshow_audio_url']) ? esc_html(stripslashes($_POST['slideshow_audio_url'])) : '';
$popup_width = isset($_POST['popup_width']) ? esc_html(stripslashes($_POST['popup_width'])) : 800;
$popup_height = isset($_POST['popup_height']) ? esc_html(stripslashes($_POST['popup_height'])) : 600;
$popup_type = isset($_POST['popup_type']) ? esc_html(stripslashes($_POST['popup_type'])) : 'fade';
$popup_interval = isset($_POST['popup_interval']) ? esc_html(stripslashes($_POST['popup_interval'])) : 5;
$popup_enable_filmstrip = isset($_POST['popup_enable_filmstrip']) ? esc_html(stripslashes($_POST['popup_enable_filmstrip'])) : 1;
$popup_filmstrip_height = isset($_POST['popup_filmstrip_height']) ? esc_html(stripslashes($_POST['popup_filmstrip_height'])) : 50;
$popup_enable_ctrl_btn = isset($_POST['popup_enable_ctrl_btn']) ? esc_html(stripslashes($_POST['popup_enable_ctrl_btn'])) : 1;
$popup_enable_fullscreen = isset($_POST['popup_enable_fullscreen']) ? esc_html(stripslashes($_POST['popup_enable_fullscreen'])) : 1;
$popup_enable_comment = isset($_POST['popup_enable_comment']) ? esc_html(stripslashes($_POST['popup_enable_comment'])) : 1;
$popup_enable_email = isset($_POST['popup_enable_email']) ? esc_html(stripslashes($_POST['popup_enable_email'])) : 0;
$popup_enable_captcha = isset($_POST['popup_enable_captcha']) ? esc_html(stripslashes($_POST['popup_enable_captcha'])) : 0;
$popup_enable_download = isset($_POST['popup_enable_download']) ? esc_html(stripslashes($_POST['popup_enable_download'])) : 0;
$popup_enable_fullsize_image = isset($_POST['popup_enable_fullsize_image']) ? esc_html(stripslashes($_POST['popup_enable_fullsize_image'])) : 0;
$popup_enable_facebook = isset($_POST['popup_enable_facebook']) ? esc_html(stripslashes($_POST['popup_enable_facebook'])) : 1;
$popup_enable_twitter = isset($_POST['popup_enable_twitter']) ? esc_html(stripslashes($_POST['popup_enable_twitter'])) : 1;
$popup_enable_google = isset($_POST['popup_enable_google']) ? esc_html(stripslashes($_POST['popup_enable_google'])) : 1;
$popup_enable_pinterest = isset($_POST['popup_enable_pinterest']) ? esc_html(stripslashes($_POST['popup_enable_pinterest'])) : 0;
$popup_enable_tumblr = isset($_POST['popup_enable_tumblr']) ? esc_html(stripslashes($_POST['popup_enable_tumblr'])) : 0;
$watermark_type = isset($_POST['watermark_type']) ? esc_html(stripslashes($_POST['watermark_type'])) : 'none';
$watermark_position = isset($_POST['watermark_position']) ? esc_html(stripslashes($_POST['watermark_position'])) : 'bottom-right';
$watermark_width = isset($_POST['watermark_width']) ? esc_html(stripslashes($_POST['watermark_width'])) : 600;
$watermark_height = isset($_POST['watermark_height']) ? esc_html(stripslashes($_POST['watermark_height'])) : 600;
$watermark_url = isset($_POST['watermark_url']) ? esc_html(stripslashes($_POST['watermark_url'])) : WD_BWG_URL . '/images/watermark.png';
$watermark_text = isset($_POST['watermark_text']) ? esc_html(stripslashes($_POST['watermark_text'])) : 'web-dorado.com';
$watermark_link = isset($_POST['watermark_link']) ? esc_html(stripslashes($_POST['watermark_link'])) : 'http://www.web-dorado.com';
$watermark_opacity = isset($_POST['watermark_opacity']) ? esc_html(stripslashes($_POST['watermark_opacity'])) : 30;
//.........这里部分代码省略.........
示例15: unpublish_all
public function unpublish_all()
{
global $wpdb;
$flag = FALSE;
if (isset($_POST['check_all_items'])) {
$wpdb->query('UPDATE ' . $wpdb->prefix . 'bwg_gallery SET published=0');
$flag = TRUE;
} else {
$gal_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'bwg_gallery');
foreach ($gal_ids_col as $gal_id) {
if (isset($_POST['check_' . $gal_id])) {
$flag = TRUE;
$wpdb->update($wpdb->prefix . 'bwg_gallery', array('published' => 0), array('id' => $gal_id));
}
}
}
if ($flag) {
echo WDWLibrary::message('Items Succesfully Unpublished.', 'updated');
} else {
echo WDWLibrary::message('You must select at least one item.', 'error');
}
$this->display();
}