Location: PHPKode > scripts > 2BGal > 2bgal/admin/photointro_direct.inc.php
<?php
// Copyright 2003 Benjamin Py [www.ben3w.com] 

// This file is part of 2BGAL
// 2BGAL 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.
// 2BGAL 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 2BGAL ; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

//securite #1 : pas d'appel direct du fichier
if (!defined('STAYONINCLUDE')) {exit;}
stayoninclude();

//recuperation des variables
if (isset($_GET["id_album"])) {$id_album=$_GET["id_album"];} else {$id_album=0;}
if (isset($_GET["id_img"])) {$id_img=$_GET["id_img"];} else {$id_img=0;}

//securite #2 : type des variables
if (!ereg("^([0-9]+)$",$id_album,$secereg)) {$id_album=0;}
if (!ereg("^([0-9]+)$",$id_img,$secereg)) {$id_img=0;}

//inclusion langue
$lang_filename = "lang/".$lang."/photointro_direct.inc.php";
require($lang_filename);

//action demandee
//------------------------------------------------------------
//changer la photo d'intro d'un album (série ou standalone)
echo "<p class=\"actionresult\">\n";
$chaine="SELECT url FROM $tbl_ilist WHERE id=".$id_img." AND album=".$id_album;
$request = MYSQL_QUERY($chaine);
$nb_image = MYSQL_NUMROWS($request);
if ($nb_image>0)
{
	$url = mysql_result($request,0,"url");
	$chaine="SELECT folder FROM $tbl_alist WHERE id=".$id_album;
	$request = MYSQL_QUERY($chaine);
	$nb_album = MYSQL_NUMROWS($request);
	if ($nb_album>0)
	{
		$folder = mysql_result($request,0,"folder");
		$chaine2="UPDATE ".$tbl_alist." SET image='".$folder."/mini_".$url."' WHERE id=".$id_album;
		$request2 = MYSQL_QUERY($chaine2);
		echo "<img src=\"actionok.png\" alt=\"\" />".$txt_modif."<br /><br />";
	}
}
echo "</p>\n";
$admaction="";
include("default.inc.php");
?>
Return current item: 2BGal