1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
| <?php
require 'includes/initialize.inc.php';
// page protected
if ($pgID == ''): header('location: pglogin.php?location=pgaddpublicphotos.php'); exit; endif;
$message = $t['enter info'];
// check submitted values
$path = "photographers/$pgID";
if (is_uploaded_file($file)):
$random = random();
copy($file, "temp/".$file_name);
if (@create_thumbnail("temp",$path,$file_name,"400")==false): continue; endif;
unlink("temp/".$file_name);
$fullname = $path."/".$file_name;
$time = time();
mysql_query("INSERT INTO plphotos VALUES ('$random', '$pgID', 'public', '', '$caID', '$fullname', '$description','','$time')"); $message = $t['success'].' '.$t['add more files'];
endif;
//////////////////// start output
require 'header.inc.php';
?>
<table width="100%" cellpadding="7"><tr><td width="65%">
<p>
<span class=header><?php print $t['add public photos'] ?></span><br>
<?php
$sql ="select * from plphotos where phAuthorID = '$pgID' and phStatus = 'public'";
// thumbnails
$res = mysql_query($sql);
if (mysql_num_rows($res)==0):
print $t['nothing to show'];
else:
$output .= '<table cellpadding=1 cellspacing=4 width=99% class="dotted"><tr class="odd">';
$i = 0;
while ($row = mysql_fetch_array($res))
{
$output .= '<td><div align=center class="smalltext">
['.getvalue("plcategories","caTitle_","caID",$row['phCategoryID']).']<br>
<a class="smalltext" target="_blank" href="photodetails.php?phID='.$row['phID'].'"><img border=0 class=photo border=0 hspace=3 vspace=0 src=thumbnail.jpg.php?phID='.$row['phID'].'><br>';
$output .= $t['enlarge'].'</a> |
<a class="smalltext" href=pgdeletephotos.php?returnpath=pgaddpublicphotos.php&phID='.$row['phID'].' onclick="return confirm(';
$output .= "'".$t['are you sure']."'";
$output .= ')">'.$t['delete'].'</a></div></td>';
$i = $i+1;
if ($i % 8 == 0): $output .= '</tr><tr class="odd">';
elseif ($i % 4 == 0): $output .= '</tr><tr class="even">'; endif;
}
$output .= '</tr></table>';
print $output;
endif;
// thumbnails end
?></p>
</td><td width="35%">
<div class="header"><?php print $t['Add Photos'] ?></div>
<br>
<p class="sticknote">
<?php print $message ?>
<br><br>
<?php require 'includes/form_addpublicphotos.inc.php' ?>
</p>
</td></tr></table>
<?php require 'footer.inc.php' ?> |
Partager