/**
  * Reads $csv for a comma separated list of image attachment IDs. Returns a php array of image URLs and IDs, or false.
  *
  * @param string $csv A comma separated list of image attachment IDs.
  * @return array|bool
  */
 function ci_featgal_get_images($csv = false)
 {
     $ids = explode(',', $csv);
     $ids = array_filter($ids);
     if (count($ids) > 0) {
         $ids = array_map('intval', $ids);
         $ids = array_map('abs', $ids);
         $urls = array();
         $image_sizes = ci_get_image_sizes();
         foreach ($ids as $id) {
             $thumb_file = ci_get_image_src($id, 'ci_featgal_small_thumb');
             $file = parse_url($thumb_file);
             $file = pathinfo($file['path']);
             $file = basename($file['basename'], '.' . $file['extension']);
             $size = $image_sizes['ci_featgal_small_thumb']['width'] . 'x' . $image_sizes['ci_featgal_small_thumb']['height'];
             if (substr_right($file, strlen($size)) == $size) {
                 $file = $thumb_file;
             } else {
                 $file = ci_get_image_src($id, 'thumbnail');
             }
             $data = array('id' => $id, 'url' => $file);
             $urls[] = $data;
         }
         return $urls;
     } else {
         return false;
     }
 }
Пример #2
0
 /**
  * Returns an associative array of theme-dependend strings, that can be used as class names.
  * 
  * @access public
  * @return array
  */
 function ci_theme_classes()
 {
     $version = str_replace('.', '-', CI_THEME_VERSION);
     $classes['theme'] = "ci-" . CI_THEME_NAME;
     $classes['theme_version'] = "ci-" . CI_THEME_NAME . '-' . $version;
     $scheme = ci_setting('stylesheet');
     if (!empty($scheme)) {
         if (substr_right($scheme, 4) == '.css') {
             $name = basename($scheme, '.css');
         } else {
             $name = basename($scheme);
         }
         $classes['theme_color_scheme'] = sanitize_html_class('ci-scheme-' . $name);
     }
     return $classes;
 }
                    }
                }
            }
            closedir($handle);
        }
    }
    ?>

	<fieldset id="ci-panel-color-scheme" class="set">
		<legend><?php 
    _e('Color Scheme', 'ci_theme');
    ?>
</legend>
		<p class="guide"><?php 
    _e('Select your color scheme. This affects the overall look and feel of your website.', 'ci_theme');
    ?>
</p>
		<?php 
    // Try to retain old settings where the stylesheet didn't include the extension .css
    if (!empty($ci['stylesheet'])) {
        $color = $ci['stylesheet'];
        if (substr_right($ci['stylesheet'], 4) != '.css') {
            $ci['stylesheet'] = $ci['stylesheet'] . '.css';
        }
    }
    ci_panel_dropdown('stylesheet', $schemes, __('Color scheme', 'ci_theme'));
    ?>
	</fieldset>

<?php 
}