HI, just like to find out is there anyone out there who can make "comment for registered user only" by default? Meaning that I dont have to go into each album and change the setting permission "who can make comment" to LOGGEDIN.. Instead, I want all album that created to be "LOGGEDIN" by default.
Thanks in advance for those who can reply me and thanks for those who are reading it.
Posts: 3474
Eventually we'll make this easier.
For now... you'll want to edit the code in util.php just a bit.
Find the createNewAlbum() function.
Change these lines:
to
-Beckett (
)
Posts: 3
becket: I added the code in but seems like it's still the same. Here is the coding...
function createNewAlbum( $parentName, $newAlbumName="", $newAlbumTitle="", $newAlbumDesc="") {
global $gallery;
// get parent album name
$albumDB = new AlbumDB(FALSE);
// set new album name from param or default
$gallery->session->albumName = $albumDB->newAlbumName($newAlbumName);
$gallery->album = new Album();
$gallery->album->fields["name"] = $gallery->session->albumName;
// set title and description
if ($newAlbumTitle) {
$gallery->album->fields["title"] = $newAlbumTitle;
}
if ($newAlbumDesc) {
$gallery->album->fields["description"] = $newAlbumDesc;
}
$gallery->album->setOwner($gallery->user->getUid());
$loggedIn = $gallery->userDB->getLoggedIn();
$loggedInUid = $loggedIn->getUid();
$gallery->album->setAddComments($loggedInUid, 1);
$gallery->album->save();
/* if this is a nested album, set nested parameters */
if ($parentName) {
.... blah blah blah blah
}
Please advice. Thanks.
Posts: 3474
Oops. I goofed ;) I need more sleep....!
Try this instead:
Gotta turn off EVERYBODY first... *then* add LOGGEDIN. Let me know how that goes.
Posts: 3474
Ooh... a little more thought tells me that the UIDs for these guys are straightforward, so instead you could replace all that with just:
That's a little clearer.
-Beckett (
)
Posts: 3
cool beckett.. it's what I wanted right now... thanks for your time, effort and coding.