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  

[TESTING] Newest Photo Block
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    NukedGallery.net Forum Index » PHP-Nuke Integration » Blocks View previous topicPrinter friendly versionView next topic
Author Message
dari

Site Admin
Site Admin


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

PostPosted: Tue Nov 04, 2003 1:49 pm    Post subject: [TESTING] Newest Photo Block Reply with quote

If you would be interested in testing the Newest Photo block, as seen on http://phpnuke.nukedgallery.net (lower left block), please post here. If there are enough responses, I will make it available for download.

This block scans your albums, and calculates the newest photo, based on upload date. The result is written to disk for speed purposes. The cache file is checked/updated once per hour to maintain a near real-time experience.
Back to top
Offline View user's profile Send private message Visit poster's website
AdBot
   Post subject: [TESTING] Newest Photo Block  

Back to top
dari

Site Admin
Site Admin


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

PostPosted: Tue Nov 04, 2003 2:23 pm    Post subject: Reply with quote

Alrighty, grab the file here:
http://www.nukedgallery.net/download-file-28.html
Back to top
Offline View user's profile Send private message Visit poster's website
plainrice

Beginner
Beginner


Joined: Nov 01, 2003
Posts: 4

PostPosted: Wed Nov 05, 2003 4:43 am    Post subject: Reply with quote

Hi Dari, I've just tried to install the newest photo block. I have changed the path to reflect my gallery installation, but I get several errors. I am using php-nuke 6.9, and gallery 1.4.1 (i forget which cvs).

Taking the errors one at a time, I get a similar foreach() error as seen a lot in the random block. I have read your FAQ (D1), however, there is not a similar "session" variable to change as in the random block. Here are my exact errors:

Warning: Invalid argument supplied for foreach() in /homepages/12/d88411853/htdocs/blocks/block-NG-NewestPhoto.php on line 75

Warning: arsort() expects parameter 1 to be array, null given in /homepages/12/d88411853/htdocs/blocks/block-NG-NewestPhoto.php on line 85

Warning: First argument to array_keys() should be an array in /homepages/12/d88411853/htdocs/blocks/block-NG-NewestPhoto.php on line 86
ERROR: requested index [-1] out of bounds [0]
Fatal error: Call to a member function on a non-object in /homepages/12/d88411853/htdocs/modules/gallery/classes/Album.php on line 987

Line 75-ish area is:

