Almost a year ago I made this post.
Now I have found a solution that works for me.
Look for these lines in thumbnails.php:
display_thumbnails($album, (isset($cat) ? $cat : 0), $page, $CONFIG['thumbcols'], $CONFIG['thumbrows'], true);
pagefooter();
And add the following lines between these two lines:
?>
<form method="post" action="placeorder.php">
<table border="0" bgcolor="#ececec" cellspacing="5">
<tr><td>Naam / Name</td><td><input type="text" size="30" name="name"></td></tr>
<tr><td>Email address</td><td><input type="text" size="30" name="email"></td></tr>
<tr><td valign="top">Opmerkingen /<br>Comments</td><td><textarea name="comments" rows="6" cols="30"></textarea></td></tr>
<tr><td> </td><td><input type="submit" value="Verstuur / Send"></td></tr>
</table></form>
<?
The code for placeorder.php is this:
<?php
define('IN_COPPERMINE', true);
define('THUMBNAILS_PHP', true);
define('INDEX_PHP', true);
require('include/init.inc.php');
require('include/mailer.inc.php');
$user_name = trim(stripslashes($_POST['name']));
$user_mail = trim(stripslashes($_POST['email']));
$user_mssg = trim(stripslashes($_POST['comments']));
if (count($FAVPICS)>0) {
$message = "Er is een order geplaatst door: $user_name<br>eMail: $user_mail.<br><br>Opmerking:<br>$user_mssg<br><br>Details worden hieronder weergegeven.<br><br>";
$favs = implode(",",$FAVPICS);
$select_columns = "filename,{$CONFIG['TABLE_PICTURES']}.title as pic_title,pid,{$CONFIG['TABLE_ALBUMS']}.title as alb_title";
$result = db_query("SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']},{$CONFIG['TABLE_ALBUMS']} WHERE approved = 'YES'AND pid IN ($favs) AND {$CONFIG['TABLE_ALBUMS']}.aid = {$CONFIG['TABLE_PICTURES']}.aid");
$rowset = db_fetch_rowset($result);
foreach ($rowset as $key => $row){
$message .= $rowset[$key]['pic_title']." (pid ".$rowset[$key]['pid'].") uit ".$rowset[$key]['alb_title']." album met afbeeldingnummer ".$rowset[$key]['filename']."<br>";
}
$query = "SELECT user_email FROM {$CONFIG['TABLE_USERS']} WHERE user_id=1";
$result = db_query($query);
$row = mysql_fetch_array($result);
$subject = "Order from Coppermine";
$result = cpg_mail($row['user_email'], $subject, $message, 'text/html', "eMail from", "your email adress");
if ($result) {
pageheader("Plaats bestelling", "<META http-equiv=\"refresh\" content=\"3;url=index.php\">");
msg_box($lang_cpg_die[INFORMATION], "Uw bestelling is succesvol verzonden...<br>Your order has been send succesfully...", $lang_continue, "index.php");
pagefooter();
ob_end_flush();
exit;
} else {
cpg_die(ERROR, "Er is iets fout gegaan bij het verwerken van uw bestelling.<br>Something went wrong with your order. Please send again.", __FILE__, __LINE__);
}
}
?>
Hope this will help and good luck.
Rob