Changeset 5735 for extensions/lightbox


Ignore:
Timestamp:
Apr 9, 2010, 3:07:06 PM (14 years ago)
Author:
patdenice
Message:

Compatibility with simple template from boulde.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/lightbox/lightbox.php

    r4826 r5735  
    11<?php
    22
    3 global $page, $conf, $template;
     3global $page, $conf, $template, $user;
    44
    55include_once(LIGHTBOX_PATH.'functions.inc.php');
    66$params = unserialize($conf['lightbox']);
    77$conf['lightbox_rel'] = isset($conf['lightbox_rel']) ? ++$conf['lightbox_rel'] : 0;
     8
     9switch ($user['template'])
     10{
     11  case 'simple':
     12    $selector = '#thumbnails a';
     13    break;
     14
     15  default:
     16    $selector = '.thumbnails a';
     17    break;
     18}
    819
    920$template->func_known_script(array('id'=>'colorbox', 'src'=>get_root_url().'plugins/lightbox/jquery.colorbox.js'), $smarty);
     
    1223<script type="text/javascript">
    1324$(document).ready(function(){
    14 $(".thumbnails a").attr("href", function () {
     25$("'.$selector.'").attr("href", function () {
    1526  return this.name;   
    1627});
    17 $(".thumbnails a").colorbox({
     28$("'.$selector.'").colorbox({
    1829  current: "",
    1930  transition: "'.$params['transition'].'",
Note: See TracChangeset for help on using the changeset viewer.