Welcome Guest, Not a member yet? Register   Sign In
cooliris views

I did find the forums for a cooliris related posts and didn't find one.

If you want http://www.cooliris.com/ integrated in your web sites you can do something like the following (see a working example at: http://caselemnhr.ro/pages/gallery):

1) create a view named gallery.php (for example) containing

<div class="article" id="article_{gallery}">
    <div class="clr"></div>
        &lt;object id="embed_{gallery}" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="600" height="450"&gt;
            <param name="movie" value="http://apps.cooliris.com/embed/cooliris.swf" />
            <param name="allowFullScreen" value="true" />
            <param name="allowScriptAccess" value="always" />
            <param name="flashvars" value="feed=api://www.flickr.com/" />
            &lt;embed type="application/x-shockwave-flash"
                  allowScriptAccess="always" /&gt;
       <div class="clr"></div>

Notice <b>

A gallery view will get the media rss items from that location (http://site/mrss/pictures). So, you have to handle the <i>mrss</i> fragment from the url part of the flashvars.

2) create a mrss.php file with the following content

&lt;?php if(!defined('BASEPATH'))
    exit('No direct script access allowed');

class Mrss extends CI_Controller
    private $ext = '.jpg';
    private $tmb = 'tmb/';

    public function __construct()


    private function _setup($title, $dir, $num_images)
        $data = array('title' => $title);

        for($i = 1; $i <= $num_images; $i++) {
            $data['items'][] = array('image_url' => $dir . $i, 'tmb_image_url' => $dir . $this->tmb . $i);

        return $data;

    public function index()

    public function gal1()

        $this->parser->parse('mrss', $this->_setup('Gallery 1', 'images/gallery/g1/', 15));

    public function gal2()

        $this->parser->parse('mrss', $this->_setup('Gallery 2', 'images/gallery/g2/', 12));

/* End of file Sgallery.php */

This supposes that you have 15 images (1.jpg, 2.jpg, ...) Smile located at images/gallery/g1/ and their thumbnails at images/gallery/g1/tmb/. You have to have 12 images for g2.

3) modify your .htaccess as follows

<IfModule mod_rewrite.c>
  RewriteEngine on

  RewriteCond $1 !^(index\.php|images|themes|robots\.txt|crossdomain\.xml)
  RewriteRule ^(.*)$ index.php/$1 [L,QSA]

For our example only the <b>crossdomain\.xml</b> and <b>images</b> are important.

I hope this is helpful for those who need simple image galleries.


Theme © iAndrew 2016 - Forum software by © MyBB