Location: PHPKode > scripts > 2BGal > 2bgal/admin/photointro_herite.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_albumsrc"])) {$id_albumsrc=$_GET["id_albumsrc"];} else {$id_albumsrc=0;}
if (isset($_GET["id_albumdest"])) {$id_albumdest=$_GET["id_albumdest"];} else {$id_albumdest=0;}

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

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

//action demandee

echo "<p class=\"actionresult\">\n";

$chaine="SELECT image FROM $tbl_alist WHERE id=".$id_albumsrc." AND idpere=".$id_albumdest;
$request = MYSQL_QUERY($chaine);
$nb_album = MYSQL_NUMROWS($request);
if ($nb_album>0)
{
	$imagefils = mysql_result($request,0,"image");
	$chaine="SELECT id FROM $tbl_alist WHERE id=".$id_albumdest;
	$request = MYSQL_QUERY($chaine);
	$nb_album = MYSQL_NUMROWS($request);
	if ($nb_album>0)
	{
		$chaine="UPDATE ".$tbl_alist." SET image='".$imagefils."' WHERE id=".$id_albumdest;
		$request = MYSQL_QUERY($chaine);
		echo "<img src=\"actionok.png\" alt=\"\" />".$txt_modif."<br /><br />";
	}
}
echo "</p>\n";
$admaction="";
include("default.inc.php");
?>
Return current item: 2BGal