Support Forums | Demo Gallery [1.x] [2.x] | Downloads | News | Site Map ]
Nuked Gallery
  Create a FREE account or Login   As a guest, you don't have access to our FULL navigation system.
 Forum FAQForum FAQ   StatisticsStatistics   SearchSearch   UsergroupsUsergroups   FavoritesFavorites  

More than 1 newest photo?

 
Post new topic   Reply to topic    NukedGallery.net Forum Index » PHP-Nuke Integration » Blocks View previous topicPrinter friendly versionView next topic
Author Message
Debz

Novice
Novice


Joined: May 05, 2004
Posts: 24

PostPosted: Tue Jul 06, 2004 7:39 am    Post subject: More than 1 newest photo? Reply with quote

Hey just wondering if there's a way to make the newest photo block have perhaps the last 2 or 3 newest photos (or more) displayed rather than only 1?

Cheers.
Back to top
Offline View user's profile Send private message
AdBot
   Post subject: More than 1 newest photo?  

Back to top
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6287
Location: Washington Township, NJ, USA

PostPosted: Tue Jul 06, 2004 7:49 am    Post subject: Re: More than 1 newest photo? Reply with quote

change:
PHP: › <?php $line =fgets($file4096);

        
$fileArray explode("/",$line);
        
$newestPhotoAlbum = new Album();
        
$newestPhotoAlbum->load($fileArray[1]);
        
$id $fileArray[2];
        
$index $newestPhotoAlbum->getPhotoIndex($id);
        
$PHOTO_URL makeAlbumUrl($newestPhotoAlbum->fields['name'], $id);
        
$ALBUM_URL makeAlbumUrl($newestPhotoAlbum->fields['name']);
        
$IMG "<center><a href=\"$PHOTO_URL\">" $newestPhotoAlbum->getThumbnailTag($indexscaleThumb) . $
        
$CAPTION "<br>".$newestPhotoAlbum->getCaption($index);
        
$FROM "<br>From: <a href=\"$ALBUM_URL\">" $newestPhotoAlbum->fields['title'] . '</a>';

        
$content $IMG;
        
$content .= $CAPTION;
        
$content .= $FROM?>

