예제 #1
0
 public function execute()
 {
     $task = WDWLibrary::get('task');
     if (method_exists($this, $task)) {
         $this->{$task}();
     }
     $this->display();
 }
예제 #2
0
 public function execute()
 {
     $task = WDWLibrary::get('task');
     $from_menu = isset($_GET['page']) && esc_html($_GET['page']) == 'BWGShortcode' ? TRUE : FALSE;
     if ($task != '' && $from_menu) {
         if (!WDWLibrary::verify_nonce('BWGShortcode')) {
             die('Sorry, your nonce did not verify.');
         }
     }
     if (method_exists($this, $task)) {
         $this->{$task}();
     }
     $this->display();
 }
예제 #3
0
 public function execute()
 {
     $task = isset($_POST['task']) ? esc_html(stripslashes($_POST['task'])) : '';
     if ($task != '') {
         if (!WDWLibrary::verify_nonce('uninstall_bwg')) {
             die('Sorry, your nonce did not verify.');
         }
     }
     if (method_exists($this, $task)) {
         $this->{$task}();
     } else {
         $this->display();
     }
 }
예제 #4
0
    public function edit($id, $reset)
    {
        $row = $this->model->get_row_data($id, $reset);
        $page_title = $id != 0 ? 'Edit theme ' . $row->name : 'Create new theme';
        $current_type = WDWLibrary::get('current_type', 'Thumbnail');
        $border_styles = array('none' => 'None', 'solid' => 'Solid', 'dotted' => 'Dotted', 'dashed' => 'Dashed', 'double' => 'Double', 'groove' => 'Groove', 'ridge' => 'Ridge', 'inset' => 'Inset', 'outset' => 'Outset');
        $font_families = array('arial' => 'Arial', 'lucida grande' => 'Lucida grande', 'segoe ui' => 'Segoe ui', 'tahoma' => 'Tahoma', 'trebuchet ms' => 'Trebuchet ms', 'verdana' => 'Verdana', 'cursive' => 'Cursive', 'fantasy' => 'Fantasy', 'monospace' => 'Monospace', 'serif' => 'Serif');
        $aligns = array('left' => 'Left', 'center' => 'Center', 'right' => 'Right');
        $font_weights = array('lighter' => 'Lighter', 'normal' => 'Normal', 'bold' => 'Bold');
        $hover_effects = array('none' => 'None', 'rotate' => 'Rotate', 'scale' => 'Scale', 'skew' => 'Skew');
        $button_styles = array('fa-chevron' => 'Chevron', 'fa-angle' => 'Angle', 'fa-angle-double' => 'Double');
        $rate_icons = array('star' => 'Star', 'bell' => 'Bell', 'circle' => 'Circle', 'flag' => 'Flag', 'heart' => 'Heart', 'square' => 'Square');
        ?>
    <div style="clear: both; float: left; width: 99%;">
      <div style="float:left; font-size: 14px; font-weight: bold;">
        This section allows you to add/edit theme.
        <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-gallery-guide-step-6/6-1.html">Read More in User Manual</a>
      </div>
      <div style="float: right; text-align: right;">
        <a style="text-decoration: none;" target="_blank" href="http://web-dorado.com/products/wordpress-photo-gallery-plugin.html">
          <img width="215" border="0" alt="web-dorado.com" src="<?php 
        echo WD_BWG_URL . '/images/logo.png';
        ?>
" />
        </a>
      </div>
    </div>
    <form class="wrap" method="post" action="admin.php?page=themes_bwg" style="float: left; width: 99%;">
      <?php 
        wp_nonce_field('themes_bwg', 'bwg_nonce');
        ?>
      <span class="theme_icon"></span>
      <h2><?php 
        echo $page_title;
        ?>
</h2>
      <div style="float: right; margin: 0 5px 0 0;">
        <input class="button-secondary" type="submit" onclick="if (spider_check_required('name', 'Name')) {return false;}; spider_set_input_value('task', 'save')" value="Save"/>
        <input class="button-secondary" type="submit" onclick="if (spider_check_required('name', 'Name')) {return false;}; spider_set_input_value('task', 'apply')" value="Apply"/>
        <input class="button-secondary" type="submit" onclick="spider_set_input_value('task', 'cancel')" value="Cancel"/>
        <input title="Reset to default theme" class="button-primary" type="submit" onclick="if (confirm('Do you want to reset to default?')) {
                                                                 spider_set_input_value('task', 'reset');
                                                               } else {
                                                                 return false;
                                                               }" value="Reset"/>
      </div>
      <div style="float: left; margin: 10px 0 0; display: none;" id="type_menu">
        <div id="type_Thumbnail" class="theme_type" onclick="bwg_change_theme_type('Thumbnail')">Thumbnails</div>
        <div id="type_Masonry" class="theme_type" style="opacity: 0.4; filter: Alpha(opacity=40);" title="This tab is disabled in free version">Masonry</div>
        <div id="type_Mosaic" class="theme_type" style="opacity: 0.4; filter: Alpha(opacity=40);" title="This tab is disabled in free version">Mosaic</div>
        <div id="type_Slideshow" class="theme_type" onclick="bwg_change_theme_type('Slideshow')">Slideshow</div>
        <div id="type_Image_browser" class="theme_type" onclick="bwg_change_theme_type('Image_browser')">Image Browser</div>
        <div id="type_Compact_album" class="theme_type" onclick="bwg_change_theme_type('Compact_album')">Compact Album</div>
        <div id="type_Masonry_album" class="theme_type" style="opacity: 0.4; filter: Alpha(opacity=40);" title="This tab is disabled in free version">Masonry Album</div>
        <div id="type_Extended_album" class="theme_type" onclick="bwg_change_theme_type('Extended_album')">Extended Album</div>
        <div id="type_Blog_style" class="theme_type" style="opacity: 0.4; filter: Alpha(opacity=40);" title="This tab is disabled in free version">Blog Style</div>
        <div id="type_Lightbox" class="theme_type" onclick="bwg_change_theme_type('Lightbox')">Lightbox</div>
        <div id="type_Navigation" class="theme_type" onclick="bwg_change_theme_type('Navigation')">Page Navigation</div>
        <input type="hidden" id="current_type" name="current_type" value="<?php 
        echo $current_type;
        ?>
" />
      </div>
      <fieldset class="spider_fieldset">
        <legend>Parameters</legend>
        <table style="clear:both;">
          <tbody>
          <tr>
            <td class="spider_label"><label for="name">Name: <span style="color:#FF0000;"> * </span> </label></td>
            <td><input type="text" id="name" name="name" value="<?php 
        echo $row->name;
        ?>
" class="spider_text_input"/></td>
          </tr>
          </tbody>
        </table>

        <fieldset class="spider_type_fieldset" id="Thumbnail">
          <fieldset class="spider_child_fieldset" id="Thumbnail_1">
            <table style="clear:both;">
              <tbody>
                <tr>
                  <td class="spider_label"><label for="thumb_margin">Margin: </label></td>
                  <td>
                    <input type="text" name="thumb_margin" id="thumb_margin" value="<?php 
        echo $row->thumb_margin;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="thumb_padding">Padding: </label></td>
                  <td>
                    <input type="text" name="thumb_padding" id="thumb_padding" value="<?php 
        echo $row->thumb_padding;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="thumb_border_width">Border width: </label></td>
                  <td>
                    <input type="text" name="thumb_border_width" id="thumb_border_width" value="<?php 
        echo $row->thumb_border_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="thumb_border_style">Border style: </label></td>
                  <td>
                    <select name="thumb_border_style" id="thumb_border_style">
                      <?php 
        foreach ($border_styles as $key => $border_style) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->thumb_border_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $border_style;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="thumb_border_color">Border color:</label></td>
                  <td>
                    <input type="text" name="thumb_border_color" id="thumb_border_color" value="<?php 
        echo $row->thumb_border_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="thumb_border_radius">Border radius: </label></td>
                  <td>
                    <input type="text" name="thumb_border_radius" id="thumb_border_radius" value="<?php 
        echo $row->thumb_border_radius;
        ?>
" class="spider_char_input" />
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="thumb_box_shadow">Shadow: </label></td>
                  <td>
                    <input type="text" name="thumb_box_shadow" id="thumb_box_shadow" value="<?php 
        echo $row->thumb_box_shadow;
        ?>
" class="spider_box_input" />
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="thumb_hover_effect">Hover effect: </label></td>
                  <td>
                    <select name="thumb_hover_effect" id="thumb_hover_effect" class="spider_int_input">
                      <?php 
        foreach ($hover_effects as $key => $hover_effect) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->thumb_hover_effect == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $hover_effect;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="thumb_hover_effect_value">Hover effect value: </label></td>
                  <td>
                    <input type="text" name="thumb_hover_effect_value" id="thumb_hover_effect_value" value="<?php 
        echo $row->thumb_hover_effect_value;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">E.g. Rotate: 10deg, Scale: 1.5, Skew: 10deg.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label>Transition: </label></td>
                  <td id="thumb_transition">
                    <input type="radio" name="thumb_transition" id="thumb_transition1" value="1"<?php 
        if ($row->thumb_transition == 1) {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="thumb_transition1" id="thumb_transition1_lbl">Yes</label>
                    <input type="radio" name="thumb_transition" id="thumb_transition0" value="0"<?php 
        if ($row->thumb_transition == 0) {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="thumb_transition0" id="thumb_transition0_lbl">No</label>
                  </td>
                </tr>
              </tbody>
            </table>
          </fieldset>
          <fieldset class="spider_child_fieldset" id="Thumbnail_2">
            <table style="clear:both;">
              <tbody>
                <tr>
                  <td class="spider_label">
                    <label for="thumb_bg_color">Thumbnail background color: </label>
                  </td>
                  <td>
                    <input type="text" name="thumb_bg_color" id="thumb_bg_color" value="<?php 
        echo $row->thumb_bg_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="thumb_transparent">Thumbnail transparency: </label></td>
                  <td>
                    <input type="text" name="thumb_transparent" id="thumb_transparent" value="<?php 
        echo $row->thumb_transparent;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
                    <div class="spider_description">Value must be between 0 to 100.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="thumbs_bg_color">Full background color: </label></td>
                  <td>
                    <input type="text" name="thumbs_bg_color" id="thumbs_bg_color" value="<?php 
        echo $row->thumbs_bg_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="thumb_bg_transparent">Full background transparency: </label></td>
                  <td>
                    <input type="text" name="thumb_bg_transparent" id="thumb_bg_transparent" value="<?php 
        echo $row->thumb_bg_transparent;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
                    <div class="spider_description">Value must be between 0 to 100.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="thumb_align">Alignment: </label></td>
                  <td>
                    <select name="thumb_align" id="thumb_align">
                      <?php 
        foreach ($aligns as $key => $align) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->thumb_align == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $align;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
              </tbody>
            </table>
          </fieldset>
          <fieldset class="spider_child_fieldset" id="Thumbnail_3">
            <table style="clear:both;">
              <tbody>
                <tr>
                  <td class="spider_label"><label>Title position: </label></td>
                  <td>
                    <input type="radio" name="thumb_title_pos" id="thumb_title_pos1" value="top" <?php 
        if ($row->thumb_title_pos == "top") {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="thumb_title_pos1" id="thumb_title_pos1_lbl">Top</label>
                    <input type="radio" name="thumb_title_pos" id="thumb_title_pos0" value="bottom" <?php 
        if ($row->thumb_title_pos == "bottom") {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="thumb_title_pos0" id="thumb_title_pos0_lbl">Bottom</label>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="thumb_title_font_size">Title font size: </label></td>
                  <td>
                    <input type="text" name="thumb_title_font_size" id="thumb_title_font_size" value="<?php 
        echo $row->thumb_title_font_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="thumb_title_font_color">Title font color: </label></td>
                  <td>
                    <input type="text" name="thumb_title_font_color" id="thumb_title_font_color" value="<?php 
        echo $row->thumb_title_font_color;
        ?>
" class="color" />
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="thumb_title_font_style">Title font family: </label></td>
                  <td>
                    <select name="thumb_title_font_style" id="thumb_title_font_style">
                      <?php 
        foreach ($font_families as $key => $font_family) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->thumb_title_font_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $font_family;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="thumb_title_font_weight">Title font weight: </label></td>
                  <td>
                    <select name="thumb_title_font_weight" id="thumb_title_font_weight">
                      <?php 
        foreach ($font_weights as $key => $font_weight) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->thumb_title_font_weight == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $font_weight;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="thumb_title_shadow">Title box shadow: </label></td>
                  <td>
                    <input type="text" name="thumb_title_shadow" id="thumb_title_shadow" value="<?php 
        echo $row->thumb_title_shadow;
        ?>
" class="spider_box_input" />
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="thumb_title_margin">Title margin: </label></td>
                  <td>
                    <input type="text" name="thumb_title_margin" id="thumb_title_margin" value="<?php 
        echo $row->thumb_title_margin;
        ?>
" class="spider_char_input" />
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
              </tbody>
            </table>
          </fieldset>
        </fieldset>

        <fieldset class="spider_type_fieldset" id="Masonry">
          <fieldset class="spider_child_fieldset" id="Masonry_1">
            <table style="clear:both;">
              <tbody>
                <tr>
                  <td class="spider_label"><label for="masonry_thumb_padding">Padding: </label></td>
                  <td>
                    <input type="text" name="masonry_thumb_padding" id="masonry_thumb_padding" value="<?php 
        echo $row->masonry_thumb_padding;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="masonry_thumb_border_width">Border width: </label></td>
                  <td>
                    <input type="text" name="masonry_thumb_border_width" id="masonry_thumb_border_width" value="<?php 
        echo $row->masonry_thumb_border_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="masonry_thumb_border_style">Border style: </label></td>
                  <td>
                    <select name="masonry_thumb_border_style" id="masonry_thumb_border_style">
                      <?php 
        foreach ($border_styles as $key => $border_style) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->masonry_thumb_border_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $border_style;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="masonry_thumb_border_color">Border color: </label></td>
                  <td>
                    <input type="text" name="masonry_thumb_border_color" id="masonry_thumb_border_color" value="<?php 
        echo $row->masonry_thumb_border_color;
        ?>
" class="color" />
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="masonry_thumb_border_radius">Border radius: </label></td>
                  <td>
                    <input type="text" name="masonry_thumb_border_radius" id="masonry_thumb_border_radius" value="<?php 
        echo $row->masonry_thumb_border_radius;
        ?>
" class="spider_char_input" />
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
              </tbody>
            </table>
          </fieldset>
          <fieldset class="spider_child_fieldset" id="Masonry_2">
            <table style="clear:both;">
              <tbody>
                <tr>
                  <td class="spider_label"><label for="masonry_thumb_transparent">Transparency: </label></td>
                  <td>
                    <input type="text" name="masonry_thumb_transparent" id="masonry_thumb_transparent" value="<?php 
        echo $row->masonry_thumb_transparent;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
                    <div class="spider_description">Value must be between 0 to 100.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="masonry_thumbs_bg_color">Background color: </label></td>
                  <td>
                    <input type="text" name="masonry_thumbs_bg_color" id="masonry_thumbs_bg_color" value="<?php 
        echo $row->masonry_thumbs_bg_color;
        ?>
" class="color" />
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="masonry_thumb_bg_transparent">Background transparency: </label></td>
                  <td>
                    <input type="text" name="masonry_thumb_bg_transparent" id="masonry_thumb_bg_transparent" value="<?php 
        echo $row->masonry_thumb_bg_transparent;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
                    <div class="spider_description">Value must be between 0 to 100.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="masonry_thumb_align0">Alignment: </label></td>
                  <td>
                    <select name="masonry_thumb_align" id="masonry_thumb_align">
                      <?php 
        foreach ($aligns as $key => $align) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->masonry_thumb_align == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $align;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
              </tbody>
            </table>
          </fieldset>
          <fieldset class="spider_child_fieldset" id="Masonry_3">
            <table style="clear:both;">
              <tbody>
                <tr>
                  <td class="spider_label"><label for="masonry_thumb_hover_effect">Hover effect: </label></td>
                  <td>
                    <select name="masonry_thumb_hover_effect" id="masonry_thumb_hover_effect" class="spider_int_input">
                      <?php 
        foreach ($hover_effects as $key => $hover_effect) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->masonry_thumb_hover_effect == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $hover_effect;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="masonry_thumb_hover_effect_value">Hover effect value: </label></td>
                  <td>
                    <input type="text" name="masonry_thumb_hover_effect_value" id="masonry_thumb_hover_effect_value" value="<?php 
        echo $row->masonry_thumb_hover_effect_value;
        ?>
" class="spider_char_input" />
                    <div class="spider_description">E.g. Rotate: 10deg, Scale: 1.5, Skew: 10deg.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label>Transition: </label></td>
                  <td id="masonry_thumb_transition">
                    <input type="radio" name="masonry_thumb_transition" id="masonry_thumb_transition1" value="1"<?php 
        if ($row->masonry_thumb_transition == 1) {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="masonry_thumb_transition1" id="masonry_thumb_transition1_lbl">Yes</label>
                    <input type="radio" name="masonry_thumb_transition" id="masonry_thumb_transition0" value="0"<?php 
        if ($row->masonry_thumb_transition == 0) {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="masonry_thumb_transition0" id="masonry_thumb_transition0_lbl">No</label>
                  </td>
                </tr>
		<tr>
                  <td class="spider_label"><label for="masonry_description_font_size">Description font size: </label></td>
                  <td>
                    <input type="text" name="masonry_description_font_size" id="masonry_description_font_size" value="<?php 
        echo $row->masonry_description_font_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="masonry_description_color">Description font color: </label></td>
                  <td>
                    <input type="text" name="masonry_description_color" id="masonry_description_color" value="<?php 
        echo $row->masonry_description_color;
        ?>
" class="color" />
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="masonry_description_font_style">Description font family: </label></td>
                  <td>
                    <select name="masonry_description_font_style" id="masonry_description_font_style">
                      <?php 
        foreach ($font_families as $key => $font_family) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->masonry_description_font_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $font_family;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
              </tbody>
            </table>
          </fieldset>
        </fieldset>

        <fieldset class="spider_type_fieldset" id="Slideshow">
          <fieldset class="spider_child_fieldset" id="Slideshow_1">
            <table style="clear:both;">
              <tbody>
                <tr>
                  <td class="spider_label"><label for="slideshow_cont_bg_color">Background color: </label></td>
                  <td>
                    <input type="text" name="slideshow_cont_bg_color" id="slideshow_cont_bg_color" value="<?php 
        echo $row->slideshow_cont_bg_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_rl_btn_size">Right, left buttons size: </label></td>
                  <td>
                    <input type="text" name="slideshow_rl_btn_size" id="slideshow_rl_btn_size" value="<?php 
        echo $row->slideshow_rl_btn_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_play_pause_btn_size">Play, pause buttons size: </label></td>
                  <td>
                    <input type="text" name="slideshow_play_pause_btn_size" id="slideshow_play_pause_btn_size" value="<?php 
        echo $row->slideshow_play_pause_btn_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_rl_btn_color">Buttons color: </label></td>
                  <td>
                    <input type="text" name="slideshow_rl_btn_color" id="slideshow_rl_btn_color" value="<?php 
        echo $row->slideshow_rl_btn_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_close_btn_transparent">Buttons transparency: </label></td>
                  <td>
                    <input type="text" name="slideshow_close_btn_transparent" id="slideshow_close_btn_transparent" value="<?php 
        echo $row->slideshow_close_btn_transparent;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
                    <div class="spider_description">Value must be between 0 to 100.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_close_rl_btn_hover_color">Buttons hover color: </label></td>
                  <td>
                    <input type="text" name="slideshow_close_rl_btn_hover_color" id="slideshow_close_rl_btn_hover_color" value="<?php 
        echo $row->slideshow_close_rl_btn_hover_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_rl_btn_width">Right, left buttons width: </label></td>
                  <td>
                    <input type="text" name="slideshow_rl_btn_width" id="slideshow_rl_btn_width" value="<?php 
        echo $row->slideshow_rl_btn_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_rl_btn_height">Right, left buttons height: </label></td>
                  <td>
                    <input type="text" name="slideshow_rl_btn_height" id="slideshow_rl_btn_height" value="<?php 
        echo $row->slideshow_rl_btn_height;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_rl_btn_bg_color">Right, left buttons background color: </label></td>
                  <td>
                    <input type="text" name="slideshow_rl_btn_bg_color" id="slideshow_rl_btn_bg_color" value="<?php 
        echo $row->slideshow_rl_btn_bg_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_rl_btn_border_width">Right, left buttons border width: </label></td>
                  <td>
                    <input type="text" name="slideshow_rl_btn_border_width" id="slideshow_rl_btn_border_width" value="<?php 
        echo $row->slideshow_rl_btn_border_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_rl_btn_border_style">Right, left buttons border style: </label></td>
                  <td>
                    <select name="slideshow_rl_btn_border_style" id="slideshow_rl_btn_border_style">
                      <?php 
        foreach ($border_styles as $key => $border_style) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->slideshow_rl_btn_border_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $border_style;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_rl_btn_border_color">Right, left buttons border color: </label></td>
                  <td>
                    <input type="text" name="slideshow_rl_btn_border_color" id="slideshow_rl_btn_border_color" value="<?php 
        echo $row->slideshow_rl_btn_border_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_rl_btn_border_radius">Right, left buttons border radius: </label></td>
                  <td>
                    <input type="text" name="slideshow_rl_btn_border_radius" id="slideshow_rl_btn_border_radius" value="<?php 
        echo $row->slideshow_rl_btn_border_radius;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_rl_btn_style">Right, left buttons style: </label></td>
                  <td>
                    <select name="slideshow_rl_btn_style" id="slideshow_rl_btn_style">
                      <?php 
        foreach ($button_styles as $key => $button_style) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->slideshow_rl_btn_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $button_style;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_rl_btn_box_shadow">Right, left buttons box shadow: </label></td>
                  <td>
                    <input type="text" name="slideshow_rl_btn_box_shadow" id="slideshow_rl_btn_box_shadow" value="<?php 
        echo $row->slideshow_rl_btn_box_shadow;
        ?>
" class="spider_box_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
              </tbody>
            </table>
          </fieldset>
          <fieldset class="spider_child_fieldset" id="Slideshow_2">
            <table style="clear:both;">
              <tbody>
                <tr>
                  <td class="spider_label"><label>Filmstrip/Slider bullet position: </label></td>
                  <td>
                    <select name="slideshow_filmstrip_pos" id="slideshow_filmstrip_pos">
                      <option value="top" <?php 
        echo $row->slideshow_filmstrip_pos == "top" ? 'selected="selected"' : '';
        ?>
>Top</option>
                      <option value="right" <?php 
        echo $row->slideshow_filmstrip_pos == "right" ? 'selected="selected"' : '';
        ?>
>Right</option>
                      <option value="bottom" <?php 
        echo $row->slideshow_filmstrip_pos == "bottom" ? 'selected="selected"' : '';
        ?>
>Bottom</option>
                      <option value="left" <?php 
        echo $row->slideshow_filmstrip_pos == "left" ? 'selected="selected"' : '';
        ?>
>Left</option>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_filmstrip_thumb_margin">Filmstrip margin: </label></td>
                  <td>
                    <input type="text" name="slideshow_filmstrip_thumb_margin" id="slideshow_filmstrip_thumb_margin" value="<?php 
        echo $row->slideshow_filmstrip_thumb_margin;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_filmstrip_thumb_border_width">Filmstrip border width: </label></td>
                  <td>
                    <input type="text" name="slideshow_filmstrip_thumb_border_width" id="slideshow_filmstrip_thumb_border_width" value="<?php 
        echo $row->slideshow_filmstrip_thumb_border_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_filmstrip_thumb_border_style">Filmstrip border style: </label>
                  </td>
                  <td>
                    <select name="slideshow_filmstrip_thumb_border_style" id="slideshow_filmstrip_thumb_border_style">
                      <?php 
        foreach ($border_styles as $key => $border_style) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->slideshow_filmstrip_thumb_border_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $border_style;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_filmstrip_thumb_border_color">Filmstrip border color: </label></td>
                  <td>
                    <input type="text" name="slideshow_filmstrip_thumb_border_color" id="slideshow_filmstrip_thumb_border_color" value="<?php 
        echo $row->slideshow_filmstrip_thumb_border_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_filmstrip_thumb_border_radius">Filmstrip border radius: </label></td>
                  <td>
                    <input type="text" name="slideshow_filmstrip_thumb_border_radius" id="slideshow_filmstrip_thumb_border_radius" value="<?php 
        echo $row->slideshow_filmstrip_thumb_border_radius;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_filmstrip_thumb_active_border_width">Filmstrip active border width: </label></td>
                  <td>
                    <input type="text" name="slideshow_filmstrip_thumb_active_border_width" id="slideshow_filmstrip_thumb_active_border_width" value="<?php 
        echo $row->slideshow_filmstrip_thumb_active_border_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/>px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_filmstrip_thumb_active_border_color">Filmstrip active border color: </label></td>
                  <td>
                    <input type="text" name="slideshow_filmstrip_thumb_active_border_color" id="slideshow_filmstrip_thumb_active_border_color" value="<?php 
        echo $row->slideshow_filmstrip_thumb_active_border_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr id="tr_appWidth">
                  <td class="spider_label"><label for="slideshow_filmstrip_thumb_deactive_transparent">Filmstrip deactive transparency: </label></td>
                  <td>
                    <input type="text" name="slideshow_filmstrip_thumb_deactive_transparent" id="slideshow_filmstrip_thumb_deactive_transparent" value="<?php 
        echo $row->slideshow_filmstrip_thumb_deactive_transparent;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
                    <div class="spider_description">Value must be between 0 to 100.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_filmstrip_rl_bg_color">Filmstrip right, left buttons background color: </label></td>
                  <td>
                    <input type="text" name="slideshow_filmstrip_rl_bg_color" id="slideshow_filmstrip_rl_bg_color" value="<?php 
        echo $row->slideshow_filmstrip_rl_bg_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_filmstrip_rl_btn_color">Filmstrip right, left buttons color: </label></td>
                  <td>
                    <input type="text" name="slideshow_filmstrip_rl_btn_color" id="slideshow_filmstrip_rl_btn_color" value="<?php 
        echo $row->slideshow_filmstrip_rl_btn_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_filmstrip_rl_btn_size">Filmstrip right, left buttons size: </label></td>
                  <td>
                    <input type="text" name="slideshow_filmstrip_rl_btn_size" id="slideshow_filmstrip_rl_btn_size" value="<?php 
        echo $row->slideshow_filmstrip_rl_btn_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)" /> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_dots_width">Slider bullet width: </label></td>
                  <td>
                    <input type="text" name="slideshow_dots_width" id="slideshow_dots_width" value="<?php 
        echo $row->slideshow_dots_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_dots_height">Slider bullet height: </label></td>
                  <td>
                    <input type="text" name="slideshow_dots_height" id="slideshow_dots_height" value="<?php 
        echo $row->slideshow_dots_height;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_dots_border_radius">Slider bullet border radius: </label></td>
                  <td>
                    <input type="text" name="slideshow_dots_border_radius" id="slideshow_dots_border_radius" value="<?php 
        echo $row->slideshow_dots_border_radius;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_dots_background_color">Slider bullet background color: </label></td>
                  <td>
                    <input type="text" name="slideshow_dots_background_color" id="slideshow_dots_background_color" value="<?php 
        echo $row->slideshow_dots_background_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_dots_margin">Slider bullet margin: </label></td>
                  <td>
                    <input type="text" name="slideshow_dots_margin" id="slideshow_dots_margin" value="<?php 
        echo $row->slideshow_dots_margin;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_dots_active_background_color">Slider bullet active background color: </label></td>
                  <td>
                    <input type="text" name="slideshow_dots_active_background_color" id="slideshow_dots_active_background_color" value="<?php 
        echo $row->slideshow_dots_active_background_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_dots_active_border_width">Slider bullet active border width: </label></td>
                  <td>
                    <input type="text" name="slideshow_dots_active_border_width" id="slideshow_dots_active_border_width" value="<?php 
        echo $row->slideshow_dots_active_border_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_dots_active_border_color">Slider bullet active border color: </label></td>
                  <td>
                    <input type="text" name="slideshow_dots_active_border_color" id="slideshow_dots_active_border_color" value="<?php 
        echo $row->slideshow_dots_active_border_color;
        ?>
" class="color"/>
                  </td>
                </tr>
              </tbody>
            </table>
          </fieldset>
          <fieldset class="spider_child_fieldset" id="Slideshow_3">
            <table style="clear:both;">
              <tbody>
                <tr>
                  <td class="spider_label"><label for="slideshow_title_background_color">Title background color: </label></td>
                  <td>
                    <input type="text" name="slideshow_title_background_color" id="slideshow_title_background_color" value="<?php 
        echo $row->slideshow_title_background_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_title_opacity">Title transparency: </label></td>
                  <td>
                    <input type="text" name="slideshow_title_opacity" id="slideshow_title_opacity" value="<?php 
        echo $row->slideshow_title_opacity;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
                    <div class="spider_description">Value must be between 0 to 100.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_title_border_radius">Title border radius: </label></td>
                  <td>
                    <input type="text" name="slideshow_title_border_radius" id="slideshow_title_border_radius" value="<?php 
        echo $row->slideshow_title_border_radius;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_title_padding">Title padding: </label></td>
                  <td>
                    <input type="text" name="slideshow_title_padding" id="slideshow_title_padding" value="<?php 
        echo $row->slideshow_title_padding;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_title_font_size">Title font size: </label></td>
                  <td>
                    <input type="text" name="slideshow_title_font_size" id="slideshow_title_font_size" value="<?php 
        echo $row->slideshow_title_font_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)" /> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_title_color">Title color: </label></td>
                  <td>
                    <input type="text" name="slideshow_title_color" id="slideshow_title_color" value="<?php 
        echo $row->slideshow_title_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_title_font">Title font family: </label></td>
                  <td>
                    <select name="slideshow_title_font" id="slideshow_title_font">
                      <?php 
        foreach ($font_families as $key => $font_family) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->slideshow_title_font == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $font_family;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_description_background_color">Description background color: </label></td>
                  <td>
                    <input type="text" name="slideshow_description_background_color" id="slideshow_description_background_color" value="<?php 
        echo $row->slideshow_description_background_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_description_opacity">Description transparency: </label></td>
                  <td>
                    <input type="text" name="slideshow_description_opacity" id="slideshow_description_opacity" value="<?php 
        echo $row->slideshow_description_opacity;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
                    <div class="spider_description">Value must be between 0 to 100.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_description_border_radius">Description border radius: </label></td>
                  <td>
                    <input type="text" name="slideshow_description_border_radius" id="slideshow_description_border_radius" value="<?php 
        echo $row->slideshow_description_border_radius;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_description_padding">Description padding: </label></td>
                  <td>
                    <input type="text" name="slideshow_description_padding" id="slideshow_description_padding" value="<?php 
        echo $row->slideshow_description_padding;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_description_font_size">Description font size: </label></td>
                  <td>
                    <input type="text" name="slideshow_description_font_size" id="slideshow_description_font_size" value="<?php 
        echo $row->slideshow_description_font_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_description_color">Description color: </label></td>
                  <td>
                    <input type="text" name="slideshow_description_color" id="slideshow_description_color" value="<?php 
        echo $row->slideshow_description_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="slideshow_description_font">Description font family: </label></td>
                  <td>
                    <select name="slideshow_description_font" id="slideshow_description_font">
                      <?php 
        foreach ($font_families as $key => $font_family) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->slideshow_description_font == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $font_family;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
              </tbody>
            </table>
          </fieldset>
        </fieldset>

        <fieldset class="spider_type_fieldset" id="Image_browser">
          <fieldset class="spider_child_fieldset" id="Image_browser_1">
            <table style="clear:both;">
              <tbody>
                <tr>
                  <td class="spider_label"><label for="image_browser_full_padding">Full padding: </label></td>
                  <td>
                    <input type="text" name="image_browser_full_padding" id="image_browser_full_padding" value="<?php 
        echo $row->image_browser_full_padding;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="image_browser_full_bg_color">Full background color: </label></td>
                  <td>
                    <input type="text" name="image_browser_full_bg_color" id="image_browser_full_bg_color" value="<?php 
        echo $row->image_browser_full_bg_color;
        ?>
" class="color" />
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="image_browser_full_transparent">Full background transparency: </label></td>
                  <td>
                    <input type="text" name="image_browser_full_transparent" id="image_browser_full_transparent" value="<?php 
        echo $row->image_browser_full_transparent;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
                    <div class="spider_description">Value must be between 0 to 100.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="image_browser_full_border_radius">Full border radius: </label></td>
                  <td>
                    <input type="text" name="image_browser_full_border_radius" id="image_browser_full_border_radius" value="<?php 
        echo $row->image_browser_full_border_radius;
        ?>
" class="spider_char_input" />
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="image_browser_full_border_width">Full border width: </label></td>
                  <td>
                    <input type="text" name="image_browser_full_border_width" id="image_browser_full_border_width" value="<?php 
        echo $row->image_browser_full_border_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="image_browser_full_border_style">Full border style: </label></td>
                  <td>
                    <select name="image_browser_full_border_style" id="image_browser_full_border_style">
                      <?php 
        foreach ($border_styles as $key => $border_style) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->image_browser_full_border_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $border_style;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="image_browser_full_border_color">Full border color: </label></td>
                  <td>
                    <input type="text" name="image_browser_full_border_color" id="image_browser_full_border_color" value="<?php 
        echo $row->image_browser_full_border_color;
        ?>
" class="color" />
                  </td>
                </tr>
              </tbody>
            </table>
          </fieldset>
          <fieldset class="spider_child_fieldset" id="Image_browser_2">
            <table style="clear:both;">
              <tbody>
                <tr>
                  <td class="spider_label"><label for="image_browser_align0">Alignment: </label></td>
                  <td>
                    <select name="image_browser_align" id="image_browser_align">
                      <?php 
        foreach ($aligns as $key => $align) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->image_browser_align == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $align;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="image_browser_margin">Margin: </label></td>
                  <td>
                    <input type="text" name="image_browser_margin" id="image_browser_margin" value="<?php 
        echo $row->image_browser_margin;
        ?>
" class="spider_char_input" />
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="image_browser_padding">Padding: </label></td>
                  <td>
                    <input type="text" name="image_browser_padding" id="image_browser_padding" value="<?php 
        echo $row->image_browser_padding;
        ?>
" class="spider_char_input" />
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="image_browser_border_width">Border width: </label></td>
                  <td>
                    <input type="text" name="image_browser_border_width" id="image_browser_border_width" value="<?php 
        echo $row->image_browser_border_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="image_browser_border_style">Border style: </label></td>
                  <td>
                    <select name="image_browser_border_style" id="image_browser_border_style">
                      <?php 
        foreach ($border_styles as $key => $border_style) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->image_browser_border_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $border_style;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="image_browser_border_color">Border color: </label></td>
                  <td>
                    <input type="text" name="image_browser_border_color" id="image_browser_border_color" value="<?php 
        echo $row->image_browser_border_color;
        ?>
" class="color" />
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="image_browser_border_radius">Border radius: </label></td>
                  <td>
                    <input type="text" name="image_browser_border_radius" id="image_browser_border_radius" value="<?php 
        echo $row->image_browser_border_radius;
        ?>
" class="spider_char_input" />
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="image_browser_bg_color">Background color: </label></td>
                  <td>
                    <input type="text" name="image_browser_bg_color" id="image_browser_bg_color" value="<?php 
        echo $row->image_browser_bg_color;
        ?>
" class="color" />
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="image_browser_transparent">Background transparency: </label></td>
                  <td>
                    <input type="text" name="image_browser_transparent" id="image_browser_transparent" value="<?php 
        echo $row->image_browser_transparent;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
                    <div class="spider_description">Value must be between 0 to 100.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="image_browser_box_shadow">Box shadow: </label></td>
                  <td>
                    <input type="text" name="image_browser_box_shadow" id="image_browser_box_shadow" value="<?php 
        echo $row->image_browser_box_shadow;
        ?>
" class="spider_box_input" />
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
              </tbody>
            </table>
          </fieldset>
          <fieldset class="spider_child_fieldset" id="Image_browser_3">
            <table style="clear:both;">
              <tbody>
                <tr>
                  <td class="spider_label"><label for="image_browser_image_description_align0">Title alignment: </label></td>
                  <td>
                    <select name="image_browser_image_description_align" id="image_browser_image_description_align">
                      <?php 
        foreach ($aligns as $key => $align) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->image_browser_image_description_align == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $align;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="image_browser_img_font_size">Font size: </label></td>
                  <td>
                    <input type="text" name="image_browser_img_font_size" id="image_browser_img_font_size" value="<?php 
        echo $row->image_browser_img_font_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="image_browser_img_font_color">Font color: </label></td>
                  <td>
                    <input type="text" name="image_browser_img_font_color" id="image_browser_img_font_color" value="<?php 
        echo $row->image_browser_img_font_color;
        ?>
" class="color" />
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="image_browser_img_font_family">Font family: </label></td>
                  <td>
                    <select name="image_browser_img_font_family" id="image_browser_img_font_family">
                      <?php 
        foreach ($font_families as $key => $font_family) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->image_browser_img_font_family == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $font_family;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="image_browser_image_description_margin">Description margin: </label></td>
                  <td>
                    <input type="text" name="image_browser_image_description_margin" id="image_browser_image_description_margin" value="<?php 
        echo $row->image_browser_image_description_margin;
        ?>
" class="spider_char_input" />
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="image_browser_image_description_padding">Description padding: </label></td>
                  <td>
                    <input type="text" name="image_browser_image_description_padding" id="image_browser_image_description_padding" value="<?php 
        echo $row->image_browser_image_description_padding;
        ?>
" class="spider_char_input" />
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="image_browser_image_description_border_width">Description border width: </label></td>
                  <td>
                    <input type="text" name="image_browser_image_description_border_width" id="image_browser_image_description_border_width" value="<?php 
        echo $row->image_browser_image_description_border_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)" /> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="image_browser_image_description_border_style">Description border style: </label></td>
                  <td>
                    <select name="image_browser_image_description_border_style" id="image_browser_image_description_border_style">
                      <?php 
        foreach ($border_styles as $key => $border_style) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->image_browser_image_description_border_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $border_style;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="image_browser_image_description_border_color">Description border color: </label></td>
                  <td>
                    <input type="text" name="image_browser_image_description_border_color" id="image_browser_image_description_border_color" value="<?php 
        echo $row->image_browser_image_description_border_color;
        ?>
" class="color" />
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="image_browser_image_description_border_radius">Description border radius: </label></td>
                  <td>
                    <input type="text" name="image_browser_image_description_border_radius" id="image_browser_image_description_border_radius" value="<?php 
        echo $row->image_browser_image_description_border_radius;
        ?>
" class="spider_char_input" />
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="image_browser_image_description_bg_color">Description background color: </label></td>
                  <td>
                    <input type="text" name="image_browser_image_description_bg_color" id="image_browser_image_description_bg_color" value="<?php 
        echo $row->image_browser_image_description_bg_color;
        ?>
" class="color" />
                  </td>
                </tr>
              </tbody>
            </table>
          </fieldset>
        </fieldset>

        <fieldset class="spider_type_fieldset" id="Compact_album">
          <fieldset class="spider_child_fieldset" id="Compact_album_1">
            <table style="clear:both;">
              <tbody>
                <tr>
                  <td class="spider_label"><label for="album_compact_thumb_padding">Padding: </label></td>
                  <td>
                    <input type="text" name="album_compact_thumb_padding" id="album_compact_thumb_padding" value="<?php 
        echo $row->album_compact_thumb_padding;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_compact_thumb_margin">Margin: </label></td>
                  <td>
                    <input type="text" name="album_compact_thumb_margin" id="album_compact_thumb_margin" value="<?php 
        echo $row->album_compact_thumb_margin;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_compact_thumb_border_width">Border width: </label></td>
                  <td>
                    <input type="text" name="album_compact_thumb_border_width" id="album_compact_thumb_border_width" value="<?php 
        echo $row->album_compact_thumb_border_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_compact_thumb_border_style">Border style: </label></td>
                  <td>
                    <select name="album_compact_thumb_border_style" id="album_compact_thumb_border_style">
                      <?php 
        foreach ($border_styles as $key => $border_style) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->album_compact_thumb_border_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $border_style;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_compact_thumb_border_color">Border color: </label></td>
                  <td>
                    <input type="text" name="album_compact_thumb_border_color" id="album_compact_thumb_border_color" value="<?php 
        echo $row->album_compact_thumb_border_color;
        ?>
" class="color" />
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_compact_thumb_border_radius">Border radius: </label></td>
                  <td>
                    <input type="text" name="album_compact_thumb_border_radius" id="album_compact_thumb_border_radius" value="<?php 
        echo $row->album_compact_thumb_border_radius;
        ?>
" class="spider_char_input" />
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_compact_thumb_box_shadow">Shadow: </label></td>
                  <td>
                    <input type="text" name="album_compact_thumb_box_shadow" id="album_compact_thumb_box_shadow" value="<?php 
        echo $row->album_compact_thumb_box_shadow;
        ?>
" class="spider_box_input" />
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_compact_thumb_hover_effect">Hover effect: </label></td>
                  <td>
                    <select name="album_compact_thumb_hover_effect" id="album_compact_thumb_hover_effect">
                      <?php 
        foreach ($hover_effects as $key => $hover_effect) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->album_compact_thumb_hover_effect == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $hover_effect;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_compact_thumb_hover_effect_value">Hover effect value: </label></td>
                  <td>
                    <input type="text" name="album_compact_thumb_hover_effect_value" id="album_compact_thumb_hover_effect_value" value="<?php 
        echo $row->album_compact_thumb_hover_effect_value;
        ?>
" class="spider_char_input" />
                    <div class="spider_description">E.g. Rotate: 10deg, Scale: 1.5, Skew: 10deg.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label>Thumbnail transition: </label></td>
                  <td id="album_compact_thumb_transition">
                    <input type="radio" name="album_compact_thumb_transition" id="album_compact_thumb_transition1" value="1"<?php 
        if ($row->album_compact_thumb_transition == 1) {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="album_compact_thumb_transition1" id="album_compact_thumb_transition1_lbl">Yes</label>
                    <input type="radio" name="album_compact_thumb_transition" id="album_compact_thumb_transition0" value="0"<?php 
        if ($row->album_compact_thumb_transition == 0) {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="album_compact_thumb_transition0" id="album_compact_thumb_transition0_lbl">No</label>
                  </td>
                </tr>
              </tbody>
            </table>
          </fieldset>
          <fieldset class="spider_child_fieldset" id="Compact_album_2">
            <table style="clear:both;">
              <tbody>
                <tr>
                  <td class="spider_label"><label for="album_compact_thumb_bg_color">Thumbnail background color: </label></td>
                  <td>
                    <input type="text" name="album_compact_thumb_bg_color" id="album_compact_thumb_bg_color" value="<?php 
        echo $row->album_compact_thumb_bg_color;
        ?>
" class="color" />
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_compact_thumb_transparent">Thumbnail transparency: </label></td>
                  <td>
                    <input type="text" name="album_compact_thumb_transparent" id="album_compact_thumb_transparent" value="<?php 
        echo $row->album_compact_thumb_transparent;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
                    <div class="spider_description">Value must be between 0 to 100.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_compact_thumbs_bg_color">Full background color: </label></td>
                  <td>
                    <input type="text" name="album_compact_thumbs_bg_color" id="album_compact_thumbs_bg_color" value="<?php 
        echo $row->album_compact_thumbs_bg_color;
        ?>
" class="color" />
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_compact_thumb_bg_transparent">Full background transparency: </label></td>
                  <td>
                    <input type="text" name="album_compact_thumb_bg_transparent" id="album_compact_thumb_bg_transparent" value="<?php 
        echo $row->album_compact_thumb_bg_transparent;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
                    <div class="spider_description">Value must be between 0 to 100.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_compact_thumb_align0">Alignment: </label></td>
                  <td>
                    <select name="album_compact_thumb_align" id="album_compact_thumb_align">
                      <?php 
        foreach ($aligns as $key => $align) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->album_compact_thumb_align == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $align;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
              </tbody>
            </table>
          </fieldset>
          <fieldset class="spider_child_fieldset" id="Compact_album_3">
            <table style="clear:both;">
              <tbody>
                <tr>
                  <td class="spider_label"><label>Title position: </label></td>
                  <td>
                    <input type="radio" name="album_compact_thumb_title_pos" id="album_compact_thumb_title_pos1" value="top" <?php 
        if ($row->album_compact_thumb_title_pos == "top") {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="album_compact_thumb_title_pos1" id="album_compact_thumb_title_pos1_lbl">Top</label>
                    <input type="radio" name="album_compact_thumb_title_pos" id="album_compact_thumb_title_pos0" value="bottom" <?php 
        if ($row->album_compact_thumb_title_pos == "bottom") {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="album_compact_thumb_title_pos0" id="album_compact_thumb_title_pos0_lbl">Bottom</label>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_compact_title_font_size">Title font size: </label></td>
                  <td>
                    <input type="text" name="album_compact_title_font_size" id="album_compact_title_font_size" value="<?php 
        echo $row->album_compact_title_font_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_compact_title_font_color">Title font color: </label></td>
                  <td>
                    <input type="text" name="album_compact_title_font_color" id="album_compact_title_font_color" value="<?php 
        echo $row->album_compact_title_font_color;
        ?>
" class="color" />
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_compact_title_font_style">Title font family: </label></td>
                  <td>
                    <select name="album_compact_title_font_style" id="album_compact_title_font_style">
                      <?php 
        foreach ($font_families as $key => $font_family) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->album_compact_title_font_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $font_family;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_compact_title_font_weight">Title font weight: </label></td>
                  <td>
                    <select name="album_compact_title_font_weight" id="album_compact_title_font_weight">
                      <?php 
        foreach ($font_weights as $key => $font_weight) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->album_compact_title_font_weight == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $font_weight;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_compact_title_shadow">Title box shadow: </label></td>
                  <td>
                    <input type="text" name="album_compact_title_shadow" id="album_compact_title_shadow" value="<?php 
        echo $row->album_compact_title_shadow;
        ?>
" class="spider_box_input" />
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_compact_title_margin">Title margin: </label></td>
                  <td>
                    <input type="text" name="album_compact_title_margin" id="album_compact_title_margin" value="<?php 
        echo $row->album_compact_title_margin;
        ?>
" class="spider_char_input" />
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_compact_back_font_size">Font size: </label></td>
                  <td>
                    <input type="text" name="album_compact_back_font_size" id="album_compact_back_font_size" value="<?php 
        echo $row->album_compact_back_font_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_compact_back_font_color">Font color: </label></td>
                  <td>
                    <input type="text" name="album_compact_back_font_color" id="album_compact_back_font_color" value="<?php 
        echo $row->album_compact_back_font_color;
        ?>
" class="color" />
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_compact_back_font_style">Font family: </label></td>
                  <td>
                    <select name="album_compact_back_font_style" id="album_compact_back_font_style">
                      <?php 
        foreach ($font_families as $key => $font_family) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->album_compact_back_font_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $font_family;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_compact_back_font_weight">Font weight: </label></td>
                  <td>
                    <select name="album_compact_back_font_weight" id="album_compact_back_font_weight">
                      <?php 
        foreach ($font_weights as $key => $font_weight) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->album_compact_back_font_weight == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $font_weight;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_compact_back_padding">Back padding: </label></td>
                  <td>
                    <input type="text" name="album_compact_back_padding" id="album_compact_back_padding" value="<?php 
        echo $row->album_compact_back_padding;
        ?>
" class="spider_char_input" />
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
              </tbody>
            </table>
          </fieldset>
        </fieldset>

        <fieldset class="spider_type_fieldset" id="Extended_album">
          <fieldset class="spider_child_fieldset" id="Extended_album_1">
            <table style="clear:both;">
              <tbody>
                <tr>
                  <td class="spider_label"><label for="album_extended_thumb_margin">Thumbnail margin: </label></td>
                  <td>
                    <input type="text" name="album_extended_thumb_margin" id="album_extended_thumb_margin" value="<?php 
        echo $row->album_extended_thumb_margin;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_thumb_padding">Thumbnail padding: </label></td>
                  <td>
                    <input type="text" name="album_extended_thumb_padding" id="album_extended_thumb_padding" value="<?php 
        echo $row->album_extended_thumb_padding;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_thumb_border_width">Thumbnail border width: </label></td>
                  <td>
                    <input type="text" name="album_extended_thumb_border_width" id="album_extended_thumb_border_width" value="<?php 
        echo $row->album_extended_thumb_border_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_thumb_border_style">Thumbnail border style: </label></td>
                  <td>
                    <select name="album_extended_thumb_border_style" id="album_extended_thumb_border_style">
                      <?php 
        foreach ($border_styles as $key => $border_style) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->album_extended_thumb_border_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $border_style;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_thumb_border_color">Thumbnail border color: </label></td>
                  <td>
                    <input type="text" name="album_extended_thumb_border_color" id="album_extended_thumb_border_color" value="<?php 
        echo $row->album_extended_thumb_border_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_thumb_border_radius">Thumbnail border radius: </label></td>
                  <td>
                    <input type="text" name="album_extended_thumb_border_radius" id="album_extended_thumb_border_radius" value="<?php 
        echo $row->album_extended_thumb_border_radius;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_thumb_box_shadow">Thumbnail box shadow: </label></td>
                  <td>
                    <input type="text" name="album_extended_thumb_box_shadow" id="album_extended_thumb_box_shadow" value="<?php 
        echo $row->album_extended_thumb_box_shadow;
        ?>
" class="spider_box_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label>Thumbnail transition: </label></td>
                  <td id="album_extended_thumb_transition">
                    <input type="radio" name="album_extended_thumb_transition" id="album_extended_thumb_transition1" value="1"<?php 
        if ($row->album_extended_thumb_transition == 1) {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="album_extended_thumb_transition1" id="album_extended_thumb_transition1_lbl">Yes</label>
                    <input type="radio" name="album_extended_thumb_transition" id="album_extended_thumb_transition0" value="0"<?php 
        if ($row->album_extended_thumb_transition == 0) {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="album_extended_thumb_transition0" id="album_extended_thumb_transition0_lbl">No</label>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_thumb_align0">Thumbnail alignment: </label></td>
                  <td>
                    <select name="album_extended_thumb_align" id="album_extended_thumb_align">
                      <?php 
        foreach ($aligns as $key => $align) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->album_extended_thumb_align == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $align;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_thumb_transparent">Thumbnail transparency: </label></td>
                  <td>
                    <input type="text" name="album_extended_thumb_transparent" id="album_extended_thumb_transparent" value="<?php 
        echo $row->album_extended_thumb_transparent;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
                    <div class="spider_description">Value must be between 0 to 100.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_thumb_hover_effect">Thumbnail hover effect: </label></td>
                  <td>
                    <select name="album_extended_thumb_hover_effect" id="album_extended_thumb_hover_effect">
                      <?php 
        foreach ($hover_effects as $key => $hover_effect) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->album_extended_thumb_hover_effect == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $hover_effect;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_thumb_hover_effect_value">Hover effect value: </label></td>
                  <td>
                    <input type="text" name="album_extended_thumb_hover_effect_value" id="album_extended_thumb_hover_effect_value" value="<?php 
        echo $row->album_extended_thumb_hover_effect_value;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">E.g. Rotate: 10deg, Scale: 1.5, Skew: 10deg.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_thumb_bg_color">Thumbnail background color: </label></td>
                  <td>
                    <input type="text" name="album_extended_thumb_bg_color" id="album_extended_thumb_bg_color" value="<?php 
        echo $row->album_extended_thumb_bg_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_thumbs_bg_color">Thumbnails background color: </label></td>
                  <td>
                    <input type="text" name="album_extended_thumbs_bg_color" id="album_extended_thumbs_bg_color" value="<?php 
        echo $row->album_extended_thumbs_bg_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_thumb_bg_transparent">Thumbnail background transparency: </label></td>
                  <td>
                    <input type="text" name="album_extended_thumb_bg_transparent" id="album_extended_thumb_bg_transparent" value="<?php 
        echo $row->album_extended_thumb_bg_transparent;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
                    <div class="spider_description">Value must be between 0 to 100.</div>
                  </td>
                </tr>
              </tbody>
            </table>
          </fieldset>
          <fieldset class="spider_child_fieldset" id="Extended_album_2">
            <table style="clear:both;">
              <tbody>
                <tr>
                  <td class="spider_label"><label for="album_extended_thumb_div_padding">Thumbnail div padding: </label></td>
                  <td>
                    <input type="text" name="album_extended_thumb_div_padding" id="album_extended_thumb_div_padding" value="<?php 
        echo $row->album_extended_thumb_div_padding;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_thumb_div_bg_color">Thumbnail div background color: </label></td>
                  <td>
                    <input type="text" name="album_extended_thumb_div_bg_color" id="album_extended_thumb_div_bg_color" value="<?php 
        echo $row->album_extended_thumb_div_bg_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_thumb_div_border_width">Thumbnail div border width: </label>
                  </td>
                  <td>
                    <input type="text" name="album_extended_thumb_div_border_width" id="album_extended_thumb_div_border_width" value="<?php 
        echo $row->album_extended_thumb_div_border_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_thumb_div_border_style">Thumbnail div border style: </label></td>
                  <td>
                    <select name="album_extended_thumb_div_border_style" id="album_extended_thumb_div_border_style">
                      <?php 
        foreach ($border_styles as $key => $border_style) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->album_extended_thumb_div_border_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $border_style;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_thumb_div_border_color">Thumbnail div border color: </label></td>
                  <td>
                    <input type="text" name="album_extended_thumb_div_border_color" id="album_extended_thumb_div_border_color" value="<?php 
        echo $row->album_extended_thumb_div_border_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_thumb_div_border_radius">Thumbnail div border radius: </label></td>
                  <td>
                    <input type="text" name="album_extended_thumb_div_border_radius" id="album_extended_thumb_div_border_radius" value="<?php 
        echo $row->album_extended_thumb_div_border_radius;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_div_margin">Margin: </label></td>
                  <td>
                    <input type="text" name="album_extended_div_margin" id="album_extended_div_margin" value="<?php 
        echo $row->album_extended_div_margin;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_div_padding">Padding: </label></td>
                  <td>
                    <input type="text" name="album_extended_div_padding" id="album_extended_div_padding" value="<?php 
        echo $row->album_extended_div_padding;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_div_bg_color">Background color: </label></td>
                  <td>
                    <input type="text" name="album_extended_div_bg_color" id="album_extended_div_bg_color" value="<?php 
        echo $row->album_extended_div_bg_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_div_bg_transparent">Background transparency: </label></td>
                  <td>
                    <input type="text" name="album_extended_div_bg_transparent" id="album_extended_div_bg_transparent" value="<?php 
        echo $row->album_extended_div_bg_transparent;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
                    <div class="spider_description">Value must be between 0 to 100.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_div_border_radius">Border radius: </label></td>
                  <td>
                    <input type="text" name="album_extended_div_border_radius" id="album_extended_div_border_radius" value="<?php 
        echo $row->album_extended_div_border_radius;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_div_separator_width">Separator width: </label></td>
                  <td>
                    <input type="text" name="album_extended_div_separator_width" id="album_extended_div_separator_width" value="<?php 
        echo $row->album_extended_div_separator_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_div_separator_style">Separator style: </label></td>
                  <td>
                    <select name="album_extended_div_separator_style" id="album_extended_div_separator_style">
                      <?php 
        foreach ($border_styles as $key => $border_style) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->album_extended_div_separator_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $border_style;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_div_separator_color">Separator color: </label></td>
                  <td>
                    <input type="text" name="album_extended_div_separator_color" id="album_extended_div_separator_color" value="<?php 
        echo $row->album_extended_div_separator_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_back_padding">Back padding: </label></td>
                  <td>
                    <input type="text" name="album_extended_back_padding" id="album_extended_back_padding" value="<?php 
        echo $row->album_extended_back_padding;
        ?>
" class="spider_char_input" />
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_back_font_size">Back font size: </label></td>
                  <td>
                    <input type="text" name="album_extended_back_font_size" id="album_extended_back_font_size" value="<?php 
        echo $row->album_extended_back_font_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_back_font_color">Back font color: </label></td>
                  <td>
                    <input type="text" name="album_extended_back_font_color" id="album_extended_back_font_color" value="<?php 
        echo $row->album_extended_back_font_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_back_font_style">Back font family: </label></td>
                  <td>
                    <select name="album_extended_back_font_style" id="album_extended_back_font_style">
                      <?php 
        foreach ($font_families as $key => $font_family) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->album_extended_back_font_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $font_family;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_back_font_weight">Back font weight: </label></td>
                  <td>
                    <select name="album_extended_back_font_weight" id="album_extended_back_font_weight">
                      <?php 
        foreach ($font_weights as $key => $font_weight) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->album_extended_back_font_weight == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $font_weight;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
            </tbody>
            </table>
          </fieldset>
          <fieldset class="spider_child_fieldset" id="Extended_album_3">
            <table style="clear:both;">
              <tbody>
                <tr>
                  <td class="spider_label"><label for="album_extended_text_div_padding">Text div padding: </label></td>
                  <td>
                    <input type="text" name="album_extended_text_div_padding" id="album_extended_text_div_padding" value="<?php 
        echo $row->album_extended_text_div_padding;
        ?>
" class="spider_char_input" />
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_text_div_border_width">Text div border width: </label></td>
                  <td>
                    <input type="text" name="album_extended_text_div_border_width" id="album_extended_text_div_border_width" value="<?php 
        echo $row->album_extended_text_div_border_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_text_div_border_style">Text border style: </label></td>
                  <td>
                    <select name="album_extended_text_div_border_style" id="album_extended_text_div_border_style">
                      <?php 
        foreach ($border_styles as $key => $border_style) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->album_extended_text_div_border_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $border_style;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_text_div_border_color">Text border color: </label></td>
                  <td>
                    <input type="text" name="album_extended_text_div_border_color" id="album_extended_text_div_border_color" value="<?php 
        echo $row->album_extended_text_div_border_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_text_div_border_radius">Text div border radius: </label></td>
                  <td>
                    <input type="text" name="album_extended_text_div_border_radius" id="album_extended_text_div_border_radius" value="<?php 
        echo $row->album_extended_text_div_border_radius;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_text_div_bg_color">Text background color: </label></td>
                  <td>
                    <input type="text" name="album_extended_text_div_bg_color" id="album_extended_text_div_bg_color" value="<?php 
        echo $row->album_extended_text_div_bg_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_title_margin_bottom">Title margin: </label></td>
                  <td>
                    <input type="text" name="album_extended_title_margin_bottom" id="album_extended_title_margin_bottom" value="<?php 
        echo $row->album_extended_title_margin_bottom;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_title_padding">Title padding: </label></td>
                  <td>
                    <input type="text" name="album_extended_title_padding" id="album_extended_title_padding" value="<?php 
        echo $row->album_extended_title_padding;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_title_span_border_width">Title border width: </label></td>
                  <td>
                    <input type="text" name="album_extended_title_span_border_width" id="album_extended_title_span_border_width" value="<?php 
        echo $row->album_extended_title_span_border_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_title_span_border_style">Title border style: </label></td>
                  <td>
                    <select name="album_extended_title_span_border_style" id="album_extended_title_span_border_style">
                      <?php 
        foreach ($border_styles as $key => $border_style) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->album_extended_title_span_border_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $border_style;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_title_span_border_color">Title border color: </label></td>
                  <td>
                    <input type="text" name="album_extended_title_span_border_color" id="album_extended_title_span_border_color" value="<?php 
        echo $row->album_extended_title_span_border_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_title_font_size">Title font size: </label></td>
                  <td>
                    <input type="text" name="album_extended_title_font_size" id="album_extended_title_font_size" value="<?php 
        echo $row->album_extended_title_font_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_title_font_color">Title font color: </label></td>
                  <td>
                    <input type="text" name="album_extended_title_font_color" id="album_extended_title_font_color" value="<?php 
        echo $row->album_extended_title_font_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_title_font_style">Title font family: </label></td>
                  <td>
                    <select name="album_extended_title_font_style" id="album_extended_title_font_style">
                      <?php 
        foreach ($font_families as $key => $font_family) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->album_extended_title_font_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $font_family;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_title_font_weight">Title font weight: </label></td>
                  <td>
                    <select name="album_extended_title_font_weight" id="album_extended_title_font_weight">
                      <?php 
        foreach ($font_weights as $key => $font_weight) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->album_extended_title_font_weight == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $font_weight;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_desc_padding">Description padding: </label></td>
                  <td>
                    <input type="text" name="album_extended_desc_padding" id="album_extended_desc_padding" value="<?php 
        echo $row->album_extended_desc_padding;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_desc_span_border_width">Description border width: </label></td>
                  <td>
                    <input type="text" name="album_extended_desc_span_border_width" id="album_extended_desc_span_border_width" value="<?php 
        echo $row->album_extended_desc_span_border_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_desc_span_border_style">Description border style: </label></td>
                  <td>
                    <select name="album_extended_desc_span_border_style" id="album_extended_desc_span_border_style">
                      <?php 
        foreach ($border_styles as $key => $border_style) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->album_extended_desc_span_border_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $border_style;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_desc_span_border_color">Description border color: </label></td>
                  <td>
                    <input type="text" name="album_extended_desc_span_border_color" id="album_extended_desc_span_border_color" value="<?php 
        echo $row->album_extended_desc_span_border_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_desc_font_size">Description font size: </label></td>
                  <td>
                    <input type="text" name="album_extended_desc_font_size" id="album_extended_desc_font_size" value="<?php 
        echo $row->album_extended_desc_font_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_desc_font_color">Description font color: </label></td>
                  <td>
                    <input type="text" name="album_extended_desc_font_color" id="album_extended_desc_font_color" value="<?php 
        echo $row->album_extended_desc_font_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_desc_font_style">Description font family: </label></td>
                  <td>
                    <select name="album_extended_desc_font_style" id="album_extended_desc_font_style">
                      <?php 
        foreach ($font_families as $key => $font_family) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->album_extended_desc_font_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $font_family;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_desc_font_weight">Description font weight: </label></td>
                  <td>
                    <select name="album_extended_desc_font_weight" id="album_extended_desc_font_weight">
                      <?php 
        foreach ($font_weights as $key => $font_weight) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->album_extended_desc_font_weight == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $font_weight;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_desc_more_size">Description more size: </label></td>
                  <td>
                    <input type="text" name="album_extended_desc_more_size" id="album_extended_desc_more_size" value="<?php 
        echo $row->album_extended_desc_more_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="album_extended_desc_more_color">Description more color: </label></td>
                  <td>
                    <input type="text" name="album_extended_desc_more_color" id="album_extended_desc_more_color" value="<?php 
        echo $row->album_extended_desc_more_color;
        ?>
" class="color"/>
                  </td>
                </tr>
              </tbody>
            </table>
          </fieldset>
        </fieldset>

        <fieldset class="spider_type_fieldset" id="Blog_style">
          <fieldset class="spider_child_fieldset" id="Blog_style_1">
            <table style="clear:both;">
              <tbody>
                <tr>
                  <td class="spider_label"><label for="blog_style_bg_color">Background color: </label></td>
                  <td>
                    <input type="text" name="blog_style_bg_color" id="blog_style_bg_color" value="<?php 
        echo $row->blog_style_bg_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="blog_style_transparent">Background transparency: </label></td>
                  <td>
                    <input type="text" name="blog_style_transparent" id="blog_style_transparent" value="<?php 
        echo $row->blog_style_transparent;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
                    <div class="spider_description">Value must be between 0 to 100.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="blog_style_align0">Alignment: </label></td>
                  <td>
                    <select name="blog_style_align" id="blog_style_align">
                      <?php 
        foreach ($aligns as $key => $align) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->blog_style_align == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $align;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="blog_style_margin">Margin: </label></td>
                  <td>
                    <input type="text" name="blog_style_margin" id="blog_style_margin" value="<?php 
        echo $row->blog_style_margin;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="blog_style_padding">Padding: </label></td>
                  <td>
                    <input type="text" name="blog_style_padding" id="blog_style_padding" value="<?php 
        echo $row->blog_style_padding;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="blog_style_box_shadow">Box shadow: </label></td>
                  <td>
                    <input type="text" name="blog_style_box_shadow" id="blog_style_box_shadow" value="<?php 
        echo $row->blog_style_box_shadow;
        ?>
" class="spider_box_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                </tbody>
            </table>
          </fieldset>
          <fieldset class="spider_child_fieldset" id="Blog_style_2">
            <table style="clear:both;">
              <tbody>
                <tr>
                  <td class="spider_label"><label for="blog_style_img_font_family">Font family: </label></td>
                  <td>
                    <select name="blog_style_img_font_family" id="blog_style_img_font_family">
                      <?php 
        foreach ($font_families as $key => $font_family) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->blog_style_img_font_family == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $font_family;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="blog_style_img_font_size">Font size: </label></td>
                  <td>
                    <input type="text" name="blog_style_img_font_size" id="blog_style_img_font_size" value="<?php 
        echo $row->blog_style_img_font_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="blog_style_img_font_color">Font color: </label></td>
                  <td>
                    <input type="text" name="blog_style_img_font_color" id="blog_style_img_font_color" value="<?php 
        echo $row->blog_style_img_font_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="blog_style_border_width">Border width: </label></td>
                  <td>
                    <input type="text" name="blog_style_border_width" id="blog_style_border_width" value="<?php 
        echo $row->blog_style_border_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="blog_style_border_style">Border style: </label></td>
                  <td>
                    <select name="blog_style_border_style" id="blog_style_border_style">
                      <?php 
        foreach ($border_styles as $key => $border_style) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->blog_style_border_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $border_style;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="blog_style_border_color">Border color: </label></td>
                  <td>
                    <input type="text" name="blog_style_border_color" id="blog_style_border_color" value="<?php 
        echo $row->blog_style_border_color;
        ?>
" class="color" />
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="blog_style_border_radius">Border radius: </label></td>
                  <td>
                    <input type="text" name="blog_style_border_radius" id="blog_style_border_radius" value="<?php 
        echo $row->blog_style_border_radius;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
              </tbody>
            </table>
          </fieldset>
          <fieldset class="spider_child_fieldset" id="Blog_style_3">
            <table style="clear:both;">
              <tbody>
                <tr>
                  <td class="spider_label"><label for="blog_style_share_buttons_margin">Buttons and title margin: </label></td>
                  <td>
                    <input type="text" name="blog_style_share_buttons_margin" id="blog_style_share_buttons_margin" value="<?php 
        echo $row->blog_style_share_buttons_margin;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="blog_style_share_buttons_font_size">Buttons size: </label></td>
                  <td>
                    <input type="text" name="blog_style_share_buttons_font_size" id="blog_style_share_buttons_font_size" value="<?php 
        echo $row->blog_style_share_buttons_font_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="blog_style_share_buttons_color">Buttons color: </label></td>
                  <td>
                    <input type="text" name="blog_style_share_buttons_color" id="blog_style_share_buttons_color" value="<?php 
        echo $row->blog_style_share_buttons_color;
        ?>
" class="color"/>
                  </td>
                </tr>
               <tr>
                  <td class="spider_label"><label for="blog_style_share_buttons_border_width">Buttons and title border width: </label></td>
                  <td>
                    <input type="text" name="blog_style_share_buttons_border_width" id="blog_style_share_buttons_border_width" value="<?php 
        echo $row->blog_style_share_buttons_border_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="blog_style_share_buttons_border_style">Buttons and title border style: </label></td>
                  <td>
                    <select name="blog_style_share_buttons_border_style" id="blog_style_share_buttons_border_style">
                      <?php 
        foreach ($border_styles as $key => $border_style) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->blog_style_share_buttons_border_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $border_style;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="blog_style_share_buttons_border_color">Buttons and title border color: </label></td>
                  <td>
                    <input type="text" name="blog_style_share_buttons_border_color" id="blog_style_share_buttons_border_color" value="<?php 
        echo $row->blog_style_share_buttons_border_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="blog_style_share_buttons_border_radius">Buttons and title border radius: </label></td>
                  <td>
                    <input type="text" name="blog_style_share_buttons_border_radius" id="blog_style_share_buttons_border_radius" value="<?php 
        echo $row->blog_style_share_buttons_border_radius;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="blog_style_share_buttons_bg_color">Buttons and title background color: </label></td>
                  <td>
                    <input type="text" name="blog_style_share_buttons_bg_color" id="blog_style_share_buttons_bg_color" value="<?php 
        echo $row->blog_style_share_buttons_bg_color;
        ?>
" class="color"/>
                  </td>
                </tr>
		<tr>
                  <td class="spider_label"><label for="blog_style_share_buttons_bg_transparent">Buttons and title background transparency: </label></td>
                  <td>
                    <input type="text" name="blog_style_share_buttons_bg_transparent" id="blog_style_share_buttons_bg_transparent" value="<?php 
        echo $row->blog_style_share_buttons_bg_transparent;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
                    <div class="spider_description">Value must be between 0 to 100.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="blog_style_share_buttons_align0">Buttons or title alignment: </label></td>
                  <td>
                    <select name="blog_style_share_buttons_align" id="blog_style_share_buttons_align">
                      <?php 
        foreach ($aligns as $key => $align) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->blog_style_share_buttons_align == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $align;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
              </tbody>
            </table>
          </fieldset>
        </fieldset>

        <fieldset class="spider_type_fieldset" id="Lightbox">
          <fieldset class="spider_child_fieldset" id="Lightbox_1">
            <table style="clear:both;">
              <tbody>
                <tr id="lightbox_overlay_bg">
                  <td class="spider_label"><label for="lightbox_overlay_bg_color">Overlay background color: </label></td>
                  <td>
                    <input type="text" name="lightbox_overlay_bg_color" id="lightbox_overlay_bg_color" value="<?php 
        echo $row->lightbox_overlay_bg_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr id="lightbox_overlay">
                  <td class="spider_label"><label for="lightbox_overlay_bg_transparent">Overlay background transparency: </label></td>
                  <td>
                    <input type="text" name="lightbox_overlay_bg_transparent" id="lightbox_overlay_bg_transparent" value="<?php 
        echo $row->lightbox_overlay_bg_transparent;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
                    <div class="spider_description">Value must be between 0 to 100.</div>
                  </td>
                </tr>
                <tr id="lightbox_bg">
                  <td class="spider_label"><label for="lightbox_bg_color">Lightbox background color: </label></td>
                  <td>
                    <input type="text" name="lightbox_bg_color" id="lightbox_bg_color" value="<?php 
        echo $row->lightbox_bg_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr id="lightbox_cntrl1">
                  <td class="spider_label"><label for="lightbox_ctrl_btn_height">Control buttons height: </label></td>
                  <td>
                    <input type="text" name="lightbox_ctrl_btn_height" id="lightbox_ctrl_btn_height" value="<?php 
        echo $row->lightbox_ctrl_btn_height;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr id="lightbox_cntrl2">
                  <td class="spider_label"><label for="lightbox_ctrl_btn_margin_top">Control buttons margin (top): </label></td>
                  <td>
                    <input type="text" name="lightbox_ctrl_btn_margin_top" id="lightbox_ctrl_btn_margin_top" value="<?php 
        echo $row->lightbox_ctrl_btn_margin_top;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr id="lightbox_cntrl3">
                  <td class="spider_label"><label for="lightbox_ctrl_btn_margin_left">Control buttons margin (left): </label></td>
                  <td>
                    <input type="text" name="lightbox_ctrl_btn_margin_left" id="lightbox_ctrl_btn_margin_left" value="<?php 
        echo $row->lightbox_ctrl_btn_margin_left;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr id="lightbox_cntrl9">
                  <td class="spider_label"><label>Control buttons position: </label></td>
                  <td>
                    <input type="radio" name="lightbox_ctrl_btn_pos" id="lightbox_ctrl_btn_pos1" value="top"<?php 
        if ($row->lightbox_ctrl_btn_pos == "top") {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="lightbox_ctrl_btn_pos1" id="lightbox_ctrl_btn_pos1_lbl">Top</label>
                    <input type="radio" name="lightbox_ctrl_btn_pos" id="lightbox_ctrl_btn_pos0" value="bottom"<?php 
        if ($row->lightbox_ctrl_btn_pos == "bottom") {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="lightbox_ctrl_btn_pos0" id="lightbox_ctrl_btn_pos0_lbl">Bottom</label>
                  </td>
                </tr>
                <tr id="lightbox_cntrl8">
                  <td class="spider_label"><label for="lightbox_ctrl_cont_bg_color">Control buttons background color: </label></td>
                  <td>
                    <input type="text" name="lightbox_ctrl_cont_bg_color" id="lightbox_ctrl_cont_bg_color" value="<?php 
        echo $row->lightbox_ctrl_cont_bg_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr id="lightbox_cntrl5">
                  <td class="spider_label"><label for="lightbox_ctrl_cont_border_radius">Control buttons container border radius: </label></td>
                  <td>
                    <input type="text" name="lightbox_ctrl_cont_border_radius" id="lightbox_ctrl_cont_border_radius" value="<?php 
        echo $row->lightbox_ctrl_cont_border_radius;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr id="lightbox_cntrl6">
                  <td class="spider_label"><label for="lightbox_ctrl_cont_transparent">Control buttons container background transparency: </label></td>
                  <td>
                    <input type="text" name="lightbox_ctrl_cont_transparent" id="lightbox_ctrl_cont_transparent" value="<?php 
        echo $row->lightbox_ctrl_cont_transparent;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
                    <div class="spider_description">Value must be between 0 to 100.</div>
                  </td>
                </tr>
                <tr id="lightbox_cntrl10">
                  <td class="spider_label"><label for="lightbox_ctrl_btn_align0">Control buttons alignment: </label></td>
                  <td>
                    <select name="lightbox_ctrl_btn_align" id="lightbox_ctrl_btn_align">
                      <?php 
        foreach ($aligns as $key => $align) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->lightbox_ctrl_btn_align == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $align;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr id="lightbox_cntrl7">
                  <td class="spider_label"><label for="lightbox_ctrl_btn_color">Control buttons color: </label></td>
                  <td>
                    <input type="text" name="lightbox_ctrl_btn_color" id="lightbox_ctrl_btn_color" value="<?php 
        echo $row->lightbox_ctrl_btn_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr id="lightbox_cntrl4">
                  <td class="spider_label"><label for="lightbox_ctrl_btn_transparent">Control buttons transparency: </label></td>
                  <td>
                    <input type="text" name="lightbox_ctrl_btn_transparent" id="lightbox_ctrl_btn_transparent" value="<?php 
        echo $row->lightbox_ctrl_btn_transparent;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
                    <div class="spider_description">Value must be between 0 to 100.</div>
                  </td>
                </tr>
                <tr id="lightbox_toggle1">
                  <td class="spider_label"><label for="lightbox_toggle_btn_height">Toggle button height: </label></td>
                  <td>
                    <input type="text" name="lightbox_toggle_btn_height" id="lightbox_toggle_btn_height" value="<?php 
        echo $row->lightbox_toggle_btn_height;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr id="lightbox_toggle2">
                  <td class="spider_label"><label for="lightbox_toggle_btn_width">Toggle button width: </label></td>
                  <td>
                    <input type="text" name="lightbox_toggle_btn_width" id="lightbox_toggle_btn_width" value="<?php 
        echo $row->lightbox_toggle_btn_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr id="lightbox_close1">
                  <td class="spider_label"><label for="lightbox_close_btn_border_radius">Close button border radius: </label>
                  </td>
                  <td>
                    <input type="text" name="lightbox_close_btn_border_radius" id="lightbox_close_btn_border_radius" value="<?php 
        echo $row->lightbox_close_btn_border_radius;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr id="lightbox_close2">
                  <td class="spider_label"><label for="lightbox_close_btn_border_width">Close button border width: </label></td>
                  <td>
                    <input type="text" name="lightbox_close_btn_border_width" id="lightbox_close_btn_border_width" value="<?php 
        echo $row->lightbox_close_btn_border_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr id="lightbox_close12">
                  <td class="spider_label"><label for="lightbox_close_btn_border_style">Close button border style: </label></td>
                  <td>
                    <select name="lightbox_close_btn_border_style" id="lightbox_close_btn_border_style">
                      <?php 
        foreach ($border_styles as $key => $border_style) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->lightbox_close_btn_border_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $border_style;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr id="lightbox_close13">
                  <td class="spider_label"><label for="lightbox_close_btn_border_color">Close button border color: </label></td>
                  <td>
                    <input type="text" name="lightbox_close_btn_border_color" id="lightbox_close_btn_border_color" value="<?php 
        echo $row->lightbox_close_btn_border_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr id="lightbox_close3">
                  <td class="spider_label"><label for="lightbox_close_btn_box_shadow">Close button box shadow: </label></td>
                  <td>
                    <input type="text" name="lightbox_close_btn_box_shadow" id="lightbox_close_btn_box_shadow" value="<?php 
        echo $row->lightbox_close_btn_box_shadow;
        ?>
" class="spider_box_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr id="lightbox_close11">
                  <td class="spider_label"><label for="lightbox_close_btn_bg_color">Close button background color: </label></td>
                  <td>
                    <input type="text" name="lightbox_close_btn_bg_color" id="lightbox_close_btn_bg_color" value="<?php 
        echo $row->lightbox_close_btn_bg_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr id="lightbox_close9">
                  <td class="spider_label"><label for="lightbox_close_btn_transparent">Close button transparency: </label></td>
                  <td>
                    <input type="text" name="lightbox_close_btn_transparent" id="lightbox_close_btn_transparent" value="<?php 
        echo $row->lightbox_close_btn_transparent;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
                  </td>
                </tr>
                <tr id="lightbox_close5">
                  <td class="spider_label"><label for="lightbox_close_btn_width">Close button width: </label></td>
                  <td>
                    <input type="text" name="lightbox_close_btn_width" id="lightbox_close_btn_width" value="<?php 
        echo $row->lightbox_close_btn_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr id="lightbox_close6">
                  <td class="spider_label"><label for="lightbox_close_btn_height">Close button height: </label></td>
                  <td>
                    <input type="text" name="lightbox_close_btn_height" id="lightbox_close_btn_height" value="<?php 
        echo $row->lightbox_close_btn_height;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr id="lightbox_close7">
                  <td class="spider_label"><label for="lightbox_close_btn_top">Close button top: </label></td>
                  <td>
                    <input type="text" name="lightbox_close_btn_top" id="lightbox_close_btn_top" value="<?php 
        echo $row->lightbox_close_btn_top;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr id="lightbox_close8">
                  <td class="spider_label"><label for="lightbox_close_btn_right">Close button right: </label></td>
                  <td>
                    <input type="text" name="lightbox_close_btn_right" id="lightbox_close_btn_right" value="<?php 
        echo $row->lightbox_close_btn_right;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr id="lightbox_close4">
                  <td class="spider_label"><label for="lightbox_close_btn_size">Close button size: </label></td>
                  <td>
                    <input type="text" name="lightbox_close_btn_size" id="lightbox_close_btn_size" value="<?php 
        echo $row->lightbox_close_btn_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr id="lightbox_close14">
                  <td class="spider_label"><label for="lightbox_close_btn_color">Close button color: </label></td>
                  <td>
                    <input type="text" name="lightbox_close_btn_color" id="lightbox_close_btn_color" value="<?php 
        echo $row->lightbox_close_btn_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr id="lightbox_close10">
                  <td class="spider_label"><label for="lightbox_close_btn_full_color">Fullscreen close button color: </label></td>
                  <td>
                    <input type="text" name="lightbox_close_btn_full_color" id="lightbox_close_btn_full_color" value="<?php 
        echo $row->lightbox_close_btn_full_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr id="lightbox_comment24">
                  <td class="spider_label"><label for="lightbox_comment_share_button_color">Share buttons color: </label></td>
                  <td>
                    <input type="text" name="lightbox_comment_share_button_color" id="lightbox_comment_share_button_color" value="<?php 
        echo $row->lightbox_comment_share_button_color;
        ?>
" class="color" />
                  </td>
                </tr>
              </tbody>
            </table>
          </fieldset>
          <fieldset class="spider_child_fieldset" id="Lightbox_2">
            <table style="clear:both;">
              <tbody>
                <tr id="lightbox_right_left11">
                  <td class="spider_label"><label for="lightbox_rl_btn_style">Right, left buttons style: </label></td>
                  <td>
                    <select name="lightbox_rl_btn_style" id="lightbox_rl_btn_style" class="spider_int_input">
                      <?php 
        foreach ($button_styles as $key => $button_style) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->lightbox_rl_btn_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $button_style;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr id="lightbox_right_left7">
                  <td class="spider_label"><label for="lightbox_rl_btn_bg_color">Right, left buttons background color: </label></td>
                  <td>
                    <input type="text" name="lightbox_rl_btn_bg_color" id="lightbox_rl_btn_bg_color" value="<?php 
        echo $row->lightbox_rl_btn_bg_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_rl_btn_transparent">Right, left buttons transparency: </label></td>
                  <td>
                    <input type="text" name="lightbox_rl_btn_transparent" id="lightbox_rl_btn_transparent" value="<?php 
        echo $row->lightbox_rl_btn_transparent;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
                  </td>
                </tr>
                <tr id="lightbox_right_left3">
                  <td class="spider_label"><label for="lightbox_rl_btn_box_shadow">Right, left buttons box shadow: </label></td>
                  <td>
                    <input type="text" name="lightbox_rl_btn_box_shadow" id="lightbox_rl_btn_box_shadow" value="<?php 
        echo $row->lightbox_rl_btn_box_shadow;
        ?>
" class="spider_box_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr id="lightbox_right_left4">
                  <td class="spider_label"><label for="lightbox_rl_btn_height">Right, left buttons height: </label></td>
                  <td>
                    <input type="text" name="lightbox_rl_btn_height" id="lightbox_rl_btn_height" value="<?php 
        echo $row->lightbox_rl_btn_height;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr id="lightbox_right_left5">
                  <td class="spider_label"><label for="lightbox_rl_btn_width">Right, left buttons width: </label></td>
                  <td>
                    <input type="text" name="lightbox_rl_btn_width" id="lightbox_rl_btn_width" value="<?php 
        echo $row->lightbox_rl_btn_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr id="lightbox_right_left6">
                  <td class="spider_label"><label for="lightbox_rl_btn_size">Right, left buttons size: </label></td>
                  <td>
                    <input type="text" name="lightbox_rl_btn_size" id="lightbox_rl_btn_size" value="<?php 
        echo $row->lightbox_rl_btn_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr id="lightbox_close15">
                  <td class="spider_label"><label for="lightbox_close_rl_btn_hover_color">Right, left, close buttons hover color: </label></td>
                  <td>
                    <input type="text" name="lightbox_close_rl_btn_hover_color" id="lightbox_close_rl_btn_hover_color" value="<?php 
        echo $row->lightbox_close_rl_btn_hover_color;
        ?>
" class="color" />
                  </td>
                </tr>
                <tr id="lightbox_right_left10">
                  <td class="spider_label"><label for="lightbox_rl_btn_color">Right, left buttons color: </label></td>
                  <td>
                    <input type="text" name="lightbox_rl_btn_color" id="lightbox_rl_btn_color" value="<?php 
        echo $row->lightbox_rl_btn_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr id="lightbox_right_left1">
                  <td class="spider_label"><label for="lightbox_rl_btn_border_radius">Right, left buttons border radius: </label></td>
                  <td>
                    <input type="text" name="lightbox_rl_btn_border_radius" id="lightbox_rl_btn_border_radius" value="<?php 
        echo $row->lightbox_rl_btn_border_radius;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr id="lightbox_right_left2">
                  <td class="spider_label"><label for="lightbox_rl_btn_border_width">Right, left buttons border width: </label></td>
                  <td>
                    <input type="text" name="lightbox_rl_btn_border_width" id="lightbox_rl_btn_border_width" value="<?php 
        echo $row->lightbox_rl_btn_border_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr id="lightbox_right_left8">
                  <td class="spider_label"><label for="lightbox_rl_btn_border_style">Right, left buttons border style: </label></td>
                  <td>
                    <select name="lightbox_rl_btn_border_style" id="lightbox_rl_btn_border_style">
                      <?php 
        foreach ($border_styles as $key => $border_style) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->lightbox_rl_btn_border_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $border_style;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr id="lightbox_right_left9">
                  <td class="spider_label"><label for="lightbox_rl_btn_border_color">Right, left buttons border color: </label></td>
                  <td>
                    <input type="text" name="lightbox_rl_btn_border_color" id="lightbox_rl_btn_border_color" value="<?php 
        echo $row->lightbox_rl_btn_border_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr id="lightbox_filmstrip12">
                  <td class="spider_label"><label>Filmstrip position: </label></td>
                  <td>
                    <select name="lightbox_filmstrip_pos" id="lightbox_filmstrip_pos">
                      <option value="top" <?php 
        echo $row->lightbox_filmstrip_pos == "top" ? 'selected="selected"' : '';
        ?>
>Top</option>
                      <option value="right" <?php 
        echo $row->lightbox_filmstrip_pos == "right" ? 'selected="selected"' : '';
        ?>
>Right</option>
                      <option value="bottom" <?php 
        echo $row->lightbox_filmstrip_pos == "bottom" ? 'selected="selected"' : '';
        ?>
>Bottom</option>
                      <option value="left" <?php 
        echo $row->lightbox_filmstrip_pos == "left" ? 'selected="selected"' : '';
        ?>
>Left</option>
                    </select>
                  </td>
                </tr>
                <tr id="lightbox_filmstrip2">
                  <td class="spider_label"><label for="lightbox_filmstrip_thumb_margin">Filmstrip thumbnail margin: </label></td>
                  <td>
                    <input type="text" name="lightbox_filmstrip_thumb_margin" id="lightbox_filmstrip_thumb_margin" value="<?php 
        echo $row->lightbox_filmstrip_thumb_margin;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr id="lightbox_filmstrip3">
                  <td class="spider_label"><label for="lightbox_filmstrip_thumb_border_width">Filmstrip thumbnail border width: </label></td>
                  <td>
                    <input type="text" name="lightbox_filmstrip_thumb_border_width" id="lightbox_filmstrip_thumb_border_width" value="<?php 
        echo $row->lightbox_filmstrip_thumb_border_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr id="lightbox_filmstrip9">
                  <td class="spider_label"><label for="lightbox_filmstrip_thumb_border_style">Filmstrip thumbnail border style: </label></td>
                  <td>
                    <select name="lightbox_filmstrip_thumb_border_style" id="lightbox_filmstrip_thumb_border_style">
                      <?php 
        foreach ($border_styles as $key => $border_style) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->lightbox_filmstrip_thumb_border_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $border_style;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr id="lightbox_filmstrip10">
                  <td class="spider_label"><label for="lightbox_filmstrip_thumb_border_color">Filmstrip thumbnail border color: </label></td>
                  <td>
                    <input type="text" name="lightbox_filmstrip_thumb_border_color" id="lightbox_filmstrip_thumb_border_color" value="<?php 
        echo $row->lightbox_filmstrip_thumb_border_color;
        ?>
" class="color" />
                  </td>
                </tr>
                <tr id="lightbox_filmstrip4">
                  <td class="spider_label"><label for="lightbox_filmstrip_thumb_border_radius">Filmstrip thumbnail border radius: </label></td>
                  <td>
                    <input type="text" name="lightbox_filmstrip_thumb_border_radius" id="lightbox_filmstrip_thumb_border_radius" value="<?php 
        echo $row->lightbox_filmstrip_thumb_border_radius;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr id="lightbox_filmstrip6">
                  <td class="spider_label"><label for="lightbox_filmstrip_thumb_active_border_width">Filmstrip thumbnail active border width: </label></td>
                  <td>
                    <input type="text" name="lightbox_filmstrip_thumb_active_border_width" id="lightbox_filmstrip_thumb_active_border_width" value="<?php 
        echo $row->lightbox_filmstrip_thumb_active_border_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr id="lightbox_filmstrip11">
                  <td class="spider_label"> <label for="lightbox_filmstrip_thumb_active_border_color">Filmstrip thumbnail active border color:</label></td>
                  <td>
                    <input type="text" name="lightbox_filmstrip_thumb_active_border_color" id="lightbox_filmstrip_thumb_active_border_color" value="<?php 
        echo $row->lightbox_filmstrip_thumb_active_border_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr id="lightbox_filmstrip5">
                  <td class="spider_label"><label for="lightbox_filmstrip_thumb_deactive_transparent">Filmstrip thumbnail deactive transparency: </label></td>
                  <td>
                    <input type="text" name="lightbox_filmstrip_thumb_deactive_transparent" id="lightbox_filmstrip_thumb_deactive_transparent" value="<?php 
        echo $row->lightbox_filmstrip_thumb_deactive_transparent;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
                    <div class="spider_description">Value must be between 0 to 100.</div>
                  </td>
                </tr>
                <tr id="lightbox_filmstrip1">
                  <td class="spider_label"><label for="lightbox_filmstrip_rl_btn_size">Filmstrip right, left buttons size: </label></td>
                  <td>
                    <input type="text" name="lightbox_filmstrip_rl_btn_size" id="lightbox_filmstrip_rl_btn_size" value="<?php 
        echo $row->lightbox_filmstrip_rl_btn_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr id="lightbox_filmstrip7">
                  <td class="spider_label"><label for="lightbox_filmstrip_rl_btn_color">Filmstrip right, left buttons color: </label></td>
                  <td>
                    <input type="text" name="lightbox_filmstrip_rl_btn_color" id="lightbox_filmstrip_rl_btn_color" value="<?php 
        echo $row->lightbox_filmstrip_rl_btn_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr id="lightbox_filmstrip8">
                  <td class="spider_label"><label for="lightbox_filmstrip_rl_bg_color">Filmstrip right, left button background color:</label></td>
                  <td>
                    <input type="text" name="lightbox_filmstrip_rl_bg_color" id="lightbox_filmstrip_rl_bg_color" value="<?php 
        echo $row->lightbox_filmstrip_rl_bg_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_rate_pos1">Rating position: </label></td>
                  <td>
                    <input type="radio" name="lightbox_rate_pos" id="lightbox_rate_pos1" value="top" <?php 
        if ($row->lightbox_rate_pos == "top") {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="lightbox_rate_pos1" id="lightbox_rate_pos1_lbl">Top</label>
                    <input type="radio" name="lightbox_rate_pos" id="lightbox_rate_pos0" value="bottom" <?php 
        if ($row->lightbox_rate_pos == "bottom") {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="lightbox_rate_pos0" id="lightbox_rate_pos0_lbl">Bottom</label>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_rate_align">Rating alignment: </label></td>
                  <td>
                    <select name="lightbox_rate_align" id="lightbox_rate_align">
                      <?php 
        foreach ($aligns as $key => $align) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->lightbox_rate_align == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $align;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_rate_icon">Rating icon: </label></td>
                  <td>
                    <select name="lightbox_rate_icon" id="lightbox_rate_icon">
                      <?php 
        foreach ($rate_icons as $key => $rate_icon) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->lightbox_rate_icon == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $rate_icon;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_rate_color">Rating color: </label></td>
                  <td>
                    <input type="text" name="lightbox_rate_color" id="lightbox_rate_color" value="<?php 
        echo $row->lightbox_rate_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_rate_hover_color">Rating hover color: </label></td>
                  <td>
                    <input type="text" name="lightbox_rate_hover_color" id="lightbox_rate_hover_color" value="<?php 
        echo $row->lightbox_rate_hover_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_rate_size">Rating size: </label></td>
                  <td>
                    <input type="text" name="lightbox_rate_size" id="lightbox_rate_size" value="<?php 
        echo $row->lightbox_rate_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_rate_stars_count">Rating icon count: </label></td>
                  <td>
                    <input type="text" name="lightbox_rate_stars_count" id="lightbox_rate_stars_count" value="<?php 
        echo $row->lightbox_rate_stars_count;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_rate_padding">Rating padding: </label></td>
                  <td>
                    <input type="text" name="lightbox_rate_padding" id="lightbox_rate_padding" value="<?php 
        echo $row->lightbox_rate_padding;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label>Hit counter position: </label></td>
                  <td>
                    <input type="radio" name="lightbox_hit_pos" id="lightbox_hit_pos1" value="top" <?php 
        if ($row->lightbox_hit_pos == "top") {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="lightbox_hit_pos1" id="lightbox_hit_pos1_lbl">Top</label>
                    <input type="radio" name="lightbox_hit_pos" id="lightbox_hit_pos0" value="bottom" <?php 
        if ($row->lightbox_hit_pos == "bottom") {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="lightbox_hit_pos0" id="lightbox_hit_pos0_lbl">Bottom</label>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_hit_align">Hit counter alignment: </label></td>
                  <td>
                    <select name="lightbox_hit_align" id="lightbox_hit_align">
                      <?php 
        foreach ($aligns as $key => $align) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->lightbox_hit_align == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $align;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_hit_bg_color">Hit counter background color: </label></td>
                  <td>
                    <input type="text" name="lightbox_hit_bg_color" id="lightbox_hit_bg_color" value="<?php 
        echo $row->lightbox_hit_bg_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_hit_bg_transparent">Hit counter background transparency: </label></td>
                  <td>
                    <input type="text" name="lightbox_hit_bg_transparent" id="lightbox_hit_bg_transparent" value="<?php 
        echo $row->lightbox_hit_bg_transparent;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
                    <div class="spider_description">Value must be between 0 to 100.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_hit_border_width">Hit counter border width: </label></td>
                  <td>
                    <input type="text" name="lightbox_hit_border_width" id="lightbox_hit_border_width" value="<?php 
        echo $row->lightbox_hit_border_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_hit_border_style">Hit counter border style: </label></td>
                  <td>
                    <select name="lightbox_hit_border_style" id="lightbox_hit_border_style">
                      <?php 
        foreach ($border_styles as $key => $border_style) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->lightbox_hit_border_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $border_style;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_hit_border_color">Hit counter border color: </label></td>
                  <td>
                    <input type="text" name="lightbox_hit_border_color" id="lightbox_hit_border_color" value="<?php 
        echo $row->lightbox_hit_border_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_hit_border_radius">Hit counter border radius: </label></td>
                  <td>
                    <input type="text" name="lightbox_hit_border_radius" id="lightbox_hit_border_radius" value="<?php 
        echo $row->lightbox_hit_border_radius;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_hit_padding">Hit counter padding: </label></td>
                  <td>
                    <input type="text" name="lightbox_hit_padding" id="lightbox_hit_padding" value="<?php 
        echo $row->lightbox_hit_padding;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_hit_margin">Hit counter margin: </label></td>
                  <td>
                    <input type="text" name="lightbox_hit_margin" id="lightbox_hit_margin" value="<?php 
        echo $row->lightbox_hit_margin;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_hit_color">Hit counter font color: </label></td>
                  <td>
                    <input type="text" name="lightbox_hit_color" id="lightbox_hit_color" value="<?php 
        echo $row->lightbox_hit_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_hit_font_style">Hit counter font family: </label></td>
                  <td>
                    <select name="lightbox_hit_font_style" id="lightbox_hit_font_style">
                      <?php 
        foreach ($font_families as $key => $font_family) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->lightbox_hit_font_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $font_family;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_hit_font_weight">Hit counter font weight: </label></td>
                  <td>
                    <select name="lightbox_hit_font_weight" id="lightbox_hit_font_weight">
                      <?php 
        foreach ($font_weights as $key => $font_weight) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->lightbox_hit_font_weight == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $font_weight;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_hit_font_size">Hit counter font size: </label>
                  </td>
                  <td>
                    <input type="text" name="lightbox_hit_font_size" id="lightbox_hit_font_size" value="<?php 
        echo $row->lightbox_hit_font_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
              </tbody>
            </table>
          </fieldset>
          <fieldset class="spider_child_fieldset" id="Lightbox_3">
            <table style="clear:both;">
              <tbody>
                <tr>
                  <td class="spider_label"><label>Info position: </label></td>
                  <td>
                    <input type="radio" name="lightbox_info_pos" id="lightbox_info_pos1" value="top" <?php 
        if ($row->lightbox_info_pos == "top") {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="lightbox_info_pos1" id="lightbox_info_pos1_lbl">Top</label>
                    <input type="radio" name="lightbox_info_pos" id="lightbox_info_pos0" value="bottom" <?php 
        if ($row->lightbox_info_pos == "bottom") {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="lightbox_info_pos0" id="lightbox_info_pos0_lbl">Bottom</label>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_info_align">Info alignment: </label></td>
                  <td>
                    <select name="lightbox_info_align" id="lightbox_info_align">
                      <?php 
        foreach ($aligns as $key => $align) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->lightbox_info_align == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $align;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_info_bg_color">Info background color: </label></td>
                  <td>
                    <input type="text" name="lightbox_info_bg_color" id="lightbox_info_bg_color" value="<?php 
        echo $row->lightbox_info_bg_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_info_bg_transparent">Info background transparency: </label></td>
                  <td>
                    <input type="text" name="lightbox_info_bg_transparent" id="lightbox_info_bg_transparent" value="<?php 
        echo $row->lightbox_info_bg_transparent;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
                    <div class="spider_description">Value must be between 0 to 100.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_info_border_width">Info border width: </label></td>
                  <td>
                    <input type="text" name="lightbox_info_border_width" id="lightbox_info_border_width" value="<?php 
        echo $row->lightbox_info_border_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_info_border_style">Info border style: </label></td>
                  <td>
                    <select name="lightbox_info_border_style" id="lightbox_info_border_style">
                      <?php 
        foreach ($border_styles as $key => $border_style) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->lightbox_info_border_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $border_style;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_info_border_color">Info border color: </label></td>
                  <td>
                    <input type="text" name="lightbox_info_border_color" id="lightbox_info_border_color" value="<?php 
        echo $row->lightbox_info_border_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_info_border_radius">Info border radius: </label></td>
                  <td>
                    <input type="text" name="lightbox_info_border_radius" id="lightbox_info_border_radius" value="<?php 
        echo $row->lightbox_info_border_radius;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_info_padding">Info padding: </label></td>
                  <td>
                    <input type="text" name="lightbox_info_padding" id="lightbox_info_padding" value="<?php 
        echo $row->lightbox_info_padding;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_info_margin">Info margin: </label></td>
                  <td>
                    <input type="text" name="lightbox_info_margin" id="lightbox_info_margin" value="<?php 
        echo $row->lightbox_info_margin;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_title_color">Title font color: </label></td>
                  <td>
                    <input type="text" name="lightbox_title_color" id="lightbox_title_color" value="<?php 
        echo $row->lightbox_title_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_title_font_style">Title font family: </label></td>
                  <td>
                    <select name="lightbox_title_font_style" id="lightbox_title_font_style">
                      <?php 
        foreach ($font_families as $key => $font_family) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->lightbox_title_font_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $font_family;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_title_font_weight">Title font weight: </label></td>
                  <td>
                    <select name="lightbox_title_font_weight" id="lightbox_title_font_weight">
                      <?php 
        foreach ($font_weights as $key => $font_weight) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->lightbox_title_font_weight == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $font_weight;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_title_font_size">Title font size: </label>
                  </td>
                  <td>
                    <input type="text" name="lightbox_title_font_size" id="lightbox_title_font_size" value="<?php 
        echo $row->lightbox_title_font_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_description_color">Description font color: </label></td>
                  <td>
                    <input type="text" name="lightbox_description_color" id="lightbox_description_color" value="<?php 
        echo $row->lightbox_description_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_description_font_style">Description font family: </label></td>
                  <td>
                    <select name="lightbox_description_font_style" id="lightbox_description_font_style">
                      <?php 
        foreach ($font_families as $key => $font_family) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->lightbox_description_font_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $font_family;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_description_font_weight">Description font weight: </label></td>
                  <td>
                    <select name="lightbox_description_font_weight" id="lightbox_description_font_weight">
                      <?php 
        foreach ($font_weights as $key => $font_weight) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->lightbox_description_font_weight == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $font_weight;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_description_font_size">Description font size: </label>
                  </td>
                  <td>
                    <input type="text" name="lightbox_description_font_size" id="lightbox_description_font_size" value="<?php 
        echo $row->lightbox_description_font_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="lightbox_comment_width">Comments Width: </label></td>
                  <td>
                    <input type="text" name="lightbox_comment_width" id="lightbox_comment_width" value="<?php 
        echo $row->lightbox_comment_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr id="lightbox_comment25">
                  <td class="spider_label"><label>Comments position: </label></td>
                  <td>
                    <input type="radio" name="lightbox_comment_pos" id="lightbox_comment_pos1" value="left"<?php 
        if ($row->lightbox_comment_pos == "left") {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="lightbox_comment_pos1" id="lightbox_comment_pos1_lbl">Left</label>
                    <input type="radio" name="lightbox_comment_pos" id="lightbox_comment_pos0" value="right"<?php 
        if ($row->lightbox_comment_pos == "right") {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="lightbox_comment_pos0" id="lightbox_comment_pos0_lbl">Right</label>
                  </td>
                </tr>
                <tr id="lightbox_comment13">
                  <td class="spider_label"><label for="lightbox_comment_bg_color">Comments background color: </label></td>
                  <td>
                    <input type="text" name="lightbox_comment_bg_color" id="lightbox_comment_bg_color" value="<?php 
        echo $row->lightbox_comment_bg_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr id="lightbox_comment2">
                  <td class="spider_label"><label for="lightbox_comment_font_size">Comments font size: </label></td>
                  <td>
                    <input type="text" name="lightbox_comment_font_size" id="lightbox_comment_font_size" value="<?php 
        echo $row->lightbox_comment_font_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr id="lightbox_comment14">
                  <td class="spider_label"><label for="lightbox_comment_font_color">Comments font color:</label></td>
                  <td>
                    <input type="text" name="lightbox_comment_font_color" id="lightbox_comment_font_color" value="<?php 
        echo $row->lightbox_comment_font_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr id="lightbox_comment15">
                  <td class="spider_label"><label for="lightbox_comment_font_style">Comments font family: </label></td>
                  <td>
                    <select name="lightbox_comment_font_style" id="lightbox_comment_font_style">
                      <?php 
        foreach ($font_families as $key => $font_family) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->lightbox_comment_font_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $font_family;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr id="lightbox_comment10">
                  <td class="spider_label"><label for="lightbox_comment_author_font_size">Comments author font size: </label>
                  </td>
                  <td>
                    <input type="text" name="lightbox_comment_author_font_size" id="lightbox_comment_author_font_size" value="<?php 
        echo $row->lightbox_comment_author_font_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr id="lightbox_comment11">
                  <td class="spider_label"><label for="lightbox_comment_date_font_size">Comments date font size: </label></td>
                  <td>
                    <input type="text" name="lightbox_comment_date_font_size" id="lightbox_comment_date_font_size" value="<?php 
        echo $row->lightbox_comment_date_font_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr id="lightbox_comment12">
                  <td class="spider_label"><label for="lightbox_comment_body_font_size">Comments body font size: </label></td>
                  <td>
                    <input type="text" name="lightbox_comment_body_font_size" id="lightbox_comment_body_font_size" value="<?php 
        echo $row->lightbox_comment_body_font_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr id="lightbox_comment6">
                  <td class="spider_label"><label for="lightbox_comment_input_border_width">Comment input border width: </label></td>
                  <td>
                    <input type="text" name="lightbox_comment_input_border_width" id="lightbox_comment_input_border_width" value="<?php 
        echo $row->lightbox_comment_input_border_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr id="lightbox_comment21">
                  <td class="spider_label"><label for="lightbox_comment_input_border_style">Comment input border style: </label></td>
                  <td>
                    <select name="lightbox_comment_input_border_style" id="lightbox_comment_input_border_style">
                      <?php 
        foreach ($border_styles as $key => $border_style) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->lightbox_comment_input_border_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $border_style;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr id="lightbox_comment20">
                  <td class="spider_label"><label for="lightbox_comment_input_border_color">Comment input border color: </label></td>
                  <td>
                    <input type="text" name="lightbox_comment_input_border_color" id="lightbox_comment_input_border_color" value="<?php 
        echo $row->lightbox_comment_input_border_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr id="lightbox_comment7">
                  <td class="spider_label"><label for="lightbox_comment_input_border_radius">Comment input border radius: </label></td>
                  <td>
                    <input type="text" name="lightbox_comment_input_border_radius" id="lightbox_comment_input_border_radius" value="<?php 
        echo $row->lightbox_comment_input_border_radius;
        ?>
" class="spider_char_input"/>
                  </td>
                </tr>
                <tr id="lightbox_comment8">
                  <td class="spider_label"><label for="lightbox_comment_input_padding">Comment input padding: </label></td>
                  <td>
                    <input type="text" name="lightbox_comment_input_padding" id="lightbox_comment_input_padding" value="<?php 
        echo $row->lightbox_comment_input_padding;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr id="lightbox_comment19">
                  <td class="spider_label"><label for="lightbox_comment_input_bg_color">Comment input background color: </label></td>
                  <td>
                    <input type="text" name="lightbox_comment_input_bg_color" id="lightbox_comment_input_bg_color" value="<?php 
        echo $row->lightbox_comment_input_bg_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr id="lightbox_comment16">
                  <td class="spider_label"><label for="lightbox_comment_button_bg_color">Comment button background color: </label></td>
                  <td>
                    <input type="text" name="lightbox_comment_button_bg_color" id="lightbox_comment_button_bg_color" value="<?php 
        echo $row->lightbox_comment_button_bg_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr id="lightbox_comment5">
                  <td class="spider_label"><label for="lightbox_comment_button_padding">Comment button padding: </label></td>
                  <td>
                    <input type="text" name="lightbox_comment_button_padding" id="lightbox_comment_button_padding" value="<?php 
        echo $row->lightbox_comment_button_padding;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr id="lightbox_comment3">
                  <td class="spider_label"><label for="lightbox_comment_button_border_width">Comment button border width: </label></td>
                  <td>
                    <input type="text" name="lightbox_comment_button_border_width" id="lightbox_comment_button_border_width" value="<?php 
        echo $row->lightbox_comment_button_border_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr id="lightbox_comment18">
                  <td class="spider_label"><label for="lightbox_comment_button_border_style">Comment button border style: </label></td>
                  <td>
                    <select name="lightbox_comment_button_border_style" id="lightbox_comment_button_border_style">
                      <?php 
        foreach ($border_styles as $key => $border_style) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->lightbox_comment_button_border_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $border_style;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr id="lightbox_comment17">
                  <td class="spider_label"><label for="lightbox_comment_button_border_color">Comment button border color: </label></td>
                  <td>
                    <input type="text" name="lightbox_comment_button_border_color" id="lightbox_comment_button_border_color" value="<?php 
        echo $row->lightbox_comment_button_border_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr id="lightbox_comment4">
                  <td class="spider_label"><label for="lightbox_comment_button_border_radius">Comment button border radius: </label></td>
                  <td>
                    <input type="text" name="lightbox_comment_button_border_radius" id="lightbox_comment_button_border_radius" value="<?php 
        echo $row->lightbox_comment_button_border_radius;
        ?>
" class="spider_char_input" />
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr id="lightbox_comment9">
                  <td class="spider_label"><label for="lightbox_comment_separator_width">Comment separator width: </label></td>
                  <td>
                    <input type="text" name="lightbox_comment_separator_width" id="lightbox_comment_separator_width" value="<?php 
        echo $row->lightbox_comment_separator_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr id="lightbox_comment22">
                  <td class="spider_label"><label for="lightbox_comment_separator_style">Comment separator style: </label></td>
                  <td>
                    <select name="lightbox_comment_separator_style" id="lightbox_comment_separator_style">
                      <?php 
        foreach ($border_styles as $key => $border_style) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->lightbox_comment_separator_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $border_style;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr id="lightbox_comment23">
                  <td class="spider_label"><label for="lightbox_comment_separator_color">Comment separator color: </label></td>
                  <td>
                    <input type="text" name="lightbox_comment_separator_color" id="lightbox_comment_separator_color" value="<?php 
        echo $row->lightbox_comment_separator_color;
        ?>
" class="color"/>
                  </td>
                </tr>
              </tbody>
            </table>
          </fieldset>
        </fieldset>

        <fieldset class="spider_type_fieldset" id="Navigation">
          <fieldset class="spider_child_fieldset" id="Navigation_1">
            <table style="clear:both;">
              <tbody>
                <tr>
                  <td class="spider_label"><label for="page_nav_font_size">Font size: </label></td>
                  <td>
                    <input type="text" name="page_nav_font_size" id="page_nav_font_size" value="<?php 
        echo $row->page_nav_font_size;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="page_nav_font_color">Font color: </label></td>
                  <td>
                    <input type="text" name="page_nav_font_color" id="page_nav_font_color" value="<?php 
        echo $row->page_nav_font_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="page_nav_font_style">Font family: </label></td>
                  <td>
                    <select name="page_nav_font_style" id="page_nav_font_style">
                      <?php 
        foreach ($font_families as $key => $font_family) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->page_nav_font_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $font_family;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="page_nav_font_weight">Font weight: </label></td>
                  <td>
                    <select name="page_nav_font_weight" id="page_nav_font_weight">
                      <?php 
        foreach ($font_weights as $key => $font_weight) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->page_nav_font_weight == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $font_weight;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="page_nav_border_width">Border width: </label></td>
                  <td>
                    <input type="text" name="page_nav_border_width" id="page_nav_border_width" value="<?php 
        echo $row->page_nav_border_width;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="page_nav_border_style">Border style: </label></td>
                  <td>
                    <select name="page_nav_border_style" id="page_nav_border_style">
                      <?php 
        foreach ($border_styles as $key => $border_style) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->page_nav_border_style == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $border_style;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="page_nav_border_color">Border color:</label></td>
                  <td>
                    <input type="text" name="page_nav_border_color" id="page_nav_border_color" value="<?php 
        echo $row->page_nav_border_color;
        ?>
" class="color"/>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="page_nav_border_radius">Border radius: </label></td>
                  <td>
                    <input type="text" name="page_nav_border_radius" id="page_nav_border_radius" value="<?php 
        echo $row->page_nav_border_radius;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
              </tbody>
            </table>
          </fieldset>
          <fieldset class="spider_child_fieldset" id="Navigation_2" style="display:block">
            <table style="clear:both;">
              <tbody>
                <tr>
                  <td class="spider_label"><label for="page_nav_margin">Margin: </label></td>
                  <td>
                    <input type="text" name="page_nav_margin" id="page_nav_margin" value="<?php 
        echo $row->page_nav_margin;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="page_nav_padding">Padding: </label></td>
                  <td>
                    <input type="text" name="page_nav_padding" id="page_nav_padding" value="<?php 
        echo $row->page_nav_padding;
        ?>
" class="spider_char_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="page_nav_button_bg_color">Button background color: </label></td>
                  <td>
                    <input type="text" name="page_nav_button_bg_color" id="page_nav_button_bg_color" value="<?php 
        echo $row->page_nav_button_bg_color;
        ?>
" class="color" />
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="page_nav_button_bg_transparent">Button background transparency: </label></td>
                  <td>
                    <input type="text" name="page_nav_button_bg_transparent" id="page_nav_button_bg_transparent" value="<?php 
        echo $row->page_nav_button_bg_transparent;
        ?>
" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
                    <div class="spider_description">Value must be between 0 to 100.</div>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label>Button transition: </label></td>
                  <td>
                    <input type="radio" name="page_nav_button_transition" id="page_nav_button_transition1" value="1"<?php 
        if ($row->page_nav_button_transition == 1) {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="page_nav_button_transition1" id="page_nav_button_transition1_lbl">Yes</label>
                    <input type="radio" name="page_nav_button_transition" id="page_nav_button_transition0" value="0"<?php 
        if ($row->page_nav_button_transition == 0) {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="page_nav_button_transition0" id="page_nav_button_transition0_lbl">No</label>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="page_nav_box_shadow">Box shadow: </label></td>
                  <td>
                    <input type="text" name="page_nav_box_shadow" id="page_nav_box_shadow" value="<?php 
        echo $row->page_nav_box_shadow;
        ?>
" class="spider_box_input"/>
                    <div class="spider_description">Use CSS type values.</div>
                  </td>
                </tr>
              </tbody>
            </table>
          </fieldset>
          <fieldset class="spider_child_fieldset" id="Navigation_3">
            <table style="clear:both;">
              <tbody>
                <tr>
                  <td class="spider_label"><label>Position: </label></td>
                  <td id="page_nav_position">
                    <input type="radio" name="page_nav_position" id="page_nav_position1" value="top"<?php 
        if ($row->page_nav_position == "top") {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="page_nav_position1" id="page_nav_position1_lbl">Top</label>
                    <input type="radio" name="page_nav_position" id="page_nav_position0" value="bottom"<?php 
        if ($row->page_nav_position == "bottom") {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="page_nav_position0" id="page_nav_position0_lbl">Bottom</label>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label for="page_nav_align0">Alignment: </label></td>
                  <td>
                    <select name="page_nav_align" id="page_nav_align">
                      <?php 
        foreach ($aligns as $key => $align) {
            ?>
                        <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $row->page_nav_align == $key ? 'selected="selected"' : '';
            ?>
><?php 
            echo $align;
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label>Numbering: </label></td>
                  <td>
                    <input type="radio" name="page_nav_number" id="page_nav_number1" value="1"<?php 
        if ($row->page_nav_number == 1) {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="page_nav_number1" id="page_nav_number1_lbl">Yes</label>
                    <input type="radio" name="page_nav_number" id="page_nav_number0" value="0"<?php 
        if ($row->page_nav_number == 0) {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="page_nav_number0" id="page_nav_number0_lbl">No</label>
                  </td>
                </tr>
                <tr>
                  <td class="spider_label"><label>Button text: </label></td>
                  <td>
                    <input type="radio" name="page_nav_button_text" id="page_nav_button_text1" value="1"<?php 
        if ($row->page_nav_button_text == 1) {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="page_nav_button_text1" id="page_nav_button_text1_lbl">Text</label>
                    <input type="radio" name="page_nav_button_text" id="page_nav_button_text0" value="0"<?php 
        if ($row->page_nav_button_text == 0) {
            echo 'checked="checked"';
        }
        ?>
 />
                    <label for="page_nav_button_text0" id="page_nav_button_text0_lbl">Arrow</label>
                    <div class="spider_description">Next, previous buttons values.</div>
                  </td>
                </tr>
              </tbody>
            </table>
          </fieldset>
        </fieldset>
      </fieldset>
      <input type="hidden" id="task" name="task" value=""/>
      <input type="hidden" id="current_id" name="current_id" value="<?php 
        echo $row->id;
        ?>
"/>
      <input type="hidden" id="default_theme" name="default_theme" value="<?php 
        echo $row->default_theme;
        ?>
"/>
      <script>
        window.onload = bwg_change_theme_type('<?php 
        echo $current_type;
        ?>
');
      </script>
    </form>
    <?php 
    }
    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');
            }
            $page_nav = $this->model->gallery_page_nav($album_gallery_id, $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_per_page_arr = array('images_per_page' => $params['extended_albums_per_page'], 'load_more_image_count' => $params['extended_albums_per_page']);
            $items_col_num = 1;
            $album_galleries_row = $this->model->get_alb_gals_row($album_gallery_id, $items_per_page, 'order', $bwg, ' asc ');
            if (!$album_galleries_row) {
                echo WDWLibrary::message(__('There is no album selected or the album was deleted.', 'bwg'), 'error');
                return;
            }
            $page_nav = $this->model->album_page_nav($album_gallery_id, $bwg);
            $album_gallery_div_id = 'bwg_album_extended_' . $bwg;
            $album_gallery_div_class = 'bwg_album_extended_thumbnails_' . $bwg;
        }
        if ($type == 'gallery') {
            if ($album_view_type == 'masonry') {
                $form_child_div_id = 'bwg_masonry_thumbnails_div_' . $bwg;
                $form_child_div_style = 'background-color:rgba(0, 0, 0, 0); position:relative; text-align:' . $theme_row->masonry_thumb_align . '; width:100%;';
                $album_gallery_div_id = 'bwg_masonry_thumbnails_' . $bwg;
                $album_gallery_div_class = 'bwg_masonry_thumbnails_' . $bwg;
            } else {
                $form_child_div_style = 'background-color:rgba(0, 0, 0, 0); position:relative; text-align:' . $theme_row->thumb_align . '; width:100%;';
                $form_child_div_id = '';
            }
        } else {
            $form_child_div_id = '';
            $form_child_div_style = 'background-color:rgba(0, 0, 0, 0); position:relative; text-align:' . $theme_row->album_extended_thumb_align . '; width:100%;';
        }
        $bwg_previous_album_id = isset($_REQUEST['bwg_previous_album_id_' . $bwg]) ? esc_html($_REQUEST['bwg_previous_album_id_' . $bwg]) : $params['album_id'];
        $bwg_previous_album_page_number = isset($_REQUEST['bwg_previous_album_page_number_' . $bwg]) ? esc_html($_REQUEST['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);
        $params_array = array('action' => 'GalleryBox', 'current_view' => $bwg, 'theme_id' => $params['theme_id'], 'thumb_width' => $params['extended_album_image_thumb_width'], 'thumb_height' => $params['extended_album_image_thumb_height'], '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' => $params['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);
        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'];
        }
        if ($params['watermark_type'] == 'text') {
            $params_array['watermark_text'] = $params['watermark_text'];
            $params_array['watermark_font_size'] = $params['watermark_font_size'];
            $params_array['watermark_font'] = $params['watermark_font'];
            $params_array['watermark_color'] = $params['watermark_color'];
        } elseif ($params['watermark_type'] == 'image') {
            $params_array['watermark_url'] = urlencode($params['watermark_url']);
            $params_array['watermark_width'] = $params['watermark_width'];
            $params_array['watermark_height'] = $params['watermark_height'];
        }
        $tags_rows = $this->model->get_tags_rows_data($album_gallery_id);
        ?>
    <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 number_format($theme_row->album_extended_thumb_bg_transparent / 100, 2, ".", "");
        ?>
);
        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_div_<?php 
        echo $bwg;
        ?>
 {
        display: table;
        width: 100%;
        height: <?php 
        echo $params['extended_album_height'];
        ?>
px;
        border-spacing: <?php 
        echo $theme_row->album_extended_div_padding;
        ?>
px;
        border-bottom: <?php 
        echo $theme_row->album_extended_div_separator_width;
        ?>
px <?php 
        echo $theme_row->album_extended_div_separator_style;
        ?>
 #<?php 
        echo $theme_row->album_extended_div_separator_color;
        ?>
;
        background-color: rgba(<?php 
        echo $rgb_album_extended_div_bg_color['red'];
        ?>
, <?php 
        echo $rgb_album_extended_div_bg_color['green'];
        ?>
, <?php 
        echo $rgb_album_extended_div_bg_color['blue'];
        ?>
, <?php 
        echo number_format($theme_row->album_extended_div_bg_transparent / 100, 2, ".", "");
        ?>
);
        border-radius: <?php 
        echo $theme_row->album_extended_div_border_radius;
        ?>
;
        margin: <?php 
        echo $theme_row->album_extended_div_margin;
        ?>
;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_album_extended_thumb_div_<?php 
        echo $bwg;
        ?>
 {
        background-color: #<?php 
        echo $theme_row->album_extended_thumb_div_bg_color;
        ?>
;
        border-radius: <?php 
        echo $theme_row->album_extended_thumb_div_border_radius;
        ?>
;
        text-align: center;
        border: <?php 
        echo $theme_row->album_extended_thumb_div_border_width;
        ?>
px <?php 
        echo $theme_row->album_extended_thumb_div_border_style;
        ?>
 #<?php 
        echo $theme_row->album_extended_thumb_div_border_color;
        ?>
;
        display: table-cell;
        vertical-align: middle;
        padding: <?php 
        echo $theme_row->album_extended_thumb_div_padding;
        ?>
;
      }
      @media only screen and (max-width : 320px) {
        #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_album_extended_thumb_div_<?php 
        echo $bwg;
        ?>
 {
          display: table-row;
        }
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_album_extended_text_div_<?php 
        echo $bwg;
        ?>
 {
        background-color: #<?php 
        echo $theme_row->album_extended_text_div_bg_color;
        ?>
;
        border-radius: <?php 
        echo $theme_row->album_extended_text_div_border_radius;
        ?>
;
        border: <?php 
        echo $theme_row->album_extended_text_div_border_width;
        ?>
px <?php 
        echo $theme_row->album_extended_text_div_border_style;
        ?>
 #<?php 
        echo $theme_row->album_extended_text_div_border_color;
        ?>
;
        display: table-cell;
        width: 100%;
        border-collapse: collapse;
        vertical-align: middle;
        padding: <?php 
        echo $theme_row->album_extended_text_div_padding;
        ?>
;
      }
      @media only screen and (max-width : 320px) {
        #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_album_extended_text_div_<?php 
        echo $bwg;
        ?>
 {
          display: table-row;
        }
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_title_spun_<?php 
        echo $bwg;
        ?>
 {
        border: <?php 
        echo $theme_row->album_extended_title_span_border_width;
        ?>
px <?php 
        echo $theme_row->album_extended_title_span_border_style;
        ?>
 #<?php 
        echo $theme_row->album_extended_title_span_border_color;
        ?>
;
        color: #<?php 
        echo $theme_row->album_extended_title_font_color;
        ?>
;
        display: block;
        font-family: <?php 
        echo $theme_row->album_extended_title_font_style;
        ?>
;
        font-size: <?php 
        echo $theme_row->album_extended_title_font_size;
        ?>
px;
        font-weight: <?php 
        echo $theme_row->album_extended_title_font_weight;
        ?>
;
        height: inherit;
        margin-bottom: <?php 
        echo $theme_row->album_extended_title_margin_bottom;
        ?>
px;
        padding: <?php 
        echo $theme_row->album_extended_title_padding;
        ?>
;
        text-align: left;
        vertical-align: middle;
        width: inherit;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_description_spun1_<?php 
        echo $bwg;
        ?>
 a {
        color: #<?php 
        echo $theme_row->album_extended_desc_font_color;
        ?>
;
        font-size: <?php 
        echo $theme_row->album_extended_desc_font_size;
        ?>
px;
        font-weight: <?php 
        echo $theme_row->album_extended_desc_font_weight;
        ?>
;
        font-family: <?php 
        echo $theme_row->album_extended_desc_font_style;
        ?>
;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_description_spun1_<?php 
        echo $bwg;
        ?>
 {
        border: <?php 
        echo $theme_row->album_extended_desc_span_border_width;
        ?>
px <?php 
        echo $theme_row->album_extended_desc_span_border_style;
        ?>
 #<?php 
        echo $theme_row->album_extended_desc_span_border_color;
        ?>
;
        display: inline-block;
        color: #<?php 
        echo $theme_row->album_extended_desc_font_color;
        ?>
;
        font-size: <?php 
        echo $theme_row->album_extended_desc_font_size;
        ?>
px;
        font-weight: <?php 
        echo $theme_row->album_extended_desc_font_weight;
        ?>
;
        font-family: <?php 
        echo $theme_row->album_extended_desc_font_style;
        ?>
;
        height: inherit;
        padding: <?php 
        echo $theme_row->album_extended_desc_padding;
        ?>
;
        vertical-align: middle;
        width: inherit;
        word-wrap: break-word;
        word-break: break-word;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_description_spun1_<?php 
        echo $bwg;
        ?>
 * {
        margin: 0;
        text-align: left !important;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_description_spun2_<?php 
        echo $bwg;
        ?>
 {
        float: left;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_description_short_<?php 
        echo $bwg;
        ?>
 {
        display: inline;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_description_full_<?php 
        echo $bwg;
        ?>
 {
        display: none;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_description_more_<?php 
        echo $bwg;
        ?>
 {
        clear: both;
        color: #<?php 
        echo $theme_row->album_extended_desc_more_color;
        ?>
;
        cursor: pointer;
        float: right;
        font-size: <?php 
        echo $theme_row->album_extended_desc_more_size;
        ?>
px;
        font-weight: normal;
      }
      /*Album thumbs styles.*/
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_album_thumb_<?php 
        echo $bwg;
        ?>
 {
        display: inline-block;
        text-align: center;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_album_thumb_spun1_<?php 
        echo $bwg;
        ?>
 {
        background-color: #<?php 
        echo $theme_row->album_extended_thumb_bg_color;
        ?>
;
        border-radius: <?php 
        echo $theme_row->album_extended_thumb_border_radius;
        ?>
;
        border: <?php 
        echo $theme_row->album_extended_thumb_border_width;
        ?>
px <?php 
        echo $theme_row->album_extended_thumb_border_style;
        ?>
 #<?php 
        echo $theme_row->album_extended_thumb_border_color;
        ?>
;
        box-shadow: <?php 
        echo $theme_row->album_extended_thumb_box_shadow;
        ?>
;
        display: inline-block;
        height: <?php 
        echo $params['extended_album_thumb_height'];
        ?>
px;
        margin: <?php 
        echo $theme_row->album_extended_thumb_margin;
        ?>
px;
        opacity: <?php 
        echo number_format($theme_row->album_extended_thumb_transparent / 100, 2, ".", "");
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $theme_row->album_extended_thumb_transparent;
        ?>
);
        <?php 
        echo $theme_row->album_extended_thumb_transition ? 'transition: all 0.3s ease 0s;-webkit-transition: all 0.3s ease 0s;' : '';
        ?>
        padding: <?php 
        echo $theme_row->album_extended_thumb_padding;
        ?>
px;
        text-align: center;
        vertical-align: middle;
        width: <?php 
        echo $params['extended_album_thumb_width'];
        ?>
px;
        z-index: 100;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_album_thumb_spun1_<?php 
        echo $bwg;
        ?>
:hover {
        opacity: 1;
        filter: Alpha(opacity=100);
        transform: <?php 
        echo $theme_row->album_extended_thumb_hover_effect;
        ?>
(<?php 
        echo $theme_row->album_extended_thumb_hover_effect_value;
        ?>
);
        -ms-transform: <?php 
        echo $theme_row->album_extended_thumb_hover_effect;
        ?>
(<?php 
        echo $theme_row->album_extended_thumb_hover_effect_value;
        ?>
);
        -webkit-transform: <?php 
        echo $theme_row->album_extended_thumb_hover_effect;
        ?>
(<?php 
        echo $theme_row->album_extended_thumb_hover_effect_value;
        ?>
);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        -moz-backface-visibility: hidden;
        -ms-backface-visibility: hidden;
        z-index: 102;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_album_thumb_spun2_<?php 
        echo $bwg;
        ?>
 {
        display: inline-block;
        height: <?php 
        echo $params['extended_album_thumb_height'];
        ?>
px;
        overflow: hidden;
        width: <?php 
        echo $params['extended_album_thumb_width'];
        ?>
px;
      }
      /*Image thumbs styles.*/
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_standart_thumb_spun1_<?php 
        echo $bwg;
        ?>
 {
        background-color: #<?php 
        echo $theme_row->thumb_bg_color;
        ?>
;
        border-radius: <?php 
        echo $theme_row->thumb_border_radius;
        ?>
;
        border: <?php 
        echo $theme_row->thumb_border_width;
        ?>
px <?php 
        echo $theme_row->thumb_border_style;
        ?>
 #<?php 
        echo $theme_row->thumb_border_color;
        ?>
;
        box-shadow: <?php 
        echo $theme_row->thumb_box_shadow;
        ?>
;
        display: inline-block;
        height: <?php 
        echo $params['extended_album_image_thumb_height'];
        ?>
px;
        margin: <?php 
        echo $theme_row->thumb_margin;
        ?>
px;
        opacity: <?php 
        echo number_format($theme_row->thumb_transparent / 100, 2, ".", "");
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $theme_row->thumb_transparent;
        ?>
);
        <?php 
        echo $theme_row->thumb_transition ? 'transition: all 0.3s ease 0s;-webkit-transition: all 0.3s ease 0s;' : '';
        ?>
        padding: <?php 
        echo $theme_row->thumb_padding;
        ?>
px;
        text-align: center;
        vertical-align: middle;
        width: <?php 
        echo $params['extended_album_image_thumb_width'];
        ?>
px;
        z-index: 100;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_standart_thumb_spun1_<?php 
        echo $bwg;
        ?>
:hover {
        -ms-transform: <?php 
        echo $theme_row->thumb_hover_effect;
        ?>
(<?php 
        echo $theme_row->thumb_hover_effect_value;
        ?>
);
        -webkit-transform: <?php 
        echo $theme_row->thumb_hover_effect;
        ?>
(<?php 
        echo $theme_row->thumb_hover_effect_value;
        ?>
);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        -moz-backface-visibility: hidden;
        -ms-backface-visibility: hidden;
        opacity: 1;
        filter: Alpha(opacity=100);
        transform: <?php 
        echo $theme_row->thumb_hover_effect;
        ?>
(<?php 
        echo $theme_row->thumb_hover_effect_value;
        ?>
);
        z-index: 102;
        position: relative;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_standart_thumb_spun2_<?php 
        echo $bwg;
        ?>
 {
        display: inline-block;
        height: <?php 
        echo $params['extended_album_image_thumb_height'];
        ?>
px;
        overflow: hidden;
        width: <?php 
        echo $params['extended_album_image_thumb_width'];
        ?>
px;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_standart_thumbnails_<?php 
        echo $bwg;
        ?>
 {
        -moz-box-sizing: border-box;
        display: inline-block;
        background-color: rgba(<?php 
        echo $rgb_thumbs_bg_color['red'];
        ?>
, <?php 
        echo $rgb_thumbs_bg_color['green'];
        ?>
, <?php 
        echo $rgb_thumbs_bg_color['blue'];
        ?>
, <?php 
        echo number_format($theme_row->thumb_bg_transparent / 100, 2, ".", "");
        ?>
);
        box-sizing: border-box;
        font-size: 0;
        max-width: <?php 
        echo $params['extended_album_image_column_number'] * ($params['extended_album_image_thumb_width'] + 2 * (2 + $theme_row->thumb_margin + $theme_row->thumb_padding + $theme_row->thumb_border_width));
        ?>
px;
        text-align: <?php 
        echo $theme_row->thumb_align;
        ?>
;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_standart_thumb_<?php 
        echo $bwg;
        ?>
 {
        display: inline-block;
        text-align: center;
      }
      <?php 
        if ($params['extended_album_image_title'] == 'show') {
            /* Show image title at the bottom.*/
            ?>
        #bwg_container1_<?php 
            echo $bwg;
            ?>
 #bwg_container2_<?php 
            echo $bwg;
            ?>
 .bwg_image_title_spun1_<?php 
            echo $bwg;
            ?>
 {
          display: block;
          margin: 0 auto;
          opacity: 1;
          filter: Alpha(opacity=100);
          text-align: center;
          width: <?php 
            echo $params['extended_album_image_thumb_width'];
            ?>
px;
        }
        <?php 
        } elseif ($params['extended_album_image_title'] == 'hover') {
            /* Show image title on hover.*/
            ?>
        #bwg_container1_<?php 
            echo $bwg;
            ?>
 #bwg_container2_<?php 
            echo $bwg;
            ?>
 .bwg_image_title_spun1_<?php 
            echo $bwg;
            ?>
 {
          display: table;
          height: inherit;
          left: -3000px;
          opacity: 0;
          filter: Alpha(opacity=0);
          position: absolute;
          top: 0px;
          width: inherit;
        }
        <?php 
        }
        ?>
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_standart_thumb_spun1_<?php 
        echo $bwg;
        ?>
:hover .bwg_image_title_spun1_<?php 
        echo $bwg;
        ?>
 {
        left: <?php 
        echo $theme_row->thumb_padding;
        ?>
px;
        top: <?php 
        echo $theme_row->thumb_padding;
        ?>
px;
        opacity: 1;
        filter: Alpha(opacity=100);
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_image_title_spun2_<?php 
        echo $bwg;
        ?>
 {
        color: #<?php 
        echo $theme_row->thumb_title_font_color;
        ?>
;
        display: table-cell;
        font-family: <?php 
        echo $theme_row->thumb_title_font_style;
        ?>
;
        font-size: <?php 
        echo $theme_row->thumb_title_font_size;
        ?>
px;
        font-weight: <?php 
        echo $theme_row->thumb_title_font_weight;
        ?>
;
        height: inherit;
        margin: <?php 
        echo $theme_row->thumb_title_margin;
        ?>
;
        text-shadow: <?php 
        echo $theme_row->thumb_title_shadow;
        ?>
;
        vertical-align: middle;
        width: inherit;
        word-break: break-all;
        word-wrap: break-word;
      }
      /*Pagination styles.*/
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 {
        text-align: <?php 
        echo $theme_row->page_nav_align;
        ?>
;
        font-size: <?php 
        echo $theme_row->page_nav_font_size;
        ?>
px;
        font-family: <?php 
        echo $theme_row->page_nav_font_style;
        ?>
;
        font-weight: <?php 
        echo $theme_row->page_nav_font_weight;
        ?>
;
        color: #<?php 
        echo $theme_row->page_nav_font_color;
        ?>
;
        margin: 6px 0 4px;
        display: block;
        height: 30px;
        line-height: 30px;
      }
      @media only screen and (max-width : 320px) {
        #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .displaying-num_<?php 
        echo $bwg;
        ?>
 {
          display: none;
        }
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .displaying-num_<?php 
        echo $bwg;
        ?>
 {
        font-size: <?php 
        echo $theme_row->page_nav_font_size;
        ?>
px;
        font-family: <?php 
        echo $theme_row->page_nav_font_style;
        ?>
;
        font-weight: <?php 
        echo $theme_row->page_nav_font_weight;
        ?>
;
        color: #<?php 
        echo $theme_row->page_nav_font_color;
        ?>
;
        margin-right: 10px;
        vertical-align: middle;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .paging-input_<?php 
        echo $bwg;
        ?>
 {
        font-size: <?php 
        echo $theme_row->page_nav_font_size;
        ?>
px;
        font-family: <?php 
        echo $theme_row->page_nav_font_style;
        ?>
;
        font-weight: <?php 
        echo $theme_row->page_nav_font_weight;
        ?>
;
        color: #<?php 
        echo $theme_row->page_nav_font_color;
        ?>
;
        vertical-align: middle;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 a.disabled,
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 a.disabled:hover,
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 a.disabled:focus {
        cursor: default;
        color: rgba(<?php 
        echo $rgb_page_nav_font_color['red'];
        ?>
, <?php 
        echo $rgb_page_nav_font_color['green'];
        ?>
, <?php 
        echo $rgb_page_nav_font_color['blue'];
        ?>
, 0.5);
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 a {
        cursor: pointer;
        font-size: <?php 
        echo $theme_row->page_nav_font_size;
        ?>
px;
        font-family: <?php 
        echo $theme_row->page_nav_font_style;
        ?>
;
        font-weight: <?php 
        echo $theme_row->page_nav_font_weight;
        ?>
;
        color: #<?php 
        echo $theme_row->page_nav_font_color;
        ?>
;
        text-decoration: none;
        padding: <?php 
        echo $theme_row->page_nav_padding;
        ?>
;
        margin: <?php 
        echo $theme_row->page_nav_margin;
        ?>
;
        border-radius: <?php 
        echo $theme_row->page_nav_border_radius;
        ?>
;
        border-style: <?php 
        echo $theme_row->page_nav_border_style;
        ?>
;
        border-width: <?php 
        echo $theme_row->page_nav_border_width;
        ?>
px;
        border-color: #<?php 
        echo $theme_row->page_nav_border_color;
        ?>
;
        background-color: #<?php 
        echo $theme_row->page_nav_button_bg_color;
        ?>
;
        opacity: <?php 
        echo number_format($theme_row->page_nav_button_bg_transparent / 100, 2, ".", "");
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $theme_row->page_nav_button_bg_transparent;
        ?>
);
        box-shadow: <?php 
        echo $theme_row->page_nav_box_shadow;
        ?>
;
        <?php 
        echo $theme_row->page_nav_button_transition ? 'transition: all 0.3s ease 0s;-webkit-transition: all 0.3s ease 0s;' : '';
        ?>
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_back_<?php 
        echo $bwg;
        ?>
 {
        background-color: rgba(0, 0, 0, 0);
        color: #<?php 
        echo $theme_row->album_extended_back_font_color;
        ?>
 !important;
        cursor: pointer;
        display: block;
        font-family: <?php 
        echo $theme_row->album_extended_back_font_style;
        ?>
;
        font-size: <?php 
        echo $theme_row->album_extended_back_font_size;
        ?>
px;
        font-weight: <?php 
        echo $theme_row->album_extended_back_font_weight;
        ?>
;
        text-decoration: none;
        padding: <?php 
        echo $theme_row->album_extended_back_padding;
        ?>
;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 #spider_popup_overlay_<?php 
        echo $bwg;
        ?>
 {
        background-color: #<?php 
        echo $theme_row->lightbox_overlay_bg_color;
        ?>
;
        opacity: <?php 
        echo number_format($theme_row->lightbox_overlay_bg_transparent / 100, 2, ".", "");
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $theme_row->lightbox_overlay_bg_transparent;
        ?>
);
      }
      .bwg_play_icon_spun_<?php 
        echo $bwg;
        ?>
	 {
        width: inherit;
        height: inherit;
        display: table;
        position: absolute;
      }	 
     .bwg_play_icon_<?php 
        echo $bwg;
        ?>
 {
        color: #<?php 
        echo $theme_row->thumb_title_font_color;
        ?>
;
        font-size: <?php 
        echo 2 * $theme_row->thumb_title_font_size;
        ?>
px;
        vertical-align: middle;
        display: table-cell !important;
        z-index: 1;
        text-align: center;
        margin: 0 auto;
      }
    </style>
    <div id="bwg_container1_<?php 
        echo $bwg;
        ?>
">
      <div id="bwg_container2_<?php 
        echo $bwg;
        ?>
">
        <form id="gal_front_form_<?php 
        echo $bwg;
        ?>
" method="post" action="#">
          <?php 
        if ($params['show_search_box'] && $type == 'gallery') {
            WDWLibrary::ajax_html_frontend_search_box('gal_front_form_' . $bwg, $bwg, $album_gallery_div_id, $images_count, $params['search_box_width']);
        }
        if (isset($params['show_sort_images']) && $params['show_sort_images'] && $type == 'gallery') {
            WDWLibrary::ajax_html_frontend_sort_box('gal_front_form_' . $bwg, $bwg, $album_gallery_div_id, $params['sort_by'], $params['search_box_width']);
        }
        if (isset($params['show_tag_box']) && $params['show_tag_box'] && $type == 'gallery') {
            WDWLibrary::ajax_html_frontend_search_tags('gal_front_form_' . $bwg, $bwg, $album_gallery_div_id, $images_count, $tags_rows);
        }
        ?>
          <div id="<?php 
        echo $form_child_div_id;
        ?>
" style="<?php 
        echo $form_child_div_style;
        ?>
">
            <div id="ajax_loading_<?php 
        echo $bwg;
        ?>
" style="position:absolute;width: 100%; z-index: 115; text-align: center; height: 100%; vertical-align: middle; display: none;">
              <div style="display: table; vertical-align: middle; width: 100%; height: 100%; background-color:#FFFFFF; opacity:0.7; filter:Alpha(opacity=70);">
                <div style="display: table-cell; text-align: center; position: relative; vertical-align: middle;" >
                  <div id="loading_div_<?php 
        echo $bwg;
        ?>
" class="spider_ajax_loading" style="display: inline-block; text-align:center; position:relative; vertical-align:middle; background-image:url(<?php 
        echo WD_BWG_URL . '/images/ajax_loader.png';
        ?>
); float: none; width:50px;height:50px;background-size:50px 50px;">
                  </div>
                </div>
              </div>
            </div>
            <?php 
        if ($params['extended_album_enable_page'] && $items_per_page && $theme_row->page_nav_position == 'top' && $page_nav['total']) {
            WDWLibrary::ajax_html_frontend_page_nav($theme_row, $page_nav['total'], $page_nav['limit'], 'gal_front_form_' . $bwg, $items_per_page_arr, $bwg, $album_gallery_div_id, $params['album_id'], $type, $options_row->enable_seo, $params['extended_album_enable_page']);
        }
        if ($bwg_previous_album_id != $params['album_id']) {
            ?>
              <a class="bwg_back_<?php 
            echo $bwg;
            ?>
" onclick="spider_frontend_ajax('gal_front_form_<?php 
            echo $bwg;
            ?>
', '<?php 
            echo $bwg;
            ?>
', '<?php 
            echo $album_gallery_div_id;
            ?>
', 'back', '', 'album')"><?php 
            echo __('Back', 'bwg');
            ?>
</a>
              <?php 
        }
        ?>
            <div id="<?php 
        echo $album_gallery_div_id;
        ?>
" class="<?php 
        echo $album_gallery_div_class;
        ?>
">
              <input type="hidden" id="bwg_previous_album_id_<?php 
        echo $bwg;
        ?>
" name="bwg_previous_album_id_<?php 
        echo $bwg;
        ?>
" value="<?php 
        echo $bwg_previous_album_id;
        ?>
" />
              <input type="hidden" id="bwg_previous_album_page_number_<?php 
        echo $bwg;
        ?>
" name="bwg_previous_album_page_number_<?php 
        echo $bwg;
        ?>
" value="<?php 
        echo $bwg_previous_album_page_number;
        ?>
" />
              <?php 
        if ($type != 'gallery') {
            if (!$page_nav['total']) {
                ?>
                  <span class="bwg_back_<?php 
                echo $bwg;
                ?>
"><?php 
                echo __('Album is empty.', 'bwg');
                ?>
</span>
                  <?php 
            }
            foreach ($album_galleries_row as $album_galallery_row) {
                if ($album_galallery_row->is_album) {
                    $album_row = $this->model->get_album_row_data($album_galallery_row->alb_gal_id);
                    if (!$album_row) {
                        continue;
                    }
                    $preview_image = $album_row->preview_image;
                    if (!$preview_image) {
                        $preview_image = $album_row->random_preview_image;
                    }
                    $def_type = 'album';
                    $title = $album_row->name;
                    $description = wpautop($album_row->description);
                } else {
                    $gallery_row = $this->model->get_gallery_row_data($album_galallery_row->alb_gal_id);
                    if (!$gallery_row) {
                        continue;
                    }
                    $preview_image = $gallery_row->preview_image;
                    if (!$preview_image) {
                        $preview_image = $gallery_row->random_preview_image;
                    }
                    $def_type = 'gallery';
                    $title = $gallery_row->name;
                    $description = wpautop($gallery_row->description);
                }
                $local_preview_image = true;
                $parsed_prev_url = parse_url($preview_image, PHP_URL_SCHEME);
                if ($parsed_prev_url == 'http' || $parsed_prev_url == 'https') {
                    $local_preview_image = false;
                }
                if (!$preview_image) {
                    $preview_url = WD_BWG_URL . '/images/no-image.png';
                    $preview_path = WD_BWG_DIR . '/images/no-image.png';
                } else {
                    if ($local_preview_image) {
                        $preview_url = site_url() . '/' . $WD_BWG_UPLOAD_DIR . $preview_image;
                        $preview_path = ABSPATH . $WD_BWG_UPLOAD_DIR . $preview_image;
                    } else {
                        $preview_url = $preview_image;
                        $preview_path = $preview_image;
                    }
                }
                if ($local_preview_image) {
                    list($image_thumb_width, $image_thumb_height) = getimagesize(htmlspecialchars_decode($preview_path, ENT_COMPAT | ENT_QUOTES));
                    $scale = max($params['extended_album_thumb_width'] / $image_thumb_width, $params['extended_album_thumb_height'] / $image_thumb_height);
                    $image_thumb_width *= $scale;
                    $image_thumb_height *= $scale;
                    $thumb_left = ($params['extended_album_thumb_width'] - $image_thumb_width) / 2;
                    $thumb_top = ($params['extended_album_thumb_height'] - $image_thumb_height) / 2;
                } else {
                    $image_thumb_width = $params['extended_album_thumb_width'];
                    $image_thumb_height = $params['extended_album_thumb_height'];
                    $thumb_left = 0;
                    $thumb_top = 0;
                }
                if ($type != 'gallery') {
                    ?>
                    <div class="bwg_album_extended_div_<?php 
                    echo $bwg;
                    ?>
">
                      <div class="bwg_album_extended_thumb_div_<?php 
                    echo $bwg;
                    ?>
">
                        <a class="bwg_album_<?php 
                    echo $bwg;
                    ?>
" <?php 
                    echo $options_row->enable_seo ? 'href="' . add_query_arg(array("type_" . $bwg => $def_type, "album_gallery_id_" . $bwg => $album_galallery_row->alb_gal_id, "bwg_previous_album_id_" . $bwg => $album_gallery_id . ',' . $bwg_previous_album_id, "bwg_previous_album_page_number_" . $bwg => (isset($_REQUEST['page_number_' . $bwg]) ? esc_html($_REQUEST['page_number_' . $bwg]) : 0) . ',' . $bwg_previous_album_page_number), $_SERVER['REQUEST_URI']) . '"' : '';
                    ?>
 style="font-size: 0;" data-alb_gal_id="<?php 
                    echo $album_galallery_row->alb_gal_id;
                    ?>
" data-def_type="<?php 
                    echo $def_type;
                    ?>
" data-title="<?php 
                    htmlspecialchars(addslashes($title));
                    ?>
">
                          <span class="bwg_album_thumb_<?php 
                    echo $bwg;
                    ?>
" style="height:inherit;">
                            <span class="bwg_album_thumb_spun1_<?php 
                    echo $bwg;
                    ?>
">
                              <span class="bwg_album_thumb_spun2_<?php 
                    echo $bwg;
                    ?>
">
                                <img style="padding: 0; max-height:none; max-width:none; width:<?php 
                    echo $image_thumb_width;
                    ?>
px; height:<?php 
                    echo $image_thumb_height;
                    ?>
px; margin-left: <?php 
                    echo $thumb_left;
                    ?>
px; margin-top: <?php 
                    echo $thumb_top;
                    ?>
px;" src="<?php 
                    echo $preview_url;
                    ?>
" alt="<?php 
                    echo $title;
                    ?>
" />
                              </span>
                            </span>
                          </span>
                        </a>
                      </div>
                      <div class="bwg_album_extended_text_div_<?php 
                    echo $bwg;
                    ?>
">
                        <?php 
                    if ($title) {
                        ?>
                          <span class="bwg_title_spun_<?php 
                        echo $bwg;
                        ?>
"><?php 
                        echo $title;
                        ?>
</span>
                          <?php 
                    }
                    if ($params['extended_album_description_enable'] && $description) {
                        if (stripos($description, '<!--more-->') !== FALSE) {
                            $description_array = explode('<!--more-->', $description);
                            $description_short = $description_array[0];
                            $description_full = $description_array[1];
                            ?>
                            <span class="bwg_description_spun1_<?php 
                            echo $bwg;
                            ?>
">
                              <span class="bwg_description_spun2_<?php 
                            echo $bwg;
                            ?>
">
                                <span class="bwg_description_short_<?php 
                            echo $bwg;
                            ?>
">
                                  <?php 
                            echo $description_short;
                            ?>
                                </span>
                                <span class="bwg_description_full_<?php 
                            echo $bwg;
                            ?>
">
                                  <?php 
                            echo $description_full;
                            ?>
                                </span>
                              </span>
                              <span class="bwg_description_more_<?php 
                            echo $bwg;
                            ?>
 bwg_more"><?php 
                            echo __('More', 'bwg');
                            ?>
</span>
                            </span>
                            <?php 
                        } else {
                            ?>
                            <span class="bwg_description_spun1_<?php 
                            echo $bwg;
                            ?>
">
                              <span class="bwg_description_short_<?php 
                            echo $bwg;
                            ?>
">
                                <?php 
                            echo $description;
                            ?>
                              </span>
                            </span>
                            <?php 
                        }
                    }
                    ?>
                      </div>
                    </div>
                    <?php 
                }
            }
        } elseif ($type == 'gallery') {
            if ($options_row->show_album_name) {
                ?>
                  <div class="bwg_back_<?php 
                echo $bwg;
                ?>
" ><?php 
                echo isset($_POST['title_' . $bwg]) ? esc_html($_POST['title_' . $bwg]) : '';
                ?>
</div>
                  <?php 
            }
            if (!$page_nav['total']) {
                if ($bwg_search != '') {
                    ?>
                    <span class="bwg_back_<?php 
                    echo $bwg;
                    ?>
"><?php 
                    echo __('There are no images matching your search.', 'bwg');
                    ?>
</span>
                    <?php 
                } else {
                    ?>
                    <span class="bwg_back_<?php 
                    echo $bwg;
                    ?>
"><?php 
                    echo __('Gallery is empty.', 'bwg');
                    ?>
</span>
                    <?php 
                }
            }
            foreach ($image_rows as $image_row) {
                $is_embed = preg_match('/EMBED/', $image_row->filetype) == 1 ? true : false;
                $is_embed_video = preg_match('/VIDEO/', $image_row->filetype) == 1 ? true : false;
                if (!$is_embed) {
                    list($image_thumb_width, $image_thumb_height) = getimagesize(htmlspecialchars_decode(ABSPATH . $WD_BWG_UPLOAD_DIR . $image_row->thumb_url, ENT_COMPAT | ENT_QUOTES));
                } else {
                    if ($image_row->resolution != '') {
                        $resolution_arr = explode(" ", $image_row->resolution);
                        $resolution_w = intval($resolution_arr[0]);
                        $resolution_h = intval($resolution_arr[2]);
                        if ($resolution_w != 0 && $resolution_h != 0) {
                            $scale = $scale = max($params['extended_album_image_thumb_width'] / $resolution_w, $params['extended_album_image_thumb_height'] / $resolution_h);
                            $image_thumb_width = $resolution_w * $scale;
                            $image_thumb_height = $resolution_h * $scale;
                        } else {
                            $image_thumb_width = $params['extended_album_image_thumb_width'];
                            $image_thumb_height = $params['extended_album_image_thumb_height'];
                        }
                    } else {
                        $image_thumb_width = $params['extended_album_image_thumb_width'];
                        $image_thumb_height = $params['extended_album_image_thumb_height'];
                    }
                }
                $scale = max($params['extended_album_image_thumb_width'] / $image_thumb_width, $params['extended_album_image_thumb_height'] / $image_thumb_height);
                $image_thumb_width *= $scale;
                $image_thumb_height *= $scale;
                $thumb_left = ($params['extended_album_image_thumb_width'] - $image_thumb_width) / 2;
                $thumb_top = ($params['extended_album_image_thumb_height'] - $image_thumb_height) / 2;
                ?>
                  <a <?php 
                echo $params['thumb_click_action'] == 'open_lightbox' ? ' class="bwg_lightbox_' . $bwg . '"' . ($options_row->enable_seo ? ' href="' . ($is_embed ? $image_row->thumb_url : site_url() . '/' . $WD_BWG_UPLOAD_DIR . $image_row->image_url) . '"' : '') . ' data-image-id="' . $image_row->id . '" data-gallery-id="' . $album_gallery_id . '"' : ($params['thumb_click_action'] == 'redirect_to_url' && $image_row->redirect_url ? 'href="' . $image_row->redirect_url . '" target="' . ($params['thumb_link_target'] ? '_blank' : '') . '"' : '');
                ?>
>
                    <span class="bwg_standart_thumb_<?php 
                echo $bwg;
                ?>
">
                      <span class="bwg_standart_thumb_spun1_<?php 
                echo $bwg;
                ?>
">
                        <span class="bwg_standart_thumb_spun2_<?php 
                echo $bwg;
                ?>
">
                          <?php 
                if ($play_icon && $is_embed_video) {
                    ?>
                          <span class="bwg_play_icon_spun_<?php 
                    echo $bwg;
                    ?>
">
                             <i title="<?php 
                    echo __('Play', 'bwg');
                    ?>
"  class="fa fa-play bwg_play_icon_<?php 
                    echo $bwg;
                    ?>
"></i>
                          </span>
                            <?php 
                }
                if ($params['extended_album_image_title'] == 'hover') {
                    ?>
                            <span class="bwg_image_title_spun1_<?php 
                    echo $bwg;
                    ?>
">
                              <span class="bwg_image_title_spun2_<?php 
                    echo $bwg;
                    ?>
">
                                <?php 
                    echo $image_row->alt;
                    ?>
                              </span>
                            </span>
                            <?php 
                }
                ?>
                          <img style="max-height:none; max-width:none; width:<?php 
                echo $image_thumb_width;
                ?>
px; height:<?php 
                echo $image_thumb_height;
                ?>
px; margin-left: <?php 
                echo $thumb_left;
                ?>
px; margin-top: <?php 
                echo $thumb_top;
                ?>
px;" id="<?php 
                echo $image_row->id;
                ?>
" src="<?php 
                echo ($is_embed ? "" : site_url() . '/' . $WD_BWG_UPLOAD_DIR) . $image_row->thumb_url;
                ?>
" alt="<?php 
                echo $image_row->alt;
                ?>
" />
                        </span>
                      </span>
                      <?php 
                if ($params['extended_album_image_title'] == 'show') {
                    ?>
                        <span class="bwg_image_title_spun1_<?php 
                    echo $bwg;
                    ?>
">
                          <span class="bwg_image_title_spun2_<?php 
                    echo $bwg;
                    ?>
">
                            <?php 
                    echo $image_row->alt;
                    ?>
                          </span>
                        </span>
                        <?php 
                }
                ?>
                    </span>
                  </a>
                  <?php 
            }
        }
        ?>
              <script>
                jQuery(".bwg_description_more_<?php 
        echo $bwg;
        ?>
").click(function () {
                  if (jQuery(this).hasClass("bwg_more")) {
                    jQuery(this).parent().find(".bwg_description_full_<?php 
        echo $bwg;
        ?>
").show();
                    jQuery(this).attr("class", "bwg_description_more_<?php 
        echo $bwg;
        ?>
 bwg_hide");
                    jQuery(this).html("<?php 
        echo __('Hide', 'bwg');
        ?>
");
                  }
                  else {
                    jQuery(this).parent().find(".bwg_description_full_<?php 
        echo $bwg;
        ?>
").hide();
                    jQuery(this).attr("class", "bwg_description_more_<?php 
        echo $bwg;
        ?>
 bwg_more");
                    jQuery(this).html("<?php 
        echo __('More', 'bwg');
        ?>
");
                  }
                });
              </script>
            </div>
            <?php 
        if ($params['extended_album_enable_page'] && $items_per_page && $theme_row->page_nav_position == 'bottom' && $page_nav['total']) {
            WDWLibrary::ajax_html_frontend_page_nav($theme_row, $page_nav['total'], $page_nav['limit'], 'gal_front_form_' . $bwg, $items_per_page_arr, $bwg, $album_gallery_div_id, $params['album_id'], $type, $options_row->enable_seo, $params['extended_album_enable_page']);
        }
        ?>
          </div>
        </form>
        <div id="spider_popup_loading_<?php 
        echo $bwg;
        ?>
" class="spider_popup_loading"></div>
        <div id="spider_popup_overlay_<?php 
        echo $bwg;
        ?>
" class="spider_popup_overlay" onclick="spider_destroypopup(1000)"></div>
      </div>
    </div>
    <script>
      function bwg_gallery_box_<?php 
        echo $bwg;
        ?>
(gallery_id, image_id) {
        var filterTags = jQuery("#bwg_tags_id_bwg_album_extended_<?php 
        echo $bwg;
        ?>
" ).val() ? jQuery("#bwg_tags_id_bwg_album_extended_<?php 
        echo $bwg;
        ?>
" ).val() : 0;
        spider_createpopup('<?php 
        echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php')));
        ?>
&gallery_id=' + gallery_id + '&image_id=' + image_id + "&filter_tag_<?php 
        echo $bwg;
        ?>
=" +  filterTags, '<?php 
        echo $bwg;
        ?>
', '<?php 
        echo $params['popup_width'];
        ?>
', '<?php 
        echo $params['popup_height'];
        ?>
', 1, 'testpopup', 5);
      }
      function bwg_document_ready_<?php 
        echo $bwg;
        ?>
() {
        var bwg_touch_flag = false;
        jQuery(".bwg_lightbox_<?php 
        echo $bwg;
        ?>
").on("click", function () {
          if (!bwg_touch_flag) {
            bwg_touch_flag = true;
            setTimeout(function(){ bwg_touch_flag = false; }, 100);
            bwg_gallery_box_<?php 
        echo $bwg;
        ?>
(jQuery(this).attr("data-gallery-id"), jQuery(this).attr("data-image-id"));
            return false;
          }
        });
        jQuery(".bwg_album_<?php 
        echo $bwg;
        ?>
").on("click", function () {
          if (!bwg_touch_flag) {
            bwg_touch_flag = true;
            setTimeout(function(){ bwg_touch_flag = false; }, 100);
            spider_frontend_ajax('gal_front_form_<?php 
        echo $bwg;
        ?>
', '<?php 
        echo $bwg;
        ?>
', 'bwg_album_extended_<?php 
        echo $bwg;
        ?>
', jQuery(this).attr("data-alb_gal_id"), '<?php 
        echo $album_gallery_id;
        ?>
', jQuery(this).attr("data-def_type"), '', jQuery(this).attr("data-title"), 'default'); 
            return false;
          }
        });
      }
      jQuery(document).ready(function () {
        bwg_document_ready_<?php 
        echo $bwg;
        ?>
();
      });
    </script>
    <?php 
        if ($from_shortcode) {
            return;
        } else {
            die;
        }
    }
    public function image_display($id)
    {
        global $WD_BWG_UPLOAD_DIR;
        $rows_data = $this->model->get_image_rows_data($id);
        $page_nav = $this->model->image_page_nav($id);
        $option_row = $this->model->get_option_row_data();
        $search_value = isset($_POST['search_value']) ? esc_html(stripslashes($_POST['search_value'])) : '';
        $image_asc_or_desc = isset($_POST['image_asc_or_desc']) ? esc_html(stripslashes($_POST['image_asc_or_desc'])) : (isset($_COOKIE['bwg_image_asc_or_desc']) ? esc_html(stripslashes($_COOKIE['bwg_image_asc_or_desc'])) : 'asc');
        $image_order_by = isset($_POST['image_order_by']) ? esc_html(stripslashes($_POST['image_order_by'])) : (isset($_COOKIE['bwg_image_order_by']) ? esc_html(stripslashes($_COOKIE['bwg_image_order_by'])) : 'order');
        $order_class = 'manage-column column-title sorted ' . $image_asc_or_desc;
        $page_number = isset($_POST['page_number']) ? esc_html(stripslashes($_POST['page_number'])) : 1;
        $ids_string = '';
        $per_page = $this->model->per_page();
        $pager = 0;
        $gallery_row = $this->model->get_row_data($id);
        $gallery_type = $gallery_row->gallery_type == 'instagram' || $gallery_row->gallery_type == 'instagram_post' ? 'instagram' : '';
        $image_array = array('image_set_watermark' => __('Set Watermark', 'bwg_back'), 'image_get_resize' => __('Resize', 'bwg_back'), 'resize_image_thumb' => __('Recreate Thumbnail', 'bwg_back'), 'image_recover_all' => __('Reset', 'bwg_back'), 'image_publish_all' => __('Publish', 'bwg_back'), 'image_unpublish_all' => __('Unpublish', 'bwg_back'), 'image_desc' => __('Edit', 'bwg_back'), 'image_delete_all' => __('Delete', 'bwg_back'));
        ?>
    <div class="buttons_div_left">
      <?php 
        $query_url = add_query_arg(array('action' => 'addImages', 'width' => '700', 'height' => '550', 'extensions' => 'jpg,jpeg,png,gif', 'callback' => 'bwg_add_image'), admin_url('admin-ajax.php'));
        $query_url = wp_nonce_url($query_url, 'addImages', 'bwg_nonce');
        $query_url = add_query_arg(array('TB_iframe' => '1'), $query_url);
        ?>
      <a href="<?php 
        echo $query_url;
        ?>
" id="add_image_bwg" class="wd-btn wd-btn-primary wd-btn-icon wd-btn-add thickbox thickbox-preview" id="content-add_media" title="<?php 
        _e("Add Images", 'bwg_back');
        ?>
" onclick="return false;" style="margin-bottom:5px; <?php 
        if ($gallery_type != '') {
            echo 'display:none';
        }
        ?>
" >
        <?php 
        _e('Add Images', 'bwg_back');
        ?>
      </a>
      <?php 
        $query_url = wp_nonce_url(admin_url('admin-ajax.php'), '', 'bwg_nonce');
        /*(re?)define ajax_url to add nonce only in admin*/
        ?>
      <script>
        var ajax_url = "<?php 
        echo $query_url;
        ?>
"
      </script>
        <input id="show_add_embed" class="wd-btn wd-btn-primary wd-btn-icon wd-btn-media"  type="button" title="<?php 
        _e("Embed Media", 'bwg_back');
        ?>
" onclick="jQuery('.opacity_add_embed').show(); jQuery('#add_embed_help').hide(); return false;" value="<?php 
        _e("Embed Media", 'bwg_back');
        ?>
" />
        <input id="show_bulk_embed" class="wd-btn wd-btn-primary wd-btn-icon wd-btn-bulk_media spider_free_version_button" type="button" title="<?php 
        _e("Social Bulk Embed", 'bwg_back');
        ?>
" onclick="jQuery('.opacity_bulk_embed').show(); return false;" value="<?php 
        _e("Social Bulk Embed", 'bwg_back');
        ?>
" />
        <?php 
        WDWLibrary::ajax_search(__('Filename', 'bwg_back'), $search_value, 'galleries_form');
        ?>
    </div>
    <div class="tablenav top buttons_div_left bwg_buttons_div">
      <span class="wd-btn wd-btn-primary-gray bwg_check_all  non_selectable " onclick="spider_check_all_items()">
        <input type="checkbox" id="check_all_items" name="check_all_items" onclick="spider_check_all_items_checkbox()" style="margin: 0; vertical-align: middle;" />
        <span style="vertical-align: middle;"><?php 
        echo __('Select All', 'bwg_back');
        ?>
</span>
      </span>
      <select class="select_icon bulk_action_img">
        <option value=""><?php 
        _e('Bulk Actions', 'bwg_back');
        ?>
</option>
        <?php 
        foreach ($image_array as $key => $value) {
            ?>
        <option value="<?php 
            echo $key;
            ?>
"><?php 
            echo $value;
            ?>
</option>
          <?php 
        }
        ?>
      </select>
      <input class="wd-btn wd-btn-primary wd-btn-icon wd-btn-apply" type="button" title="<?php 
        _e("Apply", "bwg_back");
        ?>
" onclick="if (!bwg_bulk_actions('.bulk_action_img', '')) {return false;}" value="<?php 
        _e("Apply", "bwg_back");
        ?>
" />
      <?php 
        WDWLibrary::ajax_html_page_nav($page_nav['total'], $page_nav['limit'], 'galleries_form', $per_page, $pager++);
        ?>
    </div>
    <div class="opacity_resize_image opacity_add_embed opacity_image_desc opacity_bulk_embed bwg_opacity_media" onclick="jQuery('.opacity_add_embed').hide(); jQuery('.opacity_bulk_embed').hide(); jQuery('.opacity_resize_image').hide(); jQuery('.opacity_image_desc').hide();"></div>       
      <div id="add_embed" class="opacity_add_embed bwg_add_embed">
        <input type="text" id="embed_url" name="embed_url" value="" />
        <input class="wd-btn wd-btn-primary wd-btn-icon wd-btn-add" type="button" onclick="if (bwg_get_embed_info('embed_url')) {jQuery('.opacity_add_embed').hide();} return false;" value="<?php 
        _e('Add to gallery', 'bwg_back');
        ?>
" />
        <input class="wd-btn wd-btn-primary wd-btn-icon wd-btn-cancel" type="button" onclick="jQuery('.opacity_add_embed').hide(); return false;" value="<?php 
        _e('Cancel', 'bwg_back');
        ?>
" />
        <div class="spider_description">
        <p><?php 
        _e('Enter YouTube, Vimeo, Instagram, Flickr or Dailymotion URL here.', 'bwg_back');
        ?>
 <a onclick="jQuery('#add_embed_help').show();" style='text-decoration: underline; color:blue; cursor: pointer;'><?php 
        _e('Help', 'bwg_back');
        ?>
</a></p>
        </div>
        <div id="add_embed_help" class="opacity_add_embed bwg_add_embed" style="display: none;">
          <p style="text-align:right; margin-top:0px;"><a onclick="jQuery('#add_embed_help').hide();" style="text-decoration: underline; color:blue; cursor: pointer; "><?php 
        _e('Close', 'bwg_back');
        ?>
</a></p>
          <p><b>Youtube</b> <?php 
        _e('URL example:', 'bwg_back');
        ?>
 <i>https://www.youtube.com/watch?v=fa4RLjE-yM8</i></p>
          <p><b>Vimeo</b> <?php 
        _e('URL example:', 'bwg_back');
        ?>
 <i>http://vimeo.com/8110647</i></p>
          <p><b>Instagram</b> <?php 
        _e('URL example:', 'bwg_back');
        ?>
 <i>http://instagram.com/p/ykvv0puS4u</i>. <?php 
        _e('Add', 'bwg_back');
        ?>
 "<i style="text-decoration:underline;"><?php 
        _e('post', 'bwg_back');
        ?>
</i>" <?php 
        _e('to the end of URL if you want to embed the whole Instagram post, not only its content.', 'bwg_back');
        ?>
</p>
          <p><b>Flickr</b> <?php 
        _e('URL example:', 'bwg_back');
        ?>
 <i>https://www.flickr.com/photos/sui-fong/15250186998/in/gallery-flickr-72157648726328108/</i></p>
          <p><b>Dailymotion</b> <?php 
        _e('URL example:', 'bwg_back');
        ?>
 <i>http://www.dailymotion.com/video/xexaq0_frank-sinatra-strangers-in-the-nigh_music</i></p>
        </div>
      </div>
      <div id="bulk_embed" class="opacity_bulk_embed bwg_bulk_embed">
        <input class="wd-btn wd-btn-primary wd-btn-icon wd-btn-cancel" type="button" onclick="jQuery('.opacity_bulk_embed').hide(); jQuery('#opacity_div').hide(); jQuery('#loading_div').hide(); return false;" value="<?php 
        _e('Cancel', 'bwg_back');
        ?>
" style="float: right; margin-left: 5px;" />
        <input class="wd-btn wd-btn-primary wd-btn-icon wd-btn-add spider_free_version_button" type="button" value="<?php 
        _e('Add to gallery', 'bwg_back');
        ?>
" style="float:right; margin-left:5px;"/>
        <div class="spider_description"></div>
        <table class="spider_free_version ">
          <thead>
            <tr>
              <td class="spider_label_galleries"><label for="bulk_embed_from" class="spider_free_version_label_color"><?php 
        _e("Bulk embed from:", 'bwg_back');
        ?>
 </label></td>
              <td>
                <input type="radio" disabled="disabled" class="inputbox" id="bulk_embed_from_instagram" onclick="jQuery('#instagram_bulk_params').show();" checked="checked" value="<?php 
        _e("instagram", 'bwg_back');
        ?>
" >
                <label for="bulk_embed_from_instagram" class="spider_free_version_label_color"><?php 
        _e("Instagram", 'bwg_back');
        ?>
</label>&nbsp;
              </td>
            </tr>
          </thead>
          <tbody id="instagram_bulk_params">
            <tr id='popup_tr_instagram_gallery_source' style='display:table-row'>
              <td class="spider_label_galleries"><label for="popup_instagram_gallery_source" class="spider_free_version_label_color"><?php 
        _e("Instagram username:"******"spider_free_version_label_color"><input type="text" id="popup_instagram_gallery_source" disabled="disabled" value="<?php 
        _e("Bulk embed from Instagram is disabled in free version", 'bwg_back');
        ?>
" size="64" /></td>
            </tr>
            <tr id='popup_tr_instagram_image_number' style='display:table-row'>
              <td class="spider_label_galleries"><label for="popup_instagram_image_number" class="spider_free_version_label_color"><?php 
        _e("Number of Instagram recent posts to add to gallery:", 'bwg_back');
        ?>
 </label></td>
              <td><input type="number" disabled="disabled" id="popup_instagram_image_number" value="12" /></td>
            </tr>
            <tr id='popup_tr_instagram_post_gallery' style='display:table-row'>
              <td class="spider_label_galleries"><label class="spider_free_version_label_color"><?php 
        _e("Instagram embed type:", 'bwg_back');
        ?>
 </label></td>
              <td class="spider_free_version_label_color">
                <input type="radio" disabled="disabled" class="inputbox" id="popup_instagram_post_gallery_0" checked="checked" value="0" >
                <label for="popup_instagram_post_gallery_0" class="spider_free_version_label_color"><?php 
        _e("Content", 'bwg_back');
        ?>
</label>&nbsp;
                <input type="radio" disabled="disabled" class="inputbox" id="popup_instagram_post_gallery_1" value="1" >
                <label for="popup_instagram_post_gallery_1" class="spider_free_version_label_color"><?php 
        _e("Whole post", 'bwg_back');
        ?>
</label>
              </td>
            </tr>
          </tbody>
       </table>
      </div>
      <div class="opacity_resize_image bwg_resize_image">
        <?php 
        _e("Resize images to: ", 'bwg_back');
        ?>
        <input type="text" name="image_width" id="image_width" value="1600" /> x 
        <input type="text" name="image_height" id="image_height" value="1200" /> px
        <input class="wd-btn wd-btn-primary wd-not-image" type="button" onclick="spider_set_input_value('ajax_task', 'image_resize');
                                                                                 spider_ajax_save('galleries_form');
                                                                                 jQuery('.opacity_resize_image').hide();
                                                                                 return false;" value="<?php 
        _e("Resize", 'bwg_back');
        ?>
" />
        <input class="wd-btn wd-btn-primary wd-btn-icon wd-btn-cancel" type="button" onclick="jQuery('.opacity_resize_image').hide(); return false;" value="<?php 
        _e("Cancel", 'bwg_back');
        ?>
" />
        <div class="spider_description"><?php 
        _e("The maximum size of resized image.", 'bwg_back');
        ?>
</div>
      </div>
      <div id="add_desc" class="opacity_image_desc bwg_image_desc">
        <div>
          <span class="bwg_popup_label">
            <?php 
        _e('Alt/Title: ', 'bwg_back');
        ?>
          </span>
          <input class="bwg_popup_input" type="text" id="title" name="title" value="" />
          <input class="wd-btn wd-btn-primary wd-btn-icon wd-btn-add" type="button" onclick="if (window.parent.bwg_add_title_desc()) {jQuery('.opacity_image_desc').hide();} return false;" value="<?php 
        echo __('Update', 'bwg_back');
        ?>
" />
          <input class="wd-btn wd-btn-primary wd-btn-icon wd-btn-cancel" type="button" onclick="jQuery('.opacity_image_desc').hide(); return false;" value="<?php 
        echo __('Cancel', 'bwg_back');
        ?>
" />
        </div>
        <?php 
        if ($option_row->thumb_click_action != 'open_lightbox') {
            ?>
        <div>
          <span class="bwg_popup_label">
            <?php 
            _e('Redirect URL: ', 'bwg_back');
            ?>
          </span>
          <input class="bwg_popup_input" type="text" id="redirecturl" name="redirecturl" value="" />
        </div>
        <?php 
        }
        ?>
        <div>
          <span class="bwg_popup_label">
            <?php 
        _e('Description: ', 'bwg_back');
        ?>
          </span>
          <textarea class="bwg_popup_input" type="text" id="desc" name="desc"></textarea>
        </div>
      </div>
      <div id="draganddrop" class="wd_updated" style="display:none;"><strong><p><?php 
        _e('Changes made in this table should be saved.', 'bwg_back');
        ?>
</p></strong></div>
      <table id="images_table" class="wp-list-table widefat fixed pages">
        <thead>
         <th class="check-column table_small_col table_medium_col manage-column column-title sorted asc" style="margin: 0px auto 0px 15px; width: 60px; vertical-align: middle;">
            <a id="show_hide_weights" class="bwg_order_column" title="<?php 
        _e('Hide order column', 'bwg_back');
        ?>
" onclick="spider_show_hide_weights();return false;" value="<?php 
        _e('Hide order column', 'bwg_back');
        ?>
"></a>
            <a id="th_order" onclick="spider_set_input_value('task', '');
                        spider_set_input_value('image_order_by', 'order');
                        spider_set_input_value('image_asc_or_desc', 'desc');
                        spider_ajax_save('galleries_form');" style="display: none;">
             <span class="sorting-indicator"></span>
            </a>
          </th>
          <th class="manage-column column-cb check-column table_small_col" style="padding-top:12px !important;"><input id="check_all" type="checkbox" onclick="spider_check_all(this)" style="margin:5px auto 0;" />
          
          </th>
          <th class="table_small_col">#</th>
          <th class="table_extra_large_col"><?php 
        _e('Thumbnail', 'bwg_back');
        ?>
</th>
          <th class="sortable table_extra_large_col <?php 
        if ($image_order_by == 'filename') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('task', '');
                        spider_set_input_value('image_order_by', 'filename');
                        spider_set_input_value('image_asc_or_desc', '<?php 
        echo $image_order_by == 'filename' && $image_asc_or_desc == 'asc' ? 'desc' : 'asc';
        ?>
');
                        spider_ajax_save('galleries_form');">
              <span><?php 
        _e('Filename', 'bwg_back');
        ?>
</span><span class="sorting-indicator"></span>
            </a>
          </th>
          <th class="sortable table_extra_large_col <?php 
        if ($image_order_by == 'alt') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('task', '');
                        spider_set_input_value('image_order_by', 'alt');
                        spider_set_input_value('image_asc_or_desc', '<?php 
        echo $image_order_by == 'alt' && $image_asc_or_desc == 'asc' ? 'desc' : 'asc';
        ?>
');
                        spider_ajax_save('galleries_form');">
              <span><?php 
        _e('Alt/Title', 'bwg_back');
        if ($option_row->thumb_click_action != 'open_lightbox') {
            ?>
<br /><?php 
            echo __('Redirect', 'bwg_back');
            ?>
 URL<?php 
        }
        ?>
</span><span class="sorting-indicator"></span>
            </a>
          </th>
          <th class="sortable table_extra_large_col <?php 
        if ($image_order_by == 'description') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('task', '');
                        spider_set_input_value('image_order_by', 'description');
                        spider_set_input_value('image_asc_or_desc', '<?php 
        echo $image_order_by == 'description' && $image_asc_or_desc == 'asc' ? 'desc' : 'asc';
        ?>
');
                        spider_ajax_save('galleries_form');">
              <span><?php 
        _e('Description', 'bwg_back');
        ?>
</span><span class="sorting-indicator"></span>
            </a>
          </th>
          <?php 
        $query_url = wp_nonce_url(admin_url('admin-ajax.php'), 'addTags', 'bwg_nonce');
        $query_url = add_query_arg(array('action' => 'addTags', 'width' => '650', 'height' => '500', 'bwg_items_per_page' => $per_page), $query_url);
        ?>
          <th class="table_extra_big_col">
            <a onclick="return bwg_check_checkboxes();"  title="<?php 
        echo __('Add tag', 'bwg_back');
        ?>
" href="<?php 
        echo $query_url;
        ?>
&TB_iframe=1" class="wd-btn wd-btn-primary wd-not-image thickbox thickbox-preview"><?php 
        echo __('Add tag', 'bwg_back');
        ?>
</a>
          </th>
          <th class="sortable table_big_col <?php 
        if ($image_order_by == 'published') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('task', '');
                        spider_set_input_value('image_order_by', 'published');
                        spider_set_input_value('image_asc_or_desc', '<?php 
        echo $image_order_by == 'published' && $image_asc_or_desc == 'asc' ? 'desc' : 'asc';
        ?>
');
                        spider_ajax_save('galleries_form');">
              <span><?php 
        _e('Published', 'bwg_back');
        ?>
</span><span class="sorting-indicator"></span>
            </a>
          </th>
          <th class="table_small_col"><?php 
        echo __('Delete', 'bwg_back');
        ?>
</th>
        </thead>
        <tbody id="tbody_arr">
          <?php 
        $i = ($page_number - 1) * $per_page;
        if ($rows_data) {
            foreach ($rows_data as $row_data) {
                $is_embed = preg_match('/EMBED/', $row_data->filetype) == 1 ? true : false;
                $alternate = !isset($alternate) || $alternate == 'class="alternate"' ? '' : 'class="alternate"';
                $rows_tag_data = $this->model->get_tag_rows_data($row_data->id);
                $published_image = $row_data->published ? 'publish-blue' : 'unpublish-red';
                $published = $row_data->published ? 'unpublish' : 'publish';
                $unpublish = !$row_data->published ? 'Unpublish' : 'Publish';
                ?>
              <tr id="tr_<?php 
                echo $row_data->id;
                ?>
" <?php 
                echo $alternate;
                ?>
>
                <td class="spider_order table_medium_col"><input id="order_input_<?php 
                echo $row_data->id;
                ?>
" name="order_input_<?php 
                echo $row_data->id;
                ?>
" type="text" size="1" value="<?php 
                echo $row_data->order;
                ?>
" /></td>
                <td class="connectedSortable handles table_small_col"><div title="Drag to re-order" class="handle" style="margin:5px auto 0 auto;"></div></td>
                <td class="table_small_col check-column"><input id="check_<?php 
                echo $row_data->id;
                ?>
" name="check_<?php 
                echo $row_data->id;
                ?>
" onclick="spider_check_all(this)" type="checkbox" /></td>
                <td class="table_small_col"><?php 
                echo ++$i;
                ?>
</td>
                <td class="table_extra_large_col">
                <?php 
                $is_embed_instagram_post = preg_match('/INSTAGRAM_POST/', $row_data->filetype) == 1 ? true : false;
                $instagram_post_width = 0;
                $instagram_post_height = 0;
                if ($is_embed_instagram_post) {
                    $image_resolution = explode(' x ', $row_data->resolution);
                    if (is_array($image_resolution)) {
                        $instagram_post_width = $image_resolution[0];
                        $instagram_post_height = explode(' ', $image_resolution[1]);
                        $instagram_post_height = $instagram_post_height[0];
                    }
                }
                $query_url = add_query_arg(array('action' => 'editThumb', 'type' => 'display', 'image_id' => $row_data->id, 'width' => '800', 'height' => '500', 'instagram_post_width' => $instagram_post_width, 'instagram_post_height' => $instagram_post_height), admin_url('admin-ajax.php'));
                $query_url = wp_nonce_url($query_url, 'editThumb', 'bwg_nonce');
                $query_url = add_query_arg(array('TB_iframe' => '1'), $query_url);
                $is_embed_instagram_post = preg_match('/INSTAGRAM_POST/', $row_data->filetype) == 1 ? true : false;
                ?>
                  <a class="thickbox thickbox-preview" title="<?php 
                echo $row_data->alt;
                ?>
" href="<?php 
                echo $query_url;
                ?>
">
                    <img id="image_thumb_<?php 
                echo $row_data->id;
                ?>
" class="thumb" src="<?php 
                echo (!$is_embed ? site_url() . '/' . $WD_BWG_UPLOAD_DIR : "") . $row_data->thumb_url . ($is_embed ? '' : '?date=' . date('Y-m-y H:i:s'));
                ?>
" />
                  </a>
                </td>
                <td class="table_extra_large_col">
                  <div class="filename" id="filename_<?php 
                echo $row_data->id;
                ?>
">
                    <strong><a title="<?php 
                echo $row_data->alt;
                ?>
" class="spider_word_wrap thickbox thickbox-preview" href="<?php 
                echo $query_url;
                ?>
"><?php 
                echo $row_data->filename;
                ?>
</a></strong>
                  </div>
                  <div class="fileDescription" title="<?php 
                _e("Date modified", 'bwg_back');
                ?>
" id="date_modified_<?php 
                echo $row_data->id;
                ?>
"><?php 
                echo date("d F Y, H:i", strtotime($row_data->date));
                ?>
</div>
                  <div class="fileDescription" title="<?php 
                _e("Image Resolution", 'bwg_back');
                ?>
" id="fileresolution_<?php 
                echo $row_data->id;
                ?>
"><?php 
                echo $row_data->resolution;
                ?>
</div>
                  <div class="fileDescription" title="<?php 
                _e("Image size", 'bwg_back');
                ?>
" id="filesize_<?php 
                echo $row_data->id;
                ?>
"><?php 
                echo $row_data->size;
                ?>
</div>
                  <div class="fileDescription" title="<?php 
                _e("Type", 'bwg_back');
                ?>
" id="filetype_<?php 
                echo $row_data->id;
                ?>
"><?php 
                echo $row_data->filetype;
                ?>
</div>
                  <?php 
                if (!$is_embed) {
                    ?>
                  <div> 
                    <?php 
                    $query_url = add_query_arg(array('action' => 'editThumb', 'type' => 'crop', 'image_id' => $row_data->id, 'width' => '800', 'height' => '500'), admin_url('admin-ajax.php'));
                    $query_url = wp_nonce_url($query_url, 'editThumb', 'bwg_nonce');
                    $query_url = add_query_arg(array('TB_iframe' => '1'), $query_url);
                    ?>
                    <span class="edit_thumb"><a class="thickbox thickbox-preview" href="<?php 
                    echo $query_url;
                    ?>
"><?php 
                    _e("Crop", 'bwg_back');
                    ?>
</a></span> | 
                    <?php 
                    $query_url = add_query_arg(array('action' => 'editThumb', 'type' => 'rotate', 'image_id' => $row_data->id, 'width' => '800', 'height' => '500'), admin_url('admin-ajax.php'));
                    $query_url = wp_nonce_url($query_url, 'editThumb', 'bwg_nonce');
                    $query_url = add_query_arg(array('TB_iframe' => '1'), $query_url);
                    ?>
                    <span class="edit_thumb"><a class="thickbox thickbox-preview" href="<?php 
                    echo $query_url;
                    ?>
"><?php 
                    _e("Edit", 'bwg_back');
                    ?>
</a></span> | 
                    <span class="edit_thumb"><a onclick="if (confirm('<?php 
                    echo addslashes(__('Do you want to reset the image?', 'bwg_back'));
                    ?>
')) {
                                                          spider_set_input_value('ajax_task', 'recover');
                                                          spider_set_input_value('image_current_id', '<?php 
                    echo $row_data->id;
                    ?>
');
                                                          spider_ajax_save('galleries_form');
                                                         }
                                                         return false;"><?php 
                    _e('Reset', 'bwg_back');
                    ?>
</a></span>
                  </div>
                  <?php 
                }
                ?>
                  <input type="hidden" id="image_url_<?php 
                echo $row_data->id;
                ?>
" name="image_url_<?php 
                echo $row_data->id;
                ?>
" value="<?php 
                echo $row_data->image_url;
                ?>
" />
                  <input type="hidden" id="thumb_url_<?php 
                echo $row_data->id;
                ?>
" name="thumb_url_<?php 
                echo $row_data->id;
                ?>
" value="<?php 
                echo $row_data->thumb_url;
                ?>
" />
                  <input type="hidden" id="input_filename_<?php 
                echo $row_data->id;
                ?>
" name="input_filename_<?php 
                echo $row_data->id;
                ?>
" value="<?php 
                echo $row_data->filename;
                ?>
" />
                  <input type="hidden" id="input_date_modified_<?php 
                echo $row_data->id;
                ?>
" name="input_date_modified_<?php 
                echo $row_data->id;
                ?>
" value="<?php 
                echo $row_data->date;
                ?>
" />
                  <input type="hidden" id="input_resolution_<?php 
                echo $row_data->id;
                ?>
" name="input_resolution_<?php 
                echo $row_data->id;
                ?>
" value="<?php 
                echo $row_data->resolution;
                ?>
" />
                  <input type="hidden" id="input_size_<?php 
                echo $row_data->id;
                ?>
" name="input_size_<?php 
                echo $row_data->id;
                ?>
" value="<?php 
                echo $row_data->size;
                ?>
" />
                  <input type="hidden" id="input_filetype_<?php 
                echo $row_data->id;
                ?>
" name="input_filetype_<?php 
                echo $row_data->id;
                ?>
" value="<?php 
                echo $row_data->filetype;
                ?>
" />
                </td>
                <td class="table_extra_large_col">
                  <textarea rows="2" id="image_alt_text_<?php 
                echo $row_data->id;
                ?>
" name="image_alt_text_<?php 
                echo $row_data->id;
                ?>
" style="resize:vertical;"><?php 
                echo $row_data->alt;
                ?>
</textarea>
                  <?php 
                if ($option_row->thumb_click_action != 'open_lightbox') {
                    ?>
                  <input size="24" type="text" id="redirect_url_<?php 
                    echo $row_data->id;
                    ?>
" name="redirect_url_<?php 
                    echo $row_data->id;
                    ?>
" value="<?php 
                    echo $row_data->redirect_url;
                    ?>
" />
                  <?php 
                }
                ?>
                </td>
                <td class="table_extra_large_col">
                  <textarea rows="3" id="image_description_<?php 
                echo $row_data->id;
                ?>
" name="image_description_<?php 
                echo $row_data->id;
                ?>
" style="resize:vertical;"><?php 
                echo $row_data->description;
                ?>
</textarea>
                </td>
                <td class="table_extra_large_col">
                  <?php 
                $query_url = wp_nonce_url(admin_url('admin-ajax.php'), 'addTags', 'bwg_nonce');
                $query_url = add_query_arg(array('action' => 'addTags', 'image_id' => $row_data->id, 'width' => '650', 'height' => '500', 'bwg_items_per_page' => $per_page, 'TB_iframe' => '1'), $query_url);
                ?>
                  <a href="<?php 
                echo $query_url;
                ?>
" title="<?php 
                _e('Add tag', 'bwg_back');
                ?>
" class="button-small wd-btn wd-btn-primary wd-not-image thickbox thickbox-preview"><?php 
                _e('Add tag', 'bwg_back');
                ?>
</a>
                  <div class="tags_div" id="tags_div_<?php 
                echo $row_data->id;
                ?>
">
                  <?php 
                $tags_id_string = '';
                if ($rows_tag_data) {
                    foreach ($rows_tag_data as $row_tag_data) {
                        ?>
                      <div class="tag_div" id="<?php 
                        echo $row_data->id;
                        ?>
_tag_<?php 
                        echo $row_tag_data->term_id;
                        ?>
">
                        <span class="tag_name"><?php 
                        echo $row_tag_data->name;
                        ?>
</span>
                        <span style="float:right;" class="spider_delete_img_small" onclick="bwg_remove_tag('<?php 
                        echo $row_tag_data->term_id;
                        ?>
', '<?php 
                        echo $row_data->id;
                        ?>
')" />
                      </div>
                      <?php 
                        $tags_id_string .= $row_tag_data->term_id . ',';
                    }
                }
                ?>
                  </div>
                  <input type="hidden" value="<?php 
                echo $tags_id_string;
                ?>
" id="tags_<?php 
                echo $row_data->id;
                ?>
" name="tags_<?php 
                echo $row_data->id;
                ?>
"/>
                </td>
                <td class="table_big_col publish_icon"><a style="background-image:url('<?php 
                echo WD_BWG_URL . '/images/icons/' . $published_image . '.png';
                ?>
'); background-repeat: no-repeat; display: inline-block; width: 18px; height: 22px;margin: 3px; vertical-align: middle;background-size: contain;" title="<?php 
                echo $unpublish;
                ?>
" onclick="spider_set_input_value('ajax_task', 'image_<?php 
                echo $published;
                ?>
');
                                                      spider_set_input_value('image_current_id', '<?php 
                echo $row_data->id;
                ?>
');
                                                      spider_ajax_save('galleries_form');"></a></td>
                <td class="table_big_col spider_delete_button" ><a class="bwg_img_remove" title='<?php 
                echo __('Delete', 'bwg_back');
                ?>
' onclick="if (confirm('<?php 
                echo addslashes(__('Do you want to delete selected items?', 'bwg_back'));
                ?>
')) {
                                                      spider_set_input_value('ajax_task', 'image_delete');
                                                      spider_set_input_value('image_current_id', '<?php 
                echo $row_data->id;
                ?>
');
                                                      spider_ajax_save('galleries_form');
                                                      } else {
                                                       return false;
                                                      }"></a></td>
              </tr>
              <?php 
                $ids_string .= $row_data->id . ',';
            }
        }
        ?>
          <input id="ids_string" name="ids_string" type="hidden" value="<?php 
        echo $ids_string;
        ?>
" />
          <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="asc" />
          <input id="image_asc_or_desc" name="image_asc_or_desc" type="hidden" value="asc" />
          <input id="image_order_by" name="image_order_by" type="hidden" value="<?php 
        echo $image_order_by;
        ?>
" />
          <input id="ajax_task" name="ajax_task" type="hidden" value="" />
          <input id="image_current_id" name="image_current_id" type="hidden" value="" />
          <input id="added_tags_select_all" name="added_tags_select_all" type="hidden" value="" />
          <input type="hidden" id="bulk_edit" name="bulk_edit" value="0" />
        </tbody>
      </table>
      <div class="tablenav bottom">
        <?php 
        WDWLibrary::ajax_html_page_nav($page_nav['total'], $page_nav['limit'], 'galleries_form', $per_page, $pager++);
        ?>
      </div>
      <script>
        window.onload = spider_show_hide_weights;
      </script>
    <?php 
    }
    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'];
            $params_array['watermark_color'] = $params['watermark_color'];
            $params_array['watermark_width'] = '';
            $watermark_image_or_text = $params_array['watermark_text'];
            $watermark_a = 'bwg_watermark_text_' . $bwg;
            $watermark_div = 'class="bwg_image_browser_watermark_text_' . $bwg . '"';
        } elseif ($params['watermark_type'] == 'image') {
            $show_watermark = TRUE;
            $watermark_text_image = FALSE;
            $params_array['watermark_url'] = urlencode($params['watermark_url']);
            $params_array['watermark_width'] = $params['watermark_width'];
            $params_array['watermark_height'] = $params['watermark_height'];
            $watermark_image_or_text = '<img class="bwg_image_browser_watermark_img_' . $bwg . '" src="' . $params_array['watermark_url'] . '" />';
            $watermark_a = '';
            $watermark_div = 'class="bwg_image_browser_watermark_' . $bwg . '"';
            $params_array['watermark_font'] = '';
            $params_array['watermark_color'] = '';
            $params_array['watermark_font_size'] = '';
        }
        ?>
    <style>
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .image_browser_images_conteiner_<?php 
        echo $bwg;
        ?>
 * {
        -moz-box-sizing: border-box;
        box-sizing: border-box;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .image_browser_images_conteiner_<?php 
        echo $bwg;
        ?>
{
				background-color: rgba(<?php 
        echo $image_browser_images_conteiner['red'];
        ?>
, <?php 
        echo $image_browser_images_conteiner['green'];
        ?>
, <?php 
        echo $image_browser_images_conteiner['blue'];
        ?>
, <?php 
        echo number_format($theme_row->image_browser_full_transparent / 100, 2, ".", "");
        ?>
);
				text-align: center;
				width: 100%;
				border-style: <?php 
        echo $theme_row->image_browser_full_border_style;
        ?>
;
				border-width: <?php 
        echo $theme_row->image_browser_full_border_width;
        ?>
px;
				border-color: #<?php 
        echo $theme_row->image_browser_full_border_color;
        ?>
;
				padding: <?php 
        echo $theme_row->image_browser_full_padding;
        ?>
;
				border-radius: <?php 
        echo $theme_row->image_browser_full_border_radius;
        ?>
;
				position:relative;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .image_browser_images_<?php 
        echo $bwg;
        ?>
 {
				display: inline-block;
				-moz-box-sizing: border-box;
				box-sizing: border-box;
				font-size: 0;
				text-align: center;
				max-width: 100%;
				width: <?php 
        echo $params['image_browser_width'];
        ?>
px;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .image_browser_image_buttons_conteiner_<?php 
        echo $bwg;
        ?>
 {
				text-align: <?php 
        echo $theme_row->image_browser_align;
        ?>
;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .image_browser_image_buttons_<?php 
        echo $bwg;
        ?>
 {
				display: inline-block;
				width:100%;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_image_browser_image_<?php 
        echo $bwg;
        ?>
 {
        background-color: rgba(<?php 
        echo $bwg_image_browser_image['red'];
        ?>
, <?php 
        echo $bwg_image_browser_image['green'];
        ?>
, <?php 
        echo $bwg_image_browser_image['blue'];
        ?>
, <?php 
        echo number_format($theme_row->image_browser_transparent / 100, 2, ".", "");
        ?>
);
				text-align: center;
				/*display: inline-block;*/
				vertical-align: middle;
				margin: <?php 
        echo $theme_row->image_browser_margin;
        ?>
;
				padding: <?php 
        echo $theme_row->image_browser_padding;
        ?>
;
				border-radius: <?php 
        echo $theme_row->image_browser_border_radius;
        ?>
;
				border: <?php 
        echo $theme_row->image_browser_border_width;
        ?>
px <?php 
        echo $theme_row->image_browser_border_style;
        ?>
 #<?php 
        echo $theme_row->image_browser_border_color;
        ?>
;
				box-shadow: <?php 
        echo $theme_row->image_browser_box_shadow;
        ?>
;
				/*z-index: 100;*/
				position: relative;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_image_alt_<?php 
        echo $bwg;
        ?>
{
				display: table;
				width: 100%;
				font-size: <?php 
        echo $theme_row->image_browser_img_font_size;
        ?>
px;
				font-family: <?php 
        echo $theme_row->image_browser_img_font_family;
        ?>
;
				color: #<?php 
        echo $theme_row->image_browser_img_font_color;
        ?>
;
				text-align:<?php 
        echo $theme_row->image_browser_image_description_align;
        ?>
;
				padding-left: 8px;
        word-break: break-word;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_image_browser_img_<?php 
        echo $bwg;
        ?>
 {
        padding: 0 !important;
				max-width: 100% !important;
				height: inherit !important;
				width: 100%;				
      }
      @media only screen and (max-width : 320px) {
				#bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .displaying-num_<?php 
        echo $bwg;
        ?>
 {
				  display: none;
				}
				#bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_image_alt_<?php 
        echo $bwg;
        ?>
 {
				  font-size: 10px !important;
				}
				#bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_watermark_text_<?php 
        echo $bwg;
        ?>
,
				#bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_watermark_text_<?php 
        echo $bwg;
        ?>
:hover {
				  font-size: 10px !important;
				  text-decoration: none;
				  margin: 4px;
				  font-family: <?php 
        echo $params_array['watermark_font'];
        ?>
;
				  color: #<?php 
        echo $params_array['watermark_color'];
        ?>
 !important;
				  opacity: <?php 
        echo number_format($params_array['watermark_opacity'] / 100, 2, ".", "");
        ?>
;
			  	filter: Alpha(opacity=<?php 
        echo $params_array['watermark_opacity'];
        ?>
);
          text-decoration: none;
				  position: relative;
				  z-index: 10141;
				}
				#bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_image_browser_image_description_<?php 
        echo $bwg;
        ?>
 {
          color: #<?php 
        echo $theme_row->image_browser_img_font_color;
        ?>
;
				  display: table;
				  width: 100%;
				  text-align: left;
				  font-size: 8px !important;
				  font-family: <?php 
        echo $theme_row->image_browser_img_font_family;
        ?>
;
				  padding: <?php 
        echo $theme_row->image_browser_image_description_padding;
        ?>
;
				  /*word-break: break-all;*/
				  border-style: <?php 
        echo $theme_row->image_browser_image_description_border_style;
        ?>
;
				  background-color: #<?php 
        echo $theme_row->image_browser_image_description_bg_color;
        ?>
;
				  border-radius: <?php 
        echo $theme_row->image_browser_image_description_border_radius;
        ?>
;
				  border-width: <?php 
        echo $theme_row->image_browser_image_description_border_width;
        ?>
px;
				}
        
				#bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 a {
				  font-size: 10px !important;
				}				
      }
      /*pagination styles*/
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 {
				text-align: <?php 
        echo $theme_row->page_nav_align;
        ?>
;
				font-size: <?php 
        echo $theme_row->page_nav_font_size;
        ?>
px;
				font-family: <?php 
        echo $theme_row->page_nav_font_style;
        ?>
;
				font-weight: <?php 
        echo $theme_row->page_nav_font_weight;
        ?>
;
				color: #<?php 
        echo $theme_row->page_nav_font_color;
        ?>
;
				margin: 6px 0 4px;
				display: block;
				height: 30px;
				line-height: 30px;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .displaying-num_<?php 
        echo $bwg;
        ?>
 {
				font-size: <?php 
        echo $theme_row->page_nav_font_size;
        ?>
px;
				font-family: <?php 
        echo $theme_row->page_nav_font_style;
        ?>
;
				font-weight: <?php 
        echo $theme_row->page_nav_font_weight;
        ?>
;
				color: #<?php 
        echo $theme_row->page_nav_font_color;
        ?>
;
				margin-right: 10px;
				vertical-align: middle;
				display: none;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .paging-input_<?php 
        echo $bwg;
        ?>
 {
				font-size: <?php 
        echo $theme_row->page_nav_font_size;
        ?>
px;
				font-family: <?php 
        echo $theme_row->page_nav_font_style;
        ?>
;
				font-weight: <?php 
        echo $theme_row->page_nav_font_weight;
        ?>
;
				color: #<?php 
        echo $theme_row->page_nav_font_color;
        ?>
;
				vertical-align: middle;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 a.disabled,
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 a.disabled:hover,
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 a.disabled:focus {
				cursor: default;
				color: rgba(<?php 
        echo $rgb_page_nav_font_color['red'];
        ?>
, <?php 
        echo $rgb_page_nav_font_color['green'];
        ?>
, <?php 
        echo $rgb_page_nav_font_color['blue'];
        ?>
, 0.5);
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 a.next-page:hover,
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 a.prev-page:hover {
        color: #000000;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 a {
				cursor: pointer;
				font-size: 15px;
				font-family: <?php 
        echo $theme_row->page_nav_font_style;
        ?>
;
				font-weight: <?php 
        echo $theme_row->page_nav_font_weight;
        ?>
;
				color: #<?php 
        echo $theme_row->page_nav_font_color;
        ?>
;
				text-decoration: none;
				padding: 0% 7%;
				margin: <?php 
        echo $theme_row->page_nav_margin;
        ?>
;
				border-radius: <?php 
        echo $theme_row->page_nav_border_radius;
        ?>
;
				border-style: none;
				border-width: <?php 
        echo $theme_row->page_nav_border_width;
        ?>
px;
				border-color: #<?php 
        echo $theme_row->page_nav_border_color;
        ?>
;
				background-color: #<?php 
        echo $theme_row->page_nav_button_bg_color;
        ?>
;
				opacity: <?php 
        echo number_format($theme_row->page_nav_button_bg_transparent / 100, 2, ".", "");
        ?>
;
				filter: Alpha(opacity=<?php 
        echo $theme_row->page_nav_button_bg_transparent;
        ?>
);
				<?php 
        echo $theme_row->page_nav_button_transition ? 'transition: all 0.3s ease 0s;-webkit-transition: all 0.3s ease 0s;' : '';
        ?>
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 .first-page,
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 .last-page {
        padding: 0% 7%; 		        
      }
	    #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 .next-page {
        margin: 0% 4% 0% 0%; 		        
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 .prev-page {
        margin: 0% 0% 0% 4%; 		        
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 #spider_popup_overlay_<?php 
        echo $bwg;
        ?>
 {
				background-color: #<?php 
        echo $theme_row->lightbox_overlay_bg_color;
        ?>
;
        opacity: <?php 
        echo number_format($theme_row->lightbox_overlay_bg_transparent / 100, 2, ".", "");
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $theme_row->lightbox_overlay_bg_transparent;
        ?>
);
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_image_browser_image_desp_<?php 
        echo $bwg;
        ?>
 {
				display: table;
				clear: both;
				text-align: center;
        padding: <?php 
        echo $theme_row->image_browser_image_description_margin;
        ?>
;
				width: 100%;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_image_browser_image_description_<?php 
        echo $bwg;
        ?>
 {
        color: #<?php 
        echo $theme_row->image_browser_img_font_color;
        ?>
;
				display: table;
				width: 100%;
				text-align: left;
				font-size: <?php 
        echo $theme_row->image_browser_img_font_size;
        ?>
px;
				font-family: <?php 
        echo $theme_row->image_browser_img_font_family;
        ?>
;
				padding: <?php 
        echo $theme_row->image_browser_image_description_padding;
        ?>
;
				word-break: break-word;
				border-style: <?php 
        echo $theme_row->image_browser_image_description_border_style;
        ?>
;
				background-color: #<?php 
        echo $theme_row->image_browser_image_description_bg_color;
        ?>
;
				border-radius: <?php 
        echo $theme_row->image_browser_image_description_border_radius;
        ?>
;
				border-width: <?php 
        echo $theme_row->image_browser_image_description_border_width;
        ?>
px;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_image_browser_image_alt_<?php 
        echo $bwg;
        ?>
 {
      	display:table;
        clear: both;
        text-align: center;
        padding: 8px;
        width: 100%;
      }
      /*watermark*/
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_watermark_text_<?php 
        echo $bwg;
        ?>
,
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_watermark_text_<?php 
        echo $bwg;
        ?>
:hover {
				text-decoration: none;
				margin: 4px;
				font-size: <?php 
        echo $params_array['watermark_font_size'];
        ?>
px;
				font-family: <?php 
        echo $params_array['watermark_font'];
        ?>
;
				color: #<?php 
        echo $params_array['watermark_color'];
        ?>
 !important;
				opacity: <?php 
        echo number_format($params_array['watermark_opacity'] / 100, 2, ".", "");
        ?>
;
				filter: Alpha(opacity=<?php 
        echo $params_array['watermark_opacity'];
        ?>
);
				position: relative;
				z-index: 10141;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_image_browser_image_contain_<?php 
        echo $bwg;
        ?>
{
				position: absolute;
				text-align: center;
				vertical-align: middle;
				width: 100%;
				height: 100%;
				cursor: pointer;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_image_browser_watermark_contain_<?php 
        echo $bwg;
        ?>
{
        display: table;
				vertical-align: middle;
				width: 100%;
				height: 100%;
      }	 
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_image_browser_watermark_cont_<?php 
        echo $bwg;
        ?>
{
        display: table-cell;
				text-align: <?php 
        echo $text_align;
        ?>
;
				position: relative;
				vertical-align: <?php 
        echo $vertical_align;
        ?>
;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_image_browser_watermark_<?php 
        echo $bwg;
        ?>
{
				display: inline-block;
				overflow: hidden;
				position: relative;
				vertical-align: middle;
				z-index: 10140;
				width: <?php 
        echo $params_array['watermark_width'];
        ?>
px;
				max-width: <?php 
        echo $params_array['watermark_width'] / $params['image_browser_width'] * 100;
        ?>
%;
				margin: 10px 10px 10px 10px ;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_image_browser_watermark_text_<?php 
        echo $bwg;
        ?>
{
        display: inline-block;
				overflow: hidden;
				position: relative;
				vertical-align: middle;
				z-index: 10140;
				margin: 10px 10px 10px 10px ;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_image_browser_watermark_img_<?php 
        echo $bwg;
        ?>
{
				max-width: 100%;
				opacity: <?php 
        echo number_format($params_array['watermark_opacity'] / 100, 2, ".", "");
        ?>
;
				filter: Alpha(opacity=<?php 
        echo $params_array['watermark_opacity'];
        ?>
);
				position: relative;
				z-index: 10141;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_none_selectable {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
      }
    </style>
    <div id="bwg_container1_<?php 
        echo $bwg;
        ?>
">
      <div id="bwg_container2_<?php 
        echo $bwg;
        ?>
">
        <form id="gal_front_form_<?php 
        echo $bwg;
        ?>
" method="post" action="#">
          <?php 
        if ($params['show_search_box']) {
            WDWLibrary::ajax_html_frontend_search_box('gal_front_form_' . $bwg, $bwg, 'bwg_standart_thumbnails_' . $bwg, $images_count, $params['search_box_width']);
        }
        ?>
          <div class="image_browser_images_conteiner_<?php 
        echo $bwg;
        ?>
">
            <div id="ajax_loading_<?php 
        echo $bwg;
        ?>
" style="position:absolute;width: 100%; z-index: 115; text-align: center; height: 100%; vertical-align: middle; display:none;">
              <div style="display: table; vertical-align: middle; width: 100%; height: 100%; background-color: #FFFFFF; opacity: 0.7; filter: Alpha(opacity=70);">
                <div style="display: table-cell; text-align: center; position: relative; vertical-align: middle;" >
                  <div id="loading_div_<?php 
        echo $bwg;
        ?>
" class="spider_ajax_loading" style="display: inline-block; text-align:center; position:relative; vertical-align:middle; background-image:url(<?php 
        echo WD_BWG_URL . '/images/ajax_loader.png';
        ?>
); float: none; width:50px;height:50px;background-size:50px 50px;">
                  </div>
                </div>
              </div>
            </div>
            <div class="image_browser_images_<?php 
        echo $bwg;
        ?>
" id="bwg_standart_thumbnails_<?php 
        echo $bwg;
        ?>
" >
              <?php 
        if ($theme_row->page_nav_position == 'top') {
            WDWLibrary::ajax_html_frontend_page_nav($theme_row, $page_nav['total'], $page_nav['limit'], 'gal_front_form_' . $bwg, $items_per_page, $bwg, 'bwg_standart_thumbnails_' . $bwg, 0, 'album', $option_row->enable_seo);
        }
        foreach ($image_rows as $image_row) {
            $params_array['image_id'] = isset($_POST['image_id']) ? esc_html($_POST['image_id']) : $image_row->id;
            $is_embed = preg_match('/EMBED/', $image_row->filetype) == 1 ? true : false;
            $is_embed_16x9 = (preg_match('/EMBED/', $image_row->filetype) == 1 ? true : false) && (preg_match('/VIDEO/', $image_row->filetype) == 1 ? true : false) && !(preg_match('/INSTAGRAM/', $image_row->filetype) == 1 ? true : false);
            $is_embed_instagram_post = preg_match('/INSTAGRAM_POST/', $image_row->filetype) == 1 ? true : false;
            ?>
  
                <div class="image_browser_image_buttons_conteiner_<?php 
            echo $bwg;
            ?>
">
                  <div class="image_browser_image_buttons_<?php 
            echo $bwg;
            ?>
">
                    <div class="bwg_image_browser_image_alt_<?php 
            echo $bwg;
            ?>
">
                      <?php 
            if ($image_title) {
                ?>
                        <div class="bwg_image_alt_<?php 
                echo $bwg;
                ?>
" id="alt<?php 
                echo $image_row->id;
                ?>
">
                          <?php 
                echo html_entity_decode($image_row->alt);
                ?>
                        </div>
                      <?php 
            }
            ?>
                    </div> 
                    <div class="bwg_image_browser_image_<?php 
            echo $bwg;
            ?>
">
                      <?php 
            if ($show_watermark) {
                ?>
                        <div class="bwg_image_browser_image_contain_<?php 
                echo $bwg;
                ?>
" id="bwg_image_browser_image_contain_<?php 
                echo $image_row->id;
                ?>
">
                          <div class="bwg_image_browser_watermark_contain_<?php 
                echo $bwg;
                ?>
">
                            <div class="bwg_image_browser_watermark_cont_<?php 
                echo $bwg;
                ?>
">
                              <div <?php 
                echo $watermark_div;
                ?>
 >
                                <a class="bwg_none_selectable <?php 
                echo $watermark_a;
                ?>
" id="watermark_a<?php 
                echo $image_row->id;
                ?>
" href="<?php 
                echo urldecode($params_array['watermark_link']);
                ?>
" target="_blank">
                                  <?php 
                echo $watermark_image_or_text;
                ?>
                                </a>
                              </div>
                            </div>
                          </div>
                        </div>
                        <?php 
            }
            if (!$is_embed) {
                ?>
                        <a style="position:relative;" <?php 
                echo $params['thumb_click_action'] == 'open_lightbox' ? ' class="bwg_lightbox_' . $bwg . '" data-image-id="' . $image_row->id . '"' : ($params['thumb_click_action'] == 'redirect_to_url' && $image_row->redirect_url ? 'href="' . $image_row->redirect_url . '" target="' . ($params['thumb_link_target'] ? '_blank' : '') . '"' : '');
                ?>
>
                          <img class="bwg_image_browser_img_<?php 
                echo $bwg;
                ?>
" src="<?php 
                echo site_url() . '/' . $WD_BWG_UPLOAD_DIR . $image_row->image_url;
                ?>
" alt="<?php 
                echo $image_row->alt;
                ?>
" />
                        </a>
                      <?php 
            } else {
                /*$is_embed*/
                if ($is_embed_16x9) {
                    WDWLibraryEmbed::display_embed($image_row->filetype, $image_row->filename, array('id' => "bwg_embed_frame_16x9_" . $bwg, 'width' => $params['image_browser_width'], 'height' => $params['image_browser_width'] * 0.5625, 'frameborder' => "0", 'allowfullscreen' => "allowfullscreen", 'style' => "position: relative; margin:0;"));
                } elseif ($is_embed_instagram_post) {
                    WDWLibraryEmbed::display_embed($image_row->filetype, $image_row->filename, array('id' => "bwg_embed_frame_instapost_" . $bwg, 'width' => $params['image_browser_width'], 'height' => $params['image_browser_width'] + 88, 'frameborder' => "0", 'allowfullscreen' => "allowfullscreen", 'style' => "position: relative; margin:0;"));
                } else {
                    /*for instagram image, video and flickr enable lightbox onclick*/
                    ?>
                          <a style="position:relative;" <?php 
                    echo $params['thumb_click_action'] == 'open_lightbox' ? ' class="bwg_lightbox_' . $bwg . '" data-image-id="' . $image_row->id . '"' : ($image_row->redirect_url ? 'href="' . $image_row->redirect_url . '" target="' . ($params['thumb_link_target'] ? '_blank' : '') . '"' : '');
                    ?>
>
                            <?php 
                    WDWLibraryEmbed::display_embed($image_row->filetype, $image_row->filename, array('id' => "bwg_embed_frame_" . $bwg, 'width' => $params['image_browser_width'], 'height' => 'auto', 'frameborder' => "0", 'allowfullscreen' => "allowfullscreen", 'style' => "position: relative; margin:0;"));
                    ?>
                          </a>

                        <?php 
                }
            }
            ?>
                      <script>
                      function bwg_image_browser_<?php 
            echo $bwg;
            ?>
() {
                        jQuery('#bwg_embed_frame_16x9_<?php 
            echo $bwg;
            ?>
').width(jQuery('#bwg_embed_frame_16x9_<?php 
            echo $bwg;
            ?>
').parent().width());
                        jQuery('#bwg_embed_frame_16x9_<?php 
            echo $bwg;
            ?>
').height(jQuery('#bwg_embed_frame_16x9_<?php 
            echo $bwg;
            ?>
').width() * 0.5625);
                        jQuery('#bwg_embed_frame_instapost_<?php 
            echo $bwg;
            ?>
').width(jQuery('#bwg_embed_frame_16x9_<?php 
            echo $bwg;
            ?>
').parent().width());
                        jQuery('#bwg_embed_frame_instapost_<?php 
            echo $bwg;
            ?>
').height(jQuery('#bwg_embed_frame_instapost_<?php 
            echo $bwg;
            ?>
').width() +88);

                        var bwg_image_browser_width = jQuery('.image_browser_images_<?php 
            echo $bwg;
            ?>
').width();
                        if (bwg_image_browser_width <= 108) {
                          jQuery('.paging-input_<?php 
            echo $bwg;
            ?>
').css('display', 'none');
                        }
                        else if (bwg_image_browser_width <= 200) {
                          jQuery('.paging-input_<?php 
            echo $bwg;
            ?>
').css('margin', '0% 0% 0% 0%');
                          jQuery('.paging-input_<?php 
            echo $bwg;
            ?>
').css('display', 'inline');
                          jQuery('.tablenav-pages_<?php 
            echo $bwg;
            ?>
 .next-page').css('margin', '0% 0% 0% 0%');
                          jQuery('.tablenav-pages_<?php 
            echo $bwg;
            ?>
 .prev-page').css('margin', '0% 0% 0% 0%');
                        }
                        else if (bwg_image_browser_width <= 580) {
                          jQuery('.paging-input_<?php 
            echo $bwg;
            ?>
').css('display', 'inline');
                          jQuery('.tablenav-pages_<?php 
            echo $bwg;
            ?>
 a').css('font-size', '13px');
                          jQuery('.paging-input_<?php 
            echo $bwg;
            ?>
').css('margin', '0% 7% 0% 7%');
                          jQuery('.tablenav-pages_<?php 
            echo $bwg;
            ?>
 .next-page').css('margin', '0% 0% 0% 0%');
                          jQuery('.tablenav-pages_<?php 
            echo $bwg;
            ?>
 .prev-page').css('margin', '0% 0% 0% 0%');
                        }
                        else {
                          jQuery('.tablenav-pages_<?php 
            echo $bwg;
            ?>
 a').css('font-size', '15px');
                          jQuery('.paging-input_<?php 
            echo $bwg;
            ?>
').css('margin', '0%  14% 0%  14%');
                          jQuery('.paging-input_<?php 
            echo $bwg;
            ?>
').css('display', 'inline');
                          jQuery('.tablenav-pages_<?php 
            echo $bwg;
            ?>
 .next-page').css('margin', '0% 0% 0% 0%');
                          jQuery('.tablenav-pages_<?php 
            echo $bwg;
            ?>
 .prev-page').css('margin', '0% 0% 0% 0%');
                        }
                      }
                      setTimeout(function() {
                        bwg_image_browser_<?php 
            echo $bwg;
            ?>
();
                      }, 3);
                      </script>
                    </div>
                      <?php 
            if ($enable_image_description && $image_row->description != "") {
                ?>
                      <div class="bwg_image_browser_image_desp_<?php 
                echo $bwg;
                ?>
">                    
                        <div class="bwg_image_browser_image_description_<?php 
                echo $bwg;
                ?>
" id="alt<?php 
                echo $image_row->id;
                ?>
">
                          <?php 
                echo html_entity_decode($image_row->description);
                ?>
                        </div>                  
                      </div>
                        <?php 
            }
            ?>
                  </div>
                </div>
                <?php 
        }
        if ($theme_row->page_nav_position == 'bottom') {
            WDWLibrary::ajax_html_frontend_page_nav($theme_row, $page_nav['total'], $page_nav['limit'], 'gal_front_form_' . $bwg, $items_per_page, $bwg, 'bwg_standart_thumbnails_' . $bwg, 0, 'album', $option_row->enable_seo);
        }
        ?>
            </div>
          </div>
        </form>
        <div id="spider_popup_loading_<?php 
        echo $bwg;
        ?>
" class="spider_popup_loading"></div>
        <div id="spider_popup_overlay_<?php 
        echo $bwg;
        ?>
" class="spider_popup_overlay" onclick="spider_destroypopup(1000)"></div>
      </div>
    </div>
    <script>
      jQuery(window).load(function () {
        <?php 
        if ($image_right_click) {
            ?>
          /* Disable right click.*/
          jQuery('div[id^="bwg_container"]').bind("contextmenu", function (e) {
            return false;
          });
          jQuery('div[id^="bwg_container"]').css('webkitTouchCallout','none');
          <?php 
        }
        ?>
      });
      jQuery(window).resize(function() {
        bwg_image_browser_<?php 
        echo $bwg;
        ?>
();
      });
      function bwg_gallery_box_<?php 
        echo $bwg;
        ?>
(image_id) {
        spider_createpopup('<?php 
        echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php')));
        ?>
&image_id=' + image_id, '<?php 
        echo $bwg;
        ?>
', '<?php 
        echo $params['popup_width'];
        ?>
', '<?php 
        echo $params['popup_height'];
        ?>
', 1, 'testpopup', 5, "<?php 
        echo $theme_row->lightbox_ctrl_btn_pos;
        ?>
");
      }
      function bwg_document_ready_<?php 
        echo $bwg;
        ?>
() {
        var bwg_touch_flag = false;
        jQuery(".bwg_lightbox_<?php 
        echo $bwg;
        ?>
").on("click", function () {
          if (!bwg_touch_flag) {
            bwg_touch_flag = true;
            setTimeout(function(){ bwg_touch_flag = false; }, 100);
            bwg_gallery_box_<?php 
        echo $bwg;
        ?>
(jQuery(this).attr("data-image-id"));
            return false;
          }
        });
      }
      jQuery(document).ready(function () {
        bwg_document_ready_<?php 
        echo $bwg;
        ?>
();
      });
    </script>
    <?php 
        if ($from_shortcode) {
            return;
        } else {
            die;
        }
    }
 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');
     }
 }
예제 #9
0
    public function display($reset = FALSE)
    {
        if (isset($_GET['bwg_start_tour']) && $_GET['bwg_start_tour'] == '1') {
            update_user_meta(get_current_user_id(), 'bwg_photo_gallery', '1');
            WDWLibrary::spider_redirect('admin.php?page=options_bwg');
        }
        global $WD_BWG_UPLOAD_DIR;
        ?>
    <div style="clear: both; float: left; width: 99%;">
      <div style="float:left; font-size: 14px; font-weight: bold;">
        <?php 
        _e("This section allows you to change settings for different views and general options.", 'bwg_back');
        ?>
        <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-gallery/editing-options/global-options.html"><?php 
        _e("Read More in User Manual", 'bwg_back');
        ?>
</a>
      </div>
      <div style="float: right; text-align: right;">
        <a style="text-decoration: none;" target="_blank" href="https://web-dorado.com/files/fromPhotoGallery.php">
          <img width="215" border="0" alt="web-dorado.com" src="<?php 
        echo WD_BWG_URL . '/images/logo.png';
        ?>
" />
        </a>
      </div>
    </div>
    <script>
      function bwg_add_music(files) {
        document.getElementById("slideshow_audio_url").value = files[0]['url'];
      }
      function bwg_add_built_in_watermark_image(files) {
        document.getElementById("built_in_watermark_url").value = '<?php 
        echo site_url() . '/' . $WD_BWG_UPLOAD_DIR;
        ?>
' + files[0]['url'];
      }
      function bwg_add_watermark_image(files) {
        document.getElementById("watermark_url").value = '<?php 
        echo site_url() . '/' . $WD_BWG_UPLOAD_DIR;
        ?>
' + files[0]['url'];
      }
    </script>
    <?php 
        $row = $this->model->get_row_data($reset);
        $built_in_watermark_fonts = array();
        foreach (scandir(path_join(WD_BWG_DIR, 'fonts')) as $filename) {
            if (strpos($filename, '.') === 0) {
                continue;
            } else {
                $built_in_watermark_fonts[] = $filename;
            }
        }
        $watermark_fonts = array('arial' => 'Arial', 'Lucida grande' => 'Lucida grande', 'segoe ui' => 'Segoe ui', 'tahoma' => 'Tahoma', 'trebuchet ms' => 'Trebuchet ms', 'verdana' => 'Verdana', 'cursive' => 'Cursive', 'fantasy' => 'Fantasy', 'monospace' => 'Monospace', 'serif' => 'Serif');
        $effects = array('none' => 'None', 'cubeH' => 'Cube Horizontal', 'cubeV' => 'Cube Vertical', 'fade' => 'Fade', 'sliceH' => 'Slice Horizontal', 'sliceV' => 'Slice Vertical', 'slideH' => 'Slide Horizontal', 'slideV' => 'Slide Vertical', 'scaleOut' => 'Scale Out', 'scaleIn' => 'Scale In', 'blockScale' => 'Block Scale', 'kaleidoscope' => 'Kaleidoscope', 'fan' => 'Fan', 'blindH' => 'Blind Horizontal', 'blindV' => 'Blind Vertical', 'random' => 'Random');
        ?>
    <form method="post" class="wrap bwg_form" action="admin.php?page=options_bwg" style="float: left; width: 99%;">      
      <?php 
        wp_nonce_field('options_bwg', 'bwg_nonce');
        ?>
      <span class="option-icon"></span>
      <h2 id="ed_options"><?php 
        _e("Edit options", 'bwg_back');
        ?>
</h2>
      <div style="display: inline-block; width: 100%;">
        <div style="float: right;">
          <input class="button-primary" type="submit" onclick="if (spider_check_required('title', 'Title')) {return false;}; spider_set_input_value('task', 'save')" value="<?php 
        _e("Save", 'bwg_back');
        ?>
" />
          <input class="button-secondary" type="submit" onclick="if (confirm('<?php 
        echo addslashes(__("Do you want to reset to default?", 'bwg_back'));
        ?>
')) {
                                                                 spider_set_input_value('task', 'reset');
                                                               } else {
                                                                 return false;
                                                               }" value="<?php 
        _e("Reset all options", 'bwg_back');
        ?>
" />
        </div>
      </div>
      <div style="display: none; width: 100%;" id="display_panel">
        <div style="float:left;">
          <div id="div_1" class="gallery_type" onclick="bwg_change_option_type('1')"> <?php 
        _e("Global options", 'bwg_back');
        ?>
</div><br/>
          <div id="div_8" class="gallery_type" onclick="bwg_change_option_type('8')"> <?php 
        _e("Watermark", 'bwg_back');
        ?>
</div><br/>
          <div id="div_2" class="gallery_type" onclick="bwg_change_option_type('2')"> <?php 
        _e("Advertisement", 'bwg_back');
        ?>
</div><br/>
          <div id="div_3" class="gallery_type" onclick="bwg_change_option_type('3')"> <?php 
        _e("Lightbox", 'bwg_back');
        ?>
</div><br/>
          <div id="div_4" class="gallery_type" onclick="bwg_change_option_type('4')"> <?php 
        _e("Album options", 'bwg_back');
        ?>
</div><br/>
          <div id="div_5" class="gallery_type" onclick="bwg_change_option_type('5')"> <?php 
        _e("Slideshow", 'bwg_back');
        ?>
</div><br/>
          <div id="div_6" class="gallery_type" onclick="bwg_change_option_type('6')"> <?php 
        _e("Thumbnail options", 'bwg_back');
        ?>
</div><br/>
          <div id="div_7" class="gallery_type" onclick="bwg_change_option_type('7')"> <?php 
        _e("Image options", 'bwg_back');
        ?>
</div><br/>
          <div id="div_9" class="gallery_type" onclick="bwg_change_option_type('9')"> <?php 
        _e("Embed options", 'bwg_back');
        ?>
</div><br/>
	  <div id="div_10" class="gallery_type" onclick="bwg_change_option_type('10')"> <?php 
        _e("Carousel", 'bwg_back');
        ?>
</div><br/>
          <input type="hidden" id="type" name="type" value="<?php 
        echo isset($_POST["type"]) ? esc_html(stripslashes($_POST["type"])) : "1";
        ?>
"/>
        </div>

        <!--Global options-->
        <div class="spider_div_options" id="div_content_1">
          <table>
            <tbody>
             <tr>
                <td class="spider_label_options">
                  <label><?php 
        echo __('Introduction tour:', 'bwg_back');
        ?>
</label>
                </td>
                <td>
                  <a href="admin.php?page=options_bwg&bwg_start_tour=1" class="button" title="<?php 
        echo _e('Start tour', 'bwg_back');
        ?>
">
                    <?php 
        _e('Start tour', 'bwg_back');
        ?>
                  </a>
                  <div class="spider_description"><?php 
        echo __('Take this tour to quickly learn about the use of this plugin.', 'bwg_back');
        ?>
</div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options">
                  <label for="images_directory"><?php 
        _e("Images directory:", 'bwg_back');
        ?>
</label>
                </td>
                <td>
                  <input id="images_directory" name="images_directory" type="text" style="display:inline-block; width:100%;" value="<?php 
        echo $row->images_directory;
        ?>
" />
                  <input type="hidden" id="old_images_directory" name="old_images_directory" value="<?php 
        echo $row->old_images_directory;
        ?>
"/>
                  <div class="spider_description"><?php 
        _e("Input an existing directory inside the Wordpress directory to store uploaded images.<br />Old directory content will be moved to the new one.", 'bwg_back');
        ?>
</div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options">
                  <label for="upload_img_width"><?php 
        _e("Image dimensions:", 'bwg_back');
        ?>
 </label>
                </td>
                <td>
                  <input type="text" name="upload_img_width" id="upload_img_width" value="<?php 
        echo $row->upload_img_width;
        ?>
" class="spider_int_input" /> x 
                  <input type="text" name="upload_img_height" id="upload_img_height" value="<?php 
        echo $row->upload_img_height;
        ?>
" class="spider_int_input" /> px
                  <div class="spider_description"><?php 
        _e("The maximum size of the uploaded image (0 for original size).", 'bwg_back');
        ?>
</div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options">
                  <label><?php 
        _e("Right click protection:", 'bwg_back');
        ?>
</label>
                </td>
                <td>
                  <input type="radio" name="image_right_click" id="image_right_click_1" value="1" <?php 
        if ($row->image_right_click) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="image_right_click_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                  <input type="radio" name="image_right_click" id="image_right_click_0" value="0" <?php 
        if (!$row->image_right_click) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="image_right_click_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                  <div class="spider_description"><?php 
        _e("Disable image right click possibility.", 'bwg_back');
        ?>
</div>
                </td>
              </tr>
              <tr style="display: none;">
                <td class="spider_label_options">
                  <label><?php 
        _e("Gallery role:", 'bwg_back');
        ?>
</label>
                </td>
                <td>
                  <input type="radio" name="gallery_role" id="gallery_role_1" value="1" <?php 
        if ($row->gallery_role) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="gallery_role_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                  <input type="radio" name="gallery_role" id="gallery_role_0" value="0" <?php 
        if (!$row->gallery_role) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="gallery_role_0">No</label>
                  <div class="spider_description">Only author can change a gallery.</div>
                </td>
              </tr>
              <tr style="display: none;">
                <td class="spider_label_options">
                  <label>Album role:</label>
                </td>
                <td>
                  <input type="radio" name="album_role" id="album_role_1" value="1" <?php 
        if ($row->album_role) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="album_role_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                  <input type="radio" name="album_role" id="album_role_0" value="0" <?php 
        if (!$row->album_role) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="album_role_0">No</label>
                  <div class="spider_description">Only author can change an album.</div>
                </td>
              </tr>
              <tr style="display: none;">
                <td class="spider_label_options">
                  <label>Image role:</label>
                </td>
                <td>
                  <input type="radio" name="image_role" id="image_role_1" value="1" <?php 
        if ($row->image_role) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="image_role_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                  <input type="radio" name="image_role" id="image_role_0" value="0" <?php 
        if (!$row->image_role) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="image_role_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                  <div class="spider_description"><?php 
        _e("Only author can change an image.", 'bwg_back');
        ?>
</div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options">
                  <label><?php 
        echo __('Show search box:', 'bwg_back');
        ?>
</label>
                </td>
                <td>
                  <input type="radio" name="show_search_box" id="show_search_box_1" value="1" <?php 
        if ($row->show_search_box) {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_enable_disable('', 'tr_search_box_width', 'show_search_box_1'); bwg_enable_disable('', 'tr_search_box_placeholder', 'show_search_box_1')" /><label for="show_search_box_1"><?php 
        echo __('Yes', 'bwg_back');
        ?>
</label>
                  <input type="radio" name="show_search_box" id="show_search_box_0" value="0" <?php 
        if (!$row->show_search_box) {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_enable_disable('none', 'tr_search_box_width', 'show_search_box_0'); bwg_enable_disable('none', 'tr_search_box_placeholder', 'show_search_box_0')" /><label for="show_search_box_0"><?php 
        echo __('No', 'bwg_back');
        ?>
</label>
                 <div class="spider_description"></div>
                </td>
              </tr>
	      <tr id="tr_search_box_placeholder">
                <td class="spider_label_options">
                  <label for="placeholder"><?php 
        echo __('Add placeholder to search:', 'bwg_back');
        ?>
 </label>
                </td>
                <td>
                  <input type="text" name="placeholder" id="placeholder" value="<?php 
        echo $row->placeholder;
        ?>
"  /> 
                  <div class="spider_description"></div>
                </td>
              </tr>
              <tr id="tr_search_box_width">
                <td class="spider_label_options">
                  <label for="search_box_width"><?php 
        _e('Search box width:', 'bwg_back');
        ?>
 </label>
                </td>
                <td>
                  <input type="text" name="search_box_width" id="search_box_width" value="<?php 
        echo $row->search_box_width;
        ?>
" class="spider_int_input" /> px
                  <div class="spider_description"></div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options">
                  <label><?php 
        _e('Show "Order by" dropdown list:', 'bwg_back');
        ?>
</label>
                </td>
                <td>
                  <input type="radio" name="show_sort_images" id="show_sort_images_1" value="1" <?php 
        if ($row->show_sort_images) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="show_sort_images_1"><?php 
        _e('Yes', 'bwg_back');
        ?>
</label>
                  <input type="radio" name="show_sort_images" id="show_sort_images_0" value="0" <?php 
        if (!$row->show_sort_images) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="show_sort_images_0"><?php 
        _e('No', 'bwg_back');
        ?>
</label>
                 <div class="spider_description"></div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options">
                  <label><?php 
        _e('Show tag box:', 'bwg_back');
        ?>
</label>
                </td>
                <td>
                  <input type="radio" name="show_tag_box" id="show_tag_box_1" value="1" <?php 
        if ($row->show_tag_box) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="show_tag_box_1"><?php 
        _e('Yes', 'bwg_back');
        ?>
</label>
                  <input type="radio" name="show_tag_box" id="show_tag_box_0" value="0" <?php 
        if (!$row->show_tag_box) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="show_tag_box_0"><?php 
        _e('No', 'bwg_back');
        ?>
</label>
                  <div class="spider_description"></div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options">
                  <label><?php 
        _e('Preload images:', 'bwg_back');
        ?>
</label>
                </td>
                <td>
                  <input type="radio" name="preload_images" id="preload_images_1" value="1" <?php 
        if ($row->preload_images) {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_enable_disable('', 'tr_preload_images_count', 'preload_images_1')" /><label for="preload_images_1"><?php 
        _e('Yes', 'bwg_back');
        ?>
</label>
                  <input type="radio" name="preload_images" id="preload_images_0" value="0" <?php 
        if (!$row->preload_images) {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_enable_disable('none', 'tr_preload_images_count', 'preload_images_0')" /><label for="preload_images_0"><?php 
        _e('No', 'bwg_back');
        ?>
</label>
                 <div class="spider_description"></div>
                </td>
              </tr>	
              <tr id="tr_preload_images_count">
                <td class="spider_label_options">
                  <label for="preload_images_count"><?php 
        _e('Count of images:', 'bwg_back');
        ?>
 </label>
                </td>
                <td>
                  <input type="text" name="preload_images_count" id="preload_images_count" value="<?php 
        echo $row->preload_images_count;
        ?>
" class="spider_int_input" />
                  <div class="spider_description"><?php 
        _e('Count of images to preload (0 for all).', 'bwg_back');
        ?>
</div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options">
                  <label><?php 
        _e('Import from Media Library:', 'bwg_back');
        ?>
</label>
                </td>
                <td>
                  <input type="radio" name="enable_ML_import" id="enable_ML_import_1" value="1" <?php 
        if ($row->enable_ML_import) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="enable_ML_import_1"><?php 
        _e('Yes', 'bwg_back');
        ?>
</label>
                  <input type="radio" name="enable_ML_import" id="enable_ML_import_0" value="0" <?php 
        if (!$row->enable_ML_import) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="enable_ML_import_0"><?php 
        _e('No', 'bwg_back');
        ?>
</label>
                 <div class="spider_description"><?php 
        _e('Enable import from Media Library in file manager.', 'bwg_back');
        ?>
</div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options">
                  <label><?php 
        _e('Enable href attribute:', 'bwg_back');
        ?>
</label>
                </td>
                <td>
                  <input type="radio" name="enable_seo" id="enable_seo_1" value="1" <?php 
        if ($row->enable_seo) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="enable_seo_1"><?php 
        _e('Yes', 'bwg_back');
        ?>
</label>
                  <input type="radio" name="enable_seo" id="enable_seo_0" value="0" <?php 
        if (!$row->enable_seo) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="enable_seo_0"><?php 
        _e('No', 'bwg_back');
        ?>
</label>
                 <div class="spider_description"><?php 
        _e('Disable this option only if it conflicts with your theme.', 'bwg_back');
        ?>
</div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options">
                  <label><?php 
        _e('Meta auto-fill:', 'bwg_back');
        ?>
</label>
                </td>
                <td>
                  <input type="radio" name="read_metadata" id="read_metadata_1" value="1" <?php 
        if ($row->read_metadata) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="read_metadata_1"><?php 
        _e('Yes', 'bwg_back');
        ?>
</label>
                  <input type="radio" name="read_metadata" id="read_metadata_0" value="0" <?php 
        if (!$row->read_metadata) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="read_metadata_0"><?php 
        _e('No', 'bwg_back');
        ?>
</label>
                  <div class="spider_description"><?php 
        _e('Enabling this option the meta description of the image will be automatically filled in image description field.', 'bwg_back');
        ?>
</div>
                </td>
              </tr>

              <tr>
                <td class="spider_label_options">
                  <label><?php 
        _e('Show/hide custom post types:', 'bwg_back');
        ?>
</label>
                </td>
                <td>
                  <input type="radio" name="show_hide_custom_post" id="show_hide_custom_post_1" value="1" <?php 
        if ($row->show_hide_custom_post) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="show_hide_custom_post_1"><?php 
        _e('Yes', 'bwg_back');
        ?>
</label>
                  <input type="radio" name="show_hide_custom_post" id="show_hide_custom_post_0" value="0" <?php 
        if (!$row->show_hide_custom_post) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="show_hide_custom_post_0"><?php 
        _e('No', 'bwg_back');
        ?>
</label>
                  <div class="spider_description"></div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options">
                  <label><?php 
        _e('Show/hide comments for custom post types:', 'bwg_back');
        ?>
</label>
                </td>
                <td>
                  <input type="radio" name="show_hide_post_meta" id="show_hide_post_meta_1" value="1" <?php 
        if ($row->show_hide_post_meta) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="show_hide_post_meta_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                  <input type="radio" name="show_hide_post_meta" id="show_hide_post_meta_0" value="0" <?php 
        if (!$row->show_hide_post_meta) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="show_hide_post_meta_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                  <div class="spider_description"></div>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
        
        <!--Watermark-->
        <div class="spider_div_options" id="div_content_8">
          <table style="width: 100%;">
            <tr>
              <td style="width: 50%; vertical-align: top; height: 100%; display: table-cell;">
                <table>
                  <tbody>
                    <tr id="tr_built_in_watermark_type">
                      <td class="spider_label_options">
                        <label><?php 
        _e('Watermark type: ', 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input type="radio" name="built_in_watermark_type" id="built_in_watermark_type_none" value="none" <?php 
        if ($row->built_in_watermark_type == 'none') {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_built_in_watermark('watermark_type_none')" />
                          <label for="built_in_watermark_type_none"><?php 
        _e('None', 'bwg_back');
        ?>
</label>
                        <input type="radio" name="built_in_watermark_type" id="built_in_watermark_type_text" value="text" <?php 
        if ($row->built_in_watermark_type == 'text') {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_built_in_watermark('watermark_type_text')" onchange="preview_built_in_watermark()" />
                          <label for="built_in_watermark_type_text"><?php 
        _e('Text', 'bwg_back');
        ?>
</label>
                        <input type="radio" name="built_in_watermark_type" id="built_in_watermark_type_image" value="image" <?php 
        if ($row->built_in_watermark_type == 'image') {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_built_in_watermark('watermark_type_image')" onchange="preview_built_in_watermark()" />
                          <label for="built_in_watermark_type_image"><?php 
        _e('Image', 'bwg_back');
        ?>
</label>
                          <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr id="tr_built_in_watermark_url">
                      <td class="spider_label_options">
                        <label for="built_in_watermark_url"><?php 
        _e('Watermark url: ', 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input type="text" id="built_in_watermark_url" name="built_in_watermark_url" style="width: 68%;" value="<?php 
        echo $row->built_in_watermark_url;
        ?>
" style="display:inline-block;" onchange="preview_built_in_watermark()" />
                        <?php 
        $query_url = add_query_arg(array('action' => 'addImages', 'width' => '700', 'height' => '550', 'extensions' => 'png', 'callback' => 'bwg_add_built_in_watermark_image'), admin_url('admin-ajax.php'));
        $query_url = wp_nonce_url($query_url, 'addImages', 'bwg_nonce');
        $query_url = add_query_arg(array('TB_iframe' => '1'), $query_url);
        ?>
                        <a href="<?php 
        echo $query_url;
        ?>
" id="button_add_built_in_watermark_image" class="button-primary thickbox thickbox-preview"
                           title="Add image" 
                           onclick="return false;"
                           style="margin-bottom:5px;">
                          <?php 
        _e('Add Image', 'bwg_back');
        ?>
                        </a>
                        <div class="spider_description"><?php 
        _e('Only .png format is supported.', 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>                    
                    <tr id="tr_built_in_watermark_text">
                      <td class="spider_label_options">
                        <label for="built_in_watermark_text"><?php 
        _e('Watermark text: ', 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input type="text" name="built_in_watermark_text" id="built_in_watermark_text" style="width: 100%;" value="<?php 
        echo $row->built_in_watermark_text;
        ?>
" onchange="preview_built_in_watermark()" onkeypress="preview_built_in_watermark()" />
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr id="tr_built_in_watermark_size">
                      <td class="spider_label_options">
                        <label for="built_in_watermark_size"><?php 
        _e('Watermark size: ', 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input type="text" name="built_in_watermark_size" id="built_in_watermark_size" value="<?php 
        echo $row->built_in_watermark_size;
        ?>
" class="spider_int_input" onchange="preview_built_in_watermark()" /> %
                        <div class="spider_description"><?php 
        _e('Enter size of watermark in percents according to image.', 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>
                    <tr id="tr_built_in_watermark_font_size">
                      <td class="spider_label_options">
                        <label for="built_in_watermark_font_size"><?php 
        _e('Watermark font size:', 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input type="text" name="built_in_watermark_font_size" id="built_in_watermark_font_size" value="<?php 
        echo $row->built_in_watermark_font_size;
        ?>
" class="spider_int_input" onchange="preview_built_in_watermark()" /> 
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr id="tr_built_in_watermark_font">
                      <td class="spider_label_options">
                        <label for="built_in_watermark_font"><?php 
        _e('Watermark font style: ', 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <select name="built_in_watermark_font" id="built_in_watermark_font" style="width:150px;" onchange="preview_built_in_watermark()">
                          <?php 
        foreach ($built_in_watermark_fonts as $watermark_font) {
            ?>
                            <option value="<?php 
            echo $watermark_font;
            ?>
" <?php 
            if ($row->built_in_watermark_font == $watermark_font) {
                echo 'selected="selected"';
            }
            ?>
><?php 
            echo $watermark_font;
            ?>
</option>
                            <?php 
        }
        ?>
                        </select>
                        <?php 
        foreach ($built_in_watermark_fonts as $watermark_font) {
            ?>
                            <style>
                            @font-face {
                              font-family: <?php 
            echo 'bwg_' . str_replace('.ttf', '', $watermark_font);
            ?>
;
                              src: url("<?php 
            echo WD_BWG_URL . '/fonts/' . $watermark_font;
            ?>
");
                             }
                            </style>
                            <?php 
        }
        ?>
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr id="tr_built_in_watermark_color">
                      <td class="spider_label_options">
                        <label for="built_in_watermark_color"><?php 
        _e('Watermark color:', 'bwg_back');
        ?>
 </label>
                      </td>
                      <td>
                        <input type="text" name="built_in_watermark_color" id="built_in_watermark_color" value="<?php 
        echo $row->built_in_watermark_color;
        ?>
" class="color" onchange="preview_built_in_watermark()" />
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr id="tr_built_in_watermark_opacity">
                      <td class="spider_label_options">
                        <label for="built_in_watermark_opacity"><?php 
        _e('Watermark opacity:', 'bwg_back');
        ?>
 </label>
                      </td>
                      <td>
                        <input type="text" name="built_in_watermark_opacity" id="built_in_watermark_opacity" value="<?php 
        echo $row->built_in_watermark_opacity;
        ?>
" class="spider_int_input" onchange="preview_built_in_watermark()" /> %
                        <div class="spider_description"><?php 
        _e('Opacity value must be in the range of 0 to 100.', 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>
                    <tr id="tr_built_in_watermark_position">
                      <td class="spider_label_options">
                        <label><?php 
        _e('Watermark position:', 'bwg_back');
        ?>
 </label>
                      </td>
                      <td>
                        <table class="bwg_position_table">
                          <tbody>
                            <tr>
                              <td><input type="radio" value="top-left" name="built_in_watermark_position" <?php 
        if ($row->built_in_watermark_position == "top-left") {
            echo 'checked="checked"';
        }
        ?>
 onchange="preview_built_in_watermark()"></td>
                              <td><input type="radio" value="top-center" name="built_in_watermark_position" <?php 
        if ($row->built_in_watermark_position == "top-center") {
            echo 'checked="checked"';
        }
        ?>
 onchange="preview_built_in_watermark()"></td>
                              <td><input type="radio" value="top-right" name="built_in_watermark_position" <?php 
        if ($row->built_in_watermark_position == "top-right") {
            echo 'checked="checked"';
        }
        ?>
 onchange="preview_built_in_watermark()"></td>
                            </tr>
                            <tr>
                              <td><input type="radio" value="middle-left" name="built_in_watermark_position" <?php 
        if ($row->built_in_watermark_position == "middle-left") {
            echo 'checked="checked"';
        }
        ?>
 onchange="preview_built_in_watermark()"></td>
                              <td><input type="radio" value="middle-center" name="built_in_watermark_position" <?php 
        if ($row->built_in_watermark_position == "middle-center") {
            echo 'checked="checked"';
        }
        ?>
 onchange="preview_built_in_watermark()"></td>
                              <td><input type="radio" value="middle-right" name="built_in_watermark_position" <?php 
        if ($row->built_in_watermark_position == "middle-right") {
            echo 'checked="checked"';
        }
        ?>
 onchange="preview_built_in_watermark()"></td>
                            </tr>
                            <tr>
                              <td><input type="radio" value="bottom-left" name="built_in_watermark_position" <?php 
        if ($row->built_in_watermark_position == "bottom-left") {
            echo 'checked="checked"';
        }
        ?>
 onchange="preview_built_in_watermark()"></td>
                              <td><input type="radio" value="bottom-center" name="built_in_watermark_position" <?php 
        if ($row->built_in_watermark_position == "bottom-center") {
            echo 'checked="checked"';
        }
        ?>
 onchange="preview_built_in_watermark()"></td>
                              <td><input type="radio" value="bottom-right" name="built_in_watermark_position" <?php 
        if ($row->built_in_watermark_position == "bottom-right") {
            echo 'checked="checked"';
        }
        ?>
 onchange="preview_built_in_watermark()"></td>
                            </tr>
                          </tbody>
                        </table>
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                  </tbody>
                </table>
              </td>
              <td style="width: 50%; vertical-align: top;height: 100%; display: table-cell;">
                <span id="preview_built_in_watermark" style="display:table-cell; background-image:url('<?php 
        echo WD_BWG_URL . '/images/watermark_preview.jpg';
        ?>
');background-size:100% 100%;width:400px;height:400px;padding-top: 4px; position:relative;">
                </span>
              </td>
            </tr>
          </table>
        </div>

        <!--Advertisement-->
        <div class="spider_div_options" id="div_content_2">
          <table style="width: 100%;">
            <tr>
              <td style="width: 50%; vertical-align: top; height: 100%; display: table-cell;">
                <table>
                  <tbody>
                    <tr id="tr_watermark_type">
                      <td class="spider_label_options">
                        <label><?php 
        _e('Advertisement type:', 'bwg_back');
        ?>
 </label>
                      </td>
                      <td>
                        <input type="radio" name="watermark_type" id="watermark_type_none" value="none" <?php 
        if ($row->watermark_type == 'none') {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_watermark('watermark_type_none')" />
                          <label for="watermark_type_none"><?php 
        _e('None', 'bwg_back');
        ?>
</label>
                        <input type="radio" name="watermark_type" id="watermark_type_text" value="text" <?php 
        if ($row->watermark_type == 'text') {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_watermark('watermark_type_text')" onchange="preview_watermark()" />
                          <label for="watermark_type_text"><?php 
        _e('Text', 'bwg_back');
        ?>
</label>
                        <input type="radio" name="watermark_type" id="watermark_type_image" value="image" <?php 
        if ($row->watermark_type == 'image') {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_watermark('watermark_type_image')" onchange="preview_watermark()" />
                          <label for="watermark_type_image"><?php 
        _e('Image', 'bwg_back');
        ?>
</label>
                          <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr id="tr_watermark_url">
                      <td class="spider_label_options">
                        <label for="watermark_url"><?php 
        _e('Advertisement url:', 'bwg_back');
        ?>
 </label>
                      </td>
                      <td>
                        <input type="text" id="watermark_url" name="watermark_url" style="width: 68%;" value="<?php 
        echo $row->watermark_url;
        ?>
" style="display:inline-block;" onchange="preview_watermark()" />
                        
                        <?php 
        $query_url = add_query_arg(array('action' => 'addImages', 'width' => '700', 'height' => '550', 'extensions' => 'jpg,jpeg,png,gif', 'callback' => 'bwg_add_watermark_image'), admin_url('admin-ajax.php'));
        $query_url = wp_nonce_url($query_url, 'addImages', 'bwg_nonce');
        $query_url = add_query_arg(array('TB_iframe' => '1'), $query_url);
        ?>

                        <a href="<?php 
        echo $query_url;
        ?>
" id="button_add_watermark_image" class="button-primary thickbox thickbox-preview"
                           title="Add image" 
                           onclick="return false;"
                           style="margin-bottom:5px;">
                          <?php 
        _e('Add Image', 'bwg_back');
        ?>
                        </a>
                        <div class="spider_description"><?php 
        _e('Enter absolute image file url or add file from Options page. (.jpg,.jpeg,.png,.gif formats are supported)', 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>                    
                    <tr id="tr_watermark_text">
                      <td class="spider_label_options">
                        <label for="watermark_text"><?php 
        _e('Advertisement text:', 'bwg_back');
        ?>
 </label>
                      </td>
                      <td>
                        <input type="text" name="watermark_text" id="watermark_text" style="width: 100%;" value="<?php 
        echo $row->watermark_text;
        ?>
" onchange="preview_watermark()" onkeypress="preview_watermark()" />
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr id="tr_watermark_link">
                      <td class="spider_label_options">
                        <label for="watermark_link"><?php 
        _e('Advertisement link:', 'bwg_back');
        ?>
 </label>
                      </td>
                      <td>
                        <input type="text" name="watermark_link" id="watermark_link" style="width: 100%;" value="<?php 
        echo $row->watermark_link;
        ?>
" onchange="preview_watermark()" onkeypress="preview_watermark()" />
                        <div class="spider_description"><?php 
        _e('Enter a URL to open when the advertisement banner is clicked.', 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>
                    <tr id="tr_watermark_width_height">
                      <td class="spider_label_options">
                        <label for="watermark_width"><?php 
        _e('Advertisement dimensions:', 'bwg_back');
        ?>
 </label>
                      </td>
                      <td>
                        <input type="text" name="watermark_width" id="watermark_width" value="<?php 
        echo $row->watermark_width;
        ?>
" class="spider_int_input" onchange="preview_watermark()" /> x 
                        <input type="text" name="watermark_height" id="watermark_height" value="<?php 
        echo $row->watermark_height;
        ?>
" class="spider_int_input" onchange="preview_watermark()" /> px
                        <div class="spider_description"><?php 
        _e('Maximum values for watermark image width and height.', 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>
                    <tr id="tr_watermark_font_size">
                      <td class="spider_label_options">
                        <label for="watermark_font_size"><?php 
        _e('Advertisement font size:', 'bwg_back');
        ?>
 </label>
                      </td>
                      <td>
                        <input type="text" name="watermark_font_size" id="watermark_font_size" value="<?php 
        echo $row->watermark_font_size;
        ?>
" class="spider_int_input" onchange="preview_watermark()" /> px
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr id="tr_watermark_font">
                      <td class="spider_label_options">
                        <label for="watermark_font"><?php 
        _e('Advertisement font style:', 'bwg_back');
        ?>
 </label>
                      </td>
                      <td>
                        <select name="watermark_font" id="watermark_font" style="width:150px;" onchange="preview_watermark()">
                          <?php 
        foreach ($watermark_fonts as $watermark_font) {
            ?>
                            <option value="<?php 
            echo $watermark_font;
            ?>
" <?php 
            if ($row->watermark_font == $watermark_font) {
                echo 'selected="selected"';
            }
            ?>
><?php 
            echo $watermark_font;
            ?>
</option>
                            <?php 
        }
        ?>
                        </select>
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr id="tr_watermark_color">
                      <td class="spider_label_options">
                        <label for="watermark_color"><?php 
        _e('Advertisement color:', 'bwg_back');
        ?>
 </label>
                      </td>
                      <td>
                        <input type="text" name="watermark_color" id="watermark_color" value="<?php 
        echo $row->watermark_color;
        ?>
" class="color" onchange="preview_watermark()" />
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr id="tr_watermark_opacity">
                      <td class="spider_label_options">
                        <label for="watermark_opacity"><?php 
        _e('Advertisement opacity:', 'bwg_back');
        ?>
 </label>
                      </td>
                      <td>
                        <input type="text" name="watermark_opacity" id="watermark_opacity" value="<?php 
        echo $row->watermark_opacity;
        ?>
" class="spider_int_input" onchange="preview_watermark()" /> %
                        <div class="spider_description"><?php 
        _e('Value must be between 0 to 100.', 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>
                    <tr id="tr_watermark_position">
                      <td class="spider_label_options">
                        <label><?php 
        _e('Advertisement position:', 'bwg_back');
        ?>
 </label>
                      </td>
                      <td>
                        <table class="bwg_position_table">
                          <tbody>
                            <tr>
                              <td><input type="radio" value="top-left" name="watermark_position" <?php 
        if ($row->watermark_position == "top-left") {
            echo 'checked="checked"';
        }
        ?>
 onchange="preview_watermark()"></td>
                              <td><input type="radio" value="top-center" name="watermark_position" <?php 
        if ($row->watermark_position == "top-center") {
            echo 'checked="checked"';
        }
        ?>
 onchange="preview_watermark()"></td>
                              <td><input type="radio" value="top-right" name="watermark_position" <?php 
        if ($row->watermark_position == "top-right") {
            echo 'checked="checked"';
        }
        ?>
 onchange="preview_watermark()"></td>
                            </tr>
                            <tr>
                              <td><input type="radio" value="middle-left" name="watermark_position" <?php 
        if ($row->watermark_position == "middle-left") {
            echo 'checked="checked"';
        }
        ?>
 onchange="preview_watermark()"></td>
                              <td><input type="radio" value="middle-center" name="watermark_position" <?php 
        if ($row->watermark_position == "middle-center") {
            echo 'checked="checked"';
        }
        ?>
 onchange="preview_watermark()"></td>
                              <td><input type="radio" value="middle-right" name="watermark_position" <?php 
        if ($row->watermark_position == "middle-right") {
            echo 'checked="checked"';
        }
        ?>
 onchange="preview_watermark()"></td>
                            </tr>
                            <tr>
                              <td><input type="radio" value="bottom-left" name="watermark_position" <?php 
        if ($row->watermark_position == "bottom-left") {
            echo 'checked="checked"';
        }
        ?>
 onchange="preview_watermark()"></td>
                              <td><input type="radio" value="bottom-center" name="watermark_position" <?php 
        if ($row->watermark_position == "bottom-center") {
            echo 'checked="checked"';
        }
        ?>
 onchange="preview_watermark()"></td>
                              <td><input type="radio" value="bottom-right" name="watermark_position" <?php 
        if ($row->watermark_position == "bottom-right") {
            echo 'checked="checked"';
        }
        ?>
 onchange="preview_watermark()"></td>
                            </tr>
                          </tbody>
                        </table>
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                  </tbody>
                </table>
              </td>
              <td style="width: 50%; vertical-align: top;height: 100%; display: table-cell;">
                <span id="preview_watermark" style="display:table-cell; background-image:url('<?php 
        echo WD_BWG_URL . '/images/watermark_preview.jpg';
        ?>
');background-size:100% 100%;width:400px;height:400px;padding-top: 4px; position:relative;">
                </span>
              </td>
            </tr>
          </table>
        </div>

        <!--Lightbox-->
        <div class="spider_div_options" id="div_content_3">        
          <table style="width: 100%;">
            <tr>
              <td style="width: 50%; vertical-align: top;">
                <table style="display: inline-table;">
                  <tbody>			
                    <tr id="tr_popup_full_width">
                      <td class="spider_label_options">
                        <label><?php 
        _e('Full width lightbox:', 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input type="radio" name="popup_fullscreen" id="popup_fullscreen_1" value="1" <?php 
        if ($row->popup_fullscreen) {
            echo 'checked="checked"';
        }
        ?>
 onchange="bwg_popup_fullscreen(1)" /><label for="popup_fullscreen_1"><?php 
        _e('Yes', 'bwg_back');
        ?>
</label>
                        <input type="radio" name="popup_fullscreen" id="popup_fullscreen_0" value="0" <?php 
        if (!$row->popup_fullscreen) {
            echo 'checked="checked"';
        }
        ?>
 onchange="bwg_popup_fullscreen(0)" /><label for="popup_fullscreen_0"><?php 
        _e('No', 'bwg_back');
        ?>
</label>
                        <div class="spider_description"><?php 
        _e('Enable full width feature for the lightbox.', 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>			
                    <tr id="tr_popup_dimensions" >
                      <td class="spider_label_options">
                        <label for="popup_width"><?php 
        _e('Lightbox dimensions:', 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input type="text" name="popup_width" id="popup_width" value="<?php 
        echo $row->popup_width;
        ?>
" class="spider_int_input" /> x 
                        <input type="text" name="popup_height" id="popup_height" value="<?php 
        echo $row->popup_height;
        ?>
" class="spider_int_input" /> px
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr>
                      <td class="spider_label_options">
                        <label for="popup_type"><?php 
        _e('Lightbox effect:', 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <select name="popup_type" id="popup_type" style="width:150px;">
                          <?php 
        foreach ($effects as $key => $effect) {
            ?>
                            <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $key != 'none' && $key != 'fade' ? 'disabled="disabled" title="' . __("This effect is disabled in free version.", 'bwg_back') . '"' : '';
            ?>
 <?php 
            if ($row->popup_type == $key) {
                echo 'selected="selected"';
            }
            ?>
><?php 
            echo __($effect, "bwg_back");
            ?>
</option>
                            <?php 
        }
        ?>
                        </select>
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr id="tr_popup_autoplay">
                      <td class="spider_label_options">
                        <label><?php 
        _e('Lightbox autoplay:', 'bwg_back');
        ?>
 </label>
                      </td>
                      <td>
                        <input type="radio" name="popup_autoplay" id="popup_autoplay_1" value="1" <?php 
        if ($row->popup_autoplay) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_autoplay_1"><?php 
        _e('Yes', 'bwg_back');
        ?>
</label>
                        <input type="radio" name="popup_autoplay" id="popup_autoplay_0" value="0" <?php 
        if (!$row->popup_autoplay) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_autoplay_0"><?php 
        _e('No', 'bwg_back');
        ?>
</label>
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr>
                      <td class="spider_label_options">
                        <label for="popup_interval"><?php 
        _e('Time interval:', 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input type="text" name="popup_interval" id="popup_interval" value="<?php 
        echo $row->popup_interval;
        ?>
" class="spider_int_input" /> sec.
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr>
                      <td class="spider_label_options">
                        <label><?php 
        _e('Enable filmstrip:', 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input disabled="disabled" type="radio" name="popup_enable_filmstrip" id="popup_enable_filmstrip_1" value="1" <?php 
        if ($row->popup_enable_filmstrip) {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_enable_disable('', 'tr_popup_filmstrip_height', 'popup_enable_filmstrip_1')" /><label for="popup_enable_filmstrip_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input disabled="disabled" type="radio" name="popup_enable_filmstrip" id="popup_enable_filmstrip_0" value="0" <?php 
        if (!$row->popup_enable_filmstrip) {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_enable_disable('none', 'tr_popup_filmstrip_height', 'popup_enable_filmstrip_0')" /><label for="popup_enable_filmstrip_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description spider_free_version"><?php 
        _e("This option is disabled in free version.", 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>
                    <tr id="tr_popup_filmstrip_height">
                      <td class="spider_label_options spider_free_version_label">
                        <label for="popup_filmstrip_height"><?php 
        _e("Filmstrip size:", 'bwg_back');
        ?>
</label>
                      </td>
                      <td class="spider_free_version_label">
                        <input disabled="disabled" type="text" name="popup_filmstrip_height" id="popup_filmstrip_height" value="<?php 
        echo $row->popup_filmstrip_height;
        ?>
" class="spider_int_input spider_free_version_label" /> px
                        <div class="spider_description spider_free_version"><?php 
        _e("This option is disabled in free version.", 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>
                    <tr id="tr_popup_hit_counter">
                      <td class="spider_label_options spider_free_version_label">
                        <label><?php 
        _e("Display hit counter:", 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input disabled="disabled" type="radio" name="popup_hit_counter" id="popup_hit_counter_1" value="1" <?php 
        if ($row->popup_hit_counter) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_hit_counter_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input disabled="disabled" type="radio" name="popup_hit_counter" id="popup_hit_counter_0" value="0" <?php 
        if (!$row->popup_hit_counter) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_hit_counter_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description spider_free_version"><?php 
        _e("This option is disabled in free version.", 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>
                    <tr>
                      <td class="spider_label_options">
                        <label> <?php 
        _e("Show Next / Previous buttons:", 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input type="radio" name="autohide_lightbox_navigation" id="autohide_lightbox_navigation_1" value="1" <?php 
        if ($row->autohide_lightbox_navigation) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="autohide_lightbox_navigation_1"><?php 
        _e("On hover", 'bwg_back');
        ?>
</label>
                        <input type="radio" name="autohide_lightbox_navigation" id="autohide_lightbox_navigation_0" value="0" <?php 
        if (!$row->autohide_lightbox_navigation) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="autohide_lightbox_navigation_0"><?php 
        _e("Always", 'bwg_back');
        ?>
</label>
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr>
                      <td class="spider_label_options">
                        <label><?php 
        _e("Enable control buttons:", 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input type="radio" name="popup_enable_ctrl_btn" id="popup_enable_ctrl_btn_1" value="1" <?php 
        if ($row->popup_enable_ctrl_btn) {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_enable_disable('', 'tr_popup_fullscreen', 'popup_enable_ctrl_btn_1');
                                                                                                                                                                                             bwg_enable_disable('', 'tr_popup_info', 'popup_enable_ctrl_btn_1');
                                                                                                                                                                                             bwg_enable_disable('', 'tr_popup_comment', 'popup_enable_ctrl_btn_1');
                                                                                                                                                                                             bwg_enable_disable('', 'tr_popup_facebook', 'popup_enable_ctrl_btn_1');
                                                                                                                                                                                             bwg_enable_disable('', 'tr_popup_twitter', 'popup_enable_ctrl_btn_1');
                                                                                                                                                                                             bwg_enable_disable('', 'tr_popup_google', 'popup_enable_ctrl_btn_1');
                                                                                                                                                                                             bwg_enable_disable('', 'tr_popup_pinterest', 'popup_enable_ctrl_btn_1');
                                                                                                                                                                                             bwg_enable_disable('', 'tr_popup_tumblr', 'popup_enable_ctrl_btn_1');
                                                                                                                                                                                             bwg_enable_disable('', 'tr_comment_moderation', 'comment_moderation_1');
                                                                                                                                                                                             bwg_enable_disable('', 'tr_popup_email', 'popup_enable_ctrl_btn_1');
                                                                                                                                                                                             bwg_enable_disable('', 'tr_popup_captcha', 'popup_enable_ctrl_btn_1');
                                                                                                                                                                                             bwg_enable_disable('', 'tr_popup_download', 'popup_enable_ctrl_btn_1');
                                                                                                                                                                                             bwg_enable_disable('', 'tr_popup_fullsize_image', 'popup_enable_ctrl_btn_1');" /><label for="popup_enable_ctrl_btn_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input type="radio" name="popup_enable_ctrl_btn" id="popup_enable_ctrl_btn_0" value="0" <?php 
        if (!$row->popup_enable_ctrl_btn) {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_enable_disable('none', 'tr_popup_fullscreen', 'popup_enable_ctrl_btn_0');
                                                                                                                                                                                             bwg_enable_disable('none', 'tr_popup_info', 'popup_enable_ctrl_btn_0');
                                                                                                                                                                                             bwg_enable_disable('none', 'tr_popup_comment', 'popup_enable_ctrl_btn_0');
                                                                                                                                                                                             bwg_enable_disable('none', 'tr_popup_facebook', 'popup_enable_ctrl_btn_0');
                                                                                                                                                                                             bwg_enable_disable('none', 'tr_popup_twitter', 'popup_enable_ctrl_btn_0');
                                                                                                                                                                                             bwg_enable_disable('none', 'tr_popup_google', 'popup_enable_ctrl_btn_0');
                                                                                                                                                                                             bwg_enable_disable('none', 'tr_popup_pinterest', 'popup_enable_ctrl_btn_0');
                                                                                                                                                                                             bwg_enable_disable('none', 'tr_popup_tumblr', 'popup_enable_ctrl_btn_0');
                                                                                                                                                                                             bwg_enable_disable('none', 'tr_comment_moderation', 'comment_moderation_0');
                                                                                                                                                                                             bwg_enable_disable('none', 'tr_popup_email', 'popup_enable_ctrl_btn_0');
                                                                                                                                                                                             bwg_enable_disable('none', 'tr_popup_captcha', 'popup_enable_ctrl_btn_0');
                                                                                                                                                                                             bwg_enable_disable('none', 'tr_popup_download', 'popup_enable_ctrl_btn_0');
                                                                                                                                                                                             bwg_enable_disable('none', 'tr_popup_fullsize_image', 'popup_enable_ctrl_btn_0');" /><label for="popup_enable_ctrl_btn_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr id="tr_popup_fullscreen">
                      <td class="spider_label_options">
                        <label><?php 
        _e("Enable fullscreen:", 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input type="radio" name="popup_enable_fullscreen" id="popup_enable_fullscreen_1" value="1" <?php 
        if ($row->popup_enable_fullscreen) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_enable_fullscreen_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input type="radio" name="popup_enable_fullscreen" id="popup_enable_fullscreen_0" value="0" <?php 
        if (!$row->popup_enable_fullscreen) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_enable_fullscreen_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr id="tr_popup_info">
                      <td class="spider_label_options">
                        <label><?php 
        _e("Enable info:", 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input type="radio" name="popup_enable_info" id="popup_enable_info_1" value="1" <?php 
        if ($row->popup_enable_info) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_enable_info_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input type="radio" name="popup_enable_info" id="popup_enable_info_0" value="0" <?php 
        if (!$row->popup_enable_info) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_enable_info_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr id="tr_popup_info_always_show">
                      <td class="spider_label_options">
                        <label><?php 
        _e("Display info by default:", 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input type="radio" name="popup_info_always_show" id="popup_info_always_show_1" value="1" <?php 
        if ($row->popup_info_always_show) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_info_always_show_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input type="radio" name="popup_info_always_show" id="popup_info_always_show_0" value="0" <?php 
        if (!$row->popup_info_always_show) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_info_always_show_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr id="tr_popup_info_full_width">
                      <td class="spider_label_options">
                        <label><?php 
        _e("Full width info:", 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input type="radio" name="popup_info_full_width" id="popup_info_full_width_1" value="1" <?php 
        if ($row->popup_info_full_width) {
            echo 'checked="checked"';
        }
        ?>
  /><label for="popup_info_full_width_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input type="radio" name="popup_info_full_width" id="popup_info_full_width_0" value="0" <?php 
        if (!$row->popup_info_full_width) {
            echo 'checked="checked"';
        }
        ?>
  /><label for="popup_info_full_width_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description"><?php 
        _e("Display image information based on the lightbox dimensions.", 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>
                  </tbody>
                </table>
              </td>
              <td style="width: 50%; vertical-align: top;">
                <table style="display: inline-table;">
                  <tbody>
                    <tr id="tr_popup_rate">
                      <td class="spider_label_options spider_free_version_label">
                        <label><?php 
        _e("Enable rating:", 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input disabled="disabled" type="radio" name="popup_enable_rate" id="popup_enable_rate_1" value="1" <?php 
        if ($row->popup_enable_rate) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_enable_rate_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input disabled="disabled" type="radio" name="popup_enable_rate" id="popup_enable_rate_0" value="0" <?php 
        if (!$row->popup_enable_rate) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_enable_rate_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description spider_free_version"><?php 
        _e("This option is disabled in free version.", 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>
                    <tr id="tr_popup_comment">
                      <td class="spider_label_options spider_free_version_label">
                        <label><?php 
        _e("Enable comments:", 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input disabled="disabled" type="radio" name="popup_enable_comment" id="popup_enable_comment_1" value="1" <?php 
        if ($row->popup_enable_comment) {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_enable_disable('', 'tr_comment_moderation', 'popup_enable_comment_1');
                                                                                                                                                                                          bwg_enable_disable('', 'tr_popup_email', 'popup_enable_comment_1');
                                                                                                                                                                                          bwg_enable_disable('', 'tr_popup_captcha', 'popup_enable_comment_1');" /><label for="popup_enable_comment_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input disabled="disabled" type="radio" name="popup_enable_comment" id="popup_enable_comment_0" value="0" <?php 
        if (!$row->popup_enable_comment) {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_enable_disable('none', 'tr_comment_moderation', 'popup_enable_comment_0');
                                                                                                                                                                                           bwg_enable_disable('none', 'tr_popup_email', 'popup_enable_comment_0');
                                                                                                                                                                                            bwg_enable_disable('none', 'tr_popup_captcha', 'popup_enable_comment_0');" /><label for="popup_enable_comment_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description spider_free_version"><?php 
        _e("This option is disabled in free version.", 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>
                    <tr id="tr_comment_moderation">
                      <td class="spider_label_options spider_free_version_label">
                        <label><?php 
        _e("Enable comments moderation:", 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input disabled="disabled" type="radio" name="comment_moderation" id="comment_moderation_1" value="1" <?php 
        if ($row->comment_moderation) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="comment_moderation_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input disabled="disabled" type="radio" name="comment_moderation" id="comment_moderation_0" value="0" <?php 
        if (!$row->comment_moderation) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="comment_moderation_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description spider_free_version"><?php 
        _e("This option is disabled in free version.", 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>
                    <tr id="tr_popup_email">
                      <td class="spider_label_options spider_free_version_label">
                        <label><?php 
        _e("Enable Email for comments:", 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input disabled="disabled" type="radio" name="popup_enable_email" id="popup_enable_email_1" value="1" <?php 
        if ($row->popup_enable_email) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_enable_email_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input disabled="disabled" type="radio" name="popup_enable_email" id="popup_enable_email_0" value="0" <?php 
        if (!$row->popup_enable_email) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_enable_email_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description spider_free_version"><?php 
        _e("This option is disabled in free version.", 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>
                    <tr id="tr_popup_captcha">
                      <td class="spider_label_options spider_free_version_label">
                        <label><?php 
        _e("Enable Captcha for comments:", 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input disabled="disabled" type="radio" name="popup_enable_captcha" id="popup_enable_captcha_1" value="1" <?php 
        if ($row->popup_enable_captcha) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_enable_captcha_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input disabled="disabled" type="radio" name="popup_enable_captcha" id="popup_enable_captcha_0" value="0" <?php 
        if (!$row->popup_enable_captcha) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_enable_captcha_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description spider_free_version"><?php 
        _e("This option is disabled in free version.", 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>
                    <tr id="tr_popup_fullsize_image">
                      <td class="spider_label_options">
                        <label><?php 
        _e("Enable original image display button:", 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input type="radio" name="popup_enable_fullsize_image" id="popup_enable_fullsize_image_1" value="1" <?php 
        if ($row->popup_enable_fullsize_image) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_enable_fullsize_image_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input type="radio" name="popup_enable_fullsize_image" id="popup_enable_fullsize_image_0" value="0" <?php 
        if (!$row->popup_enable_fullsize_image) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_enable_fullsize_image_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr id="tr_popup_download">
                      <td class="spider_label_options">
                        <label><?php 
        _e("Enable download button:", 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input type="radio" name="popup_enable_download" id="popup_enable_download_1" value="1" <?php 
        if ($row->popup_enable_download) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_enable_download_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input type="radio" name="popup_enable_download" id="popup_enable_download_0" value="0" <?php 
        if (!$row->popup_enable_download) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_enable_download_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr id="tr_popup_facebook">
                      <td class="spider_label_options spider_free_version_label">
                        <label><?php 
        _e("Enable Facebook button:", 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input disabled="disabled" type="radio" name="popup_enable_facebook" id="popup_enable_facebook_1" value="1" <?php 
        if ($row->popup_enable_facebook) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_enable_facebook_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input disabled="disabled" type="radio" name="popup_enable_facebook" id="popup_enable_facebook_0" value="0" <?php 
        if (!$row->popup_enable_facebook) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_enable_facebook_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description spider_free_version"><?php 
        _e("This option is disabled in free version.", 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>
                    <tr id="tr_popup_twitter">
                      <td class="spider_label_options spider_free_version_label">
                        <label><?php 
        _e("Enable Twitter button:", 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input disabled="disabled" type="radio" name="popup_enable_twitter" id="popup_enable_facebook_1" value="1" <?php 
        if ($row->popup_enable_twitter) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_enable_twitter_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input disabled="disabled" type="radio" name="popup_enable_twitter" id="popup_enable_facebook_0" value="0" <?php 
        if (!$row->popup_enable_twitter) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_enable_twitter_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description spider_free_version"><?php 
        _e("This option is disabled in free version.", 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>
                    <tr id="tr_popup_google">
                      <td class="spider_label_options spider_free_version_label">
                        <label><?php 
        _e("Enable Google+ button:", 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input disabled="disabled" type="radio" name="popup_enable_google" id="popup_enable_google_1" value="1" <?php 
        if ($row->popup_enable_google) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_enable_google_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input disabled="disabled" type="radio" name="popup_enable_google" id="popup_enable_google_0" value="0" <?php 
        if (!$row->popup_enable_google) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_enable_google_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description spider_free_version"><?php 
        _e("This option is disabled in free version.", 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>
                    <tr id="tr_popup_pinterest">
                      <td class="spider_label_options spider_free_version_label">
                        <label><?php 
        _e("Enable Pinterest button:", 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input disabled="disabled" type="radio" name="popup_enable_pinterest" id="popup_enable_pinterest_1" value="1" <?php 
        if ($row->popup_enable_pinterest) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_enable_pinterest_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input disabled="disabled" type="radio" name="popup_enable_pinterest" id="popup_enable_pinterest_0" value="0" <?php 
        if (!$row->popup_enable_pinterest) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_enable_pinterest_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description spider_free_version"><?php 
        _e("This option is disabled in free version.", 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>
                    <tr id="tr_popup_tumblr">
                      <td class="spider_label_options spider_free_version_label">
                        <label><?php 
        _e("Enable Tumblr button:", 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input disabled="disabled" type="radio" name="popup_enable_tumblr" id="popup_enable_tumblr_1" value="1" <?php 
        if ($row->popup_enable_tumblr) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_enable_tumblr_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input disabled="disabled" type="radio" name="popup_enable_tumblr" id="popup_enable_tumblr_0" value="0" <?php 
        if (!$row->popup_enable_tumblr) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="popup_enable_tumblr_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description spider_free_version"><?php 
        _e("This option is disabled in free version.", 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>
                    <tr id="tr_image_count">
                      <td class="spider_label_options">
                        <label><?php 
        _e("Show images count:", 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input type="radio" name="show_image_counts" id="show_image_counts_current_image_number_1" value="1" <?php 
        if ($row->show_image_counts) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="show_image_counts_current_image_number_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input type="radio" name="show_image_counts" id="show_image_counts_current_image_number_0" value="0" <?php 
        if (!$row->show_image_counts) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="show_image_counts_current_image_number_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr id="tr_image_cycle">
                      <td class="spider_label_options">
                        <label><?php 
        _e("Enable loop:", 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input type="radio" name="enable_loop" id="enable_loop_1" value="1" <?php 
        if ($row->enable_loop) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="enable_loop_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input type="radio" name="enable_loop" id="enable_loop_0" value="0" <?php 
        if (!$row->enable_loop) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="enable_loop_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr>
                      <td class="spider_label_options spider_free_version_label">
                        <label><?php 
        _e("Enable", 'bwg_back');
        ?>
 AddThis:</label>
                      </td>
                      <td>
                        <input disabled="disabled" type="radio" name="enable_addthis" id="enable_addthis_1" value="1" <?php 
        if ($row->enable_addthis) {
            echo 'checked="checked"';
        }
        ?>
 />
                        <label for="enable_addthis_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input disabled="disabled" type="radio" name="enable_addthis" id="enable_addthis_0" value="0" <?php 
        if (!$row->enable_addthis) {
            echo 'checked="checked"';
        }
        ?>
 />
                        <label for="enable_addthis_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description spider_free_version"><?php 
        _e("This option is disabled in free version.", 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>
                  </tbody>
                </table>
              </td>
            </tr>
          </table>
        </div>

        <!--Album options-->
        <div class="spider_div_options" id="div_content_4">        
          <table>
            <tbody>
              <tr>
                <td class="spider_label_options">
                  <label for="album_column_number"><?php 
        _e("Number of album columns:", 'bwg_back');
        ?>
 </label>
                </td>
                <td>
                  <input type="text" name="album_column_number" id="album_column_number" value="<?php 
        echo $row->album_column_number;
        ?>
" class="spider_int_input" />
                  <div class="spider_description"></div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options">
                  <label for="albums_per_page"><?php 
        _e("Albums per page:", 'bwg_back');
        ?>
 </label>
                </td>
                <td>
                  <input type="text" name="albums_per_page" id="albums_per_page" value="<?php 
        echo $row->albums_per_page;
        ?>
" class="spider_int_input" />
                  <div class="spider_description"></div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options">
                  <label><?php 
        _e("Enable pagination:", 'bwg_back');
        ?>
</label>
                </td>
                <td>
                  <input type="radio" name="album_enable_page" id="album_enable_page_1" value="1" <?php 
        if ($row->album_enable_page) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="album_enable_page_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                  <input type="radio" name="album_enable_page" id="album_enable_page_0" value="0" <?php 
        if (!$row->album_enable_page) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="album_enable_page_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                  <div class="spider_description"></div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options">
                  <label><?php 
        _e("Album view type:", 'bwg_back');
        ?>
</label>
                </td>
                <td>
                  <input disabled="disabled" type="radio" name="album_view_type" id="album_view_type_1" value="thumbnail" <?php 
        if ($row->album_view_type == "thumbnail") {
            echo 'checked="checked"';
        }
        ?>
 /><label for="album_view_type_1"><?php 
        _e("Thumbnail", 'bwg_back');
        ?>
</label>
                  <input disabled="disabled" type="radio" name="album_view_type" id="album_view_type_0" value="masonry" <?php 
        if ($row->album_view_type == "masonry") {
            echo 'checked="checked"';
        }
        ?>
 /><label for="album_view_type_0"><?php 
        _e("Masonry", 'bwg_back');
        ?>
</label>
                  <div class="spider_description spider_free_version"><?php 
        _e("This option is disabled in free version.", 'bwg_back');
        ?>
</div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options">
                  <label><?php 
        _e("Show title:", 'bwg_back');
        ?>
</label>
                </td>
                <td>
                  <input type="radio" name="album_title_show_hover" id="album_title_show_hover_1" value="hover" <?php 
        if ($row->album_title_show_hover == "hover") {
            echo 'checked="checked"';
        }
        ?>
 /><label for="album_title_show_hover_1"><?php 
        _e("Show on hover", 'bwg_back');
        ?>
</label><br />
                  <input type="radio" name="album_title_show_hover" id="album_title_show_hover_0" value="show" <?php 
        if ($row->album_title_show_hover == "show") {
            echo 'checked="checked"';
        }
        ?>
 /><label for="album_title_show_hover_0"><?php 
        _e("Always show", 'bwg_back');
        ?>
</label><br />
                  <input type="radio" name="album_title_show_hover" id="album_title_show_hover_2" value="none" <?php 
        if ($row->album_title_show_hover == "none") {
            echo 'checked="checked"';
        }
        ?>
 /><label for="album_title_show_hover_2"><?php 
        _e("Don't show", 'bwg_back');
        ?>
</label>
                  <div class="spider_description"></div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options">
                  <label><?php 
        _e("Show album/gallery name:", 'bwg_back');
        ?>
</label>
                </td>
                <td>
                  <input type="radio" name="show_album_name_enable" id="show_album_name_enable_1" value="1" <?php 
        if ($row->show_album_name) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="show_album_name_enable_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                  <input type="radio" name="show_album_name_enable" id="show_album_name_enable_0" value="0" <?php 
        if (!$row->show_album_name) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="show_album_name_enable_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                  <div class="spider_description"></div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options">
                  <label><?php 
        _e("Enable extended album description:", 'bwg_back');
        ?>
</label>
                </td>
                <td>
                  <input type="radio" name="extended_album_description_enable" id="extended_album_description_enable_1" value="1" <?php 
        if ($row->extended_album_description_enable) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="extended_album_description_enable_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                  <input type="radio" name="extended_album_description_enable" id="extended_album_description_enable_0" value="0" <?php 
        if (!$row->extended_album_description_enable) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="extended_album_description_enable_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                  <div class="spider_description"></div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options">
                  <label for="album_thumb_width"><?php 
        _e("Album thumbnail dimensions:", 'bwg_back');
        ?>
 </label>
                </td>
                <td>
                  <input type="text" name="album_thumb_width" id="album_thumb_width" value="<?php 
        echo $row->album_thumb_width;
        ?>
" class="spider_int_input" /> x 
                  <input type="text" name="album_thumb_height" id="album_thumb_height" value="<?php 
        echo $row->album_thumb_height;
        ?>
" class="spider_int_input" /> px
                  <div class="spider_description"></div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options">
                  <label for="extended_album_height"><?php 
        _e("Extended album height:", 'bwg_back');
        ?>
 </label>
                </td>
                <td>
                  <input type="text" name="extended_album_height" id="extended_album_height" value="<?php 
        echo $row->extended_album_height;
        ?>
" class="spider_int_input" /> px
                  <div class="spider_description"></div>
                </td>
              </tr>
            </tbody>
          </table>
        </div>

        <!--Slideshow-->
        <div class="spider_div_options" id="div_content_5">
          <table style="width: 100%;">
            <tr>
              <td style="width: 50%; vertical-align: top;">
                <table style="display: inline-table;">
                  <tbody>
                    <tr>
                      <td class="spider_label_options">
                        <label for="slideshow_type"><?php 
        _e("Slideshow effect:", 'bwg_back');
        ?>
 </label>
                      </td>
                      <td>
                        <select name="slideshow_type" id="slideshow_type" style="width:150px;">
                          <?php 
        foreach ($effects as $key => $effect) {
            ?>
                            <option value="<?php 
            echo $key;
            ?>
" <?php 
            echo $key != 'none' && $key != 'fade' ? 'disabled="disabled" title="This effect is disabled in free version."' : '';
            ?>
 <?php 
            if ($row->slideshow_type == $key) {
                echo 'selected="selected"';
            }
            ?>
><?php 
            echo $effect;
            ?>
</option>
                            <?php 
        }
        ?>
                        </select>
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr>
                      <td class="spider_label_options">
                        <label for="slideshow_interval"><?php 
        _e("Time interval:", 'bwg_back');
        ?>
 </label>
                      </td>
                      <td>
                        <input type="text" name="slideshow_interval" id="slideshow_interval" value="<?php 
        echo $row->slideshow_interval;
        ?>
" class="spider_int_input" /> sec.
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr>
                      <td class="spider_label_options">
                        <label for="slideshow_width"><?php 
        _e("Slideshow dimensions:", 'bwg_back');
        ?>
 </label>
                      </td>
                      <td>
                        <input type="text" name="slideshow_width" id="slideshow_width" value="<?php 
        echo $row->slideshow_width;
        ?>
" class="spider_int_input" /> x 
                        <input type="text" name="slideshow_height" id="slideshow_height" value="<?php 
        echo $row->slideshow_height;
        ?>
" class="spider_int_input" /> px
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr>
                      <td class="spider_label_options">
                        <label><?php 
        _e("Enable autoplay:", 'bwg_back');
        ?>
 </label>
                      </td>
                      <td>
                        <input type="radio" name="slideshow_enable_autoplay" id="slideshow_enable_autoplay_yes" value="1" <?php 
        if ($row->slideshow_enable_autoplay) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="slideshow_enable_autoplay_yes"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input type="radio" name="slideshow_enable_autoplay" id="slideshow_enable_autoplay_no" value="0" <?php 
        if (!$row->slideshow_enable_autoplay) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="slideshow_enable_autoplay_no"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr>
                      <td class="spider_label_options">
                        <label><?php 
        _e("Enable shuffle:", 'bwg_back');
        ?>
 </label>
                      </td>
                      <td>
                        <input type="radio" name="slideshow_enable_shuffle" id="slideshow_enable_shuffle_yes" value="1" <?php 
        if ($row->slideshow_enable_shuffle) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="slideshow_enable_shuffle_yes"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input type="radio" name="slideshow_enable_shuffle" id="slideshow_enable_shuffle_no" value="0" <?php 
        if (!$row->slideshow_enable_shuffle) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="slideshow_enable_shuffle_no"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr>
                      <td class="spider_label_options">
                        <label> <?php 
        _e("Show Next / Previous buttons:", 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input type="radio" name="autohide_slideshow_navigation" id="autohide_slideshow_navigation_1" value="1" <?php 
        if ($row->autohide_slideshow_navigation) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="autohide_slideshow_navigation_1"><?php 
        _e("On hover", 'bwg_back');
        ?>
</label>
                        <input type="radio" name="autohide_slideshow_navigation" id="autohide_slideshow_navigation_0" value="0" <?php 
        if (!$row->autohide_slideshow_navigation) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="autohide_slideshow_navigation_0"><?php 
        _e("Always", 'bwg_back');
        ?>
</label>
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr>
                      <td class="spider_label_options">
                        <label><?php 
        _e("Enable control buttons:", 'bwg_back');
        ?>
 </label>
                      </td>
                      <td>
                        <input type="radio" name="slideshow_enable_ctrl" id="slideshow_enable_ctrl_yes" value="1" <?php 
        if ($row->slideshow_enable_ctrl) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="slideshow_enable_ctrl_yes"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input type="radio" name="slideshow_enable_ctrl" id="slideshow_enable_ctrl_no" value="0" <?php 
        if (!$row->slideshow_enable_ctrl) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="slideshow_enable_ctrl_no"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr>
                      <td class="spider_label_options spider_free_version_label"><label><?php 
        _e("Enable slideshow filmstrip:", 'bwg_back');
        ?>
 </label></td>
                      <td>
                        <input disabled="disabled" type="radio" name="slideshow_enable_filmstrip" id="slideshow_enable_filmstrip_yes" value="1" <?php 
        if ($row->slideshow_enable_filmstrip) {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_enable_disable('', 'tr_slideshow_filmstrip_height', 'slideshow_enable_filmstrip_yes')" /><label for="slideshow_enable_filmstrip_yes"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input disabled="disabled" type="radio" name="slideshow_enable_filmstrip" id="slideshow_enable_filmstrip_no" value="0" <?php 
        if (!$row->slideshow_enable_filmstrip) {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_enable_disable('none', 'tr_slideshow_filmstrip_height', 'slideshow_enable_filmstrip_no')" /><label for="slideshow_enable_filmstrip_no"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description spider_free_version"><?php 
        _e("This option is disabled in free version.", 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>
                    <tr id="tr_slideshow_filmstrip_height">
                      <td class="spider_label_options spider_free_version_label"><label for="slideshow_filmstrip_height"><?php 
        _e("Slideshow filmstrip size:", 'bwg_back');
        ?>
 </label></td>
                      <td class="spider_free_version_label">
                        <input disabled="disabled" type="text" name="slideshow_filmstrip_height" id="slideshow_filmstrip_height" value="<?php 
        echo $row->slideshow_filmstrip_height;
        ?>
" class="spider_int_input spider_free_version_label" /> px
                        <div class="spider_description spider_free_version"><?php 
        _e("This option is disabled in free version.", 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>
                  </tbody>
                </table>
              </td>
              <td style="width: 50%; vertical-align: top;">
                <table style="width: 100%; display: inline-table;">
                  <tbody>
                    <tr>
                      <td class="spider_label_options"><label><?php 
        _e("Enable image title:", 'bwg_back');
        ?>
 </label></td>
                      <td>
                        <input type="radio" name="slideshow_enable_title" id="slideshow_enable_title_yes" value="1" <?php 
        if ($row->slideshow_enable_title) {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_enable_disable('', 'tr_slideshow_title_position', 'slideshow_enable_title_yes')" /><label for="slideshow_enable_title_yes"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input type="radio" name="slideshow_enable_title" id="slideshow_enable_title_no" value="0" <?php 
        if (!$row->slideshow_enable_title) {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_enable_disable('none', 'tr_slideshow_title_position', 'slideshow_enable_title_no')" /><label for="slideshow_enable_title_no"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr id="tr_slideshow_title_position">
                      <td class="spider_label_options"><label><?php 
        _e("Title position:", 'bwg_back');
        ?>
 </label></td>
                      <td>
                        <table class="bwg_position_table">
                          <tbody>
                            <tr>
                              <td><input type="radio" value="top-left" id="slideshow_title_topLeft" name="slideshow_title_position" <?php 
        if ($row->slideshow_title_position == "top-left") {
            echo 'checked="checked"';
        }
        ?>
></td>
                              <td><input type="radio" value="top-center" id="slideshow_title_topCenter" name="slideshow_title_position" <?php 
        if ($row->slideshow_title_position == "top-center") {
            echo 'checked="checked"';
        }
        ?>
></td>
                              <td><input type="radio" value="top-right" id="slideshow_title_topRight" name="slideshow_title_position" <?php 
        if ($row->slideshow_title_position == "top-right") {
            echo 'checked="checked"';
        }
        ?>
></td>
                            </tr>
                            <tr>
                              <td><input type="radio" value="middle-left" id="slideshow_title_midLeft" name="slideshow_title_position" <?php 
        if ($row->slideshow_title_position == "middle-left") {
            echo 'checked="checked"';
        }
        ?>
></td>
                              <td><input type="radio" value="middle-center" id="slideshow_title_midCenter" name="slideshow_title_position" <?php 
        if ($row->slideshow_title_position == "middle-center") {
            echo 'checked="checked"';
        }
        ?>
></td>
                              <td><input type="radio" value="middle-right" id="slideshow_title_midRight" name="slideshow_title_position" <?php 
        if ($row->slideshow_title_position == "middle-right") {
            echo 'checked="checked"';
        }
        ?>
></td>
                            </tr>
                            <tr>
                              <td><input type="radio" value="bottom-left" id="slideshow_title_botLeft" name="slideshow_title_position" <?php 
        if ($row->slideshow_title_position == "bottom-left") {
            echo 'checked="checked"';
        }
        ?>
></td>
                              <td><input type="radio" value="bottom-center" id="slideshow_title_botCenter" name="slideshow_title_position" <?php 
        if ($row->slideshow_title_position == "bottom-center") {
            echo 'checked="checked"';
        }
        ?>
></td>
                              <td><input type="radio" value="bottom-right" id="slideshow_title_botRight" name="slideshow_title_position" <?php 
        if ($row->slideshow_title_position == "bottom-right") {
            echo 'checked="checked"';
        }
        ?>
></td>
                            </tr>
                          </tbody>
                        </table>
                        <div class="spider_description"><?php 
        _e("Image title position on slideshow", 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>
                    <tr id="tr_slideshow_full_width_title">
                      <td class="spider_label_options">
                        <label><?php 
        _e("Full width title:", 'bwg_back');
        ?>
</label>
                      </td>
                      <td>
                        <input type="radio" name="slideshow_title_full_width" id="slideshow_title_full_width_1" value="1" <?php 
        if ($row->slideshow_title_full_width) {
            echo 'checked="checked"';
        }
        ?>
  /><label for="slideshow_title_full_width_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input type="radio" name="slideshow_title_full_width" id="slideshow_title_full_width_0" value="0" <?php 
        if (!$row->slideshow_title_full_width) {
            echo 'checked="checked"';
        }
        ?>
  /><label for="slideshow_title_full_width_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description"><?php 
        _e("Display image title based on the slideshow dimensions.", 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>
                    <tr>
                      <td class="spider_label_options"><label><?php 
        _e("Enable image description: ", 'bwg_back');
        ?>
</label></td>
                      <td>
                        <input type="radio" name="slideshow_enable_description" id="slideshow_enable_description_yes" value="1" <?php 
        if ($row->slideshow_enable_description) {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_enable_disable('', 'tr_slideshow_description_position', 'slideshow_enable_description_yes')" /><label for="slideshow_enable_description_yes"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input type="radio" name="slideshow_enable_description" id="slideshow_enable_description_no" value="0" <?php 
        if (!$row->slideshow_enable_description) {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_enable_disable('none', 'tr_slideshow_description_position', 'slideshow_enable_description_no')" /><label for="slideshow_enable_description_no"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr id="tr_slideshow_description_position">
                      <td class="spider_label"><label><?php 
        _e("Description position:", 'bwg_back');
        ?>
 </label></td>
                      <td>
                        <table class="bwg_position_table">
                          <tbody>
                            <tr>
                              <td><input type="radio" value="top-left" id="slideshow_description_topLeft" name="slideshow_description_position" <?php 
        if ($row->slideshow_description_position == "top-left") {
            echo 'checked="checked"';
        }
        ?>
></td>
                              <td><input type="radio" value="top-center" id="slideshow_description_topCenter" name="slideshow_description_position" <?php 
        if ($row->slideshow_description_position == "top-center") {
            echo 'checked="checked"';
        }
        ?>
></td>
                              <td><input type="radio" value="top-right" id="slideshow_description_topRight" name="slideshow_description_position" <?php 
        if ($row->slideshow_description_position == "top-right") {
            echo 'checked="checked"';
        }
        ?>
></td>
                            </tr>
                            <tr>
                              <td><input type="radio" value="middle-left" id="slideshow_description_midLeft" name="slideshow_description_position" <?php 
        if ($row->slideshow_description_position == "middle-left") {
            echo 'checked="checked"';
        }
        ?>
></td>
                              <td><input type="radio" value="middle-center" id="slideshow_description_midCenter" name="slideshow_description_position" <?php 
        if ($row->slideshow_description_position == "middle-center") {
            echo 'checked="checked"';
        }
        ?>
></td>
                              <td><input type="radio" value="middle-right" id="slideshow_description_midRight" name="slideshow_description_position" <?php 
        if ($row->slideshow_description_position == "middle-right") {
            echo 'checked="checked"';
        }
        ?>
></td>
                            </tr>
                            <tr>
                              <td><input type="radio" value="bottom-left" id="slideshow_description_botLeft" name="slideshow_description_position" <?php 
        if ($row->slideshow_description_position == "bottom-left") {
            echo 'checked="checked"';
        }
        ?>
></td>
                              <td><input type="radio" value="bottom-center" id="slideshow_description_botCenter" name="slideshow_description_position" <?php 
        if ($row->slideshow_description_position == "bottom-center") {
            echo 'checked="checked"';
        }
        ?>
></td>
                              <td><input type="radio" value="bottom-right" id="slideshow_description_botRight" name="slideshow_description_position" <?php 
        if ($row->slideshow_description_position == "bottom-right") {
            echo 'checked="checked"';
        }
        ?>
></td>
                            </tr>
                          </tbody>
                        </table>
                        <div class="spider_description"><?php 
        _e("Image description position on slideshow", 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>
                    <tr>
                      <td class="spider_label_options">
                        <label><?php 
        _e("Enable slideshow Music:", 'bwg_back');
        ?>
 </label>
                      </td>
                      <td>
                        <input type="radio" name="slideshow_enable_music" id="slideshow_enable_music_yes" value="1" <?php 
        if ($row->slideshow_enable_music) {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_enable_disable('', 'tr_slideshow_music_url', 'slideshow_enable_music_yes')" /><label for="slideshow_enable_music_yes"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input type="radio" name="slideshow_enable_music" id="slideshow_enable_music_no" value="0" <?php 
        if (!$row->slideshow_enable_music) {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_enable_disable('none', 'tr_slideshow_music_url', 'slideshow_enable_music_no')"  /><label for="slideshow_enable_music_no"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr id="tr_slideshow_music_url">
                      <td class="spider_label_options">
                        <label for="slideshow_audio_url"><?php 
        _e("Music url:", 'bwg_back');
        ?>
 </label>
                      </td>
                      <td>
                        <input type="text" id="slideshow_audio_url" name="slideshow_audio_url" style="width: 70%;" value="<?php 
        echo $row->slideshow_audio_url;
        ?>
" style="display:inline-block;" />
                        <?php 
        $query_url = add_query_arg(array('action' => 'addMusic', 'width' => '700', 'height' => '550', 'extensions' => 'aac,m4a,f4a,mp3,ogg,oga', 'callback' => 'bwg_add_music'), admin_url('admin-ajax.php'));
        $query_url = wp_nonce_url($query_url, 'addMusic', 'bwg_nonce');
        $query_url = add_query_arg(array('TB_iframe' => '1'), $query_url);
        ?>
                        <a href="<?php 
        echo $query_url;
        ?>
" id="button_add_music" class="button-primary thickbox thickbox-preview"
                           title="Add music"
                           onclick="return false;"
                           style="margin-bottom:5px;">
                          <?php 
        _e("Add Music", 'bwg_back');
        ?>
                        </a>
                        <div class="spider_description"><?php 
        _e("Only", 'bwg_back');
        ?>
 .aac,.m4a,.f4a,.mp3,.ogg,.oga <?php 
        _e("formats are supported.", 'bwg_back');
        ?>
</div>
                      </td>
                    </tr>
                  </tbody>
                </table>
              </td>
            </tr>
          </table>
        </div>

        <!--Thumbnail options-->
        <div class="spider_div_options" id="div_content_6">        
          <table>
            <tbody>
              <tr style="display:none;">
                <td class="spider_label_options">
                  <label><?php 
        _e("Masonry:", 'bwg_back');
        ?>
</label>
                </td>
                <td>
                  <input type="radio" name="masonry" id="masonry_1" value="horizontal" <?php 
        if ($row->masonry == "horizontal") {
            echo 'checked="checked"';
        }
        ?>
 /><label for="masonry_1"><?php 
        _e("Horizontal", 'bwg_back');
        ?>
</label>
                  <input type="radio" name="masonry" id="masonry_0" value="vertical" <?php 
        if ($row->masonry == "vertical") {
            echo 'checked="checked"';
        }
        ?>
 /><label for="masonry_0"><?php 
        _e("Vertical", 'bwg_back');
        ?>
</label>
                  <div class="spider_description"></div>
                </td>
              </tr>
	      <tr style="display:none;">
                <td class="spider_label_options">
                  <label><?php 
        _e("Mosaic:", 'bwg_back');
        ?>
</label>
                </td>
                <td>
                  <input type="radio" name="mosaic" id="mosaic_0" value="vertical" <?php 
        if ($row->mosaic == "vertical") {
            echo 'checked="checked"';
        }
        ?>
 /><label for="mosaic_0"><?php 
        _e("Vertical", 'bwg_back');
        ?>
</label>
                  <input type="radio" name="mosaic" id="mosaic_1" value="horizontal" <?php 
        if ($row->mosaic == "horizontal") {
            echo 'checked="checked"';
        }
        ?>
 /><label for="mosaic_1"><?php 
        _e("Horizontal", 'bwg_back');
        ?>
</label>
                  <div class="spider_description"></div>
                </td>
              </tr>
              <tr style="display:none;">
                <td class="spider_label_options">
                  <label><?php 
        _e("Resizable mosaic:", 'bwg_back');
        ?>
</label>
                </td>
                <td>
                  <input type="radio" name="resizable_mosaic" id="resizable_mosaic_0" value="0" <?php 
        if ($row->resizable_mosaic == "0") {
            echo 'checked="checked"';
        }
        ?>
 /><label for="resizable_mosaic_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                  <input type="radio" name="resizable_mosaic" id="resizable_mosaic_1" value="1" <?php 
        if ($row->resizable_mosaic == "1") {
            echo 'checked="checked"';
        }
        ?>
 /><label for="resizable_mosaic_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                  <div class="spider_description"></div>
                </td>
              </tr>
              <tr style="display:none;">
                <td class="spider_label_options">
                  <label for="mosaic_total_width"><?php 
        _e("Total width of mosaic:", 'bwg_back');
        ?>
 </label>
                </td>
                <td>
                  <input type="text" name="mosaic_total_width" id="mosaic_total_width" value="<?php 
        echo $row->mosaic_total_width;
        ?>
" class="spider_int_input" /> %
                  <div class="spider_description"><?php 
        _e("Width of mosaic as a percentage of container's width.", 'bwg_back');
        ?>
</div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options">
                  <label for="image_column_number"><?php 
        _e("Number of image columns:", 'bwg_back');
        ?>
 </label>
                </td>
                <td>
                  <input type="text" name="image_column_number" id="image_column_number" value="<?php 
        echo $row->image_column_number;
        ?>
" class="spider_int_input" />
                  <div class="spider_description"></div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options">
                  <label for="images_per_page"><?php 
        _e("Images per page:", 'bwg_back');
        ?>
 </label>
                </td>
                <td>
                  <input type="text" name="images_per_page" id="images_per_page" value="<?php 
        echo $row->images_per_page;
        ?>
" class="spider_int_input" />
                  <div class="spider_description"></div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options">
                  <label for="upload_thumb_width"><?php 
        _e("Generated thumbnail dimensions:", 'bwg_back');
        ?>
 </label>
                </td>
                <td>
                  <input type="text" name="upload_thumb_width" id="upload_thumb_width" value="<?php 
        echo $row->upload_thumb_width;
        ?>
" class="spider_int_input" /> x 
                  <input type="text" name="upload_thumb_height" id="upload_thumb_height" value="<?php 
        echo $row->upload_thumb_height;
        ?>
" class="spider_int_input" /> px
                  <div class="spider_description"><?php 
        _e("The maximum size of the generated thumbnail. Its dimensions should be larger than the ones of the frontend thumbnail.", 'bwg_back');
        ?>
</div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options">
                  <label for="thumb_width"><?php 
        _e("Frontend thumbnail dimensions:", 'bwg_back');
        ?>
 </label>
                </td>
                <td>
                  <input type="text" name="thumb_width" id="thumb_width" value="<?php 
        echo $row->thumb_width;
        ?>
" class="spider_int_input" /> x 
                  <input type="text" name="thumb_height" id="thumb_height" value="<?php 
        echo $row->thumb_height;
        ?>
" class="spider_int_input" /> px
                  <div class="spider_description"><?php 
        _e("The default size of the thumbnail which will be displayed in the website", 'bwg_back');
        ?>
</div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options">
                  <label><?php 
        _e("Show image title:", 'bwg_back');
        ?>
</label>
                </td>
                <td>
                  <input type="radio" name="image_title_show_hover" id="image_title_show_hover_1" value="hover" <?php 
        if ($row->image_title_show_hover == "hover") {
            echo 'checked="checked"';
        }
        ?>
 /><label for="image_title_show_hover_1"><?php 
        _e("Show on hover", 'bwg_back');
        ?>
</label><br />
                  <input type="radio" name="image_title_show_hover" id="image_title_show_hover_0" value="show" <?php 
        if ($row->image_title_show_hover == "show") {
            echo 'checked="checked"';
        }
        ?>
 /><label for="image_title_show_hover_0"><?php 
        _e("Always show", 'bwg_back');
        ?>
</label><br />
                  <input type="radio" name="image_title_show_hover" id="image_title_show_hover_2" value="none" <?php 
        if ($row->image_title_show_hover == "none") {
            echo 'checked="checked"';
        }
        ?>
 /><label for="image_title_show_hover_2"><?php 
        _e("Don't show", 'bwg_back');
        ?>
</label>
                  <div class="spider_description"></div>
                </td>
              </tr>
              <tr id="tr_thumb_show_name">
                <td class="spider_label_options"><label><?php 
        _e("Show gallery name:", 'bwg_back');
        ?>
 </label></td>
                <td>
                  <input type="radio" name="thumb_name" id="thumb_name_yes" value="1" <?php 
        if ($row->showthumbs_name) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="thumb_name_yes"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                  <input type="radio" name="thumb_name" id="thumb_name_no" value="0"  <?php 
        if (!$row->showthumbs_name) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="thumb_name_no"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                  <div class="spider_description"></div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options spider_free_version_label">
                  <label><?php 
        _e("Show description in Vertical Masonry view:", 'bwg_back');
        ?>
 </label>
                </td>
                <td>
                  <input disabled="disabled" type="radio" name="show_masonry_thumb_description" id="masonry_thumb_desc_1" value="1" <?php 
        if ($row->show_masonry_thumb_description) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="masonry_thumb_desc_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                  <input disabled="disabled" type="radio" name="show_masonry_thumb_description" id="masonry_thumb_desc_0" value="0" <?php 
        if (!$row->show_masonry_thumb_description) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="masonry_thumb_desc_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                  <div style="width: 200px;" class="spider_description spider_free_version"><?php 
        _e("This option is disabled in free version.", 'bwg_back');
        ?>
</div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options"><label><?php 
        _e("Enable image pagination:", 'bwg_back');
        ?>
 </label></td>
                <td>
                  <input type="radio" name="image_enable_page" id="image_enable_page_yes" value="1" <?php 
        if ($row->image_enable_page) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="image_enable_page_yes"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                  <input type="radio" name="image_enable_page" id="image_enable_page_no" value="0" <?php 
        if (!$row->image_enable_page) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="image_enable_page_no"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                  <div class="spider_description"></div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options"><label><?php 
        _e("Thumbnail click action:", 'bwg_back');
        ?>
 </label></td>
                <td>
                  <input type="radio" name="thumb_click_action" id="thumb_click_action_1" value="open_lightbox" <?php 
        if ($row->thumb_click_action == 'open_lightbox') {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_enable_disable('none', 'tr_thumb_link_target', 'thumb_click_action_1')" /><label for="thumb_click_action_1"><?php 
        _e("Open lightbox", 'bwg_back');
        ?>
</label>
                  <input type="radio" name="thumb_click_action" id="thumb_click_action_2" value="redirect_to_url" <?php 
        if ($row->thumb_click_action == 'redirect_to_url') {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_enable_disable('', 'tr_thumb_link_target', 'thumb_click_action_2')" /><label for="thumb_click_action_2"><?php 
        _e("Redirect to url", 'bwg_back');
        ?>
</label>
                  <input type="radio" name="thumb_click_action" id="thumb_click_action_3" value="do_nothing" <?php 
        if ($row->thumb_click_action == 'do_nothing') {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_enable_disable('none', 'tr_thumb_link_target', 'thumb_click_action_3')" /><label for="thumb_click_action_3"><?php 
        _e("Do Nothing", 'bwg_back');
        ?>
</label>
                  <div class="spider_description"></div>
                </td>
              </tr>
              <tr id="tr_thumb_link_target">
                <td class="spider_label_options"><label><?php 
        _e("Open in a new window:", 'bwg_back');
        ?>
 </label></td>
                <td>
                  <input type="radio" name="thumb_link_target" id="thumb_link_target_yes" value="1" <?php 
        if ($row->thumb_link_target) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="thumb_link_target_yes"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                  <input type="radio" name="thumb_link_target" id="thumb_link_target_no" value="0" <?php 
        if (!$row->thumb_link_target) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="thumb_link_target_no"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                  <div class="spider_description"></div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options"><label><?php 
        _e("Play icon over the video thumbnail:", 'bwg_back');
        ?>
 </label></td>
                <td>
                  <input type="radio" name="play_icon" id="play_icon_yes" value="1" <?php 
        if ($row->play_icon) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="play_icon_yes"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                  <input type="radio" name="play_icon" id="play_icon_no" value="0" <?php 
        if (!$row->play_icon) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="play_icon_no"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                  <div class="spider_description"></div>
                </td>
              </tr>
            </tbody>
          </table>
        </div>

        <!--Image options-->
        <div class="spider_div_options" id="div_content_7">        
          <table>
            <tbody>
              <tr>
                <td class="spider_label_options">
                  <label><?php 
        _e("Enable image title for Image Browser view:", 'bwg_back');
        ?>
</label>
                </td>
                <td>
                  <input type="radio" name="image_browser_title_enable" id="image_browser_title_enable_1" value="1" <?php 
        if ($row->image_browser_title_enable) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="image_browser_title_enable_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                  <input type="radio" name="image_browser_title_enable" id="image_browser_title_enable_0" value="0" <?php 
        if (!$row->image_browser_title_enable) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="image_browser_title_enable_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                  <div class="spider_description"></div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options">
                  <label><?php 
        _e("Enable image description for Image Browser view:", 'bwg_back');
        ?>
</label>
                </td>
                <td>
                  <input type="radio" name="image_browser_description_enable" id="image_browser_description_enable_1" value="1" <?php 
        if ($row->image_browser_description_enable) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="image_browser_description_enable_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                  <input type="radio" name="image_browser_description_enable" id="image_browser_description_enable_0" value="0" <?php 
        if (!$row->image_browser_description_enable) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="image_browser_description_enable_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                  <div class="spider_description"></div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options">
                  <label for="image_browser_width"><?php 
        _e("Image width for Image Browser view:", 'bwg_back');
        ?>
</label>
                </td>
                <td>
                  <input type="text" name="image_browser_width" id="image_browser_width" value="<?php 
        echo $row->image_browser_width;
        ?>
" class="spider_int_input" /> px
                  <div class="spider_description"></div>
                </td>
              </tr>
              <tr>
                <td colspan="2">
                  <div style="margin: 0;" class="spider_description spider_free_version"><?php 
        _e("The Blog Style view is disabled in free version.", 'bwg_back');
        ?>
</div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options spider_free_version_label">
                  <label><?php 
        _e("Enable image title for Blog Style view:", 'bwg_back');
        ?>
</label>
                </td>
                <td class="spider_free_version_label">
                  <input disabled="disabled" type="radio" name="blog_style_title_enable" id="blog_style_title_enable_1" value="1" <?php 
        if ($row->blog_style_title_enable) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="blog_style_title_enable_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                  <input disabled="disabled" type="radio" name="blog_style_title_enable" id="blog_style_title_enable_0" value="0" <?php 
        if (!$row->blog_style_title_enable) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="blog_style_title_enable_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                  <div class="spider_description"></div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options spider_free_version_label">
                  <label for="blog_style_width"><?php 
        _e("Image width for Blog Style view:", 'bwg_back');
        ?>
</label>
                </td>
                <td class="spider_free_version_label">
                  <input disabled="disabled" type="text" name="blog_style_width" id="blog_style_width" value="<?php 
        echo $row->blog_style_width;
        ?>
" class="spider_int_input spider_free_version_label" /> px
                  <div class="spider_description"></div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options spider_free_version_label">
                  <label for="blog_style_images_per_page"><?php 
        _e("Images per page in Blog Style view:", 'bwg_back');
        ?>
</label>
                </td>
                <td class="spider_free_version_label">
                  <input disabled="disabled" type="text" name="blog_style_images_per_page" id="blog_style_images_per_page" value="<?php 
        echo $row->blog_style_images_per_page;
        ?>
" class="spider_int_input spider_free_version_label" />
                  <div class="spider_description"></div>
                </td>
              </tr>
              <tr>
                <td class="spider_label_options spider_free_version_label">
                  <label><?php 
        _e("Enable pagination for Blog Style view:", 'bwg_back');
        ?>
</label>
                </td>
                <td class="spider_free_version_label">
                  <input disabled="disabled" type="radio" name="blog_style_enable_page" id="blog_style_enable_page_1" value="1" <?php 
        if ($row->blog_style_enable_page) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="blog_style_enable_page_1"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                  <input disabled="disabled" type="radio" name="blog_style_enable_page" id="blog_style_enable_page_0" value="0" <?php 
        if (!$row->blog_style_enable_page) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="blog_style_enable_page_0"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                  <div class="spider_description"></div>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
        <!--Embed options-->
        <div class="spider_div_options" id="div_content_9">
          <table>
            <tbody>
              <tr>
                <td class="spider_label_options spider_free_version_label">
                  <label ><?php 
        _e("Gallery autoupdate interval:", 'bwg_back');
        ?>
</label>
                </td>
                <td class="spider_free_version_label">
                  <input type="number" disabled="disabled" id="autoupdate_interval_hour" class="spider_int_input" min="0" max="24" value="0" />
                  <?php 
        _e("hour", 'bwg_back');
        ?>
                  <input type="number" disabled="disabled" id="autoupdate_interval_min" class="spider_int_input" min="0" max="59" value="30" />
                  <?php 
        _e("min", 'bwg_back');
        ?>
                  <div class="spider_description spider_free_version"><?php 
        _e("Autoupdatable galleries are disabled in free version.", 'bwg_back');
        ?>
</div>
                </td>
              </tr>
              
              <tr>
                <td class="spider_label_options spider_free_version_label">
                  <label>Instagram Access Token:</label>
                </td>
                <td class="spider_free_version_label">
                  <input id="instagram_client_id" type="text" disabled="disabled" style="display:inline-block; width:100%;" value="" />
                 <div class="spider_description spider_free_version">Instagram <?php 
        _e("galleries are disabled in free version.", 'bwg_back');
        ?>
</div>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
	
	<!-- Carousel-->
		    <div class="spider_div_options" id="div_content_10">
          <table style="width: 100%;">
            <tr>
              <td style="width: 50%; vertical-align: top;">
                <table style="display: inline-table;">
                  <tbody>
                    <tr>
                      <td class="spider_label_options spider_free_version_label">
                        <label for="carousel_interval"><?php 
        _e("Time interval:", 'bwg_back');
        ?>
 </label>
                      </td>
                      <td class="spider_free_version_label">
                        <input type="text" disabled="disabled" name="carousel_interval" id="carousel_interval" value="<?php 
        echo $row->carousel_interval;
        ?>
" class="spider_int_input" /> sec.
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr>
                      <td class="spider_label_options spider_free_version_label">
                        <label for="carousel_image_column_number"><?php 
        _e("Max. number of images:", 'bwg_back');
        ?>
 </label>
                      </td>
                      <td class="spider_free_version_label">
                        <input type="text" disabled="disabled" name="carousel_image_column_number" id="carousel_image_column_number" value="<?php 
        echo $row->carousel_image_column_number;
        ?>
" class="spider_int_input" /> sec.
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr>
                      <td class="spider_label_options spider_free_version_label">
                        <label for="carousel_image_par"><?php 
        _e("Carousel image ratio:", 'bwg_back');
        ?>
 </label>
                      </td>
                      <td class="spider_free_version_label">
                        <input type="text" disabled="disabled" name="carousel_image_par" id="carousel_image_par" value="<?php 
        echo $row->carousel_image_par;
        ?>
"  /> 
                        <div class="spider_description"></div>
                      </td>
                    </tr>                
                    <tr>
                      <td class="spider_label_options spider_free_version_label">
                        <label for="carousel_width"><?php 
        _e("Image dimensions:", 'bwg_back');
        ?>
 </label>
                      </td>
                      <td class="spider_free_version_label">
                        <input type="text" disabled="disabled" name="carousel_width" id="carousel_width" value="<?php 
        echo $row->carousel_width;
        ?>
" class="spider_int_input" /> x 
                        <input type="text" disabled="disabled" name="carousel_height" id="carousel_height" value="<?php 
        echo $row->carousel_height;
        ?>
" class="spider_int_input" /> px
                        <div class="spider_description"></div>
                      </td>
                    </tr>         
                    <tr>
                      <td class="spider_label_options spider_free_version_label">
                        <label for="carousel_r_width"><?php 
        _e("Fixed width:", 'bwg_back');
        ?>
 </label>
                      </td>
                      <td class="spider_free_version_label">
                        <input type="text" disabled="disabled" name="carousel_r_width" id="carousel_r_width" value="<?php 
        echo $row->carousel_r_width;
        ?>
" class="spider_int_input" /> px                         
                      </td>
                    </tr>   
                  </tbody>
                </table>
              </td>
              <td style="width: 50%; vertical-align: top;">
                <table style="width: 100%; display: inline-table;">
                  <tbody>
                    <tr>
                      <td class="spider_label_options spider_free_version_label"><label><?php 
        _e("Enable image title:", 'bwg_back');
        ?>
 </label></td>
                      <td class="spider_free_version_label">
                        <input type="radio" disabled="disabled" name="carousel_enable_title" id="carousel_enable_title_yes" value="1" <?php 
        if ($row->carousel_enable_title) {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_enable_disable('', 'tr_carousel_title_position', 'carousel_enable_title_yes')" /><label for="carousel_enable_title_yes"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input type="radio" disabled="disabled" name="carousel_enable_title" id="carousel_enable_title_no" value="0" <?php 
        if (!$row->carousel_enable_title) {
            echo 'checked="checked"';
        }
        ?>
 onClick="bwg_enable_disable('none', 'tr_carousel_title_position', 'carousel_enable_title_no')" /><label for="carousel_enable_title_no"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr>
                      <td class="spider_label_options spider_free_version_label">
                        <label><?php 
        _e("Enable autoplay:", 'bwg_back');
        ?>
 </label>
                      </td>
                      <td class="spider_free_version_label">
                        <input type="radio" disabled="disabled" name="carousel_enable_autoplay" id="carousel_enable_autoplay_yes" value="1" <?php 
        if ($row->carousel_enable_autoplay) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="carousel_enable_autoplay_yes"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input type="radio" disabled="disabled" name="carousel_enable_autoplay" id="carousel_enable_autoplay_no" value="0" <?php 
        if (!$row->carousel_enable_autoplay) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="carousel_enable_autoplay_no"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description"></div>
                      </td>
                    </tr>
                    <tr>
                      <td class="spider_label_options spider_free_version_label">
                        <label> <?php 
        _e("Container fit:", 'bwg_back');
        ?>
 </label>
                      </td>
                      <td class="spider_free_version_label">
                        <input type="radio" disabled="disabled" name="carousel_fit_containerWidth" id="carousel_fit_containerWidth_yes" value="1" <?php 
        if ($row->carousel_fit_containerWidth) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="carousel_fit_containerWidth_yes"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input type="radio" disabled="disabled" name="carousel_fit_containerWidth" id="carousel_fit_containerWidth_no" value="0" <?php 
        if (!$row->carousel_fit_containerWidth) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="carousel_fit_containerWidth_no"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description"></div>
                      </td>
                    </tr> 
                    <tr>
                      <td class="spider_label_options spider_free_version_label">
                        <label> <?php 
        _e("Next/Previous buttons:", 'bwg_back');
        ?>
 </label>
                      </td>
                      <td class="spider_free_version_label">
                        <input type="radio" disabled="disabled" name="carousel_prev_next_butt" id="carousel_prev_next_butt_yes" value="1" <?php 
        if ($row->carousel_prev_next_butt) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="carousel_prev_next_butt_yes"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input type="radio" disabled="disabled" name="carousel_prev_next_butt" id="carousel_prev_next_butt_no" value="0" <?php 
        if (!$row->carousel_prev_next_butt) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="carousel_prev_next_butt_no"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description"></div>
                      </td>
                    </tr> 
                    <tr>
                      <td class="spider_label_options spider_free_version_label">
                        <label> <?php 
        _e("Play/Pause button:", 'bwg_back');
        ?>
 </label>
                      </td>
                      <td class="spider_free_version_label">
                        <input type="radio" disabled="disabled" name="carousel_play_pause_butt" id="carousel_play_pause_butt_yes" value="1" <?php 
        if ($row->carousel_play_pause_butt) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="carousel_play_pause_butt_yes"><?php 
        _e("Yes", 'bwg_back');
        ?>
</label>
                        <input type="radio" disabled="disabled" name="carousel_play_pause_butt" id="carousel_play_pause_butt_no" value="0" <?php 
        if (!$row->carousel_play_pause_butt) {
            echo 'checked="checked"';
        }
        ?>
 /><label for="carousel_play_pause_butt_no"><?php 
        _e("No", 'bwg_back');
        ?>
</label>
                        <div class="spider_description"></div>
                      </td>
                    </tr> 
                  </tbody>
                </table>
              </td>
            </tr>
          </table>
	  <div class="spider_description spider_free_version"><?php 
        _e("Carousel view is disabled in free version.", 'bwg_back');
        ?>
</div>
        </div>

      </div>
              
      <input id="task" name="task" type="hidden" value="" />
      <input id="current_id" name="current_id" type="hidden" value="<?php 
        echo $row->id;
        ?>
" />
      <script>
        window.onload = bwg_change_option_type('<?php 
        echo isset($_POST['type']) ? esc_html($_POST['type']) : '1';
        ?>
');
        window.onload = bwg_inputs();
        window.onload = bwg_watermark('watermark_type_<?php 
        echo $row->watermark_type;
        ?>
');
        window.onload = bwg_built_in_watermark('watermark_type_<?php 
        echo $row->built_in_watermark_type;
        ?>
');
        window.onload = bwg_popup_fullscreen(<?php 
        echo $row->popup_fullscreen;
        ?>
);
        window.onload = bwg_enable_disable(<?php 
        echo $row->show_search_box ? "'', 'tr_search_box_width', 'show_search_box_1'" : "'none', 'tr_search_box_width', 'show_search_box_0'";
        ?>
);
        window.onload = bwg_enable_disable(<?php 
        echo $row->show_search_box ? "'', 'tr_search_box_placeholder', 'show_search_box_1'" : "'none', 'tr_search_box_placeholder', 'show_search_box_0'";
        ?>
);
        window.onload = bwg_enable_disable(<?php 
        echo $row->preload_images ? "'', 'tr_preload_images_count', 'preload_images_1'" : "'none', 'tr_preload_images_count', 'preload_images_0'";
        ?>
);
        window.onload = bwg_enable_disable(<?php 
        echo $row->popup_enable_ctrl_btn ? "'', 'tr_popup_fullscreen', 'popup_enable_ctrl_btn_1'" : "'none', 'tr_popup_fullscreen', 'popup_enable_ctrl_btn_0'";
        ?>
);
        window.onload = bwg_enable_disable(<?php 
        echo $row->popup_enable_ctrl_btn ? "'', 'tr_popup_info', 'popup_enable_ctrl_btn_1'" : "'none', 'tr_popup_info', 'popup_enable_ctrl_btn_0'";
        ?>
);
        window.onload = bwg_enable_disable(<?php 
        echo $row->popup_enable_ctrl_btn ? "'', 'tr_popup_download', 'popup_enable_ctrl_btn_1'" : "'none', 'tr_popup_download', 'popup_enable_ctrl_btn_0'";
        ?>
);
        window.onload = bwg_enable_disable(<?php 
        echo $row->popup_enable_ctrl_btn ? "'', 'tr_popup_fullsize_image', 'popup_enable_ctrl_btn_1'" : "'none', 'tr_popup_fullsize_image', 'popup_enable_ctrl_btn_0'";
        ?>
);
        window.onload = bwg_enable_disable(<?php 
        echo $row->popup_enable_ctrl_btn ? "'', 'tr_popup_comment', 'popup_enable_ctrl_btn_1'" : "'none', 'tr_popup_comment', 'popup_enable_ctrl_btn_0'";
        ?>
);
        window.onload = bwg_enable_disable(<?php 
        echo $row->popup_enable_ctrl_btn ? $row->popup_enable_comment ? "'', 'tr_comment_moderation', 'popup_enable_comment_1'" : "'none', 'tr_comment_moderation', 'popup_enable_comment_0'" : "'none', 'tr_comment_moderation', 'popup_enable_comment_0'";
        ?>
);
        window.onload = bwg_enable_disable(<?php 
        echo $row->popup_enable_ctrl_btn ? $row->popup_enable_comment ? "'', 'tr_popup_email', 'popup_enable_comment_1'" : "'none', 'tr_popup_email', 'popup_enable_comment_0'" : "'none', 'tr_popup_email', 'popup_enable_comment_0'";
        ?>
);
        window.onload = bwg_enable_disable(<?php 
        echo $row->popup_enable_ctrl_btn ? $row->popup_enable_comment ? "'', 'tr_popup_captcha', 'popup_enable_comment_1'" : "'none', 'tr_popup_captcha', 'popup_enable_comment_0'" : "'none', 'tr_popup_captcha', 'popup_enable_comment_0'";
        ?>
);
        window.onload = bwg_enable_disable(<?php 
        echo $row->popup_enable_ctrl_btn ? "'', 'tr_popup_facebook', 'popup_enable_ctrl_btn_1'" : "'none', 'tr_popup_facebook', 'popup_enable_ctrl_btn_0'";
        ?>
);
        window.onload = bwg_enable_disable(<?php 
        echo $row->popup_enable_ctrl_btn ? "'', 'tr_popup_twitter', 'popup_enable_ctrl_btn_1'" : "'none', 'tr_popup_twitter', 'popup_enable_ctrl_btn_0'";
        ?>
);
        window.onload = bwg_enable_disable(<?php 
        echo $row->popup_enable_ctrl_btn ? "'', 'tr_popup_google', 'popup_enable_ctrl_btn_1'" : "'none', 'tr_popup_google', 'popup_enable_ctrl_btn_0'";
        ?>
);
        window.onload = bwg_enable_disable(<?php 
        echo $row->popup_enable_ctrl_btn ? "'', 'tr_popup_pinterest', 'popup_enable_ctrl_btn_1'" : "'none', 'tr_popup_pinterest', 'popup_enable_ctrl_btn_0'";
        ?>
);
        window.onload = bwg_enable_disable(<?php 
        echo $row->popup_enable_ctrl_btn ? "'', 'tr_popup_thumblr', 'popup_enable_ctrl_btn_1'" : "'none', 'tr_popup_thumblr', 'popup_enable_ctrl_btn_0'";
        ?>
);
        window.onload = bwg_enable_disable(<?php 
        echo $row->popup_enable_filmstrip ? "'', 'tr_popup_filmstrip_height', 'popup_enable_filmstrip_1'" : "'none', 'tr_popup_filmstrip_height', 'popup_enable_filmstrip_0'";
        ?>
);
        window.onload = bwg_enable_disable(<?php 
        echo $row->slideshow_enable_filmstrip ? "'', 'tr_slideshow_filmstrip_height', 'slideshow_enable_filmstrip_yes'" : "'none', 'tr_slideshow_filmstrip_height', 'slideshow_enable_filmstrip_no'";
        ?>
);
        window.onload = bwg_enable_disable(<?php 
        echo $row->slideshow_enable_title ? "'', 'tr_slideshow_title_position', 'slideshow_enable_title_yes'" : "'none', 'tr_slideshow_title_position', 'slideshow_enable_title_no'";
        ?>
);
        window.onload = bwg_enable_disable(<?php 
        echo $row->slideshow_enable_description ? "'', 'tr_slideshow_description_position', 'slideshow_enable_description_yes'" : "'none', 'tr_slideshow_description_position', 'slideshow_enable_description_no'";
        ?>
);
        window.onload = bwg_enable_disable(<?php 
        echo $row->slideshow_enable_music ? "'', 'tr_slideshow_music_url', 'slideshow_enable_music_yes'" : "'none', 'tr_slideshow_music_url', 'slideshow_enable_music_no'";
        ?>
);
        window.onload = bwg_enable_disable(<?php 
        echo $row->thumb_click_action == 'redirect_to_url' ? "'', 'tr_thumb_link_target', 'thumb_click_action_2'" : "'none', 'tr_thumb_link_target', 'thumb_click_action_" . ($row->thumb_click_action == 'open_lightbox' ? 1 : 3) . "'";
        ?>
);
        window.onload = preview_watermark();
        window.onload = preview_built_in_watermark();
      </script>
    </form>
    <?php 
    }
    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;
        text-decoration: none;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_album_extended_div_<?php 
        echo $bwg;
        ?>
 {
        display: table;
        width: 100%;
        height: <?php 
        echo $params['extended_album_height'];
        ?>
px;
        border-spacing: <?php 
        echo $theme_row->album_extended_div_padding;
        ?>
px;
        border-bottom: <?php 
        echo $theme_row->album_extended_div_separator_width;
        ?>
px <?php 
        echo $theme_row->album_extended_div_separator_style;
        ?>
 #<?php 
        echo $theme_row->album_extended_div_separator_color;
        ?>
;
        background-color: rgba(<?php 
        echo $rgb_album_extended_div_bg_color['red'];
        ?>
, <?php 
        echo $rgb_album_extended_div_bg_color['green'];
        ?>
, <?php 
        echo $rgb_album_extended_div_bg_color['blue'];
        ?>
, <?php 
        echo $theme_row->album_extended_div_bg_transparent / 100;
        ?>
);
        border-radius: <?php 
        echo $theme_row->album_extended_div_border_radius;
        ?>
;
        margin: <?php 
        echo $theme_row->album_extended_div_margin;
        ?>
;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_album_extended_thumb_div_<?php 
        echo $bwg;
        ?>
 {
        background-color: #<?php 
        echo $theme_row->album_extended_thumb_div_bg_color;
        ?>
;
        border-radius: <?php 
        echo $theme_row->album_extended_thumb_div_border_radius;
        ?>
;
        text-align: center;
        border: <?php 
        echo $theme_row->album_extended_thumb_div_border_width;
        ?>
px <?php 
        echo $theme_row->album_extended_thumb_div_border_style;
        ?>
 #<?php 
        echo $theme_row->album_extended_thumb_div_border_color;
        ?>
;
        display: table-cell;
        vertical-align: middle;
        padding: <?php 
        echo $theme_row->album_extended_thumb_div_padding;
        ?>
;
      }
      @media only screen and (max-width : 320px) {
        #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_album_extended_thumb_div_<?php 
        echo $bwg;
        ?>
 {
          display: table-row;
        }
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_album_extended_text_div_<?php 
        echo $bwg;
        ?>
 {
        background-color: #<?php 
        echo $theme_row->album_extended_text_div_bg_color;
        ?>
;
        border-radius: <?php 
        echo $theme_row->album_extended_text_div_border_radius;
        ?>
;
        border: <?php 
        echo $theme_row->album_extended_text_div_border_width;
        ?>
px <?php 
        echo $theme_row->album_extended_text_div_border_style;
        ?>
 #<?php 
        echo $theme_row->album_extended_text_div_border_color;
        ?>
;
        display: table-cell;
        width: 100%;
        border-collapse: collapse;
        vertical-align: middle;
        padding: <?php 
        echo $theme_row->album_extended_text_div_padding;
        ?>
;
      }
      @media only screen and (max-width : 320px) {
        #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_album_extended_text_div_<?php 
        echo $bwg;
        ?>
 {
          display: table-row;
        }
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_title_spun_<?php 
        echo $bwg;
        ?>
 {
        border: <?php 
        echo $theme_row->album_extended_title_span_border_width;
        ?>
px <?php 
        echo $theme_row->album_extended_title_span_border_style;
        ?>
 #<?php 
        echo $theme_row->album_extended_title_span_border_color;
        ?>
;
        color: #<?php 
        echo $theme_row->album_extended_title_font_color;
        ?>
;
        display: block;
        font-family: <?php 
        echo $theme_row->album_extended_title_font_style;
        ?>
;
        font-size: <?php 
        echo $theme_row->album_extended_title_font_size;
        ?>
px;
        font-weight: <?php 
        echo $theme_row->album_extended_title_font_weight;
        ?>
;
        height: inherit;
        margin-bottom: <?php 
        echo $theme_row->album_extended_title_margin_bottom;
        ?>
px;
        padding: <?php 
        echo $theme_row->album_extended_title_padding;
        ?>
;
        text-align: left;
        vertical-align: middle;
        width: inherit;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_description_spun1_<?php 
        echo $bwg;
        ?>
 {
        border: <?php 
        echo $theme_row->album_extended_desc_span_border_width;
        ?>
px <?php 
        echo $theme_row->album_extended_desc_span_border_style;
        ?>
 #<?php 
        echo $theme_row->album_extended_desc_span_border_color;
        ?>
;
        display: inline-block;
        color: #<?php 
        echo $theme_row->album_extended_desc_font_color;
        ?>
;
        font-size: <?php 
        echo $theme_row->album_extended_desc_font_size;
        ?>
px;
        font-weight: <?php 
        echo $theme_row->album_extended_desc_font_weight;
        ?>
;
        font-family: <?php 
        echo $theme_row->album_extended_desc_font_style;
        ?>
;
        height: inherit;
        padding: <?php 
        echo $theme_row->album_extended_desc_padding;
        ?>
;
        vertical-align: middle;
        width: inherit;
        word-wrap: break-word;
        word-break: break-word;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_description_spun1_<?php 
        echo $bwg;
        ?>
 * {
        margin: 0;
        text-align: left !important;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_description_spun2_<?php 
        echo $bwg;
        ?>
 {
        float: left;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_description_short_<?php 
        echo $bwg;
        ?>
 {
        display: inline;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_description_full_<?php 
        echo $bwg;
        ?>
 {
        display: none;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_description_more_<?php 
        echo $bwg;
        ?>
 {
        clear: both;
        color: #<?php 
        echo $theme_row->album_extended_desc_more_color;
        ?>
;
        cursor: pointer;
        float: right;
        font-size: <?php 
        echo $theme_row->album_extended_desc_more_size;
        ?>
px;
        font-weight: normal;
      }
      /*Album thumbs styles.*/
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_album_thumb_<?php 
        echo $bwg;
        ?>
 {
        display: inline-block;
        text-align: center;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_album_thumb_spun1_<?php 
        echo $bwg;
        ?>
 {
        background-color: #<?php 
        echo $theme_row->album_extended_thumb_bg_color;
        ?>
;
        border-radius: <?php 
        echo $theme_row->album_extended_thumb_border_radius;
        ?>
;
        border: <?php 
        echo $theme_row->album_extended_thumb_border_width;
        ?>
px <?php 
        echo $theme_row->album_extended_thumb_border_style;
        ?>
 #<?php 
        echo $theme_row->album_extended_thumb_border_color;
        ?>
;
        box-shadow: <?php 
        echo $theme_row->album_extended_thumb_box_shadow;
        ?>
;
        display: inline-block;
        height: <?php 
        echo $params['extended_album_thumb_height'];
        ?>
px;
        margin: <?php 
        echo $theme_row->album_extended_thumb_margin;
        ?>
px;
        opacity: <?php 
        echo $theme_row->album_extended_thumb_transparent / 100;
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $theme_row->album_extended_thumb_transparent;
        ?>
);
        <?php 
        echo $theme_row->album_extended_thumb_transition ? 'transition: all 0.3s ease 0s;-webkit-transition: all 0.3s ease 0s;' : '';
        ?>
        padding: <?php 
        echo $theme_row->album_extended_thumb_padding;
        ?>
px;
        text-align: center;
        vertical-align: middle;
        width: <?php 
        echo $params['extended_album_thumb_width'];
        ?>
px;
        z-index: 100;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_album_thumb_spun1_<?php 
        echo $bwg;
        ?>
:hover {
        opacity: 1;
        filter: Alpha(opacity=100);
        transform: <?php 
        echo $theme_row->album_extended_thumb_hover_effect;
        ?>
(<?php 
        echo $theme_row->album_extended_thumb_hover_effect_value;
        ?>
);
        -ms-transform: <?php 
        echo $theme_row->album_extended_thumb_hover_effect;
        ?>
(<?php 
        echo $theme_row->album_extended_thumb_hover_effect_value;
        ?>
);
        -webkit-transform: <?php 
        echo $theme_row->album_extended_thumb_hover_effect;
        ?>
(<?php 
        echo $theme_row->album_extended_thumb_hover_effect_value;
        ?>
);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        -moz-backface-visibility: hidden;
        -ms-backface-visibility: hidden;
        z-index: 102;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_album_thumb_spun2_<?php 
        echo $bwg;
        ?>
 {
        display: inline-block;
        height: <?php 
        echo $params['extended_album_thumb_height'];
        ?>
px;
        overflow: hidden;
        width: <?php 
        echo $params['extended_album_thumb_width'];
        ?>
px;
      }
      /*Image thumbs styles.*/
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_standart_thumb_spun1_<?php 
        echo $bwg;
        ?>
 {
        background-color: #<?php 
        echo $theme_row->thumb_bg_color;
        ?>
;
        border-radius: <?php 
        echo $theme_row->thumb_border_radius;
        ?>
;
        border: <?php 
        echo $theme_row->thumb_border_width;
        ?>
px <?php 
        echo $theme_row->thumb_border_style;
        ?>
 #<?php 
        echo $theme_row->thumb_border_color;
        ?>
;
        box-shadow: <?php 
        echo $theme_row->thumb_box_shadow;
        ?>
;
        display: inline-block;
        height: <?php 
        echo $params['extended_album_image_thumb_height'];
        ?>
px;
        margin: <?php 
        echo $theme_row->thumb_margin;
        ?>
px;
        opacity: <?php 
        echo $theme_row->thumb_transparent / 100;
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $theme_row->thumb_transparent;
        ?>
);
        <?php 
        echo $theme_row->thumb_transition ? 'transition: all 0.3s ease 0s;-webkit-transition: all 0.3s ease 0s;' : '';
        ?>
        padding: <?php 
        echo $theme_row->thumb_padding;
        ?>
px;
        text-align: center;
        vertical-align: middle;
        width: <?php 
        echo $params['extended_album_image_thumb_width'];
        ?>
px;
        z-index: 100;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_standart_thumb_spun1_<?php 
        echo $bwg;
        ?>
:hover {
        -ms-transform: <?php 
        echo $theme_row->thumb_hover_effect;
        ?>
(<?php 
        echo $theme_row->thumb_hover_effect_value;
        ?>
);
        -webkit-transform: <?php 
        echo $theme_row->thumb_hover_effect;
        ?>
(<?php 
        echo $theme_row->thumb_hover_effect_value;
        ?>
);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        -moz-backface-visibility: hidden;
        -ms-backface-visibility: hidden;
        opacity: 1;
        filter: Alpha(opacity=100);
        transform: <?php 
        echo $theme_row->thumb_hover_effect;
        ?>
(<?php 
        echo $theme_row->thumb_hover_effect_value;
        ?>
);
        z-index: 102;
        position: relative;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_standart_thumb_spun2_<?php 
        echo $bwg;
        ?>
 {
        display: inline-block;
        height: <?php 
        echo $params['extended_album_image_thumb_height'];
        ?>
px;
        overflow: hidden;
        width: <?php 
        echo $params['extended_album_image_thumb_width'];
        ?>
px;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_standart_thumbnails_<?php 
        echo $bwg;
        ?>
 {
        -moz-box-sizing: border-box;
        display: inline-block;
        background-color: rgba(<?php 
        echo $rgb_thumbs_bg_color['red'];
        ?>
, <?php 
        echo $rgb_thumbs_bg_color['green'];
        ?>
, <?php 
        echo $rgb_thumbs_bg_color['blue'];
        ?>
, <?php 
        echo $theme_row->thumb_bg_transparent / 100;
        ?>
);
        box-sizing: border-box;
        font-size: 0;
        max-width: <?php 
        echo $params['extended_album_image_column_number'] * ($params['extended_album_image_thumb_width'] + 2 * (2 + $theme_row->thumb_margin + $theme_row->thumb_padding + $theme_row->thumb_border_width));
        ?>
px;
        text-align: <?php 
        echo $theme_row->thumb_align;
        ?>
;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_standart_thumbnails_<?php 
        echo $bwg;
        ?>
 a {
        cursor: pointer;
        text-decoration: none;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_standart_thumb_<?php 
        echo $bwg;
        ?>
 {
        display: inline-block;
        text-align: center;
      }
      <?php 
        if ($params['extended_album_image_title'] == 'show') {
            /* Show image title at the bottom.*/
            ?>
        #bwg_container1_<?php 
            echo $bwg;
            ?>
 #bwg_container2_<?php 
            echo $bwg;
            ?>
 .bwg_image_title_spun1_<?php 
            echo $bwg;
            ?>
 {
          display: block;
          margin: 0 auto;
          opacity: 1;
          filter: Alpha(opacity=100);
          text-align: center;
          width: <?php 
            echo $params['extended_album_image_thumb_width'];
            ?>
px;
        }
        <?php 
        } elseif ($params['extended_album_image_title'] == 'hover') {
            /* Show image title on hover.*/
            ?>
        #bwg_container1_<?php 
            echo $bwg;
            ?>
 #bwg_container2_<?php 
            echo $bwg;
            ?>
 .bwg_image_title_spun1_<?php 
            echo $bwg;
            ?>
 {
          display: table;
          height: inherit;
          left: -3000px;
          opacity: 0;
          filter: Alpha(opacity=0);
          position: absolute;
          top: 0px;
          width: inherit;
        }
        <?php 
        }
        ?>
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_standart_thumb_spun1_<?php 
        echo $bwg;
        ?>
:hover .bwg_image_title_spun1_<?php 
        echo $bwg;
        ?>
 {
        left: <?php 
        echo $theme_row->thumb_padding;
        ?>
px;
        top: <?php 
        echo $theme_row->thumb_padding;
        ?>
px;
        opacity: 1;
        filter: Alpha(opacity=100);
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_image_title_spun2_<?php 
        echo $bwg;
        ?>
 {
        color: #<?php 
        echo $theme_row->thumb_title_font_color;
        ?>
;
        display: table-cell;
        font-family: <?php 
        echo $theme_row->thumb_title_font_style;
        ?>
;
        font-size: <?php 
        echo $theme_row->thumb_title_font_size;
        ?>
px;
        font-weight: <?php 
        echo $theme_row->thumb_title_font_weight;
        ?>
;
        height: inherit;
        margin: <?php 
        echo $theme_row->thumb_title_margin;
        ?>
;
        text-shadow: <?php 
        echo $theme_row->thumb_title_shadow;
        ?>
;
        vertical-align: middle;
        width: inherit;
        word-break: break-all;
        word-wrap: break-word;
      }
      /*Pagination styles.*/
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 {
        text-align: <?php 
        echo $theme_row->page_nav_align;
        ?>
;
        font-size: <?php 
        echo $theme_row->page_nav_font_size;
        ?>
px;
        font-family: <?php 
        echo $theme_row->page_nav_font_style;
        ?>
;
        font-weight: <?php 
        echo $theme_row->page_nav_font_weight;
        ?>
;
        color: #<?php 
        echo $theme_row->page_nav_font_color;
        ?>
;
        margin: 6px 0 4px;
        display: block;
        height: 30px;
        line-height: 30px;
      }
      @media only screen and (max-width : 320px) {
        #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .displaying-num_<?php 
        echo $bwg;
        ?>
 {
          display: none;
        }
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .displaying-num_<?php 
        echo $bwg;
        ?>
 {
        font-size: <?php 
        echo $theme_row->page_nav_font_size;
        ?>
px;
        font-family: <?php 
        echo $theme_row->page_nav_font_style;
        ?>
;
        font-weight: <?php 
        echo $theme_row->page_nav_font_weight;
        ?>
;
        color: #<?php 
        echo $theme_row->page_nav_font_color;
        ?>
;
        margin-right: 10px;
        vertical-align: middle;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .paging-input_<?php 
        echo $bwg;
        ?>
 {
        font-size: <?php 
        echo $theme_row->page_nav_font_size;
        ?>
px;
        font-family: <?php 
        echo $theme_row->page_nav_font_style;
        ?>
;
        font-weight: <?php 
        echo $theme_row->page_nav_font_weight;
        ?>
;
        color: #<?php 
        echo $theme_row->page_nav_font_color;
        ?>
;
        vertical-align: middle;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 a.disabled,
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 a.disabled:hover,
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 a.disabled:focus {
        cursor: default;
        color: rgba(<?php 
        echo $rgb_page_nav_font_color['red'];
        ?>
, <?php 
        echo $rgb_page_nav_font_color['green'];
        ?>
, <?php 
        echo $rgb_page_nav_font_color['blue'];
        ?>
, 0.5);
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 a {
        cursor: pointer;
        font-size: <?php 
        echo $theme_row->page_nav_font_size;
        ?>
px;
        font-family: <?php 
        echo $theme_row->page_nav_font_style;
        ?>
;
        font-weight: <?php 
        echo $theme_row->page_nav_font_weight;
        ?>
;
        color: #<?php 
        echo $theme_row->page_nav_font_color;
        ?>
;
        text-decoration: none;
        padding: <?php 
        echo $theme_row->page_nav_padding;
        ?>
;
        margin: <?php 
        echo $theme_row->page_nav_margin;
        ?>
;
        border-radius: <?php 
        echo $theme_row->page_nav_border_radius;
        ?>
;
        border-style: <?php 
        echo $theme_row->page_nav_border_style;
        ?>
;
        border-width: <?php 
        echo $theme_row->page_nav_border_width;
        ?>
px;
        border-color: #<?php 
        echo $theme_row->page_nav_border_color;
        ?>
;
        background-color: #<?php 
        echo $theme_row->page_nav_button_bg_color;
        ?>
;
        opacity: <?php 
        echo $theme_row->page_nav_button_bg_transparent / 100;
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $theme_row->page_nav_button_bg_transparent;
        ?>
);
        box-shadow: <?php 
        echo $theme_row->page_nav_box_shadow;
        ?>
;
        <?php 
        echo $theme_row->page_nav_button_transition ? 'transition: all 0.3s ease 0s;-webkit-transition: all 0.3s ease 0s;' : '';
        ?>
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_back_<?php 
        echo $bwg;
        ?>
 {
        background-color: rgba(0, 0, 0, 0);
        color: #<?php 
        echo $theme_row->album_extended_back_font_color;
        ?>
 !important;
        cursor: pointer;
        display: block;
        font-family: <?php 
        echo $theme_row->album_extended_back_font_style;
        ?>
;
        font-size: <?php 
        echo $theme_row->album_extended_back_font_size;
        ?>
px;
        font-weight: <?php 
        echo $theme_row->album_extended_back_font_weight;
        ?>
;
        text-decoration: none;
        padding: <?php 
        echo $theme_row->album_extended_back_padding;
        ?>
;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 #spider_popup_overlay_<?php 
        echo $bwg;
        ?>
 {
        background-color: #<?php 
        echo $theme_row->lightbox_overlay_bg_color;
        ?>
;
        opacity: <?php 
        echo $theme_row->lightbox_overlay_bg_transparent / 100;
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $theme_row->lightbox_overlay_bg_transparent;
        ?>
);
      }
    </style>
    <div id="bwg_container1_<?php 
        echo $bwg;
        ?>
">
      <div id="bwg_container2_<?php 
        echo $bwg;
        ?>
">
        <form id="gal_front_form_<?php 
        echo $bwg;
        ?>
" method="post" action="#">
          <div style="background-color:rgba(0, 0, 0, 0); text-align:center; width:100%;">
            <?php 
        if ($params['extended_album_enable_page'] && $items_per_page && $theme_row->page_nav_position == 'top' && $page_nav['total']) {
            WDWLibrary::ajax_html_frontend_page_nav($theme_row, $page_nav['total'], $page_nav['limit'], 'gal_front_form_' . $bwg, $items_per_page, $bwg, $album_gallery_div_id, $params['album_id']);
        }
        ?>
            <div id="bwg_album_extended_<?php 
        echo $bwg;
        ?>
" class="<?php 
        echo $album_gallery_div_class;
        ?>
">
              <div id="ajax_loading_<?php 
        echo $bwg;
        ?>
" style="position:absolute;">
                <div id="opacity_div_<?php 
        echo $bwg;
        ?>
" style="display:none; background-color:#FFFFFF; opacity:0.7; filter:Alpha(opacity=70); position:absolute; z-index:105;"></div>
                <span id="loading_div_<?php 
        echo $bwg;
        ?>
" style="display:none; text-align:center; position:relative; vertical-align:middle; z-index:107">
                  <img src="<?php 
        echo WD_BWG_URL . '/images/ajax_loader.png';
        ?>
" class="spider_ajax_loading" style="float: none; width:50px;">
                </span>
              </div>
              <?php 
        if ($bwg_previous_album_id) {
            ?>
                <a class="bwg_back_<?php 
            echo $bwg;
            ?>
" onclick="spider_frontend_ajax('gal_front_form_<?php 
            echo $bwg;
            ?>
', '<?php 
            echo $bwg;
            ?>
', 'bwg_album_extended_<?php 
            echo $bwg;
            ?>
', 'back')"><?php 
            echo __('Back', 'bwg');
            ?>
</a>
                <?php 
        }
        ?>
              <input type="hidden" id="bwg_previous_album_id_<?php 
        echo $bwg;
        ?>
" name="bwg_previous_album_id_<?php 
        echo $bwg;
        ?>
" value="<?php 
        echo $bwg_previous_album_id;
        ?>
" />
              <input type="hidden" id="bwg_previous_album_page_number_<?php 
        echo $bwg;
        ?>
" name="bwg_previous_album_page_number_<?php 
        echo $bwg;
        ?>
" value="<?php 
        echo $bwg_previous_album_page_number;
        ?>
" />
              <?php 
        if ($type != 'gallery') {
            if (!$page_nav['total']) {
                ?>
                  <span class="bwg_back_<?php 
                echo $bwg;
                ?>
"><?php 
                echo __('Album is empty.', 'bwg');
                ?>
</span>
                  <?php 
            }
            foreach ($album_galleries_row as $album_galallery_row) {
                if ($album_galallery_row->is_album) {
                    $album_row = $this->model->get_album_row_data($album_galallery_row->alb_gal_id);
                    $preview_image = $album_row->preview_image;
                    if (!$preview_image) {
                        $preview_image = $album_row->random_preview_image;
                    }
                    $def_type = 'album';
                    $title = $album_row->name;
                    $description = wpautop($album_row->description);
                } else {
                    $gallery_row = $this->model->get_gallery_row_data($album_galallery_row->alb_gal_id);
                    $preview_image = $gallery_row->preview_image;
                    if (!$preview_image) {
                        $preview_image = $gallery_row->random_preview_image;
                    }
                    $def_type = 'gallery';
                    $title = $gallery_row->name;
                    $description = wpautop($gallery_row->description);
                }
                if (!$preview_image) {
                    $preview_url = WD_BWG_URL . '/images/no-image.png';
                    $preview_path = WD_BWG_DIR . '/images/no-image.png';
                } else {
                    $preview_url = site_url() . '/' . $WD_BWG_UPLOAD_DIR . $preview_image;
                    $preview_path = ABSPATH . $WD_BWG_UPLOAD_DIR . $preview_image;
                }
                list($image_thumb_width, $image_thumb_height) = getimagesize(htmlspecialchars_decode($preview_path, ENT_COMPAT | ENT_QUOTES));
                $scale = max($params['extended_album_thumb_width'] / $image_thumb_width, $params['extended_album_thumb_height'] / $image_thumb_height);
                $image_thumb_width *= $scale;
                $image_thumb_height *= $scale;
                $thumb_left = ($params['extended_album_thumb_width'] - $image_thumb_width) / 2;
                $thumb_top = ($params['extended_album_thumb_height'] - $image_thumb_height) / 2;
                if ($type != 'gallery') {
                    ?>
                    <div class="bwg_album_extended_div_<?php 
                    echo $bwg;
                    ?>
">
                      <div class="bwg_album_extended_thumb_div_<?php 
                    echo $bwg;
                    ?>
">
                        <a style="font-size: 0;" onclick="spider_frontend_ajax('gal_front_form_<?php 
                    echo $bwg;
                    ?>
', '<?php 
                    echo $bwg;
                    ?>
', 'bwg_album_extended_<?php 
                    echo $bwg;
                    ?>
', '<?php 
                    echo $album_galallery_row->alb_gal_id;
                    ?>
', '<?php 
                    echo $album_gallery_id;
                    ?>
', '<?php 
                    echo $def_type;
                    ?>
')">
                          <span class="bwg_album_thumb_<?php 
                    echo $bwg;
                    ?>
" style="height:inherit;">
                            <span class="bwg_album_thumb_spun1_<?php 
                    echo $bwg;
                    ?>
">
                              <span class="bwg_album_thumb_spun2_<?php 
                    echo $bwg;
                    ?>
">
                                <img style="padding: 0; max-height:none; max-width:none; width:<?php 
                    echo $image_thumb_width;
                    ?>
px; height:<?php 
                    echo $image_thumb_height;
                    ?>
px; margin-left: <?php 
                    echo $thumb_left;
                    ?>
px; margin-top: <?php 
                    echo $thumb_top;
                    ?>
px;" src="<?php 
                    echo $preview_url;
                    ?>
" alt="<?php 
                    echo $title;
                    ?>
" />
                              </span>
                            </span>
                          </span>
                        </a>
                      </div>
                      <div class="bwg_album_extended_text_div_<?php 
                    echo $bwg;
                    ?>
">
                        <?php 
                    if ($title) {
                        ?>
                          <span class="bwg_title_spun_<?php 
                        echo $bwg;
                        ?>
"><?php 
                        echo $title;
                        ?>
</span>
                          <?php 
                    }
                    if ($params['extended_album_description_enable'] && $description) {
                        if (stripos($description, '<!--more-->') !== FALSE) {
                            $description_array = explode('<!--more-->', $description);
                            $description_short = $description_array[0];
                            $description_full = $description_array[1];
                            ?>
                            <span class="bwg_description_spun1_<?php 
                            echo $bwg;
                            ?>
">
                              <span class="bwg_description_spun2_<?php 
                            echo $bwg;
                            ?>
">
                                <span class="bwg_description_short_<?php 
                            echo $bwg;
                            ?>
">
                                  <?php 
                            echo $description_short;
                            ?>
                                </span>
                                <span class="bwg_description_full_<?php 
                            echo $bwg;
                            ?>
">
                                  <?php 
                            echo $description_full;
                            ?>
                                </span>
                              </span>
                              <span class="bwg_description_more_<?php 
                            echo $bwg;
                            ?>
 bwg_more"><?php 
                            echo __('More', 'bwg');
                            ?>
</span>
                            </span>
                            <?php 
                        } else {
                            ?>
                            <span class="bwg_description_spun1_<?php 
                            echo $bwg;
                            ?>
">
                              <span class="bwg_description_short_<?php 
                            echo $bwg;
                            ?>
">
                                <?php 
                            echo $description;
                            ?>
                              </span>
                            </span>
                            <?php 
                        }
                    }
                    ?>
                      </div>
                    </div>
                    <?php 
                }
            }
        } elseif ($type == 'gallery') {
            if (!$page_nav['total']) {
                ?>
                  <span class="bwg_back_<?php 
                echo $bwg;
                ?>
"><?php 
                echo __('Gallery is empty.', 'bwg');
                ?>
</span>
                  <?php 
            }
            foreach ($image_rows as $image_row) {
                $params_array = array('action' => 'GalleryBox', 'current_view' => $bwg, 'image_id' => isset($_POST['image_id']) ? esc_html($_POST['image_id']) : $image_row->id, 'gallery_id' => $album_gallery_id, 'theme_id' => $params['theme_id'], 'thumb_width' => $params['extended_album_image_thumb_width'], 'thumb_height' => $params['extended_album_image_thumb_height'], 'image_width' => $params['popup_width'], 'image_height' => $params['popup_height'], 'image_effect' => $params['popup_effect'], 'sort_by' => $params['sort_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'], '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'], 'watermark_type' => $params['watermark_type'], 'current_url' => $current_url);
                if ($params['watermark_type'] != 'none') {
                    $params_array['watermark_link'] = $params['watermark_link'];
                    $params_array['watermark_opacity'] = $params['watermark_opacity'];
                    $params_array['watermark_position'] = $params['watermark_position'];
                }
                if ($params['watermark_type'] == 'text') {
                    $params_array['watermark_text'] = $params['watermark_text'];
                    $params_array['watermark_font_size'] = $params['watermark_font_size'];
                    $params_array['watermark_font'] = $params['watermark_font'];
                    $params_array['watermark_color'] = $params['watermark_color'];
                } elseif ($params['watermark_type'] == 'image') {
                    $params_array['watermark_url'] = $params['watermark_url'];
                    $params_array['watermark_width'] = $params['watermark_width'];
                    $params_array['watermark_height'] = $params['watermark_height'];
                }
                list($image_thumb_width, $image_thumb_height) = getimagesize(htmlspecialchars_decode(ABSPATH . $WD_BWG_UPLOAD_DIR . $image_row->thumb_url, ENT_COMPAT | ENT_QUOTES));
                $scale = max($params['extended_album_image_thumb_width'] / $image_thumb_width, $params['extended_album_image_thumb_height'] / $image_thumb_height);
                $image_thumb_width *= $scale;
                $image_thumb_height *= $scale;
                $thumb_left = ($params['extended_album_image_thumb_width'] - $image_thumb_width) / 2;
                $thumb_top = ($params['extended_album_image_thumb_height'] - $image_thumb_height) / 2;
                ?>
                  <a style="font-size: 0;" onclick="spider_createpopup('<?php 
                echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php')));
                ?>
', '<?php 
                echo $bwg;
                ?>
', '<?php 
                echo $params['popup_width'];
                ?>
', '<?php 
                echo $params['popup_height'];
                ?>
', 1, 'testpopup', 5); return false;">
                    <span class="bwg_standart_thumb_<?php 
                echo $bwg;
                ?>
">
                      <span class="bwg_standart_thumb_spun1_<?php 
                echo $bwg;
                ?>
">
                        <span class="bwg_standart_thumb_spun2_<?php 
                echo $bwg;
                ?>
">
                          <img style="max-height:none; max-width:none; width:<?php 
                echo $image_thumb_width;
                ?>
px; height:<?php 
                echo $image_thumb_height;
                ?>
px; margin-left: <?php 
                echo $thumb_left;
                ?>
px; margin-top: <?php 
                echo $thumb_top;
                ?>
px;" id="<?php 
                echo $image_row->id;
                ?>
" src="<?php 
                echo site_url() . '/' . $WD_BWG_UPLOAD_DIR . $image_row->thumb_url;
                ?>
" alt="<?php 
                echo $image_row->alt;
                ?>
" />
                          <?php 
                if ($params['extended_album_image_title'] == 'hover') {
                    ?>
                            <span class="bwg_image_title_spun1_<?php 
                    echo $bwg;
                    ?>
">
                              <span class="bwg_image_title_spun2_<?php 
                    echo $bwg;
                    ?>
">
                                <?php 
                    echo $image_row->alt;
                    ?>
                              </span>
                            </span>
                            <?php 
                }
                ?>
                        </span>
                      </span>
                      <?php 
                if ($params['extended_album_image_title'] == 'show') {
                    ?>
                        <span class="bwg_image_title_spun1_<?php 
                    echo $bwg;
                    ?>
">
                          <span class="bwg_image_title_spun2_<?php 
                    echo $bwg;
                    ?>
">
                            <?php 
                    echo $image_row->alt;
                    ?>
                          </span>
                        </span>
                        <?php 
                }
                ?>
                    </span>
                  </a>
                  <?php 
            }
        }
        ?>
              <script>
                jQuery(".bwg_description_more_<?php 
        echo $bwg;
        ?>
").click(function () {
                  if (jQuery(this).hasClass("bwg_more")) {
                    jQuery(this).parent().find(".bwg_description_full_<?php 
        echo $bwg;
        ?>
").show();
                    jQuery(this).attr("class", "bwg_description_more_<?php 
        echo $bwg;
        ?>
 bwg_hide");
                    jQuery(this).html("<?php 
        echo __('Hide', 'bwg');
        ?>
");
                  }
                  else {
                    jQuery(this).parent().find(".bwg_description_full_<?php 
        echo $bwg;
        ?>
").hide();
                    jQuery(this).attr("class", "bwg_description_more_<?php 
        echo $bwg;
        ?>
 bwg_more");
                    jQuery(this).html("<?php 
        echo __('More', 'bwg');
        ?>
");
                  }
                });
              </script>
            </div>
            <?php 
        if ($params['extended_album_enable_page'] && $items_per_page && $theme_row->page_nav_position == 'bottom' && $page_nav['total']) {
            WDWLibrary::ajax_html_frontend_page_nav($theme_row, $page_nav['total'], $page_nav['limit'], 'gal_front_form_' . $bwg, $items_per_page, $bwg, $album_gallery_div_id, $params['album_id']);
        }
        ?>
          </div>
        </form>
        <div id="spider_popup_loading_<?php 
        echo $bwg;
        ?>
" class="spider_popup_loading"></div>
        <div id="spider_popup_overlay_<?php 
        echo $bwg;
        ?>
" class="spider_popup_overlay" onclick="spider_destroypopup(1000)"></div>
      </div>
    </div>
    <?php 
        if ($from_shortcode) {
            return;
        } else {
            die;
        }
    }
 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();
 }
    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['compuct_album_image_title'])) {
            $params['compuct_album_image_title'] = 'none';
        }
        if (!isset($params['compuct_album_view_type'])) {
            $album_view_type = 'thumbnail';
        } else {
            $album_view_type = $params['compuct_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;
        }
        $options_row = $this->model->get_options_row_data();
        if (!isset($params['show_album_name'])) {
            $params['show_album_name'] = $options_row->show_album_name;
        }
        $from = isset($params['from']) ? esc_html($params['from']) : 0;
        $type = isset($_POST['type_' . $bwg]) ? esc_html($_POST['type_' . $bwg]) : (isset($params['type']) ? $params['type'] : 'album');
        $bwg_search = isset($_POST['bwg_search_' . $bwg]) && esc_html($_POST['bwg_search_' . $bwg]) != '' ? esc_html($_POST['bwg_search_' . $bwg]) : '';
        $sort_direction = ' ' . $params['order_by'] . ' ';
        $play_icon = $options_row->play_icon;
        if ($from === "widget") {
            $params['album_id'] = $params['id'];
            $params['sort_by'] = $params['show'] == 'random' ? 'RAND()' : 'order';
            if ($params['show'] == 'last') {
                $sort_direction = ' DESC ';
            }
            $params['compuct_albums_per_page'] = $params['count'];
            $params['compuct_album_column_number'] = $options_row->album_column_number;
            $params['compuct_album_image_column_number'] = $options_row->image_column_number;
            $params['compuct_album_thumb_width'] = $params['width'];
            $params['compuct_album_thumb_height'] = $params['height'];
            $params['compuct_album_image_thumb_width'] = $params['width'];
            $params['compuct_album_image_thumb_height'] = $params['height'];
            $params['compuct_album_title'] = $options_row->album_title_show_hover;
            $params['compuct_album_enable_page'] = 0;
            $params['compuct_album_image_title'] = $options_row->image_title_show_hover;
            $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 {
            $items_per_page = $params['compuct_albums_per_page'];
            $items_col_num = $params['compuct_album_column_number'];
            $album_galleries_row = $this->model->get_alb_gals_row($album_gallery_id, $items_per_page, 'order', $bwg, ' ASC ');
            if (!$album_galleries_row) {
                echo WDWLibrary::message(__('There is no album selected or the album was deleted.', 'bwg'), 'error');
                return;
            }
            $page_nav = $this->model->album_page_nav($album_gallery_id, $items_per_page, $bwg);
            $album_gallery_div_id = 'bwg_album_compact_' . $bwg;
            $album_gallery_div_class = 'bwg_album_thumbnails_' . $bwg;
        }
        if ($type == 'gallery') {
            if ($album_view_type == 'masonry') {
                $form_child_div_style = 'background-color:rgba(0, 0, 0, 0); position:relative; text-align:' . $theme_row->masonry_thumb_align . '; width:100%;';
                $form_child_div_id = 'bwg_masonry_thumbnails_div_' . $bwg;
                $album_gallery_div_id = 'bwg_masonry_thumbnails_' . $bwg;
                $album_gallery_div_class = 'bwg_masonry_thumbnails_' . $bwg;
            } else {
                $form_child_div_style = 'background-color:rgba(0, 0, 0, 0); position:relative; text-align:' . $theme_row->thumb_align . '; width:100%;';
                $form_child_div_id = '';
            }
        } else {
            $form_child_div_id = '';
            $form_child_div_style = 'background-color:rgba(0, 0, 0, 0); position:relative; text-align:' . $theme_row->album_compact_thumb_align . '; width:100%;';
        }
        $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_compact_thumbs_bg_color = WDWLibrary::spider_hex2rgb($theme_row->album_compact_thumbs_bg_color);
        $rgb_thumbs_bg_color = WDWLibrary::spider_hex2rgb($theme_row->thumbs_bg_color);
        ?>
	
    <style>
      /*Album thumbs styles.*/
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_album_thumb_<?php 
        echo $bwg;
        ?>
 {
        display: inline-block;
        text-align: center;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .<?php 
        echo $album_gallery_div_class;
        ?>
 * {
        -moz-box-sizing: content-box;
        box-sizing: content-box;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_album_thumb_spun1_<?php 
        echo $bwg;
        ?>
 {
        background-color: #<?php 
        echo $theme_row->album_compact_thumb_bg_color;
        ?>
;
        display: inline-block;
        height: <?php 
        echo $params['compuct_album_thumb_height'];
        ?>
px;
        margin: <?php 
        echo $theme_row->album_compact_thumb_margin;
        ?>
px;
        opacity: <?php 
        echo number_format($theme_row->album_compact_thumb_transparent / 100, 2, ".", "");
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $theme_row->album_compact_thumb_transparent;
        ?>
);
        <?php 
        echo $theme_row->album_compact_thumb_transition ? 'transition: all 0.3s ease 0s;-webkit-transition: all 0.3s ease 0s;' : '';
        ?>
        padding: <?php 
        echo $theme_row->album_compact_thumb_padding;
        ?>
px;
        text-align: center;
        vertical-align: middle;
        width: <?php 
        echo $params['compuct_album_thumb_width'];
        ?>
px;
        z-index: 100;
        -webkit-backface-visibility: visible;
        -ms-backface-visibility: visible;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_album_thumb_spun1_<?php 
        echo $bwg;
        ?>
:hover {
        opacity: 1;
        filter: Alpha(opacity=100);
        transform: <?php 
        echo $theme_row->album_compact_thumb_hover_effect;
        ?>
(<?php 
        echo $theme_row->album_compact_thumb_hover_effect_value;
        ?>
);
        -ms-transform: <?php 
        echo $theme_row->album_compact_thumb_hover_effect;
        ?>
(<?php 
        echo $theme_row->album_compact_thumb_hover_effect_value;
        ?>
);
        -webkit-transform: <?php 
        echo $theme_row->album_compact_thumb_hover_effect;
        ?>
(<?php 
        echo $theme_row->album_compact_thumb_hover_effect_value;
        ?>
);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        -moz-backface-visibility: hidden;
        -ms-backface-visibility: hidden;
        z-index: 102;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_album_thumb_spun2_<?php 
        echo $bwg;
        ?>
 {
        border-radius: <?php 
        echo $theme_row->album_compact_thumb_border_radius;
        ?>
;
        border: <?php 
        echo $theme_row->album_compact_thumb_border_width;
        ?>
px <?php 
        echo $theme_row->album_compact_thumb_border_style;
        ?>
 #<?php 
        echo $theme_row->album_compact_thumb_border_color;
        ?>
;
        box-shadow: <?php 
        echo $theme_row->album_compact_thumb_box_shadow;
        ?>
;
        display: inline-block;
        height: <?php 
        echo $params['compuct_album_thumb_height'];
        ?>
px;
        overflow: hidden;
        width: <?php 
        echo $params['compuct_album_thumb_width'];
        ?>
px;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_album_thumbnails_<?php 
        echo $bwg;
        ?>
 {
        display: inline-block;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
        background-color: rgba(<?php 
        echo $rgb_album_compact_thumbs_bg_color['red'];
        ?>
, <?php 
        echo $rgb_album_compact_thumbs_bg_color['green'];
        ?>
, <?php 
        echo $rgb_album_compact_thumbs_bg_color['blue'];
        ?>
, <?php 
        echo number_format($theme_row->album_compact_thumb_bg_transparent / 100, 2, ".", "");
        ?>
);
        font-size: 0;
        text-align: <?php 
        echo $theme_row->album_compact_thumb_align;
        ?>
;
        max-width: <?php 
        echo $items_col_num * ($params['compuct_album_thumb_width'] + 2 * (2 + $theme_row->album_compact_thumb_margin + $theme_row->album_compact_thumb_padding + $theme_row->album_compact_thumb_border_width));
        ?>
px;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_album_thumbnails_<?php 
        echo $bwg;
        ?>
 .bwg_link {
        border: none;
        cursor: pointer;
        text-decoration: none;
        font-size: 0;
      }
      <?php 
        if ($params['compuct_album_title'] == 'show') {
            /* Show album/gallery title at the bottom.*/
            ?>
        #bwg_container1_<?php 
            echo $bwg;
            ?>
 #bwg_container2_<?php 
            echo $bwg;
            ?>
 .bwg_title_spun1_<?php 
            echo $bwg;
            ?>
 {
          display: block;
          opacity: 1;
          filter: Alpha(opacity=100);
          text-align: center;
          width: <?php 
            echo $params['compuct_album_thumb_width'];
            ?>
px;
        }
        <?php 
        } elseif ($params['compuct_album_title'] == 'hover') {
            /* Show album/gallery title on hover.*/
            ?>
        #bwg_container1_<?php 
            echo $bwg;
            ?>
 #bwg_container2_<?php 
            echo $bwg;
            ?>
 .bwg_title_spun1_<?php 
            echo $bwg;
            ?>
 {
          display: table;
          height: inherit;
          left: -3000px;
          opacity: 0;
          filter: Alpha(opacity=0);
          position: absolute;
          top: 0px;
          width: inherit;
        }
        <?php 
        }
        ?>
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_album_thumb_spun1_<?php 
        echo $bwg;
        ?>
:hover .bwg_title_spun1_<?php 
        echo $bwg;
        ?>
 {
        left: <?php 
        echo $theme_row->album_compact_thumb_padding;
        ?>
px;
        top: <?php 
        echo $theme_row->album_compact_thumb_padding;
        ?>
px;
        opacity: 1;
        filter: Alpha(opacity=100);
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_title_spun2_<?php 
        echo $bwg;
        ?>
 {
        color: #<?php 
        echo $theme_row->album_compact_title_font_color;
        ?>
;
        display: table-cell;
        font-family: <?php 
        echo $theme_row->album_compact_title_font_style;
        ?>
;
        font-size: <?php 
        echo $theme_row->album_compact_title_font_size;
        ?>
px;
        font-weight: <?php 
        echo $theme_row->album_compact_title_font_weight;
        ?>
;
        height: inherit;
        padding: <?php 
        echo $theme_row->album_compact_title_margin;
        ?>
;
        text-shadow: <?php 
        echo $theme_row->album_compact_title_shadow;
        ?>
;
        vertical-align: middle;
        width: inherit;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_album_thumbnails_<?php 
        echo $bwg;
        ?>
 {
        display: inline-block;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
        background-color: rgba(<?php 
        echo $rgb_album_compact_thumbs_bg_color['red'];
        ?>
, <?php 
        echo $rgb_album_compact_thumbs_bg_color['green'];
        ?>
, <?php 
        echo $rgb_album_compact_thumbs_bg_color['blue'];
        ?>
, <?php 
        echo number_format($theme_row->album_compact_thumb_bg_transparent / 100, 2, ".", "");
        ?>
);
        font-size: 0;
        text-align: <?php 
        echo $theme_row->album_compact_thumb_align;
        ?>
;
        max-width: <?php 
        echo $items_col_num * ($params['compuct_album_thumb_width'] + 2 * (2 + $theme_row->album_compact_thumb_margin + $theme_row->album_compact_thumb_padding + $theme_row->album_compact_thumb_border_width));
        ?>
px;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_album_thumbnails_<?php 
        echo $bwg;
        ?>
 .bwg_link {
        border: none;
        cursor: pointer;
        text-decoration: none;
        font-size: 0;
      }
      /*Image thumbs styles.*/
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_standart_thumb_spun1_<?php 
        echo $bwg;
        ?>
 {
        background-color: #<?php 
        echo $theme_row->thumb_bg_color;
        ?>
;
        display: inline-block;
        height: <?php 
        echo $params['compuct_album_image_thumb_height'];
        ?>
px;
        margin: <?php 
        echo $theme_row->thumb_margin;
        ?>
px;
        opacity: <?php 
        echo number_format($theme_row->thumb_transparent / 100, 2, ".", "");
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $theme_row->thumb_transparent;
        ?>
);
        <?php 
        echo $theme_row->thumb_transition ? 'transition: all 0.3s ease 0s;-webkit-transition: all 0.3s ease 0s;' : '';
        ?>
        padding: <?php 
        echo $theme_row->thumb_padding;
        ?>
px;
        text-align: center;
        vertical-align: middle;
        width: <?php 
        echo $params['compuct_album_image_thumb_width'];
        ?>
px;
        z-index: 100;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_standart_thumb_spun1_<?php 
        echo $bwg;
        ?>
:hover {
        -ms-transform: <?php 
        echo $theme_row->thumb_hover_effect;
        ?>
(<?php 
        echo $theme_row->thumb_hover_effect_value;
        ?>
);
        -webkit-transform: <?php 
        echo $theme_row->thumb_hover_effect;
        ?>
(<?php 
        echo $theme_row->thumb_hover_effect_value;
        ?>
);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        -moz-backface-visibility: hidden;
        -ms-backface-visibility: hidden;
        opacity: 1;
        filter: Alpha(opacity=100);
        transform: <?php 
        echo $theme_row->thumb_hover_effect;
        ?>
(<?php 
        echo $theme_row->thumb_hover_effect_value;
        ?>
);
        z-index: 102;
        position: relative;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_standart_thumb_spun2_<?php 
        echo $bwg;
        ?>
 {
        border-radius: <?php 
        echo $theme_row->thumb_border_radius;
        ?>
;
        border: <?php 
        echo $theme_row->thumb_border_width;
        ?>
px <?php 
        echo $theme_row->thumb_border_style;
        ?>
 #<?php 
        echo $theme_row->thumb_border_color;
        ?>
;
        box-shadow: <?php 
        echo $theme_row->thumb_box_shadow;
        ?>
;
        display: inline-block;
        height: <?php 
        echo $params['compuct_album_image_thumb_height'];
        ?>
px;
        overflow: hidden;
        width: <?php 
        echo $params['compuct_album_image_thumb_width'];
        ?>
px;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_standart_thumbnails_<?php 
        echo $bwg;
        ?>
 {
        -moz-box-sizing: border-box;
        display: inline-block;
        background-color: rgba(<?php 
        echo $rgb_thumbs_bg_color['red'];
        ?>
, <?php 
        echo $rgb_thumbs_bg_color['green'];
        ?>
, <?php 
        echo $rgb_thumbs_bg_color['blue'];
        ?>
, <?php 
        echo number_format($theme_row->thumb_bg_transparent / 100, 2, ".", "");
        ?>
);
        box-sizing: border-box;
        font-size: 0;
        max-width: <?php 
        echo $params['compuct_album_image_column_number'] * ($params['compuct_album_image_thumb_width'] + 2 * (2 + $theme_row->thumb_margin + $theme_row->thumb_padding + $theme_row->thumb_border_width));
        ?>
px;
        text-align: <?php 
        echo $theme_row->thumb_align;
        ?>
;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_standart_thumbnails_<?php 
        echo $bwg;
        ?>
 .bwg_link {
        border: none;
        cursor: pointer;
        text-decoration: none;
        font-size: 0;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_standart_thumb_<?php 
        echo $bwg;
        ?>
 {
        display: inline-block;
        text-align: center;
      }
      <?php 
        if ($params['compuct_album_image_title'] == 'show') {
            /* Show image title at the bottom.*/
            ?>
        #bwg_container1_<?php 
            echo $bwg;
            ?>
 #bwg_container2_<?php 
            echo $bwg;
            ?>
 .bwg_image_title_spun1_<?php 
            echo $bwg;
            ?>
 {
          display: block;
          margin: 0 auto;
          opacity: 1;
          filter: Alpha(opacity=100);
          text-align: center;
          width: <?php 
            echo $params['compuct_album_thumb_width'];
            ?>
px;
        }
        <?php 
        } elseif ($params['compuct_album_image_title'] == 'hover') {
            /* Show image title on hover.*/
            ?>
        #bwg_container1_<?php 
            echo $bwg;
            ?>
 #bwg_container2_<?php 
            echo $bwg;
            ?>
 .bwg_image_title_spun1_<?php 
            echo $bwg;
            ?>
 {
          display: table;
          height: inherit;
          left: -3000px;
          opacity: 0;
          filter: Alpha(opacity=0);
          position: absolute;
          top: 0px;
          width: inherit;
        }
        <?php 
        }
        ?>
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_standart_thumb_spun1_<?php 
        echo $bwg;
        ?>
:hover .bwg_image_title_spun1_<?php 
        echo $bwg;
        ?>
 {
        left: <?php 
        echo $theme_row->thumb_padding;
        ?>
px;
        top: <?php 
        echo $theme_row->thumb_padding;
        ?>
px;
        opacity: 1;
        filter: Alpha(opacity=100);
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_image_title_spun2_<?php 
        echo $bwg;
        ?>
 {
        color: #<?php 
        echo $theme_row->thumb_title_font_color;
        ?>
;
        display: table-cell;
        font-family: <?php 
        echo $theme_row->thumb_title_font_style;
        ?>
;
        font-size: <?php 
        echo $theme_row->thumb_title_font_size;
        ?>
px;
        font-weight: <?php 
        echo $theme_row->thumb_title_font_weight;
        ?>
;
        height: inherit;
        margin: <?php 
        echo $theme_row->thumb_title_margin;
        ?>
;
        text-shadow: <?php 
        echo $theme_row->thumb_title_shadow;
        ?>
;
        vertical-align: middle;
        width: inherit;
        word-wrap: break-word;
      }
      /*Pagination styles.*/
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 {
        text-align: <?php 
        echo $theme_row->page_nav_align;
        ?>
;
        font-size: <?php 
        echo $theme_row->page_nav_font_size;
        ?>
px;
        font-family: <?php 
        echo $theme_row->page_nav_font_style;
        ?>
;
        font-weight: <?php 
        echo $theme_row->page_nav_font_weight;
        ?>
;
        color: #<?php 
        echo $theme_row->page_nav_font_color;
        ?>
;
        margin: 6px 0 4px;
        display: block;
        height: 30px;
        line-height: 30px;
      }
      @media only screen and (max-width : 320px) {
        #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .displaying-num_<?php 
        echo $bwg;
        ?>
 {
          display: none;
        }
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .displaying-num_<?php 
        echo $bwg;
        ?>
 {
        font-size: <?php 
        echo $theme_row->page_nav_font_size;
        ?>
px;
        font-family: <?php 
        echo $theme_row->page_nav_font_style;
        ?>
;
        font-weight: <?php 
        echo $theme_row->page_nav_font_weight;
        ?>
;
        color: #<?php 
        echo $theme_row->page_nav_font_color;
        ?>
;
        margin-right: 10px;
        vertical-align: middle;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .paging-input_<?php 
        echo $bwg;
        ?>
 {
        font-size: <?php 
        echo $theme_row->page_nav_font_size;
        ?>
px;
        font-family: <?php 
        echo $theme_row->page_nav_font_style;
        ?>
;
        font-weight: <?php 
        echo $theme_row->page_nav_font_weight;
        ?>
;
        color: #<?php 
        echo $theme_row->page_nav_font_color;
        ?>
;
        vertical-align: middle;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 a.disabled,
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 a.disabled:hover,
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 a.disabled:focus {
        cursor: default;
        color: rgba(<?php 
        echo $rgb_page_nav_font_color['red'];
        ?>
, <?php 
        echo $rgb_page_nav_font_color['green'];
        ?>
, <?php 
        echo $rgb_page_nav_font_color['blue'];
        ?>
, 0.5);
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 a {
        cursor: pointer;
        font-size: <?php 
        echo $theme_row->page_nav_font_size;
        ?>
px;
        font-family: <?php 
        echo $theme_row->page_nav_font_style;
        ?>
;
        font-weight: <?php 
        echo $theme_row->page_nav_font_weight;
        ?>
;
        color: #<?php 
        echo $theme_row->page_nav_font_color;
        ?>
;
        text-decoration: none;
        padding: <?php 
        echo $theme_row->page_nav_padding;
        ?>
;
        margin: <?php 
        echo $theme_row->page_nav_margin;
        ?>
;
        border-radius: <?php 
        echo $theme_row->page_nav_border_radius;
        ?>
;
        border-style: <?php 
        echo $theme_row->page_nav_border_style;
        ?>
;
        border-width: <?php 
        echo $theme_row->page_nav_border_width;
        ?>
px;
        border-color: #<?php 
        echo $theme_row->page_nav_border_color;
        ?>
;
        background-color: #<?php 
        echo $theme_row->page_nav_button_bg_color;
        ?>
;
        opacity: <?php 
        echo number_format($theme_row->page_nav_button_bg_transparent / 100, 2, ".", "");
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $theme_row->page_nav_button_bg_transparent;
        ?>
);
        box-shadow: <?php 
        echo $theme_row->page_nav_box_shadow;
        ?>
;
        <?php 
        echo $theme_row->page_nav_button_transition ? 'transition: all 0.3s ease 0s;-webkit-transition: all 0.3s ease 0s;' : '';
        ?>
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_back_<?php 
        echo $bwg;
        ?>
 {
        background-color: rgba(0, 0, 0, 0);
        color: #<?php 
        echo $theme_row->album_compact_back_font_color;
        ?>
 !important;
        cursor: pointer;
        display: block;
        font-family: <?php 
        echo $theme_row->album_compact_back_font_style;
        ?>
;
        font-size: <?php 
        echo $theme_row->album_compact_back_font_size;
        ?>
px;
        font-weight: <?php 
        echo $theme_row->album_compact_back_font_weight;
        ?>
;
        text-decoration: none;
        padding: <?php 
        echo $theme_row->album_compact_back_padding;
        ?>
;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 #spider_popup_overlay_<?php 
        echo $bwg;
        ?>
 {
        background-color: #<?php 
        echo $theme_row->lightbox_overlay_bg_color;
        ?>
;
        opacity: <?php 
        echo number_format($theme_row->lightbox_overlay_bg_transparent / 100, 2, ".", "");
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $theme_row->lightbox_overlay_bg_transparent;
        ?>
);
      }
      .bwg_play_icon_spun_<?php 
        echo $bwg;
        ?>
	 {
        width: inherit;
        height: inherit;
        display: table;
        position: absolute;
      }	 
     .bwg_play_icon_<?php 
        echo $bwg;
        ?>
 {
        color: #<?php 
        echo $theme_row->thumb_title_font_color;
        ?>
;
        font-size: <?php 
        echo 2 * $theme_row->thumb_title_font_size;
        ?>
px;
        vertical-align: middle;
        display: table-cell !important;
        z-index: 1;
        text-align: center;
        margin: 0 auto;
      }
    </style>
		<?php 
        $album_row = $this->model->get_album_row_data($album_gallery_id);
        ?>
				
    <div id="bwg_container1_<?php 
        echo $bwg;
        ?>
">
      <div id="bwg_container2_<?php 
        echo $bwg;
        ?>
">
        <form id="gal_front_form_<?php 
        echo $bwg;
        ?>
" method="post" action="#">
          <?php 
        if ($params['show_search_box'] && $type == 'gallery') {
            WDWLibrary::ajax_html_frontend_search_box('gal_front_form_' . $bwg, $bwg, $album_gallery_div_id, $images_count, $params['search_box_width']);
        }
        if (isset($params['show_sort_images']) && $params['show_sort_images'] && $type == 'gallery') {
            WDWLibrary::ajax_html_frontend_sort_box('gal_front_form_' . $bwg, $bwg, $album_gallery_div_id, $params['sort_by'], $params['search_box_width']);
        }
        ?>
          <div id="<?php 
        echo $form_child_div_id;
        ?>
" style="<?php 
        echo $form_child_div_style;
        ?>
">
            <div id="ajax_loading_<?php 
        echo $bwg;
        ?>
" style="position:absolute;width: 100%; z-index: 115; text-align: center; height: 100%; vertical-align: middle; display: none;">
              <div style="display: table; vertical-align: middle; width: 100%; height: 100%; background-color: #FFFFFF; opacity: 0.7; filter: Alpha(opacity=70);">
                <div style="display: table-cell; text-align: center; position: relative; vertical-align: middle;" >
                  <div id="loading_div_<?php 
        echo $bwg;
        ?>
" style="display: inline-block; text-align:center; position:relative; vertical-align:middle;">
                    <img src="<?php 
        echo WD_BWG_URL . '/images/ajax_loader.png';
        ?>
" class="spider_ajax_loading" style="float: none; width:50px;">
                  </div>
                </div>
              </div>
            </div>
            <?php 
        if ($params['compuct_album_enable_page'] && $items_per_page && $theme_row->page_nav_position == 'top' && $page_nav['total']) {
            WDWLibrary::ajax_html_frontend_page_nav($theme_row, $page_nav['total'], $page_nav['limit'], 'gal_front_form_' . $bwg, $items_per_page, $bwg, $album_gallery_div_id, $params['album_id'], $type);
        }
        if ($bwg_previous_album_id) {
            ?>
              <a class="bwg_back_<?php 
            echo $bwg;
            ?>
" onclick="spider_frontend_ajax('gal_front_form_<?php 
            echo $bwg;
            ?>
', '<?php 
            echo $bwg;
            ?>
', '<?php 
            echo $album_gallery_div_id;
            ?>
', 'back')"><?php 
            echo __('Back', 'bwg');
            ?>
</a>
              <?php 
        }
        if ($options_row->show_album_name) {
            if ($type == 'gallery') {
                ?>
              <div class="bwg_back_<?php 
                echo $bwg;
                ?>
" ><?php 
                echo isset($_POST['title_' . $bwg]) ? esc_html($_POST['title_' . $bwg]) : '';
                ?>
</div>
              <?php 
            } else {
                ?>
	      <div class="bwg_back_<?php 
                echo $bwg;
                ?>
"><?php 
                echo $album_row->name;
                ?>
</div>
	      	<?php 
            }
        }
        ?>
            <div id="<?php 
        echo $album_gallery_div_id;
        ?>
" class="<?php 
        echo $album_gallery_div_class;
        ?>
" >
              <input type="hidden" id="bwg_previous_album_id_<?php 
        echo $bwg;
        ?>
" name="bwg_previous_album_id_<?php 
        echo $bwg;
        ?>
" value="<?php 
        echo $bwg_previous_album_id;
        ?>
" />
              <input type="hidden" id="bwg_previous_album_page_number_<?php 
        echo $bwg;
        ?>
" name="bwg_previous_album_page_number_<?php 
        echo $bwg;
        ?>
" value="<?php 
        echo $bwg_previous_album_page_number;
        ?>
" />
              <?php 
        if ($type != 'gallery') {
            if (!$page_nav['total']) {
                ?>
                  <span class="bwg_back_<?php 
                echo $bwg;
                ?>
"><?php 
                echo __('Album is empty.', 'bwg');
                ?>
</span>
                  <?php 
            }
            foreach ($album_galleries_row as $album_galallery_row) {
                if ($album_galallery_row->is_album) {
                    $album_row = $this->model->get_album_row_data($album_galallery_row->alb_gal_id);
                    if (!$album_row) {
                        continue;
                    }
                    $preview_image = $album_row->preview_image;
                    if (!$preview_image) {
                        $preview_image = $album_row->random_preview_image;
                    }
                    $def_type = 'album';
                    $title = $album_row->name;
                    $permalink = $album_row->permalink;
                } else {
                    $gallery_row = $this->model->get_gallery_row_data($album_galallery_row->alb_gal_id);
                    if (!$gallery_row) {
                        continue;
                    }
                    $preview_image = $gallery_row->preview_image;
                    if (!$preview_image) {
                        $preview_image = $gallery_row->random_preview_image;
                    }
                    $def_type = 'gallery';
                    $title = $gallery_row->name;
                    $permalink = $gallery_row->permalink;
                }
                $local_preview_image = true;
                $parsed_prev_url = parse_url($preview_image, PHP_URL_SCHEME);
                if ($parsed_prev_url == 'http' || $parsed_prev_url == 'https') {
                    $local_preview_image = false;
                }
                if (!$preview_image) {
                    $preview_url = WD_BWG_URL . '/images/no-image.png';
                    $preview_path = WD_BWG_DIR . '/images/no-image.png';
                } else {
                    if ($local_preview_image) {
                        $preview_url = site_url() . '/' . $WD_BWG_UPLOAD_DIR . $preview_image;
                        $preview_path = ABSPATH . $WD_BWG_UPLOAD_DIR . $preview_image;
                    } else {
                        $preview_url = $preview_image;
                        $preview_path = $preview_image;
                    }
                }
                if ($local_preview_image) {
                    list($image_thumb_width, $image_thumb_height) = getimagesize(htmlspecialchars_decode($preview_path, ENT_COMPAT | ENT_QUOTES));
                    $scale = max($params['compuct_album_thumb_width'] / $image_thumb_width, $params['compuct_album_thumb_height'] / $image_thumb_height);
                    $image_thumb_width *= $scale;
                    $image_thumb_height *= $scale;
                    $thumb_left = ($params['compuct_album_thumb_width'] - $image_thumb_width) / 2;
                    $thumb_top = ($params['compuct_album_thumb_height'] - $image_thumb_height) / 2;
                } else {
                    $image_thumb_width = $params['compuct_album_thumb_width'];
                    $image_thumb_height = $params['compuct_album_thumb_height'];
                    $thumb_left = 0;
                    $thumb_top = 0;
                }
                if ($type != 'gallery') {
                    ?>
                    <a class="bwg_link" <?php 
                    echo "href='" . ($from !== "widget" ? $local_preview_image ? str_replace("/thumb/", "/", $preview_url) : $preview_url : $permalink) . "'";
                    ?>
 
                    <?php 
                    echo $from !== "widget" ? " onclick=\"spider_frontend_ajax('gal_front_form_" . $bwg . "', '" . $bwg . "', 'bwg_album_compact_" . $bwg . "', '" . $album_galallery_row->alb_gal_id . "', '" . $album_gallery_id . "', '" . $def_type . "', '', '" . htmlspecialchars(addslashes($title)) . "', 'default'); return false;\"" : 'onclick="window.location=' . "'" . $permalink . "'" . '"';
                    ?>
>  
                      <span class="bwg_album_thumb_<?php 
                    echo $bwg;
                    ?>
">
                        <?php 
                    if ($params['compuct_album_title'] == 'show' && $theme_row->album_compact_thumb_title_pos == 'top') {
                        ?>
                          <span class="bwg_title_spun1_<?php 
                        echo $bwg;
                        ?>
">
                            <span class="bwg_title_spun2_<?php 
                        echo $bwg;
                        ?>
">
                              <?php 
                        echo $title;
                        ?>
                            </span>
                          </span>
                          <?php 
                    }
                    ?>
                        <span class="bwg_album_thumb_spun1_<?php 
                    echo $bwg;
                    ?>
">
                          <span class="bwg_album_thumb_spun2_<?php 
                    echo $bwg;
                    ?>
">
                            <img style="padding: 0 !important; max-height: none !important; max-width: none !important; width: <?php 
                    echo $image_thumb_width;
                    ?>
px; height:<?php 
                    echo $image_thumb_height;
                    ?>
px; margin-left: <?php 
                    echo $thumb_left;
                    ?>
px; margin-top: <?php 
                    echo $thumb_top;
                    ?>
px;" src="<?php 
                    echo $preview_url;
                    ?>
" alt="<?php 
                    echo $title;
                    ?>
" />
                            <?php 
                    if ($params['compuct_album_title'] == 'hover') {
                        ?>
                              <span class="bwg_title_spun1_<?php 
                        echo $bwg;
                        ?>
">
                                <span class="bwg_title_spun2_<?php 
                        echo $bwg;
                        ?>
">
                                  <?php 
                        echo $title;
                        ?>
                                </span>
                              </span>
                              <?php 
                    }
                    ?>
                          </span>
                        </span>
                        <?php 
                    if ($params['compuct_album_title'] == 'show' && $theme_row->album_compact_thumb_title_pos == 'bottom') {
                        ?>
                          <span class="bwg_title_spun1_<?php 
                        echo $bwg;
                        ?>
">
                            <span class="bwg_title_spun2_<?php 
                        echo $bwg;
                        ?>
">
                              <?php 
                        echo $title;
                        ?>
                            </span>
                          </span>
                          <?php 
                    }
                    ?>
                      </span>
                    </a>
                    <?php 
                }
            }
        } elseif ($type == 'gallery') {
            if (!$page_nav['total']) {
                if ($bwg_search != '') {
                    ?>
                    <span class="bwg_back_<?php 
                    echo $bwg;
                    ?>
"><?php 
                    echo __('There are no images matching your search.', 'bwg');
                    ?>
</span>
                    <?php 
                } else {
                    ?>
                    <span class="bwg_back_<?php 
                    echo $bwg;
                    ?>
"><?php 
                    echo __('Gallery is empty.', 'bwg');
                    ?>
</span>
                    <?php 
                }
            }
            foreach ($image_rows as $image_row) {
                $params_array = array('action' => 'GalleryBox', 'current_view' => $bwg, 'image_id' => isset($_POST['image_id']) ? esc_html($_POST['image_id']) : $image_row->id, 'gallery_id' => $album_gallery_id, 'theme_id' => $params['theme_id'], 'thumb_width' => $params['compuct_album_image_thumb_width'], 'thumb_height' => $params['compuct_album_image_thumb_height'], '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' => $params['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);
                if ($params['watermark_type'] != 'none') {
                    $params_array['watermark_link'] = $params['watermark_link'];
                    $params_array['watermark_opacity'] = $params['watermark_opacity'];
                    $params_array['watermark_position'] = $params['watermark_position'];
                }
                if ($params['watermark_type'] == 'text') {
                    $params_array['watermark_text'] = $params['watermark_text'];
                    $params_array['watermark_font_size'] = $params['watermark_font_size'];
                    $params_array['watermark_font'] = $params['watermark_font'];
                    $params_array['watermark_color'] = $params['watermark_color'];
                } elseif ($params['watermark_type'] == 'image') {
                    $params_array['watermark_url'] = $params['watermark_url'];
                    $params_array['watermark_width'] = $params['watermark_width'];
                    $params_array['watermark_height'] = $params['watermark_height'];
                }
                $is_video = $image_row->filetype == "YOUTUBE" || $image_row->filetype == "VIMEO";
                $is_embed = preg_match('/EMBED/', $image_row->filetype) == 1 ? true : false;
                $is_embed_video = preg_match('/VIDEO/', $image_row->filetype) == 1 ? true : false;
                if (!$is_embed) {
                    list($image_thumb_width, $image_thumb_height) = getimagesize(htmlspecialchars_decode(ABSPATH . $WD_BWG_UPLOAD_DIR . $image_row->thumb_url, ENT_COMPAT | ENT_QUOTES));
                } else {
                    if ($image_row->resolution != '') {
                        $resolution_arr = explode(" ", $image_row->resolution);
                        $resolution_w = intval($resolution_arr[0]);
                        $resolution_h = intval($resolution_arr[2]);
                        if ($resolution_w != 0 && $resolution_h != 0) {
                            $scale = $scale = max($params['compuct_album_image_thumb_width'] / $resolution_w, $params['compuct_album_image_thumb_height'] / $resolution_h);
                            $image_thumb_width = $resolution_w * $scale;
                            $image_thumb_height = $resolution_h * $scale;
                        } else {
                            $image_thumb_width = $params['compuct_album_image_thumb_width'];
                            $image_thumb_height = $params['compuct_album_image_thumb_height'];
                        }
                    } else {
                        $image_thumb_width = $params['compuct_album_image_thumb_width'];
                        $image_thumb_height = $params['compuct_album_image_thumb_height'];
                    }
                }
                $scale = max($params['compuct_album_image_thumb_width'] / $image_thumb_width, $params['compuct_album_image_thumb_height'] / $image_thumb_height);
                $image_thumb_width *= $scale;
                $image_thumb_height *= $scale;
                $thumb_left = ($params['compuct_album_image_thumb_width'] - $image_thumb_width) / 2;
                $thumb_top = ($params['compuct_album_image_thumb_height'] - $image_thumb_height) / 2;
                ?>
                  <a class="bwg_link" <?php 
                echo $params['thumb_click_action'] == 'open_lightbox' ? 'href="' . ($is_embed ? $image_row->thumb_url : site_url() . '/' . $WD_BWG_UPLOAD_DIR . $image_row->image_url) . '"' : ($image_row->redirect_url ? 'href="' . $image_row->redirect_url . '"' : '');
                ?>
 
                  <?php 
                echo $params['thumb_click_action'] == 'open_lightbox' ? ' onclick="spider_createpopup(\'' . addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))) . '\', ' . $bwg . ', ' . $params['popup_width'] . ', ' . $params['popup_height'] . ', 1, \'testpopup\', 5); return false;"' : ($image_row->redirect_url ? $params['thumb_link_target'] ? ' onclick="window.open(' . "'" . $image_row->redirect_url . "'," . "'" . '_blank' . "'" . ')"' : 'onclick="window.location=' . "'" . $image_row->redirect_url . "'" . '"' : '');
                ?>
>

                    <span class="bwg_standart_thumb_<?php 
                echo $bwg;
                ?>
">
                      <?php 
                if ($params['compuct_album_image_title'] == 'show' && $theme_row->album_compact_thumb_title_pos == 'top') {
                    ?>
                        <span class="bwg_image_title_spun1_<?php 
                    echo $bwg;
                    ?>
">
                          <span class="bwg_image_title_spun2_<?php 
                    echo $bwg;
                    ?>
">
                            <?php 
                    echo $image_row->alt;
                    ?>
                          </span>
                        </span>
                        <?php 
                }
                ?>
                      <span class="bwg_standart_thumb_spun1_<?php 
                echo $bwg;
                ?>
">
                        <span class="bwg_standart_thumb_spun2_<?php 
                echo $bwg;
                ?>
">
                          <?php 
                if ($play_icon && $is_embed_video) {
                    ?>
                          <span class="bwg_play_icon_spun_<?php 
                    echo $bwg;
                    ?>
">
                             <i title="<?php 
                    echo __('Play', 'bwg');
                    ?>
"  class="fa fa-play bwg_play_icon_<?php 
                    echo $bwg;
                    ?>
"></i>
                          </span>
                            <?php 
                }
                if ($params['compuct_album_image_title'] == 'hover') {
                    ?>
                            <span class="bwg_image_title_spun1_<?php 
                    echo $bwg;
                    ?>
">
                              <span class="bwg_image_title_spun2_<?php 
                    echo $bwg;
                    ?>
">
                                <?php 
                    echo $image_row->alt;
                    ?>
                              </span>
                            </span>
                            <?php 
                }
                ?>
                          <img style="max-height:none; max-width:none; width:<?php 
                echo $image_thumb_width;
                ?>
px; height:<?php 
                echo $image_thumb_height;
                ?>
px; margin-left: <?php 
                echo $thumb_left;
                ?>
px; margin-top: <?php 
                echo $thumb_top;
                ?>
px;" id="<?php 
                echo $image_row->id;
                ?>
" src="<?php 
                echo ($is_embed ? "" : site_url() . '/' . $WD_BWG_UPLOAD_DIR) . $image_row->thumb_url;
                ?>
" alt="<?php 
                echo $image_row->alt;
                ?>
" />
                        </span>
                      </span>
                      <?php 
                if ($params['compuct_album_image_title'] == 'show' && $theme_row->album_compact_thumb_title_pos == 'bottom') {
                    ?>
                        <span class="bwg_image_title_spun1_<?php 
                    echo $bwg;
                    ?>
">
                          <span class="bwg_image_title_spun2_<?php 
                    echo $bwg;
                    ?>
">
                            <?php 
                    echo $image_row->alt;
                    ?>
                          </span>
                        </span>
                        <?php 
                }
                ?>
                    </span>
                  </a>
                  <?php 
            }
        }
        ?>
            </div>
            <?php 
        if ($params['compuct_album_enable_page'] && $items_per_page && $theme_row->page_nav_position == 'bottom' && $page_nav['total']) {
            WDWLibrary::ajax_html_frontend_page_nav($theme_row, $page_nav['total'], $page_nav['limit'], 'gal_front_form_' . $bwg, $items_per_page, $bwg, $album_gallery_div_id, $params['album_id'], $type);
        }
        ?>
          </div>
        </form>
        <div id="spider_popup_loading_<?php 
        echo $bwg;
        ?>
" class="spider_popup_loading"></div>
        <div id="spider_popup_overlay_<?php 
        echo $bwg;
        ?>
" class="spider_popup_overlay" onclick="spider_destroypopup(1000)"></div>
      </div>
    </div>

    <?php 
        if ($from_shortcode) {
            return;
        } else {
            die;
        }
    }
 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;
         }
     }
     /*delete corresponding posts and their meta*/
     $query2 = "SELECT ID, post_content FROM " . $wpdb->posts . " WHERE post_type = 'bwg_tag' ";
     $posts = $wpdb->get_results($query2, OBJECT);
     foreach ($posts as $post) {
         $post_content = $post->post_content;
         if (strpos($post_content, ' type="tag" ')) {
             wp_delete_post($post->ID, true);
         }
     }
     if ($flag) {
         $message = 5;
     } else {
         $message = 6;
     }
     $page = WDWLibrary::get('page');
     $query_url = wp_nonce_url(admin_url('admin.php'), 'tags_bwg', 'bwg_nonce');
     $query_url = add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), $query_url);
     WDWLibrary::spider_redirect($query_url);
 }
예제 #14
0
    public function display()
    {
        $rows_data = $this->model->get_rows_data();
        $page_nav = $this->model->page_nav();
        $search_value = isset($_POST['search_value']) ? esc_html(stripslashes($_POST['search_value'])) : '';
        $asc_or_desc = isset($_POST['asc_or_desc']) ? esc_html(stripslashes($_POST['asc_or_desc'])) : 'asc';
        $order_by = isset($_POST['order_by']) ? esc_html(stripslashes($_POST['order_by'])) : 'name';
        $image_id = isset($_GET['image_id']) ? esc_html($_GET['image_id']) : '0';
        $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
        ?>
    <link media="all" type="text/css" href="<?php 
        echo get_admin_url();
        ?>
load-styles.php?c=1&amp;dir=ltr&amp;load=admin-bar,wp-admin,dashicons,buttons,wp-auth-check" rel="stylesheet">
    <link media="all" type="text/css" href="<?php 
        echo get_admin_url();
        ?>
css/colors<?php 
        echo get_bloginfo('version') < '3.8' ? '-fresh' : '';
        ?>
.min.css" id="colors-css" rel="stylesheet">
    <link media="all" type="text/css" href="<?php 
        echo WD_BWG_URL . '/css/bwg_tables.css';
        ?>
" id="bwg_tables-css" rel="stylesheet">
    <script language="javascript" type="text/javascript" src="<?php 
        echo get_option("siteurl");
        ?>
/wp-includes/js/jquery/jquery.js"></script>
    <script src="<?php 
        echo WD_BWG_URL . '/js/bwg.js';
        ?>
" type="text/javascript"></script>
    <form class="wrap wp-core-ui" id="tags_form" method="post" action="<?php 
        echo add_query_arg(array('action' => 'addTags', 'width' => '650', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
        ?>
" style="width:95%; margin: 0 auto;">
      <h2 style="width:200px; float:left;">Tags</h2>
      <a href="" class="thickbox thickbox-preview" id="content-add_media" title="Add Tag" onclick="bwg_get_tags('<?php 
        echo $image_id;
        ?>
', event);" style="float:right; padding: 9px 0px 4px 0">
        <img src="<?php 
        echo WD_BWG_URL . '/images/add_but.png';
        ?>
" style="border:none;" />
      </a>
      <div class="tablenav top">
        <?php 
        WDWLibrary::search('Name', $search_value, 'tags_form');
        WDWLibrary::html_page_nav($page_nav['total'], $page_nav['limit'], 'tags_form');
        ?>
      </div>
      <table class="wp-list-table widefat fixed pages">
        <thead>
          <th class="manage-column column-cb check-column table_small_col"><input id="check_all" type="checkbox" style="margin:0;" /></th>
          <th class="table_small_col <?php 
        if ($order_by == 'id') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('order_by', 'id');
                        spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == 'id' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                        spider_form_submit(event, 'tags_form')" href="">
              <span>ID</span><span class="sorting-indicator"></span></th>
            </a>
          <th class="<?php 
        if ($order_by == 'name') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('order_by', 'name');
                        spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == 'name' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                        spider_form_submit(event, 'tags_form')" href="">
              <span>Name</span><span class="sorting-indicator"></span>
            </a>
          </th>
          <th class="<?php 
        if ($order_by == 'slug') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('order_by', 'slug');
                        spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == 'slug' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                        spider_form_submit(event, 'tags_form')" href="">
              <span>Slug</span><span class="sorting-indicator"></span>
            </a>
          </th>
        </thead>
        <tbody id="tbody_arr">
          <?php 
        if ($rows_data) {
            foreach ($rows_data as $row_data) {
                $alternate = !isset($alternate) || $alternate == 'class="alternate"' ? '' : 'class="alternate"';
                ?>
              <tr id="tr_<?php 
                echo $row_data->term_id;
                ?>
" <?php 
                echo $alternate;
                ?>
>
                <td class="table_small_col check-column"><input id="check_<?php 
                echo $row_data->term_id;
                ?>
" name="check_<?php 
                echo $row_data->term_id;
                ?>
" type="checkbox" /></td>
                <td class="table_small_col"><?php 
                echo $row_data->term_id;
                ?>
</td>
                <td><a onclick="window.parent.bwg_add_tag('<?php 
                echo $image_id;
                ?>
', ['<?php 
                echo $row_data->term_id;
                ?>
'],['<?php 
                echo htmlspecialchars(addslashes($row_data->name));
                ?>
'])" id="a_<?php 
                echo $row_data->term_id;
                ?>
" style="cursor:pointer;"><?php 
                echo $row_data->name;
                ?>
</a></td> 
                <td id="slug_<?php 
                echo $row_data->term_id;
                ?>
"><?php 
                echo $row_data->slug ? $row_data->slug : '&nbsp;';
                ?>
</td> 
              </tr>
              <?php 
            }
        }
        ?>
        </tbody>
      </table>
      <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="asc" />
      <input id="order_by" name="order_by" type="hidden" value="<?php 
        echo $order_by;
        ?>
" />
    </form>
    <script src="<?php 
        echo get_admin_url();
        ?>
load-scripts.php?c=1&load%5B%5D=common,admin-bar" type="text/javascript"></script>
    <?php 
        die;
    }
예제 #15
0
    public function display()
    {
        $rows_data = $this->model->get_rows_data();
        $page_nav = $this->model->page_nav();
        $search_value = isset($_POST['search_value']) ? esc_html($_POST['search_value']) : '';
        $search_select_value = isset($_POST['search_select_value']) ? (int) $_POST['search_select_value'] : 0;
        $asc_or_desc = isset($_POST['asc_or_desc']) ? esc_html($_POST['asc_or_desc']) : 'asc';
        $order_by = isset($_POST['order_by']) ? esc_html($_POST['order_by']) : 'id';
        $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
        $ids_string = '';
        ?>
    <div style="clear: both; float: left; width: 95%;">
      <div style="float:left; font-size: 14px; font-weight: bold;">
        This section allows you to create, edit and delete themes.
        <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-gallery-guide-step-6/6-1.html">Read More in User Manual</a>
        <?php 
        if (get_option("wd_bwg_theme_version")) {
            ?>
          <br />
          This feature is disabled for the non-commercial version.
          <?php 
        }
        ?>
      </div>
      <div style="float: right; text-align: right;">
        <a style="color: red; text-decoration: none;" target="_blank" href="http://web-dorado.com/products/wordpress-photo-gallery-plugin.html">
          <img width="215" border="0" alt="web-dorado.com" src="<?php 
        echo WD_BWG_URL . '/images/header.png';
        ?>
" />
          <p style="font-size: 16px; margin: 0; padding: 0 20px 0 0;">Get the full version</p>
        </a>
      </div>
    </div>
    <?php 
        if (get_option("wd_bwg_theme_version")) {
            ?>
      <div style="clear: both; float: left; width: 97%;">
        <img style="max-width: 100%;" src="<?php 
            echo WD_BWG_URL . '/images/theme_thumbnails.png';
            ?>
" />
        <img style="max-width: 100%;" src="<?php 
            echo WD_BWG_URL . '/images/theme_masonry.png';
            ?>
" />
        <img style="max-width: 100%;" src="<?php 
            echo WD_BWG_URL . '/images/theme_slideshow.png';
            ?>
" />
        <img style="max-width: 100%;" src="<?php 
            echo WD_BWG_URL . '/images/theme_image_browser.png';
            ?>
" />
        <img style="max-width: 100%;" src="<?php 
            echo WD_BWG_URL . '/images/theme_compact_album.png';
            ?>
" />
        <img style="max-width: 100%;" src="<?php 
            echo WD_BWG_URL . '/images/theme_extended_album.png';
            ?>
" />
        <img style="max-width: 100%;" src="<?php 
            echo WD_BWG_URL . '/images/theme_blog_style.png';
            ?>
" />
        <img style="max-width: 100%;" src="<?php 
            echo WD_BWG_URL . '/images/theme_lightbox.png';
            ?>
" />
        <img style="max-width: 100%;" src="<?php 
            echo WD_BWG_URL . '/images/theme_page_navigation.png';
            ?>
" />
      </div>
      <?php 
            die;
        }
        ?>
    <form class="wrap" id="themes_form" method="post" action="admin.php?page=themes_bwg" style="float: left; width: 95%;">
      <span class="theme_icon"></span>
      <h2>
        Themes
        <a href="" class="add-new-h2" onclick="spider_set_input_value('task', 'add');
                                               spider_form_submit(event, 'themes_form')">Add new</a>
      </h2>
      <div class="buttons_div">
        <input class="button-secondary" type="submit" onclick="if (confirm('Do you want to delete selected items?')) {
                                                       spider_set_input_value('task', 'delete_all');
                                                     } else {
                                                       return false;
                                                     }" value="Delete"/>
      </div>
      <div class="tablenav top">
        <?php 
        WDWLibrary::search('Title', $search_value, 'themes_form');
        WDWLibrary::html_page_nav($page_nav['total'], $page_nav['limit'], 'themes_form');
        ?>
      </div>
      <table class="wp-list-table widefat fixed pages">
        <thead>
          <th class="manage-column column-cb check-column table_small_col"><input id="check_all" type="checkbox" style="margin:0;"/></th>
          <th class="table_small_col <?php 
        if ($order_by == 'id') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('task', '');
              spider_set_input_value('order_by', 'id');
              spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html($_POST['order_by']) == 'id' && esc_html($_POST['asc_or_desc']) == 'asc' ? 'desc' : 'asc';
        ?>
');
              spider_form_submit(event, 'themes_form')" href="">
              <span>ID</span><span class="sorting-indicator"></span></a>
          </th>
          <th class="<?php 
        if ($order_by == 'name') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('task', '');
              spider_set_input_value('order_by', 'name');
              spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html($_POST['order_by']) == 'title' && esc_html($_POST['asc_or_desc']) == 'asc' ? 'desc' : 'asc';
        ?>
');
              spider_form_submit(event, 'themes_form')" href="">
              <span>Name</span><span class="sorting-indicator"></span></a>
          </th>
          <th class="table_big_col <?php 
        if ($order_by == 'default_theme') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('task', '');
              spider_set_input_value('order_by', 'default_theme');
              spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html($_POST['order_by']) == 'default_theme' && esc_html($_POST['asc_or_desc']) == 'asc' ? 'desc' : 'asc';
        ?>
');
              spider_form_submit(event, 'themes_form')" href="">
              <span>Default</span><span class="sorting-indicator"></span></a>
          </th>
          <th class="table_big_col">Edit</th>
          <th class="table_big_col">Delete</th>
        </thead>
        <tbody id="tbody_arr">
          <?php 
        if ($rows_data) {
            foreach ($rows_data as $row_data) {
                $alternate = !isset($alternate) || $alternate == 'class="alternate"' ? '' : 'class="alternate"';
                $default_image = $row_data->default_theme ? 'default' : 'notdefault';
                $default = $row_data->default_theme ? '' : 'setdefault';
                ?>
              <tr id="tr_<?php 
                echo $row_data->id;
                ?>
" <?php 
                echo $alternate;
                ?>
>
                <td class="table_small_col check-column">
                  <input id="check_<?php 
                echo $row_data->id;
                ?>
" name="check_<?php 
                echo $row_data->id;
                ?>
" type="checkbox"/>
                </td>
                <td class="table_small_col"><?php 
                echo $row_data->id;
                ?>
</td>
                <td>
                  <a onclick="spider_set_input_value('task', 'edit');
                              spider_set_input_value('current_id', '<?php 
                echo $row_data->id;
                ?>
');
                              spider_form_submit(event, 'themes_form')" href="" title="Edit"><?php 
                echo $row_data->name;
                ?>
</a>
                </td>
                <td class="table_big_col">
                  <?php 
                if ($default != '') {
                    ?>
                    <a onclick="spider_set_input_value('task', '<?php 
                    echo $default;
                    ?>
');
                                spider_set_input_value('current_id', '<?php 
                    echo $row_data->id;
                    ?>
');
                                spider_form_submit(event, 'themes_form')" href="">
                    <?php 
                }
                ?>
                  <img src="<?php 
                echo WD_BWG_URL . '/images/' . $default_image . '.png';
                ?>
" />
                  <?php 
                if ($default != '') {
                    ?>
                    </a>
                    <?php 
                }
                ?>
                </td>
                <td class="table_big_col">
                  <a onclick="spider_set_input_value('task', 'edit');
                              spider_set_input_value('current_id', '<?php 
                echo $row_data->id;
                ?>
');
                              spider_form_submit(event, 'themes_form')" href="">Edit</a>
                </td>
                <td class="table_big_col">
                  <a onclick="spider_set_input_value('task', 'delete');
                              spider_set_input_value('current_id', '<?php 
                echo $row_data->id;
                ?>
');
                              spider_form_submit(event, 'themes_form')" href="">Delete</a>
                </td>
              </tr>
              <?php 
                $ids_string .= $row_data->id . ',';
            }
        }
        ?>
        </tbody>
      </table>
      <input id="task" name="task" type="hidden" value=""/>
      <input id="current_id" name="current_id" type="hidden" value=""/>
      <input id="ids_string" name="ids_string" type="hidden" value="<?php 
        echo $ids_string;
        ?>
"/>
      <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="asc"/>
      <input id="order_by" name="order_by" type="hidden" value="<?php 
        echo $order_by;
        ?>
"/>
    </form>
    <?php 
    }
예제 #16
0
    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';
        $filmstrip_thumb_margin = $theme_row->slideshow_filmstrip_thumb_margin;
        $margins_split = explode(" ", $filmstrip_thumb_margin);
        $temp_iterator = 1;
        if (isset($margins_split[$temp_iterator])) {
            $filmstrip_thumb_margin_right = (int) $margins_split[$temp_iterator];
            if (isset($margins_split[$temp_iterator + 2])) {
                $filmstrip_thumb_margin_left = (int) $margins_split[$temp_iterator + 2];
            } else {
                $filmstrip_thumb_margin_left = $filmstrip_thumb_margin_right;
            }
        } elseif (isset($margins_split[0])) {
            $filmstrip_thumb_margin_right = (int) $margins_split[0];
            $filmstrip_thumb_margin_left = $filmstrip_thumb_margin_right;
        }
        $filmstrip_thumb_margin_hor = $filmstrip_thumb_margin_right + $filmstrip_thumb_margin_left;
        ?>
    <style>
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 {
        visibility: hidden;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 * {
        -moz-user-select: none;
        -khtml-user-select: none;
        -webkit-user-select: none;
        -ms-user-select: none;
        user-select: none;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_image_wrap_<?php 
        echo $bwg;
        ?>
 * {
        box-sizing: border-box;
        -moz-box-sizing: border-box;
        -webkit-box-sizing: border-box;
        /*backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        -moz-backface-visibility: hidden;
        -ms-backface-visibility: hidden;*/
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_image_wrap_<?php 
        echo $bwg;
        ?>
 {
        background-color: #<?php 
        echo $theme_row->slideshow_cont_bg_color;
        ?>
;
        border-collapse: collapse;
        display: table;
        position: relative;
        text-align: center;
        width: <?php 
        echo $image_width;
        ?>
px;
        height: <?php 
        echo $image_height;
        ?>
px;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_image_<?php 
        echo $bwg;
        ?>
 {
        padding: 0 !important;
        margin: 0 !important;
        float: none !important;
        max-width: <?php 
        echo $image_width;
        ?>
px;
        max-height: <?php 
        echo $image_height - $slideshow_filmstrip_height;
        ?>
px;
        vertical-align: middle;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_embed_<?php 
        echo $bwg;
        ?>
 {
        padding: 0 !important;
        margin: 0 !important;
        float: none !important;
        width: <?php 
        echo $image_width;
        ?>
px;
        height: <?php 
        echo $image_height - $slideshow_filmstrip_height;
        ?>
px;
        vertical-align: middle;
        display: inline-block;
        text-align: center;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_watermark_<?php 
        echo $bwg;
        ?>
 {
        position: relative;
        z-index: 15;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 #bwg_slideshow_play_pause_<?php 
        echo $bwg;
        ?>
 {
        background: transparent url("<?php 
        echo WD_BWG_URL . '/images/blank.gif';
        ?>
") repeat scroll 0 0;
        bottom: 0;
        cursor: pointer;
        display: table;
        height: inherit;
        outline: medium none;
        position: absolute;
        width: 30%;
        left: 35%;
        z-index: 13;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 #bwg_slideshow_play_pause_<?php 
        echo $bwg;
        ?>
:hover #bwg_slideshow_play_pause-ico_<?php 
        echo $bwg;
        ?>
 {
        display: inline-block !important;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 #bwg_slideshow_play_pause_<?php 
        echo $bwg;
        ?>
:hover span {
        position: relative;
        z-index: 13;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 #bwg_slideshow_play_pause_<?php 
        echo $bwg;
        ?>
 span {
        display: table-cell;
        text-align: center;
        vertical-align: middle;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 #bwg_slideshow_play_pause-ico_<?php 
        echo $bwg;
        ?>
 {  
        display: none !important;
        color: #<?php 
        echo $theme_row->slideshow_rl_btn_color;
        ?>
;        
        font-size: <?php 
        echo $theme_row->slideshow_play_pause_btn_size;
        ?>
px;
        cursor: pointer;
        position: relative;
        z-index: 13;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 #bwg_slideshow_play_pause-ico_<?php 
        echo $bwg;
        ?>
:hover {  
        color: #<?php 
        echo $theme_row->slideshow_close_rl_btn_hover_color;
        ?>
;
        display: inline-block;
        position: relative;
        z-index: 13;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 #spider_slideshow_left_<?php 
        echo $bwg;
        ?>
,
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 #spider_slideshow_right_<?php 
        echo $bwg;
        ?>
 {
        background: transparent url("<?php 
        echo WD_BWG_URL . '/images/blank.gif';
        ?>
") repeat scroll 0 0;
        bottom: 35%;
        cursor: pointer;
        display: inline;
        height: 30%;
        outline: medium none;
        position: absolute;
        width: 35%;
        /*z-index: 10130;*/
        z-index: 13;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 #spider_slideshow_left_<?php 
        echo $bwg;
        ?>
 {
        left: 0;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 #spider_slideshow_right_<?php 
        echo $bwg;
        ?>
 {
        right: 0;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 #spider_slideshow_left_<?php 
        echo $bwg;
        ?>
:hover,
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 #spider_slideshow_right_<?php 
        echo $bwg;
        ?>
:hover {
        visibility: visible;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 #spider_slideshow_left_<?php 
        echo $bwg;
        ?>
:hover span {
        left: 20px;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 #spider_slideshow_right_<?php 
        echo $bwg;
        ?>
:hover span {
        left: auto;
        right: 20px;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 #spider_slideshow_left-ico_<?php 
        echo $bwg;
        ?>
 span,
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 #spider_slideshow_right-ico_<?php 
        echo $bwg;
        ?>
 span {
        display: table-cell;
        text-align: center;
        vertical-align: middle;
        z-index: 13;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 #spider_slideshow_left-ico_<?php 
        echo $bwg;
        ?>
,
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 #spider_slideshow_right-ico_<?php 
        echo $bwg;
        ?>
 {
        background-color: #<?php 
        echo $theme_row->slideshow_rl_btn_bg_color;
        ?>
;
        border-radius: <?php 
        echo $theme_row->slideshow_rl_btn_border_radius;
        ?>
;
        border: <?php 
        echo $theme_row->slideshow_rl_btn_border_width;
        ?>
px <?php 
        echo $theme_row->slideshow_rl_btn_border_style;
        ?>
 #<?php 
        echo $theme_row->slideshow_rl_btn_border_color;
        ?>
;
        box-shadow: <?php 
        echo $theme_row->slideshow_rl_btn_box_shadow;
        ?>
;
        color: #<?php 
        echo $theme_row->slideshow_rl_btn_color;
        ?>
;
        height: <?php 
        echo $theme_row->slideshow_rl_btn_height;
        ?>
px;
        font-size: <?php 
        echo $theme_row->slideshow_rl_btn_size;
        ?>
px;
        width: <?php 
        echo $theme_row->slideshow_rl_btn_width;
        ?>
px;
        z-index: 13;
        -moz-box-sizing: content-box;
        box-sizing: content-box;
        cursor: pointer;
        display: table;
        line-height: 0;
        margin-top: -15px;
        position: absolute;
        top: 50%;
        /*z-index: 10135;*/
        opacity: <?php 
        echo number_format($theme_row->slideshow_close_btn_transparent / 100, 2, ".", "");
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $theme_row->slideshow_close_btn_transparent;
        ?>
);
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 #spider_slideshow_left-ico_<?php 
        echo $bwg;
        ?>
:hover,
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 #spider_slideshow_right-ico_<?php 
        echo $bwg;
        ?>
:hover {
        color: #<?php 
        echo $theme_row->slideshow_close_rl_btn_hover_color;
        ?>
;
        cursor: pointer;
      }
      <?php 
        if ($options_row->autohide_slideshow_navigation) {
            ?>
	  #spider_slideshow_left-ico_<?php 
            echo $bwg;
            ?>
{
		   left: -9999px;
	  }
	#spider_slideshow_right-ico_<?php 
            echo $bwg;
            ?>
{
		left: -9999px;
	 }
		
 <?php 
        } else {
            ?>
	    #spider_slideshow_left-ico_<?php 
            echo $bwg;
            ?>
{
		   left: 20px;
		}
	   #spider_slideshow_right-ico_<?php 
            echo $bwg;
            ?>
{
		   left: auto;
           right: 20px;
		}
	  <?php 
        }
        ?>
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_image_container_<?php 
        echo $bwg;
        ?>
 {
        display: table;
        position: absolute;
        text-align: center;
        <?php 
        echo $theme_row->slideshow_filmstrip_pos;
        ?>
: <?php 
        echo $slideshow_filmstrip_height;
        ?>
px;
        vertical-align: middle;
        width: <?php 
        echo $image_width;
        ?>
px;
        height: <?php 
        echo $image_height;
        ?>
px;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_filmstrip_container_<?php 
        echo $bwg;
        ?>
 {
        display: table;
        height: <?php 
        echo $slideshow_filmstrip_height;
        ?>
px;
        position: absolute;
        width: <?php 
        echo $image_width;
        ?>
px;
        /*z-index: 10105;*/
        <?php 
        echo $theme_row->slideshow_filmstrip_pos;
        ?>
: 0;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_filmstrip_<?php 
        echo $bwg;
        ?>
 {
        left: 20px;
        overflow: hidden;
        position: absolute;
        width: <?php 
        echo $image_width - 40;
        ?>
px;
        /*z-index: 10106;*/
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_filmstrip_thumbnails_<?php 
        echo $bwg;
        ?>
 {
        height: <?php 
        echo $slideshow_filmstrip_height;
        ?>
px;
        left: 0px;
        margin: 0 auto;
        overflow: hidden;
        position: relative;
        width: <?php 
        echo ($slideshow_filmstrip_width + $filmstrip_thumb_margin_hor) * count($image_rows);
        ?>
px;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_filmstrip_thumbnail_<?php 
        echo $bwg;
        ?>
 {
        position: relative;
        background: none;
        border: <?php 
        echo $theme_row->slideshow_filmstrip_thumb_border_width;
        ?>
px <?php 
        echo $theme_row->slideshow_filmstrip_thumb_border_style;
        ?>
 #<?php 
        echo $theme_row->slideshow_filmstrip_thumb_border_color;
        ?>
;
        border-radius: <?php 
        echo $theme_row->slideshow_filmstrip_thumb_border_radius;
        ?>
;
        cursor: pointer;
        float: left;
        height: <?php 
        echo $slideshow_filmstrip_height;
        ?>
px;
        margin: <?php 
        echo $theme_row->slideshow_filmstrip_thumb_margin;
        ?>
;
        width: <?php 
        echo $slideshow_filmstrip_width;
        ?>
px;
        overflow: hidden;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_thumb_active_<?php 
        echo $bwg;
        ?>
 {
        opacity: 1;
        filter: Alpha(opacity=100);
        border: <?php 
        echo $theme_row->slideshow_filmstrip_thumb_active_border_width;
        ?>
px solid #<?php 
        echo $theme_row->slideshow_filmstrip_thumb_active_border_color;
        ?>
;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_thumb_deactive_<?php 
        echo $bwg;
        ?>
 {
        opacity: <?php 
        echo number_format($theme_row->slideshow_filmstrip_thumb_deactive_transparent / 100, 2, ".", "");
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $theme_row->slideshow_filmstrip_thumb_deactive_transparent;
        ?>
);
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_filmstrip_thumbnail_img_<?php 
        echo $bwg;
        ?>
 {
        display: block;
        opacity: 1;
        filter: Alpha(opacity=100);
        padding: 0 !important;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_filmstrip_left_<?php 
        echo $bwg;
        ?>
 {
        background-color: #<?php 
        echo $theme_row->slideshow_filmstrip_rl_bg_color;
        ?>
;
        cursor: pointer;
        display: table-cell;
        vertical-align: middle;
        width: 20px;
        /*z-index: 10106;*/
        left: 0;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_filmstrip_right_<?php 
        echo $bwg;
        ?>
 {
        background-color: #<?php 
        echo $theme_row->slideshow_filmstrip_rl_bg_color;
        ?>
;
        cursor: pointer;
        right: 0;
        width: 20px;
        display: table-cell;
        vertical-align: middle;
        /*z-index: 10106;*/
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_filmstrip_left_<?php 
        echo $bwg;
        ?>
 i,
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_filmstrip_right_<?php 
        echo $bwg;
        ?>
 i {
        color: #<?php 
        echo $theme_row->slideshow_filmstrip_rl_btn_color;
        ?>
;
        font-size: <?php 
        echo $theme_row->slideshow_filmstrip_rl_btn_size;
        ?>
px;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_none_selectable_<?php 
        echo $bwg;
        ?>
 {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_watermark_container_<?php 
        echo $bwg;
        ?>
 {
        display: table-cell;
        margin: 0 auto;
        position: relative;
        vertical-align: middle;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_watermark_spun_<?php 
        echo $bwg;
        ?>
 {
        display: table-cell;
        overflow: hidden;
        position: relative;
        text-align: <?php 
        echo $watermark_position[1];
        ?>
;
        vertical-align: <?php 
        echo $watermark_position[0];
        ?>
;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_title_spun_<?php 
        echo $bwg;
        ?>
 {
        display: table-cell;
        overflow: hidden;
        position: relative;
        text-align: <?php 
        echo $slideshow_title_position[1];
        ?>
;
        vertical-align: <?php 
        echo $slideshow_title_position[0];
        ?>
;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_description_spun_<?php 
        echo $bwg;
        ?>
 {
        display: table-cell;
        overflow: hidden;
        position: relative;
        text-align: <?php 
        echo $slideshow_description_position[1];
        ?>
;
        vertical-align: <?php 
        echo $slideshow_description_position[0];
        ?>
;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_watermark_image_<?php 
        echo $bwg;
        ?>
 {
        padding: 0 !important;
        float: none !important;
        margin: 4px !important;
        max-height: <?php 
        echo $watermark_height;
        ?>
px;
        max-width: <?php 
        echo $watermark_width;
        ?>
px;
        opacity: <?php 
        echo number_format($watermark_opacity / 100, 2, ".", "");
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $watermark_opacity;
        ?>
);
        position: relative;
        z-index: 15;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_watermark_text_<?php 
        echo $bwg;
        ?>
,
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_watermark_text_<?php 
        echo $bwg;
        ?>
:hover {
        text-decoration: none;
        margin: 4px;
        font-size: <?php 
        echo $watermark_font_size;
        ?>
px;
        font-family: <?php 
        echo $watermark_font;
        ?>
;
        color: #<?php 
        echo $watermark_color;
        ?>
 !important;
        opacity: <?php 
        echo number_format($watermark_opacity / 100, 2, ".", "");
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $watermark_opacity;
        ?>
);
        position: relative;
        z-index: 15;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_title_text_<?php 
        echo $bwg;
        ?>
 {
        text-decoration: none;
        font-size: <?php 
        echo $theme_row->slideshow_title_font_size;
        ?>
px;
        font-family: <?php 
        echo $theme_row->slideshow_title_font;
        ?>
;
        color: #<?php 
        echo $theme_row->slideshow_title_color;
        ?>
 !important;
        opacity: <?php 
        echo number_format($theme_row->slideshow_title_opacity / 100, 2, ".", "");
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $theme_row->slideshow_title_opacity;
        ?>
);
        position: relative;
        z-index: 11;
        border-radius: <?php 
        echo $theme_row->slideshow_title_border_radius;
        ?>
;
        background-color: #<?php 
        echo $theme_row->slideshow_title_background_color;
        ?>
;
        padding: <?php 
        echo $theme_row->slideshow_title_padding;
        ?>
;
        <?php 
        if ($params['slideshow_title_full_width']) {
            ?>
        width: 100%;
        <?php 
        } else {
            ?>
        margin: 5px;
        <?php 
        }
        ?>
        display: inline-block;
        word-wrap: break-word;
        word-break: break-word;
        <?php 
        if (!$enable_slideshow_filmstrip && $slideshow_title_position[0] == $theme_row->slideshow_filmstrip_pos) {
            echo $theme_row->slideshow_filmstrip_pos . ':' . ($theme_row->slideshow_dots_height + 4) . 'px;';
        }
        ?>
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_description_text_<?php 
        echo $bwg;
        ?>
 {
        text-decoration: none;
        font-size: <?php 
        echo $theme_row->slideshow_description_font_size;
        ?>
px;
        font-family: <?php 
        echo $theme_row->slideshow_description_font;
        ?>
;
        color: #<?php 
        echo $theme_row->slideshow_description_color;
        ?>
 !important;
        opacity: <?php 
        echo number_format($theme_row->slideshow_description_opacity / 100, 2, ".", "");
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $theme_row->slideshow_description_opacity;
        ?>
);
        position: relative;
        z-index: 15;
        border-radius: <?php 
        echo $theme_row->slideshow_description_border_radius;
        ?>
;
        background-color: #<?php 
        echo $theme_row->slideshow_description_background_color;
        ?>
;
        padding: <?php 
        echo $theme_row->slideshow_description_padding;
        ?>
;
        margin: 5px;
        display: inline-block;
        word-wrap: break-word;
        word-break: break-word;
        <?php 
        if (!$enable_slideshow_filmstrip && $slideshow_description_position[0] == $theme_row->slideshow_filmstrip_pos) {
            echo $theme_row->slideshow_filmstrip_pos . ':' . ($theme_row->slideshow_dots_height + 4) . 'px;';
        }
        ?>
        
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_description_text_<?php 
        echo $bwg;
        ?>
 * {
        text-decoration: none;
        color: #<?php 
        echo $theme_row->slideshow_description_color;
        ?>
 !important;                
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slide_container_<?php 
        echo $bwg;
        ?>
 {
        display: table-cell;
        margin: 0 auto;
        position: absolute;
        vertical-align: middle;
        width: 100%;
        height: 100%;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slide_bg_<?php 
        echo $bwg;
        ?>
 {
        margin: 0 auto;
        width: inherit;
        height: inherit;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slider_<?php 
        echo $bwg;
        ?>
 {
        height: inherit;
        width: inherit;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_image_spun_<?php 
        echo $bwg;
        ?>
 {
        width: inherit;
        height: inherit;
        display: table-cell;
        filter: Alpha(opacity=100);
        opacity: 1;
        position: absolute;
        vertical-align: middle;
        z-index: 2;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_image_second_spun_<?php 
        echo $bwg;
        ?>
 {
        width: inherit;
        height: inherit;
        display: table-cell;
        filter: Alpha(opacity=0);
        opacity: 0;
        position: absolute;
        vertical-align: middle;
        z-index: 1;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_grid_<?php 
        echo $bwg;
        ?>
 {
        display: none;
        height: 100%;
        overflow: hidden;
        position: absolute;
        width: 100%;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_gridlet_<?php 
        echo $bwg;
        ?>
 {
        opacity: 1;
        filter: Alpha(opacity=100);
        position: absolute;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_dots_<?php 
        echo $bwg;
        ?>
 {
        display: inline-block;
        position: relative;
        width: <?php 
        echo $theme_row->slideshow_dots_width;
        ?>
px;
        height: <?php 
        echo $theme_row->slideshow_dots_height;
        ?>
px;
        border-radius: <?php 
        echo $theme_row->slideshow_dots_border_radius;
        ?>
;
        background: #<?php 
        echo $theme_row->slideshow_dots_background_color;
        ?>
;
        margin: <?php 
        echo $theme_row->slideshow_dots_margin;
        ?>
px;
        cursor: pointer;
        overflow: hidden;
        z-index: 17;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_dots_container_<?php 
        echo $bwg;
        ?>
 {
        display: block;
        overflow: hidden;
        position: absolute;
        width: <?php 
        echo $image_width;
        ?>
px;
        <?php 
        echo $theme_row->slideshow_filmstrip_pos;
        ?>
: 0;
        z-index: 17;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_dots_thumbnails_<?php 
        echo $bwg;
        ?>
 {
        left: 0px;
        font-size: 0;
        margin: 0 auto;
        overflow: hidden;
        position: relative;
        height: <?php 
        echo $theme_row->slideshow_dots_height + $theme_row->slideshow_dots_margin * 2;
        ?>
px;
        width: <?php 
        echo ($theme_row->slideshow_dots_width + $theme_row->slideshow_dots_margin * 2) * count($image_rows);
        ?>
px;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_dots_active_<?php 
        echo $bwg;
        ?>
 {
        background: #<?php 
        echo $theme_row->slideshow_dots_active_background_color;
        ?>
;
        opacity: 1;
        filter: Alpha(opacity=100);
        border: <?php 
        echo $theme_row->slideshow_dots_active_border_width;
        ?>
px solid #<?php 
        echo $theme_row->slideshow_dots_active_border_color;
        ?>
;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_dots_deactive_<?php 
        echo $bwg;
        ?>
 {
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_image_spun1_<?php 
        echo $bwg;
        ?>
 {
        display: table; 
        width: inherit; 
        height: inherit;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_slideshow_image_spun2_<?php 
        echo $bwg;
        ?>
 {
        display: table-cell; 
        vertical-align: middle; 
        text-align: center;
      }
    </style>
    <script>
      var data_<?php 
        echo $bwg;
        ?>
 = [];
      var event_stack_<?php 
        echo $bwg;
        ?>
 = [];
      <?php 
        foreach ($image_rows as $key => $image_row) {
            if ($image_row->id == $current_image_id) {
                $current_image_alt = $image_row->alt;
                $current_image_description = str_replace(array("\r\n", "\n", "\r"), esc_html('<br />'), $image_row->description);
            }
            ?>
        data_<?php 
            echo $bwg;
            ?>
["<?php 
            echo $key;
            ?>
"] = [];
        data_<?php 
            echo $bwg;
            ?>
["<?php 
            echo $key;
            ?>
"]["id"] = "<?php 
            echo $image_row->id;
            ?>
";
        data_<?php 
            echo $bwg;
            ?>
["<?php 
            echo $key;
            ?>
"]["alt"] = "<?php 
            echo $image_row->alt;
            ?>
";
        data_<?php 
            echo $bwg;
            ?>
["<?php 
            echo $key;
            ?>
"]["description"] = "<?php 
            echo str_replace(array("\r\n", "\n", "\r"), esc_html('<br />'), $image_row->description);
            ?>
";
        data_<?php 
            echo $bwg;
            ?>
["<?php 
            echo $key;
            ?>
"]["image_url"] = "<?php 
            echo $image_row->image_url;
            ?>
";
        data_<?php 
            echo $bwg;
            ?>
["<?php 
            echo $key;
            ?>
"]["thumb_url"] = "<?php 
            echo $image_row->thumb_url;
            ?>
";
        data_<?php 
            echo $bwg;
            ?>
["<?php 
            echo $key;
            ?>
"]["date"] = "<?php 
            echo $image_row->date;
            ?>
";
        data_<?php 
            echo $bwg;
            ?>
["<?php 
            echo $key;
            ?>
"]["is_embed"] = "<?php 
            echo preg_match('/EMBED/', $image_row->filetype) == 1 ? true : false;
            ?>
";
        data_<?php 
            echo $bwg;
            ?>
["<?php 
            echo $key;
            ?>
"]["is_embed_video"] = "<?php 
            echo preg_match('/EMBED/', $image_row->filetype) == 1 && preg_match('/_VIDEO/', $image_row->filetype) == 1 ? true : false;
            ?>
";
        <?php 
        }
        ?>
    
    </script>
    <div id="bwg_container1_<?php 
        echo $bwg;
        ?>
">
      <div id="bwg_container2_<?php 
        echo $bwg;
        ?>
">
        <div class="bwg_slideshow_image_wrap_<?php 
        echo $bwg;
        ?>
">
          <?php 
        $current_pos = 0;
        if (!$enable_slideshow_filmstrip) {
            ?>
            <div class="bwg_slideshow_dots_container_<?php 
            echo $bwg;
            ?>
">
              <div class="bwg_slideshow_dots_thumbnails_<?php 
            echo $bwg;
            ?>
">
                <?php 
            foreach ($image_rows as $key => $image_row) {
                if ($image_row->id == $current_image_id) {
                    $current_pos = $key * ($slideshow_filmstrip_width + 2);
                    $current_key = $key;
                }
                ?>
                <span id="bwg_dots_<?php 
                echo $key;
                ?>
_<?php 
                echo $bwg;
                ?>
" class="bwg_slideshow_dots_<?php 
                echo $bwg;
                ?>
 <?php 
                echo $image_row->id == $current_image_id ? 'bwg_slideshow_dots_active_' . $bwg : 'bwg_slideshow_dots_deactive_' . $bwg;
                ?>
" onclick="bwg_change_image_<?php 
                echo $bwg;
                ?>
(parseInt(jQuery('#bwg_current_image_key_<?php 
                echo $bwg;
                ?>
').val()), '<?php 
                echo $key;
                ?>
', data_<?php 
                echo $bwg;
                ?>
)" image_id="<?php 
                echo $image_row->id;
                ?>
" image_key="<?php 
                echo $key;
                ?>
"></span>
                <?php 
            }
            ?>
              </div>
            </div>
            <?php 
        }
        ?>
          <div id="bwg_slideshow_image_container_<?php 
        echo $bwg;
        ?>
" class="bwg_slideshow_image_container_<?php 
        echo $bwg;
        ?>
">        
            <div class="bwg_slide_container_<?php 
        echo $bwg;
        ?>
">
              <div class="bwg_slide_bg_<?php 
        echo $bwg;
        ?>
">
                <div class="bwg_slider_<?php 
        echo $bwg;
        ?>
">
                <?php 
        foreach ($image_rows as $key => $image_row) {
            $is_embed = preg_match('/EMBED/', $image_row->filetype) == 1 ? true : false;
            $is_embed_video = $is_embed && preg_match('/_VIDEO/', $image_row->filetype) == 1 ? true : false;
            $is_embed_instagram_post = preg_match('/INSTAGRAM_POST/', $image_row->filetype) == 1 ? true : false;
            if ($image_row->id == $current_image_id) {
                $current_key = $key;
                ?>
                    <span class="bwg_slideshow_image_spun_<?php 
                echo $bwg;
                ?>
" id="image_id_<?php 
                echo $bwg;
                ?>
_<?php 
                echo $image_row->id;
                ?>
">
                      <span class="bwg_slideshow_image_spun1_<?php 
                echo $bwg;
                ?>
">
                        <span class="bwg_slideshow_image_spun2_<?php 
                echo $bwg;
                ?>
">
                          <?php 
                if (!$is_embed) {
                    ?>
                            <img id="bwg_slideshow_image_<?php 
                    echo $bwg;
                    ?>
" class="bwg_slideshow_image_<?php 
                    echo $bwg;
                    ?>
" src="<?php 
                    echo site_url() . '/' . $WD_BWG_UPLOAD_DIR . $image_row->image_url;
                    ?>
" image_id="<?php 
                    echo $image_row->id;
                    ?>
" alt="<?php 
                    echo $image_row->alt;
                    ?>
"/>
                            <?php 
                } else {
                    /*$is_embed*/
                    ?>
                            <span id="bwg_slideshow_image_<?php 
                    echo $bwg;
                    ?>
" class="bwg_slideshow_embed_<?php 
                    echo $bwg;
                    ?>
" image_id="<?php 
                    echo $image_row->id;
                    ?>
">
                            <?php 
                    if ($is_embed_instagram_post) {
                        $post_width = $image_width - ($filmstrip_direction == 'vertical' ? $slideshow_filmstrip_width : 0);
                        $post_height = $image_height - ($filmstrip_direction == 'horizontal' ? $slideshow_filmstrip_height : 0);
                        if ($post_height < $post_width + 88) {
                            $post_width = $post_height - 88;
                        } else {
                            $post_height = $post_width + 88;
                        }
                        WDWLibraryEmbed::display_embed($image_row->filetype, $image_row->filename, array('class' => "bwg_embed_frame_" . $bwg, 'frameborder' => "0", 'style' => "width:" . $post_width . "px; height:" . $post_height . "px; vertical-align:middle; display:inline-block; position:relative;"));
                    } else {
                        WDWLibraryEmbed::display_embed($image_row->filetype, $image_row->filename, array('class' => "bwg_embed_frame_" . $bwg, 'frameborder' => "0", 'allowfullscreen' => "allowfullscreen", 'style' => "width:inherit; height:inherit; vertical-align:middle; display:table-cell;"));
                    }
                    ?>
         
                            </span>
                            <?php 
                }
                ?>
                        </span>
                      </span>
                    </span>
                    <input type="hidden" id="bwg_current_image_key_<?php 
                echo $bwg;
                ?>
" value="<?php 
                echo $key;
                ?>
" />
                    <?php 
            } else {
                ?>
                    <span class="bwg_slideshow_image_second_spun_<?php 
                echo $bwg;
                ?>
" id="image_id_<?php 
                echo $bwg;
                ?>
_<?php 
                echo $image_row->id;
                ?>
">
                      <span class="bwg_slideshow_image_spun1_<?php 
                echo $bwg;
                ?>
">
                        <span class="bwg_slideshow_image_spun2_<?php 
                echo $bwg;
                ?>
">
                          <?php 
                if (!$is_embed) {
                    ?>
                            <img class="bwg_slideshow_image_<?php 
                    echo $bwg;
                    ?>
" src="<?php 
                    echo site_url() . '/' . $WD_BWG_UPLOAD_DIR . $image_row->image_url;
                    ?>
" alt="<?php 
                    echo $image_row->alt;
                    ?>
"/>
                          <?php 
                } else {
                    /*$is_embed*/
                    ?>
                            <span class="bwg_slideshow_embed_<?php 
                    echo $bwg;
                    ?>
">
                                <?php 
                    if ($is_embed_instagram_post) {
                        $post_width = $image_width - ($filmstrip_direction == 'vertical' ? $slideshow_filmstrip_width : 0);
                        $post_height = $image_height - ($filmstrip_direction == 'horizontal' ? $slideshow_filmstrip_height : 0);
                        if ($post_height < $post_width + 88) {
                            $post_width = $post_height - 88;
                        } else {
                            $post_height = $post_width + 88;
                        }
                        WDWLibraryEmbed::display_embed($image_row->filetype, $image_row->filename, array('class' => "bwg_embed_frame_" . $bwg, 'frameborder' => "0", 'style' => "width:" . $post_width . "px; height:" . $post_height . "px; vertical-align:middle; display:inline-block; position:relative;"));
                    } else {
                        WDWLibraryEmbed::display_embed($image_row->filetype, $image_row->filename, array('class' => "bwg_embed_frame_" . $bwg, 'frameborder' => "0", 'allowfullscreen' => "allowfullscreen", 'style' => "width:inherit; height:inherit; vertical-align:middle; display:table-cell;"));
                    }
                    ?>
                        
                            </span>
                            <?php 
                }
                ?>
                        </span>
                      </span>
                    </span>
                    <?php 
            }
        }
        ?>
                </div>
              </div>
            </div>
            <?php 
        if ($enable_slideshow_ctrl) {
            ?>
              <a id="spider_slideshow_left_<?php 
            echo $bwg;
            ?>
" onclick="bwg_change_image_<?php 
            echo $bwg;
            ?>
(parseInt(jQuery('#bwg_current_image_key_<?php 
            echo $bwg;
            ?>
').val()), (parseInt(jQuery('#bwg_current_image_key_<?php 
            echo $bwg;
            ?>
').val()) + data_<?php 
            echo $bwg;
            ?>
.length - iterator_<?php 
            echo $bwg;
            ?>
()) % data_<?php 
            echo $bwg;
            ?>
.length, data_<?php 
            echo $bwg;
            ?>
); return false;"><span id="spider_slideshow_left-ico_<?php 
            echo $bwg;
            ?>
"><span><i class="bwg_slideshow_prev_btn_<?php 
            echo $bwg;
            ?>
 fa <?php 
            echo $theme_row->slideshow_rl_btn_style;
            ?>
-left"></i></span></span></a>
              <span id="bwg_slideshow_play_pause_<?php 
            echo $bwg;
            ?>
" style="display: <?php 
            echo $play_pause_button_display;
            ?>
;"><span><span id="bwg_slideshow_play_pause-ico_<?php 
            echo $bwg;
            ?>
"><i class="bwg_ctrl_btn_<?php 
            echo $bwg;
            ?>
 bwg_slideshow_play_pause_<?php 
            echo $bwg;
            ?>
 fa fa-play"></i></span></span></span>
              <a id="spider_slideshow_right_<?php 
            echo $bwg;
            ?>
" onclick="bwg_change_image_<?php 
            echo $bwg;
            ?>
(parseInt(jQuery('#bwg_current_image_key_<?php 
            echo $bwg;
            ?>
').val()), (parseInt(jQuery('#bwg_current_image_key_<?php 
            echo $bwg;
            ?>
').val()) + iterator_<?php 
            echo $bwg;
            ?>
()) % data_<?php 
            echo $bwg;
            ?>
.length, data_<?php 
            echo $bwg;
            ?>
); return false;"><span id="spider_slideshow_right-ico_<?php 
            echo $bwg;
            ?>
"><span><i class="bwg_slideshow_next_btn_<?php 
            echo $bwg;
            ?>
 fa <?php 
            echo $theme_row->slideshow_rl_btn_style;
            ?>
-right"></i></span></span></a>
              <?php 
        }
        ?>
          </div>
          <?php 
        if ($watermark_type != 'none') {
            ?>
          <div class="bwg_slideshow_image_container_<?php 
            echo $bwg;
            ?>
" style="position: absolute;">
            <div class="bwg_slideshow_watermark_container_<?php 
            echo $bwg;
            ?>
">
              <div style="display:table; margin:0 auto;">
                <span class="bwg_slideshow_watermark_spun_<?php 
            echo $bwg;
            ?>
" id="bwg_slideshow_watermark_container_<?php 
            echo $bwg;
            ?>
">
                  <?php 
            if ($watermark_type == 'image') {
                ?>
                  <a href="<?php 
                echo urldecode($watermark_link);
                ?>
" target="_blank">
                    <img class="bwg_slideshow_watermark_image_<?php 
                echo $bwg;
                ?>
 bwg_slideshow_watermark_<?php 
                echo $bwg;
                ?>
" src="<?php 
                echo $watermark_url;
                ?>
" />
                  </a>
                  <?php 
            } elseif ($watermark_type == 'text') {
                ?>
                  <a class="bwg_none_selectable_<?php 
                echo $bwg;
                ?>
 bwg_slideshow_watermark_text_<?php 
                echo $bwg;
                ?>
 bwg_slideshow_watermark_<?php 
                echo $bwg;
                ?>
" target="_blank" href="<?php 
                echo $watermark_link;
                ?>
"><?php 
                echo $watermark_text;
                ?>
</a>
                  <?php 
            }
            ?>
                </span>
              </div>
            </div>
          </div>      
          <?php 
        }
        if ($enable_image_title) {
            ?>
          <div class="bwg_slideshow_image_container_<?php 
            echo $bwg;
            ?>
" style="position: absolute;">
            <div class="bwg_slideshow_watermark_container_<?php 
            echo $bwg;
            ?>
">
              <div style="display:table; margin:0 auto;">
                <span class="bwg_slideshow_title_spun_<?php 
            echo $bwg;
            ?>
">
                  <div class="bwg_slideshow_title_text_<?php 
            echo $bwg;
            ?>
" style="<?php 
            if (!$current_image_alt) {
                echo 'display:none;';
            }
            ?>
">
                    <?php 
            echo html_entity_decode($current_image_alt);
            ?>
                  </div>
                </span>
              </div>
            </div>
          </div>
          <?php 
        }
        if ($enable_image_description) {
            ?>
          <div class="bwg_slideshow_image_container_<?php 
            echo $bwg;
            ?>
" style="position: absolute;">
            <div class="bwg_slideshow_watermark_container_<?php 
            echo $bwg;
            ?>
">
              <div style="display:table; margin:0 auto;">
                <span class="bwg_slideshow_description_spun_<?php 
            echo $bwg;
            ?>
">
                  <div class="bwg_slideshow_description_text_<?php 
            echo $bwg;
            ?>
" style="<?php 
            if (!$current_image_description) {
                echo 'display:none;';
            }
            ?>
">
                    <?php 
            echo html_entity_decode(str_replace("\r\n", esc_html('<br />'), $current_image_description));
            ?>
                  </div>
                </span>
              </div>
            </div>
          </div>
          <?php 
        }
        if ($enable_slideshow_music) {
            ?>
            <audio id="bwg_audio_<?php 
            echo $bwg;
            ?>
" src="<?php 
            echo site_url() . '/' . $WD_BWG_UPLOAD_DIR . $slideshow_music_url;
            ?>
" loop volume="1.0"></audio>
            <?php 
        }
        ?>
        </div>
      </div>
    </div>

    <script>
      var bwg_trans_in_progress_<?php 
        echo $bwg;
        ?>
 = false;
      var bwg_transition_duration_<?php 
        echo $bwg;
        ?>
 = <?php 
        echo $slideshow_interval < 4 && $slideshow_interval != 0 ? $slideshow_interval * 1000 / 4 : 800;
        ?>
;
      var bwg_playInterval_<?php 
        echo $bwg;
        ?>
;
      /* Stop autoplay.*/
      window.clearInterval(bwg_playInterval_<?php 
        echo $bwg;
        ?>
);
      /* Set watermark container size.*/
      function bwg_change_watermark_container_<?php 
        echo $bwg;
        ?>
() {
        jQuery(".bwg_slider_<?php 
        echo $bwg;
        ?>
").children().each(function() {
          if (jQuery(this).css("zIndex") == 2) {
            var bwg_current_image_span = jQuery(this).find("img");
            if (!bwg_current_image_span.length) {
              bwg_current_image_span = jQuery(this).find("iframe");
            }
            if (!bwg_current_image_span.length) {
              bwg_current_image_span = jQuery(this).find("video");
            }
            var width = bwg_current_image_span.width();
            var height = bwg_current_image_span.height();
            jQuery(".bwg_slideshow_watermark_spun_<?php 
        echo $bwg;
        ?>
").width(width);
            jQuery(".bwg_slideshow_watermark_spun_<?php 
        echo $bwg;
        ?>
").height(height);
            jQuery(".bwg_slideshow_title_spun_<?php 
        echo $bwg;
        ?>
").width(width);
            jQuery(".bwg_slideshow_title_spun_<?php 
        echo $bwg;
        ?>
").height(height);
            jQuery(".bwg_slideshow_description_spun_<?php 
        echo $bwg;
        ?>
").width(width);
            jQuery(".bwg_slideshow_description_spun_<?php 
        echo $bwg;
        ?>
").height(height);
            jQuery(".bwg_slideshow_watermark_<?php 
        echo $bwg;
        ?>
").css({display: ''});
            if (jQuery.trim(jQuery(".bwg_slideshow_title_text_<?php 
        echo $bwg;
        ?>
").text())) {
              jQuery(".bwg_slideshow_title_text_<?php 
        echo $bwg;
        ?>
").css({display: ''});
            }
            if (jQuery.trim(jQuery(".bwg_slideshow_description_text_<?php 
        echo $bwg;
        ?>
").text())) {
              jQuery(".bwg_slideshow_description_text_<?php 
        echo $bwg;
        ?>
").css({display: ''});
            }
          }
        });
      }
      var bwg_current_key_<?php 
        echo $bwg;
        ?>
 = '<?php 
        echo isset($current_key) ? $current_key : '';
        ?>
';
      var bwg_current_filmstrip_pos_<?php 
        echo $bwg;
        ?>
 = <?php 
        echo $current_pos;
        ?>
;
      /* Set filmstrip initial position.*/
      function bwg_set_filmstrip_pos_<?php 
        echo $bwg;
        ?>
(filmStripWidth) {
        var selectedImagePos = -bwg_current_filmstrip_pos_<?php 
        echo $bwg;
        ?>
 - (jQuery(".bwg_slideshow_filmstrip_thumbnail_<?php 
        echo $bwg;
        ?>
").width() + <?php 
        echo $filmstrip_thumb_margin_hor;
        ?>
) / 2;
        var imagesContainerLeft = Math.min(0, Math.max(filmStripWidth - jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php 
        echo $bwg;
        ?>
").width(), selectedImagePos + filmStripWidth / 2));
        jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php 
        echo $bwg;
        ?>
").animate({
            left: imagesContainerLeft
          }, {
            duration: 500,
            complete: function () { bwg_filmstrip_arrows_<?php 
        echo $bwg;
        ?>
(); }
          });
      }
      function bwg_move_filmstrip_<?php 
        echo $bwg;
        ?>
() {
        var image_left = jQuery(".bwg_slideshow_thumb_active_<?php 
        echo $bwg;
        ?>
").position().left;
        var image_right = jQuery(".bwg_slideshow_thumb_active_<?php 
        echo $bwg;
        ?>
").position().left + jQuery(".bwg_slideshow_thumb_active_<?php 
        echo $bwg;
        ?>
").outerWidth(true);
        var bwg_filmstrip_width = jQuery(".bwg_slideshow_filmstrip_<?php 
        echo $bwg;
        ?>
").outerWidth(true);
        var bwg_filmstrip_thumbnails_width = jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php 
        echo $bwg;
        ?>
").outerWidth(true);
        var long_filmstrip_cont_left = jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php 
        echo $bwg;
        ?>
").position().left;
        var long_filmstrip_cont_right = Math.abs(jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php 
        echo $bwg;
        ?>
").position().left) + bwg_filmstrip_width;
        if (bwg_filmstrip_width > bwg_filmstrip_thumbnails_width) {
          return;
        }
        if (image_left < Math.abs(long_filmstrip_cont_left)) {
          jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php 
        echo $bwg;
        ?>
").animate({
            left: -image_left
          }, {
            duration: 500,
            complete: function () { bwg_filmstrip_arrows_<?php 
        echo $bwg;
        ?>
(); }
          });
        }
        else if (image_right > long_filmstrip_cont_right) {
          jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php 
        echo $bwg;
        ?>
").animate({
            left: -(image_right - bwg_filmstrip_width)
          }, {
            duration: 500,
            complete: function () { bwg_filmstrip_arrows_<?php 
        echo $bwg;
        ?>
(); }
          });
        }
      }
      function bwg_move_dots_<?php 
        echo $bwg;
        ?>
() {
        var image_left = jQuery(".bwg_slideshow_dots_active_<?php 
        echo $bwg;
        ?>
").position().left;
        var image_right = jQuery(".bwg_slideshow_dots_active_<?php 
        echo $bwg;
        ?>
").position().left + jQuery(".bwg_slideshow_dots_active_<?php 
        echo $bwg;
        ?>
").outerWidth(true);
        var bwg_dots_width = jQuery(".bwg_slideshow_dots_container_<?php 
        echo $bwg;
        ?>
").outerWidth(true);
        var bwg_dots_thumbnails_width = jQuery(".bwg_slideshow_dots_thumbnails_<?php 
        echo $bwg;
        ?>
").outerWidth(false);
        var long_filmstrip_cont_left = jQuery(".bwg_slideshow_dots_thumbnails_<?php 
        echo $bwg;
        ?>
").position().left;
        var long_filmstrip_cont_right = Math.abs(jQuery(".bwg_slideshow_dots_thumbnails_<?php 
        echo $bwg;
        ?>
").position().left) + bwg_dots_width;
        if (bwg_dots_width > bwg_dots_thumbnails_width) {
          return;
        }
        if (image_left < Math.abs(long_filmstrip_cont_left)) {
          jQuery(".bwg_slideshow_dots_thumbnails_<?php 
        echo $bwg;
        ?>
").animate({
            left: -image_left
          }, {
            duration: 500,
            complete: function () {  }
          });
        }
        else if (image_right > long_filmstrip_cont_right) {
          jQuery(".bwg_slideshow_dots_thumbnails_<?php 
        echo $bwg;
        ?>
").animate({
            left: -(image_right - bwg_dots_width)
          }, {
            duration: 500,
            complete: function () {  }
          });
        }
      }
      /* Show/hide filmstrip arrows.*/
      function bwg_filmstrip_arrows_<?php 
        echo $bwg;
        ?>
() {
        if (jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php 
        echo $bwg;
        ?>
").width() < jQuery(".bwg_slideshow_filmstrip_<?php 
        echo $bwg;
        ?>
").width()) {
          jQuery(".bwg_slideshow_filmstrip_left_<?php 
        echo $bwg;
        ?>
").hide();
          jQuery(".bwg_slideshow_filmstrip_right_<?php 
        echo $bwg;
        ?>
").hide();
        }
        else {
          jQuery(".bwg_slideshow_filmstrip_left_<?php 
        echo $bwg;
        ?>
").show();
          jQuery(".bwg_slideshow_filmstrip_right_<?php 
        echo $bwg;
        ?>
").show();
        }
      }
      function bwg_testBrowser_cssTransitions_<?php 
        echo $bwg;
        ?>
() {
        return bwg_testDom_<?php 
        echo $bwg;
        ?>
('Transition');
      }
      function bwg_testBrowser_cssTransforms3d_<?php 
        echo $bwg;
        ?>
() {
        return bwg_testDom_<?php 
        echo $bwg;
        ?>
('Perspective');
      }
      function bwg_testDom_<?php 
        echo $bwg;
        ?>
(prop) {
        /* Browser vendor CSS prefixes.*/
        var browserVendors = ['', '-webkit-', '-moz-', '-ms-', '-o-', '-khtml-'];
        /* Browser vendor DOM prefixes.*/
        var domPrefixes = ['', 'Webkit', 'Moz', 'ms', 'O', 'Khtml'];
        var i = domPrefixes.length;
        while (i--) {
          if (typeof document.body.style[domPrefixes[i] + prop] !== 'undefined') {
            return true;
          }
        }
        return false;
      }
      function bwg_cube_<?php 
        echo $bwg;
        ?>
(tz, ntx, nty, nrx, nry, wrx, wry, current_image_class, next_image_class, direction) {
        /* If browser does not support 3d transforms/CSS transitions.*/
        if (!bwg_testBrowser_cssTransitions_<?php 
        echo $bwg;
        ?>
()) {
          return bwg_fallback_<?php 
        echo $bwg;
        ?>
(current_image_class, next_image_class, direction);
        }
        if (!bwg_testBrowser_cssTransforms3d_<?php 
        echo $bwg;
        ?>
()) {
          return bwg_fallback3d_<?php 
        echo $bwg;
        ?>
(current_image_class, next_image_class, direction);
        }
        bwg_trans_in_progress_<?php 
        echo $bwg;
        ?>
 = true;
        /* Set active thumbnail.*/
        jQuery(".bwg_slideshow_filmstrip_thumbnail_<?php 
        echo $bwg;
        ?>
").removeClass("bwg_slideshow_thumb_active_<?php 
        echo $bwg;
        ?>
").addClass("bwg_slideshow_thumb_deactive_<?php 
        echo $bwg;
        ?>
");
        jQuery("#bwg_filmstrip_thumbnail_" + bwg_current_key_<?php 
        echo $bwg;
        ?>
 + "_<?php 
        echo $bwg;
        ?>
").removeClass("bwg_slideshow_thumb_deactive_<?php 
        echo $bwg;
        ?>
").addClass("bwg_slideshow_thumb_active_<?php 
        echo $bwg;
        ?>
");
        jQuery(".bwg_slideshow_dots_<?php 
        echo $bwg;
        ?>
").removeClass("bwg_slideshow_dots_active_<?php 
        echo $bwg;
        ?>
").addClass("bwg_slideshow_dots_deactive_<?php 
        echo $bwg;
        ?>
");
        jQuery("#bwg_dots_" + bwg_current_key_<?php 
        echo $bwg;
        ?>
 + "_<?php 
        echo $bwg;
        ?>
").removeClass("bwg_slideshow_dots_deactive_<?php 
        echo $bwg;
        ?>
").addClass("bwg_slideshow_dots_active_<?php 
        echo $bwg;
        ?>
");
        jQuery(".bwg_slide_bg_<?php 
        echo $bwg;
        ?>
").css('perspective', 1000);
        jQuery(current_image_class).css({
          transform : 'translateZ(' + tz + 'px)',
          backfaceVisibility : 'hidden'
        });
        jQuery(next_image_class).css({
          opacity : 1,
          filter: 'Alpha(opacity=100)',
          zIndex: 2,
          backfaceVisibility : 'hidden',
          transform : 'translateY(' + nty + 'px) translateX(' + ntx + 'px) rotateY('+ nry +'deg) rotateX('+ nrx +'deg)'
        });
        jQuery(".bwg_slider_<?php 
        echo $bwg;
        ?>
").css({
          transform: 'translateZ(-' + tz + 'px)',
          transformStyle: 'preserve-3d'
        });
        /* Execution steps.*/
        setTimeout(function () {
          jQuery(".bwg_slider_<?php 
        echo $bwg;
        ?>
").css({
            transition: 'all ' + bwg_transition_duration_<?php 
        echo $bwg;
        ?>
 + 'ms ease-in-out',
            transform: 'translateZ(-' + tz + 'px) rotateX('+ wrx +'deg) rotateY('+ wry +'deg)'
          });
        }, 20);
        /* After transition.*/
        jQuery(".bwg_slider_<?php 
        echo $bwg;
        ?>
").one('webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend', jQuery.proxy(bwg_after_trans));
        function bwg_after_trans() {
          /*if (bwg_from_focus_<?php 
        echo $bwg;
        ?>
) {
            bwg_from_focus_<?php 
        echo $bwg;
        ?>
 = false;
            return;
          }*/
          jQuery(current_image_class).removeAttr('style');
          jQuery(next_image_class).removeAttr('style');
          jQuery(".bwg_slider_<?php 
        echo $bwg;
        ?>
").removeAttr('style');
          jQuery(current_image_class).css({'opacity' : 0, filter: 'Alpha(opacity=0)', 'z-index': 1});
          jQuery(next_image_class).css({'opacity' : 1, filter: 'Alpha(opacity=100)', 'z-index' : 2});
          bwg_change_watermark_container_<?php 
        echo $bwg;
        ?>
();
          bwg_trans_in_progress_<?php 
        echo $bwg;
        ?>
 = false;
          if (typeof event_stack_<?php 
        echo $bwg;
        ?>
 !== 'undefined') {
            if (event_stack_<?php 
        echo $bwg;
        ?>
.length > 0) {
              key = event_stack_<?php 
        echo $bwg;
        ?>
[0].split("-");
              event_stack_<?php 
        echo $bwg;
        ?>
.shift();
              bwg_change_image_<?php 
        echo $bwg;
        ?>
(key[0], key[1], data_<?php 
        echo $bwg;
        ?>
, true);
            }
          }
        }
      }
      function bwg_cubeH_<?php 
        echo $bwg;
        ?>
(current_image_class, next_image_class, direction) {
        /* Set to half of image width.*/
        var dimension = jQuery(current_image_class).width() / 2;
        if (direction == 'right') {
          bwg_cube_<?php 
        echo $bwg;
        ?>
(dimension, dimension, 0, 0, 90, 0, -90, current_image_class, next_image_class, direction);
        }
        else if (direction == 'left') {
          bwg_cube_<?php 
        echo $bwg;
        ?>
(dimension, -dimension, 0, 0, -90, 0, 90, current_image_class, next_image_class, direction);
        }
      }
      /* For browsers that does not support transitions.*/
      function bwg_fallback_<?php 
        echo $bwg;
        ?>
(current_image_class, next_image_class, direction) {
        bwg_fade_<?php 
        echo $bwg;
        ?>
(current_image_class, next_image_class, direction);
      }
      /* For browsers that support transitions, but not 3d transforms (only used if primary transition makes use of 3d-transforms).*/
      function bwg_fallback3d_<?php 
        echo $bwg;
        ?>
(current_image_class, next_image_class, direction) {
        bwg_sliceV_<?php 
        echo $bwg;
        ?>
(current_image_class, next_image_class, direction);
      }
      function bwg_none_<?php 
        echo $bwg;
        ?>
(current_image_class, next_image_class, direction) {
        jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1});
        jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2});
        bwg_change_watermark_container_<?php 
        echo $bwg;
        ?>
();
        /* Set active thumbnail.*/
        jQuery(".bwg_slideshow_filmstrip_thumbnail_<?php 
        echo $bwg;
        ?>
").removeClass("bwg_slideshow_thumb_active_<?php 
        echo $bwg;
        ?>
").addClass("bwg_slideshow_thumb_deactive_<?php 
        echo $bwg;
        ?>
");
        jQuery("#bwg_filmstrip_thumbnail_" + bwg_current_key_<?php 
        echo $bwg;
        ?>
 + "_<?php 
        echo $bwg;
        ?>
").removeClass("bwg_slideshow_thumb_deactive_<?php 
        echo $bwg;
        ?>
").addClass("bwg_slideshow_thumb_active_<?php 
        echo $bwg;
        ?>
");
        jQuery(".bwg_slideshow_dots_<?php 
        echo $bwg;
        ?>
").removeClass("bwg_slideshow_dots_active_<?php 
        echo $bwg;
        ?>
").addClass("bwg_slideshow_dots_deactive_<?php 
        echo $bwg;
        ?>
");
        jQuery("#bwg_dots_" + bwg_current_key_<?php 
        echo $bwg;
        ?>
 + "_<?php 
        echo $bwg;
        ?>
").removeClass("bwg_slideshow_dots_deactive_<?php 
        echo $bwg;
        ?>
").addClass("bwg_slideshow_dots_active_<?php 
        echo $bwg;
        ?>
");
      }
      function bwg_fade_<?php 
        echo $bwg;
        ?>
(current_image_class, next_image_class, direction) {
        /* Set active thumbnail.*/
        jQuery(".bwg_slideshow_filmstrip_thumbnail_<?php 
        echo $bwg;
        ?>
").removeClass("bwg_slideshow_thumb_active_<?php 
        echo $bwg;
        ?>
").addClass("bwg_slideshow_thumb_deactive_<?php 
        echo $bwg;
        ?>
");
        jQuery("#bwg_filmstrip_thumbnail_" + bwg_current_key_<?php 
        echo $bwg;
        ?>
 + "_<?php 
        echo $bwg;
        ?>
").removeClass("bwg_slideshow_thumb_deactive_<?php 
        echo $bwg;
        ?>
").addClass("bwg_slideshow_thumb_active_<?php 
        echo $bwg;
        ?>
");
        jQuery(".bwg_slideshow_dots_<?php 
        echo $bwg;
        ?>
").removeClass("bwg_slideshow_dots_active_<?php 
        echo $bwg;
        ?>
").addClass("bwg_slideshow_dots_deactive_<?php 
        echo $bwg;
        ?>
");
        jQuery("#bwg_dots_" + bwg_current_key_<?php 
        echo $bwg;
        ?>
 + "_<?php 
        echo $bwg;
        ?>
").removeClass("bwg_slideshow_dots_deactive_<?php 
        echo $bwg;
        ?>
").addClass("bwg_slideshow_dots_active_<?php 
        echo $bwg;
        ?>
");
        if (bwg_testBrowser_cssTransitions_<?php 
        echo $bwg;
        ?>
()) {
          jQuery(next_image_class).css('transition', 'opacity ' + bwg_transition_duration_<?php 
        echo $bwg;
        ?>
 + 'ms linear');
          jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1});
          jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2});
          bwg_change_watermark_container_<?php 
        echo $bwg;
        ?>
();
        }
        else {
          jQuery(current_image_class).animate({'opacity' : 0, 'z-index' : 1}, bwg_transition_duration_<?php 
        echo $bwg;
        ?>
);
          jQuery(next_image_class).animate({
              'opacity' : 1,
              'z-index': 2
            }, {
              duration: bwg_transition_duration_<?php 
        echo $bwg;
        ?>
,
              complete: function () { bwg_change_watermark_container_<?php 
        echo $bwg;
        ?>
(); }
            });
          /* For IE.*/
          jQuery(current_image_class).fadeTo(bwg_transition_duration_<?php 
        echo $bwg;
        ?>
, 0);
          jQuery(next_image_class).fadeTo(bwg_transition_duration_<?php 
        echo $bwg;
        ?>
, 1);
        }
      }
      function bwg_grid_<?php 
        echo $bwg;
        ?>
(cols, rows, ro, tx, ty, sc, op, current_image_class, next_image_class, direction) {
        /* If browser does not support CSS transitions.*/
        if (!bwg_testBrowser_cssTransitions_<?php 
        echo $bwg;
        ?>
()) {
          return bwg_fallback_<?php 
        echo $bwg;
        ?>
(current_image_class, next_image_class, direction);
        }
        bwg_trans_in_progress_<?php 
        echo $bwg;
        ?>
 = true;
        /* Set active thumbnail.*/
        jQuery(".bwg_slideshow_filmstrip_thumbnail_<?php 
        echo $bwg;
        ?>
").removeClass("bwg_slideshow_thumb_active_<?php 
        echo $bwg;
        ?>
").addClass("bwg_slideshow_thumb_deactive_<?php 
        echo $bwg;
        ?>
");
        jQuery("#bwg_filmstrip_thumbnail_" + bwg_current_key_<?php 
        echo $bwg;
        ?>
 + "_<?php 
        echo $bwg;
        ?>
").removeClass("bwg_slideshow_thumb_deactive_<?php 
        echo $bwg;
        ?>
").addClass("bwg_slideshow_thumb_active_<?php 
        echo $bwg;
        ?>
");
        jQuery(".bwg_slideshow_dots_<?php 
        echo $bwg;
        ?>
").removeClass("bwg_slideshow_dots_active_<?php 
        echo $bwg;
        ?>
").addClass("bwg_slideshow_dots_deactive_<?php 
        echo $bwg;
        ?>
");
        jQuery("#bwg_dots_" + bwg_current_key_<?php 
        echo $bwg;
        ?>
 + "_<?php 
        echo $bwg;
        ?>
").removeClass("bwg_slideshow_dots_deactive_<?php 
        echo $bwg;
        ?>
").addClass("bwg_slideshow_dots_active_<?php 
        echo $bwg;
        ?>
");
        /* The time (in ms) added to/subtracted from the delay total for each new gridlet.*/
        var count = (bwg_transition_duration_<?php 
        echo $bwg;
        ?>
) / (cols + rows);
        /* Gridlet creator (divisions of the image grid, positioned with background-images to replicate the look of an entire slide image when assembled)*/
        function bwg_gridlet(width, height, top, img_top, left, img_left, src, imgWidth, imgHeight, c, r) {
          var delay = (c + r) * count;
          /* Return a gridlet elem with styles for specific transition.*/
          return jQuery('<div class="bwg_gridlet_<?php 
        echo $bwg;
        ?>
" />').css({
            width : width,
            height : height,
            top : top,
            left : left,
            backgroundImage : 'url("' + src + '")',
            backgroundColor: jQuery(".bwg_slideshow_image_wrap_<?php 
        echo $bwg;
        ?>
").css("background-color"),
            /*backgroundColor: rgba(0, 0, 0, 0),*/
            backgroundRepeat: 'no-repeat',
            backgroundPosition : img_left + 'px ' + img_top + 'px',
            backgroundSize : imgWidth + 'px ' + imgHeight + 'px',
            transition : 'all ' + bwg_transition_duration_<?php 
        echo $bwg;
        ?>
 + 'ms ease-in-out ' + delay + 'ms',
            transform : 'none'
          });
        }
        /* Get the current slide's image.*/
        var cur_img = jQuery(current_image_class).find('img');
        /* Create a grid to hold the gridlets.*/
        var grid = jQuery('<div />').addClass('bwg_grid_<?php 
        echo $bwg;
        ?>
');
        /* Prepend the grid to the next slide (i.e. so it's above the slide image).*/
        jQuery(current_image_class).prepend(grid);
        /* vars to calculate positioning/size of gridlets*/
        var cont = jQuery(".bwg_slide_bg_<?php 
        echo $bwg;
        ?>
");
        var imgWidth = cur_img.width();
        var imgHeight = cur_img.height();
        var contWidth = cont.width(),
            contHeight = cont.height(),
            imgSrc = cur_img.attr('src'),/*.replace('/thumb', ''),*/
            colWidth = Math.floor(contWidth / cols),
            rowHeight = Math.floor(contHeight / rows),
            colRemainder = contWidth - (cols * colWidth),
            colAdd = Math.ceil(colRemainder / cols),
            rowRemainder = contHeight - (rows * rowHeight),
            rowAdd = Math.ceil(rowRemainder / rows),
            leftDist = 0,
            img_leftDist = (jQuery(".bwg_slide_bg_<?php 
        echo $bwg;
        ?>
").width() - cur_img.width()) / 2;
        /* tx/ty args can be passed as 'auto'/'min-auto' (meaning use slide width/height or negative slide width/height).*/
        tx = tx === 'auto' ? contWidth : tx;
        tx = tx === 'min-auto' ? - contWidth : tx;
        ty = ty === 'auto' ? contHeight : ty;
        ty = ty === 'min-auto' ? - contHeight : ty;
        /* Loop through cols*/
        for (var i = 0; i < cols; i++) {
          var topDist = 0,
              img_topDst = (jQuery(".bwg_slide_bg_<?php 
        echo $bwg;
        ?>
").height() - cur_img.height()) / 2,
              newColWidth = colWidth;
          /* If imgWidth (px) does not divide cleanly into the specified number of cols, adjust individual col widths to create correct total.*/
          if (colRemainder > 0) {
            var add = colRemainder >= colAdd ? colAdd : colRemainder;
            newColWidth += add;
            colRemainder -= add;
          }
          /* Nested loop to create row gridlets for each col.*/
          for (var j = 0; j < rows; j++)  {
            var newRowHeight = rowHeight,
                newRowRemainder = rowRemainder;
            /* If contHeight (px) does not divide cleanly into the specified number of rows, adjust individual row heights to create correct total.*/
            if (newRowRemainder > 0) {
              add = newRowRemainder >= rowAdd ? rowAdd : rowRemainder;
              newRowHeight += add;
              newRowRemainder -= add;
            }
            /* Create & append gridlet to grid.*/
            grid.append(bwg_gridlet(newColWidth, newRowHeight, topDist, img_topDst, leftDist, img_leftDist, imgSrc, imgWidth, imgHeight, i, j));
            topDist += newRowHeight;
            img_topDst -= newRowHeight;
          }
          img_leftDist -= newColWidth;
          leftDist += newColWidth;
        }
        /* Set event listener on last gridlet to finish transitioning.*/
        var last_gridlet = grid.children().last();
        /* Show grid & hide the image it replaces.*/
        grid.show();
        cur_img.css('opacity', 0);
        /* Add identifying classes to corner gridlets (useful if applying border radius).*/
        grid.children().first().addClass('rs-top-left');
        grid.children().last().addClass('rs-bottom-right');
        grid.children().eq(rows - 1).addClass('rs-bottom-left');
        grid.children().eq(- rows).addClass('rs-top-right');
        /* Execution steps.*/
        setTimeout(function () {
          grid.children().css({
            opacity: op,
            transform: 'rotate('+ ro +'deg) translateX('+ tx +'px) translateY('+ ty +'px) scale('+ sc +')'
          });
        }, 1);
        jQuery(next_image_class).css('opacity', 1);
        /* After transition.*/
        jQuery(last_gridlet).one('webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend', jQuery.proxy(bwg_after_trans));
        function bwg_after_trans() {
          /*if (bwg_from_focus_<?php 
        echo $bwg;
        ?>
) {
            bwg_from_focus_<?php 
        echo $bwg;
        ?>
 = false;
            return;
          }*/
          jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1});
          jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2});
          cur_img.css('opacity', 1);
          bwg_change_watermark_container_<?php 
        echo $bwg;
        ?>
();
          grid.remove();
          bwg_trans_in_progress_<?php 
        echo $bwg;
        ?>
 = false;
          if (typeof event_stack_<?php 
        echo $bwg;
        ?>
 !== 'undefined') {
            if (event_stack_<?php 
        echo $bwg;
        ?>
.length > 0) {
              key = event_stack_<?php 
        echo $bwg;
        ?>
[0].split("-");
              event_stack_<?php 
        echo $bwg;
        ?>
.shift();
              bwg_change_image_<?php 
        echo $bwg;
        ?>
(key[0], key[1], data_<?php 
        echo $bwg;
        ?>
, true);
            }
          }
        }
      }
      function bwg_sliceV_<?php 
        echo $bwg;
        ?>
(current_image_class, next_image_class, direction) {
        if (direction == 'right') {
          var translateY = 'min-auto';
        }
        else if (direction == 'left') {
          var translateY = 'auto';
        }
        bwg_grid_<?php 
        echo $bwg;
        ?>
(10, 1, 0, 0, translateY, 1, 0, current_image_class, next_image_class, direction);
      }
      function bwg_scaleOut_<?php 
        echo $bwg;
        ?>
(current_image_class, next_image_class, direction) {
        bwg_grid_<?php 
        echo $bwg;
        ?>
(1, 1, 0, 0, 0, 1.5, 0, current_image_class, next_image_class, direction);
      }
      function bwg_blindH_<?php 
        echo $bwg;
        ?>
(current_image_class, next_image_class, direction) {
        bwg_grid_<?php 
        echo $bwg;
        ?>
(10, 1, 0, 0, 0, .7, 0, current_image_class, next_image_class);
      }
      function iterator_<?php 
        echo $bwg;
        ?>
() {
        var iterator = 1;
        if (<?php 
        echo $enable_slideshow_shuffle;
        ?>
) {
          iterator = Math.floor((data_<?php 
        echo $bwg;
        ?>
.length - 1) * Math.random() + 1);
        }
        return iterator;
      }
      function bwg_change_image_<?php 
        echo $bwg;
        ?>
(current_key, key, data_<?php 
        echo $bwg;
        ?>
, from_effect) {
        /* Pause videos.*/
        jQuery("#bwg_slideshow_image_container_<?php 
        echo $bwg;
        ?>
").find("iframe").each(function () {
          jQuery(this)[0].contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
          jQuery(this)[0].contentWindow.postMessage('{ "method": "pause" }', "*");
          jQuery(this)[0].contentWindow.postMessage('pause', '*');
        });
        if (data_<?php 
        echo $bwg;
        ?>
[key]) {
          if (jQuery('.bwg_ctrl_btn_<?php 
        echo $bwg;
        ?>
').hasClass('fa-pause')) {
            play_<?php 
        echo $bwg;
        ?>
();
          }
          if (!from_effect) {
            /* Change image key.*/
            jQuery("#bwg_current_image_key_<?php 
        echo $bwg;
        ?>
").val(key);
            if (current_key == '-1') { /* Filmstrip.*/
              current_key = jQuery(".bwg_slideshow_thumb_active_<?php 
        echo $bwg;
        ?>
").children("img").attr("image_key");
            }
            else if (current_key == '-2') { /* Dots.*/
              current_key = jQuery(".bwg_slideshow_dots_active_<?php 
        echo $bwg;
        ?>
").attr("image_key");
            }
          }
          if (bwg_trans_in_progress_<?php 
        echo $bwg;
        ?>
) {
            event_stack_<?php 
        echo $bwg;
        ?>
.push(current_key + '-' + key);
            return;
          }
          var direction = 'right';
          if (bwg_current_key_<?php 
        echo $bwg;
        ?>
 > key) {
            var direction = 'left';
          }
          else if (bwg_current_key_<?php 
        echo $bwg;
        ?>
 == key) {
            return;
          }
          jQuery(".bwg_slideshow_watermark_<?php 
        echo $bwg;
        ?>
").css({display: 'none'});
          jQuery(".bwg_slideshow_title_text_<?php 
        echo $bwg;
        ?>
").css({display: 'none'});
          jQuery(".bwg_slideshow_description_text_<?php 
        echo $bwg;
        ?>
").css({display: 'none'});
          /* Set active thumbnail position.*/
          bwg_current_filmstrip_pos_<?php 
        echo $bwg;
        ?>
 = key * (jQuery(".bwg_slideshow_filmstrip_thumbnail_<?php 
        echo $bwg;
        ?>
").width() + 2 + 2 * <?php 
        echo $theme_row->lightbox_filmstrip_thumb_border_width;
        ?>
);
          bwg_current_key_<?php 
        echo $bwg;
        ?>
 = key;
          /* Change image id, title, description.*/
          jQuery("#bwg_slideshow_image_<?php 
        echo $bwg;
        ?>
").attr('image_id', data_<?php 
        echo $bwg;
        ?>
[key]["id"]);
          jQuery(".bwg_slideshow_title_text_<?php 
        echo $bwg;
        ?>
").html(jQuery('<div />').html(data_<?php 
        echo $bwg;
        ?>
[key]["alt"]).text());
          jQuery(".bwg_slideshow_description_text_<?php 
        echo $bwg;
        ?>
").html(jQuery('<div />').html(data_<?php 
        echo $bwg;
        ?>
[key]["description"]).text());
          var current_image_class = "#image_id_<?php 
        echo $bwg;
        ?>
_" + data_<?php 
        echo $bwg;
        ?>
[current_key]["id"];
          var next_image_class = "#image_id_<?php 
        echo $bwg;
        ?>
_" + data_<?php 
        echo $bwg;
        ?>
[key]["id"];
          bwg_<?php 
        echo $slideshow_effect;
        ?>
_<?php 
        echo $bwg;
        ?>
(current_image_class, next_image_class, direction);
          <?php 
        if ($enable_slideshow_filmstrip) {
            ?>
            bwg_move_filmstrip_<?php 
            echo $bwg;
            ?>
();
            <?php 
        } else {
            ?>
            bwg_move_dots_<?php 
            echo $bwg;
            ?>
();
            <?php 
        }
        ?>
          if (data_<?php 
        echo $bwg;
        ?>
[key]["is_embed_video"]) {
            jQuery("#bwg_slideshow_play_pause_<?php 
        echo $bwg;
        ?>
").css({display: 'none'});
          }
          else {
            jQuery("#bwg_slideshow_play_pause_<?php 
        echo $bwg;
        ?>
").css({display: ''});            
          }
        }
      }
      function bwg_popup_resize_<?php 
        echo $bwg;
        ?>
() {
        var parent_width = jQuery(".bwg_slideshow_image_wrap_<?php 
        echo $bwg;
        ?>
").parent().width();
        if (parent_width >= <?php 
        echo $image_width;
        ?>
) {
          jQuery(".bwg_slideshow_image_wrap_<?php 
        echo $bwg;
        ?>
").css({width: <?php 
        echo $image_width;
        ?>
});
          jQuery(".bwg_slideshow_image_wrap_<?php 
        echo $bwg;
        ?>
").css({height: <?php 
        echo $image_height;
        ?>
});
          jQuery(".bwg_slideshow_image_container_<?php 
        echo $bwg;
        ?>
").css({width: <?php 
        echo $image_width;
        ?>
});
          jQuery(".bwg_slideshow_image_container_<?php 
        echo $bwg;
        ?>
").css({height: (<?php 
        echo $image_height - $slideshow_filmstrip_height;
        ?>
)});
          jQuery(".bwg_slideshow_image_<?php 
        echo $bwg;
        ?>
").css({
            cssText: "max-width: <?php 
        echo $image_width;
        ?>
px !important; max-height: <?php 
        echo $image_height - $slideshow_filmstrip_height;
        ?>
px !important;"
          });
          jQuery(".bwg_slideshow_embed_<?php 
        echo $bwg;
        ?>
").css({
            cssText: "width: <?php 
        echo $image_width;
        ?>
px !important; height: <?php 
        echo $image_height - $slideshow_filmstrip_height;
        ?>
px !important;"
          });
          bwg_resize_instagram_post_<?php 
        echo $bwg;
        ?>
();
          /* Set watermark container size.*/
          bwg_change_watermark_container_<?php 
        echo $bwg;
        ?>
();
          jQuery(".bwg_slideshow_filmstrip_container_<?php 
        echo $bwg;
        ?>
").css({width: <?php 
        echo $image_width;
        ?>
});
          jQuery(".bwg_slideshow_filmstrip_<?php 
        echo $bwg;
        ?>
").css({width: (<?php 
        echo $image_width;
        ?>
 - 40)});
          jQuery(".bwg_slideshow_dots_container_<?php 
        echo $bwg;
        ?>
").css({width: <?php 
        echo $image_width;
        ?>
});
          jQuery("#bwg_slideshow_play_pause-ico_<?php 
        echo $bwg;
        ?>
").css({fontSize: (<?php 
        echo $theme_row->slideshow_play_pause_btn_size;
        ?>
)});
          jQuery(".bwg_slideshow_watermark_image_<?php 
        echo $bwg;
        ?>
").css({maxWidth: <?php 
        echo $watermark_width;
        ?>
, maxHeight: <?php 
        echo $watermark_height;
        ?>
});
          jQuery(".bwg_slideshow_watermark_text_<?php 
        echo $bwg;
        ?>
, .bwg_slideshow_watermark_text_<?php 
        echo $bwg;
        ?>
:hover").css({fontSize: (<?php 
        echo $watermark_font_size;
        ?>
)});
          jQuery(".bwg_slideshow_title_text_<?php 
        echo $bwg;
        ?>
").css({fontSize: (<?php 
        echo $theme_row->slideshow_title_font_size * 2;
        ?>
)});
          jQuery(".bwg_slideshow_description_text_<?php 
        echo $bwg;
        ?>
").css({fontSize: (<?php 
        echo $theme_row->slideshow_description_font_size * 2;
        ?>
)});
        }
        else {
          jQuery(".bwg_slideshow_image_wrap_<?php 
        echo $bwg;
        ?>
").css({width: (parent_width)});
          jQuery(".bwg_slideshow_image_wrap_<?php 
        echo $bwg;
        ?>
").css({height: ((parent_width) * <?php 
        echo $image_height / $image_width;
        ?>
)});
          jQuery(".bwg_slideshow_image_container_<?php 
        echo $bwg;
        ?>
").css({width: (parent_width)});
          jQuery(".bwg_slideshow_image_container_<?php 
        echo $bwg;
        ?>
").css({height: ((parent_width) * <?php 
        echo $image_height / $image_width;
        ?>
 - <?php 
        echo $slideshow_filmstrip_height;
        ?>
)});
          jQuery(".bwg_slideshow_image_<?php 
        echo $bwg;
        ?>
").css({
            cssText: "max-width: " + parent_width + "px !important; max-height: " + (parent_width * (<?php 
        echo $image_height / $image_width;
        ?>
) - <?php 
        echo $slideshow_filmstrip_height;
        ?>
 - 1) + "px !important;"
          });
          jQuery(".bwg_slideshow_embed_<?php 
        echo $bwg;
        ?>
").css({
            cssText: "width: " + parent_width + "px !important; height: " + (parent_width * (<?php 
        echo $image_height / $image_width;
        ?>
) - <?php 
        echo $slideshow_filmstrip_height;
        ?>
 - 1) + "px !important;"
          });
          bwg_resize_instagram_post_<?php 
        echo $bwg;
        ?>
();
          /* Set watermark container size.*/
          bwg_change_watermark_container_<?php 
        echo $bwg;
        ?>
();
          jQuery(".bwg_slideshow_filmstrip_container_<?php 
        echo $bwg;
        ?>
").css({width: (parent_width)});
          jQuery(".bwg_slideshow_filmstrip_<?php 
        echo $bwg;
        ?>
").css({width: (parent_width - 40)});
          jQuery(".bwg_slideshow_dots_container_<?php 
        echo $bwg;
        ?>
").css({width: (parent_width)});
          jQuery("#bwg_slideshow_play_pause-ico_<?php 
        echo $bwg;
        ?>
").css({fontSize: ((parent_width) * <?php 
        echo $theme_row->slideshow_play_pause_btn_size / $image_width;
        ?>
)});
          jQuery(".bwg_slideshow_watermark_image_<?php 
        echo $bwg;
        ?>
").css({maxWidth: ((parent_width) * <?php 
        echo $watermark_width / $image_width;
        ?>
), maxHeight: ((parent_width) * <?php 
        echo $watermark_height / $image_width;
        ?>
)});
          jQuery(".bwg_slideshow_watermark_text_<?php 
        echo $bwg;
        ?>
, .bwg_slideshow_watermark_text_<?php 
        echo $bwg;
        ?>
:hover").css({fontSize: ((parent_width) * <?php 
        echo $watermark_font_size / $image_width;
        ?>
)});
          jQuery(".bwg_slideshow_title_text_<?php 
        echo $bwg;
        ?>
").css({fontSize: ((parent_width) * <?php 
        echo 2 * $theme_row->slideshow_title_font_size / $image_width;
        ?>
)});
          jQuery(".bwg_slideshow_description_text_<?php 
        echo $bwg;
        ?>
").css({fontSize: ((parent_width) * <?php 
        echo 2 * $theme_row->slideshow_description_font_size / $image_width;
        ?>
)});
        }
      }
      jQuery(window).resize(function() {
        bwg_popup_resize_<?php 
        echo $bwg;
        ?>
();
      });
      jQuery(window).load(function () {
      	<?php 
        if ($image_right_click) {
            ?>
          /* Disable right click.*/
          jQuery('div[id^="bwg_container"]').bind("contextmenu", function () {
            return false;
          });
          <?php 
        }
        ?>
        if (typeof jQuery().swiperight !== 'undefined') {
          if (jQuery.isFunction(jQuery().swiperight)) {
            jQuery('#bwg_container1_<?php 
        echo $bwg;
        ?>
').swiperight(function () {
              bwg_change_image_<?php 
        echo $bwg;
        ?>
(parseInt(jQuery('#bwg_current_image_key_<?php 
        echo $bwg;
        ?>
').val()), (parseInt(jQuery('#bwg_current_image_key_<?php 
        echo $bwg;
        ?>
').val()) - iterator_<?php 
        echo $bwg;
        ?>
()) >= 0 ? (parseInt(jQuery('#bwg_current_image_key_<?php 
        echo $bwg;
        ?>
').val()) - iterator_<?php 
        echo $bwg;
        ?>
()) % data_<?php 
        echo $bwg;
        ?>
.length : data_<?php 
        echo $bwg;
        ?>
.length - 1, data_<?php 
        echo $bwg;
        ?>
);
              return false;
            });
          }
        }
        if (typeof jQuery().swipeleft !== 'undefined') {
          if (jQuery.isFunction(jQuery().swipeleft)) {
            jQuery('#bwg_container1_<?php 
        echo $bwg;
        ?>
').swipeleft(function () {
              bwg_change_image_<?php 
        echo $bwg;
        ?>
(parseInt(jQuery('#bwg_current_image_key_<?php 
        echo $bwg;
        ?>
').val()), (parseInt(jQuery('#bwg_current_image_key_<?php 
        echo $bwg;
        ?>
').val()) + iterator_<?php 
        echo $bwg;
        ?>
()) % data_<?php 
        echo $bwg;
        ?>
.length, data_<?php 
        echo $bwg;
        ?>
);
              return false;
            });
          }
        }

        var isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
        var bwg_click = isMobile ? 'touchend' : 'click';
        bwg_popup_resize_<?php 
        echo $bwg;
        ?>
();
        jQuery("#bwg_container1_<?php 
        echo $bwg;
        ?>
").css({visibility: 'visible'});
        jQuery(".bwg_slideshow_watermark_<?php 
        echo $bwg;
        ?>
").css({display: 'none'});
        jQuery(".bwg_slideshow_title_text_<?php 
        echo $bwg;
        ?>
").css({display: 'none'});
        jQuery(".bwg_slideshow_description_text_<?php 
        echo $bwg;
        ?>
").css({display: 'none'});
        setTimeout(function () {
          bwg_change_watermark_container_<?php 
        echo $bwg;
        ?>
();
        }, 500);
        /* Set image container height.*/
        jQuery(".bwg_slideshow_image_container_<?php 
        echo $bwg;
        ?>
").height(jQuery(".bwg_slideshow_image_wrap_<?php 
        echo $bwg;
        ?>
").height() - <?php 
        echo $slideshow_filmstrip_height;
        ?>
);
        var mousewheelevt = (/Firefox/i.test(navigator.userAgent)) ? "DOMMouseScroll" : "mousewheel"; /* FF doesn't recognize mousewheel as of FF3.x */
        jQuery('.bwg_slideshow_filmstrip_<?php 
        echo $bwg;
        ?>
').bind(mousewheelevt, function(e) {
          var evt = window.event || e; /* Equalize event object.*/
          evt = evt.originalEvent ? evt.originalEvent : evt; /* Convert to originalEvent if possible.*/
          var delta = evt.detail ? evt.detail*(-40) : evt.wheelDelta; /* Check for detail first, because it is used by Opera and FF.*/
          if (delta > 0) {
            /* Scroll up.*/
            jQuery(".bwg_slideshow_filmstrip_left_<?php 
        echo $bwg;
        ?>
").trigger("click");
          }
          else {
            /* Scroll down.*/
            jQuery(".bwg_slideshow_filmstrip_right_<?php 
        echo $bwg;
        ?>
").trigger("click");
          }
          return false;
        });
        jQuery(".bwg_slideshow_filmstrip_right_<?php 
        echo $bwg;
        ?>
").on(bwg_click, function () {
          jQuery( ".bwg_slideshow_filmstrip_thumbnails_<?php 
        echo $bwg;
        ?>
" ).stop(true, false);
          if (jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php 
        echo $bwg;
        ?>
").position().left >= -(jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php 
        echo $bwg;
        ?>
").width() - jQuery(".bwg_slideshow_filmstrip_<?php 
        echo $bwg;
        ?>
").width())) {
            jQuery(".bwg_slideshow_filmstrip_left_<?php 
        echo $bwg;
        ?>
").css({opacity: 1, filter: "Alpha(opacity=100)"});
            if (jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php 
        echo $bwg;
        ?>
").position().left < -(jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php 
        echo $bwg;
        ?>
").width() - jQuery(".bwg_slideshow_filmstrip_<?php 
        echo $bwg;
        ?>
").width() - <?php 
        echo $filmstrip_thumb_margin_hor + $slideshow_filmstrip_width;
        ?>
)) {
              jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php 
        echo $bwg;
        ?>
").animate({left: -(jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php 
        echo $bwg;
        ?>
").width() - jQuery(".bwg_slideshow_filmstrip_<?php 
        echo $bwg;
        ?>
").width())}, 500, 'linear');
            }
            else {
              jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php 
        echo $bwg;
        ?>
").animate({left: (jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php 
        echo $bwg;
        ?>
").position().left - <?php 
        echo $filmstrip_thumb_margin_hor + $slideshow_filmstrip_width;
        ?>
)}, 500, 'linear');
            }
          }
          /* Disable right arrow.*/
          window.setTimeout(function(){
            if (jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php 
        echo $bwg;
        ?>
").position().left == -(jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php 
        echo $bwg;
        ?>
").width() - jQuery(".bwg_slideshow_filmstrip_<?php 
        echo $bwg;
        ?>
").width())) {
              jQuery(".bwg_slideshow_filmstrip_right_<?php 
        echo $bwg;
        ?>
").css({opacity: 0.3, filter: "Alpha(opacity=30)"});
            }
          }, 500);
        });
        jQuery(".bwg_slideshow_filmstrip_left_<?php 
        echo $bwg;
        ?>
").on(bwg_click, function () {
          jQuery( ".bwg_slideshow_filmstrip_thumbnails_<?php 
        echo $bwg;
        ?>
" ).stop(true, false);
          if (jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php 
        echo $bwg;
        ?>
").position().left < 0) {
            jQuery(".bwg_slideshow_filmstrip_right_<?php 
        echo $bwg;
        ?>
").css({opacity: 1, filter: "Alpha(opacity=100)"});
            if (jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php 
        echo $bwg;
        ?>
").position().left > - <?php 
        echo $filmstrip_thumb_margin_hor + $slideshow_filmstrip_width;
        ?>
) {
              jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php 
        echo $bwg;
        ?>
").animate({left: 0}, 500, 'linear');
            }
            else {
              jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php 
        echo $bwg;
        ?>
").animate({left: (jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php 
        echo $bwg;
        ?>
").position().left + <?php 
        echo $filmstrip_thumb_margin_hor + $slideshow_filmstrip_width;
        ?>
)}, 500, 'linear');
            }
          }
          /* Disable left arrow.*/
          window.setTimeout(function(){
            if (jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php 
        echo $bwg;
        ?>
").position().left == 0) {
              jQuery(".bwg_slideshow_filmstrip_left_<?php 
        echo $bwg;
        ?>
").css({opacity: 0.3, filter: "Alpha(opacity=30)"});
            }
          }, 500);
        });
        /* Set filmstrip initial position.*/
        bwg_set_filmstrip_pos_<?php 
        echo $bwg;
        ?>
(jQuery(".bwg_slideshow_filmstrip_<?php 
        echo $bwg;
        ?>
").width());
        /* Play/pause.*/
        jQuery("#bwg_slideshow_play_pause_<?php 
        echo $bwg;
        ?>
").on(bwg_click, function () {
          if (jQuery(".bwg_ctrl_btn_<?php 
        echo $bwg;
        ?>
").hasClass("fa-play")) {
            play_<?php 
        echo $bwg;
        ?>
();
            jQuery(".bwg_slideshow_play_pause_<?php 
        echo $bwg;
        ?>
").attr("title", "<?php 
        echo __('Pause', 'bwg');
        ?>
");
            jQuery(".bwg_slideshow_play_pause_<?php 
        echo $bwg;
        ?>
").attr("class", "bwg_ctrl_btn_<?php 
        echo $bwg;
        ?>
 bwg_slideshow_play_pause_<?php 
        echo $bwg;
        ?>
 fa fa-pause");
            if (<?php 
        echo $enable_slideshow_music;
        ?>
) {
              document.getElementById("bwg_audio_<?php 
        echo $bwg;
        ?>
").play();
            }
          }
          else {
            /* Pause.*/
            window.clearInterval(bwg_playInterval_<?php 
        echo $bwg;
        ?>
);
            jQuery(".bwg_slideshow_play_pause_<?php 
        echo $bwg;
        ?>
").attr("title", "<?php 
        echo __('Play', 'bwg');
        ?>
");
            jQuery(".bwg_slideshow_play_pause_<?php 
        echo $bwg;
        ?>
").attr("class", "bwg_ctrl_btn_<?php 
        echo $bwg;
        ?>
 bwg_slideshow_play_pause_<?php 
        echo $bwg;
        ?>
 fa fa-play");
            if (<?php 
        echo $enable_slideshow_music;
        ?>
) {
              document.getElementById("bwg_audio_<?php 
        echo $bwg;
        ?>
").pause();
            }
          }
        });
        if (<?php 
        echo $enable_slideshow_autoplay;
        ?>
) {
          play_<?php 
        echo $bwg;
        ?>
();
          jQuery(".bwg_slideshow_play_pause_<?php 
        echo $bwg;
        ?>
").attr("title", "<?php 
        echo __('Pause', 'bwg');
        ?>
");
          jQuery(".bwg_slideshow_play_pause_<?php 
        echo $bwg;
        ?>
").attr("class", "bwg_ctrl_btn_<?php 
        echo $bwg;
        ?>
 bwg_slideshow_play_pause_<?php 
        echo $bwg;
        ?>
 fa fa-pause");
          if (<?php 
        echo $enable_slideshow_music;
        ?>
) {
            document.getElementById("bwg_audio_<?php 
        echo $bwg;
        ?>
").play();
          }
        }
        jQuery(".bwg_slideshow_image_<?php 
        echo $bwg;
        ?>
").removeAttr("width");
        jQuery(".bwg_slideshow_image_<?php 
        echo $bwg;
        ?>
").removeAttr("height");
      });
      function bwg_resize_instagram_post_<?php 
        echo $bwg;
        ?>
(){
        
        /*jQuery.fn.exists = function(){return this.length>0;};*/
        if (jQuery('.inner_instagram_iframe_bwg_embed_frame_<?php 
        echo $bwg;
        ?>
').length) {
          
          var w = jQuery('.bwg_slideshow_embed_<?php 
        echo $bwg;
        ?>
').width();
          var h = jQuery('.bwg_slideshow_embed_<?php 
        echo $bwg;
        ?>
').height();
          var post_width = 0;
          var post_height = 0;
          if(h <w +88 ){
            post_height = h;
            post_width = h -88; 
          }
          else{
            post_width = w;
            post_height = w +88 ;  
          }
           jQuery('.inner_instagram_iframe_bwg_embed_frame_<?php 
        echo $bwg;
        ?>
').each(function(){
          post_height = post_height;
          post_width = post_width;
          var top_pos = (0.5 *( h-post_height));
          jQuery(this).parent().parent().css({
              height: post_height,
              width: post_width,
              top:  top_pos
            });
            jQuery(this).parent().css({
              height: post_height,
              width: post_width,
              top:  top_pos
            });
          });
        }
        bwg_change_watermark_container_<?php 
        echo $bwg;
        ?>
();
      }
      function play_<?php 
        echo $bwg;
        ?>
() {
        window.clearInterval(bwg_playInterval_<?php 
        echo $bwg;
        ?>
);
        /* Play.*/
        bwg_playInterval_<?php 
        echo $bwg;
        ?>
 = setInterval(function () {
          var iterator = 1;
          if (<?php 
        echo $enable_slideshow_shuffle;
        ?>
) {
            iterator = Math.floor((data_<?php 
        echo $bwg;
        ?>
.length - 1) * Math.random() + 1);
          }
          bwg_change_image_<?php 
        echo $bwg;
        ?>
(parseInt(jQuery('#bwg_current_image_key_<?php 
        echo $bwg;
        ?>
').val()), (parseInt(jQuery('#bwg_current_image_key_<?php 
        echo $bwg;
        ?>
').val()) + iterator) % data_<?php 
        echo $bwg;
        ?>
.length, data_<?php 
        echo $bwg;
        ?>
)
        }, '<?php 
        echo $slideshow_interval * 1000;
        ?>
');
      }
      jQuery(window).focus(function() {
        /* event_stack_<?php 
        echo $bwg;
        ?>
 = [];*/
        if (!jQuery(".bwg_ctrl_btn_<?php 
        echo $bwg;
        ?>
").hasClass("fa-play")) {
          play_<?php 
        echo $bwg;
        ?>
();
        }
        var i_<?php 
        echo $bwg;
        ?>
 = 0;
        jQuery(".bwg_slider_<?php 
        echo $bwg;
        ?>
").children("span").each(function () {
          if (jQuery(this).css('opacity') == 1) {
            jQuery("#bwg_current_image_key_<?php 
        echo $bwg;
        ?>
").val(i_<?php 
        echo $bwg;
        ?>
);
          }
          i_<?php 
        echo $bwg;
        ?>
++;
        });
      });
      jQuery(window).blur(function() {
        event_stack_<?php 
        echo $bwg;
        ?>
 = [];
        window.clearInterval(bwg_playInterval_<?php 
        echo $bwg;
        ?>
);
      });
    </script>
    <?php 
        if ($from_shortcode) {
            return;
        } else {
            die;
        }
    }
    public function display()
    {
        global $WD_BWG_UPLOAD_DIR;
        require_once WD_BWG_DIR . '/framework/WDWLibraryEmbed.php';
        $tag_id = isset($_GET['tag_id']) ? esc_html($_GET['tag_id']) : 0;
        $gallery_id = WDWLibrary::esc_script('get', 'gallery_id', 0, 'int');
        $bwg = isset($_GET['current_view']) ? esc_html($_GET['current_view']) : 0;
        $current_image_id = WDWLibrary::esc_script('get', 'image_id', 0, 'int');
        $theme_id = isset($_GET['theme_id']) ? esc_html($_GET['theme_id']) : 1;
        $thumb_width = isset($_GET['thumb_width']) ? esc_html($_GET['thumb_width']) : 120;
        $thumb_height = isset($_GET['thumb_height']) ? esc_html($_GET['thumb_height']) : 90;
        $open_with_fullscreen = WDWLibrary::esc_script('get', 'open_with_fullscreen', 0, 'int');
        $open_with_autoplay = WDWLibrary::esc_script('get', 'open_with_autoplay', 0, 'int');
        $image_width = WDWLibrary::esc_script('get', 'image_width', 800, 'int');
        $image_height = WDWLibrary::esc_script('get', 'image_height', 500, 'int');
        $image_effect = WDWLibrary::esc_script('get', 'image_effect', 'fade');
        $sort_by = isset($_GET['wd_sor']) ? esc_html($_GET['wd_sor']) : 'order';
        $order_by = isset($_GET['wd_ord']) ? esc_html($_GET['wd_ord']) : 'asc';
        $enable_image_filmstrip = FALSE;
        $enable_image_fullscreen = isset($_GET['enable_image_fullscreen']) ? esc_html($_GET['enable_image_fullscreen']) : 0;
        $popup_enable_info = isset($_GET['popup_enable_info']) ? esc_html($_GET['popup_enable_info']) : 1;
        $popup_info_always_show = isset($_GET['popup_info_always_show']) ? esc_html($_GET['popup_info_always_show']) : 0;
        $popup_info_full_width = isset($_GET['popup_info_full_width']) ? esc_html($_GET['popup_info_full_width']) : 0;
        $popup_enable_rate = WDWLibrary::esc_script('get', 'popup_enable_rate', 0, 'int');
        $popup_hit_counter = isset($_GET['popup_hit_counter']) ? esc_html($_GET['popup_hit_counter']) : 0;
        $slideshow_effect_duration = isset($_GET['slideshow_effect_duration']) ? (int) $_GET['slideshow_effect_duration'] : 1;
        $slideshow_interval = isset($_GET['slideshow_interval']) ? (int) $_GET['slideshow_interval'] : 5;
        $enable_image_ctrl_btn = isset($_GET['enable_image_ctrl_btn']) ? esc_html($_GET['enable_image_ctrl_btn']) : 0;
        $enable_comment_social = FALSE;
        $enable_image_facebook = FALSE;
        $enable_image_twitter = FALSE;
        $enable_image_google = FALSE;
        $enable_image_pinterest = FALSE;
        $enable_image_tumblr = FALSE;
        $watermark_type = isset($_GET['watermark_type']) ? esc_html($_GET['watermark_type']) : 'none';
        $watermark_text = isset($_GET['watermark_text']) ? esc_html($_GET['watermark_text']) : '';
        $watermark_font_size = isset($_GET['watermark_font_size']) ? esc_html($_GET['watermark_font_size']) : 12;
        $watermark_font = isset($_GET['watermark_font']) ? esc_html($_GET['watermark_font']) : 'Arial';
        $watermark_color = isset($_GET['watermark_color']) ? esc_html($_GET['watermark_color']) : 'FFFFFF';
        $watermark_opacity = isset($_GET['watermark_opacity']) ? esc_html($_GET['watermark_opacity']) : 30;
        $watermark_position = explode('-', isset($_GET['watermark_position']) ? esc_html($_GET['watermark_position']) : 'bottom-right');
        $watermark_link = isset($_GET['watermark_link']) ? esc_html($_GET['watermark_link']) : '';
        $watermark_url = isset($_GET['watermark_url']) ? esc_html($_GET['watermark_url']) : '';
        $watermark_width = isset($_GET['watermark_width']) ? esc_html($_GET['watermark_width']) : 90;
        $watermark_height = isset($_GET['watermark_height']) ? esc_html($_GET['watermark_height']) : 90;
        $theme_row = $this->model->get_theme_row_data($theme_id);
        $option_row = $this->model->get_option_row_data();
        $image_right_click = $option_row->image_right_click;
        $image_filmstrip_height = 0;
        $image_filmstrip_width = 0;
        if ($tag_id != 0) {
            $image_rows = $this->model->get_image_rows_data_tag($tag_id, $sort_by, $order_by);
        } else {
            $image_rows = $this->model->get_image_rows_data($gallery_id, $bwg, $sort_by, $order_by);
        }
        $image_id = isset($_POST['image_id']) ? (int) $_POST['image_id'] : $current_image_id;
        $filmstrip_thumb_margin = $theme_row->lightbox_filmstrip_thumb_margin;
        $margins_split = explode(" ", $filmstrip_thumb_margin);
        $filmstrip_thumb_margin_right = 0;
        $filmstrip_thumb_margin_left = 0;
        if (isset($margins_split[1])) {
            $filmstrip_thumb_margin_right = (int) $margins_split[1];
            if (isset($margins_split[3])) {
                $filmstrip_thumb_margin_left = (int) $margins_split[3];
            } else {
                $filmstrip_thumb_margin_left = $filmstrip_thumb_margin_right;
            }
        } elseif (isset($margins_split[0])) {
            $filmstrip_thumb_margin_right = (int) $margins_split[0];
            $filmstrip_thumb_margin_left = $filmstrip_thumb_margin_right;
        }
        $filmstrip_thumb_margin_hor = $filmstrip_thumb_margin_right + $filmstrip_thumb_margin_left;
        $rgb_bwg_image_info_bg_color = WDWLibrary::spider_hex2rgb($theme_row->lightbox_info_bg_color);
        $rgb_bwg_image_hit_bg_color = WDWLibrary::spider_hex2rgb($theme_row->lightbox_hit_bg_color);
        $rgb_lightbox_ctrl_cont_bg_color = WDWLibrary::spider_hex2rgb($theme_row->lightbox_ctrl_cont_bg_color);
        $lightbox_bg_transparent = isset($theme_row->lightbox_bg_transparent) ? $theme_row->lightbox_bg_transparent : 100;
        $lightbox_bg_color = WDWLibrary::spider_hex2rgb($theme_row->lightbox_bg_color);
        $current_filename = '';
        ?>
    <style>
      .spider_popup_wrap * {
        -moz-box-sizing: border-box;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
      }
      .spider_popup_wrap {
        background-color: rgba(<?php 
        echo $lightbox_bg_color['red'];
        ?>
, <?php 
        echo $lightbox_bg_color['green'];
        ?>
, <?php 
        echo $lightbox_bg_color['blue'];
        ?>
, <?php 
        echo number_format($lightbox_bg_transparent / 100, 2, ".", "");
        ?>
);
        display: inline-block;
        left: 50%;
        outline: medium none;
        position: fixed;
        text-align: center;
        top: 50%;
        z-index: 100000;
      }
      .bwg_popup_image {
        max-width: <?php 
        echo $image_width;
        ?>
px;
        max-height: <?php 
        echo $image_height - $image_filmstrip_height;
        ?>
px;
        vertical-align: middle;
        display: inline-block;
      }
      .bwg_popup_embed {
        width: <?php 
        echo $image_width;
        ?>
px;
        height: <?php 
        echo $image_height - $image_filmstrip_height;
        ?>
px;
        vertical-align: middle;
        text-align: center;
        display: inline-block;
      }
      .bwg_ctrl_btn {
        color: #<?php 
        echo $theme_row->lightbox_ctrl_btn_color;
        ?>
;
        font-size: <?php 
        echo $theme_row->lightbox_ctrl_btn_height;
        ?>
px;
        margin: <?php 
        echo $theme_row->lightbox_ctrl_btn_margin_top;
        ?>
px <?php 
        echo $theme_row->lightbox_ctrl_btn_margin_left;
        ?>
px;
        opacity: <?php 
        echo number_format($theme_row->lightbox_ctrl_btn_transparent / 100, 2, ".", "");
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $theme_row->lightbox_ctrl_btn_transparent;
        ?>
);
      }
      .bwg_toggle_btn {
        color: #<?php 
        echo $theme_row->lightbox_ctrl_btn_color;
        ?>
;
        font-size: <?php 
        echo $theme_row->lightbox_toggle_btn_height;
        ?>
px;
        margin: 0;
        opacity: <?php 
        echo number_format($theme_row->lightbox_ctrl_btn_transparent / 100, 2, ".", "");
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $theme_row->lightbox_ctrl_btn_transparent;
        ?>
);
        padding: 0;
      }
      .bwg_btn_container {
        bottom: 0;
        left: 0;
        overflow: hidden;
        position: absolute;
        right: 0;
        top: 0;
      }
      .bwg_ctrl_btn_container {
        background-color: rgba(<?php 
        echo $rgb_lightbox_ctrl_cont_bg_color['red'];
        ?>
, <?php 
        echo $rgb_lightbox_ctrl_cont_bg_color['green'];
        ?>
, <?php 
        echo $rgb_lightbox_ctrl_cont_bg_color['blue'];
        ?>
, <?php 
        echo number_format($theme_row->lightbox_ctrl_cont_transparent / 100, 2, ".", "");
        ?>
);
        /*background: none repeat scroll 0 0 #<?php 
        echo $theme_row->lightbox_ctrl_cont_bg_color;
        ?>
;*/
        <?php 
        if ($theme_row->lightbox_ctrl_btn_pos == 'top') {
            ?>
          border-bottom-left-radius: <?php 
            echo $theme_row->lightbox_ctrl_cont_border_radius;
            ?>
px;
          border-bottom-right-radius: <?php 
            echo $theme_row->lightbox_ctrl_cont_border_radius;
            ?>
px;
          <?php 
        } else {
            ?>
          bottom: 0;
          border-top-left-radius: <?php 
            echo $theme_row->lightbox_ctrl_cont_border_radius;
            ?>
px;
          border-top-right-radius: <?php 
            echo $theme_row->lightbox_ctrl_cont_border_radius;
            ?>
px;
          <?php 
        }
        ?>
        height: <?php 
        echo $theme_row->lightbox_ctrl_btn_height + 2 * $theme_row->lightbox_ctrl_btn_margin_top;
        ?>
px;
        position: absolute;
        text-align: <?php 
        echo $theme_row->lightbox_ctrl_btn_align;
        ?>
;
        width: 100%;
        z-index: 10150;
      }
      .bwg_toggle_container {
        background: none repeat scroll 0 0 #<?php 
        echo $theme_row->lightbox_ctrl_cont_bg_color;
        ?>
;
        <?php 
        if ($theme_row->lightbox_ctrl_btn_pos == 'top') {
            ?>
          border-bottom-left-radius: <?php 
            echo $theme_row->lightbox_ctrl_cont_border_radius;
            ?>
px;
          border-bottom-right-radius: <?php 
            echo $theme_row->lightbox_ctrl_cont_border_radius;
            ?>
px;
          /*top: <?php 
            echo $theme_row->lightbox_ctrl_btn_height + 2 * $theme_row->lightbox_ctrl_btn_margin_top;
            ?>
px;*/
          <?php 
        } else {
            ?>
          border-top-left-radius: <?php 
            echo $theme_row->lightbox_ctrl_cont_border_radius;
            ?>
px;
          border-top-right-radius: <?php 
            echo $theme_row->lightbox_ctrl_cont_border_radius;
            ?>
px;
          /*bottom: <?php 
            echo $theme_row->lightbox_ctrl_btn_height + 2 * $theme_row->lightbox_ctrl_btn_margin_top;
            ?>
px;*/
          <?php 
        }
        ?>
        cursor: pointer;
        left: 50%;
        line-height: 0;
        margin-left: -<?php 
        echo $theme_row->lightbox_toggle_btn_width / 2;
        ?>
px;
        opacity: <?php 
        echo number_format($theme_row->lightbox_ctrl_cont_transparent / 100, 2, ".", "");
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $theme_row->lightbox_ctrl_cont_transparent;
        ?>
);
        position: absolute;
        text-align: center;
        width: <?php 
        echo $theme_row->lightbox_toggle_btn_width;
        ?>
px;
        z-index: 10150;
      }
      .bwg_close_btn {
        opacity: <?php 
        echo number_format($theme_row->lightbox_close_btn_transparent / 100, 2, ".", "");
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $theme_row->lightbox_close_btn_transparent;
        ?>
);
      }
      .spider_popup_close {
        background-color: #<?php 
        echo $theme_row->lightbox_close_btn_bg_color;
        ?>
;
        border-radius: <?php 
        echo $theme_row->lightbox_close_btn_border_radius;
        ?>
;
        border: <?php 
        echo $theme_row->lightbox_close_btn_border_width;
        ?>
px <?php 
        echo $theme_row->lightbox_close_btn_border_style;
        ?>
 #<?php 
        echo $theme_row->lightbox_close_btn_border_color;
        ?>
;
        box-shadow: <?php 
        echo $theme_row->lightbox_close_btn_box_shadow;
        ?>
;
        color: #<?php 
        echo $theme_row->lightbox_close_btn_color;
        ?>
;
        height: <?php 
        echo $theme_row->lightbox_close_btn_height;
        ?>
px;
        font-size: <?php 
        echo $theme_row->lightbox_close_btn_size;
        ?>
px;
        right: <?php 
        echo $theme_row->lightbox_close_btn_right;
        ?>
px;
        top: <?php 
        echo $theme_row->lightbox_close_btn_top;
        ?>
px;
        width: <?php 
        echo $theme_row->lightbox_close_btn_width;
        ?>
px;
      }
      .spider_popup_close_fullscreen {
        color: #<?php 
        echo $theme_row->lightbox_close_btn_full_color;
        ?>
;
        font-size: <?php 
        echo $theme_row->lightbox_close_btn_size;
        ?>
px;
        right: 15px;
      }
      .spider_popup_close span,
      #spider_popup_left-ico span,
      #spider_popup_right-ico span {
        display: table-cell;
        text-align: center;
        vertical-align: middle;
      }
      #spider_popup_left-ico,
      #spider_popup_right-ico {
        background-color: #<?php 
        echo $theme_row->lightbox_rl_btn_bg_color;
        ?>
;
        border-radius: <?php 
        echo $theme_row->lightbox_rl_btn_border_radius;
        ?>
;
        border: <?php 
        echo $theme_row->lightbox_rl_btn_border_width;
        ?>
px <?php 
        echo $theme_row->lightbox_rl_btn_border_style;
        ?>
 #<?php 
        echo $theme_row->lightbox_rl_btn_border_color;
        ?>
;
        box-shadow: <?php 
        echo $theme_row->lightbox_rl_btn_box_shadow;
        ?>
;
        color: #<?php 
        echo $theme_row->lightbox_rl_btn_color;
        ?>
;
        height: <?php 
        echo $theme_row->lightbox_rl_btn_height;
        ?>
px;
        font-size: <?php 
        echo $theme_row->lightbox_rl_btn_size;
        ?>
px;
        width: <?php 
        echo $theme_row->lightbox_rl_btn_width;
        ?>
px;
        opacity: <?php 
        echo number_format($theme_row->lightbox_rl_btn_transparent / 100, 2, ".", "");
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $theme_row->lightbox_rl_btn_transparent;
        ?>
);
      }
      <?php 
        if ($option_row->autohide_lightbox_navigation) {
            ?>
      #spider_popup_left-ico{
        left: -9999px;
      }
      #spider_popup_right-ico{
        left: -9999px;
      }      
      <?php 
        } else {
            ?>
        #spider_popup_left-ico {
        left: 20px;
        }
        #spider_popup_right-ico {
          left: auto;
          right: 20px;
        }
      <?php 
        }
        ?>
      .bwg_ctrl_btn:hover,
      .bwg_toggle_btn:hover,
      .spider_popup_close:hover,
      .spider_popup_close_fullscreen:hover,
      #spider_popup_left-ico:hover,
      #spider_popup_right-ico:hover {
        color: #<?php 
        echo $theme_row->lightbox_close_rl_btn_hover_color;
        ?>
;
        cursor: pointer;
      }
      .bwg_image_wrap {
        height: inherit;
        display: table;
        position: absolute;
        text-align: center;
        width: inherit;
      }
      .bwg_image_wrap * {
        -moz-user-select: none;
        -khtml-user-select: none;
        -webkit-user-select: none;
        -ms-user-select: none;
        user-select: none;
      }
      .bwg_comment_wrap {
        bottom: 0;
        left: 0;
        overflow: hidden;
        position: absolute;
        right: 0;
        top: 0;
        z-index: -1;
      }
      .bwg_comment_container {
        -moz-box-sizing: border-box;
        background-color: #<?php 
        echo $theme_row->lightbox_comment_bg_color;
        ?>
;
        color: #<?php 
        echo $theme_row->lightbox_comment_font_color;
        ?>
;
        font-size: <?php 
        echo $theme_row->lightbox_comment_font_size;
        ?>
px;
        font-family: <?php 
        echo $theme_row->lightbox_comment_font_style;
        ?>
;
        height: 100%;
        overflow: hidden;
        position: absolute;
        <?php 
        echo $theme_row->lightbox_comment_pos;
        ?>
: -<?php 
        echo $theme_row->lightbox_comment_width;
        ?>
px;
        top: 0;
        width: <?php 
        echo $theme_row->lightbox_comment_width;
        ?>
px;
        z-index: 10103;
      }
      .bwg_comments {
        bottom: 0;
        font-size: <?php 
        echo $theme_row->lightbox_comment_font_size;
        ?>
px;
        font-family: <?php 
        echo $theme_row->lightbox_comment_font_style;
        ?>
;
        height: 100%;
        left: 0;
        overflow-x: hidden;
        overflow-y: auto;
        position: absolute;
        top: 0;
        width: 100%;
        z-index: 10101;
      }
      .bwg_comments p,
      .bwg_comment_body_p {
        margin: 5px !important;
        text-align: left;
        word-wrap: break-word;
        word-break: break-word;
      }
      .bwg_comments input[type="submit"] {
        background: none repeat scroll 0 0 #<?php 
        echo $theme_row->lightbox_comment_button_bg_color;
        ?>
;
        border: <?php 
        echo $theme_row->lightbox_comment_button_border_width;
        ?>
px <?php 
        echo $theme_row->lightbox_comment_button_border_style;
        ?>
 #<?php 
        echo $theme_row->lightbox_comment_button_border_color;
        ?>
;
        border-radius: <?php 
        echo $theme_row->lightbox_comment_button_border_radius;
        ?>
;
        color: #<?php 
        echo $theme_row->lightbox_comment_font_color;
        ?>
;
        cursor: pointer;
        padding: <?php 
        echo $theme_row->lightbox_comment_button_padding;
        ?>
;
      }
      .bwg_comments input[type="text"],
      .bwg_comments textarea {
        background: none repeat scroll 0 0 #<?php 
        echo $theme_row->lightbox_comment_input_bg_color;
        ?>
;
        border: <?php 
        echo $theme_row->lightbox_comment_input_border_width;
        ?>
px <?php 
        echo $theme_row->lightbox_comment_input_border_style;
        ?>
 #<?php 
        echo $theme_row->lightbox_comment_input_border_color;
        ?>
;
        border-radius: <?php 
        echo $theme_row->lightbox_comment_input_border_radius;
        ?>
;
        color: #<?php 
        echo $theme_row->lightbox_comment_font_color;
        ?>
;
        padding: <?php 
        echo $theme_row->lightbox_comment_input_padding;
        ?>
;
        width: 100%;
      }
      .bwg_comments textarea {
        resize: vertical;
      }
      .bwg_comment_header_p {
        border-top: <?php 
        echo $theme_row->lightbox_comment_separator_width;
        ?>
px <?php 
        echo $theme_row->lightbox_comment_separator_style;
        ?>
 #<?php 
        echo $theme_row->lightbox_comment_separator_color;
        ?>
;
      }
      .bwg_comment_header {
        color: #<?php 
        echo $theme_row->lightbox_comment_font_color;
        ?>
;
        font-size: <?php 
        echo $theme_row->lightbox_comment_author_font_size;
        ?>
px;
      }
      .bwg_comment_date {
        color: #<?php 
        echo $theme_row->lightbox_comment_font_color;
        ?>
;
        float: right;
        font-size: <?php 
        echo $theme_row->lightbox_comment_date_font_size;
        ?>
px;
      }
      .bwg_comment_body {
        color: #<?php 
        echo $theme_row->lightbox_comment_font_color;
        ?>
;
        font-size: <?php 
        echo $theme_row->lightbox_comment_body_font_size;
        ?>
px;
      }
      .bwg_comment_delete_btn {
        color: #FFFFFF;
        cursor: pointer;
        float: right;
        font-size: 14px;
        margin: 2px;
      }
      .bwg_comments_close {
        cursor: pointer;
        line-height: 0;
        position: relative;
        font-size: 13px;
        text-align: <?php 
        echo $theme_row->lightbox_comment_pos == 'left' ? 'right' : 'left';
        ?>
;
        margin: 5px;
        z-index: 10150;
      }
      .bwg_comment_textarea::-webkit-scrollbar {
        width: 4px;
      }
      .bwg_comment_textarea::-webkit-scrollbar-track {
      }
      .bwg_comment_textarea::-webkit-scrollbar-thumb {
        background-color: rgba(255, 255, 255, 0.55);
        border-radius: 2px;
      }  
      .bwg_comment_textarea::-webkit-scrollbar-thumb:hover {
        background-color: #D9D9D9;
      }
      .bwg_ctrl_btn_container a,
      .bwg_ctrl_btn_container a:hover {
        text-decoration: none;
      }
      .bwg_rate:hover {
        color: #<?php 
        echo $theme_row->lightbox_rate_color;
        ?>
;
      }
      .bwg_facebook:hover {
        color: #3B5998;
      }
      .bwg_twitter:hover {
        color: #4099FB;
      }
      .bwg_google:hover {
        color: #DD4B39;
      }
      .bwg_pinterest:hover {
        color: #cb2027;
      }
      .bwg_tumblr:hover {
        color: #2F5070;
      }
      .bwg_facebook,
      .bwg_twitter,
      .bwg_google,
      .bwg_pinterest,
      .bwg_tumblr {
        color: #<?php 
        echo $theme_row->lightbox_comment_share_button_color;
        ?>
;
      }
      .bwg_image_container {
        display: table;
        position: absolute;
        text-align: center;
        <?php 
        echo $theme_row->lightbox_filmstrip_pos;
        ?>
: <?php 
        echo $image_filmstrip_height;
        ?>
px;
        vertical-align: middle;
        width: 100%;
      }      
      .bwg_filmstrip_container {
        display: table;
        height: <?php 
        echo $image_filmstrip_height;
        ?>
px;
        position: absolute;
        width: <?php 
        echo $image_width;
        ?>
px;
        z-index: 10150;
        <?php 
        echo $theme_row->lightbox_filmstrip_pos;
        ?>
: 0;
      }
      .bwg_filmstrip {
        left: 20px;
        overflow: hidden;
        position: absolute;
        width: <?php 
        echo $image_width - 40;
        ?>
px;
        z-index: 10106;
      }
      .bwg_filmstrip_thumbnails {
        height: <?php 
        echo $image_filmstrip_height;
        ?>
px;
        left: 0px;
        margin: 0 auto;
        overflow: hidden;
        position: relative;
        width: <?php 
        echo ($image_filmstrip_width + $filmstrip_thumb_margin_hor) * count($image_rows);
        ?>
px;
      }
      .bwg_filmstrip_thumbnail {
        position: relative;
        background: none;
        border: <?php 
        echo $theme_row->lightbox_filmstrip_thumb_border_width;
        ?>
px <?php 
        echo $theme_row->lightbox_filmstrip_thumb_border_style;
        ?>
 #<?php 
        echo $theme_row->lightbox_filmstrip_thumb_border_color;
        ?>
;
        border-radius: <?php 
        echo $theme_row->lightbox_filmstrip_thumb_border_radius;
        ?>
;
        cursor: pointer;
        float: left;
        height: <?php 
        echo $image_filmstrip_height;
        ?>
px;
        margin: <?php 
        echo $theme_row->lightbox_filmstrip_thumb_margin;
        ?>
;
        width: <?php 
        echo $image_filmstrip_width;
        ?>
px;
        overflow: hidden;
      }
      .bwg_thumb_active {
        opacity: 1;
        filter: Alpha(opacity=100);
        border: <?php 
        echo $theme_row->lightbox_filmstrip_thumb_active_border_width;
        ?>
px solid #<?php 
        echo $theme_row->lightbox_filmstrip_thumb_active_border_color;
        ?>
;
      }
      .bwg_thumb_deactive {
        opacity: <?php 
        echo number_format($theme_row->lightbox_filmstrip_thumb_deactive_transparent / 100, 2, ".", "");
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $theme_row->lightbox_filmstrip_thumb_deactive_transparent;
        ?>
);
      }
      .bwg_filmstrip_thumbnail_img {
        display: block;
        opacity: 1;
        filter: Alpha(opacity=100);
      }
      .bwg_filmstrip_left {
        background-color: #<?php 
        echo $theme_row->lightbox_filmstrip_rl_bg_color;
        ?>
;
        cursor: pointer;
        display: table-cell;
        vertical-align: middle;
        width: 20px;
        z-index: 10106;
        left: 0;
      }
      .bwg_filmstrip_right {
        background-color: #<?php 
        echo $theme_row->lightbox_filmstrip_rl_bg_color;
        ?>
;
        cursor: pointer;
        right: 0;
        width: 20px;
        display: table-cell;
        vertical-align: middle;
        z-index: 10106;
      }
      .bwg_filmstrip_left i,
      .bwg_filmstrip_right i {
        color: #<?php 
        echo $theme_row->lightbox_filmstrip_rl_btn_color;
        ?>
;
        font-size: <?php 
        echo $theme_row->lightbox_filmstrip_rl_btn_size;
        ?>
px;
      }
      .bwg_none_selectable {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
      }
      .bwg_watermark_container {
        display: table-cell;
        margin: 0 auto;
        position: relative;
        vertical-align: middle;
      }
      .bwg_watermark_spun {
        display: table-cell;
        overflow: hidden;
        position: relative;
        text-align: <?php 
        echo $watermark_position[1];
        ?>
;
        vertical-align: <?php 
        echo $watermark_position[0];
        ?>
;
        /*z-index: 10140;*/
      }
      .bwg_watermark_image {
        margin: 4px;
        max-height: <?php 
        echo $watermark_height;
        ?>
px;
        max-width: <?php 
        echo $watermark_width;
        ?>
px;
        opacity: <?php 
        echo number_format($watermark_opacity / 100, 2, ".", "");
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $watermark_opacity;
        ?>
);
        position: relative;
        z-index: 10141;
      }
      .bwg_watermark_text,
      .bwg_watermark_text:hover {
        text-decoration: none;
        margin: 4px;
        font-size: <?php 
        echo $watermark_font_size;
        ?>
px;
        font-family: <?php 
        echo $watermark_font;
        ?>
;
        color: #<?php 
        echo $watermark_color;
        ?>
 !important;
        opacity: <?php 
        echo number_format($watermark_opacity / 100, 2, ".", "");
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $watermark_opacity;
        ?>
);
        position: relative;
        z-index: 10141;
      }
      .bwg_slide_container {
        display: table-cell;
        position: absolute;
        vertical-align: middle;
        width: 100%;
        height: 100%;
      }
      .bwg_slide_bg {
        margin: 0 auto;
        width: inherit;
        height: inherit;
      }
      .bwg_slider {
        height: inherit;
        width: inherit;
      }
      .bwg_popup_image_spun {
        height: inherit;
        display: table-cell;
        filter: Alpha(opacity=100);
        opacity: 1;
        position: absolute;
        vertical-align: middle;
        width: inherit;
        z-index: 2;
      }
      .bwg_popup_image_second_spun {
        width: inherit;
        height: inherit;
        display: table-cell;
        filter: Alpha(opacity=0);
        opacity: 0;
        position: absolute;
        vertical-align: middle;
        z-index: 1;
      }
      .bwg_grid {
        display: none;
        height: 100%;
        overflow: hidden;
        position: absolute;
        width: 100%;
      }
      .bwg_gridlet {
        opacity: 1;
        filter: Alpha(opacity=100);
        position: absolute;
      }
      .bwg_image_info_container1 {
        display: <?php 
        echo $popup_info_always_show ? 'table-cell' : 'none';
        ?>
;
      }
      .bwg_image_hit_container1 {
        display: <?php 
        echo $popup_hit_counter ? 'table-cell' : 'none';
        ?>
;;
      }
      .bwg_image_info_spun {
        text-align: <?php 
        echo $theme_row->lightbox_info_align;
        ?>
;
        vertical-align: <?php 
        echo $theme_row->lightbox_info_pos;
        ?>
;
      }
      .bwg_image_hit_spun {
        text-align: <?php 
        echo $theme_row->lightbox_hit_align;
        ?>
;
        vertical-align: <?php 
        echo $theme_row->lightbox_hit_pos;
        ?>
;
      }
      .bwg_image_hit {
        background: rgba(<?php 
        echo $rgb_bwg_image_hit_bg_color['red'];
        ?>
, <?php 
        echo $rgb_bwg_image_hit_bg_color['green'];
        ?>
, <?php 
        echo $rgb_bwg_image_hit_bg_color['blue'];
        ?>
, <?php 
        echo number_format($theme_row->lightbox_hit_bg_transparent / 100, 2, ".", "");
        ?>
);
        border: <?php 
        echo $theme_row->lightbox_hit_border_width;
        ?>
px <?php 
        echo $theme_row->lightbox_hit_border_style;
        ?>
 #<?php 
        echo $theme_row->lightbox_hit_border_color;
        ?>
;
        border-radius: <?php 
        echo $theme_row->lightbox_info_border_radius;
        ?>
;
        <?php 
        echo (!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'bottom') && $theme_row->lightbox_ctrl_btn_pos == 'bottom' && $theme_row->lightbox_hit_pos == 'bottom' ? 'bottom: ' . ($theme_row->lightbox_ctrl_btn_height + 2 * $theme_row->lightbox_ctrl_btn_margin_top) . 'px;' : '';
        ?>
        margin: <?php 
        echo $theme_row->lightbox_hit_margin;
        ?>
;
        padding: <?php 
        echo $theme_row->lightbox_hit_padding;
        ?>
;
        <?php 
        echo (!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'top') && $theme_row->lightbox_ctrl_btn_pos == 'top' && $theme_row->lightbox_hit_pos == 'top' ? 'top: ' . ($theme_row->lightbox_ctrl_btn_height + 2 * $theme_row->lightbox_ctrl_btn_margin_top) . 'px;' : '';
        ?>
      }
      .bwg_image_hits,
      .bwg_image_hits * {
        color: #<?php 
        echo $theme_row->lightbox_hit_color;
        ?>
 !important;
        font-family: <?php 
        echo $theme_row->lightbox_hit_font_style;
        ?>
;
        font-size: <?php 
        echo $theme_row->lightbox_hit_font_size;
        ?>
px;
        font-weight: <?php 
        echo $theme_row->lightbox_hit_font_weight;
        ?>
;
      }
      .bwg_image_info {
        background: rgba(<?php 
        echo $rgb_bwg_image_info_bg_color['red'];
        ?>
, <?php 
        echo $rgb_bwg_image_info_bg_color['green'];
        ?>
, <?php 
        echo $rgb_bwg_image_info_bg_color['blue'];
        ?>
, <?php 
        echo number_format($theme_row->lightbox_info_bg_transparent / 100, 2, ".", "");
        ?>
);
        border: <?php 
        echo $theme_row->lightbox_info_border_width;
        ?>
px <?php 
        echo $theme_row->lightbox_info_border_style;
        ?>
 #<?php 
        echo $theme_row->lightbox_info_border_color;
        ?>
;
        border-radius: <?php 
        echo $theme_row->lightbox_info_border_radius;
        ?>
;
        <?php 
        echo (!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'bottom') && $theme_row->lightbox_ctrl_btn_pos == 'bottom' && $theme_row->lightbox_info_pos == 'bottom' ? 'bottom: ' . ($theme_row->lightbox_ctrl_btn_height + 2 * $theme_row->lightbox_ctrl_btn_margin_top) . 'px;' : '';
        ?>
        <?php 
        if ($popup_info_full_width) {
            ?>
        width: 100%;
        <?php 
        } else {
            ?>
        width: 33%;
        margin: <?php 
            echo $theme_row->lightbox_info_margin;
            ?>
;
        <?php 
        }
        ?>
        padding: <?php 
        echo $theme_row->lightbox_info_padding;
        ?>
;
        <?php 
        echo (!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'top') && $theme_row->lightbox_ctrl_btn_pos == 'top' && $theme_row->lightbox_info_pos == 'top' ? 'top: ' . ($theme_row->lightbox_ctrl_btn_height + 2 * $theme_row->lightbox_ctrl_btn_margin_top) . 'px;' : '';
        ?>
      }
      .bwg_image_title,
      .bwg_image_title * {
        color: #<?php 
        echo $theme_row->lightbox_title_color;
        ?>
 !important;
        font-family: <?php 
        echo $theme_row->lightbox_title_font_style;
        ?>
;
        font-size: <?php 
        echo $theme_row->lightbox_title_font_size;
        ?>
px;
        font-weight: <?php 
        echo $theme_row->lightbox_title_font_weight;
        ?>
;
      }
      .bwg_image_description,
      .bwg_image_description * {
        color: #<?php 
        echo $theme_row->lightbox_description_color;
        ?>
 !important;
        font-family: <?php 
        echo $theme_row->lightbox_description_font_style;
        ?>
;
        font-size: <?php 
        echo $theme_row->lightbox_description_font_size;
        ?>
px;
        font-weight: <?php 
        echo $theme_row->lightbox_description_font_weight;
        ?>
;
      }
      .bwg_image_rate_spun {
        text-align: <?php 
        echo $theme_row->lightbox_rate_align;
        ?>
;
        vertical-align: <?php 
        echo $theme_row->lightbox_rate_pos;
        ?>
;
      }
      .bwg_image_rate {
        <?php 
        echo (!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'bottom') && $theme_row->lightbox_ctrl_btn_pos == 'bottom' && $theme_row->lightbox_rate_pos == 'bottom' ? 'bottom: ' . ($theme_row->lightbox_ctrl_btn_height + 2 * $theme_row->lightbox_ctrl_btn_margin_top) . 'px;' : '';
        ?>
        padding: <?php 
        echo $theme_row->lightbox_rate_padding;
        ?>
;
        <?php 
        echo (!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'top') && $theme_row->lightbox_ctrl_btn_pos == 'top' && $theme_row->lightbox_rate_pos == 'top' ? 'top: ' . ($theme_row->lightbox_ctrl_btn_height + 2 * $theme_row->lightbox_ctrl_btn_margin_top) . 'px;' : '';
        ?>
      }
      #bwg_rate_form .bwg_hint,
      #bwg_rate_form .fa-<?php 
        echo $theme_row->lightbox_rate_icon;
        ?>
,
      #bwg_rate_form .fa-<?php 
        echo $theme_row->lightbox_rate_icon;
        ?>
-half-o,
      #bwg_rate_form .fa-<?php 
        echo $theme_row->lightbox_rate_icon;
        ?>
-o,
      #bwg_rate_form .fa-minus-square-o {
        color: #<?php 
        echo $theme_row->lightbox_rate_color;
        ?>
;
        font-size: <?php 
        echo $theme_row->lightbox_rate_size;
        ?>
px;
      }
      #bwg_rate_form .bwg_hint {
        margin: 0 5px;
        display: none;
      }
      .bwg_rate_hover {
        color: #<?php 
        echo $theme_row->lightbox_rate_hover_color;
        ?>
 !important;
      }
      .bwg_star {
        display: inline-block;
      }
      .bwg_rated {
        color: #<?php 
        echo $theme_row->lightbox_rate_color;
        ?>
;
        display: none;
        font-size: <?php 
        echo $theme_row->lightbox_rate_size - 2;
        ?>
px;
      }
			@media (max-width: 480px) {
				.bwg_image_count_container {
					display: none;
				}
        .bwg_image_title,
        .bwg_image_title * {
					font-size: 12px;
				}
        .bwg_image_description,
        .bwg_image_description * {
					font-size: 10px;
				}
			}
      .bwg_image_count_container {
        left: 0;
        line-height: 1;
        position: absolute;
        vertical-align: middle;
      }
    </style>
    <script>
      var data = [];
      var event_stack = [];
      <?php 
        $image_id_exist = FALSE;
        foreach ($image_rows as $key => $image_row) {
            if ($image_row->id == $image_id) {
                $current_avg_rating = $image_row->avg_rating;
                $current_rate = $image_row->rate;
                $current_rate_count = $image_row->rate_count;
                $current_image_key = $key;
            }
            if ($image_row->id == $current_image_id) {
                $current_image_alt = $image_row->alt;
                $current_image_hit_count = $image_row->hit_count;
                $current_image_description = str_replace(array("\r\n", "\n", "\r"), esc_html('<br />'), $image_row->description);
                $current_image_url = $image_row->image_url;
                $current_thumb_url = $image_row->thumb_url;
                $current_filetype = $image_row->filetype;
                $current_filename = $image_row->filename;
                $image_id_exist = TRUE;
            }
            ?>
        data["<?php 
            echo $key;
            ?>
"] = [];
        data["<?php 
            echo $key;
            ?>
"]["number"] = <?php 
            echo $key + 1;
            ?>
;
        data["<?php 
            echo $key;
            ?>
"]["id"] = "<?php 
            echo $image_row->id;
            ?>
";
        data["<?php 
            echo $key;
            ?>
"]["alt"] = "<?php 
            echo str_replace(array("\r\n", "\n", "\r"), esc_html('<br />'), $image_row->alt);
            ?>
";
        data["<?php 
            echo $key;
            ?>
"]["description"] = "<?php 
            echo str_replace(array("\r\n", "\n", "\r"), esc_html('<br />'), $image_row->description);
            ?>
";
        <?php 
            $image_resolution = explode(' x ', $image_row->resolution);
            if (is_array($image_resolution)) {
                $instagram_post_width = $image_resolution[0];
                $instagram_post_height = explode(' ', $image_resolution[1]);
                $instagram_post_height = $instagram_post_height[0];
            }
            ?>
        data["<?php 
            echo $key;
            ?>
"]["image_width"] = "<?php 
            echo $instagram_post_width;
            ?>
";
        data["<?php 
            echo $key;
            ?>
"]["image_height"] = "<?php 
            echo $instagram_post_height;
            ?>
";
        data["<?php 
            echo $key;
            ?>
"]["image_url"] = "<?php 
            echo $image_row->image_url;
            ?>
";
        data["<?php 
            echo $key;
            ?>
"]["thumb_url"] = "<?php 
            echo $image_row->thumb_url;
            ?>
";
        data["<?php 
            echo $key;
            ?>
"]["date"] = "<?php 
            echo $image_row->date;
            ?>
";
        data["<?php 
            echo $key;
            ?>
"]["comment_count"] = "<?php 
            echo $image_row->comment_count;
            ?>
";
        data["<?php 
            echo $key;
            ?>
"]["filetype"] = "<?php 
            echo $image_row->filetype;
            ?>
";
        data["<?php 
            echo $key;
            ?>
"]["filename"] = "<?php 
            echo $image_row->filename;
            ?>
";
        data["<?php 
            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) {
                    ?>
          <i title="<?php 
                    echo __('Maximize', 'bwg');
                    ?>
" class="bwg_ctrl_btn bwg_resize-full fa fa-resize-full "></i>
          <?php 
                }
                ?>
          <i title="<?php 
                echo __('Fullscreen', 'bwg');
                ?>
" class="bwg_ctrl_btn bwg_fullscreen fa fa-fullscreen"></i>
          <?php 
            }
            if ($popup_enable_info) {
                ?>
          <i title="<?php 
                echo __('Show info', 'bwg');
                ?>
" class="bwg_ctrl_btn bwg_info fa fa-info"></i>
          <?php 
            }
            $is_embed = preg_match('/EMBED/', $current_filetype) == 1 ? TRUE : FALSE;
            if ($option_row->popup_enable_fullsize_image) {
                ?>
            <a id="bwg_fullsize_image" href="<?php 
                echo !$is_embed ? site_url() . '/' . $WD_BWG_UPLOAD_DIR . $current_image_url : $current_image_url;
                ?>
" target="_blank">
              <i title="<?php 
                echo __('Open image in original size.', 'bwg');
                ?>
" class="bwg_ctrl_btn fa fa-external-link"></i>
            </a>
            <?php 
            }
            if ($option_row->popup_enable_download) {
                $style = 'none';
                $current_image_arr = explode('/', $current_image_url);
                if (!$is_embed) {
                    $download_href = site_url() . '/' . $WD_BWG_UPLOAD_DIR . $current_image_url;
                    $style = 'inline-block';
                } elseif (preg_match('/FLICKR/', $current_filetype) == 1) {
                    $download_href = $current_filename;
                    $style = 'inline-block';
                } elseif (preg_match('/INSTAGRAM/', $current_filetype) == 1) {
                    $download_href = substr_replace($current_thumb_url, 'l', -1);
                    $style = 'inline-block';
                }
                ?>
            <a id="bwg_download" href="<?php 
                echo $download_href;
                ?>
" target="_blank" download="<?php 
                echo end($current_image_arr);
                ?>
" style="display: <?php 
                echo $style;
                ?>
;">
              <i title="<?php 
                echo __('Download original image', 'bwg');
                ?>
" class="bwg_ctrl_btn fa fa-download"></i>
            </a>
            <?php 
            }
            ?>
        </div>
        <div class="bwg_toggle_container">
          <i class="bwg_toggle_btn fa <?php 
            echo $theme_row->lightbox_ctrl_btn_pos == 'top' ? 'fa-angle-up' : 'fa-angle-down';
            ?>
"></i>
        </div>
      </div>
      <?php 
        }
        $current_pos = 0;
        ?>
      <?php 
        if ($watermark_type != 'none') {
            ?>
      <div class="bwg_image_container">
        <div class="bwg_watermark_container">
          <div style="display:table; margin:0 auto;">
            <span class="bwg_watermark_spun" id="bwg_watermark_container">
              <?php 
            if ($watermark_type == 'image') {
                ?>
              <a href="<?php 
                echo urldecode($watermark_link);
                ?>
" target="_blank">
                <img class="bwg_watermark_image bwg_watermark" src="<?php 
                echo $watermark_url;
                ?>
" />
              </a>
              <?php 
            } elseif ($watermark_type == 'text') {
                ?>
              <a class="bwg_none_selectable bwg_watermark_text bwg_watermark" target="_blank" href="<?php 
                echo $watermark_link;
                ?>
"><?php 
                echo stripslashes($watermark_text);
                ?>
</a>
              <?php 
            }
            ?>
            </span>
          </div>
        </div>
      </div>
      <?php 
        }
        ?>
      <div id="bwg_image_container" class="bwg_image_container">
        <div class="bwg_image_info_container1">
          <div class="bwg_image_info_container2">
            <span class="bwg_image_info_spun">
              <div class="bwg_image_info" <?php 
        if (trim($current_image_alt) == '' && trim($current_image_description) == '') {
            echo 'style="background:none;"';
        }
        ?>
>
                <div class="bwg_image_title"><?php 
        echo html_entity_decode($current_image_alt);
        ?>
</div>
                <div class="bwg_image_description"><?php 
        echo html_entity_decode($current_image_description);
        ?>
</div>
              </div>
            </span>
          </div>
        </div>
        <div class="bwg_slide_container">
          <div class="bwg_slide_bg">
            <div class="bwg_slider">
          <?php 
        $current_key = -6;
        foreach ($image_rows as $key => $image_row) {
            $is_embed = preg_match('/EMBED/', $image_row->filetype) == 1 ? true : false;
            $is_embed_instagram_post = preg_match('/INSTAGRAM_POST/', $image_row->filetype) == 1 ? true : false;
            if ($image_row->id == $current_image_id) {
                $current_key = $key;
                ?>
              <span class="bwg_popup_image_spun" id="bwg_popup_image" image_id="<?php 
                echo $image_row->id;
                ?>
">
                <span class="bwg_popup_image_spun1" style="display: table; width: inherit; height: inherit;">
                  <span class="bwg_popup_image_spun2" style="display: table-cell; vertical-align: middle; text-align: center;">
                    <?php 
                if (!$is_embed) {
                    ?>
                      <img class="bwg_popup_image bwg_popup_watermark" src="<?php 
                    echo site_url() . '/' . $WD_BWG_UPLOAD_DIR . $image_row->image_url;
                    ?>
" alt="<?php 
                    echo $image_row->alt;
                    ?>
" />
                      <?php 
                } else {
                    /*$is_embed*/
                    ?>
                        <span class="bwg_popup_embed bwg_popup_watermark" style="diplay: table; table-layout: fixed;">
                        <?php 
                    if ($is_embed_instagram_post) {
                        $post_width = $image_width;
                        $post_height = $image_height;
                        if ($post_height < $post_width + 88) {
                            $post_width = $post_height - 88;
                        } else {
                            $post_height = $post_width + 88;
                        }
                        $instagram_post_width = $post_width;
                        $instagram_post_height = $post_height;
                        $image_resolution = explode(' x ', $image_row->resolution);
                        if (is_array($image_resolution)) {
                            $instagram_post_width = $image_resolution[0];
                            $instagram_post_height = explode(' ', $image_resolution[1]);
                            $instagram_post_height = $instagram_post_height[0];
                        }
                        WDWLibraryEmbed::display_embed($image_row->filetype, $image_row->filename, array('class' => "bwg_embed_frame", 'data-width' => $instagram_post_width, 'data-height' => $instagram_post_height, 'frameborder' => "0", 'style' => "width:" . $post_width . "px; height:" . $post_height . "px; vertical-align:middle; display:inline-block; position:relative;"));
                    } else {
                        WDWLibraryEmbed::display_embed($image_row->filetype, $image_row->filename, array('class' => "bwg_embed_frame", 'frameborder' => "0", 'allowfullscreen' => "allowfullscreen", 'style' => "width:inherit; height:inherit; vertical-align:middle; display:table-cell;"));
                    }
                    ?>
                      </span>
                      <?php 
                }
                ?>
                    
                  </span>
                </span>
              </span>
              <span class="bwg_popup_image_second_spun">                
              </span>
              <input type="hidden" id="bwg_current_image_key" value="<?php 
                echo $key;
                ?>
" />
              <?php 
                break;
            }
        }
        ?>
            </div>
          </div>
        </div>
        <a id="spider_popup_left" <?php 
        echo $option_row->enable_loop == 0 && $current_key == 0 ? 'style="display: none;"' : '';
        ?>
><span id="spider_popup_left-ico"><span><i class="bwg_prev_btn fa <?php 
        echo $theme_row->lightbox_rl_btn_style;
        ?>
-left"></i></span></span></a>
        <a id="spider_popup_right" <?php 
        echo $option_row->enable_loop == 0 && $current_key == count($image_rows) - 1 ? 'style="display: none;"' : '';
        ?>
><span id="spider_popup_right-ico"><span><i class="bwg_next_btn fa <?php 
        echo $theme_row->lightbox_rl_btn_style;
        ?>
-right"></i></span></span></a>
      </div>
    </div>
    <a class="spider_popup_close" onclick="spider_destroypopup(1000); return false;" ontouchend="spider_destroypopup(1000); return false;"><span><i class="bwg_close_btn fa fa-times"></i></span></a>
    <script language="javascript" type="text/javascript" src="<?php 
        echo WD_BWG_URL . '/js/bwg_embed.js?ver=' . wd_bwg_version();
        ?>
"></script>
    <script>
      var bwg_trans_in_progress = false;
      var bwg_transition_duration = <?php 
        echo $slideshow_interval < 4 && $slideshow_interval != 0 ? $slideshow_interval * 1000 / 4 : $slideshow_effect_duration * 1000;
        ?>
;
      var bwg_playInterval;
      if ((jQuery("#spider_popup_wrap").width() >= jQuery(window).width()) || (jQuery("#spider_popup_wrap").height() >= jQuery(window).height())) {
        jQuery(".spider_popup_close").attr("class", "bwg_ctrl_btn spider_popup_close_fullscreen");
      }
      /* Stop autoplay.*/
      window.clearInterval(bwg_playInterval);
      /* Set watermark container size.*/
      function bwg_change_watermark_container() {
        jQuery(".bwg_slider").children().each(function() {
          if (jQuery(this).css("zIndex") == 2) {
            /* This may be neither img nor iframe.*/
            var bwg_current_image_span = jQuery(this).find("img");
            if (!bwg_current_image_span.length) {
              bwg_current_image_span = jQuery(this).find("iframe");
            }
            if (!bwg_current_image_span.length) {
              bwg_current_image_span = jQuery(this).find("video");
            }
            /*set timeout for video to get size according to style, and then put watermark*/
            setTimeout(function () {
              var width = bwg_current_image_span.width();
              var height = bwg_current_image_span.height();
          

              jQuery(".bwg_watermark_spun").width(width);
              jQuery(".bwg_watermark_spun").height(height);
              jQuery(".bwg_watermark").css({display: ''});
              /* Set watermark image size.*/
              var comment_container_width = 0;
              if (jQuery(".bwg_comment_container").hasClass("bwg_open")) {
                comment_container_width = <?php 
        echo $theme_row->lightbox_comment_width;
        ?>
;
               }
              if (width <= (jQuery(window).width() - comment_container_width)) {
                jQuery(".bwg_watermark_image").css({
                  width: ((jQuery(".spider_popup_wrap").width() - comment_container_width) * <?php 
        echo $watermark_width / $image_width;
        ?>
)
                });
                jQuery(".bwg_watermark_text, .bwg_watermark_text:hover").css({
                  fontSize: ((jQuery(".spider_popup_wrap").width() - comment_container_width) * <?php 
        echo $watermark_font_size / $image_width;
        ?>
)
                });
              }
            }, 800);
          }
        });
      }
      var bwg_current_key = '<?php 
        echo $current_key;
        ?>
';
      var bwg_current_filmstrip_pos = <?php 
        echo $current_pos;
        ?>
;
      /* Set filmstrip initial position.*/
      function bwg_set_filmstrip_pos(filmStripWidth) {
        var selectedImagePos = -bwg_current_filmstrip_pos - (jQuery(".bwg_filmstrip_thumbnail").outerWidth(true)) / 2;
        var imagesContainerLeft = Math.min(0, Math.max(filmStripWidth - jQuery(".bwg_filmstrip_thumbnails").width(), selectedImagePos + filmStripWidth / 2));
        jQuery(".bwg_filmstrip_thumbnails").animate({
            left: imagesContainerLeft
          }, {
            duration: 500,
            complete: function () { bwg_filmstrip_arrows(); }
          });
      }
      function bwg_move_filmstrip() {
        var image_left = jQuery(".bwg_thumb_active").position().left;
        var image_right = jQuery(".bwg_thumb_active").position().left + jQuery(".bwg_thumb_active").outerWidth(true);
        var bwg_filmstrip_width = jQuery(".bwg_filmstrip").outerWidth(true);
        var bwg_filmstrip_thumbnails_width = jQuery(".bwg_filmstrip_thumbnails").outerWidth(true);
        var long_filmstrip_cont_left = jQuery(".bwg_filmstrip_thumbnails").position().left;
        var long_filmstrip_cont_right = Math.abs(jQuery(".bwg_filmstrip_thumbnails").position().left) + bwg_filmstrip_width;
        if (bwg_filmstrip_width > bwg_filmstrip_thumbnails_width) {
          return;
        }
        if (image_left < Math.abs(long_filmstrip_cont_left)) {
          jQuery(".bwg_filmstrip_thumbnails").animate({
            left: -image_left
          }, {
            duration: 500,
            complete: function () { bwg_filmstrip_arrows(); }
          });
        }
        else if (image_right > long_filmstrip_cont_right) {
          jQuery(".bwg_filmstrip_thumbnails").animate({
            left: -(image_right - bwg_filmstrip_width)
          }, {
            duration: 500,
            complete: function () { bwg_filmstrip_arrows(); }
          });
        }
      }
      /* Show/hide filmstrip arrows.*/
      function bwg_filmstrip_arrows() {
        if (jQuery(".bwg_filmstrip_thumbnails").width() < jQuery(".bwg_filmstrip").width()) {
          jQuery(".bwg_filmstrip_left").hide();
          jQuery(".bwg_filmstrip_right").hide();
        }
        else {
          jQuery(".bwg_filmstrip_left").show();
          jQuery(".bwg_filmstrip_right").show();
        }
      }
      function bwg_testBrowser_cssTransitions() {
        return bwg_testDom('Transition');
      }
      function bwg_testBrowser_cssTransforms3d() {
        return bwg_testDom('Perspective');
      }
      function bwg_testDom(prop) {
        /* Browser vendor CSS prefixes.*/
        var browserVendors = ['', '-webkit-', '-moz-', '-ms-', '-o-', '-khtml-'];
        /* Browser vendor DOM prefixes.*/
        var domPrefixes = ['', 'Webkit', 'Moz', 'ms', 'O', 'Khtml'];
        var i = domPrefixes.length;
        while (i--) {
          if (typeof document.body.style[domPrefixes[i] + prop] !== 'undefined') {
            return true;
          }
        }
        return false;
      }
      function bwg_cube(tz, ntx, nty, nrx, nry, wrx, wry, current_image_class, next_image_class, direction) {
        /* If browser does not support 3d transforms/CSS transitions.*/
        if (!bwg_testBrowser_cssTransitions()) {
          return bwg_fallback(current_image_class, next_image_class, direction);
        }
        if (!bwg_testBrowser_cssTransforms3d()) {
          return bwg_fallback3d(current_image_class, next_image_class, direction);
        }
        bwg_trans_in_progress = true;
        /* Set active thumbnail.*/
        jQuery(".bwg_filmstrip_thumbnail").removeClass("bwg_thumb_active").addClass("bwg_thumb_deactive");
        jQuery("#bwg_filmstrip_thumbnail_" + bwg_current_key).removeClass("bwg_thumb_deactive").addClass("bwg_thumb_active");
        jQuery(".bwg_slide_bg").css('perspective', 1000);
        jQuery(current_image_class).css({
          transform : 'translateZ(' + tz + 'px)',
          backfaceVisibility : 'hidden'
        });
        jQuery(next_image_class).css({
          opacity : 1,
          filter: 'Alpha(opacity=100)',
          backfaceVisibility : 'hidden',
          transform : 'translateY(' + nty + 'px) translateX(' + ntx + 'px) rotateY('+ nry +'deg) rotateX('+ nrx +'deg)'
        });
        jQuery(".bwg_slider").css({
          transform: 'translateZ(-' + tz + 'px)',
          transformStyle: 'preserve-3d'
        });
        /* Execution steps.*/
        setTimeout(function () {
          jQuery(".bwg_slider").css({
            transition: 'all ' + bwg_transition_duration + 'ms ease-in-out',
            transform: 'translateZ(-' + tz + 'px) rotateX('+ wrx +'deg) rotateY('+ wry +'deg)'
          });
        }, 20);
        /* After transition.*/
        jQuery(".bwg_slider").one('webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend', jQuery.proxy(bwg_after_trans));
        function bwg_after_trans() {
          jQuery(current_image_class).removeAttr('style');
          jQuery(next_image_class).removeAttr('style');
          jQuery(".bwg_slider").removeAttr('style');
          jQuery(current_image_class).css({'opacity' : 0, filter: 'Alpha(opacity=0)', 'z-index': 1});
          jQuery(next_image_class).css({'opacity' : 1, filter: 'Alpha(opacity=100)', 'z-index' : 2});
          
          bwg_trans_in_progress = false;
          jQuery(current_image_class).html('');
          if (typeof event_stack !== 'undefined') {
            if (event_stack.length > 0) {
              key = event_stack[0].split("-");
              event_stack.shift();
              bwg_change_image(key[0], key[1], data, true);
            }
          }
          bwg_change_watermark_container();
        }
      }
      function bwg_cubeH(current_image_class, next_image_class, direction) {
        /* Set to half of image width.*/
        var dimension = jQuery(current_image_class).width() / 2;
        if (direction == 'right') {
          bwg_cube(dimension, dimension, 0, 0, 90, 0, -90, current_image_class, next_image_class, direction);
        }
        else if (direction == 'left') {
          bwg_cube(dimension, -dimension, 0, 0, -90, 0, 90, current_image_class, next_image_class, direction);
        }
      }
      /* For browsers that does not support transitions.*/
      function bwg_fallback(current_image_class, next_image_class, direction) {
        bwg_fade(current_image_class, next_image_class, direction);
      }
      /* For browsers that support transitions, but not 3d transforms (only used if primary transition makes use of 3d-transforms).*/
      function bwg_fallback3d(current_image_class, next_image_class, direction) {
        bwg_sliceV(current_image_class, next_image_class, direction);
      }
      function bwg_none(current_image_class, next_image_class, direction) {
        jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1});
        jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2});
        /* Set active thumbnail.*/
        jQuery(".bwg_filmstrip_thumbnail").removeClass("bwg_thumb_active").addClass("bwg_thumb_deactive");
        jQuery("#bwg_filmstrip_thumbnail_" + bwg_current_key).removeClass("bwg_thumb_deactive").addClass("bwg_thumb_active");
        bwg_trans_in_progress = false; 
        jQuery(current_image_class).html('');
        bwg_change_watermark_container();
      }
      function bwg_fade(current_image_class, next_image_class, direction) {
        /* Set active thumbnail.*/
        jQuery(".bwg_filmstrip_thumbnail").removeClass("bwg_thumb_active").addClass("bwg_thumb_deactive");
        jQuery("#bwg_filmstrip_thumbnail_" + bwg_current_key).removeClass("bwg_thumb_deactive").addClass("bwg_thumb_active");
        if (bwg_testBrowser_cssTransitions()) {
          jQuery(next_image_class).css('transition', 'opacity ' + bwg_transition_duration + 'ms linear');
          jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1});
          jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2});
          bwg_change_watermark_container();
        }
        else {
          jQuery(current_image_class).animate({'opacity' : 0, 'z-index' : 1}, bwg_transition_duration);
          jQuery(next_image_class).animate({
              'opacity' : 1,
              'z-index': 2
            }, {
              duration: bwg_transition_duration,
              complete: function () { 

                bwg_trans_in_progress = false;  
                jQuery(current_image_class).html('');
                bwg_change_watermark_container(); }
            });
          /* For IE.*/
          jQuery(current_image_class).fadeTo(bwg_transition_duration, 0);
          jQuery(next_image_class).fadeTo(bwg_transition_duration, 1);
        }
      }
      function bwg_grid(cols, rows, ro, tx, ty, sc, op, current_image_class, next_image_class, direction) {
        /* If browser does not support CSS transitions.*/
        if (!bwg_testBrowser_cssTransitions()) {
          return bwg_fallback(current_image_class, next_image_class, direction);
        }
        bwg_trans_in_progress = true;
        /* Set active thumbnail.*/
        jQuery(".bwg_filmstrip_thumbnail").removeClass("bwg_thumb_active").addClass("bwg_thumb_deactive");
        jQuery("#bwg_filmstrip_thumbnail_" + bwg_current_key).removeClass("bwg_thumb_deactive").addClass("bwg_thumb_active");
        /* The time (in ms) added to/subtracted from the delay total for each new gridlet.*/
        var count = (bwg_transition_duration) / (cols + rows);
        /* Gridlet creator (divisions of the image grid, positioned with background-images to replicate the look of an entire slide image when assembled)*/
        function bwg_gridlet(width, height, top, img_top, left, img_left, src, imgWidth, imgHeight, c, r) {
          var delay = (c + r) * count;
          /* Return a gridlet elem with styles for specific transition.*/
          return jQuery('<span class="bwg_gridlet" />').css({
            display : "block",
            width : width,
            height : height,
            top : top,
            left : left,
            backgroundImage : 'url("' + src + '")',
            backgroundColor: jQuery(".spider_popup_wrap").css("background-color"),
            /*backgroundColor: 'rgba(0, 0, 0, 0)',*/
            backgroundRepeat: 'no-repeat',
            backgroundPosition : img_left + 'px ' + img_top + 'px',
            backgroundSize : imgWidth + 'px ' + imgHeight + 'px',
            transition : 'all ' + bwg_transition_duration + 'ms ease-in-out ' + delay + 'ms',
            transform : 'none'
          });
        }
        /* Get the current slide's image.*/
        var cur_img = jQuery(current_image_class).find('img');
        /* Create a grid to hold the gridlets.*/
        var grid = jQuery('<span style="display: block;" />').addClass('bwg_grid');
        /* Prepend the grid to the next slide (i.e. so it's above the slide image).*/
        jQuery(current_image_class).prepend(grid);
        /* Vars to calculate positioning/size of gridlets.*/
        var cont = jQuery(".bwg_slide_bg");
        var imgWidth = cur_img.width();
        var imgHeight = cur_img.height();
        var contWidth = cont.width(),
            contHeight = cont.height(),
            colWidth = Math.floor(contWidth / cols),
            rowHeight = Math.floor(contHeight / rows),
            colRemainder = contWidth - (cols * colWidth),
            colAdd = Math.ceil(colRemainder / cols),
            rowRemainder = contHeight - (rows * rowHeight),
            rowAdd = Math.ceil(rowRemainder / rows),
            leftDist = 0,
            img_leftDist = Math.ceil((jQuery(".bwg_slide_bg").width() - cur_img.width()) / 2);
	var imgSrc = typeof cur_img.attr('src')=='undefined' ? '' :cur_img.attr('src');
        /* tx/ty args can be passed as 'auto'/'min-auto' (meaning use slide width/height or negative slide width/height).*/
        tx = tx === 'auto' ? contWidth : tx;
        tx = tx === 'min-auto' ? - contWidth : tx;
        ty = ty === 'auto' ? contHeight : ty;
        ty = ty === 'min-auto' ? - contHeight : ty;
        /* Loop through cols.*/
        for (var i = 0; i < cols; i++) {
          var topDist = 0,
              img_topDst = Math.floor((jQuery(".bwg_slide_bg").height() - cur_img.height()) / 2),
              newColWidth = colWidth;
          /* If imgWidth (px) does not divide cleanly into the specified number of cols, adjust individual col widths to create correct total.*/
          if (colRemainder > 0) {
            var add = colRemainder >= colAdd ? colAdd : colRemainder;
            newColWidth += add;
            colRemainder -= add;
          }
          /* Nested loop to create row gridlets for each col.*/
          for (var j = 0; j < rows; j++)  {
            var newRowHeight = rowHeight,
                newRowRemainder = rowRemainder;
            /* If contHeight (px) does not divide cleanly into the specified number of rows, adjust individual row heights to create correct total.*/
            if (newRowRemainder > 0) {
              add = newRowRemainder >= rowAdd ? rowAdd : rowRemainder;
              newRowHeight += add;
              newRowRemainder -= add;
            }
            /* Create & append gridlet to grid.*/
            grid.append(bwg_gridlet(newColWidth, newRowHeight, topDist, img_topDst, leftDist, img_leftDist, imgSrc, imgWidth, imgHeight, i, j));
            topDist += newRowHeight;
            img_topDst -= newRowHeight;
          }
          img_leftDist -= newColWidth;
          leftDist += newColWidth;
        }
        /* Set event listener on last gridlet to finish transitioning.*/
        var last_gridlet = grid.children().last();
        /* Show grid & hide the image it replaces.*/
        grid.show();
        cur_img.css('opacity', 0);
        /* Add identifying classes to corner gridlets (useful if applying border radius).*/
        grid.children().first().addClass('rs-top-left');
        grid.children().last().addClass('rs-bottom-right');
        grid.children().eq(rows - 1).addClass('rs-bottom-left');
        grid.children().eq(- rows).addClass('rs-top-right');
        /* Execution steps.*/
        setTimeout(function () {
          grid.children().css({
            opacity: op,
            transform: 'rotate('+ ro +'deg) translateX('+ tx +'px) translateY('+ ty +'px) scale('+ sc +')'
          });
        }, 1);
        jQuery(next_image_class).css('opacity', 1);
        /* After transition.*/
        jQuery(last_gridlet).one('webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend', jQuery.proxy(bwg_after_trans));
        function bwg_after_trans() {
          jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1});
          jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2});
          cur_img.css('opacity', 1);
          grid.remove();
          bwg_trans_in_progress = false;
          jQuery(current_image_class).html('');
          if (typeof event_stack !== 'undefined') {
            if (event_stack.length > 0) {
              key = event_stack[0].split("-");
              event_stack.shift();
              bwg_change_image(key[0], key[1], data, true);
            }
          }
          bwg_change_watermark_container();
        }
      }
      function bwg_sliceV(current_image_class, next_image_class, direction) {
        if (direction == 'right') {
          var translateY = 'min-auto';
        }
        else if (direction == 'left') {
          var translateY = 'auto';
        }
        bwg_grid(10, 1, 0, 0, translateY, 1, 0, current_image_class, next_image_class, direction);
      }
      function bwg_scaleOut(current_image_class, next_image_class, direction) {
        bwg_grid(1, 1, 0, 0, 0, 1.5, 0, current_image_class, next_image_class, direction);
      }
      function bwg_blindH(current_image_class, next_image_class, direction) {
        bwg_grid(10, 1, 0, 0, 0, .7, 0, current_image_class, next_image_class);
      }
      function bwg_change_image(current_key, key, data, from_effect) {
        jQuery("#spider_popup_left").show();
        jQuery("#spider_popup_right").show();
        if (<?php 
        echo $option_row->enable_loop;
        ?>
 == 0) {
          if (key == (parseInt(data.length) - 1)) {
            jQuery("#spider_popup_right").hide();
          }
          if (key == 0) {
            jQuery("#spider_popup_left").hide();
          }
        }
        /* Pause videos.*/
        jQuery("#bwg_image_container").find("iframe").each(function () {
          jQuery(this)[0].contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
          jQuery(this)[0].contentWindow.postMessage('{ "method": "pause" }', "*");
          jQuery(this)[0].contentWindow.postMessage('pause', '*');
        });
        if (typeof data[key] != 'undefined') {
          if (typeof data[current_key] != 'undefined') {
            if (jQuery(".bwg_play_pause").length && !jQuery(".bwg_play_pause").hasClass("fa-play")) {
              bwg_play();
            }
            if (!from_effect) {
              /* Change image key.*/
              jQuery("#bwg_current_image_key").val(key);
              /*if (current_key == '-1') {
                current_key = jQuery(".bwg_thumb_active").children("img").attr("image_key");
              }*/
            }
            if (bwg_trans_in_progress) {
              event_stack.push(current_key + '-' + key);
              return;
            }
            var direction = 'right';
            if (bwg_current_key > key) {
              var direction = 'left';
            }
            else if (bwg_current_key == key) {
              return;
            }
            /*jQuery("#spider_popup_left").hover().css({"display": "inline"});
            jQuery("#spider_popup_right").hover().css({"display": "inline"});*/
            jQuery(".bwg_image_count").html(data[key]["number"]);
            /* Set filmstrip initial position.*/
            jQuery(".bwg_watermark").css({display: 'none'});
            /* Set active thumbnail position.*/
            bwg_current_filmstrip_pos = key * (jQuery(".bwg_filmstrip_thumbnail").width() + 2 + 2 * <?php 
        echo $theme_row->lightbox_filmstrip_thumb_border_width;
        ?>
);
            bwg_current_key = key;
            /* Change image id.*/
            jQuery("#bwg_popup_image").attr('image_id', data[key]["id"]);
            /* Change image title, description.*/
            jQuery(".bwg_image_title").html(jQuery('<span style="display: block;" />').html(data[key]["alt"]).text());
            jQuery(".bwg_image_description").html(jQuery('<span style="display: block;" />').html(data[key]["description"]).text());
            jQuery(".bwg_image_info").removeAttr("style");
            if (data[key]["alt"].trim() == "") {
              if (data[key]["description"].trim() == "") {
                      jQuery(".bwg_image_info").css("background", "none");
              }
            }
          if (jQuery(".bwg_image_info_container1").css("display") != 'none') {
            jQuery(".bwg_image_info_container1").css("display", "table-cell");
          }
          else {
            jQuery(".bwg_image_info_container1").css("display", "none");
          }
          var current_image_class = jQuery(".bwg_popup_image_spun").css("zIndex") == 2 ? ".bwg_popup_image_spun" : ".bwg_popup_image_second_spun";
          var next_image_class = current_image_class == ".bwg_popup_image_second_spun" ? ".bwg_popup_image_spun" : ".bwg_popup_image_second_spun";
          
          var is_embed = data[key]['filetype'].indexOf("EMBED_") > -1 ? true : false;
          var is_embed_instagram_post = data[key]['filetype'].indexOf('INSTAGRAM_POST') > -1 ? true :false;
          var cur_height = jQuery(current_image_class).height();
          var cur_width = jQuery(current_image_class).width();
          var innhtml = '<span class="bwg_popup_image_spun1" style="display: table; width: inherit; height: inherit;"><span class="bwg_popup_image_spun2" style="display: table-cell; vertical-align: middle; text-align: center;">';
          if (!is_embed) {
              innhtml += '<img style="max-height: ' + cur_height + 'px; max-width: ' + cur_width + 'px;" class="bwg_popup_image bwg_popup_watermark" src="<?php 
        echo site_url() . '/' . $WD_BWG_UPLOAD_DIR;
        ?>
' + jQuery('<span style="display: block;" />').html(data[key]["image_url"]).text() + '" alt="' + data[key]["alt"] + '" />';
          }
          else { /*is_embed*/

            innhtml += '<span style="height: ' + cur_height + 'px; width: ' + cur_width + 'px;" class="bwg_popup_embed bwg_popup_watermark">';
            if (is_embed_instagram_post) {
              var post_width = 0;
              var post_height = 0;
              if (cur_height < cur_width + 88) {
                post_height = cur_height;
                post_width = post_height - 88;
              }
              else {
                post_width = cur_width;
                post_height = post_width + 88;
              }
              innhtml += spider_display_embed(data[key]['filetype'], data[key]['filename'], {class:"bwg_embed_frame", 'data-width': data[key]['image_width'], 'data-height': data[key]['image_height'], frameborder: "0", allowfullscreen: "allowfullscreen", style: "width:" + post_width + "px; height:" + post_height + "px; vertical-align:middle; display:inline-block; position:relative;"});
            }
            else{
              innhtml += spider_display_embed(data[key]['filetype'], data[key]['filename'], {class:"bwg_embed_frame", frameborder:"0", allowfullscreen:"allowfullscreen", style:"width:inherit; height:inherit; vertical-align:middle; display:table-cell;" });
            }
            innhtml += "</span>";
          }
          innhtml += '</span></span>';
          jQuery(next_image_class).html(innhtml);
          
          function bwg_afterload() {
            <?php 
        if ($option_row->preload_images) {
            echo 'bwg_preload_images(key);';
        }
        ?>
            bwg_<?php 
        echo $image_effect;
        ?>
(current_image_class, next_image_class, direction);
            jQuery("#bwg_download").show();
            if (!is_embed) {
              jQuery("#bwg_fullsize_image").attr("href", "<?php 
        echo site_url() . '/' . $WD_BWG_UPLOAD_DIR;
        ?>
" + data[key]['image_url']);
              jQuery("#bwg_download").attr("href", "<?php 
        echo site_url() . '/' . $WD_BWG_UPLOAD_DIR;
        ?>
" + data[key]['image_url']);
            }
            else {
              jQuery("#bwg_fullsize_image").attr("href", data[key]['image_url']);
              if (data[key]['filetype'].indexOf("FLICKR_") > -1) {
                jQuery("#bwg_download").attr("href", data[key]['filename']);
              }
              else if (data[key]['filetype'].indexOf("INSTAGRAM_") > -1) {
                jQuery("#bwg_download").attr("href", data[key]['thumb_url'].substring(0, data[key]['thumb_url'].length - 1) + 'l');
              }
              else {
               jQuery("#bwg_download").hide();
              }
            }
            var image_arr = data[key]['image_url'].split("/");
            jQuery("#bwg_download").attr("download", image_arr[image_arr.length - 1]);
            /* Load comments.*/
            if (jQuery(".bwg_comment_container").hasClass("bwg_open")) {
              if (data[key]["comment_count"] == 0) {
                jQuery("#bwg_added_comments").hide();
              }
              else {
                jQuery("#bwg_added_comments").show();
                spider_set_input_value('ajax_task', 'display');
                spider_set_input_value('image_id', jQuery('#bwg_popup_image').attr('image_id'));
                spider_ajax_save('bwg_comment_form');
              }
            }
            /* Update custom scroll.*/
              if (typeof jQuery().mCustomScrollbar !== 'undefined') {
                if (jQuery.isFunction(jQuery().mCustomScrollbar)) {
                  jQuery(".bwg_comments").mCustomScrollbar({
                    advanced:{
                      updateOnContentResize: true
                    }
                  });
                }
              }
            jQuery(".mCSB_scrollTools").hide();
            <?php 
        if ($enable_image_filmstrip) {
            ?>
              bwg_move_filmstrip();
              <?php 
        }
        ?>
            bwg_resize_instagram_post();
          }
          if (!is_embed) {
            var cur_img = jQuery(next_image_class).find('img');
            cur_img.one('load', function() {
              bwg_afterload();
            }).each(function() {
              if(this.complete) jQuery(this).load();
            });
          }
          else {
            bwg_afterload();
            }
          }
        }
      }
      jQuery(document).on('keydown', function (e) {
        if (jQuery("#bwg_name").is(":focus") || jQuery("#bwg_email").is(":focus") || jQuery("#bwg_comment").is(":focus") || jQuery("#bwg_captcha_input").is(":focus")) {
          return;
        }
        if (e.keyCode === 39) { /* Right arrow.*/
          bwg_change_image(parseInt(jQuery('#bwg_current_image_key').val()), parseInt(jQuery('#bwg_current_image_key').val()) + 1, data)
        }
        else if (e.keyCode === 37) { /* Left arrow.*/
          bwg_change_image(parseInt(jQuery('#bwg_current_image_key').val()), parseInt(jQuery('#bwg_current_image_key').val()) - 1, data)
        }
        else if (e.keyCode === 27) { /* Esc.*/
          spider_destroypopup(1000);
        }
        else if (e.keyCode === 32) { /* Space.*/
          jQuery(".bwg_play_pause").trigger('click');
        }
      });
      function bwg_preload_images(key) {
        count = <?php 
        echo (int) $option_row->preload_images_count / 2;
        ?>
;
        var count_all = data.length;
        if (count_all < <?php 
        echo $option_row->preload_images_count;
        ?>
) {
          count = 0;
        }
        if (count != 0) {
          for (var i = key - count; i < key + count; i++) {
            var index = parseInt((i + count_all) % count_all);
            var is_embed = data[index]['filetype'].indexOf("EMBED_") > -1 ? true : false;
            if (typeof data[index] != "undefined") {
              if (!is_embed) {
                jQuery("<img/>").attr("src", '<?php 
        echo site_url() . '/' . $WD_BWG_UPLOAD_DIR;
        ?>
' + jQuery('<span style="display: block;" />').html(data[index]["image_url"]).text());
              }
            }
          }
        }
        else {
          for (var i = 0; i < data.length; i++) {
            var is_embed = data[i]['filetype'].indexOf("EMBED_") > -1 ? true : false;
            if (typeof data[index] != "undefined") {
              if (!is_embed) {
                jQuery("<img/>").attr("src", '<?php 
        echo site_url() . '/' . $WD_BWG_UPLOAD_DIR;
        ?>
' + jQuery('<span style="display: block;" />').html(data[i]["image_url"]).text());
              }
            }
          }
        }
      }
      function bwg_popup_resize() {
        if (typeof jQuery().fullscreen !== 'undefined') {
          if (jQuery.isFunction(jQuery().fullscreen)) {
            if (!jQuery.fullscreen.isFullScreen()) {
              jQuery(".bwg_resize-full").show();
              jQuery(".bwg_resize-full").attr("class", "bwg_ctrl_btn bwg_resize-full fa fa-resize-full");
              jQuery(".bwg_resize-full").attr("title", "<?php 
        echo __('Maximize', 'bwg');
        ?>
");
              jQuery(".bwg_fullscreen").attr("class", "bwg_ctrl_btn bwg_fullscreen fa fa-fullscreen");
              jQuery(".bwg_fullscreen").attr("title", "<?php 
        echo __('Fullscreen', 'bwg');
        ?>
");
            }
          }
        }
        var comment_container_width = 0;
        if (jQuery(".bwg_comment_container").hasClass("bwg_open")) {
          comment_container_width = <?php 
        echo $theme_row->lightbox_comment_width;
        ?>
;
        }
        if (comment_container_width > jQuery(window).width()) {
          comment_container_width = jQuery(window).width();
          jQuery(".bwg_comment_container").css({
            width: comment_container_width
          });
          jQuery(".spider_popup_close_fullscreen").hide();
        }
        else {
          jQuery(".spider_popup_close_fullscreen").show();
        }
        if (!(!(jQuery(window).height() > <?php 
        echo $image_height;
        ?>
) || !(<?php 
        echo $open_with_fullscreen;
        ?>
 != 1))) {
          jQuery("#spider_popup_wrap").css({
            height: <?php 
        echo $image_height;
        ?>
,
            top: '50%',
            marginTop: -<?php 
        echo $image_height / 2;
        ?>
,
            zIndex: 100000
          });
          jQuery(".bwg_image_container").css({height: (<?php 
        echo $image_height - $image_filmstrip_height;
        ?>
)});
          jQuery(".bwg_popup_image").css({
            maxHeight: <?php 
        echo $image_height - $image_filmstrip_height;
        ?>
          });
          jQuery(".bwg_popup_embed").css({
            height: <?php 
        echo $image_height - $image_filmstrip_height;
        ?>
          });
          bwg_popup_current_height = <?php 
        echo $image_height;
        ?>
;
        }
        else {
          jQuery("#spider_popup_wrap").css({
            height: jQuery(window).height(),
            top: 0,
            marginTop: 0,
            zIndex: 100000
          });
          jQuery(".bwg_image_container").css({height: (jQuery(window).height() - <?php 
        echo $image_filmstrip_height;
        ?>
)});
          jQuery(".bwg_popup_image").css({
            maxHeight: jQuery(window).height() - <?php 
        echo $image_filmstrip_height;
        ?>
          });
          jQuery(".bwg_popup_embed").css({
            height: jQuery(window).height() - <?php 
        echo $image_filmstrip_height;
        ?>
          });
          bwg_popup_current_height = jQuery(window).height();
        }
        if (!(!(jQuery(window).width() >= <?php 
        echo $image_width;
        ?>
) || !(<?php 
        echo $open_with_fullscreen;
        ?>
 != 1))) {
          jQuery("#spider_popup_wrap").css({
            width: <?php 
        echo $image_width;
        ?>
,
            left: '50%',
            marginLeft: -<?php 
        echo $image_width / 2;
        ?>
,
            zIndex: 100000
          });
          jQuery(".bwg_image_wrap").css({width: <?php 
        echo $image_width;
        ?>
 - comment_container_width});
          jQuery(".bwg_image_container").css({width: <?php 
        echo $image_width;
        ?>
 - comment_container_width});
          jQuery(".bwg_popup_image").css({
            maxWidth: <?php 
        echo $image_width;
        ?>
 - comment_container_width
          });
          jQuery(".bwg_popup_embed").css({
            width: <?php 
        echo $image_width;
        ?>
 - comment_container_width
          });
          jQuery(".bwg_filmstrip_container").css({width: <?php 
        echo $image_width;
        ?>
 - comment_container_width});
          jQuery(".bwg_filmstrip").css({width: (<?php 
        echo $image_width;
        ?>
  - comment_container_width- 40)});
          bwg_popup_current_width = <?php 
        echo $image_width;
        ?>
;
        }
        else {
          jQuery("#spider_popup_wrap").css({
            width: jQuery(window).width(),
            left: 0,
            marginLeft: 0,
            zIndex: 100000
          });
          jQuery(".bwg_image_wrap").css({width: (jQuery(window).width() - comment_container_width)});
          jQuery(".bwg_image_container").css({width: jQuery(window).width() - comment_container_width});
          jQuery(".bwg_popup_image").css({
            maxWidth: jQuery(window).width() - comment_container_width
          });
          jQuery(".bwg_popup_embed").css({
            width: jQuery(window).width() - comment_container_width
          });
          jQuery(".bwg_filmstrip_container").css({width: (jQuery(window).width() - comment_container_width)});
          jQuery(".bwg_filmstrip").css({width: (jQuery(window).width() - comment_container_width - 40)});
          bwg_popup_current_width = jQuery(window).width();
        }
        /* Set watermark container size.*/
        bwg_resize_instagram_post();
        bwg_change_watermark_container();
        if (!(!(jQuery(window).height() > <?php 
        echo $image_height - 2 * $theme_row->lightbox_close_btn_top;
        ?>
) || !(jQuery(window).width() >= <?php 
        echo $image_width - 2 * $theme_row->lightbox_close_btn_right;
        ?>
) || !(<?php 
        echo $open_with_fullscreen;
        ?>
 != 1))) {
          jQuery(".spider_popup_close_fullscreen").attr("class", "spider_popup_close");
        }
        else {
          if (!(!(jQuery("#spider_popup_wrap").width() < jQuery(window).width()) || !(jQuery("#spider_popup_wrap").height() < jQuery(window).height()))) {
            jQuery(".spider_popup_close").attr("class", "bwg_ctrl_btn spider_popup_close_fullscreen");
          }
        }
        if ( "<?php 
        echo $theme_row->lightbox_ctrl_btn_pos;
        ?>
" == 'bottom') {
          jQuery(".bwg_toggle_container").css("bottom", jQuery(".bwg_ctrl_btn_container").height() + "px");
        }
        if ( "<?php 
        echo $theme_row->lightbox_ctrl_btn_pos;
        ?>
" == 'top') {
          jQuery(".bwg_toggle_container").css("top", jQuery(".bwg_ctrl_btn_container").height() + "px");
        }
      }
      jQuery(window).resize(function() {
        if (typeof jQuery().fullscreen !== 'undefined') {
          if (jQuery.isFunction(jQuery().fullscreen)) {
            if (!jQuery.fullscreen.isFullScreen()) {
              bwg_popup_resize();
            }
          }
        }
      });
      /* Popup current width/height.*/
      var bwg_popup_current_width = <?php 
        echo $image_width;
        ?>
;
      var bwg_popup_current_height = <?php 
        echo $image_height;
        ?>
;
      /* Open/close comments.*/
      function bwg_comment() {
        jQuery(".bwg_watermark").css({display: 'none'});
        if (jQuery(".bwg_comment_container").hasClass("bwg_open")) {
          /* Close comment.*/
          var border_width = parseInt(jQuery(".bwg_comment_container").css('borderRightWidth'));
          if (!border_width) {
            border_width = 0;
          }
          jQuery(".bwg_comment_container").animate({<?php 
        echo $theme_row->lightbox_comment_pos;
        ?>
: -jQuery(".bwg_comment_container").width() - border_width}, 500);
          jQuery(".bwg_image_wrap").animate({
            <?php 
        echo $theme_row->lightbox_comment_pos;
        ?>
: 0,
            width: jQuery("#spider_popup_wrap").width()
          }, 500);
          jQuery(".bwg_popup_image").animate({
              maxWidth: jQuery("#spider_popup_wrap").width()
            }, {
              duration: 500,
              complete: function () { bwg_change_watermark_container(); }
            });
          jQuery(".bwg_popup_embed").animate({
              width: jQuery("#spider_popup_wrap").width()
            }, {
              duration: 500,
              complete: function () { 
                bwg_resize_instagram_post();
                bwg_change_watermark_container(); }
            });
          jQuery(".bwg_filmstrip_container").animate({width: jQuery(".spider_popup_wrap").width()}, 500);
          jQuery(".bwg_filmstrip").animate({width: jQuery(".spider_popup_wrap").width() - 40}, 500);
          /* Set filmstrip initial position.*/
          bwg_set_filmstrip_pos(jQuery(".spider_popup_wrap").width() - 40);
          jQuery(".bwg_comment_container").attr("class", "bwg_comment_container bwg_close");
          jQuery(".bwg_comment").attr("title", "<?php 
        echo __('Show Comments', 'bwg');
        ?>
");
          jQuery(".spider_popup_close_fullscreen").show();
        }
        else {
          /* Open comment.*/
          var comment_container_width = <?php 
        echo $theme_row->lightbox_comment_width;
        ?>
;
          if (comment_container_width > jQuery(window).width()) {
            comment_container_width = jQuery(window).width();
            jQuery(".bwg_comment_container").css({
              width: comment_container_width
            });
            jQuery(".spider_popup_close_fullscreen").hide();
            if (jQuery(".bwg_ctrl_btn").hasClass("fa-pause")) {
              var isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
              jQuery(".bwg_play_pause").trigger(isMobile ? 'touchend' : 'click');
            }
          }
          else {
            jQuery(".spider_popup_close_fullscreen").show();
          }
          jQuery(".bwg_comment_container").animate({<?php 
        echo $theme_row->lightbox_comment_pos;
        ?>
: 0}, 500);
          jQuery(".bwg_image_wrap").animate({
            <?php 
        echo $theme_row->lightbox_comment_pos;
        ?>
: jQuery(".bwg_comment_container").width(),
            width: jQuery("#spider_popup_wrap").width() - jQuery(".bwg_comment_container").width()}, 500);
          jQuery(".bwg_popup_image").animate({
              maxWidth: jQuery("#spider_popup_wrap").width() - jQuery(".bwg_comment_container").width()
            }, {
              duration: 500,
              complete: function () { bwg_change_watermark_container(); }
            });
          jQuery(".bwg_popup_embed").animate({
              width: jQuery("#spider_popup_wrap").width() - jQuery(".bwg_comment_container").width()
            }, {
              duration: 500,
              complete: function () { 
                bwg_resize_instagram_post();
                bwg_change_watermark_container(); }
            });
          jQuery(".bwg_filmstrip_container").css({width: jQuery("#spider_popup_wrap").width() - jQuery(".bwg_comment_container").width()});
          jQuery(".bwg_filmstrip").animate({width: jQuery(".bwg_filmstrip_container").width() - 40}, 500);
          /* Set filmstrip initial position.*/
          bwg_set_filmstrip_pos(jQuery(".bwg_filmstrip_container").width() - 40);
          jQuery(".bwg_comment_container").attr("class", "bwg_comment_container bwg_open");
          jQuery(".bwg_comment").attr("title", "<?php 
        echo __('Hide Comments', 'bwg');
        ?>
");
          /* Load comments.*/
          var cur_image_key = parseInt(jQuery("#bwg_current_image_key").val());
          if (data[cur_image_key]["comment_count"] != 0) {
            jQuery("#bwg_added_comments").show();
            spider_set_input_value('ajax_task', 'display');
            spider_set_input_value('image_id', jQuery('#bwg_popup_image').attr('image_id'));
            spider_ajax_save('bwg_comment_form');
          }
        }
      }
      function bwg_reset_zoom() {
        var isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
        var viewportmeta = document.querySelector('meta[name="viewport"]');
        if (isMobile) {
          if (viewportmeta) {
            viewportmeta.content = 'width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=0';
          }
        }
      }
      /* jQuery(document).ready(function () { */
      	<?php 
        if ($image_right_click) {
            ?>
          /* Disable right click.*/
          jQuery(".bwg_image_wrap").bind("contextmenu", function (e) {
            return false;
          });
           jQuery(".bwg_image_wrap").css('webkitTouchCallout','none');
          <?php 
        }
        ?>
        if (typeof jQuery().swiperight !== 'undefined') {
          if (jQuery.isFunction(jQuery().swiperight)) {
            jQuery('#spider_popup_wrap').swiperight(function () {
            bwg_change_image(parseInt(jQuery('#bwg_current_image_key').val()), (parseInt(jQuery('#bwg_current_image_key').val()) + data.length - 1) % data.length, data);
              return false;
            });
          }
        }
        if (typeof jQuery().swipeleft !== 'undefined') {
          if (jQuery.isFunction(jQuery().swipeleft)) {
            jQuery('#spider_popup_wrap').swipeleft(function () {
            bwg_change_image(parseInt(jQuery('#bwg_current_image_key').val()), (parseInt(jQuery('#bwg_current_image_key').val()) + 1) % data.length, data);
              return false;
            });
          }
        }

        bwg_reset_zoom();
        var isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
        var bwg_click = isMobile ? 'touchend' : 'click';
        jQuery("#spider_popup_left").on(bwg_click, function () {
          bwg_change_image(parseInt(jQuery('#bwg_current_image_key').val()), (parseInt(jQuery('#bwg_current_image_key').val()) + data.length - 1) % data.length, data);
          return false;
        });
        jQuery("#spider_popup_right").on(bwg_click, function () {
          bwg_change_image(parseInt(jQuery('#bwg_current_image_key').val()), (parseInt(jQuery('#bwg_current_image_key').val()) + 1) % data.length, data);
          return false;
        });
        if (navigator.appVersion.indexOf("MSIE 10") != -1 || navigator.appVersion.indexOf("MSIE 9") != -1) {
          setTimeout(function () {
            bwg_popup_resize();
          }, 1);
        }
        else {
          bwg_popup_resize();
        }
        jQuery(".bwg_watermark").css({display: 'none'});
        setTimeout(function () {
          bwg_change_watermark_container();
        }, 500);
        /* If browser doesn't support Fullscreen API.*/
        if (typeof jQuery().fullscreen !== 'undefined') {
          if (jQuery.isFunction(jQuery().fullscreen)) {
            if (!jQuery.fullscreen.isNativelySupported()) {
              jQuery(".bwg_fullscreen").hide();
            }
          }
        }
        /* Set image container height.*/
        jQuery(".bwg_image_container").height(jQuery(".bwg_image_wrap").height() - <?php 
        echo $image_filmstrip_height;
        ?>
);
        /* Change default scrollbar in comments.*/
        if (typeof jQuery().mCustomScrollbar !== 'undefined') {
          if (jQuery.isFunction(jQuery().mCustomScrollbar)) {
            jQuery(".bwg_comments").mCustomScrollbar({scrollInertia: 150});
          }
        }
        var mousewheelevt = (/Firefox/i.test(navigator.userAgent)) ? "DOMMouseScroll" : "mousewheel" /*FF doesn't recognize mousewheel as of FF3.x*/
        jQuery('.bwg_filmstrip').on(mousewheelevt, function(e) {
          var evt = window.event || e; /* Equalize event object.*/
          evt = evt.originalEvent ? evt.originalEvent : evt; /* Convert to originalEvent if possible.*/
          var delta = evt.detail ? evt.detail*(-40) : evt.wheelDelta; /* Check for detail first, because it is used by Opera and FF.*/
          var isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
          if (delta > 0) {
            /* Scroll up.*/
            jQuery(".bwg_filmstrip_left").trigger(isMobile ? 'touchend' : 'click');
          }
          else {
            /* Scroll down.*/
            jQuery(".bwg_filmstrip_right").trigger(isMobile ? 'touchend' : 'click');
          }
        });
        jQuery(".bwg_filmstrip_right").on(bwg_click, function () {
          jQuery( ".bwg_filmstrip_thumbnails" ).stop(true, false);
          if (jQuery(".bwg_filmstrip_thumbnails").position().left >= -(jQuery(".bwg_filmstrip_thumbnails").width() - jQuery(".bwg_filmstrip").width())) {
            jQuery(".bwg_filmstrip_left").css({opacity: 1, filter: "Alpha(opacity=100)"});
            if (jQuery(".bwg_filmstrip_thumbnails").position().left < -(jQuery(".bwg_filmstrip_thumbnails").width() - jQuery(".bwg_filmstrip").width() - <?php 
        echo $filmstrip_thumb_margin_hor + $image_filmstrip_width;
        ?>
)) {
              jQuery(".bwg_filmstrip_thumbnails").animate({left: -(jQuery(".bwg_filmstrip_thumbnails").width() - jQuery(".bwg_filmstrip").width())}, 500, 'linear');
            }
            else {
              jQuery(".bwg_filmstrip_thumbnails").animate({left: (jQuery(".bwg_filmstrip_thumbnails").position().left - <?php 
        echo $filmstrip_thumb_margin_hor + $image_filmstrip_width;
        ?>
)}, 500, 'linear');
            }
          }
          /* Disable right arrow.*/
          window.setTimeout(function(){
            if (jQuery(".bwg_filmstrip_thumbnails").position().left == -(jQuery(".bwg_filmstrip_thumbnails").width() - jQuery(".bwg_filmstrip").width())) {
              jQuery(".bwg_filmstrip_right").css({opacity: 0.3, filter: "Alpha(opacity=30)"});
            }
          }, 500);
        });
        jQuery(".bwg_filmstrip_left").on(bwg_click, function () {
          jQuery( ".bwg_filmstrip_thumbnails" ).stop(true, false);
          if (jQuery(".bwg_filmstrip_thumbnails").position().left < 0) {
            jQuery(".bwg_filmstrip_right").css({opacity: 1, filter: "Alpha(opacity=100)"});
            if (jQuery(".bwg_filmstrip_thumbnails").position().left > - <?php 
        echo $filmstrip_thumb_margin_hor + $image_filmstrip_width;
        ?>
) {
              jQuery(".bwg_filmstrip_thumbnails").animate({left: 0}, 500, 'linear');
            }
            else {
              jQuery(".bwg_filmstrip_thumbnails").animate({left: (jQuery(".bwg_filmstrip_thumbnails").position().left + <?php 
        echo $image_filmstrip_width + $filmstrip_thumb_margin_hor;
        ?>
)}, 500, 'linear');
            }
          }
          /* Disable left arrow.*/
          window.setTimeout(function(){
            if (jQuery(".bwg_filmstrip_thumbnails").position().left == 0) {
              jQuery(".bwg_filmstrip_left").css({opacity: 0.3, filter: "Alpha(opacity=30)"});
            }
          }, 500);
        });
        /* Set filmstrip initial position.*/
        bwg_set_filmstrip_pos(jQuery(".bwg_filmstrip").width());
        /* Show/hide image title/description.*/
        jQuery(".bwg_info").on(bwg_click, function() {
          if (jQuery(".bwg_image_info_container1").css("display") == 'none') {
            jQuery(".bwg_image_info_container1").css("display", "table-cell");
            jQuery(".bwg_info").attr("title", "<?php 
        echo __('Hide info', 'bwg');
        ?>
");
          }
          else {
            jQuery(".bwg_image_info_container1").css("display", "none");
            jQuery(".bwg_info").attr("title", "<?php 
        echo __('Show info', 'bwg');
        ?>
");
          }
        });
        /* Open/close comments.*/
        jQuery(".bwg_comment, .bwg_comments_close_btn").on(bwg_click, function() { bwg_comment()});
        /* Open/close control buttons.*/
        jQuery(".bwg_toggle_container").on(bwg_click, function () {
          var bwg_open_toggle_btn_class = "<?php 
        echo $theme_row->lightbox_ctrl_btn_pos == 'top' ? 'fa-angle-up' : 'fa-angle-down';
        ?>
";
          var bwg_close_toggle_btn_class = "<?php 
        echo $theme_row->lightbox_ctrl_btn_pos == 'top' ? 'fa-angle-down' : 'fa-angle-up';
        ?>
";
          if (jQuery(".bwg_toggle_container i").hasClass(bwg_open_toggle_btn_class)) {
            /* Close controll buttons.*/
            <?php 
        if ((!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'bottom') && $theme_row->lightbox_ctrl_btn_pos == 'bottom' && $theme_row->lightbox_info_pos == 'bottom') {
            ?>
                jQuery(".bwg_image_info").animate({bottom: 0}, 500);
                <?php 
        } elseif ((!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'top') && $theme_row->lightbox_ctrl_btn_pos == 'top' && $theme_row->lightbox_info_pos == 'top') {
            ?>
                jQuery(".bwg_image_info").animate({top: 0}, 500);
                <?php 
        }
        ?>
            jQuery(".bwg_ctrl_btn_container").animate({<?php 
        echo $theme_row->lightbox_ctrl_btn_pos;
        ?>
: '-' + jQuery(".bwg_ctrl_btn_container").height()}, 500);
            jQuery(".bwg_toggle_container").animate({
                <?php 
        echo $theme_row->lightbox_ctrl_btn_pos;
        ?>
: 0
              }, {
                duration: 500,
                complete: function () { jQuery(".bwg_toggle_container i").attr("class", "bwg_toggle_btn fa " + bwg_close_toggle_btn_class) }
              });
          }
          else {
            /* Open controll buttons.*/
            <?php 
        if ((!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'bottom') && $theme_row->lightbox_ctrl_btn_pos == 'bottom' && $theme_row->lightbox_info_pos == 'bottom') {
            ?>
                jQuery(".bwg_image_info").animate({bottom: jQuery(".bwg_ctrl_btn_container").height()}, 500);
                <?php 
        } elseif ((!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'top') && $theme_row->lightbox_ctrl_btn_pos == 'top' && $theme_row->lightbox_info_pos == 'top') {
            ?>
                jQuery(".bwg_image_info").animate({top: jQuery(".bwg_ctrl_btn_container").height()}, 500);
                <?php 
        }
        ?>
            jQuery(".bwg_ctrl_btn_container").animate({<?php 
        echo $theme_row->lightbox_ctrl_btn_pos;
        ?>
: 0}, 500);
            jQuery(".bwg_toggle_container").animate({
                <?php 
        echo $theme_row->lightbox_ctrl_btn_pos;
        ?>
: jQuery(".bwg_ctrl_btn_container").height()
              }, {
                duration: 500,
                complete: function () { jQuery(".bwg_toggle_container i").attr("class", "bwg_toggle_btn fa " + bwg_open_toggle_btn_class) }
              });
          }
        });
        /* Maximize/minimize.*/
        jQuery(".bwg_resize-full").on(bwg_click, function () {
          jQuery(".bwg_watermark").css({display: 'none'});
          var comment_container_width = 0;
          if (jQuery(".bwg_comment_container").hasClass("bwg_open")) {
            comment_container_width = jQuery(".bwg_comment_container").width();
          }
          if (jQuery(".bwg_resize-full").hasClass("fa-resize-small")) {
            if (jQuery(window).width() > <?php 
        echo $image_width;
        ?>
) {
              bwg_popup_current_width = <?php 
        echo $image_width;
        ?>
;
            }
            if (jQuery(window).height() > <?php 
        echo $image_height;
        ?>
) {
              bwg_popup_current_height = <?php 
        echo $image_height;
        ?>
;
            }
            /* Minimize.*/
            jQuery("#spider_popup_wrap").animate({
              width: bwg_popup_current_width,
              height: bwg_popup_current_height,
              left: '50%',
              top: '50%',
              marginLeft: -bwg_popup_current_width / 2,
              marginTop: -bwg_popup_current_height / 2,
              zIndex: 100000
            }, 500);
            jQuery(".bwg_image_wrap").animate({width: bwg_popup_current_width - comment_container_width}, 500);
            jQuery(".bwg_image_container").animate({height: bwg_popup_current_height - <?php 
        echo $image_filmstrip_height;
        ?>
, width: bwg_popup_current_width - comment_container_width}, 500);
            jQuery(".bwg_popup_image").animate({
                maxWidth: bwg_popup_current_width - comment_container_width,
                maxHeight: bwg_popup_current_height - <?php 
        echo $image_filmstrip_height;
        ?>
              }, {
                duration: 500,
                complete: function () {
                  bwg_change_watermark_container();
                  if ((jQuery("#spider_popup_wrap").width() < jQuery(window).width())) {
                    if (jQuery("#spider_popup_wrap").height() < jQuery(window).height()) {
                      jQuery(".spider_popup_close_fullscreen").attr("class", "spider_popup_close");
                    }
                  }
                }
              });
            jQuery(".bwg_popup_embed").animate({
                width: bwg_popup_current_width - comment_container_width,
                height: bwg_popup_current_height - <?php 
        echo $image_filmstrip_height;
        ?>
              }, {
                duration: 500,
                complete: function () {
                  bwg_resize_instagram_post();
                  bwg_change_watermark_container();
                  if (jQuery("#spider_popup_wrap").width() < jQuery(window).width()) {
                    if (jQuery("#spider_popup_wrap").height() < jQuery(window).height()) {
                      jQuery(".spider_popup_close_fullscreen").attr("class", "spider_popup_close");
                    }
                  }
                }
              });
            jQuery(".bwg_filmstrip_container").animate({width: bwg_popup_current_width - comment_container_width}, 500);
            jQuery(".bwg_filmstrip").animate({width: bwg_popup_current_width - comment_container_width - 40}, 500);
            /* Set filmstrip initial position.*/
            bwg_set_filmstrip_pos(bwg_popup_current_width - 40);
            jQuery(".bwg_resize-full").attr("class", "bwg_ctrl_btn bwg_resize-full fa fa-resize-full");
            jQuery(".bwg_resize-full").attr("title", "<?php 
        echo __('Maximize', 'bwg');
        ?>
");
          }
          else {
            bwg_popup_current_width = jQuery(window).width();
            bwg_popup_current_height = jQuery(window).height();
            /* Maximize.*/
            jQuery("#spider_popup_wrap").animate({
              width: jQuery(window).width(),
              height: jQuery(window).height(),
              left: 0,
              top: 0,
              margin: 0,
              zIndex: 100000
            }, 500);
            jQuery(".bwg_image_wrap").animate({width: (jQuery(window).width() - comment_container_width)}, 500);
            jQuery(".bwg_image_container").animate({height: (bwg_popup_current_height - <?php 
        echo $image_filmstrip_height;
        ?>
), width: bwg_popup_current_width - comment_container_width}, 500);
            jQuery(".bwg_popup_image").animate({
                maxWidth: jQuery(window).width() - comment_container_width,
                maxHeight: jQuery(window).height() - <?php 
        echo $image_filmstrip_height;
        ?>
              }, {
                duration: 500,
                complete: function () { bwg_change_watermark_container(); }
              });
            jQuery(".bwg_popup_embed").animate({
                width: jQuery(window).width() - comment_container_width,
                height: jQuery(window).height() - <?php 
        echo $image_filmstrip_height;
        ?>
              }, {
                duration: 500,
                complete: function () { 
                  bwg_resize_instagram_post();
                  bwg_change_watermark_container(); }
              });
            jQuery(".bwg_filmstrip_container").animate({width: jQuery(window).width() - comment_container_width}, 500);
            jQuery(".bwg_filmstrip").animate({width: jQuery(window).width() - comment_container_width - 40}, 500);
            /* Set filmstrip initial position.*/
            bwg_set_filmstrip_pos(jQuery(window).width() - comment_container_width - 40);
            jQuery(".bwg_resize-full").attr("class", "bwg_ctrl_btn bwg_resize-full fa fa-resize-small");
            jQuery(".bwg_resize-full").attr("title", "<?php 
        echo __('Restore', 'bwg');
        ?>
");
            jQuery(".spider_popup_close").attr("class", "bwg_ctrl_btn spider_popup_close_fullscreen");
          }
        });
        /* Fullscreen.*/
        /*Toggle with mouse click*/
        jQuery(".bwg_fullscreen").on(bwg_click, function () {
          jQuery(".bwg_watermark").css({display: 'none'});
          var comment_container_width = 0;
          if (jQuery(".bwg_comment_container").hasClass("bwg_open")) {
            comment_container_width = jQuery(".bwg_comment_container").width();
          }
          function bwg_exit_fullscreen() {
            if (jQuery(window).width() > <?php 
        echo $image_width;
        ?>
) {
              bwg_popup_current_width = <?php 
        echo $image_width;
        ?>
;
            }
            if (jQuery(window).height() > <?php 
        echo $image_height;
        ?>
) {
              bwg_popup_current_height = <?php 
        echo $image_height;
        ?>
;
            }
            <?php 
        /* "Full width lightbox" sets yes.*/
        if ($open_with_fullscreen) {
            ?>
            bwg_popup_current_width = jQuery(window).width();
            bwg_popup_current_height = jQuery(window).height();
              <?php 
        }
        ?>
            jQuery("#spider_popup_wrap").on("fscreenclose", function() {
              jQuery("#spider_popup_wrap").css({
                width: bwg_popup_current_width,
                height: bwg_popup_current_height,
                left: '50%',
                top: '50%',
                marginLeft: -bwg_popup_current_width / 2,
                marginTop: -bwg_popup_current_height / 2,
                zIndex: 100000
              });
              jQuery(".bwg_image_wrap").css({width: bwg_popup_current_width - comment_container_width});
              jQuery(".bwg_image_container").css({height: bwg_popup_current_height - <?php 
        echo $image_filmstrip_height;
        ?>
, width: bwg_popup_current_width - comment_container_width});
              /*jQuery(".bwg_slide_bg").css({height: bwg_popup_current_height - <?php 
        echo $image_filmstrip_height;
        ?>
});
              jQuery(".bwg_popup_image_spun1").css({height: bwg_popup_current_height - <?php 
        echo $image_filmstrip_height;
        ?>
});*/
              jQuery(".bwg_popup_image").css({
                maxWidth: bwg_popup_current_width - comment_container_width,
                maxHeight: bwg_popup_current_height - <?php 
        echo $image_filmstrip_height;
        ?>
              });
              jQuery(".bwg_popup_embed").css({
                width: bwg_popup_current_width - comment_container_width,
                height: bwg_popup_current_height - <?php 
        echo $image_filmstrip_height;
        ?>
              });
              bwg_resize_instagram_post();
              /* Set watermark container size.*/
              bwg_change_watermark_container();
              jQuery(".bwg_filmstrip_container").css({width: bwg_popup_current_width - comment_container_width});
              jQuery(".bwg_filmstrip").css({width: bwg_popup_current_width - comment_container_width- 40});
              /* Set filmstrip initial position.*/
              bwg_set_filmstrip_pos(bwg_popup_current_width - 40);
              jQuery(".bwg_resize-full").show();
              jQuery(".bwg_resize-full").attr("class", "bwg_ctrl_btn bwg_resize-full fa fa-resize-full");
              jQuery(".bwg_resize-full").attr("title", "<?php 
        echo __('Maximize', 'bwg');
        ?>
");
              jQuery(".bwg_fullscreen").attr("class", "bwg_ctrl_btn bwg_fullscreen fa fa-fullscreen");
              jQuery(".bwg_fullscreen").attr("title", "<?php 
        echo __('Fullscreen', 'bwg');
        ?>
");
              if (jQuery("#spider_popup_wrap").width() < jQuery(window).width()) {
                if (jQuery("#spider_popup_wrap").height() < jQuery(window).height()) {
                  jQuery(".spider_popup_close_fullscreen").attr("class", "spider_popup_close");
                }
              }
            });
          }
          if (typeof jQuery().fullscreen !== 'undefined') {
            if (jQuery.isFunction(jQuery().fullscreen)) {
            if (jQuery.fullscreen.isFullScreen()) {
              /* Exit Fullscreen.*/
              jQuery.fullscreen.exit();
              bwg_exit_fullscreen();
            }
            else {
              /* Fullscreen.*/
              jQuery("#spider_popup_wrap").fullscreen();
              /*jQuery("#spider_popup_wrap").on("fscreenopen", function() {
              if (jQuery.fullscreen.isFullScreen()) {*/
                var screen_width = screen.width;
                var screen_height = screen.height;
                jQuery("#spider_popup_wrap").css({
                  width: screen_width,
                  height: screen_height,
                  left: 0,
                  top: 0,
                  margin: 0,
                  zIndex: 100000
                });
                jQuery(".bwg_image_wrap").css({width: screen_width - comment_container_width});
                jQuery(".bwg_image_container").css({height: (screen_height - <?php 
        echo $image_filmstrip_height;
        ?>
), width: screen_width - comment_container_width});
                /* jQuery(".bwg_slide_bg").css({height: screen_height - <?php 
        echo $image_filmstrip_height;
        ?>
});*/
                jQuery(".bwg_popup_image").css({
                  maxWidth: (screen_width - comment_container_width),
                  maxHeight: (screen_height - <?php 
        echo $image_filmstrip_height;
        ?>
)
                });
                jQuery(".bwg_popup_embed").css({
                  width: (screen_width - comment_container_width),
                  height: (screen_height - <?php 
        echo $image_filmstrip_height;
        ?>
)
                });
                bwg_resize_instagram_post();
                /* Set watermark container size.*/
                bwg_change_watermark_container();
                jQuery(".bwg_filmstrip_container").css({width: (screen_width - comment_container_width)});
                jQuery(".bwg_filmstrip").css({width: (screen_width - comment_container_width - 40)});
                /* Set filmstrip initial position.*/
                bwg_set_filmstrip_pos(screen_width - comment_container_width - 40);
                jQuery(".bwg_resize-full").hide();
                jQuery(".bwg_fullscreen").attr("class", "bwg_ctrl_btn bwg_fullscreen fa fa-resize-small");
                jQuery(".bwg_fullscreen").attr("title", "<?php 
        echo __('Exit Fullscreen', 'bwg');
        ?>
");
                jQuery(".spider_popup_close").attr("class", "bwg_ctrl_btn spider_popup_close_fullscreen");
              /*});
              }*/
              }
            }
          }
          return false;
        });
        /* Play/pause.*/
        jQuery(".bwg_play_pause, .bwg_popup_image").on(bwg_click, function () {
          if (jQuery(".bwg_play_pause").length && jQuery(".bwg_play_pause").hasClass("fa-play")) {
            /* Play.*/
            bwg_play();
            jQuery(".bwg_play_pause").attr("title", "<?php 
        echo __('Pause', 'bwg');
        ?>
");
            jQuery(".bwg_play_pause").attr("class", "bwg_ctrl_btn bwg_play_pause fa fa-pause");
          }
          else {
            /* Pause.*/
            window.clearInterval(bwg_playInterval);
            jQuery(".bwg_play_pause").attr("title", "<?php 
        echo __('Play', 'bwg');
        ?>
");
            jQuery(".bwg_play_pause").attr("class", "bwg_ctrl_btn bwg_play_pause fa fa-play");
          }
        });
        /* Open with autoplay.*/
        <?php 
        if ($open_with_autoplay) {
            ?>
          bwg_play();
          jQuery(".bwg_play_pause").attr("title", "<?php 
            echo __('Pause', 'bwg');
            ?>
");
          jQuery(".bwg_play_pause").attr("class", "bwg_ctrl_btn bwg_play_pause fa fa-pause");
          <?php 
        }
        ?>
        /* Open with fullscreen.*/
        <?php 
        if ($open_with_fullscreen) {
            ?>
          bwg_open_with_fullscreen();
          <?php 
        }
        ?>
        <?php 
        if ($option_row->preload_images) {
            echo "bwg_preload_images(parseInt(jQuery('#bwg_current_image_key').val()));";
        }
        ?>
        jQuery(".bwg_popup_image").removeAttr("width");
        jQuery(".bwg_popup_image").removeAttr("height");
     /*  }); */
      /* Open with fullscreen.*/
      function bwg_open_with_fullscreen() {
        jQuery(".bwg_watermark").css({display: 'none'});
        var comment_container_width = 0;
        if (jQuery(".bwg_comment_container").hasClass("bwg_open")) {
          comment_container_width = jQuery(".bwg_comment_container").width();
        }
        bwg_popup_current_width = jQuery(window).width();
        bwg_popup_current_height = jQuery(window).height();
        jQuery("#spider_popup_wrap").css({
          width: jQuery(window).width(),
          height: jQuery(window).height(),
          left: 0,
          top: 0,
          margin: 0,
          zIndex: 100000
        });
        jQuery(".bwg_image_wrap").css({width: (jQuery(window).width() - comment_container_width)});
        jQuery(".bwg_image_container").css({height: (bwg_popup_current_height - <?php 
        echo $image_filmstrip_height;
        ?>
)});
        jQuery(".bwg_popup_image").css({
         maxWidth: jQuery(window).width() - comment_container_width,
         maxHeight: jQuery(window).height() - <?php 
        echo $image_filmstrip_height;
        ?>
        },  {
          complete: function () { bwg_change_watermark_container(); }
         });
        jQuery(".bwg_popup_embed").css({
         width: jQuery(window).width() - comment_container_width,
         height: jQuery(window).height() - <?php 
        echo $image_filmstrip_height;
        ?>
        },  {
          complete: function () { 
            bwg_resize_instagram_post();
            bwg_change_watermark_container(); }
         });
        jQuery(".bwg_filmstrip_container").css({width: jQuery(window).width() - comment_container_width});
        jQuery(".bwg_filmstrip").css({width: jQuery(window).width() - comment_container_width - 40});
        /* Set filmstrip initial position.*/
        bwg_set_filmstrip_pos(jQuery(window).width() - comment_container_width - 40);

        jQuery(".bwg_resize-full").attr("class", "bwg_ctrl_btn bwg_resize-full fa fa-resize-small");
        jQuery(".bwg_resize-full").attr("title", "<?php 
        echo __('Restore', 'bwg');
        ?>
");
        jQuery(".spider_popup_close").attr("class", "bwg_ctrl_btn spider_popup_close_fullscreen");         
      }

      function bwg_resize_instagram_post() {
        if (jQuery('.inner_instagram_iframe_bwg_embed_frame').length) {
          var post_width = jQuery(".bwg_image_container").width();
          var post_height = jQuery(".bwg_image_container").height();
          
          jQuery('.inner_instagram_iframe_bwg_embed_frame').each(function() {
            var parent_container = jQuery(this).parent();
            if (post_height / (parseInt(parent_container.attr('data-height')) + 96) < post_width / parseInt(parent_container.attr('data-width'))) {
              parent_container.height(post_height);
              parent_container.width((parent_container.height() - 96) * parent_container.attr('data-width') / parent_container.attr('data-height') + 16);
            }
            else {
              parent_container.width(post_width);
              parent_container.height((parent_container.width() - 16) * parent_container.attr('data-height') / parent_container.attr('data-width') + 96);
            }
            parent_container.css({top: 0.5 * (post_height - parent_container.height())});
          });
          bwg_change_watermark_container();
        }
      }

      function bwg_play() {
        window.clearInterval(bwg_playInterval);
        bwg_playInterval = setInterval(function () {
          if (!data[parseInt(jQuery('#bwg_current_image_key').val()) + 1]) {
            if (<?php 
        echo $option_row->enable_loop;
        ?>
 == 1) {
              /* Wrap around.*/
              bwg_change_image(parseInt(jQuery('#bwg_current_image_key').val()), 0, data);
            }
            return;
          }
          bwg_change_image(parseInt(jQuery('#bwg_current_image_key').val()), parseInt(jQuery('#bwg_current_image_key').val()) + 1, data)
        }, '<?php 
        echo $slideshow_interval * 1000;
        ?>
');
      }
      jQuery(window).focus(function() {
        /* event_stack = [];*/
          if (jQuery(".bwg_play_pause").length && !jQuery(".bwg_play_pause").hasClass("fa-play")) {
            bwg_play();
          }
        /*var i = 0;
        jQuery(".bwg_slider").children("span").each(function () {
          if (jQuery(this).css('opacity') == 1) {
            jQuery("#bwg_current_image_key").val(i);
          }
          i++;
        });*/
      });
      jQuery(window).blur(function() {
        event_stack = [];
        window.clearInterval(bwg_playInterval);
      });
    </script>
    <?php 
        die;
    }
 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();
 }
    public function image_display($id)
    {
        global $WD_BWG_UPLOAD_DIR;
        $rows_data = $this->model->get_image_rows_data($id);
        $page_nav = $this->model->image_page_nav($id);
        $search_value = isset($_POST['search_value']) ? esc_html(stripslashes($_POST['search_value'])) : '';
        $asc_or_desc = isset($_POST['asc_or_desc']) ? esc_html(stripslashes($_POST['asc_or_desc'])) : 'asc';
        $image_order_by = isset($_POST['image_order_by']) ? esc_html(stripslashes($_POST['image_order_by'])) : 'order';
        $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
        $page_number = isset($_POST['page_number']) ? esc_html(stripslashes($_POST['page_number'])) : 1;
        $ids_string = '';
        ?>
      <div id="draganddrop" class="updated" style="display:none;"><strong><p>Changes made in this table should be saved.</p></strong></div>
      <a style="margin: 5px 0;" href="<?php 
        echo add_query_arg(array('action' => 'addImages', 'width' => '700', 'height' => '550', 'extensions' => 'jpg,jpeg,png,gif', 'callback' => 'bwg_add_image', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
        ?>
" class="button-primary thickbox thickbox-preview" id="content-add_media" title="Add Images" onclick="return false;" style="margin-bottom:5px;">
        Add Images
      </a>
      <div class="buttons_div">
        <span class="button-secondary non_selectable" onclick="spider_check_all_items()">
          <input type="checkbox" id="check_all_items" name="check_all_items" onclick="spider_check_all_items_checkbox()" style="margin: 0; vertical-align: middle;" />
          <span style="vertical-align: middle;">Select All</span>
        </span>
        <input id="show_hide_weights"  class="button-secondary" type="button" onclick="spider_show_hide_weights();return false;" value="Hide order column" />
        <input class="button-primary" type="submit" onclick="spider_set_input_value('ajax_task', 'image_set_watermark');
                                                             spider_ajax_save('galleries_form');
                                                             return false;" value="Set Watermark" />
        <input class="button-secondary" type="submit" onclick="spider_set_input_value('ajax_task', 'image_recover_all');
                                                             spider_ajax_save('galleries_form');
                                                             return false;" value="Reset" />
        <input class="button-secondary" type="submit" onclick="spider_set_input_value('ajax_task', 'image_publish_all');
                                                     spider_ajax_save('galleries_form');
                                                     return false;" value="Publish" />
        <input class="button-secondary" type="submit" onclick="spider_set_input_value('ajax_task', 'image_unpublish_all');
                                                     spider_ajax_save('galleries_form');
                                                     return false;" value="Unpublish" />
        <input class="button-secondary" type="submit" onclick="if (confirm('Do you want to delete selected items?')) {
                                                       spider_set_input_value('ajax_task', 'image_delete_all');
                                                       spider_ajax_save('galleries_form');
                                                       return false;
                                                     } else {
                                                       return false;
                                                     }" value="Delete" />
      </div>
      <div class="tablenav top">
        <?php 
        WDWLibrary::ajax_search('Filename', $search_value, 'galleries_form');
        WDWLibrary::ajax_html_page_nav($page_nav['total'], $page_nav['limit'], 'galleries_form');
        ?>
      </div>

      <table id="images_table" class="wp-list-table widefat fixed pages">
        <thead>
          <th class="check-column table_small_col"></th>
          <th class="manage-column column-cb check-column table_small_col"><input id="check_all" type="checkbox" onclick="spider_check_all(this)" style="margin:0;" /></th>
          <th class="table_small_col">#</th>
          <th class="table_extra_large_col">Thumbnail</th>
          <th class="table_extra_large_col <?php 
        if ($image_order_by == 'filename') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('task', '');
                        spider_set_input_value('image_order_by', 'filename');
                        spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['image_order_by']) && esc_html(stripslashes($_POST['image_order_by'])) == 'filename' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                        spider_ajax_save('galleries_form');">
              <span>Filename</span><span class="sorting-indicator"></span>
            </a>
          </th>
          <th class="table_extra_large_col <?php 
        if ($image_order_by == 'alt') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('task', '');
                        spider_set_input_value('image_order_by', 'alt');
                        spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['image_order_by']) && esc_html(stripslashes($_POST['image_order_by'])) == 'alt' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                        spider_ajax_save('galleries_form');">
              <span>Alt/Title</span><span class="sorting-indicator"></span>
            </a>
          </th>
          <th class="table_extra_large_col <?php 
        if ($image_order_by == 'description') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('task', '');
                        spider_set_input_value('image_order_by', 'description');
                        spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['image_order_by']) && esc_html(stripslashes($_POST['image_order_by'])) == 'description' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                        spider_ajax_save('galleries_form');">
              <span>Description</span><span class="sorting-indicator"></span>
            </a>
          </th>
          <th class="table_extra_large_col">Tags</th>
          <th id="th_order" class="table_medium_col <?php 
        if ($image_order_by == 'order') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('task', '');
                        spider_set_input_value('image_order_by', 'order');
                        spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['image_order_by']) && esc_html(stripslashes($_POST['image_order_by'])) == 'order' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                        spider_ajax_save('galleries_form');">
              <span>Order</span><span class="sorting-indicator"></span>
            </a>
          </th>
          <th class="table_big_col <?php 
        if ($image_order_by == 'published') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('task', '');
                        spider_set_input_value('image_order_by', 'published');
                        spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['image_order_by']) && esc_html(stripslashes($_POST['image_order_by'])) == 'published' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                        spider_ajax_save('galleries_form');">
              <span>Published</span><span class="sorting-indicator"></span>
            </a>
          </th>
          <th class="table_big_col">Delete</th>
        </thead>
        <tbody id="tbody_arr">
          <?php 
        $i = ($page_number - 1) * 20;
        if ($rows_data) {
            foreach ($rows_data as $row_data) {
                $alternate = !isset($alternate) || $alternate == 'class="alternate"' ? '' : 'class="alternate"';
                $rows_tag_data = $this->model->get_tag_rows_data($row_data->id);
                $published_image = $row_data->published ? 'publish' : 'unpublish';
                $published = $row_data->published ? 'unpublish' : 'publish';
                ?>
              <tr id="tr_<?php 
                echo $row_data->id;
                ?>
" <?php 
                echo $alternate;
                ?>
>
                <td class="connectedSortable table_small_col"><div title="Drag to re-order" class="handle" style="margin:5px auto 0 auto;"></div></td>
                <td class="table_small_col check-column"><input id="check_<?php 
                echo $row_data->id;
                ?>
" name="check_<?php 
                echo $row_data->id;
                ?>
" onclick="spider_check_all(this)" type="checkbox" /></td>
                <td class="table_small_col"><?php 
                echo ++$i;
                ?>
</td>
                <td class="table_extra_large_col">
                  <a class="thickbox thickbox-preview" title="<?php 
                echo $row_data->filename;
                ?>
" href="<?php 
                echo add_query_arg(array('action' => 'editThumb', 'type' => 'display', 'image_id' => $row_data->id, 'width' => '800', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
                ?>
">
                    <img id="image_thumb_<?php 
                echo $row_data->id;
                ?>
" class="thumb" src="<?php 
                echo site_url() . '/' . $WD_BWG_UPLOAD_DIR . $row_data->thumb_url . '?date=' . date('Y-m-y H:i:s');
                ?>
">
                  </a>
                </td>
                <td class="table_extra_large_col">
                  <div class="filename" id="filename_<?php 
                echo $row_data->id;
                ?>
">
                    <strong><a title="<?php 
                echo $row_data->filename;
                ?>
" class="spider_word_wrap thickbox thickbox-preview" href="<?php 
                echo add_query_arg(array('action' => 'editThumb', 'type' => 'display', 'image_id' => $row_data->id, 'width' => '800', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
                ?>
"><?php 
                echo $row_data->filename;
                ?>
</a></strong>
                  </div>
                  <div class="fileDescription" title="Date modified" id="date_modified_<?php 
                echo $row_data->id;
                ?>
"><?php 
                echo date("d F Y, H:i", strtotime($row_data->date));
                ?>
</div>
                  <div class="fileDescription" title="Image Resolution" id="fileresolution_<?php 
                echo $row_data->id;
                ?>
"><?php 
                echo $row_data->resolution;
                ?>
</div>
                  <div class="fileDescription" title="Image size" id="filesize_<?php 
                echo $row_data->id;
                ?>
"><?php 
                echo $row_data->size;
                ?>
</div>
                  <div class="fileDescription" title="Image type" id="filetype_<?php 
                echo $row_data->id;
                ?>
"><?php 
                echo $row_data->filetype;
                ?>
</div>
                  <div>
                    <span class="edit_thumb"><a class="thickbox thickbox-preview" href="<?php 
                echo add_query_arg(array('action' => 'editThumb', 'type' => 'crop', 'image_id' => $row_data->id, 'TB_iframe' => '1', 'width' => '800', 'height' => '500'), admin_url('admin-ajax.php'));
                ?>
">Crop</a></span> | 
                    <span class="edit_thumb"><a class="thickbox thickbox-preview" href="<?php 
                echo add_query_arg(array('action' => 'editThumb', 'type' => 'rotate', 'image_id' => $row_data->id, 'width' => '800', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
                ?>
">Rotate</a></span> | 
                    <span class="edit_thumb"><a onclick="if (confirm('Do you want to reset the image?')) {
                                                          spider_set_input_value('ajax_task', 'recover');
                                                          spider_set_input_value('image_current_id', '<?php 
                echo $row_data->id;
                ?>
');
                                                          spider_ajax_save('galleries_form');
                                                         }
                                                         return false;">Reset</a></span>
                  </div>
                  <input type="hidden" id="image_url_<?php 
                echo $row_data->id;
                ?>
" name="image_url_<?php 
                echo $row_data->id;
                ?>
" value="<?php 
                echo $row_data->image_url;
                ?>
" />
                  <input type="hidden" id="thumb_url_<?php 
                echo $row_data->id;
                ?>
" name="thumb_url_<?php 
                echo $row_data->id;
                ?>
" value="<?php 
                echo $row_data->thumb_url;
                ?>
" />
                  <input type="hidden" id="input_filename_<?php 
                echo $row_data->id;
                ?>
" name="input_filename_<?php 
                echo $row_data->id;
                ?>
" value="<?php 
                echo $row_data->filename;
                ?>
" />
                  <input type="hidden" id="input_date_modified_<?php 
                echo $row_data->id;
                ?>
" name="input_date_modified_<?php 
                echo $row_data->id;
                ?>
" value="<?php 
                echo $row_data->date;
                ?>
" />
                  <input type="hidden" id="input_resolution_<?php 
                echo $row_data->id;
                ?>
" name="input_resolution_<?php 
                echo $row_data->id;
                ?>
" value="<?php 
                echo $row_data->resolution;
                ?>
" />
                  <input type="hidden" id="input_size_<?php 
                echo $row_data->id;
                ?>
" name="input_size_<?php 
                echo $row_data->id;
                ?>
" value="<?php 
                echo $row_data->size;
                ?>
" />
                  <input type="hidden" id="input_filetype_<?php 
                echo $row_data->id;
                ?>
" name="input_filetype_<?php 
                echo $row_data->id;
                ?>
" value="<?php 
                echo $row_data->filetype;
                ?>
" />
                </td>
                <td class="table_extra_large_col">
                  <input size="24" type="text" id="image_alt_text_<?php 
                echo $row_data->id;
                ?>
" name="image_alt_text_<?php 
                echo $row_data->id;
                ?>
" value="<?php 
                echo $row_data->alt;
                ?>
" />
                </td>
                <td class="table_extra_large_col">
                  <textarea cols="20" rows="2" id="image_description_<?php 
                echo $row_data->id;
                ?>
" name="image_description_<?php 
                echo $row_data->id;
                ?>
" style="resize:vertical;"><?php 
                echo $row_data->description;
                ?>
</textarea>
                </td>
                <td class="table_extra_large_col">
                  <a href="<?php 
                echo add_query_arg(array('action' => 'addTags', 'image_id' => $row_data->id, 'width' => '650', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
                ?>
" class="button button-small button-primary thickbox thickbox-preview">Add tag</a>
                  <div class="tags_div" id="tags_div_<?php 
                echo $row_data->id;
                ?>
">
                  <?php 
                $tags_id_string = '';
                if ($rows_tag_data) {
                    foreach ($rows_tag_data as $row_tag_data) {
                        ?>
                      <div class="tag_div" id="<?php 
                        echo $row_data->id;
                        ?>
_tag_<?php 
                        echo $row_tag_data->term_id;
                        ?>
">
                        <span class="tag_name"><?php 
                        echo $row_tag_data->name;
                        ?>
</span>
                        <span style="float:right;" class="spider_delete_img_small" onclick="bwg_remove_tag('<?php 
                        echo $row_tag_data->term_id;
                        ?>
', '<?php 
                        echo $row_data->id;
                        ?>
')" />
                      </div>
                      <?php 
                        $tags_id_string .= $row_tag_data->term_id . ',';
                    }
                }
                ?>
                  </div>
                  <input type="hidden" value="<?php 
                echo $tags_id_string;
                ?>
" id="tags_<?php 
                echo $row_data->id;
                ?>
" name="tags_<?php 
                echo $row_data->id;
                ?>
"/>
                </td>
                <td class="spider_order table_medium_col"><input id="order_input_<?php 
                echo $row_data->id;
                ?>
" name="order_input_<?php 
                echo $row_data->id;
                ?>
" type="text" size="1" value="<?php 
                echo $row_data->order;
                ?>
" /></td>
                <td class="table_big_col"><a onclick="spider_set_input_value('ajax_task', 'image_<?php 
                echo $published;
                ?>
');
                                                      spider_set_input_value('image_current_id', '<?php 
                echo $row_data->id;
                ?>
');
                                                      spider_ajax_save('galleries_form');"><img src="<?php 
                echo WD_BWG_URL . '/images/' . $published_image . '.png';
                ?>
"></img></a></td>
                <td class="table_big_col"><a onclick="spider_set_input_value('ajax_task', 'image_delete');
                                                      spider_set_input_value('image_current_id', '<?php 
                echo $row_data->id;
                ?>
');
                                                      spider_ajax_save('galleries_form');">Delete</a></td>
              </tr>
              <?php 
                $ids_string .= $row_data->id . ',';
            }
        }
        ?>
          <input id="ids_string" name="ids_string" type="hidden" value="<?php 
        echo $ids_string;
        ?>
" />
          <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="asc" />
          <input id="image_order_by" name="image_order_by" type="hidden" value="<?php 
        echo $image_order_by;
        ?>
" />
          <input id="ajax_task" name="ajax_task" type="hidden" value="" />
          <input id="image_current_id" name="image_current_id" type="hidden" value="" />
        </tbody>
      </table>
      <script>
        window.onload = spider_show_hide_weights;
      </script>
    <?php 
    }
    public function display()
    {
        $album_id = isset($_GET['album_id']) ? esc_html(stripslashes($_GET['album_id'])) : (isset($_POST['album_id']) ? esc_html(stripslashes($_POST['album_id'])) : '');
        $rows_data = $this->model->get_rows_data($album_id);
        $page_nav = $this->model->page_nav($album_id);
        $search_value = isset($_POST['search_value']) ? esc_html(stripslashes($_POST['search_value'])) : '';
        $asc_or_desc = isset($_POST['asc_or_desc']) ? esc_html(stripslashes($_POST['asc_or_desc'])) : 'asc';
        $order_by = isset($_POST['order_by']) ? esc_html(stripslashes($_POST['order_by'])) : 'name';
        $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
        $per_page = $this->model->per_page();
        $pager = 0;
        wp_print_scripts('jquery');
        wp_print_scripts('wp-pointer');
        wp_print_styles('admin-bar');
        wp_print_styles('dashicons');
        wp_print_styles('wp-admin');
        wp_print_styles('buttons');
        wp_print_styles('wp-auth-check');
        wp_print_styles('wp-pointer');
        if (get_bloginfo('version') < '3.9') {
            ?>
    <link media="all" type="text/css" href="<?php 
            echo get_admin_url();
            ?>
css/colors<?php 
            echo get_bloginfo('version') < '3.8' ? '-fresh' : '';
            ?>
.min.css" id="colors-css" rel="stylesheet">
    <?php 
        }
        ?>
    <link media="all" type="text/css" href="<?php 
        echo WD_BWG_URL . '/css/bwg_tables.css?ver=' . wd_bwg_version();
        ?>
" id="spider_audio_player_tables-css" rel="stylesheet">
    <script src="<?php 
        echo WD_BWG_URL . '/js/bwg.js?ver=' . wd_bwg_version();
        ?>
" type="text/javascript"></script>
    <form class="wrap wp-core-ui bwg_form" id="albums_galleries_form" method="post" action="<?php 
        echo add_query_arg(array('action' => 'addAlbumsGalleries', 'width' => '700', 'height' => '550', 'callback' => 'bwg_add_items', 'bwg_items_per_page' => $per_page, 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
        ?>
" style="width:95%; margin: 0 auto;">
      <?php 
        wp_nonce_field('addAlbumsGalleries', 'bwg_nonce');
        ?>
      <h2 style="width:200px;float:left"><?php 
        _e("Albums/Galleries", 'bwg_back');
        ?>
</h2>
      <a href="" class="thickbox thickbox-preview" id="content-add_media" title="Add Album/Gallery" onclick="spider_get_items(event);" style="float:right; padding: 9px 0px 4px 0">
        <img id='add_albums' src="<?php 
        echo WD_BWG_URL . '/images/add_but.png';
        ?>
" style="border:none;" />
      </a>
      <div class="tablenav top">
        <?php 
        WDWLibrary::search(__("Name", 'bwg_back'), $search_value, 'albums_galleries_form');
        WDWLibrary::html_page_nav($page_nav['total'], $pager++, $page_nav['limit'], 'albums_galleries_form', $per_page);
        ?>
      </div>
      <table class="wp-list-table widefat fixed pages">
        <thead>
          <th class="manage-column column-cb check-column table_small_col"><input id="check_all" type="checkbox" style="margin:0;" /></th>
          <th class="table_small_col <?php 
        if ($order_by == 'id') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('order_by', 'id');
                        spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == 'id' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                        spider_form_submit(event, 'albums_galleries_form')" href="">
              <span>ID</span><span class="sorting-indicator"></span>
            </a>
          </th>
          <th class="table_medium_col_uncenter <?php 
        if ($order_by == 'is_album') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('task', '');
                        spider_set_input_value('order_by', 'is_album');
                        spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == 'is_album' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                        spider_form_submit(event, 'albums_galleries_form')" href="">
              <span><?php 
        _e("Type", 'bwg_back');
        ?>
</span><span class="sorting-indicator"></span>
            </a>
          </th>
          <th class="<?php 
        if ($order_by == 'name') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('order_by', 'name');
                        spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == 'name' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                        spider_form_submit(event, 'albums_galleries_form')" href="">
              <span><?php 
        _e("Name", 'bwg_back');
        ?>
</span><span class="sorting-indicator"></span>
            </a>
          </th>          
        </thead>
        <tbody id="tbody_albums_galleries">
          <?php 
        if ($rows_data) {
            $iterator = 0;
            foreach ($rows_data as $row_data) {
                $alternate = !isset($alternate) || $alternate == 'class="alternate"' ? '' : 'class="alternate"';
                ?>
              <tr id="tr_<?php 
                echo $iterator;
                ?>
" <?php 
                echo $alternate;
                ?>
>
                <td class="table_small_col check-column"><input id="check_<?php 
                echo $iterator;
                ?>
" name="check_<?php 
                echo $iterator;
                ?>
" type="checkbox" /></td>
                <td id="id_<?php 
                echo $iterator;
                ?>
" class="table_small_col"><?php 
                echo $row_data->id;
                ?>
</td>
                <td id="url_<?php 
                echo $iterator;
                ?>
" class="table_medium_col_uncenter"><?php 
                echo $row_data->is_album ? __("Album", 'bwg_back') : __("Gallery", 'bwg_back');
                ?>
</td>
                <td>
                  <a onclick="window.parent.bwg_add_items(['<?php 
                echo $row_data->id;
                ?>
'],['<?php 
                echo htmlspecialchars(addslashes($row_data->name));
                ?>
'], ['<?php 
                echo htmlspecialchars(addslashes($row_data->is_album));
                ?>
'])" id="a_<?php 
                echo $iterator;
                ?>
" style="cursor:pointer;">
                    <?php 
                echo $row_data->name;
                ?>
                  </a>
                </td>
              </tr>
              <?php 
                $iterator++;
            }
        }
        ?>
        </tbody>
      </table>
      <div class="tablenav bottom">
        <?php 
        WDWLibrary::html_page_nav($page_nav['total'], $pager++, $page_nav['limit'], 'albums_galleries_form', $per_page);
        ?>
      </div>
      <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="asc" />
      <input id="order_by" name="order_by" type="hidden" value="<?php 
        echo $order_by;
        ?>
" />
      <input id="album_id" name="album_id" type="hidden" value="<?php 
        echo $album_id;
        ?>
" />
    </form>
    <script src="<?php 
        echo get_admin_url();
        ?>
load-scripts.php?c=1&load%5B%5D=common,admin-bar" type="text/javascript"></script>
    <?php 
        include_once WD_BWG_DIR . '/includes/bwg_pointers.php';
        new BWG_pointers();
        die;
    }
 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) {
         $message = 7;
     } 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);
 }
예제 #22
0
    public function display()
    {
        global $WD_BWG_UPLOAD_DIR;
        $rows_data = $this->model->get_rows_data();
        $page_nav = $this->model->page_nav();
        $search_value = isset($_POST['search_value']) ? esc_html(stripslashes($_POST['search_value'])) : '';
        $search_select_value = isset($_POST['search_select_value']) ? (int) $_POST['search_select_value'] : 0;
        $asc_or_desc = isset($_POST['asc_or_desc']) ? esc_html(stripslashes($_POST['asc_or_desc'])) : 'asc';
        $order_by = isset($_POST['order_by']) ? esc_html(stripslashes($_POST['order_by'])) : 'order';
        $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
        $ids_string = '';
        $per_page = $this->model->per_page();
        $pager = 0;
        ?>
    <div style="clear: both; float: left; width: 99%;">
      <div style="float:left; font-size: 14px; font-weight: bold;">
        This section allows you to create, edit and delete albums.
        <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-gallery-guide-step-4.html">Read More in User Manual</a>
      </div>
      <div style="float: right; text-align: right;">
        <a style="text-decoration: none;" target="_blank" href="http://web-dorado.com/products/wordpress-photo-gallery-plugin.html">
          <img width="215" border="0" alt="web-dorado.com" src="<?php 
        echo WD_BWG_URL . '/images/logo.png';
        ?>
" />
        </a>
      </div>
    </div>
    <form class="wrap" id="albums_form" method="post" action="admin.php?page=albums_bwg" style="float: left; width:99%;">
    <?php 
        wp_nonce_field('albums_bwg', 'bwg_nonce');
        ?>
      <span class="album-icon"></span>
      <h2>
        Albums
        <a href="" class="add-new-h2" onclick="spider_set_input_value('task', 'add');
                                               spider_form_submit(event, 'albums_form')">Add new</a>
      </h2>
      <div id="draganddrop" class="updated" style="display:none;"><strong><p>Changes made in this table should be saved.</p></strong></div>
      <div class="buttons_div">
        <span class="button-secondary non_selectable" onclick="spider_check_all_items()">
          <input type="checkbox" id="check_all_items" name="check_all_items" onclick="spider_check_all_items_checkbox()" style="margin: 0; vertical-align: middle;" />
          <span style="vertical-align: middle;">Select All</span>
        </span>
        <input id="show_hide_weights"  class="button-secondary" type="button" onclick="spider_show_hide_weights();return false;" value="Hide order column" />
        <input class="button-secondary" type="submit" onclick="spider_set_input_value('task', 'save_order')" value="Save Order" />
        <input class="button-secondary" type="submit" onclick="spider_set_input_value('task', 'publish_all')" value="Publish" />
        <input class="button-secondary" type="submit" onclick="spider_set_input_value('task', 'unpublish_all')" value="Unpublish" />
        <input class="button-secondary" type="submit" onclick="if (confirm('Do you want to delete selected items?')) {
                                                       spider_set_input_value('task', 'delete_all');
                                                     } else {
                                                       return false;
                                                     }" value="Delete" />
      </div>
      <div class="tablenav top">
        <?php 
        WDWLibrary::search('Name', $search_value, 'albums_form');
        WDWLibrary::html_page_nav($page_nav['total'], $pager++, $page_nav['limit'], 'albums_form', $per_page);
        ?>
      </div>
      <table class="wp-list-table widefat fixed pages">
        <thead>
          <th class="table_small_col"></th>
          <th class="manage-column column-cb check-column table_small_col"><input id="check_all" onclick="spider_check_all(this)" type="checkbox" style="margin:0;" /></th>
          <th class="table_small_col <?php 
        if ($order_by == 'id') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('task', '');
                        spider_set_input_value('order_by', 'id');
                        spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == 'id' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                        spider_form_submit(event, 'albums_form')" href="">
              <span>ID</span><span class="sorting-indicator"></span>
            </a>
          </th>          
          <th class="<?php 
        if ($order_by == 'name') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('task', '');
                        spider_set_input_value('order_by', 'name');
                        spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == 'name' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                        spider_form_submit(event, 'albums_form')" href="">
              <span>Name</span><span class="sorting-indicator"></span>
            </a>
          </th>
          <th class="<?php 
        if ($order_by == 'slug') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('task', '');
                        spider_set_input_value('order_by', 'slug');
                        spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == 'slug' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                        spider_form_submit(event, 'albums_form')" href="">
              <span>Slug</span><span class="sorting-indicator"></span>
            </a>
          </th>
          <th class="table_extra_large_col">Thumbnail</th>
          <th id="th_order" class="table_medium_col <?php 
        if ($order_by == 'order') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('task', '');
                        spider_set_input_value('order_by', 'order');
                        spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == 'order' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                        spider_form_submit(event, 'albums_form')" href="">
              <span>Order</span><span class="sorting-indicator"></span>
            </a>
          </th>
          <th class="<?php 
        if ($order_by == 'display_name') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('task', '');
                        spider_set_input_value('order_by', 'display_name');
                        spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == 'display_name' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                        spider_form_submit(event, 'albums_form')" href="">
              <span>Author</span><span class="sorting-indicator"></span>
            </a>
          </th>
          <th class="table_big_col <?php 
        if ($order_by == 'published') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('task', '');
                        spider_set_input_value('order_by', 'published');
                        spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == 'published' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                        spider_form_submit(event, 'albums_form')" href="">
              <span>Published</span><span class="sorting-indicator"></span>
            </a>
          </th>
          <th class="table_big_col">Edit</th>
          <th class="table_big_col">Delete</th>
        </thead>
        <tbody id="tbody_arr">
          <?php 
        if ($rows_data) {
            foreach ($rows_data as $row_data) {
                $alternate = !isset($alternate) || $alternate == 'class="alternate"' ? '' : 'class="alternate"';
                $published_image = $row_data->published ? 'publish' : 'unpublish';
                $published = $row_data->published ? 'unpublish' : 'publish';
                if ($row_data->preview_image == '') {
                    $preview_image = WD_BWG_URL . '/images/no-image.png';
                } else {
                    $preview_image = site_url() . '/' . $WD_BWG_UPLOAD_DIR . $row_data->preview_image;
                }
                ?>
              <tr id="tr_<?php 
                echo $row_data->id;
                ?>
" <?php 
                echo $alternate;
                ?>
>
                <td class="connectedSortable table_small_col"><div class="handle" style="margin:5px auto 0 auto;" title="Drag to re-order"></div></td>
                <td class="table_small_col check-column"><input id="check_<?php 
                echo $row_data->id;
                ?>
" name="check_<?php 
                echo $row_data->id;
                ?>
" onclick="spider_check_all(this)" type="checkbox" /></td>
                <td class="table_small_col"><?php 
                echo $row_data->id;
                ?>
</td>                
                <td><a onclick="spider_set_input_value('task', 'edit');
                                spider_set_input_value('current_id', '<?php 
                echo $row_data->id;
                ?>
');
                                spider_form_submit(event, 'albums_form')" href="" title="Edit"><?php 
                echo $row_data->name;
                ?>
</a></td>
                <td><?php 
                echo $row_data->slug;
                ?>
</td>                
                <td class="table_extra_large_col">
                  <img title="<?php 
                echo $row_data->name;
                ?>
" style="border: 1px solid #CCCCCC; max-width:60px; max-height:60px;" src="<?php 
                echo $preview_image;
                ?>
">
                </td>
                <td class="spider_order table_medium_col"><input id="order_input_<?php 
                echo $row_data->id;
                ?>
" name="order_input_<?php 
                echo $row_data->id;
                ?>
" type="text" size="1" value="<?php 
                echo $row_data->order;
                ?>
" /></td>
                <td><?php 
                echo get_userdata($row_data->author)->display_name;
                ?>
</td>
                <td class="table_big_col"><a onclick="spider_set_input_value('task', '<?php 
                echo $published;
                ?>
');spider_set_input_value('current_id', '<?php 
                echo $row_data->id;
                ?>
');spider_form_submit(event, 'albums_form')" href=""><img src="<?php 
                echo WD_BWG_URL . '/images/' . $published_image . '.png';
                ?>
"></img></a></td>
                <td class="table_big_col"><a onclick="spider_set_input_value('task', 'edit');
                                                      spider_set_input_value('current_id', '<?php 
                echo $row_data->id;
                ?>
');
                                                      spider_form_submit(event, 'albums_form')" href="">Edit</a></td>
                <td class="table_big_col"><a onclick="spider_set_input_value('task', 'delete');
                                                      spider_set_input_value('current_id', '<?php 
                echo $row_data->id;
                ?>
');
                                                      spider_form_submit(event, 'albums_form')" href="">Delete</a></td>
              </tr>
              <?php 
                $ids_string .= $row_data->id . ',';
            }
        }
        ?>
        </tbody>
      </table>
      <div class="tablenav bottom">
        <?php 
        WDWLibrary::html_page_nav($page_nav['total'], $pager++, $page_nav['limit'], 'albums_form', $per_page);
        ?>
      </div>
      <input id="task" name="task" type="hidden" value="" />
      <input id="current_id" name="current_id" type="hidden" value="" />
      <input id="ids_string" name="ids_string" type="hidden" value="<?php 
        echo $ids_string;
        ?>
" />
      <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="asc" />
      <input id="order_by" name="order_by" type="hidden" value="<?php 
        echo $order_by;
        ?>
" />
      <script>
        window.onload = spider_show_hide_weights;
      </script>
    </form>
    <?php 
    }
예제 #23
0
    public function display()
    {
        $rows_data = $this->model->get_rows_data();
        $page_nav = $this->model->page_nav();
        $search_value = isset($_POST['search_value']) ? esc_html(stripslashes($_POST['search_value'])) : '';
        $asc_or_desc = isset($_POST['asc_or_desc']) ? esc_html(stripslashes($_POST['asc_or_desc'])) : 'asc';
        $order_by = isset($_POST['order_by']) ? esc_html(stripslashes($_POST['order_by'])) : 'A.term_id';
        $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
        $ids_string = '';
        $per_page = $this->model->per_page();
        $pager = 0;
        $query_url = wp_nonce_url(admin_url('admin-ajax.php'), '', 'bwg_nonce');
        $query_url = add_query_arg(array('action' => ''), $query_url);
        ?>
    <script>
      var ajax_url = "<?php 
        echo $query_url;
        ?>
"
    </script>
    <div style="clear: both; float: left; width: 99%;">
      <div style="float:left; font-size: 14px; font-weight: bold;">
        <?php 
        _e("This section allows you to create, edit and delete tags.", 'bwg_back');
        ?>
        <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-gallery-guide-step-3.html"><?php 
        _e("Read More in User Manual", 'bwg_back');
        ?>
</a>
      </div>
      <div style="float: right; text-align: right;">
        <a style="text-decoration: none;" target="_blank" href="https://web-dorado.com/files/fromPhotoGallery.php">
          <img width="215" border="0" alt="web-dorado.com" src="<?php 
        echo WD_BWG_URL . '/images/logo.png';
        ?>
" />
        </a>
      </div>
    </div>
    <div id="wordpress_message_1" style="width:99%;display:none"><div id="wordpress_message_2" class="updated"><p><strong><?php 
        _e("Item Succesfully Saved.", 'bwg_back');
        ?>
</strong></p></div></div>
    <form class="wrap" id="tags_form" method="post" action="admin.php?page=tags_bwg" style="float:left; width: 99%;">
      <?php 
        wp_nonce_field('tags_bwg', 'bwg_nonce');
        ?>
      <span class="tag_icon"></span>
      <h2><?php 
        _e("Tags", 'bwg_back');
        ?>
</h2>
      <div class="buttons_div">
        <input class="button-secondary" type="submit" value="<?php 
        _e("Save", 'bwg_back');
        ?>
" onclick="if (confirm('Do you want to save items?')){
                                                                    spider_set_input_value('task', 'edit_tags');
                                                                  } else {
                                                                    return false;
                                                                  }" />
        <input class="button-secondary" type="submit" value="<?php 
        _e("Delete", 'bwg_back');
        ?>
" onclick="if (confirm('Do you want to delete selected items?')) {
                                                                      spider_set_input_value('task', 'delete_all');
                                                                    } else {
                                                                      return false;
                                                                    }" />
      </div>
      <div class="tablenav top">
        <?php 
        WDWLibrary::search(__("Name", 'bwg_back'), $search_value, 'tags_form');
        WDWLibrary::html_page_nav($page_nav['total'], $pager++, $page_nav['limit'], 'tags_form', $per_page);
        ?>
      </div>
      <table class="wp-list-table widefat fixed pages">
        <thead>
          <tr>
            <th class="manage-column column-cb check-column table_small_col"><input id="check_all" type="checkbox" style="margin:0;" /></th>
            <th class="table_small_col <?php 
        if ($order_by == 'A.term_id') {
            echo $order_class;
        }
        ?>
">
              <a onclick="spider_set_input_value('task', '');
                          spider_set_input_value('order_by', 'A.term_id');
                          spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == 'A.term_id' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                          spider_form_submit(event, 'tags_form')" href="">
                <span>ID</span><span class="sorting-indicator"></span></th>
              </a>
            <th class="<?php 
        if ($order_by == 'A.name') {
            echo $order_class;
        }
        ?>
">
              <a onclick="spider_set_input_value('task', '');
                          spider_set_input_value('order_by', 'A.name');
                          spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == 'A.name' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                          spider_form_submit(event, 'tags_form')" href="">
                <span><?php 
        _e("Name", 'bwg_back');
        ?>
</span><span class="sorting-indicator"></span>
              </a>
            </th>
            <th class="<?php 
        if ($order_by == 'A.slug') {
            echo $order_class;
        }
        ?>
">
              <a onclick="spider_set_input_value('task', '');
                          spider_set_input_value('order_by', 'A.slug');
                          spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == 'A.slug' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                          spider_form_submit(event, 'tags_form')" href="">
                <span><?php 
        _e("Slug", 'bwg_back');
        ?>
</span><span class="sorting-indicator"></span>
              </a>
            </th>
            <th class="<?php 
        if ($order_by == 'B.count') {
            echo $order_class;
        }
        ?>
 table_big_col ">
              <a onclick="spider_set_input_value('task', '');
                          spider_set_input_value('order_by', 'B.count');
                          spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == 'B.count' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                          spider_form_submit(event, 'tags_form')" href="">
                <span><?php 
        _e("Count", 'bwg_back');
        ?>
</span><span class="sorting-indicator"></span>
              </a>
            </th>
            <th class="table_big_col"><?php 
        _e("Edit", 'bwg_back');
        ?>
</th>
            <th class="table_big_col"><?php 
        _e("Delete", 'bwg_back');
        ?>
</th>
          </tr>		  
          <tr id="tr">
            <th></th>
            <th></th>
            <th class="edit_input">
              <input class="input_th" name="tagname" type="text" value="">
            </th>
            <th class="edit_input">
              <input class="input_th" name="slug" type="text" value="">
            </th>
            <th></th>
            <th class="table_big_col">
              <a class="add_tag_th button-primary button button-small" onclick="spider_set_input_value('task', 'save');
                                                                                spider_set_input_value('current_id', '');
                                                                                spider_form_submit(event, 'tags_form')" href=""><?php 
        _e("Add Tag", 'bwg_back');
        ?>
 </a>
            </th>
            <th></th>
          </tr>
        </thead>
        <tbody id="tbody_arr">
          <?php 
        if ($rows_data) {
            foreach ($rows_data as $row_data) {
                $alternate = !isset($alternate) || $alternate == 'class="alternate"' ? '' : 'class="alternate"';
                ?>
              <tr id="tr_<?php 
                echo $row_data->term_id;
                ?>
" <?php 
                echo $alternate;
                ?>
>
                <td class="table_small_col check-column" id="td_check_<?php 
                echo $row_data->term_id;
                ?>
" ><input id="check_<?php 
                echo $row_data->term_id;
                ?>
" name="check_<?php 
                echo $row_data->term_id;
                ?>
" type="checkbox" /></td>
                <td class="table_small_col" id="td_id_<?php 
                echo $row_data->term_id;
                ?>
" ><?php 
                echo $row_data->term_id;
                ?>
</td>
                <td id="td_name_<?php 
                echo $row_data->term_id;
                ?>
" >
                  <a class="pointer" id="name<?php 
                echo $row_data->term_id;
                ?>
"
                     onclick="edit_tag(<?php 
                echo $row_data->term_id;
                ?>
)" 
                     title="<?php 
                _e("Edit", 'bwg_back');
                ?>
"><?php 
                echo $row_data->name;
                ?>
</a>
                </td>
                <td id="td_slug_<?php 
                echo $row_data->term_id;
                ?>
">
                  <a class="pointer"
                     id="slug<?php 
                echo $row_data->term_id;
                ?>
"
                     onclick="edit_tag(<?php 
                echo $row_data->term_id;
                ?>
)" 
                     title="<?php 
                _e("Edit", 'bwg_back');
                ?>
"><?php 
                echo $row_data->slug;
                ?>
</a>
                </td>
                <td class="table_big_col" id="td_count_<?php 
                echo $row_data->term_id;
                ?>
" >
                  <a class="pointer"
                     id="count<?php 
                echo $row_data->term_id;
                ?>
"
                     onclick="edit_tag(<?php 
                echo $row_data->term_id;
                ?>
)"
                     title="<?php 
                _e("Edit", 'bwg_back');
                ?>
"><?php 
                echo $this->model->get_count_of_images($row_data->term_id);
                ?>
</a>
                </td>
                <td class="table_big_col" id="td_edit_<?php 
                echo $row_data->term_id;
                ?>
">
                  <a onclick="edit_tag(<?php 
                echo $row_data->term_id;
                ?>
)"><?php 
                _e("Edit", 'bwg_back');
                ?>
</a>
                </td>
                <td class="table_big_col" id="td_delete_<?php 
                echo $row_data->term_id;
                ?>
">
                  <a onclick="spider_set_input_value('task', 'delete');
                              spider_set_input_value('current_id', <?php 
                echo $row_data->term_id;
                ?>
);
                              spider_form_submit(event, 'tags_form')" href=""><?php 
                _e("Delete", 'bwg_back');
                ?>
</a>
                </td>
              </tr>
              <?php 
                $ids_string .= $row_data->term_id . ',';
            }
        }
        ?>
        </tbody>
      </table>
      <div class="tablenav bottom">
        <?php 
        WDWLibrary::html_page_nav($page_nav['total'], $pager++, $page_nav['limit'], 'tags_form', $per_page);
        ?>
      </div>
      <input id="task" name="task" type="hidden" value="" />
      <input id="current_id" name="current_id" type="hidden" value="" />
      <input id="ids_string" name="ids_string" type="hidden" value="<?php 
        echo $ids_string;
        ?>
" />
      <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="<?php 
        echo $asc_or_desc;
        ?>
" />
      <input id="order_by" name="order_by" type="hidden" value="<?php 
        echo $order_by;
        ?>
" />
    </form>
    <?php 
    }
예제 #24
0
 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();
 }
function bwg_ajax()
{
    if (function_exists('current_user_can')) {
        if (!current_user_can('manage_options')) {
            die('Access Denied');
        }
    } else {
        die('Access Denied');
    }
    global $wpdb;
    require_once WD_BWG_DIR . '/framework/WDWLibrary.php';
    $page = WDWLibrary::get('action');
    if ($page != '' && ($page == 'BWGShortcode' || $page == 'addAlbumsGalleries' || $page == 'editThumb' || $page == 'addTags')) {
        if (!WDWLibrary::verify_nonce($page) && $page != 'BWGShortcode') {
            die('Sorry, your nonce did not verify.');
        }
        require_once WD_BWG_DIR . '/admin/controllers/BWGController' . ucfirst($page) . '.php';
        $controller_class = 'BWGController' . ucfirst($page);
        $controller = new $controller_class();
        $controller->execute();
    }
}
    public function display()
    {
        $rows_data = $this->model->get_rows_data();
        $page_nav = $this->model->page_nav();
        $search_value = isset($_POST['search_value']) ? esc_html(stripslashes($_POST['search_value'])) : '';
        $asc_or_desc = isset($_POST['asc_or_desc']) ? esc_html(stripslashes($_POST['asc_or_desc'])) : 'asc';
        $order_by = isset($_POST['order_by']) ? esc_html(stripslashes($_POST['order_by'])) : 'name';
        $image_id = isset($_GET['image_id']) ? esc_html($_GET['image_id']) : (isset($_POST['image_id']) ? esc_html($_POST['image_id']) : '0');
        $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
        $per_page = $this->model->per_page();
        $pager = 0;
        wp_print_scripts('jquery');
        wp_print_styles('admin-bar');
        wp_print_styles('wp-admin');
        wp_print_styles('dashicons');
        wp_print_styles('buttons');
        wp_print_styles('wp-auth-check');
        if (get_bloginfo('version') < '3.9') {
            ?>
    <link media="all" type="text/css" href="<?php 
            echo get_admin_url();
            ?>
css/colors<?php 
            echo get_bloginfo('version') < '3.8' ? '-fresh' : '';
            ?>
.min.css" id="colors-css" rel="stylesheet">
    <?php 
        }
        ?>
    <link media="all" type="text/css" href="<?php 
        echo WD_BWG_URL . '/css/bwg_tables.css?ver=' . wd_bwg_version();
        ?>
" id="bwg_tables-css" rel="stylesheet">
    <script src="<?php 
        echo WD_BWG_URL . '/js/bwg.js?ver=' . wd_bwg_version();
        ?>
" type="text/javascript"></script>
    <form class="wrap wp-core-ui bwg_form" id="tags_form" method="post" action="<?php 
        echo add_query_arg(array('action' => 'addTags', 'width' => '650', 'height' => '500', 'bwg_items_per_page' => $per_page, 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
        ?>
" style="width:99%; margin: 0 auto;">
      <?php 
        wp_nonce_field('addTags', 'bwg_nonce');
        ?>
      <h2 style="width:200px; float:left;"><?php 
        _e("Tags", 'bwg_back');
        ?>
</h2>
      <a href="" class="thickbox thickbox-preview" id="content-add_media" title="Add Tag" onclick="bwg_get_tags('<?php 
        echo $image_id;
        ?>
', event);" style="float:right; padding: 9px 0px 4px 0">
        <div class="wd-btn wd-btn-primary wd-btn-icon wd-btn-add" style="border:none;padding-top:8px !important;">ADD </div>
      </a>
      <div class="tablenav top">
        <?php 
        WDWLibrary::search(__('Name', 'bwg_back'), $search_value, 'tags_form', 'position_search');
        WDWLibrary::html_page_nav($page_nav['total'], $pager++, $page_nav['limit'], 'tags_form', $per_page);
        ?>
      </div>
      <table class="wp-list-table widefat fixed pages">
        <thead>
          <th class="manage-column column-cb check-column table_small_col"><input id="check_all" type="checkbox" style="margin:0;" /></th>
          <th class="sortable table_small_col <?php 
        if ($order_by == 'term_id') {
            echo $order_class;
        }
        ?>
" style="padding-left:15px">
            <a onclick="spider_set_input_value('order_by', 'term_id');
                        spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == 'term_id' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                        spider_form_submit(event, 'tags_form')" href="">
              <span>ID</span><span class="sorting-indicator"></span></th>
            </a>
          <th class="sortable <?php 
        if ($order_by == 'name') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('order_by', 'name');
                        spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == 'name' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                        spider_form_submit(event, 'tags_form')" href="">
              <span><?php 
        _e("Name", 'bwg_back');
        ?>
</span><span class="sorting-indicator"></span>
            </a>
          </th>
          <th class="sortable <?php 
        if ($order_by == 'slug') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('order_by', 'slug');
                        spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == 'slug' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                        spider_form_submit(event, 'tags_form')" href="">
              <span><?php 
        _e("Slug", 'bwg_back');
        ?>
</span><span class="sorting-indicator"></span>
            </a>
          </th>
        </thead>
        <tbody id="tbody_arr">
          <?php 
        if ($rows_data) {
            foreach ($rows_data as $row_data) {
                $alternate = !isset($alternate) || $alternate == 'class="alternate"' ? '' : 'class="alternate"';
                ?>
              <tr id="tr_<?php 
                echo $row_data->term_id;
                ?>
" <?php 
                echo $alternate;
                ?>
>
                <td class="table_small_col check-column"><input id="check_<?php 
                echo $row_data->term_id;
                ?>
" name="check_<?php 
                echo $row_data->term_id;
                ?>
" type="checkbox" /></td>
                <td class="table_small_col"><?php 
                echo $row_data->term_id;
                ?>
</td>
                <td><a onclick="window.parent.bwg_add_tag('<?php 
                echo $image_id;
                ?>
', ['<?php 
                echo $row_data->term_id;
                ?>
'],['<?php 
                echo htmlspecialchars(addslashes($row_data->name));
                ?>
'])" id="a_<?php 
                echo $row_data->term_id;
                ?>
" style="cursor:pointer;"><?php 
                echo $row_data->name;
                ?>
</a></td> 
                <td id="slug_<?php 
                echo $row_data->term_id;
                ?>
"><?php 
                echo $row_data->slug ? $row_data->slug : '&nbsp;';
                ?>
</td> 
              </tr>
              <?php 
            }
        }
        ?>
        </tbody>
      </table>
      <div class="tablenav bottom">
        <?php 
        WDWLibrary::html_page_nav($page_nav['total'], $pager++, $page_nav['limit'], 'tags_form', $per_page);
        ?>
      </div>
      <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="asc" />
      <input id="order_by" name="order_by" type="hidden" value="<?php 
        echo $order_by;
        ?>
" />
      <input id="image_id" name="image_id" type="hidden" value="<?php 
        echo $image_id;
        ?>
" />
    </form>
    <script src="<?php 
        echo get_admin_url();
        ?>
load-scripts.php?c=1&load%5B%5D=common,admin-bar" type="text/javascript"></script>
    <?php 
        die;
    }
 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;
     $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';
     $built_in_watermark_opacity = isset($_POST['built_in_watermark_opacity']) ? esc_html(stripslashes($_POST['built_in_watermark_opacity'])) : 30;
     $built_in_watermark_font_size = isset($_POST['built_in_watermark_font_size']) ? esc_html(stripslashes($_POST['built_in_watermark_font_size'])) : 20;
     $built_in_watermark_font = isset($_POST['built_in_watermark_font']) ? esc_html(stripslashes($_POST['built_in_watermark_font'])) : '';
     $built_in_watermark_color = isset($_POST['built_in_watermark_color']) ? esc_html(stripslashes($_POST['built_in_watermark_color'])) : '';
     $gallery_role = isset($_POST['gallery_role']) ? esc_html(stripslashes($_POST['gallery_role'])) : 0;
     $image_right_click = isset($_POST['image_right_click']) ? esc_html(stripslashes($_POST['image_right_click'])) : 0;
     $popup_fullscreen = isset($_POST['popup_fullscreen']) ? esc_html(stripslashes($_POST['popup_fullscreen'])) : 0;
     $album_role = isset($_POST['album_role']) ? esc_html(stripslashes($_POST['album_role'])) : 0;
     $image_role = isset($_POST['image_role']) ? esc_html(stripslashes($_POST['image_role'])) : 0;
     $popup_autoplay = isset($_POST['popup_autoplay']) ? esc_html(stripslashes($_POST['popup_autoplay'])) : 0;
     $album_view_type = isset($_POST['album_view_type']) ? esc_html(stripslashes($_POST['album_view_type'])) : 'thumbnail';
     $show_search_box = isset($_POST['show_search_box']) ? esc_html(stripslashes($_POST['show_search_box'])) : 0;
     $search_box_width = isset($_POST['search_box_width']) ? esc_html(stripslashes($_POST['search_box_width'])) : 180;
     $preload_images = isset($_POST['preload_images']) ? esc_html(stripslashes($_POST['preload_images'])) : 1;
     $preload_images_count = isset($_POST['preload_images_count']) ? esc_html(stripslashes($_POST['preload_images_count'])) : 10;
     $popup_enable_info = isset($_POST['popup_enable_info']) ? esc_html(stripslashes($_POST['popup_enable_info'])) : 1;
     $popup_info_always_show = isset($_POST['popup_info_always_show']) ? esc_html(stripslashes($_POST['popup_info_always_show'])) : 0;
     $popup_enable_rate = isset($_POST['popup_enable_rate']) ? esc_html(stripslashes($_POST['popup_enable_rate'])) : 0;
     $thumb_click_action = isset($_POST['thumb_click_action']) ? esc_html(stripslashes($_POST['thumb_click_action'])) : 'open_lightbox';
     $thumb_link_target = isset($_POST['thumb_link_target']) ? esc_html(stripslashes($_POST['thumb_link_target'])) : 1;
     $comment_moderation = isset($_POST['comment_moderation']) ? esc_html(stripslashes($_POST['comment_moderation'])) : 0;
     $popup_hit_counter = isset($_POST['popup_hit_counter']) ? esc_html(stripslashes($_POST['popup_hit_counter'])) : 0;
     $enable_ML_import = isset($_POST['enable_ML_import']) ? esc_html(stripslashes($_POST['enable_ML_import'])) : 0;
     $autoupdate_interval = isset($_POST['autoupdate_interval_hour']) && isset($_POST['autoupdate_interval_min']) ? (int) $_POST['autoupdate_interval_hour'] * 60 + (int) $_POST['autoupdate_interval_min'] : 30;
     /*minimum autoupdate interval is 1 min*/
     $autoupdate_interval = $autoupdate_interval >= 1 ? $autoupdate_interval : 1;
     $instagram_client_id = isset($_POST['instagram_client_id']) ? esc_html(stripslashes($_POST['instagram_client_id'])) : '';
     $showthumbs_name = isset($_POST['thumb_name']) ? esc_html(stripslashes($_POST['thumb_name'])) : 1;
     $show_album_name = isset($_POST['show_album_name_enable']) ? esc_html(stripslashes($_POST['show_album_name_enable'])) : 1;
     $show_image_counts = isset($_POST['show_image_counts']) ? esc_html(stripslashes($_POST['show_image_counts'])) : 0;
     $play_icon = isset($_POST['play_icon']) ? esc_html(stripslashes($_POST['play_icon'])) : 1;
     $show_masonry_thumb_description = isset($_POST['show_masonry_thumb_description']) ? esc_html(stripslashes($_POST['show_masonry_thumb_description'])) : 0;
     $popup_info_full_width = isset($_POST['popup_info_full_width']) ? esc_html(stripslashes($_POST['popup_info_full_width'])) : 0;
     $show_sort_images = isset($_POST['show_sort_images']) ? esc_html(stripslashes($_POST['show_sort_images'])) : 0;
     $enable_seo = isset($_POST['enable_seo']) ? esc_html(stripslashes($_POST['enable_seo'])) : 1;
     $autohide_lightbox_navigation = isset($_POST['autohide_lightbox_navigation']) ? esc_html(stripslashes($_POST['autohide_lightbox_navigation'])) : 1;
     $autohide_slideshow_navigation = isset($_POST['autohide_slideshow_navigation']) ? esc_html(stripslashes($_POST['autohide_slideshow_navigation'])) : 1;
     $read_metadata = isset($_POST['read_metadata']) ? esc_html(stripslashes($_POST['read_metadata'])) : 0;
     $enable_loop = isset($_POST['enable_loop']) ? esc_html(stripslashes($_POST['enable_loop'])) : 1;
     $enable_addthis = isset($_POST['enable_addthis']) ? esc_html(stripslashes($_POST['enable_addthis'])) : 0;
     $addthis_profile_id = isset($_POST['addthis_profile_id']) ? esc_html(stripslashes($_POST['addthis_profile_id'])) : '';
     $carousel_interval = isset($_POST['carousel_interval']) ? esc_html(stripslashes($_POST['carousel_interval'])) : 5;
     $carousel_width = isset($_POST['carousel_width']) ? esc_html(stripslashes($_POST['carousel_width'])) : 300;
     $carousel_height = isset($_POST['carousel_height']) ? esc_html(stripslashes($_POST['carousel_height'])) : 300;
     $carousel_image_par = isset($_POST['carousel_image_par']) ? esc_html(stripslashes($_POST['carousel_image_par'])) : 0.75;
     $carousel_image_column_number = isset($_POST['carousel_image_column_number']) ? esc_html(stripslashes($_POST['carousel_image_column_number'])) : 5;
     $carousel_enable_title = isset($_POST['carousel_enable_title']) ? esc_html(stripslashes($_POST['carousel_enable_title'])) : 0;
     $carousel_enable_autoplay = isset($_POST['carousel_enable_autoplay']) ? esc_html(stripslashes($_POST['carousel_enable_autoplay'])) : 0;
     $carousel_r_width = isset($_POST['carousel_r_width']) ? esc_html(stripslashes($_POST['carousel_r_width'])) : 800;
     $carousel_fit_containerWidth = isset($_POST['carousel_fit_containerWidth']) ? esc_html(stripslashes($_POST['carousel_fit_containerWidth'])) : 1;
     $carousel_prev_next_butt = isset($_POST['carousel_prev_next_butt']) ? esc_html(stripslashes($_POST['carousel_prev_next_butt'])) : 1;
     $carousel_play_pause_butt = isset($_POST['carousel_play_pause_butt']) ? esc_html(stripslashes($_POST['carousel_play_pause_butt'])) : 1;
     $bwg_permissions = isset($_POST['permissions']) ? esc_html(stripslashes($_POST['permissions'])) : 'manage_options';
     $facebook_app_id = isset($_POST['facebook_app_id']) ? esc_html(stripslashes($_POST['facebook_app_id'])) : '';
     $facebook_app_secret = isset($_POST['facebook_app_secret']) ? esc_html(stripslashes($_POST['facebook_app_secret'])) : '';
     $show_tag_box = isset($_POST['show_tag_box']) ? esc_html(stripslashes($_POST['show_tag_box'])) : 0;
     $show_hide_custom_post = isset($_POST['show_hide_custom_post']) ? esc_html(stripslashes($_POST['show_hide_custom_post'])) : 0;
     $show_hide_post_meta = isset($_POST['show_hide_post_meta']) ? esc_html(stripslashes($_POST['show_hide_post_meta'])) : 0;
     $save = $wpdb->update($wpdb->prefix . 'bwg_option', array('images_directory' => $images_directory, 'masonry' => $masonry, 'mosaic' => $mosaic, 'resizable_mosaic' => $resizable_mosaic, 'mosaic_total_width' => $mosaic_total_width, 'image_column_number' => $image_column_number, 'images_per_page' => $images_per_page, 'thumb_width' => $thumb_width, 'thumb_height' => $thumb_height, 'upload_thumb_width' => $upload_thumb_width, 'upload_thumb_height' => $upload_thumb_height, 'upload_img_width' => $upload_img_width, 'upload_img_height' => $upload_img_height, 'image_enable_page' => $image_enable_page, 'image_title_show_hover' => $image_title_show_hover, 'album_column_number' => $album_column_number, 'albums_per_page' => $albums_per_page, 'album_title_show_hover' => $album_title_show_hover, 'album_thumb_width' => $album_thumb_width, 'album_thumb_height' => $album_thumb_height, 'album_enable_page' => $album_enable_page, 'extended_album_height' => $extended_album_height, 'extended_album_description_enable' => $extended_album_description_enable, 'image_browser_width' => $image_browser_width, 'image_browser_title_enable' => $image_browser_title_enable, 'image_browser_description_enable' => $image_browser_description_enable, 'blog_style_width' => $blog_style_width, 'blog_style_title_enable' => $blog_style_title_enable, 'blog_style_images_per_page' => $blog_style_images_per_page, 'blog_style_enable_page' => $blog_style_enable_page, 'slideshow_type' => $slideshow_type, 'slideshow_interval' => $slideshow_interval, 'slideshow_width' => $slideshow_width, 'slideshow_height' => $slideshow_height, 'slideshow_enable_autoplay' => $slideshow_enable_autoplay, 'slideshow_enable_shuffle' => $slideshow_enable_shuffle, 'slideshow_enable_ctrl' => $slideshow_enable_ctrl, 'slideshow_enable_filmstrip' => $slideshow_enable_filmstrip, 'slideshow_filmstrip_height' => $slideshow_filmstrip_height, 'slideshow_enable_title' => $slideshow_enable_title, 'slideshow_title_position' => $slideshow_title_position, 'slideshow_title_full_width' => $slideshow_title_full_width, 'slideshow_enable_description' => $slideshow_enable_description, 'slideshow_description_position' => $slideshow_description_position, 'slideshow_enable_music' => $slideshow_enable_music, 'slideshow_audio_url' => $slideshow_audio_url, 'popup_width' => $popup_width, 'popup_height' => $popup_height, 'popup_type' => $popup_type, 'popup_interval' => $popup_interval, 'popup_enable_filmstrip' => $popup_enable_filmstrip, 'popup_filmstrip_height' => $popup_filmstrip_height, 'popup_enable_ctrl_btn' => $popup_enable_ctrl_btn, 'popup_enable_fullscreen' => $popup_enable_fullscreen, 'popup_enable_comment' => $popup_enable_comment, 'popup_enable_email' => $popup_enable_email, 'popup_enable_captcha' => $popup_enable_captcha, 'popup_enable_download' => $popup_enable_download, 'popup_enable_fullsize_image' => $popup_enable_fullsize_image, 'popup_enable_facebook' => $popup_enable_facebook, 'popup_enable_twitter' => $popup_enable_twitter, 'popup_enable_google' => $popup_enable_google, 'popup_enable_pinterest' => $popup_enable_pinterest, 'popup_enable_tumblr' => $popup_enable_tumblr, 'watermark_type' => $watermark_type, 'watermark_position' => $watermark_position, 'watermark_width' => $watermark_width, 'watermark_height' => $watermark_height, 'watermark_url' => $watermark_url, 'watermark_text' => $watermark_text, 'watermark_link' => $watermark_link, 'watermark_font_size' => $watermark_font_size, 'watermark_font' => $watermark_font, 'watermark_color' => $watermark_color, 'watermark_opacity' => $watermark_opacity, 'built_in_watermark_type' => $built_in_watermark_type, 'built_in_watermark_position' => $built_in_watermark_position, 'built_in_watermark_size' => $built_in_watermark_size, 'built_in_watermark_url' => $built_in_watermark_url, 'built_in_watermark_text' => $built_in_watermark_text, 'built_in_watermark_font_size' => $built_in_watermark_font_size, 'built_in_watermark_font' => $built_in_watermark_font, 'built_in_watermark_color' => $built_in_watermark_color, 'built_in_watermark_opacity' => $built_in_watermark_opacity, 'gallery_role' => $gallery_role, 'image_right_click' => $image_right_click, 'popup_fullscreen' => $popup_fullscreen, 'album_role' => $album_role, 'image_role' => $image_role, 'popup_autoplay' => $popup_autoplay, 'album_view_type' => $album_view_type, 'show_search_box' => $show_search_box, 'search_box_width' => $search_box_width, 'preload_images' => $preload_images, 'preload_images_count' => $preload_images_count, 'popup_enable_info' => $popup_enable_info, 'popup_info_always_show' => $popup_info_always_show, 'popup_enable_rate' => $popup_enable_rate, 'thumb_click_action' => $thumb_click_action, 'thumb_link_target' => $thumb_link_target, 'comment_moderation' => $comment_moderation, 'popup_hit_counter' => $popup_hit_counter, 'enable_ML_import' => $enable_ML_import, 'autoupdate_interval' => $autoupdate_interval, 'instagram_client_id' => $instagram_client_id, 'showthumbs_name' => $showthumbs_name, 'show_album_name' => $show_album_name, 'show_image_counts' => $show_image_counts, 'play_icon' => $play_icon, 'show_masonry_thumb_description' => $show_masonry_thumb_description, 'popup_info_full_width' => $popup_info_full_width, 'show_sort_images' => $show_sort_images, 'enable_seo' => $enable_seo, 'autohide_lightbox_navigation' => $autohide_lightbox_navigation, 'autohide_slideshow_navigation' => $autohide_slideshow_navigation, 'read_metadata' => $read_metadata, 'enable_loop' => $enable_loop, 'enable_addthis' => $enable_addthis, 'addthis_profile_id' => $addthis_profile_id, 'carousel_interval' => $carousel_interval, 'carousel_width' => $carousel_width, 'carousel_height' => $carousel_height, 'carousel_image_column_number' => $carousel_image_column_number, 'carousel_image_par' => $carousel_image_par, 'carousel_enable_title' => $carousel_enable_title, 'carousel_enable_autoplay' => $carousel_enable_autoplay, 'carousel_r_width' => $carousel_r_width, 'carousel_fit_containerWidth' => $carousel_fit_containerWidth, 'carousel_prev_next_butt' => $carousel_prev_next_butt, 'carousel_play_pause_butt' => $carousel_play_pause_butt, 'permissions' => $bwg_permissions, 'facebook_app_id' => $facebook_app_id, 'facebook_app_secret' => $facebook_app_secret, 'show_tag_box' => $show_tag_box, 'show_hide_custom_post' => $show_hide_custom_post, 'show_hide_post_meta' => $show_hide_post_meta), array('id' => 1));
     if ($save !== FALSE) {
         if ($old_images_directory && $old_images_directory != $images_directory) {
             rename(ABSPATH . $old_images_directory . '/photo-gallery', ABSPATH . $images_directory . '/photo-gallery');
         }
         if (!is_dir(ABSPATH . $images_directory . '/photo-gallery')) {
             mkdir(ABSPATH . $images_directory . '/photo-gallery', 0777);
         }
         echo WDWLibrary::message(__('Item Succesfully Saved.', 'bwg_back'), 'updated');
     } else {
         echo WDWLibrary::message('Error. Please install plugin again.', 'error');
     }
 }
 public function save_order($flag = TRUE)
 {
     global $wpdb;
     $album_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'bwg_album');
     $message = 0;
     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) {
             $message = 13;
         }
     }
     $page = WDWLibrary::get('page');
     $query_url = wp_nonce_url(admin_url('admin.php'), 'albums_bwg', 'bwg_nonce');
     $query_url = add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), $query_url);
     WDWLibrary::spider_redirect($query_url);
 }
예제 #29
0
    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';
        }
        if (!isset($params['popup_fullscreen'])) {
            $params['popup_fullscreen'] = 0;
        }
        if (!isset($params['popup_autoplay'])) {
            $params['popup_autoplay'] = 0;
        }
        if (!isset($params['order_by'])) {
            $params['order_by'] = ' asc ';
        }
        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['show_sort_images'])) {
            $params['show_sort_images'] = 0;
        }
        if (!isset($params['image_enable_page'])) {
            $params['image_enable_page'] = 1;
        }
        if (!isset($params['show_tag_box'])) {
            $params['show_tag_box'] = 0;
        }
        $from = isset($params['from']) ? esc_html($params['from']) : 0;
        $sort_direction = ' ' . $params['order_by'] . ' ';
        $options_row = $this->model->get_options_row_data();
        $placeholder = isset($options_row->placeholder) ? $options_row->placeholder : '';
        $play_icon = $options_row->play_icon;
        if ($from) {
            $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 ';
            } elseif ($params['show'] == 'first') {
                $sort_direction = ' ASC ';
            }
            $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_fullscreen'] = $options_row->popup_fullscreen;
            $params['popup_autoplay'] = $options_row->popup_autoplay;
            $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'] = urlencode($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'] = urlencode($options_row->watermark_url);
            $params['watermark_width'] = $options_row->watermark_width;
            $params['watermark_height'] = $options_row->watermark_height;
            $params['thumb_click_action'] = $options_row->thumb_click_action;
            $params['thumb_link_target'] = $options_row->thumb_link_target;
        }
        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;
                }
            }
        }
        $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;
        }
        $params['load_more_image_count'] = isset($params['load_more_image_count']) && $params['image_enable_page'] == 2 ? $params['load_more_image_count'] : $params['images_per_page'];
        $items_per_page = array('images_per_page' => $params['images_per_page'], 'load_more_image_count' => $params['load_more_image_count']);
        $image_rows = $this->model->get_image_rows_data($params, $bwg, $type, $sort_direction);
        $images_count = count($image_rows);
        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'], $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);
        $tags_rows = $this->model->get_tags_rows_data($params['gallery_id']);
        ?>
    <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 
        echo $theme_row->thumb_bg_color;
        ?>
;
        display: inline-block;
        height: <?php 
        echo $params['thumb_height'];
        ?>
px;
        margin: <?php 
        echo $theme_row->thumb_margin;
        ?>
px;
        padding: <?php 
        echo $theme_row->thumb_padding;
        ?>
px;
        opacity: <?php 
        echo number_format($theme_row->thumb_transparent / 100, 2, ".", "");
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $theme_row->thumb_transparent;
        ?>
);
        text-align: center;
        vertical-align: middle;
        <?php 
        echo $theme_row->thumb_transition ? 'transition: all 0.3s ease 0s;-webkit-transition: all 0.3s ease 0s;' : '';
        ?>
        width: <?php 
        echo $params['thumb_width'];
        ?>
px;
        z-index: 100;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_standart_thumb_spun1_<?php 
        echo $bwg;
        ?>
:hover {
        -ms-transform: <?php 
        echo $theme_row->thumb_hover_effect;
        ?>
(<?php 
        echo $theme_row->thumb_hover_effect_value;
        ?>
);
        -webkit-transform: <?php 
        echo $theme_row->thumb_hover_effect;
        ?>
(<?php 
        echo $theme_row->thumb_hover_effect_value;
        ?>
);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        -moz-backface-visibility: hidden;
        -ms-backface-visibility: hidden;
        opacity: 1;
        filter: Alpha(opacity=100);
        transform: <?php 
        echo $theme_row->thumb_hover_effect;
        ?>
(<?php 
        echo $theme_row->thumb_hover_effect_value;
        ?>
);
        z-index: 102;
        position: relative;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_standart_thumb_spun2_<?php 
        echo $bwg;
        ?>
 {
        border: <?php 
        echo $theme_row->thumb_border_width;
        ?>
px <?php 
        echo $theme_row->thumb_border_style;
        ?>
 #<?php 
        echo $theme_row->thumb_border_color;
        ?>
;
        border-radius: <?php 
        echo $theme_row->thumb_border_radius;
        ?>
;
        box-shadow: <?php 
        echo $theme_row->thumb_box_shadow;
        ?>
;
        display: inline-block;
        height: <?php 
        echo $params['thumb_height'];
        ?>
px;
        overflow: hidden;
        width: <?php 
        echo $params['thumb_width'];
        ?>
px;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_standart_thumbnails_<?php 
        echo $bwg;
        ?>
 {
        background-color: rgba(<?php 
        echo $rgb_thumbs_bg_color['red'];
        ?>
, <?php 
        echo $rgb_thumbs_bg_color['green'];
        ?>
, <?php 
        echo $rgb_thumbs_bg_color['blue'];
        ?>
, <?php 
        echo number_format($theme_row->thumb_bg_transparent / 100, 2, ".", "");
        ?>
);
        display: inline-block;
        font-size: 0;
        max-width: <?php 
        echo $params['image_column_number'] * ($params['thumb_width'] + 2 * (2 + $theme_row->thumb_margin + $theme_row->thumb_padding + $theme_row->thumb_border_width));
        ?>
px;
        text-align: <?php 
        echo $theme_row->thumb_align;
        ?>
;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_standart_thumb_<?php 
        echo $bwg;
        ?>
 {
        display: inline-block;
        text-align: center;
      }
      <?php 
        if ($params['image_title'] == 'show') {
            /* Show image title at the bottom.*/
            ?>
        #bwg_container1_<?php 
            echo $bwg;
            ?>
 #bwg_container2_<?php 
            echo $bwg;
            ?>
 .bwg_title_spun1_<?php 
            echo $bwg;
            ?>
 {
          display: block;
          margin: 0 auto;
          opacity: 1;
          filter: Alpha(opacity=100);
          text-align: center;
          width: <?php 
            echo $params['thumb_width'];
            ?>
px;
        }
        <?php 
        } elseif ($params['image_title'] == 'hover') {
            /* Show image title on hover.*/
            ?>
        #bwg_container1_<?php 
            echo $bwg;
            ?>
 #bwg_container2_<?php 
            echo $bwg;
            ?>
 .bwg_title_spun1_<?php 
            echo $bwg;
            ?>
 {
          display: table;
          height: inherit;
          left: -3000px;
          opacity: 0;
          filter: Alpha(opacity=0);
          position: absolute;
          top: 0px;
          width: inherit;
        }
        <?php 
        }
        ?>
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_standart_thumb_spun1_<?php 
        echo $bwg;
        ?>
:hover .bwg_title_spun1_<?php 
        echo $bwg;
        ?>
 {
        left: <?php 
        echo $theme_row->thumb_padding;
        ?>
px;
        top: <?php 
        echo $theme_row->thumb_padding;
        ?>
px;
        opacity: 1;
        filter: Alpha(opacity=100);
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_title_spun2_<?php 
        echo $bwg;
        ?>
 {
        color: #<?php 
        echo $theme_row->thumb_title_font_color;
        ?>
;
        display: table-cell;
        font-family: <?php 
        echo $theme_row->thumb_title_font_style;
        ?>
;
        font-size: <?php 
        echo $theme_row->thumb_title_font_size;
        ?>
px;
        font-weight: <?php 
        echo $theme_row->thumb_title_font_weight;
        ?>
;
        height: inherit;
        padding: <?php 
        echo $theme_row->thumb_title_margin;
        ?>
;
        text-shadow: <?php 
        echo $theme_row->thumb_title_shadow;
        ?>
;
        vertical-align: middle;
        width: inherit;
        word-wrap: break-word;
      }
      /*pagination styles*/
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 {
        text-align: <?php 
        echo $theme_row->page_nav_align;
        ?>
;
        font-size: <?php 
        echo $theme_row->page_nav_font_size;
        ?>
px;
        font-family: <?php 
        echo $theme_row->page_nav_font_style;
        ?>
;
        font-weight: <?php 
        echo $theme_row->page_nav_font_weight;
        ?>
;
        color: #<?php 
        echo $theme_row->page_nav_font_color;
        ?>
;
        margin: 6px 0 4px;
        display: block;
        height: 30px;
        line-height: 30px;
      }
      @media only screen and (max-width : 320px) {
        #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .displaying-num_<?php 
        echo $bwg;
        ?>
 {
          display: none;
        }
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .displaying-num_<?php 
        echo $bwg;
        ?>
 {
        font-size: <?php 
        echo $theme_row->page_nav_font_size;
        ?>
px;
        font-family: <?php 
        echo $theme_row->page_nav_font_style;
        ?>
;
        font-weight: <?php 
        echo $theme_row->page_nav_font_weight;
        ?>
;
        color: #<?php 
        echo $theme_row->page_nav_font_color;
        ?>
;
        margin-right: 10px;
        vertical-align: middle;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .paging-input_<?php 
        echo $bwg;
        ?>
 {
        font-size: <?php 
        echo $theme_row->page_nav_font_size;
        ?>
px;
        font-family: <?php 
        echo $theme_row->page_nav_font_style;
        ?>
;
        font-weight: <?php 
        echo $theme_row->page_nav_font_weight;
        ?>
;
        color: #<?php 
        echo $theme_row->page_nav_font_color;
        ?>
;
        vertical-align: middle;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 a.disabled,
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 a.disabled:hover,
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 a.disabled:focus {
        cursor: default;
        color: rgba(<?php 
        echo $rgb_page_nav_font_color['red'];
        ?>
, <?php 
        echo $rgb_page_nav_font_color['green'];
        ?>
, <?php 
        echo $rgb_page_nav_font_color['blue'];
        ?>
, 0.5);
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .tablenav-pages_<?php 
        echo $bwg;
        ?>
 a {
        cursor: pointer;
        font-size: <?php 
        echo $theme_row->page_nav_font_size;
        ?>
px;
        font-family: <?php 
        echo $theme_row->page_nav_font_style;
        ?>
;
        font-weight: <?php 
        echo $theme_row->page_nav_font_weight;
        ?>
;
        color: #<?php 
        echo $theme_row->page_nav_font_color;
        ?>
;
        text-decoration: none;
        padding: <?php 
        echo $theme_row->page_nav_padding;
        ?>
;
        margin: <?php 
        echo $theme_row->page_nav_margin;
        ?>
;
        border-radius: <?php 
        echo $theme_row->page_nav_border_radius;
        ?>
;
        border-style: <?php 
        echo $theme_row->page_nav_border_style;
        ?>
;
        border-width: <?php 
        echo $theme_row->page_nav_border_width;
        ?>
px;
        border-color: #<?php 
        echo $theme_row->page_nav_border_color;
        ?>
;
        background-color: #<?php 
        echo $theme_row->page_nav_button_bg_color;
        ?>
;
        opacity: <?php 
        echo number_format($theme_row->page_nav_button_bg_transparent / 100, 2, ".", "");
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $theme_row->page_nav_button_bg_transparent;
        ?>
);
        box-shadow: <?php 
        echo $theme_row->page_nav_box_shadow;
        ?>
;
        <?php 
        echo $theme_row->page_nav_button_transition ? 'transition: all 0.3s ease 0s;-webkit-transition: all 0.3s ease 0s;' : '';
        ?>
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 .bwg_back_<?php 
        echo $bwg;
        ?>
 {
        background-color: rgba(0, 0, 0, 0);
        color: #<?php 
        echo $theme_row->album_compact_back_font_color;
        ?>
 !important;
        cursor: pointer;
        display: block;
        font-family: <?php 
        echo $theme_row->album_compact_back_font_style;
        ?>
;
        font-size: <?php 
        echo $theme_row->album_compact_back_font_size;
        ?>
px;
        font-weight: <?php 
        echo $theme_row->album_compact_back_font_weight;
        ?>
;
        text-decoration: none;
        padding: <?php 
        echo $theme_row->album_compact_back_padding;
        ?>
;
      }
      #bwg_container1_<?php 
        echo $bwg;
        ?>
 #bwg_container2_<?php 
        echo $bwg;
        ?>
 #spider_popup_overlay_<?php 
        echo $bwg;
        ?>
 {
        background-color: #<?php 
        echo $theme_row->lightbox_overlay_bg_color;
        ?>
;
        opacity: <?php 
        echo number_format($theme_row->lightbox_overlay_bg_transparent / 100, 2, ".", "");
        ?>
;
        filter: Alpha(opacity=<?php 
        echo $theme_row->lightbox_overlay_bg_transparent;
        ?>
);
      }
     .bwg_play_icon_spun_<?php 
        echo $bwg;
        ?>
 {
        width: inherit;
        height: inherit;
        display: table;
        position: absolute;
      }	 
     .bwg_play_icon_<?php 
        echo $bwg;
        ?>
 {
        color: #<?php 
        echo $theme_row->thumb_title_font_color;
        ?>
;
        font-size: <?php 
        echo 2 * $theme_row->thumb_title_font_size;
        ?>
px;
        vertical-align: middle;
        display: table-cell !important;
        z-index: 1;
        text-align: center;
        margin: 0 auto;
      }
    </style>
    <div id="bwg_container1_<?php 
        echo $bwg;
        ?>
">
      <div id="bwg_container2_<?php 
        echo $bwg;
        ?>
">
        <form id="gal_front_form_<?php 
        echo $bwg;
        ?>
" method="post" action="#">
          <?php 
        if ($params['show_search_box']) {
            WDWLibrary::ajax_html_frontend_search_box('gal_front_form_' . $bwg, $bwg, 'bwg_standart_thumbnails_' . $bwg, $images_count, $params['search_box_width'], $placeholder);
        }
        if (isset($params['show_sort_images']) && $params['show_sort_images']) {
            WDWLibrary::ajax_html_frontend_sort_box('gal_front_form_' . $bwg, $bwg, 'bwg_standart_thumbnails_' . $bwg, $params['sort_by'], $params['search_box_width']);
        }
        if (isset($params['show_tag_box']) && $params['show_tag_box']) {
            WDWLibrary::ajax_html_frontend_search_tags('gal_front_form_' . $bwg, $bwg, 'bwg_standart_thumbnails_' . $bwg, $images_count, $tags_rows);
        }
        ?>
          <div class="bwg_back_<?php 
        echo $bwg;
        ?>
"><?php 
        echo $options_row->showthumbs_name ? $gallery_row->name : '';
        ?>
</div>
          <div style="background-color:rgba(0, 0, 0, 0); text-align: <?php 
        echo $theme_row->thumb_align;
        ?>
; width:100%; position: relative;">
            <div id="ajax_loading_<?php 
        echo $bwg;
        ?>
" style="position:absolute;width: 100%; z-index: 115; text-align: center; height: 100%; vertical-align: middle; display:none;">
              <div style="display: table; vertical-align: middle; width: 100%; height: 100%; background-color: #FFFFFF; opacity: 0.7; filter: Alpha(opacity=70);">
                <div style="display: table-cell; text-align: center; position: relative; vertical-align: middle;" >
                  <div id="loading_div_<?php 
        echo $bwg;
        ?>
" class="spider_ajax_loading" style="display: inline-block; text-align:center; position:relative; vertical-align:middle; background-image:url(<?php 
        echo WD_BWG_URL . '/images/ajax_loader.png';
        ?>
); float: none; width:50px;height:50px;background-size:50px 50px;">
                  </div>
                </div>
              </div>
            </div>
            <?php 
        if ($params['image_enable_page'] && $params['images_per_page'] && $theme_row->page_nav_position == 'top') {
            WDWLibrary::ajax_html_frontend_page_nav($theme_row, $page_nav['total'], $page_nav['limit'], 'gal_front_form_' . $bwg, $items_per_page, $bwg, 'bwg_standart_thumbnails_' . $bwg, 0, 'album', $options_row->enable_seo, $params['image_enable_page']);
        }
        ?>
            <div id="bwg_standart_thumbnails_<?php 
        echo $bwg;
        ?>
" class="bwg_standart_thumbnails_<?php 
        echo $bwg;
        ?>
">
              <?php 
        foreach ($image_rows as $image_row) {
            $is_embed = preg_match('/EMBED/', $image_row->filetype) == 1 ? true : false;
            $is_embed_video = preg_match('/VIDEO/', $image_row->filetype) == 1 ? true : false;
            if (!$is_embed) {
                list($image_thumb_width, $image_thumb_height) = getimagesize(htmlspecialchars_decode(ABSPATH . $WD_BWG_UPLOAD_DIR . $image_row->thumb_url, ENT_COMPAT | ENT_QUOTES));
            } else {
                $image_thumb_width = $params['thumb_width'];
                if ($image_row->resolution != '') {
                    $resolution_arr = explode(" ", $image_row->resolution);
                    $resolution_w = intval($resolution_arr[0]);
                    $resolution_h = intval($resolution_arr[2]);
                    if ($resolution_w != 0 && $resolution_h != 0) {
                        $scale = $scale = max($params['thumb_width'] / $resolution_w, $params['thumb_height'] / $resolution_h);
                        $image_thumb_width = $resolution_w * $scale;
                        $image_thumb_height = $resolution_h * $scale;
                    } else {
                        $image_thumb_width = $params['thumb_width'];
                        $image_thumb_height = $params['thumb_height'];
                    }
                } else {
                    $image_thumb_width = $params['thumb_width'];
                    $image_thumb_height = $params['thumb_height'];
                }
            }
            $scale = max($params['thumb_width'] / $image_thumb_width, $params['thumb_height'] / $image_thumb_height);
            $image_thumb_width *= $scale;
            $image_thumb_height *= $scale;
            $thumb_left = ($params['thumb_width'] - $image_thumb_width) / 2;
            $thumb_top = ($params['thumb_height'] - $image_thumb_height) / 2;
            ?>
                <a <?php 
            echo $params['thumb_click_action'] == 'open_lightbox' ? ' class="bwg_lightbox_' . $bwg . '"' . ($options_row->enable_seo ? ' href="' . ($is_embed ? $image_row->thumb_url : site_url() . '/' . $WD_BWG_UPLOAD_DIR . $image_row->image_url) . '"' : '') . ' data-image-id="' . $image_row->id . '"' : ($params['thumb_click_action'] == 'redirect_to_url' && $image_row->redirect_url ? 'href="' . $image_row->redirect_url . '" target="' . ($params['thumb_link_target'] ? '_blank' : '') . '"' : '');
            ?>
>
                  <span class="bwg_standart_thumb_<?php 
            echo $bwg;
            ?>
">
                    <?php 
            if ($params['image_title'] == 'show' and $theme_row->thumb_title_pos == 'top') {
                ?>
                      <span class="bwg_title_spun1_<?php 
                echo $bwg;
                ?>
">
                        <span class="bwg_title_spun2_<?php 
                echo $bwg;
                ?>
">
                          <?php 
                echo $image_row->alt;
                ?>
                        </span>
                      </span>
                      <?php 
            }
            ?>
                    <span class="bwg_standart_thumb_spun1_<?php 
            echo $bwg;
            ?>
">
                      <span class="bwg_standart_thumb_spun2_<?php 
            echo $bwg;
            ?>
">
                        <?php 
            if ($play_icon && $is_embed_video) {
                ?>
                        <span class="bwg_play_icon_spun_<?php 
                echo $bwg;
                ?>
">
                           <i title="<?php 
                echo __('Play', 'bwg');
                ?>
"  class="fa fa-play bwg_play_icon_<?php 
                echo $bwg;
                ?>
"></i>
                        </span>
                          <?php 
            }
            if ($params['image_title'] == 'hover') {
                ?>
                          <span class="bwg_title_spun1_<?php 
                echo $bwg;
                ?>
">
                            <span class="bwg_title_spun2_<?php 
                echo $bwg;
                ?>
">
                              <?php 
                echo $image_row->alt;
                ?>
                            </span>
                          </span>
                          <?php 
            }
            ?>
                        <img class="bwg_standart_thumb_img_<?php 
            echo $bwg;
            ?>
 bwg_img_clear bwg_img_custom" style="width:<?php 
            echo $image_thumb_width;
            ?>
px; height:<?php 
            echo $image_thumb_height;
            ?>
px; margin-left: <?php 
            echo $thumb_left;
            ?>
px; margin-top: <?php 
            echo $thumb_top;
            ?>
px;" id="<?php 
            echo $image_row->id;
            ?>
" src="<?php 
            echo ($is_embed ? "" : site_url() . '/' . $WD_BWG_UPLOAD_DIR) . $image_row->thumb_url;
            ?>
" alt="<?php 
            echo $image_row->alt;
            ?>
" />
                      </span>
                    </span>
                    <?php 
            if ($params['image_title'] == 'show' and $theme_row->thumb_title_pos == 'bottom') {
                ?>
                      <span class="bwg_title_spun1_<?php 
                echo $bwg;
                ?>
">
                        <span class="bwg_title_spun2_<?php 
                echo $bwg;
                ?>
">
                          <?php 
                echo $image_row->alt;
                ?>
                        </span>
                      </span>
                      <?php 
            }
            ?>
                  </span>
                </a>
                <?php 
        }
        ?>
            </div>
            <?php 
        if ($params['image_enable_page'] && $params['images_per_page'] && $theme_row->page_nav_position == 'bottom') {
            WDWLibrary::ajax_html_frontend_page_nav($theme_row, $page_nav['total'], $page_nav['limit'], 'gal_front_form_' . $bwg, $items_per_page, $bwg, 'bwg_standart_thumbnails_' . $bwg, 0, 'album', $options_row->enable_seo, $params['image_enable_page']);
        }
        ?>
          </div>
        </form>
        <div id="spider_popup_loading_<?php 
        echo $bwg;
        ?>
" class="spider_popup_loading"></div>
        <div id="spider_popup_overlay_<?php 
        echo $bwg;
        ?>
" class="spider_popup_overlay" onclick="spider_destroypopup(1000)"></div>
      </div>
    </div>
    <script>
      <?php 
        $params_array = array('tag_id' => isset($params['type']) ? $params['gallery_id'] : 0, 'action' => 'GalleryBox', 'current_view' => $bwg, 'gallery_id' => $params['gallery_id'], 'theme_id' => $params['theme_id'], 'thumb_width' => $params['thumb_width'], 'thumb_height' => $params['thumb_height'], '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' => isset($params['type']) ? 'date' : ($params['sort_by'] == 'RAND()' ? 'order' : $params['sort_by']), 'wd_ord' => $sort_direction, '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' => urlencode($current_url));
        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'];
        }
        if ($params['watermark_type'] == 'text') {
            $params_array['watermark_text'] = $params['watermark_text'];
            $params_array['watermark_font_size'] = $params['watermark_font_size'];
            $params_array['watermark_font'] = $params['watermark_font'];
            $params_array['watermark_color'] = $params['watermark_color'];
        } elseif ($params['watermark_type'] == 'image') {
            $params_array['watermark_url'] = urlencode($params['watermark_url']);
            $params_array['watermark_width'] = $params['watermark_width'];
            $params_array['watermark_height'] = $params['watermark_height'];
        }
        ?>
      function bwg_gallery_box_<?php 
        echo $bwg;
        ?>
(image_id) {
        var filterTags = jQuery("#bwg_tags_id_bwg_standart_thumbnails_<?php 
        echo $bwg;
        ?>
" ).val() ? jQuery("#bwg_tags_id_bwg_standart_thumbnails_<?php 
        echo $bwg;
        ?>
" ).val() : 0;
        var filtersearchname = jQuery("#bwg_search_input_<?php 
        echo $bwg;
        ?>
" ).val() ? jQuery("#bwg_search_input_<?php 
        echo $bwg;
        ?>
" ).val() : '';
        spider_createpopup('<?php 
        echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php')));
        ?>
&image_id=' + image_id + "&filter_tag_<?php 
        echo $bwg;
        ?>
=" +  filterTags + "&filter_search_name_<?php 
        echo $bwg;
        ?>
=" +  filtersearchname, '<?php 
        echo $bwg;
        ?>
', '<?php 
        echo $params['popup_width'];
        ?>
', '<?php 
        echo $params['popup_height'];
        ?>
', 1, 'testpopup', 5, "<?php 
        echo $theme_row->lightbox_ctrl_btn_pos;
        ?>
");
      }
      function bwg_document_ready_<?php 
        echo $bwg;
        ?>
() {
        var bwg_touch_flag = false;
        jQuery(".bwg_lightbox_<?php 
        echo $bwg;
        ?>
").on("click", function () {
          if (!bwg_touch_flag) {
            bwg_touch_flag = true;
            setTimeout(function(){ bwg_touch_flag = false; }, 100);
            bwg_gallery_box_<?php 
        echo $bwg;
        ?>
(jQuery(this).attr("data-image-id"));
            return false;
          }
        });
      }
      jQuery(document).ready(function () {
        bwg_document_ready_<?php 
        echo $bwg;
        ?>
();
      });
    </script>
    <?php 
        if ($from_shortcode) {
            return;
        } else {
            die;
        }
    }
예제 #30
0
function bwg_ajax()
{
    global $wpdb;
    require_once WD_BWG_DIR . '/framework/WDWLibrary.php';
    $page = WDWLibrary::get('action');
    if ($page != '' && ($page == 'BWGShortcode' || $page == 'addAlbumsGalleries' || $page == 'editThumb' || $page == 'addTags')) {
        require_once WD_BWG_DIR . '/admin/controllers/BWGController' . ucfirst($page) . '.php';
        $controller_class = 'BWGController' . ucfirst($page);
        $controller = new $controller_class();
        $controller->execute();
    }
}