|
|
Posted by meltedown on 11/17/05 21:38
FayeC wrote:
> I have created a site in Joomla with a login (no self registration,
> users are provided with username and password by the admin).
> The users are supposed to login to a specific page where they can see
> 4 images.
> I have the following code:
> <?php
> // define directory path
> $dir = "images/user1/";
>
> // iterate through files
> // look for JPEGs
> if (is_dir($dir)) {
> if ($dh = opendir($dir)) {
> while (($file = readdir($dh)) !== false) {
> if (preg_match("/.jpg/", $file)) {
> // read EXIF headers
> $exif = exif_read_data($file, 0, true);
> echo "<tr>";
> // get thumbnail
> // link to full image
> echo "<td valign=top><a
> href=$dir/$file><imgsrc=thumbnail.php?file=$file></a><td>";
> echo "<td valign=top><font size=-1>";
> // get file name
> echo "File: <b>" . $exif['FILE']['FileName'] .
> "</b><br/>";
> // get timestamp
> echo "Timestamp: " . $exif['IFD0']['DateTime'] .
> "<br/>";
> // get image dimensions
> echo "Dimensions: " . $exif['COMPUTED']['Height'] . "
> x " . $exif['COMPUTED']['Height'] . " <br/>";
> // get camera make and model
> echo "Camera: " . $exif['IFD0']['Model'];
> echo "</font></td>";
> echo "</tr>";
> }
> }
> closedir($dh);
> }
> }
> ?>
>
> The question now is how to change the code to dimamically replace the
> folder name by the login username used.
> For example....if user2 logs in the images loaded will be only those
> in the folder images/user2, if user3 logs in it will be from the
> folder images/user3, etc...
> I am a little confused as to how to implement that in Joomla but as
> long as I have the code right I thinkI can just insert the code into
> the appropriate page using a mambot.
> If anybody here has any tips on how to accomplish that it would be
> extremely appreciated.
> Thank you in advance,
>
>
> FayeC
I'm not sure if your question is as easy as it seems, but it seems like
all you need to do is instead of
$dir = "images/user1/";
you go $dir="image/$username";
Navigation:
[Reply to this message]
|