to
PHP: › <?php for($i=0;$i<3;$i++) {
       
$line =fgets($file4096);

        
$fileArray explode("/",$line);
        
$newestPhotoAlbum = new Album();
        
$newestPhotoAlbum->load($fileArray[1]);
        
$id $fileArray[2];
        
$index $newestPhotoAlbum->getPhotoIndex($id);
        
$PHOTO_URL makeAlbumUrl($newestPhotoAlbum->fields['name'], $id);
        
$ALBUM_URL makeAlbumUrl($newestPhotoAlbum->fields['name']);
        
$IMG "<center><a href=\"$PHOTO_URL\">" $newestPhotoAlbum->getThumbnailTag($indexscaleThumb) . $
        
$CAPTION "<br>".$newestPhotoAlbum->getCaption($index);
        
$FROM "<br>From: <a href=\"$ALBUM_URL\">" $newestPhotoAlbum->fields['title'] . '</a><br>';

        
$content $IMG;
        
$content .= $CAPTION;
        
$content .= $FROM;
?>
Back to top
Offline View user's profile Send private message Visit poster's website
Debz

Novice
Novice


Joined: May 05, 2004
Posts: 24

PostPosted: Tue Jul 06, 2004 7:57 am    Post subject: Re: More than 1 newest photo? Reply with quote

hmm i get an error Sad

my newest photo block file looks like this:
Code: › <?php

/****************************************************************************/
/* PHP-NUKE: Web Portal System                                              */
/* ===========================                                              */
/*                                                                          */
/* Copyright (c) 2002 by Francisco Burzi (fbc@mandrakesoft.com)             */
/* http://phpnuke.org                                                       */
/*                                                                          */
/* This program is free software. You can redistribute it and/or modify     */
/* it under the terms of the GNU General Public License as published by     */
/* the Free Software Foundation; either version 2 of the License.           */
/*                                                                          */
/* Block to show users albums in their Gallery which have been updated      */
/* since their last visit.                                                  */
/*                                                                          */
/* Dariush Molavi - http://www.nukedgallery.net                             */
/* email: dari@nukedgallery.net                                             */
/* version: 1.0                                                             */
/* 4 November 2003                                                          */
/*                                                                          */
/****************************************************************************/

if (eregi("block-NG-NewestPhoto.php",$PHP_SELF)) {
    Header("Location: index.html");
    die();
}

global $gallery,$GALLERY_MODULENAME,$GALLERY_EMBEDDED_INSIDE,$GALLERY_EMBEDDED_INSIDE_TYPE;

// CHANGE EACH OF THESE TO REFLECT YOUR INSTALLATION     
$GALLERY_BASEDIR = "/home/pikchaz/public_html/home/modules/Gallery/";
define(EXPIRE_TIME, 1800);
$GALLERY_MODULENAME="Gallery";
// DON"T CHANGE ANYTHING BELOW HERE

require_once($GALLERY_BASEDIR."init.php");
define(NEW_PHOTO_CACHE,$gallery->app->albumDir."/newestphoto.cache");
$content = "";
$GALLERY_EMBEDDED_INSIDE="nuke";
$GALLERY_EMBEDDED_INSIDE_TYPE = "phpnuke";

function getNewestPhoto($albumName, $depth=0) {
   global $gallery, $dateArray, $imageArray, $albumNameArray,$GALLERY_EMBEDDED_INSIDE,$GALLERY_EMBEDDED_INSIDE_TYPE, $GALLERY_MODULENAME;

   $tempDates = array();
   $tempImages = array();

   $myAlbum = new Album();
   $myAlbum->load($albumName);
   $numPhotos = $myAlbum->numPhotos(1);
        for ($i=1; $i <= $numPhotos; $i++) {
      if(!$myAlbum->getAlbumName($i)) {
         $id = $myAlbum->getPhotoId($i);       
         $index = $myAlbum->getPhotoIndex($id);
          array_push($tempDates, $myAlbum->getUploadDate($index));
         array_push($tempImages, $id);         
      }
   }

   arsort($tempDates);
   $keys = array_keys($tempDates);
   array_push($dateArray, $tempDates[$keys[0]]);
   array_push($imageArray, $tempImages[$keys[0]]);
   array_push($albumNameArray, $albumName);
}      

function scanNewestPhoto() {
   global $gallery, $dateArray, $imageArray, $albumNameArray;

   $dateArray = array();
   $imageArray = array();
   $albumNameArray = array();
   $everybody = new EverybodyUser();
   $albumDB = new AlbumDB(FALSE);

   foreach ($albumDB->albumList as $tmpAlbum) {
      if($everybody->canReadAlbum($tmpAlbum)) {
         $name = $tmpAlbum->fields["name"];
         $title = $tmpAlbum->fields["title"];
         getNewestPhoto($name);
      }
   }
}

function saveNewestPhoto() {
   global $gallery, $dateArray, $imageArray, $albumNameArray;

   arsort($dateArray);
   $dateKeys = array_keys($dateArray);

   $new_image_file = fopen(NEW_PHOTO_CACHE,"w");
   fwrite($new_image_file, $dateArray[$dateKeys[0]]."/".$albumNameArray[$dateKeys[0]]."/".$imageArray[$dateKeys[0]]);
   fclose($new_image_file);
}

function readNewestPhoto() {
   global $gallery, $GALLERY_EMBEDDED_INSIDE, $GALLERY_EMBEDDED_INSIDE_TYPE, $GALLERY_MODULENAME;

   $GALLERY_EMBEDDED_INSIDE="nuke";
   $GALLERY_EMBEDDED_INSIDE_TYPE="phpnuke";

   $file =fopen(NEW_PHOTO_CACHE,"r");
   
   $line =fgets($file);

   $fileArray = explode("/",$line);
   $newestPhotoAlbum = new Album();
   $newestPhotoAlbum->load($fileArray[1]);
   $id = $fileArray[2];
   $index = $newestPhotoAlbum->getPhotoIndex($id);
   $PHOTO_URL = makeAlbumUrl($newestPhotoAlbum->fields['name'], $id);
   $ALBUM_URL = makeAlbumUrl($newestPhotoAlbum->fields['name']);
   $IMG = "<center><a href=\"$PHOTO_URL\">" . $newestPhotoAlbum->getThumbnailTag($index) . '</a>';
   $CAPTION = "<br>".$newestPhotoAlbum->getCaption($index);
   $FROM = "<br>From: <a href=\"$ALBUM_URL\">" . $newestPhotoAlbum->fields['title'] . '</a>';

   $content = $IMG;
   $content .= $CAPTION;
   $content .= $FROM;
   
   return $content;
}

$rebuild = 0;

if (fs_file_exists(NEW_PHOTO_CACHE)) {
   $stat = fs_stat(NEW_PHOTO_CACHE);
   $mtime = $stat[9];
        if (time() - $mtime > EXPIRE_TIME) {     
                $rebuild = 1;
        }
}
else {
   scanNewestPhoto();
   saveNewestPhoto();
   $content = readNewestPhoto();
}

if($rebuild) {
        scanNewestPhoto();
        saveNewestPhoto();
        $content = readNewestPhoto();
}
else {
   $content = readNewestPhoto();
}

?>
Back to top
Offline View user's profile Send private message
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6287
Location: Washington Township, NJ, USA

PostPosted: Tue Jul 06, 2004 7:59 am    Post subject: Re: More than 1 newest photo? Reply with quote

what version of gallery are you running? what error are you getting? i can't help you if you don't give me that information.
Back to top
Offline View user's profile Send private message Visit poster's website
Debz

Novice
Novice


Joined: May 05, 2004
Posts: 24

PostPosted: Tue Jul 06, 2004 8:09 am    Post subject: Re: More than 1 newest photo? Reply with quote

Error:

Parse error: parse error, unexpected $ in /home/pikchaz/public_html/home/blocks/block-NG-NewestPhoto.php on line 152

Gallery version 1.4.3
Php: 4.3.7
Apache: 1.3.31 (unix)
Back to top
Offline View user's profile Send private message
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6287
Location: Washington Township, NJ, USA

PostPosted: Tue Jul 06, 2004 8:13 am    Post subject: Re: More than 1 newest photo? Reply with quote

did you grab the block for gallery 1.4.3? if so, in my file, line 152 reads:
PHP: › <?php scanNewestPhoto(); ?>


can you post your line 152 and make sure that there are no funky line-feeds from copy-pasting or from uploading your file.
Back to top
Offline View user's profile Send private message Visit poster's website
Debz

Novice
Novice


Joined: May 05, 2004
Posts: 24

PostPosted: Wed Jul 07, 2004 3:16 am    Post subject: Re: More than 1 newest photo? Reply with quote

ok yeah updated to the one for gallery 1.4.3 & redid it, now getting error:

ERROR: requested index [-1] out of bounds [0]
Fatal error: Call to a member function on a non-object in /home/pikchaz/public_html/home/modules/Gallery/classes/Album.php on line 1103


code now looks like this:

Code: › <?php

/****************************************************************************/
/* PHP-NUKE: Web Portal System                                              */
/* ===========================                                              */
/*                                                                          */
/* Copyright (c) 2002 by Francisco Burzi (fbc@mandrakesoft.com)             */
/* http://phpnuke.org                                                       */
/*                                                                          */
/* This program is free software. You can redistribute it and/or modify     */
/* it under the terms of the GNU General Public License as published by     */
/* the Free Software Foundation; either version 2 of the License.           */
/*                                                                          */
/* Block to show users albums in their Gallery which have been updated      */
/* since their last visit.                                                  */
/*                                                                          */
/* Dariush Molavi - http://www.nukedgallery.net                             */
/* email: dari@nukedgallery.net                                             */
/* version: 1.0                                                             */
/* 4 November 2003                                                          */
/*                                                                          */
/****************************************************************************/

if (eregi("block-NG-NewestPhoto.php",$PHP_SELF)) {
    Header("Location: index.html");
    die();
}

global $gallery,$GALLERY_MODULENAME,$GALLERY_EMBEDDED_INSIDE,$GALLERY_EMBEDDED_INSIDE_TYPE;

/*******************************************************************/
/* Full path to your Gallery, don't forget the trailing /          */
/*******************************************************************/     
$GALLERY_BASEDIR = "/home/pikchaz/public_html/home/modules/Gallery/";

/*******************************************************************/
/* Time, in seconds, to refresh random photo cache. Default is     */
/* 86400 (check it daily)                                          */
/*******************************************************************/
define(EXPIRE_TIME, 3600);

/*******************************************************************/
/* The module name of your Gallery, default is "gallery"           */
/*******************************************************************/
$GALLERY_MODULENAME="Gallery";

/*******************************************************************/
/* Size of thumbnail. Leave at 0 to use Gallery default            */
/*******************************************************************/
define(scaleThumb, 0);

// DON"T CHANGE ANYTHING BELOW HERE

require_once($GALLERY_BASEDIR."init.php");
define(NEW_PHOTO_CACHE,$gallery->app->albumDir."/newestphoto.cache");
$content = "";
$GALLERY_EMBEDDED_INSIDE="nuke";
$GALLERY_EMBEDDED_INSIDE_TYPE = "phpnuke";

function getNewestPhoto($albumName, $depth=0) {
   global $gallery, $dateArray, $imageArray, $albumNameArray,$GALLERY_EMBEDDED_INSIDE,$GALLERY_EMBEDDED_INSIDE_TYPE, $GALLERY_MODULENAME;

   $tempDates = array();
   $tempImages = array();

   $myAlbum = new Album();
   $myAlbum->load($albumName);
   $numPhotos = $myAlbum->numPhotos(1);
        for ($i=1; $i <= $numPhotos; $i++) {
      if(!$myAlbum->getAlbumName($i)) {
         $id = $myAlbum->getPhotoId($i);       
         $index = $myAlbum->getPhotoIndex($id);
          array_push($tempDates, $myAlbum->getUploadDate($index));
         array_push($tempImages, $id);         
      }
   }

   arsort($tempDates);
   $keys = array_keys($tempDates);
   array_push($dateArray, $tempDates[$keys[0]]);
   array_push($imageArray, $tempImages[$keys[0]]);
   array_push($albumNameArray, $albumName);
}      

function scanNewestPhoto() {
   global $gallery, $dateArray, $imageArray, $albumNameArray;

   $dateArray = array();
   $imageArray = array();
   $albumNameArray = array();
   $everybody = new EverybodyUser();
   $albumDB = new AlbumDB(FALSE);

   foreach ($albumDB->albumList as $tmpAlbum) {
      if($everybody->canReadAlbum($tmpAlbum)) {
         $name = $tmpAlbum->fields["name"];
         $title = $tmpAlbum->fields["title"];
         getNewestPhoto($name);
      }
   }
}

function saveNewestPhoto() {
   global $gallery, $dateArray, $imageArray, $albumNameArray;

   arsort($dateArray);
   $dateKeys = array_keys($dateArray);

   $new_image_file = fopen(NEW_PHOTO_CACHE,"w");
   fwrite($new_image_file, $dateArray[$dateKeys[0]]."/".$albumNameArray[$dateKeys[0]]."/".$imageArray[$dateKeys[0]]);
   fclose($new_image_file);
}

function readNewestPhoto() {
   global $gallery, $GALLERY_EMBEDDED_INSIDE, $GALLERY_EMBEDDED_INSIDE_TYPE, $GALLERY_MODULENAME;

   $GALLERY_EMBEDDED_INSIDE="nuke";
   $GALLERY_EMBEDDED_INSIDE_TYPE="phpnuke";

   $file =fopen(NEW_PHOTO_CACHE,"r");
for($i=0;$i<3;$i++) {
       $line =fgets($file, 4096);

        $fileArray = explode("/",$line);
        $newestPhotoAlbum = new Album();
        $newestPhotoAlbum->load($fileArray[1]);
        $id = $fileArray[2];
        $index = $newestPhotoAlbum->getPhotoIndex($id);
        $PHOTO_URL = makeAlbumUrl($newestPhotoAlbum->fields['name'], $id);
        $ALBUM_URL = makeAlbumUrl($newestPhotoAlbum->fields['name']);
        $IMG = "<center><a href=\"$PHOTO_URL\">" . $newestPhotoAlbum->getThumbnailTag($index, scaleThumb) . $
        $CAPTION = "<br>".$newestPhotoAlbum->getCaption($index);
        $FROM = "<br>From: <a href=\"$ALBUM_URL\">" . $newestPhotoAlbum->fields['title'] . '</a><br>';

        $content = $IMG;
        $content .= $CAPTION;
        $content .= $FROM;
}    
   return $content;
}

$rebuild = 0;

if (fs_file_exists(NEW_PHOTO_CACHE)) {
   $stat = fs_stat(NEW_PHOTO_CACHE);
   $mtime = $stat[9];
        if (time() - $mtime > EXPIRE_TIME) {     
                $rebuild = 1;
        }
}
else {
   scanNewestPhoto();
   saveNewestPhoto();
   $content = readNewestPhoto();
}

if($rebuild) {
        scanNewestPhoto();
        saveNewestPhoto();
        $content = readNewestPhoto();
}
else {
   $content = readNewestPhoto();
}

?>



The block for 1.4.3 by itself without editing the code works ok.
Back to top
Offline View user's profile Send private message
maniaka

Knowledgeable User
Knowledgeable User


Joined: Nov 01, 2003
Posts: 40

PostPosted: Thu Jul 08, 2004 6:02 pm    Post subject: Re: More than 1 newest photo? Reply with quote

This is a good block for central new images. whit 3 or 5 images, a new central block its a good idea.


Thx
Back to top
Offline View user's profile Send private message Visit poster's website
Debz

Novice
Novice


Joined: May 05, 2004
Posts: 24

PostPosted: Fri Jul 09, 2004 8:32 pm    Post subject: Re: More than 1 newest photo? Reply with quote

my line 152 in newestphoto block file = scanNewestPhoto();


I am still getting the error:

ERROR: requested index [-1] out of bounds [0]
Fatal error: Call to a member function on a non-object in /home/pikchaz/public_html/home/modules/Gallery/classes/Album.php on line 1103

my line 1103 in Album.php =

if ($photo->isAlbum())
Back to top
Offline View user's profile Send private message
banjolawyer

Beginner
Beginner


Joined: Aug 08, 2004
Posts: 5

PostPosted: Wed Aug 18, 2004 9:07 pm    Post subject: Re: More than 1 newest photo? Reply with quote

Has anyone figured out a solution to this? I tried changing isAlbum to getAlbum, but that didn't work.
Back to top
Offline View user's profile Send private message
hook

Beginner
Beginner


Joined: Mar 15, 2005
Posts: 2

PostPosted: Wed Aug 24, 2005 11:48 am    Post subject: Re: More than 1 newest photo? Reply with quote

I downloaded block-NG-NewestPhoto143.zip Version 1.0 dated nov 4 2003.

I would like to have more than one newest photo shown and I tried what was listed in this thread and I got the same error as the person above

ERROR: requested index [-1] out of bounds [0]
Fatal error: Call to a member function on a non-object in /home3/silverla/www/nuke/html/modules/gallery/classes/Album.php on line 1103

I am using Gallery 1.5 and PHPnuke 7.6 and the stock block works fine. If this can be made to work it would be possible to choose how many new photos to show.

I like the updated album block but it doesn't show thumbnails otherwise it would work for what I need.

Any help is much appreciated
Thanks,
Hook
Back to top
Offline View user's profile Send private message
kerflop

Beginner
Beginner


Joined: Aug 11, 2003
Posts: 3

PostPosted: Thu Sep 01, 2005 5:21 pm    Post subject: Re: More than 1 newest photo? Reply with quote

Hey Dari:

I am using Gallery 1.5 with block-NG-NewestPhoto143 and I am wanting the same thing. The ability to view more than one (scrolling like the Random photo block preferably) in the block...

The code for block-NG-NewestPhoto143.zip is:
Code: › <?php

/****************************************************************************/
/* PHP-NUKE: Web Portal System                                              */
/* ===========================                                              */
/*                                                                          */
/* Copyright (c) 2002 by Francisco Burzi (fbc@mandrakesoft.com)             */
/* http://phpnuke.org                                                       */
/*                                                                          */
/* This program is free software. You can redistribute it and/or modify     */
/* it under the terms of the GNU General Public License as published by     */
/* the Free Software Foundation; either version 2 of the License.           */
/*                                                                          */
/* Block to show users albums in their Gallery which have been updated      */
/* since their last visit.                                                  */
/*                                                                          */
/* Dariush Molavi - http://www.nukedgallery.net                             */
/* email: dari@nukedgallery.net                                             */
/* version: 1.0                                                             */
/* 4 November 2003                                                          */
/*                                                                          */
/****************************************************************************/

if (eregi("block-NG-NewestPhoto.php",$PHP_SELF)) {
    Header("Location: index.php");
    die();
}

global $gallery,$GALLERY_MODULENAME,$GALLERY_EMBEDDED_INSIDE,$GALLERY_EMBEDDED_INSIDE_TYPE;

/*******************************************************************/
/* Full path to your Gallery, don't forget the trailing /          */
/*******************************************************************/     
$GALLERY_BASEDIR = "XXXXXXXXXXXXXXXXXXXXXXXXX";

/*******************************************************************/
/* Time, in seconds, to refresh random photo cache. Default is     */
/* 86400 (check it daily)                                          */
/*******************************************************************/
define(EXPIRE_TIME, 3600);

/*******************************************************************/
/* The module name of your Gallery, default is "gallery"           */
/*******************************************************************/
$GALLERY_MODULENAME="gallery";

/*******************************************************************/
/* Size of thumbnail. Leave at 0 to use Gallery default            */
/*******************************************************************/
define(scaleThumb, 0);

// DON"T CHANGE ANYTHING BELOW HERE

require_once($GALLERY_BASEDIR."init.php");
define(NEW_PHOTO_CACHE,$gallery->app->albumDir."/newestphoto.cache");
$content = "";
$GALLERY_EMBEDDED_INSIDE="nuke";
$GALLERY_EMBEDDED_INSIDE_TYPE = "phpnuke";

function getNewestPhoto($albumName, $depth=0) {
   global $gallery, $dateArray, $imageArray, $albumNameArray,$GALLERY_EMBEDDED_INSIDE,$GALLERY_EMBEDDED_INSIDE_TYPE, $GALLERY_MODULENAME;

   $tempDates = array();
   $tempImages = array();

   $myAlbum = new Album();
   $myAlbum->load($albumName);
   $numPhotos = $myAlbum->numPhotos(1);
        for ($i=1; $i <= $numPhotos; $i++) {
      if(!$myAlbum->getAlbumName($i)) {
         $id = $myAlbum->getPhotoId($i);       
         $index = $myAlbum->getPhotoIndex($id);
          array_push($tempDates, $myAlbum->getUploadDate($index));
         array_push($tempImages, $id);         
      }
   }

   arsort($tempDates);
   $keys = array_keys($tempDates);
   array_push($dateArray, $tempDates[$keys[0]]);
   array_push($imageArray, $tempImages[$keys[0]]);
   array_push($albumNameArray, $albumName);
}      

function scanNewestPhoto() {
   global $gallery, $dateArray, $imageArray, $albumNameArray;

   $dateArray = array();
   $imageArray = array();
   $albumNameArray = array();
   $everybody = new EverybodyUser();
   $albumDB = new AlbumDB(FALSE);

   foreach ($albumDB->albumList as $tmpAlbum) {
      if($everybody->canReadAlbum($tmpAlbum)) {
         $name = $tmpAlbum->fields["name"];
         $title = $tmpAlbum->fields["title"];
         getNewestPhoto($name);
      }
   }
}

function saveNewestPhoto() {
   global $gallery, $dateArray, $imageArray, $albumNameArray;

   arsort($dateArray);
   $dateKeys = array_keys($dateArray);

   $new_image_file = fopen(NEW_PHOTO_CACHE,"w");
   fwrite($new_image_file, $dateArray[$dateKeys[0]]."/".$albumNameArray[$dateKeys[0]]."/".$imageArray[$dateKeys[0]]);
   fclose($new_image_file);
}

function readNewestPhoto() {
   global $gallery, $GALLERY_EMBEDDED_INSIDE, $GALLERY_EMBEDDED_INSIDE_TYPE, $GALLERY_MODULENAME;

   $GALLERY_EMBEDDED_INSIDE="nuke";
   $GALLERY_EMBEDDED_INSIDE_TYPE="phpnuke";

   $file =fopen(NEW_PHOTO_CACHE,"r");
   
   $line =fgets($file, 4096);

   $fileArray = explode("/",$line);
   $newestPhotoAlbum = new Album();
   $newestPhotoAlbum->load($fileArray[1]);
   $id = $fileArray[2];
   $index = $newestPhotoAlbum->getPhotoIndex($id);
   $PHOTO_URL = makeAlbumUrl($newestPhotoAlbum->fields['name'], $id);
   $ALBUM_URL = makeAlbumUrl($newestPhotoAlbum->fields['name']);
   $IMG = "<center><a href=\"$PHOTO_URL\">" . $newestPhotoAlbum->getThumbnailTag($index, scaleThumb) . '</a>';
   $CAPTION = "<br>".$newestPhotoAlbum->getCaption($index);
   $FROM = "<br>From: <a href=\"$ALBUM_URL\">" . $newestPhotoAlbum->fields['title'] . '</a>';

   $content = $IMG;
   $content .= $CAPTION;
   $content .= $FROM;
   
   return $content;
}

$rebuild = 0;

if (fs_file_exists(NEW_PHOTO_CACHE)) {
   $stat = fs_stat(NEW_PHOTO_CACHE);
   $mtime = $stat[9];
        if (time() - $mtime > EXPIRE_TIME) {     
                $rebuild = 1;
        }
}
else {
   scanNewestPhoto();
   saveNewestPhoto();
   $content = readNewestPhoto();
}

if($rebuild) {
        scanNewestPhoto();
        saveNewestPhoto();
        $content = readNewestPhoto();
}
else {
   $content = readNewestPhoto();
}

?>


I have tried to do what you suggest in previous post, but no luck...

Thanks
Bob
Back to top
Offline View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    NukedGallery.net Forum Index » PHP-Nuke Integration » Blocks View previous topicPrinter friendly versionView next topic

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours

Powered by phpBB © phpBB Group



Sponsors: Dedicated ServersDomain NamesWeb HostingDomain Name RegistrationDedicated Web HostingWeb Design New YorkCompare VoIPseo packagesSEO CompanyNew York Yellow PagesFind LocationsVOIP Phone ServiceNeckermannOnline internetSEORestaurant Locator • Get great HP coupons from CouponSnapshot • Search for great dell coupons at CouponSnapshot.com.au • Graduation DressesAndroid TabletSEO IndiaBuy Phen375fuel filter

8th year online! 2003-2011
Legal • Use of this site consitutes agreement to the Acceptable Use Policy
Hosted by Implosion WorksSourceForge.net Logo • Theme by TonicMedia