| Author |
Message |
executive
Novice


Joined: Aug 10, 2003 Posts: 25
|
Posted: Sun Aug 10, 2003 11:16 am Post subject: block customization |
|
|
i'm using the NG-newAlbums-Horozontal block and i was wondering if anyone knew how to make it only three album across. better yet, 3 albums across and 2 albums down. making a total of 6 images. i think it would look really neat with each album at 150x150 pixel.
----
nothing to report. only a request.. |
|
| Back to top |
|
|
AdBot
|
| Post subject: block customization |
|
|
|
|
|
| Back to top |
|
 |
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Sun Aug 10, 2003 12:18 pm Post subject: |
|
|
Yep - it's certainly possible. Look how I have it working:
http://www.esp3.net
Scroll down to the bottom. Not quite the same but uses the same technique!  |
|
| Back to top |
|
|
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Sun Aug 10, 2003 1:14 pm Post subject: Re: block customization |
|
|
I've had a play with the block. Cut and paste the following code, making sure you overwrite the existing code:
Code: ›
/* DON"T CHANGE ANYTHING BELOW HERE */
global $gallery, $prefix, $cookie, $user;
require_once($GALLERY_BASEDIR."init.php");
cookiedecode($user);
$username = $cookie[1];
if( is_user($user) ) {
$tempUser = new LoggedInUser();
}
else {
$tempUser = new EverybodyUser();
}
$albumNameCache = array();
$albumDateCache = array();
$content = "";
$albumDB = new AlbumDB(FALSE);
$scaleTo = 150;
foreach ($albumDB->albumList as $tmpAlbum) {
$name = $tmpAlbum->fields["name"];
$tempAlbum = new Album();
$tempAlbum->load($name);
if(($tempUser->canReadAlbum($tempAlbum)) || ($tempUser->isLoggedIn() && !$gallery->session->offline)) {
array_push($albumNameCache,$name);
array_push($albumDateCache,$tempAlbum->fields['clicks_date']);
}
}
arsort($albumDateCache);
$keys = array_keys($albumDateCache);
$content .= "<center><table border=\"0\"><tr align=\"center\">";
for($i=0;$i<6;$i++){
$parentTitle = "";
$currentAlbum = new Album();
$albumName = $albumNameCache[$keys[$i]];
$currentAlbum->load($albumName);
if($currentAlbum->fields['parentAlbumName']) {
$parentAlbum = new Album();
$parentAlbum->load($currentAlbum->fields['parentAlbumName']);
$parentTitle .= $parentAlbum->fields['title']." - ";
}
if($i == 3) { $content .= "</tr><tr>"; }
$content .= "<td align=\"center\"><a href=\"".WEB_BASE_ADDR."modules.php?set_albumName=".$albumName."&op=modload&name=".GALLERY_NAME."&file=index&include=view_album.php\">";
if(USE_THUMBS) {
$content .= $currentAlbum->getHighlightTag($scaleTo)."<br>";
}
$content .= $parentTitle."".$currentAlbum->fields['title']."</a></td>";
}
$content .= "</tr></table></center>"; |
|
| Back to top |
|
|
executive
Novice


Joined: Aug 10, 2003 Posts: 25
|
Posted: Sun Aug 10, 2003 6:18 pm Post subject: Re: block customization |
|
|
i like the site and really like your LATEST PAPARAZZI. anyway thanks for the mod and i'll apply and post back.
OT: why do i have to log in everytime i visit this site? is it possible to remember the users? |
|
| Back to top |
|
|
executive
Novice


Joined: Aug 10, 2003 Posts: 25
|
Posted: Sun Aug 10, 2003 6:42 pm Post subject: |
|
|
hello again slackbladder, is there a way so that i can customize the block myself? i hate to keep coming back and bothering you. sooner or later you'll ignore me. lol!
anyway, if i can make one more request, can you make it just 3 albums across and a link to the gallery bellow it? i find that there's no more room for articles.
this will be my last request for some time. |
|
| Back to top |
|
|
executive
Novice


Joined: Aug 10, 2003 Posts: 25
|
Posted: Sun Aug 10, 2003 6:57 pm Post subject: |
|
|
i think i did it myself. lol! i had no idea what i was doing but her's what i changed:
for($i=0;$i<6;$i++){
to
for($i=0;$i<3;$i++){
now gotta figure out a way to add a link to my album gallery at the bottom of the random block.  |
|
| Back to top |
|
|
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Mon Aug 11, 2003 1:40 am Post subject: |
|
|
NICE ONE!
Let us know if you get stuck! |
|
| Back to top |
|
|
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Mon Aug 11, 2003 1:44 am Post subject: Re: block customization |
|
|
executive wrote: › OT: why do i have to log in everytime i visit this site? is it possible to remember the users?
It's so the UPDATED GALLERIES block on the left works. It needs users to log out and log back in again to allow the MOD to show what has changed since their last visit. The session time for the cookie has been reduced to something like 30 mins. |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
|
Posted: Mon Aug 11, 2003 7:14 am Post subject: |
|
|
| actually, i think it's an hour. but it's the only way to force a user to log in when they revisit the page (i think the old session time was something like a year). i know it's a PITA, but you can tweak the session time on your site if you use that block, just change the value that's in the index.php patch file from 3600 to something else. |
|
| Back to top |
|
|
|
|
|
|
|