Location: PHPKode > projects > Buzzword > buzzword-0.8.12/gallery/rotate.php
<?php

/*
 * buzzword
 * Copyright (c) 2003 Jon Tai
 *
 * $Id: rotate.php,v 1.6 2003/12/11 04:14:00 jon Exp $
 *
 * This file is part of buzzword.
 *
 * buzzword is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * buzzword 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with buzzword; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once './config.inc';
force_admin_login();

$image = new gallery_image(import_gallery_image_key());
if (!$image->exists())
    display_error('image does not exist');

$rotation = (int) get_request_var('r');
while ($rotation < 0)
    $rotation += 360;

$image->orientation = (($image->orientation + $rotation) % 360);
$image->update();
$image->clear_cache();

header('Location: image.php?i='.$image->image_key);
exit;

?>
Return current item: Buzzword