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] Random Photo- Version 2.0
Goto page 1, 2, 3, 4, 5, 6, 7  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: 6284
Location: Washington Township, NJ, USA

PostPosted: Mon Dec 15, 2003 10:26 am    Post subject: [TESTING] Random Photo- Version 2.0 Reply with quote

A totally rewritten random photo block is available for testing.
i have rewritten the block as follows:
- image size can be modified
- number of images (for random photo only) can be altered (can easily be tweaked for hourly/daily as well, if enough people request it).
- horozontal/vertical switch so block can be top/bottom center with multiple images laid out horozontally
- allows for marquee-style scrolling when in vertical orientation
- allows for auto-refresh (interval set by user); eliminates need to refresh entire page to see new random photo.

see it in action at http://phpnuke.nukedgallery.net

NOTE: because i want to retain the feature of using the one "core" block file to allow for multiple random/hourly/daily blocks on a site, the "support" file is now a functions file that gets put in the blocks directory. no need to touch/tweak that at all. this functions file has been extensively rewritten (allows other extensions besides jpg) and is much cleaner. also, the auto-refresh feature makes use of an IFRAME, which requires an additional file. The total package is now three files:
- <nuke>/blocks/block-NG-Random.php
- <nuke>/blocks/block-NG-Random_functions.php
- <nuke>/block-NG-AutoPhoto.php

See the auto refresh in action on the demo site. If you have no desire to use the auto refresh feature, then you don't need the AutoPhoto.php. If there are any other requests, please let me know and I'll try to add them in before a release.

http://www.nukedgallery.net/download-file-30.html [nukedgallery.net]
_________________
Back to top
Offline View user's profile Send private message Visit poster's website
AdBot
   Post subject: [TESTING] Random Photo- Version 2.0  

Back to top
darkknight

Guru
Guru


Joined: Aug 21, 2003
Posts: 54

PostPosted: Mon Dec 15, 2003 10:35 am    Post subject: Reply with quote

ok, so to continue from old old posts, does this random block only allow images that people have permissions to view? (id be happy with it just displaying images that only the public can view), but would like to know if it will display restricted albums...
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: 6284
Location: Washington Township, NJ, USA

PostPosted: Mon Dec 15, 2003 10:36 am    Post subject: Reply with quote

yes, only images available to the EVERYBODY user are viewable. it's an easy tweak in the _functions file to get rid of that check (i believe it's in the scan function, just remove the check..).
_________________
Back to top
Offline View user's profile Send private message Visit poster's website
darkknight

Guru
Guru


Joined: Aug 21, 2003
Posts: 54

PostPosted: Mon Dec 15, 2003 10:40 am    Post subject: Reply with quote

nope, thats fine the way it is. Thanks!
Back to top
Offline View user's profile Send private message Visit poster's website
darkknight

Guru
Guru


Joined: Aug 21, 2003
Posts: 54

PostPosted: Mon Dec 15, 2003 10:47 am    Post subject: Reply with quote

im getting an intermittant error:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/hosting/web/anton/www.strangeparty.com/fullgallery/classes/database/mysql/Database.php on line 37

any ideas on how to debug this.. the images display fine, but the occasional one doesnt open a real image when clicked on. Gives some gallery error
Back to top
Offline View user's profile Send private message Visit poster's website
darkknight

Guru
Guru


Joined: Aug 21, 2003
Posts: 54

PostPosted: Mon Dec 15, 2003 10:48 am    Post subject: Reply with quote

funny, ive just noticed it seems to only happen if im logged in to nuke.... wierd
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: 6284
Location: Washington Township, NJ, USA

PostPosted: Mon Dec 15, 2003 10:49 am    Post subject: Reply with quote

what setting (random, auto, etc)?
_________________
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: 6284
Location: Washington Township, NJ, USA

PostPosted: Mon Dec 15, 2003 10:55 am    Post subject: Reply with quote

ok i got the same error...will try to debug later this afternoon.
_________________
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: 6284
Location: Washington Township, NJ, USA

PostPosted: Mon Dec 15, 2003 11:43 am    Post subject: Reply with quote

ok, i know what the error is, why it's caused, and where it's coming from. i'm just having a helluva time getting rid of it...
_________________
Back to top
Offline View user's profile Send private message Visit poster's website
darkknight

Guru
Guru


Joined: Aug 21, 2003
Posts: 54

PostPosted: Mon Dec 15, 2003 12:06 pm    Post subject: Reply with quote

remove the offending line of code.. it doesnt seem to work, yet the images seem to display even if it is broken...
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: 6284
Location: Washington Township, NJ, USA

PostPosted: Mon Dec 15, 2003 3:47 pm    Post subject: Reply with quote

i've fixed it (i think...at least i don't get the error anymore).
in block-NG-RandomPhoto.php, change:
PHP: › <?php global $gallery?>

to
PHP: › <?php global $gallery,$Version_Num?>


i will update the download...
_________________
Back to top
Offline View user's profile Send private message Visit poster's website
unknownid

Beginner
Beginner


Joined: Aug 21, 2003
Posts: 6

PostPosted: Mon Dec 15, 2003 6:23 pm    Post subject: Reply with quote

Cool! This worked great right off for me, and scrolling a set of 4 is awsome. I am still curious about removing the 'check' you speak of so that maybe I could make the block only viewable by loggedin and the block would use 'ALL' the photos in the galleries (no matter the permissions), or at least all the galleries with the permissions of loggedin?

Man, you guys are so cool. I am so happy to have this cool block on my site.


--Thanks
Back to top
Offline View user's profile Send private message
dari

Site Admin
Site Admin


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

PostPosted: Mon Dec 15, 2003 9:31 pm    Post subject: Reply with quote

in the _functions file, find the scanalbums function (it should be the last one).

try replacing it with this function:
PHP: › <?php function scanalbums() {
    global 
$cache;
    global 
$gallery;

    
$cache = array();
    
$albumDB = new AlbumDB();
    foreach (
$albumDB->albumList as $tmpAlbum) {
                        
$numPhotos $tmpAlbum->numPhotos(1);
                        
$name $tmpAlbum->fields["name"];
                        if (
$numPhotos 0) {
                                
$cache[$name] = $numPhotos;
                        }       
    }
?>


this should use all pictures in all albums (try it out, make all albums LOGGEDIN only, see if it works....that way, if the block is enabled only for registered users, you'll have no problems.
_________________
Back to top
Offline View user's profile Send private message Visit poster's website
darkknight

Guru
Guru


Joined: Aug 21, 2003
Posts: 54

PostPosted: Tue Dec 16, 2003 7:07 am    Post subject: Reply with quote

out of interest.. is there a way to recursively set permissions on galleries? like all at once? cause that would be really useful
Back to top
Offline View user's profile Send private message Visit poster's website
darkknight

Guru
Guru


Joined: Aug 21, 2003
Posts: 54

PostPosted: Tue Dec 16, 2003 7:10 am    Post subject: Reply with quote

The file to fix was actually the block-NG-RandomPhoto_funcionts.php, but yeah.. it seems to work!
Back to top
Offline View user's profile Send private message Visit poster's website
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, 4, 5, 6, 7  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: Web HostingDedicated ServersDomain NamesDomain Name RegistrationDedicated Web HostingSEO Search Engine OptimisationSEOWeb Design New YorkSEO Web DesignWeb hosting AustraliaCheap Web Design

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