Plugin Directory

Changeset 670289


Ignore:
Timestamp:
02/19/2013 01:47:23 PM (13 years ago)
Author:
mohsinrasool
Message:

added linking feature and fixes bug

Location:
nextgen-flex-slider-template
Files:
21 added
5 edited

Legend:

Unmodified
Added
Removed
  • nextgen-flex-slider-template/trunk/admin-settings.php

    r666267 r670289  
    1717    register_setting('ng_slider_options', 'ng_slider_display_content');
    1818    register_setting('ng_slider_options', 'ng_slider_image_width');
     19    //register_setting('ng_slider_options', 'ng_slider_image_height');
    1920    register_setting('ng_slider_options', 'ng_slider_text_width');
    2021    register_setting('ng_slider_options', 'ng_slider_slideshow_speed');
     
    2425    //register_setting('ng_slider_options', 'ng_slider_direction');
    2526    //register_setting('ng_slider_options', 'ng_slider_animation');
     27    register_setting('ng_slider_options', 'ng_slider_link_title');
     28    register_setting('ng_slider_options', 'ng_slider_link_image');
     29    register_setting('ng_slider_options', 'ng_slider_link_new_window');
    2630    register_setting('ng_slider_options', 'ng_slider_direction_nav');
    2731    register_setting('ng_slider_options', 'ng_slider_pagination');
     
    3539    add_settings_field('ng_slider_disable_img_stretching', '', 'ng_slider_disable_img_stretching', 'ng_slider_general_options', 'ng_slider_general_options');
    3640    add_settings_field('ng_slider_text_width', 'Content Width', 'ng_slider_text_width_code', 'ng_slider_general_options', 'ng_slider_general_options');
     41    //add_settings_field('ng_slider_image_height', 'Limit Image Height', 'ng_slider_image_height', 'ng_slider_general_options', 'ng_slider_general_options');
     42    add_settings_field('ng_slider_link_title', 'Linking Sliders', 'ng_slider_link_title', 'ng_slider_general_options', 'ng_slider_general_options');
     43    add_settings_field('ng_slider_link_image', '', 'ng_slider_link_image', 'ng_slider_general_options', 'ng_slider_general_options');
     44    add_settings_field('ng_slider_link_new_window', '', 'ng_slider_link_new_window', 'ng_slider_general_options', 'ng_slider_general_options');
    3745    add_settings_field('ng_slider_background', 'Background Color', 'ng_slider_background', 'ng_slider_general_options', 'ng_slider_general_options');
    3846    add_settings_field('ng_slider_slideshow_speed', 'Animation Delay', 'ng_slider_slideshow_speed_code', 'ng_slider_general_options', 'ng_slider_general_options');
     
    5361function ng_slider_disable_img_stretching() {
    5462    echo '<label><input id="ng_slider_disable_img_stretching" name="ng_slider_disable_img_stretching" type="checkbox" value="1" ' . checked(get_option("ng_slider_disable_img_stretching"), '1', false ) . ' /> Disable image stretching. If images are pixelated pease check this option.</label>';
     63}
     64function ng_slider_link_title() {
     65    echo 'Follow <a href="http://wpdevsnippets/linking-image-and-title-nextgen-flex-slider-template" target="_blank">this tutorial</a> to set it up.<br /><label><input id="ng_slider_link_title" name="ng_slider_link_title" type="checkbox" value="1" ' . checked(get_option("ng_slider_link_title"), '1', false ) . ' /> Link title to specified URL. </label>';
     66}
     67function ng_slider_link_image() {
     68    echo '<label><input id="ng_slider_link_image" name="ng_slider_link_image" type="checkbox" value="1" ' . checked(get_option("ng_slider_link_image"), '1', false ) . ' /> Link image to specified URL. </label>';
     69}
     70function ng_slider_link_new_window() {
     71    echo '<label><input id="ng_slider_link_new_window" name="ng_slider_link_new_window" type="checkbox" value="1" ' . checked(get_option("ng_slider_link_new_window"), '1', false ) . ' /> Open links in a new window</label>';
     72}
     73
     74
     75function ng_slider_image_height() {
     76    echo '<input id="ng_slider_image_height" name="ng_slider_image_height" type="text" value="' . get_option("ng_slider_image_height") . '" /> e.g. any valid height value. 300px etc<br />';
    5577}
    5678
     
    166188        <em>Possible Values</em>: 100px or 20% etc</p>
    167189
     190        <p><strong>link_title:</strong> <br>
     191        (boolean) (optional) Enable or disable whether title should be linked or not (for content slider). Please follow <a href="http://wpdevsnippets/linking-image-and-title-nextgen-flex-slider-template" target="_blank">this tutorial</a> to set it up<br>
     192        <em>Possible Values</em>: 0 or 1</p>
     193
     194        <p><strong>link_image:</strong> <br>
     195        (boolean) (optional) Enable or disable whether image should be linked or not. Please follow <a href="http://wpdevsnippets/linking-image-and-title-nextgen-flex-slider-template" target="_blank">this tutorial</a> to set it up<br>
     196        <em>Possible Values</em>: 0 or 1</p>
     197
     198        <p><strong>link_new_window:</strong> <br>
     199        (boolean) (optional) Enable to open slider url to be opened in a new window. Please follow <a href="http://wpdevsnippets/linking-image-and-title-nextgen-flex-slider-template" target="_blank">this tutorial</a> to set it up<br>
     200        <em>Possible Values</em>: 0 or 1</p>
     201
    168202        <p><strong>background:</strong> <br>
    169203        (string) (optional) Set background color of the slider <br>
  • nextgen-flex-slider-template/trunk/nextgen-flex-slider-template.php

    r666267 r670289  
    66Author: Mohsin Rasool
    77Author URI: http://wpdevsnippets.com
    8 Version: 1.6
     8Version: 1.7
    99*/
    1010
  • nextgen-flex-slider-template/trunk/readme.txt

    r666267 r670289  
    55Requires at least: 3.0.1
    66Tested up to: 3.5
    7 Stable tag: 1.6
     7Stable tag: 1.7
    88Author: Mohsin Rasool
    99License: GPLv2
     
    4242    direction_nav:
    4343    (boolean) (optional) Enable or disable next/prev navigation arrows
    44     Possible Values: 1 or 0
     44    Possible Values: 0 or 1
    4545
    4646    pagination:
    4747    (boolean) (optional) Enable or disable pagination bullets at bottom
    48     Possible Values: 1 or 0
     48    Possible Values: 0 or 1
    4949
    5050    image_width:
     
    5555    (string) (optional) Set width of the content area (in case of content slider)
    5656    Possible Values: 100px or 20% etc
     57
     58    link_title:
     59    (boolean) (optional) Enable or disable whether title should be linked or not (for content slider). Please follow [this tutorial](http://wpdevsnippets/linking-image-and-title-nextgen-flex-slider-template "Linking Flex Sliders") to set it up
     60    Possible Values: 0 or 1
     61
     62    link_image:
     63    (boolean) (optional) Enable or disable whether image should be linked or not. Please follow [this tutorial](http://wpdevsnippets/linking-image-and-title-nextgen-flex-slider-template "Linking Flex Sliders") to set it up
     64    Possible Values: 0 or 1
     65
     66    link_new_window:
     67    (boolean) (optional) Enable to open slider url to be opened in a new window. Please follow [this tutorial](http://wpdevsnippets/linking-image-and-title-nextgen-flex-slider-template "Linking Flex Sliders") to set it up
     68    Possible Values: 0 or 1
    5769
    5870    background:
     
    7082== Usage ==
    7183
    72 [nggallery id=x template="sliderview"]
     84[nggallery id=x template="sliderview" direction_nav="0"]
    7385
    7486== Installation ==
     
    123135== Changelog ==
    124136
     137= 1.7 =
     138* Added feature to link the images and titles
     139* Fixed open_short_tag bug
     140
    125141= 1.6 =
    126142* Allow multiple slider with different options on the same page or different pages
     
    156172== Upgrade Notice ==
    157173
     174= 1.7 =
     175* Added feature to link the images and titles
     176* Fixed open_short_tag bug
     177
    158178= 1.6 =
    159179* Allow multiple slider with different options on the same page or different pages
     
    172192
    173193= 1.2 =
    174 Fixes blank screen bug when activated. It may also conflict with another plugin.
     194* Fixes blank screen bug when activated. It may also conflict with another plugin.
  • nextgen-flex-slider-template/trunk/template-nggsliderview.php

    r666267 r670289  
    1515?>
    1616<?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($gallery)) : ?>
    17 <?
     17<?php
     18
    1819    //  Parse the attributes
    1920    $defaults = array (
     
    2829        'ng_slider_text_width' => get_option('ng_slider_text_width'),
    2930        'ng_slider_use_width_for_img_slider' => get_option('ng_slider_use_width_for_img_slider'),
    30         'ng_slider_disable_img_stretching' => get_option('ng_slider_disable_img_stretching')
     31        'ng_slider_disable_img_stretching' => get_option('ng_slider_disable_img_stretching'),
     32        'ng_slider_link_title' => get_option('ng_slider_link_title'),
     33        'ng_slider_link_image' => get_option('ng_slider_link_image'),
     34        'ng_slider_link_new_window' => get_option('ng_slider_link_new_window')
    3135    );
    3236   
     37
    3338    $ng_slider_theme_names = array('black','blue','grey');
    3439       
     
    6267        }
    6368    }
     69
    6470    extract($defaults);
    6571
     
    7177        $images = array_reverse($images);
    7278?>
    73 <div id="<?php echo $gallery->anchor ?>" class="flexslider <?=$ng_slider_theme?>">
     79<div id="<?php echo $gallery->anchor ?>" class="flexslider <?php echo $ng_slider_theme?>">
    7480   <ul class="slides">
    7581    <!-- Thumbnails -->
    76     <?php foreach ($images as $image) : ?>     
    77     <li class="<? if(!$display_content) echo 'full-width';?>">
     82    <?php foreach ($images as $image) : ?>
     83    <li class="<?php if(!$display_content) echo 'full-width';?>">
    7884            <div class="feature-image ">
    79                 <img class="full home_feature" src="<?php echo $image->imageURL ?>" alt="<?php echo $image->alttext ?>" title="<?php echo $image->alttext ?>">
     85                <?php if(!empty($image->ngg_custom_fields['image_link']) && $ng_slider_link_image) { ?>
     86                    <a href="<?php echo $image->ngg_custom_fields['image_link'] ?>" <?php echo $ng_slider_link_new_window ? 'target="_blank"':'' ?> ><img class="full home_feature" src="<?php echo $image->imageURL ?>" alt="<?php echo $image->alttext ?>" title="<?php echo $image->alttext ?>"></a>
     87                <?php }else{ ?>
     88                    <img class="full home_feature" src="<?php echo $image->imageURL ?>" alt="<?php echo $image->alttext ?>" title="<?php echo $image->alttext ?>">
     89                <?php } ?>
     90                   
    8091            </div>
    81             <? if($display_content) {?>
     92            <?php if($display_content) {?>
    8293            <div class="flex-caption">
    83                 <h2 class="post-title"><?php echo ($image->alttext) ?></h2>
     94                <?php if(!empty($image->ngg_custom_fields['image_link']) && $ng_slider_link_title) { ?>
     95                    <a href="<?php echo $image->ngg_custom_fields['image_link'] ?>" <?php echo $ng_slider_link_new_window ? 'target="_blank"':'' ?> ><h2 class="post-title"><?php echo ($image->alttext) ?></h2></a>
     96                <?php }else{ ?>
     97                    <h2 class="post-title"><?php echo ($image->alttext) ?></h2>
     98                <?php } ?>
    8499                <p><?php echo html_entity_decode($image->description) ?></p>
    85100            </div>
    86             <? } ?>
     101            <?php } ?>
    87102    </li>
    88103    <?php endforeach; ?>
     
    94109    jQuery(document).ready(function($) {
    95110      $('#<?php echo $gallery->anchor ?>').flexslider({
    96         <? echo "slideshowSpeed: ".($ng_slider_slideshow_speed ? $ng_slider_slideshow_speed*1000: 6000).","?>
    97         <? //echo "direction: '".(get_option('ng_slider_direction') ? get_option('ng_slider_direction'): 'horizontal')."',"?>
    98         <? if($ng_slider_order == 'random')
     111        <?php echo "slideshowSpeed: ".($ng_slider_slideshow_speed ? $ng_slider_slideshow_speed*1000: 6000).","?>
     112        <?php //echo "direction: '".(get_option('ng_slider_direction') ? get_option('ng_slider_direction'): 'horizontal')."',"?>
     113        <?php if($ng_slider_order == 'random')
    99114                echo 'randomize:true,';
    100115           
    101116        ?>
    102         <? echo "directionNav: ".($ng_slider_direction_nav ? 'true': 'false').","?>
    103         <? echo "controlNav: ".($ng_slider_pagination ? 'true': 'false').","?>
    104         <? //echo "animation: '".(get_option('ng_slider_animation') ? get_option('ng_slider_animation'): 'fade')."',"?>
     117        <?php echo "directionNav: ".($ng_slider_direction_nav ? 'true': 'false').","?>
     118        <?php echo "controlNav: ".($ng_slider_pagination ? 'true': 'false').","?>
     119        <?php //echo "animation: '".(get_option('ng_slider_animation') ? get_option('ng_slider_animation'): 'fade')."',"?>
    105120        pauseOnHover:true
    106121  });
     
    108123</script>
    109124<style>
    110     <?
     125    <?php
    111126    $img_width = $ng_slider_image_width;
    112127    $bg_color = $ng_slider_background;
Note: See TracChangeset for help on using the changeset viewer.