Модуль в виде ссылки

Тема в разделе "Корзина: темы для удаления", создана пользователем platochek, 24.05.2013.

  1. Offline

    platochek Недавно здесь

    Регистрация:
    07.05.2013
    Сообщения:
    11
    Симпатии:
    0
    Пол:
    Мужской
    Подскажите как быть?
    Есть модуль CN Photos (слайдер)
    Как сделать чтобы, он стал ссылкой на выполнение скрипта.

    код слайдера
    <?php
    /**
    * @version 2.1
    * @package mod_cn_photos
    * @author Caleb Nance
    * @copyright Copyright © 2009 - 2012 demo.calebnance.com. All rights reserved.
    * @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
    *
    * mod_cn_photos.php
    */
    // No direct access
    defined('_JEXEC') or die;

    // Include the syndicate functions only once
    require_once dirname(__FILE__).'/helper.php';

    // Set document
    $document = JFactory::getDocument();
    $document->addStylesheet('modules/mod_cn_photos/css/cn_photos.css');

    // Set variables
    $width = $params->get('width', '150');
    $height = $params->get('height', '150');
    $path = $params->get('path', 'modules/mod_cn_photos/gallery');
    $fx = $params->get('fx', 'fade');
    $pause = $params->get('pause', '0');
    $next = $params->get('next', '0');
    $timeout = $params->get('timeout', '3000');
    $speed = $params->get('speed', '1000');
    $modid = $params->get('modid', '1');
    $random = $params->get('random', '0');
    $sfx = $params->get('moduleclass_sfx');
    $alt_tags = $params->get('alt_tags');
    $base = JURI::base();

    // Set Captions For Photos (explode from textarea with # as the split point)
    $alt_array = explode('*', $alt_tags);

    // Get photos
    $photos = modCN_PhotosHelper::getPhotos($params);
    // Reindex photos in order
    $photos = modCN_PhotosHelper::reindex_array($photos);

    // Set total of photos
    $total = count($photos);

    // Set random start image for nth-child() jQuery
    $random_start = rand(1, $total);

    // Check if shuffle is selected for FX
    if($fx == 'shuffle'){
    $shuffle = modCN_PhotosHelper::getShuffle($params);
    }

    // Set slideshow cycle
    // Self Calling (invoking) Function
    $js_code = "(function(){ cnphotos_".$modid."(document).ready(function() {";
    $js_code .= " cnphotos_".$modid."('.slideshow".$modid." img').css({ opacity: 0 }); ";
    $js_code .= " setTimeout(function() { ";
    $js_code .= " cnphotos_".$modid."('.slideshow".$modid."')";
    $js_code .= ".cycle({ ";

    // Random has to be set first
    if($random == '1'):
    $js_code .= " random: 1, startingSlide: ".$random_start.", ";
    else:
    // Setting this to the last, so it fades in on the first..
    // work around.. I don't like it that much but it works :)
    $starting_slide = $total - 1;
    $js_code .= " startingSlide: ".$starting_slide.", ";
    endif;

    // Set FX, speed, & delay
    $js_code .= "fx: '".$fx."', speed: ".$speed.", delay: -".$timeout.",";

    // If shuffle
    if($fx == 'shuffle'):
    $js_code .= $shuffle;
    endif;

    // Check for next on click
    if($next == '1'):
    $js_code .= " next: '.slideshow".$modid."', ";
    endif;

    // Check for pause on hover
    if($pause == '1'):
    $js_code .= " pause: 1, ";
    endif;

    // Set timeout (no comma at the end - safe guard)
    $js_code .= " timeout: ".$timeout."});";
    $js_code .= " cnphotos_".$modid."('.slideshow".$modid." img').css({ opacity: 0 }); }, 1000); });";
    $js_code .= " })() ";

    // Check if none is selected for FX
    if($fx == 'none'):

    // Reset cycle for no effect
    // Self Calling (invoking) Function
    $js_code = "(function(){ cnphotos_".$modid."(document).ready(function() {";
    $js_code .= " cnphotos_".$modid."('.slideshow".$modid."')";
    $js_code .= ".cycle({ ";
    $js_code .= " fx: 'none', ";

    // Random has to be set first
    if($random == '1'):
    $js_code .= " random: 1, startingSlide: ".$random_start.", ";
    else:
    // Setting this to the last, so it fades in on the first..
    // work around.. I don't like it that much but it works :)
    $starting_slide = $total - 1;
    $js_code .= " startingSlide: ".$starting_slide.", ";
    endif;

    // Set speed & delay
    $js_code .= " speed: ".$speed.", delay: -".$timeout.",";

    // Check for next on click
    if($next == '1'):
    $js_code .= " next: '.slideshow".$modid."', ";
    endif;

    // Check for pause on hover
    if($pause == '1'):
    $js_code .= " pause: 1, ";
    endif;
    $js_code .= " }); });";
    $js_code .= " })() ";
    endif;

    // Get CSS
    $css_code = modCN_PhotosHelper::getHeader($params);
    $document->addStyleDeclaration($css_code);

    // Checks if photos are empty
    if(empty($photos)) {
    echo '<p>The folder path <br />'. $base . $path .'<br /> is empty.</p><p>Please make sure that there is at least 1 image that is of png, jpg, jpeg, or gif format in the folder listed above.</p><p>If the problem persists, please let me know.</p><p><a href="http://demo.calebnance.com/Contact/Caleb-Nance.html" target="_blank" >Contact Me</a></p>';
    return;
    }

    // Set the module class suffix
    $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'));

    require JModuleHelper::getLayoutPath('mod_cn_photos', $params->get('layout', 'default'));

    ?>
    код ссылки.
    <a href="javascript:void(0)" onclick="javascript:return openS(&quot;http://www.atlantisline.ru/?partnerId=1134&amp;brand=no&quot;)">ссылка</a>
     
  2.  
  3. woojin
    Offline

    woojin Местный Команда форума => Cпециалист <=

    Регистрация:
    31.05.2009
    Сообщения:
    3 206
    Симпатии:
    334
    Пол:
    Мужской
    !!!научись пользоваться редактором!!!


    код вставляется сюда: 18qb6mqIp.png


    чтобы получилось так:


    Код (PHP):
    1. <?php
    2.     phpinfo();
    3. ?>
     

Поделиться этой страницей

Загрузка...