Code: › function scanNewestPhoto() {
   global $gallery, $albumDB;

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


Any ideas?

-Geoff-
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: Wed Nov 05, 2003 8:13 am    Post subject: Re: [TESTING] Newest Photo Block Reply with quote

yep, i'm seeing it too...let me get a fix worked up.
Back to top
Offline View user's profile Send private message Visit poster's website
dari

Site Admin
Site Admin


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

PostPosted: Wed Nov 05, 2003 8:31 am    Post subject: Reply with quote

ok, here's a patch, it should work just fine:
Code: ›
--- block-NG-NewestPhoto.php    2003-11-04 14:18:17.000000000 -0500
+++ block-NG-NewestPhoto-new.php        2003-11-05 08:26:11.000000000 -0500
@@ -38,12 +38,6 @@
 define(NEW_PHOTO_CACHE,$gallery->app->albumDir."/newestphoto.cache");
 $content = "";
 
-$albumDB = new AlbumDB(FALSE);
-
-$dateArray = array();
-$imageArray = array();
-$albumNameArray = array();
-
 function getNewestPhoto($albumName, $depth=0) {
        global $gallery, $dateArray, $imageArray, $albumNameArray;
 
@@ -70,7 +64,13 @@
 }
 
 function scanNewestPhoto() {
-       global $gallery, $albumDB;
+       global $gallery, $dateArray, $imageArray, $albumNameArray;
+
+       $dateArray = array();
+       $imageArray = array();
+       $albumNameArray = array();
+
+       $albumDB = new AlbumDB(FALSE);
 
        foreach ($albumDB->albumList as $tmpAlbum) {
                $name = $tmpAlbum->fields["name"];


the lines with a "-" in front of them get deleted, the lines with a "+" in front of them get added in. an updated download has been posted.
Back to top
Offline View user's profile Send private message Visit poster's website
plainrice

Beginner
Beginner


Joined: Nov 01, 2003
Posts: 4

PostPosted: Wed Nov 05, 2003 11:44 am    Post subject: Reply with quote

That worked. Thanks a bunch for your work and support.
Back to top
Offline View user's profile Send private message
plainrice

Beginner
Beginner


Joined: Nov 01, 2003
Posts: 4

PostPosted: Wed Nov 05, 2003 8:21 pm    Post subject: Reply with quote

Found another small problem. The newest photo seems to show up fine, but when you click on the photo or the album, an error page comes up: "Sorry, such file doesn't exist..." The address in the location bar it's trying to load is: "http://www.plainrice.com/modules.php?set_albumName=arborfest08312002&id=My_Pictures0024&op=modload&name=&file=index&include=view_photo.php"
Back to top
Offline View user's profile Send private message
Stevesteve

Beginner
Beginner


Joined: Sep 09, 2003
Posts: 13

PostPosted: Thu Nov 06, 2003 2:04 am    Post subject: Reply with quote

I get this as well. The problem appears to be that "name" is blank.

eg op=modload&name=&file=index
where it should be
op=modload&name=gallery&file=index

If you add "gallery" to the url it works fine, how do we update the blocks? On my (new) site both blocks are having the problem (block-NG-mostPopular and block-NG-NewestPhoto)
eg http://www.getitindia.net

Cheers,
Steve Wink
Back to top
Offline View user's profile Send private message
efurban

Beginner
Beginner


Joined: Nov 01, 2003
Posts: 5

PostPosted: Thu Nov 06, 2003 4:42 am    Post subject: Re: [TESTING] Newest Photo Block Reply with quote

here is the solution (hehe, my first post here):

1. change $GALLERY_MODULENAME to $GALLERY_MODULENAME_LOCAL
at the beginning, as well as in the readNewestPhoto() function of the original code

2. in readNewestPhoto() function, add
$GALLERY_MODULENAME=$GALLERY_MODULENAME_LOCAL;
after the global $balabalabal.... line.

done!

let me know if you have any problem.

Smile
Back to top
Offline View user's profile Send private message
plainrice

Beginner
Beginner


Joined: Nov 01, 2003
Posts: 4

PostPosted: Thu Nov 06, 2003 1:56 pm    Post subject: Reply with quote

Stevesteve wrote: › I get this as well. The problem appears to be that "name" is blank.

eg op=modload&name=&file=index
where it should be
op=modload&name=gallery&file=index

If you add "gallery" to the url it works fine


Agreed, that seems to work. I'm gonna look through the code to see what I can find....Dari a lil' help tho?
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: Thu Nov 06, 2003 2:19 pm    Post subject: Reply with quote

hmm..well the latest code bunch available should work, depending on your gallery version. The GALLERY_MODULENAME variable should work, though it may just be available on the 1.4.1 CVS version (which you should upgrade to once it is finally released..lots of cool features Wink ).
Back to top
Offline View user's profile Send private message Visit poster's website
Stevesteve

Beginner
Beginner


Joined: Sep 09, 2003
Posts: 13

PostPosted: Thu Nov 06, 2003 5:55 pm    Post subject: Reply with quote

i'm using the same cvs version of gallery as you guys, v1.4.1-cvs-b208 so it shouldn't be a problem with the gallery itself.

I.ve made the changes suggested by efurban but no luck....i must be missing something.. will keep looking

Thanks for your help,
Steve
Back to top
Offline View user's profile Send private message
islandman

Beginner
Beginner


Joined: Nov 06, 2003
Posts: 1

PostPosted: Sun Nov 09, 2003 12:59 am    Post subject: Reply with quote

I'm also getting this error

Quote: ›
eg op=modload&name=&file=index
where it should be
op=modload&name=gallery&file=index


using:
gallery-1.4-pl2
PhpNuke6.9

tried efurban's suggestion but it did not work either.

Rolling Eyes
Back to top
Offline View user's profile Send private message
Stevesteve

Beginner
Beginner


Joined: Sep 09, 2003
Posts: 13

PostPosted: Sun Nov 09, 2003 6:31 pm    Post subject: Reply with quote

fixed!

in the newest block files, after the line "global $gallery;" (about line 30)

add

"global $GALLERY_MODULENAME;" (without the quotes obviously).

It works with or with out the changes efurban mentions above. I've installed googletap and this block works fine now, i guess i would work normally as well.

good luck,
Steve
Back to top
Offline View user's profile Send private message
JConnell

Beginner
Beginner


Joined: Dec 05, 2003
Posts: 7
Location: Northwest, USA

PostPosted: Thu Dec 11, 2003 9:17 am    Post subject: Re: [TESTING] Newest Photo Block Reply with quote

I have just discovered and installed this block on my site (Nuke 6.9+Gallery 1.4.1). It works great, but I'm having one problem:

I have two galleries. One has "everybody" for permissions, and the other has "logged in" for permissions. However this block is showing pictures from the "logged in" album to guests.

I know the random photo block does not do this, so maybe its easy to add? Sorry I don't have any php knowledge I am just curious if someone could help me.
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
Goto page 1, 2, 3  Next

 
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