Version Description
Download this release
Release Info
Developer | webdorado |
Plugin | Photo Gallery by WD – Responsive Photo Gallery |
Version | 1.2.0 |
Comparing to | |
See all releases |
Code changes from version 1.1.31 to 1.2.0
- admin/controllers/BWGControllerBWGShortcode.php +26 -0
- admin/models/BWGModelBWGShortcode.php +6 -0
- admin/models/BWGModelUninstall_bwg.php +1 -0
- admin/views/BWGViewBWGShortcode.php +84 -33
- admin/views/BWGViewUninstall_bwg.php +3 -1
- photo-gallery.php +18 -3
- readme.txt +1 -1
- update/bwg_update.php +8 -0
admin/controllers/BWGControllerBWGShortcode.php
CHANGED
@@ -19,6 +19,10 @@ class BWGControllerBWGShortcode {
|
|
19 |
// Public Methods //
|
20 |
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
public function execute() {
|
|
|
|
|
|
|
|
|
22 |
$this->display();
|
23 |
}
|
24 |
|
@@ -31,6 +35,28 @@ class BWGControllerBWGShortcode {
|
|
31 |
$view->display();
|
32 |
}
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
// Getters & Setters //
|
36 |
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
// Public Methods //
|
20 |
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
public function execute() {
|
22 |
+
$task = WDWLibrary::get('task');
|
23 |
+
if (method_exists($this, $task)) {
|
24 |
+
$this->$task();
|
25 |
+
}
|
26 |
$this->display();
|
27 |
}
|
28 |
|
35 |
$view->display();
|
36 |
}
|
37 |
|
38 |
+
public function save() {
|
39 |
+
global $wpdb;
|
40 |
+
$tagtext = ((isset($_POST['tagtext'])) ? stripslashes($_POST['tagtext']) : '');
|
41 |
+
if ($tagtext) {
|
42 |
+
$id = ((isset($_POST['currrent_id'])) ? (int) esc_html(stripslashes($_POST['currrent_id'])) : 0);
|
43 |
+
$insert = ((isset($_POST['bwg_insert'])) ? (int) esc_html(stripslashes($_POST['bwg_insert'])) : 0);
|
44 |
+
if (!$insert) {
|
45 |
+
$save = $wpdb->update($wpdb->prefix . 'bwg_shortcode', array(
|
46 |
+
'tagtext' => $tagtext
|
47 |
+
), array('id' => $id));
|
48 |
+
}
|
49 |
+
else {
|
50 |
+
$save = $wpdb->insert($wpdb->prefix . 'bwg_shortcode', array(
|
51 |
+
'id' => $id,
|
52 |
+
'tagtext' => $tagtext
|
53 |
+
), array(
|
54 |
+
'%d',
|
55 |
+
'%s'
|
56 |
+
));
|
57 |
+
}
|
58 |
+
}
|
59 |
+
}
|
60 |
////////////////////////////////////////////////////////////////////////////////////////
|
61 |
// Getters & Setters //
|
62 |
////////////////////////////////////////////////////////////////////////////////////////
|
admin/models/BWGModelBWGShortcode.php
CHANGED
@@ -19,6 +19,12 @@ class BWGModelBWGShortcode {
|
|
19 |
// Public Methods //
|
20 |
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
public function get_gallery_rows_data() {
|
23 |
global $wpdb;
|
24 |
$query = "SELECT * FROM " . $wpdb->prefix . "bwg_gallery WHERE published=1 ORDER BY name";
|
19 |
// Public Methods //
|
20 |
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
|
22 |
+
public function get_shortcode_data() {
|
23 |
+
global $wpdb;
|
24 |
+
$shortcode = $wpdb->get_results("SELECT id, tagtext FROM " . $wpdb->prefix . "bwg_shortcode");
|
25 |
+
return $shortcode;
|
26 |
+
}
|
27 |
+
|
28 |
public function get_gallery_rows_data() {
|
29 |
global $wpdb;
|
30 |
$query = "SELECT * FROM " . $wpdb->prefix . "bwg_gallery WHERE published=1 ORDER BY name";
|
admin/models/BWGModelUninstall_bwg.php
CHANGED
@@ -29,6 +29,7 @@ class BWGModelUninstall_bwg {
|
|
29 |
$wpdb->query("DROP TABLE " . $wpdb->prefix . "bwg_image_tag");
|
30 |
$wpdb->query("DROP TABLE " . $wpdb->prefix . "bwg_option");
|
31 |
$wpdb->query("DROP TABLE " . $wpdb->prefix . "bwg_theme");
|
|
|
32 |
delete_option("wd_bwg_version");
|
33 |
delete_option("wd_bwg_theme_version");
|
34 |
// Delete terms.
|
29 |
$wpdb->query("DROP TABLE " . $wpdb->prefix . "bwg_image_tag");
|
30 |
$wpdb->query("DROP TABLE " . $wpdb->prefix . "bwg_option");
|
31 |
$wpdb->query("DROP TABLE " . $wpdb->prefix . "bwg_theme");
|
32 |
+
$wpdb->query("DROP TABLE " . $wpdb->prefix . "bwg_shortcode");
|
33 |
delete_option("wd_bwg_version");
|
34 |
delete_option("wd_bwg_theme_version");
|
35 |
// Delete terms.
|
admin/views/BWGViewBWGShortcode.php
CHANGED
@@ -28,6 +28,7 @@ class BWGViewBWGShortcode {
|
|
28 |
$option_row = $this->model->get_option_row_data();
|
29 |
$theme_rows = $this->model->get_theme_rows_data();
|
30 |
$from_menu = ((isset($_GET['page']) && (esc_html($_GET['page']) == 'BWGShortcode')) ? TRUE : FALSE);
|
|
|
31 |
$effects = array(
|
32 |
'none' => 'None',
|
33 |
'cubeH' => 'Cube Horizontal',
|
@@ -69,11 +70,11 @@ class BWGViewBWGShortcode {
|
|
69 |
<script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
|
70 |
<?php
|
71 |
wp_print_scripts('jquery');
|
72 |
-
wp_print_scripts('jquery-ui-core');
|
73 |
-
wp_print_scripts('jquery-ui-widget');
|
74 |
-
wp_print_scripts('jquery-ui-position');
|
75 |
-
wp_print_scripts('jquery-ui-tooltip');
|
76 |
}
|
|
|
|
|
|
|
|
|
77 |
?>
|
78 |
<link rel="stylesheet" href="<?php echo WD_BWG_URL . '/css/bwg_shortcode.css?ver='; ?><?php echo get_option("wd_bwg_version"); ?>">
|
79 |
<link rel="stylesheet" href="<?php echo WD_BWG_URL . '/css/jquery-ui-1.10.3.custom.css'; ?>">
|
@@ -86,7 +87,7 @@ class BWGViewBWGShortcode {
|
|
86 |
<base target="_self">
|
87 |
</head>
|
88 |
<body id="link" onLoad="tinyMCEPopup.executeOnLoad('init();');document.body.style.display='';" dir="ltr" class="forceColors">
|
89 |
-
<form method="post" action="#">
|
90 |
<div class="tabs" role="tablist" tabindex="-1">
|
91 |
<ul>
|
92 |
<li id="display_tab" class="current" role="tab" tabindex="0">
|
@@ -102,7 +103,8 @@ class BWGViewBWGShortcode {
|
|
102 |
}
|
103 |
else {
|
104 |
?>
|
105 |
-
<
|
|
|
106 |
<?php
|
107 |
}
|
108 |
?>
|
@@ -852,30 +854,51 @@ class BWGViewBWGShortcode {
|
|
852 |
<a id="bwg_pro_version_link" class="button button-primary" target="_blank" style="line-height: 25px; padding: 0 5px; text-decoration: none; vertical-align: middle; width: inherit; float: left;" href="http://wpdemo.web-dorado.com/thumbnails-view-2/">Please see Pro <span id="bwg_pro_version">Thumbnail</span> View</a>
|
853 |
</div>
|
854 |
<div style="float:right;">
|
855 |
-
<input type="
|
856 |
<input type="button" id="cancel" name="cancel" value="Cancel" onClick="tinyMCEPopup.close();" />
|
857 |
</div>
|
858 |
</div>
|
859 |
-
</form>
|
860 |
<?php
|
861 |
}
|
862 |
else {
|
|
|
|
|
|
|
|
|
|
|
|
|
863 |
?>
|
864 |
<hr style="float: left; width: 100%;" />
|
865 |
<span style="float: left; width: 100%;">
|
866 |
<a id="bwg_pro_version_link" class="button button-primary" target="_blank" style="display: table; margin-bottom: 5px;" href="http://web-dorado.com/products/wordpress-photo-gallery-plugin.html">Please see Pro <span id="bwg_pro_version">Thumbnail</span> View</a>
|
867 |
<input type="button" class="button-primary" id="insert" name="insert" value="Generate" onclick="bwg_insert_shortcode('');" />
|
868 |
<input type="button" class="button-secondary" id="import" name="import" value="Import" onclick="bwg_update_shortcode()" />
|
869 |
-
<textarea style="width: 100%; resize: vertical; margin-top: 5px;" id="bwg_shortcode" rows="
|
870 |
</span>
|
871 |
</div>
|
872 |
<?php
|
873 |
}
|
874 |
?>
|
875 |
-
|
876 |
-
|
877 |
-
|
|
|
|
|
|
|
878 |
<script type="text/javascript">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
879 |
bwg_update_shortcode();
|
880 |
<?php if (!$from_menu) { ?>
|
881 |
var content = tinyMCE.activeEditor.selection.getContent();
|
@@ -883,17 +906,27 @@ class BWGViewBWGShortcode {
|
|
883 |
var content = jQuery("#bwg_shortcode").val();
|
884 |
<?php } ?>
|
885 |
function bwg_update_shortcode() {
|
886 |
-
|
887 |
-
if (!
|
888 |
-
|
889 |
jQuery('#insert').val('Insert');
|
890 |
-
|
891 |
bwg_gallery_type('thumbnails');
|
892 |
}
|
893 |
else { // Update.
|
894 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
895 |
jQuery('#insert').val('Update');
|
896 |
-
|
|
|
|
|
897 |
jQuery('#insert').attr('onclick', "bwg_insert_shortcode(content)");
|
898 |
jQuery("select[id=theme] option[value='" + short_code['theme_id'] + "']").attr('selected', 'selected');
|
899 |
switch (short_code['gallery_type']) {
|
@@ -1300,9 +1333,22 @@ class BWGViewBWGShortcode {
|
|
1300 |
}
|
1301 |
return short_code_attr;
|
1302 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1303 |
function bwg_insert_shortcode(content) {
|
1304 |
var gallery_type = jQuery("input[name=gallery_type]:checked").val();
|
1305 |
var theme = jQuery("#theme").val();
|
|
|
1306 |
var short_code = '[Best_Wordpress_Gallery';
|
1307 |
var tagtext = ' gallery_type="' + gallery_type + '" theme_id="' + theme + '"';
|
1308 |
switch (gallery_type) {
|
@@ -1318,7 +1364,7 @@ class BWGViewBWGShortcode {
|
|
1318 |
tagtext += ' image_enable_page="' + jQuery("input[name=image_enable_page]:checked").val() + '"';
|
1319 |
tagtext += ' thumb_width="' + jQuery("#thumb_width").val() + '"';
|
1320 |
tagtext += ' thumb_height="' + jQuery("#thumb_height").val() + '"';
|
1321 |
-
|
1322 |
break;
|
1323 |
|
1324 |
}
|
@@ -1341,7 +1387,7 @@ class BWGViewBWGShortcode {
|
|
1341 |
tagtext += ' slideshow_description_position="' + jQuery("input[name=slideshow_description_position]:checked").val() + '"';
|
1342 |
tagtext += ' enable_slideshow_music="' + jQuery("input[name=enable_slideshow_music]:checked").val() + '"';
|
1343 |
tagtext += ' slideshow_music_url="' + jQuery("#slideshow_music_url").val() + '"';
|
1344 |
-
|
1345 |
break;
|
1346 |
|
1347 |
}
|
@@ -1354,7 +1400,7 @@ class BWGViewBWGShortcode {
|
|
1354 |
tagtext += ' image_browser_width="' + jQuery("#image_browser_width").val() + '"';
|
1355 |
tagtext += ' image_browser_title_enable="' + jQuery("input[name=image_browser_title_enable]:checked").val() + '"';
|
1356 |
tagtext += ' image_browser_description_enable="' + jQuery("input[name=image_browser_description_enable]:checked").val() + '"';
|
1357 |
-
|
1358 |
break;
|
1359 |
|
1360 |
}
|
@@ -1376,7 +1422,7 @@ class BWGViewBWGShortcode {
|
|
1376 |
tagtext += ' compuct_album_image_thumb_width="' + jQuery("#compuct_album_image_thumb_width").val() + '"';
|
1377 |
tagtext += ' compuct_album_image_thumb_height="' + jQuery("#compuct_album_image_thumb_height").val() + '"';
|
1378 |
tagtext += ' compuct_album_enable_page="' + jQuery("input[name=compuct_album_enable_page]:checked").val() + '"';
|
1379 |
-
|
1380 |
break;
|
1381 |
|
1382 |
}
|
@@ -1398,7 +1444,7 @@ class BWGViewBWGShortcode {
|
|
1398 |
tagtext += ' extended_album_image_thumb_width="' + jQuery("#extended_album_image_thumb_width").val() + '"';
|
1399 |
tagtext += ' extended_album_image_thumb_height="' + jQuery("#extended_album_image_thumb_height").val() + '"';
|
1400 |
tagtext += ' extended_album_enable_page="' + jQuery("input[name=extended_album_enable_page]:checked").val() + '"';
|
1401 |
-
|
1402 |
break;
|
1403 |
|
1404 |
}
|
@@ -1446,28 +1492,33 @@ class BWGViewBWGShortcode {
|
|
1446 |
tagtext += ' watermark_opacity="' + jQuery("#watermark_opacity").val() + '"';
|
1447 |
tagtext += ' watermark_position="' + jQuery("input[name=watermark_position]:checked").val() + '"';
|
1448 |
}
|
1449 |
-
short_code +=
|
|
|
1450 |
short_code = short_code.replace(/\[Best_Wordpress_Gallery([^\]]*)\]/g, function(d, c) {
|
1451 |
-
return "<img src='<?php echo WD_BWG_URL; ?>/images/bwg_shortcode.png' class='bwg_shortcode mceItem' title='Best_Wordpress_Gallery" +
|
1452 |
});
|
1453 |
-
|
|
|
|
|
|
|
|
|
|
|
1454 |
<?php if (!$from_menu) { ?>
|
1455 |
if (window.tinymce.isIE && content) {
|
1456 |
// IE and Update.
|
1457 |
var all_content = tinyMCE.activeEditor.getContent();
|
1458 |
-
console.dir(all_content);
|
1459 |
all_content = all_content.replace('<p></p><p>[Best_Wordpress_Gallery', '<p>[Best_Wordpress_Gallery');
|
1460 |
-
tinyMCE.activeEditor.setContent(all_content.replace(content,
|
1461 |
}
|
1462 |
else {
|
1463 |
-
// window.tinyMCE.execInstanceCommand('content', 'mceInsertContent', false, short_code);
|
1464 |
window.tinyMCE.execCommand('mceInsertContent', false, short_code);
|
1465 |
-
// window.tinyMCE.activeEditor.dom.setAttrib(window.tinyMCE.activeEditor.selection.getNode(), "title", "Best_Wordpress_Gallery" + tagtext);
|
1466 |
}
|
1467 |
tinyMCEPopup.editor.execCommand('mceRepaint');
|
1468 |
-
|
|
|
|
|
1469 |
<?php } else { ?>
|
1470 |
-
jQuery("#bwg_shortcode").val(
|
1471 |
<?php } ?>
|
1472 |
}
|
1473 |
</script>
|
@@ -1476,7 +1527,7 @@ class BWGViewBWGShortcode {
|
|
1476 |
<?php
|
1477 |
die();
|
1478 |
}
|
1479 |
-
|
1480 |
////////////////////////////////////////////////////////////////////////////////////////
|
1481 |
// Getters & Setters //
|
1482 |
////////////////////////////////////////////////////////////////////////////////////////
|
28 |
$option_row = $this->model->get_option_row_data();
|
29 |
$theme_rows = $this->model->get_theme_rows_data();
|
30 |
$from_menu = ((isset($_GET['page']) && (esc_html($_GET['page']) == 'BWGShortcode')) ? TRUE : FALSE);
|
31 |
+
$shortcodes = $this->model->get_shortcode_data();
|
32 |
$effects = array(
|
33 |
'none' => 'None',
|
34 |
'cubeH' => 'Cube Horizontal',
|
70 |
<script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
|
71 |
<?php
|
72 |
wp_print_scripts('jquery');
|
|
|
|
|
|
|
|
|
73 |
}
|
74 |
+
wp_print_scripts('jquery-ui-core');
|
75 |
+
wp_print_scripts('jquery-ui-widget');
|
76 |
+
wp_print_scripts('jquery-ui-position');
|
77 |
+
wp_print_scripts('jquery-ui-tooltip');
|
78 |
?>
|
79 |
<link rel="stylesheet" href="<?php echo WD_BWG_URL . '/css/bwg_shortcode.css?ver='; ?><?php echo get_option("wd_bwg_version"); ?>">
|
80 |
<link rel="stylesheet" href="<?php echo WD_BWG_URL . '/css/jquery-ui-1.10.3.custom.css'; ?>">
|
87 |
<base target="_self">
|
88 |
</head>
|
89 |
<body id="link" onLoad="tinyMCEPopup.executeOnLoad('init();');document.body.style.display='';" dir="ltr" class="forceColors">
|
90 |
+
<form method="post" action="#" id="bwg_shortcode_form">
|
91 |
<div class="tabs" role="tablist" tabindex="-1">
|
92 |
<ul>
|
93 |
<li id="display_tab" class="current" role="tab" tabindex="0">
|
103 |
}
|
104 |
else {
|
105 |
?>
|
106 |
+
<form method="post" action="#" id="bwg_shortcode_form">
|
107 |
+
<div id="display_panel" style="width: 99%; margin-top: 30px;">
|
108 |
<?php
|
109 |
}
|
110 |
?>
|
854 |
<a id="bwg_pro_version_link" class="button button-primary" target="_blank" style="line-height: 25px; padding: 0 5px; text-decoration: none; vertical-align: middle; width: inherit; float: left;" href="http://wpdemo.web-dorado.com/thumbnails-view-2/">Please see Pro <span id="bwg_pro_version">Thumbnail</span> View</a>
|
855 |
</div>
|
856 |
<div style="float:right;">
|
857 |
+
<input type="button" id="insert" name="insert" value="Insert" onClick="bwg_insert_shortcode('');" />
|
858 |
<input type="button" id="cancel" name="cancel" value="Cancel" onClick="tinyMCEPopup.close();" />
|
859 |
</div>
|
860 |
</div>
|
|
|
861 |
<?php
|
862 |
}
|
863 |
else {
|
864 |
+
$tagtext = '';
|
865 |
+
if (isset($_POST['currrent_id'])) {
|
866 |
+
$currrent_id = stripslashes($_POST['currrent_id']);
|
867 |
+
$title = ((isset($_POST['title'])) ? stripslashes($_POST['title']) : '');
|
868 |
+
$tagtext = '[Best_Wordpress_Gallery id="' . $currrent_id . '"' . $title . ']';
|
869 |
+
}
|
870 |
?>
|
871 |
<hr style="float: left; width: 100%;" />
|
872 |
<span style="float: left; width: 100%;">
|
873 |
<a id="bwg_pro_version_link" class="button button-primary" target="_blank" style="display: table; margin-bottom: 5px;" href="http://web-dorado.com/products/wordpress-photo-gallery-plugin.html">Please see Pro <span id="bwg_pro_version">Thumbnail</span> View</a>
|
874 |
<input type="button" class="button-primary" id="insert" name="insert" value="Generate" onclick="bwg_insert_shortcode('');" />
|
875 |
<input type="button" class="button-secondary" id="import" name="import" value="Import" onclick="bwg_update_shortcode()" />
|
876 |
+
<textarea style="width: 100%; resize: vertical; margin-top: 5px;" id="bwg_shortcode" rows="2" onkeydown="bwg_onKeyDown(event)"><?php echo $tagtext; ?></textarea>
|
877 |
</span>
|
878 |
</div>
|
879 |
<?php
|
880 |
}
|
881 |
?>
|
882 |
+
<input type="hidden" id="tagtext" name="tagtext" value="" />
|
883 |
+
<input type="hidden" id="currrent_id" name="currrent_id" value="" />
|
884 |
+
<input type="hidden" id="title" name="title" value="" />
|
885 |
+
<input type="hidden" id="bwg_insert" name="bwg_insert" value="" />
|
886 |
+
<input type="hidden" id="task" name="task" value="" />
|
887 |
+
</form>
|
888 |
<script type="text/javascript">
|
889 |
+
var shortcodes = [];
|
890 |
+
var shortcode_id = 1;
|
891 |
+
<?php
|
892 |
+
foreach ($shortcodes as $shortcode) {
|
893 |
+
?>
|
894 |
+
shortcodes[<?php echo $shortcode->id; ?>] = '<?php echo $shortcode->tagtext; ?>';
|
895 |
+
shortcode_id = <?php echo $shortcode->id + 1; ?>;
|
896 |
+
<?php
|
897 |
+
}
|
898 |
+
?>
|
899 |
+
window.onload = bwg_shortcode_load;
|
900 |
+
var params = get_params("Best_Wordpress_Gallery");
|
901 |
+
var bwg_insert = 1;
|
902 |
bwg_update_shortcode();
|
903 |
<?php if (!$from_menu) { ?>
|
904 |
var content = tinyMCE.activeEditor.selection.getContent();
|
906 |
var content = jQuery("#bwg_shortcode").val();
|
907 |
<?php } ?>
|
908 |
function bwg_update_shortcode() {
|
909 |
+
params = get_params("Best_Wordpress_Gallery");
|
910 |
+
if (!params) { // Insert.
|
911 |
+
<?php if (!$from_menu) { ?>
|
912 |
jQuery('#insert').val('Insert');
|
913 |
+
<?php } ?>
|
914 |
bwg_gallery_type('thumbnails');
|
915 |
}
|
916 |
else { // Update.
|
917 |
+
if (params['id']) {
|
918 |
+
shortcode_id = params['id'];
|
919 |
+
var short_code = get_short_params(shortcodes[params['id']]);
|
920 |
+
bwg_insert = 0;
|
921 |
+
}
|
922 |
+
else {
|
923 |
+
var short_code = get_params("Best_Wordpress_Gallery");
|
924 |
+
}
|
925 |
+
<?php if (!$from_menu) { ?>
|
926 |
jQuery('#insert').val('Update');
|
927 |
+
<?php } else { ?>
|
928 |
+
content = jQuery("#bwg_shortcode").val();
|
929 |
+
<?php } ?>
|
930 |
jQuery('#insert').attr('onclick', "bwg_insert_shortcode(content)");
|
931 |
jQuery("select[id=theme] option[value='" + short_code['theme_id'] + "']").attr('selected', 'selected');
|
932 |
switch (short_code['gallery_type']) {
|
1333 |
}
|
1334 |
return short_code_attr;
|
1335 |
}
|
1336 |
+
function get_short_params(tagtext) {
|
1337 |
+
var params_str = tagtext.substring(tagtext.indexOf(" ") + 1);
|
1338 |
+
var key_values = params_str.split('" ');
|
1339 |
+
var short_code_attr = new Array();
|
1340 |
+
for (var key in key_values) {
|
1341 |
+
var short_code_index = key_values[key].split('=')[0];
|
1342 |
+
var short_code_value = key_values[key].split('=')[1];
|
1343 |
+
short_code_value = short_code_value.replace(/\"/g, '');
|
1344 |
+
short_code_attr[short_code_index] = short_code_value;
|
1345 |
+
}
|
1346 |
+
return short_code_attr;
|
1347 |
+
}
|
1348 |
function bwg_insert_shortcode(content) {
|
1349 |
var gallery_type = jQuery("input[name=gallery_type]:checked").val();
|
1350 |
var theme = jQuery("#theme").val();
|
1351 |
+
var title = "";
|
1352 |
var short_code = '[Best_Wordpress_Gallery';
|
1353 |
var tagtext = ' gallery_type="' + gallery_type + '" theme_id="' + theme + '"';
|
1354 |
switch (gallery_type) {
|
1364 |
tagtext += ' image_enable_page="' + jQuery("input[name=image_enable_page]:checked").val() + '"';
|
1365 |
tagtext += ' thumb_width="' + jQuery("#thumb_width").val() + '"';
|
1366 |
tagtext += ' thumb_height="' + jQuery("#thumb_height").val() + '"';
|
1367 |
+
title = ' gal_title="' + jQuery('#gallery option:selected').text().replace("'", "").replace('"', '') + '"';
|
1368 |
break;
|
1369 |
|
1370 |
}
|
1387 |
tagtext += ' slideshow_description_position="' + jQuery("input[name=slideshow_description_position]:checked").val() + '"';
|
1388 |
tagtext += ' enable_slideshow_music="' + jQuery("input[name=enable_slideshow_music]:checked").val() + '"';
|
1389 |
tagtext += ' slideshow_music_url="' + jQuery("#slideshow_music_url").val() + '"';
|
1390 |
+
title = ' gal_title="' + jQuery('#gallery option:selected').text().replace("'", "").replace('"', '') + '"';
|
1391 |
break;
|
1392 |
|
1393 |
}
|
1400 |
tagtext += ' image_browser_width="' + jQuery("#image_browser_width").val() + '"';
|
1401 |
tagtext += ' image_browser_title_enable="' + jQuery("input[name=image_browser_title_enable]:checked").val() + '"';
|
1402 |
tagtext += ' image_browser_description_enable="' + jQuery("input[name=image_browser_description_enable]:checked").val() + '"';
|
1403 |
+
title = ' gal_title="' + jQuery('#gallery option:selected').text().replace("'", "").replace('"', '') + '"';
|
1404 |
break;
|
1405 |
|
1406 |
}
|
1422 |
tagtext += ' compuct_album_image_thumb_width="' + jQuery("#compuct_album_image_thumb_width").val() + '"';
|
1423 |
tagtext += ' compuct_album_image_thumb_height="' + jQuery("#compuct_album_image_thumb_height").val() + '"';
|
1424 |
tagtext += ' compuct_album_enable_page="' + jQuery("input[name=compuct_album_enable_page]:checked").val() + '"';
|
1425 |
+
title = ' gal_title="' + jQuery('#album option:selected').text().replace("'", "").replace('"', '') + '"';
|
1426 |
break;
|
1427 |
|
1428 |
}
|
1444 |
tagtext += ' extended_album_image_thumb_width="' + jQuery("#extended_album_image_thumb_width").val() + '"';
|
1445 |
tagtext += ' extended_album_image_thumb_height="' + jQuery("#extended_album_image_thumb_height").val() + '"';
|
1446 |
tagtext += ' extended_album_enable_page="' + jQuery("input[name=extended_album_enable_page]:checked").val() + '"';
|
1447 |
+
title = ' gal_title="' + jQuery('#album option:selected').text().replace("'", "").replace('"', '') + '"';
|
1448 |
break;
|
1449 |
|
1450 |
}
|
1492 |
tagtext += ' watermark_opacity="' + jQuery("#watermark_opacity").val() + '"';
|
1493 |
tagtext += ' watermark_position="' + jQuery("input[name=watermark_position]:checked").val() + '"';
|
1494 |
}
|
1495 |
+
short_code += ' id="' + shortcode_id + '"' + title + ']';
|
1496 |
+
var short_id = ' id="' + shortcode_id + '"' + title;
|
1497 |
short_code = short_code.replace(/\[Best_Wordpress_Gallery([^\]]*)\]/g, function(d, c) {
|
1498 |
+
return "<img src='<?php echo WD_BWG_URL; ?>/images/bwg_shortcode.png' class='bwg_shortcode mceItem' title='Best_Wordpress_Gallery" + short_id + "' />";
|
1499 |
});
|
1500 |
+
jQuery("#task").val("save");
|
1501 |
+
jQuery("#tagtext").val(tagtext);
|
1502 |
+
jQuery("#currrent_id").val(shortcode_id);
|
1503 |
+
jQuery("#title").val(title);
|
1504 |
+
jQuery("#bwg_insert").val((content && !bwg_insert) ? 0 : 1);
|
1505 |
+
jQuery("#bwg_shortcode_form").submit();
|
1506 |
<?php if (!$from_menu) { ?>
|
1507 |
if (window.tinymce.isIE && content) {
|
1508 |
// IE and Update.
|
1509 |
var all_content = tinyMCE.activeEditor.getContent();
|
|
|
1510 |
all_content = all_content.replace('<p></p><p>[Best_Wordpress_Gallery', '<p>[Best_Wordpress_Gallery');
|
1511 |
+
tinyMCE.activeEditor.setContent(all_content.replace(content, '[Best_Wordpress_Gallery id="' + shortcode_id + '"' + title + ']'));
|
1512 |
}
|
1513 |
else {
|
|
|
1514 |
window.tinyMCE.execCommand('mceInsertContent', false, short_code);
|
|
|
1515 |
}
|
1516 |
tinyMCEPopup.editor.execCommand('mceRepaint');
|
1517 |
+
setTimeout(function() {
|
1518 |
+
tinyMCEPopup.close();
|
1519 |
+
}, 1000);
|
1520 |
<?php } else { ?>
|
1521 |
+
jQuery("#bwg_shortcode").val('[Best_Wordpress_Gallery id="' + shortcode_id + '"' + title + ']');
|
1522 |
<?php } ?>
|
1523 |
}
|
1524 |
</script>
|
1527 |
<?php
|
1528 |
die();
|
1529 |
}
|
1530 |
+
|
1531 |
////////////////////////////////////////////////////////////////////////////////////////
|
1532 |
// Getters & Setters //
|
1533 |
////////////////////////////////////////////////////////////////////////////////////////
|
admin/views/BWGViewUninstall_bwg.php
CHANGED
@@ -59,6 +59,7 @@ class BWGViewUninstall_bwg {
|
|
59 |
<li><?php echo $prefix; ?>bwg_image_tag</li>
|
60 |
<li><?php echo $prefix; ?>bwg_option</li>
|
61 |
<li><?php echo $prefix; ?>bwg_theme</li>
|
|
|
62 |
</ol>
|
63 |
</td>
|
64 |
</tr>
|
@@ -138,7 +139,8 @@ class BWGViewUninstall_bwg {
|
|
138 |
<p><?php echo $prefix; ?>bwg_image_rate,</p>
|
139 |
<p><?php echo $prefix; ?>bwg_image_tag,</p>
|
140 |
<p><?php echo $prefix; ?>bwg_option,</p>
|
141 |
-
<p><?php echo $prefix; ?>bwg_theme
|
|
|
142 |
</div>
|
143 |
<?php
|
144 |
if (isset($_POST['bwg_delete_files'])) {
|
59 |
<li><?php echo $prefix; ?>bwg_image_tag</li>
|
60 |
<li><?php echo $prefix; ?>bwg_option</li>
|
61 |
<li><?php echo $prefix; ?>bwg_theme</li>
|
62 |
+
<li><?php echo $prefix; ?>bwg_shortcode</li>
|
63 |
</ol>
|
64 |
</td>
|
65 |
</tr>
|
139 |
<p><?php echo $prefix; ?>bwg_image_rate,</p>
|
140 |
<p><?php echo $prefix; ?>bwg_image_tag,</p>
|
141 |
<p><?php echo $prefix; ?>bwg_option,</p>
|
142 |
+
<p><?php echo $prefix; ?>bwg_theme,</p>
|
143 |
+
<p><?php echo $prefix; ?>bwg_shortcode.</p>
|
144 |
</div>
|
145 |
<?php
|
146 |
if (isset($_POST['bwg_delete_files'])) {
|
photo-gallery.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: Photo Gallery
|
5 |
* Plugin URI: http://web-dorado.com/products/wordpress-photo-gallery-plugin.html
|
6 |
* Description: This plugin is a fully responsive gallery plugin with advanced functionality. It allows having different image galleries for your posts and pages. You can create unlimited number of galleries, combine them into albums, and provide descriptions and tags.
|
7 |
-
* Version: 1.
|
8 |
* Author: http://web-dorado.com/
|
9 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
*/
|
@@ -160,6 +160,15 @@ function create_taxonomy() {
|
|
160 |
add_action('init', 'create_taxonomy', 0);
|
161 |
|
162 |
function bwg_shortcode($params) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
shortcode_atts(array(
|
164 |
'gallery_type' => 'thumbnails',
|
165 |
'theme_id' => 1,
|
@@ -402,6 +411,12 @@ if (class_exists('WP_Widget')) {
|
|
402 |
// Activate plugin.
|
403 |
function bwg_activate() {
|
404 |
global $wpdb;
|
|
|
|
|
|
|
|
|
|
|
|
|
405 |
$bwg_gallery = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "bwg_gallery` (
|
406 |
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
407 |
`name` varchar(255) NOT NULL,
|
@@ -2713,7 +2728,7 @@ function bwg_activate() {
|
|
2713 |
));
|
2714 |
}
|
2715 |
$version = get_option("wd_bwg_version");
|
2716 |
-
$new_version = '1.
|
2717 |
if ($version && version_compare($version, $new_version, '<')) {
|
2718 |
require_once WD_BWG_DIR . "/update/bwg_update.php";
|
2719 |
bwg_update($version);
|
@@ -2728,7 +2743,7 @@ register_activation_hook(__FILE__, 'bwg_activate');
|
|
2728 |
|
2729 |
function bwg_update_hook() {
|
2730 |
$version = get_option("wd_bwg_version");
|
2731 |
-
$new_version = '1.
|
2732 |
if ($version && version_compare($version, $new_version, '<')) {
|
2733 |
require_once WD_BWG_DIR . "/update/bwg_update.php";
|
2734 |
bwg_update($version);
|
4 |
* Plugin Name: Photo Gallery
|
5 |
* Plugin URI: http://web-dorado.com/products/wordpress-photo-gallery-plugin.html
|
6 |
* Description: This plugin is a fully responsive gallery plugin with advanced functionality. It allows having different image galleries for your posts and pages. You can create unlimited number of galleries, combine them into albums, and provide descriptions and tags.
|
7 |
+
* Version: 1.2.0
|
8 |
* Author: http://web-dorado.com/
|
9 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
*/
|
160 |
add_action('init', 'create_taxonomy', 0);
|
161 |
|
162 |
function bwg_shortcode($params) {
|
163 |
+
if (isset($params['id'])) {
|
164 |
+
global $wpdb;
|
165 |
+
$shortcode = $wpdb->get_var($wpdb->prepare("SELECT tagtext FROM " . $wpdb->prefix . "bwg_shortcode WHERE id='%d'", $params['id']));
|
166 |
+
$shortcode_params = explode('" ', $shortcode);
|
167 |
+
foreach ($shortcode_params as $shortcode_param) {
|
168 |
+
$shortcode_elem = explode('="', $shortcode_param);
|
169 |
+
$params[str_replace(' ', '', $shortcode_elem[0])] = $shortcode_elem[1];
|
170 |
+
}
|
171 |
+
}
|
172 |
shortcode_atts(array(
|
173 |
'gallery_type' => 'thumbnails',
|
174 |
'theme_id' => 1,
|
411 |
// Activate plugin.
|
412 |
function bwg_activate() {
|
413 |
global $wpdb;
|
414 |
+
$bwg_shortcode = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "bwg_shortcode` (
|
415 |
+
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
416 |
+
`tagtext` mediumtext NOT NULL,
|
417 |
+
PRIMARY KEY (`id`)
|
418 |
+
) DEFAULT CHARSET=utf8;";
|
419 |
+
$wpdb->query($bwg_shortcode);
|
420 |
$bwg_gallery = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "bwg_gallery` (
|
421 |
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
422 |
`name` varchar(255) NOT NULL,
|
2728 |
));
|
2729 |
}
|
2730 |
$version = get_option("wd_bwg_version");
|
2731 |
+
$new_version = '1.2.0';
|
2732 |
if ($version && version_compare($version, $new_version, '<')) {
|
2733 |
require_once WD_BWG_DIR . "/update/bwg_update.php";
|
2734 |
bwg_update($version);
|
2743 |
|
2744 |
function bwg_update_hook() {
|
2745 |
$version = get_option("wd_bwg_version");
|
2746 |
+
$new_version = '1.2.0';
|
2747 |
if ($version && version_compare($version, $new_version, '<')) {
|
2748 |
require_once WD_BWG_DIR . "/update/bwg_update.php";
|
2749 |
bwg_update($version);
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://web-dorado.com/products/wordpress-photo-gallery-plugin.html
|
|
4 |
Tags: photo, photo gallery, image gallery, video gallery, gallery, galleries, wordpress gallery plugin, images gallery, album, photo albums, simple gallery, best gallery plugin, free photo gallery, wp gallery, wordpress gallery, website gallery, gallery shortcode, best gallery, picture, pictures, gallery slider, photo album, photogallery, widget gallery, image, images, photos, gallery lightbox, photoset, wordpress photo gallery plugin, wp gallery plugins, responsive wordpress photo gallery, media, image album, filterable gallery, banner rotator, fullscreen gallery, fotogalerie, galleria, galerie, galeri
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.0
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
4 |
Tags: photo, photo gallery, image gallery, video gallery, gallery, galleries, wordpress gallery plugin, images gallery, album, photo albums, simple gallery, best gallery plugin, free photo gallery, wp gallery, wordpress gallery, website gallery, gallery shortcode, best gallery, picture, pictures, gallery slider, photo album, photogallery, widget gallery, image, images, photos, gallery lightbox, photoset, wordpress photo gallery plugin, wp gallery plugins, responsive wordpress photo gallery, media, image album, filterable gallery, banner rotator, fullscreen gallery, fotogalerie, galleria, galerie, galeri
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.0
|
7 |
+
Stable tag: 1.2.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
update/bwg_update.php
CHANGED
@@ -133,6 +133,14 @@ function bwg_update($version) {
|
|
133 |
$wpdb->query("ALTER TABLE " . $wpdb->prefix . "bwg_option ADD `show_album_name` tinyint(1) NOT NULL DEFAULT 0");
|
134 |
$wpdb->query("ALTER TABLE " . $wpdb->prefix . "bwg_option ADD `show_image_counts` tinyint(1) NOT NULL DEFAULT 0");
|
135 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
return;
|
137 |
}
|
138 |
|
133 |
$wpdb->query("ALTER TABLE " . $wpdb->prefix . "bwg_option ADD `show_album_name` tinyint(1) NOT NULL DEFAULT 0");
|
134 |
$wpdb->query("ALTER TABLE " . $wpdb->prefix . "bwg_option ADD `show_image_counts` tinyint(1) NOT NULL DEFAULT 0");
|
135 |
}
|
136 |
+
if (version_compare($version, '1.2.0') == -1) {
|
137 |
+
$bwg_shortcode = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "bwg_shortcode` (
|
138 |
+
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
139 |
+
`tagtext` mediumtext NOT NULL,
|
140 |
+
PRIMARY KEY (`id`)
|
141 |
+
) DEFAULT CHARSET=utf8;";
|
142 |
+
$wpdb->query($bwg_shortcode);
|
143 |
+
}
|
144 |
return;
|
145 |
}
|
146 |
|