vishwamano

source of vishwamano.com
git clone git://git.ricketyspace.net/vishwamano.git
Log | Files | Refs

commit 3bd063b4d44007213c8229b888320ce6c178e2e3
parent 634175d19739f169ff571e5245287f36d7b96a0d
Author: rsiddharth <rsiddharth@ninthfloor.org>
Date:   Tue, 30 Dec 2014 02:16:06 -0500

First version of upgraded gallery/ page ready (uses Smarty).

new file:   gallery/index.php

Diffstat:
gallery/index.php | 52++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+), 0 deletions(-)

diff --git a/gallery/index.php b/gallery/index.php @@ -0,0 +1,52 @@ +<?php + +/* Vishwamano.com PHP snafu. + + Copyright (C) 2014 rsiddharth <rsiddharth@ninthfloor.org> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + COPYING contains the full text of the GNU Affero General Public + License. If you have not recieved a copy of the file along with + this program, see <http://www.gnu.org/licenses/>. + +*/ + + +require_once('../templating.php'); +require_once($abs_path . '/utils.php'); + +$title = 'Gallery &middot; Vishwa Manoharan Photograhy'; +$meta_desc = 'Vishwa Manoharan is an aspiring wildlife, landscape, nature, macro, +people and fashion photographer and photography tutor'; + +$img_directories = array('Lanscapes' => $abs_path . '/images/gallery/land/', + 'The Little World' => $abs_path . '/images/gallery/macro/', + 'Wildlife Portraits' => $abs_path . '/images/gallery/wp/', + 'In The Wild' => $abs_path . '/images/gallery/wild/', + 'Snapshots of Life' => $abs_path . '/images/gallery/people/', + 'Frolic & Fervor' => $abs_path . '/images/gallery/fashion/'); + + +$all_images = array(); +foreach($img_directories as $g_desc => $img_dir) { + # array_slice is used to get only first 4 images. + $images = array_slice(get_images($img_dir), 0, 4); + $images_path = substr($img_dir, strlen($abs_path) + 1); + $gallery_path = substr($img_dir, strlen($abs_path) + 16); + $all_images[$g_desc] = array($images, $images_path, $gallery_path); +} + +$smarty->assign('all_images', $all_images); +$smarty->assign('title', $title); +$smarty->assign('meta_description', $meta_desc); +$smarty->display('gallery.tpl'); +