I'll give it a try. I had to change the code a bit because I don't think that I have the time to explain here how the newwws-theme works with its own configuration files. I also made the way the cookies are written a bit easier to understand for those people who have never used cookies before.
FIRST...
Place this PHP code BEFORE the line with <!DOCTYPE etc....> in album.php
`
<?php
#========================[Private album]===========================
/* $newwws_password is set in the album specific configuration file, but */
/* if the name of an album starts starts with an underscore, we consider it to be */
/* a private album too. The default-password will be zen */
if (substr(getAlbumTitle(), 0, 1) == "_" && empty($newwws_password)) $newwws_password = "zen";
/* Check if this is a private album and ask for a password */
$newwws_passwordfile = $themepath . "/" . $theme . "/" . "newwws_password.php";
if (empty($newwws_password)){
$newwws_askforpassword = false;
} else {
$newwws_askforpassword = true;
}
$newwws_password_soll = $newwws_password;
$newwws_password_ist = $_POST['newwws_pw'];
if($_COOKIE["newwws_".strtolower(str_replace(" ", "_", getAlbumTitle()))] == "OK") $newwws_password_ist = $newwws_password_soll;
if ($newwws_password_ist == $newwws_password_soll) {
$newwws_askforpassword = false;
setcookie ("newwws_".strtolower(str_replace(" ", "_", getAlbumTitle())),"OK",time()+1800, "/");
}
?>
`
SECOND...
Place this code in a new PHP-file called newwws_password.php in the same folder as album.php
`
<form name="form" method="post" action="<?php echo getPageURL(getCurrentPage()); ?>">
<label for="newwws_pw">Password:</label>
<input type="password" title="Enter your password" name="newwws_pw" />
<input type="submit" name="Submit" value="Login" />
</form>
`
THIRD...
Look in album.php for the line with the code for the thumbnails and replace it with this code. I've placed that code in a new php-file. With an include I can add that php-file to album.php:
`
<?php
if ($newwws_askforpassword){
include("$newwws_passwordfile");
} else {
/* place the original thumbs generating code here */
/* or include another php-file with the thumbs-code */
include("$newwws_thumbs_php");
}
?>
`
FOURTH...
Enhance this - I'm not a programmer
I hope this helps.
Groeten, Miriam