public static function tchsp_shortcode_int($arr) { if (!is_array($arr)) { return ''; } $imageli = ""; $tch = ""; $id = isset($arr['id']) ? $arr['id'] : '0'; $data = array(); $data = tchsp_cls_dbquery::tchsp_gallery_details_select($id); if (count($data) > 0) { $form_gallery = array('gal_id' => $data[0]['gal_id'], 'gal_title' => $data[0]['gal_title'], 'gal_width' => $data[0]['gal_width'], 'gal_height' => $data[0]['gal_height'], 'gal_controls' => $data[0]['gal_controls'], 'gal_autointerval' => $data[0]['gal_autointerval'], 'gal_intervaltime' => $data[0]['gal_intervaltime'], 'gal_animation' => $data[0]['gal_animation'], 'gal_random' => $data[0]['gal_random']); $gal_width = $form_gallery["gal_width"]; $gal_height = $form_gallery["gal_height"]; $gal_controls = $form_gallery["gal_controls"]; $gal_autointerval = $form_gallery["gal_autointerval"]; $gal_intervaltime = $form_gallery["gal_intervaltime"]; $gal_animation = $form_gallery["gal_animation"]; $gal_width1 = $gal_width + 4; $gal_height1 = $gal_height + 4; $image = tchsp_cls_dbquery::tchsp_image_details_load($form_gallery["gal_id"], $form_gallery["gal_random"]); if (count($image) > 0) { foreach ($image as $img) { $imageli = $imageli . '<li>'; $imageli = $imageli . '<a href="' . $img['img_link'] . '" target="_target">'; $imageli = $imageli . '<img alt="' . $img['img_title'] . '" src="' . $img['img_imageurl'] . '" />'; $imageli = $imageli . '</a>'; $imageli = $imageli . '</li>'; } if ($imageli != "") { $tch = $tch . "<style type='text/css' media='screen'>\r\r\n\t\t\t\t\t#tchsp { height: 1%; margin: 30px 0 0; overflow:hidden; position: relative; padding: 0 50px 10px; }\r\r\n\t\t\t\t\t#tchsp .viewport { height: " . $gal_height1 . "px; overflow: hidden; position: relative; }\r\r\n\t\t\t\t\t#tchsp .buttons { background: #C01313; border-radius: 35px; display: block; position: absolute;\r\r\n\t\t\t\t\ttop: 40%; left: 0; width: 35px; height: 35px; color: #fff; font-weight: bold; text-align: center; line-height: 35px; text-decoration: none;\r\r\n\t\t\t\t\tfont-size: 22px; }\r\r\n\t\t\t\t\t#tchsp .next { right: 0; left: auto;top: 40%; }\r\r\n\t\t\t\t\t#tchsp .buttons:hover{ color: #C01313;background: #fff; }\r\r\n\t\t\t\t\t#tchsp .disable { visibility: hidden; }\r\r\n\t\t\t\t\t#tchsp .overview { list-style: none; position: absolute; padding: 0; margin: 0; width: " . $gal_width1 . "px; left: 0 top: 0; }\r\r\n\t\t\t\t\t#tchsp .overview li{ float: left; margin: 0 20px 0 0; padding: 1px; height: " . $gal_height . "px; border: 1px solid #dcdcdc; width: " . $gal_width . "px;}\r\r\n\t\t\t\t\t</style>"; $tch = $tch . '<div id="tchsp">'; $tch = $tch . '<a class="buttons prev" href="#"><</a>'; $tch = $tch . '<div class="viewport">'; $tch = $tch . '<ul class="overview">'; $tch = $tch . $imageli; $tch = $tch . '</ul>'; $tch = $tch . '</div>'; $tch = $tch . '<a class="buttons next" href="#">></a>'; $tch = $tch . '</div>'; $tch = $tch . '<script type="text/javascript">'; $tch = $tch . 'jQuery(document).ready(function(){'; $tch = $tch . "jQuery('#tchsp').tinycarousel({ buttons: " . $gal_controls . ", interval: " . $gal_autointerval . ", intervalTime: " . $gal_intervaltime . ", animationTime: " . $gal_animation . " });"; $tch = $tch . '});'; $tch = $tch . '</script>'; } } } else { $tch = __('Please check your short code. Gallery does not exists for this Id.', TCHSP_TDOMAIN); } return $tch; }
<option value='NO'>NO</option> </select> <p><?php _e('Do you want the picture to show in your galler?', TCHSP_TDOMAIN); ?> </p> <label for="tag-a"><?php _e('Gallery title', TCHSP_TDOMAIN); ?> </label> <select name="img_gal_id" id="img_gal_id"> <option value=''>Select</option> <?php $galleryData = array(); $galleryData = tchsp_cls_dbquery::tchsp_gallery_details_select(0); if (count($galleryData) > 0) { foreach ($galleryData as $data) { ?> <option value='<?php echo $data['gal_id']; ?> '><?php echo $data['gal_title']; ?> </option><?php } } ?> </select>
} $tchsp_errors = array(); $tchsp_success = ''; $tchsp_error_found = FALSE; // First check if ID exist with requested ID $result = '0'; $result = tchsp_cls_dbquery::tchsp_gallery_details_count($did); if ($result != '1') { ?> <div class="error fade"><p><strong><?php _e('Oops, selected details doesnt exist.', TCHSP_TDOMAIN); ?> </strong></p></div><?php } else { $data = array(); $data = tchsp_cls_dbquery::tchsp_gallery_details_select($did); // Preset the form fields $form = array('gal_id' => $data[0]['gal_id'], 'gal_title' => $data[0]['gal_title'], 'gal_width' => $data[0]['gal_width'], 'gal_height' => $data[0]['gal_height'], 'gal_controls' => $data[0]['gal_controls'], 'gal_autointerval' => $data[0]['gal_autointerval'], 'gal_intervaltime' => $data[0]['gal_intervaltime'], 'gal_animation' => $data[0]['gal_animation'], 'gal_random' => $data[0]['gal_random']); } // Form submitted, check the data if (isset($_POST['tchsp_form_submit']) && $_POST['tchsp_form_submit'] == 'yes') { // Just security thingy that wordpress offers us check_admin_referer('tchsp_form_edit'); $form['gal_title'] = isset($_POST['gal_title']) ? $_POST['gal_title'] : ''; if ($form['gal_title'] == '') { $tchsp_errors[] = __('Enter title for your gallery.', TCHSP_TDOMAIN); $tchsp_error_found = TRUE; } $form['gal_width'] = isset($_POST['gal_width']) ? $_POST['gal_width'] : ''; if ($form['gal_width'] == '') { $tchsp_errors[] = __('Enter your image width, You should add same width images in this gallery. (Ex: 200)', TCHSP_TDOMAIN);
if ($data['img_linktarget'] == "_blank") { echo "Open New Window"; } else { echo "Open Same Window"; } ?> </td> <td><?php echo $data['img_display']; ?> </td> <td> <?php $galleryData = array(); $galleryData = tchsp_cls_dbquery::tchsp_gallery_details_select($data['img_gal_id']); if (count($galleryData) > 0) { foreach ($galleryData as $data) { echo $data['gal_title']; } } ?> </td> </tr> <?php $i = $i + 1; } } else { ?> <tr><td colspan="7" align="center"><?php