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  

NG random block, permissions error
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
darkknight

Guru
Guru


Joined: Aug 21, 2003
Posts: 54

PostPosted: Mon Aug 25, 2003 1:09 pm    Post subject: NG random block, permissions error Reply with quote

Quote: › Warning: fopen("/block-random.cache", "w") - Permission denied in /home/anton/public_html/fullgallery/platform/fs_unix.php on line 53


Has anyone seen this before?

FYI:
Quote: ›
%ls -l block-random.cache
-rw-r--r-- 1 apache apache 515 Aug 25 18:17 block-random.cache



N.B. It only happens when looking at the gallery module, not the rest of the site.


Last edited by darkknight on Mon Aug 25, 2003 1:13 pm; edited 1 time in total
Back to top
Offline View user's profile Send private message Visit poster's website
AdBot
   Post subject: NG random block, permissions error  

Back to top
dari

Site Admin
Site Admin


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

PostPosted: Mon Aug 25, 2003 1:12 pm    Post subject: Reply with quote

2 options:
in the random_support.php file, change this:
Code: ›
                // Check the cache file to see if it's up to date
                $rebuild = 1;
                if (fs_file_exists(CACHE_FILE)) {
                        $stat = fs_stat(CACHE_FILE);
                        $mtime = $stat[9];
                        if (time() - $mtime < CACHE_EXPIRED) {
                        $rebuild = 1;
                        }
                }

to this:
Code: ›
                // Check the cache file to see if it's up to date
                $rebuild = 0;
                if (fs_file_exists(CACHE_FILE)) {
                        $stat = fs_stat(CACHE_FILE);
                        $mtime = $stat[9];
                        if (time() - $mtime < CACHE_EXPIRED) {
                        $rebuild = 1;
                        }
                }


or, delete the cache file and let it get regenerated.
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 Aug 25, 2003 1:21 pm    Post subject: Reply with quote

Strangely enough it was set to 0

Setting it to 1 gives:
Quote: ›
Warning: fopen("/block-random.cache", "r") - No such file or directory in /home/anton/public_html/fullgallery/platform/fs_unix.php on line 53

Warning: Invalid argument supplied for foreach() in /home/anton/public_html/fullgallery/random_support.php on line 221


and even if it rebiulds the cache file i still get the same error. (i know the second error above is already solved somewhere in the forums, so ill sort that out later)
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 Aug 25, 2003 1:28 pm    Post subject: Reply with quote

Actually, the second error is a new one i think... line 222 of my randum_support is
Code: ›
$total = 0;
    foreach ($cache as $name => $count) {
                if (!$choose) {
                        $choose = $name;
                }

                $total += $count;
                if ($total != 0 && ($total == 1 || rand(1, $total) <= $count)) {
                        $choose = $name;
                }
    }
Back to top
Offline View user's profile Send private message Visit poster's website
slackbladder

Moderator
Moderator


Joined: Mar 29, 2003
Posts: 1038
Location: Cambs,UK

PostPosted: Mon Aug 25, 2003 1:30 pm    Post subject: Reply with quote

Check your paths. Seems like you've installed GALLERY outside NUKE?
Back to top
Offline View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
darkknight

Guru
Guru


Joined: Aug 21, 2003
Posts: 54

PostPosted: Mon Aug 25, 2003 1:32 pm    Post subject: Reply with quote

yes, is this a problem?

gallery was installed first... so it was easier to leave it there and then link it in as a module.

It does rebuild the block.random-cache, so its got the right path for that...
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 Aug 25, 2003 1:35 pm    Post subject: Reply with quote

actually, another observation is that when $rebuild = 1; the random block just says "no photo chosen" but only when not in the gallery module.

Its obviously a path issue, with being in the gallery path. All paths are given absolute, and straight to me gallery dir.

im looking for any path references that may want to be relative to the NUKE dir. pointers?
Back to top
Offline View user's profile Send private message Visit poster's website
slackbladder

Moderator
Moderator


Joined: Mar 29, 2003
Posts: 1038
Location: Cambs,UK

PostPosted: Mon Aug 25, 2003 1:38 pm    Post subject: Reply with quote

Can we see the URL and config paths from the two files? (random_support.php, block-NG-random.php)
Back to top
Offline View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
darkknight

Guru
Guru


Joined: Aug 21, 2003
Posts: 54

PostPosted: Mon Aug 25, 2003 1:40 pm    Post subject: Reply with quote

block-NG-random.php:
Code: ›
$GALLERY_BASEDIR = "/home/anton/public_html/fullgallery/";
define(ALBUM_BASEADDR, "http://piatek.kicks-ass.net/~anton/fullalbums/");
define(SERVER_ADDR, "http://piatek.kicks-ass.net/");
require_once($GALLERY_BASEDIR . "init.php");
require_once($GALLERY_BASEDIR . "random_support.php");


random_support.php:
Code: ›
$GALLERY_BASEDIR = "/home/anton/public_html/fullgallery/";
require_once($GALLERY_BASEDIR . "init.php");
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: Mon Aug 25, 2003 1:44 pm    Post subject: Reply with quote

add ~anton/ to the end of your SERVER ADDR
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 Aug 25, 2003 1:51 pm    Post subject: Reply with quote

No change,
the phpnuke path is /
the gallery path is /~anton/fullgallery/
the album path is /~anton/fullalbum/

im not sure that change is going to help...
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 Aug 25, 2003 1:54 pm    Post subject: Reply with quote

some debug work reveals it is trying to open /block.random-cache... not ~anton/public_html/fullalbums/block.random-cache
Back to top
Offline View user's profile Send private message Visit poster's website
slackbladder

Moderator
Moderator


Joined: Mar 29, 2003
Posts: 1038
Location: Cambs,UK

PostPosted: Mon Aug 25, 2003 1:57 pm    Post subject: Reply with quote

You need to move the GALLERY app in to the MODULES folder inside NUKE. If not you will have to re-code as the links from the random block are looking for it inside the modules folder.

Also the current RANDOM block you have is using the name Antons_Photos - NOT what you have configured in your config (fullgallery)
Back to top
Offline View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
darkknight

Guru
Guru


Joined: Aug 21, 2003
Posts: 54

PostPosted: Mon Aug 25, 2003 1:57 pm    Post subject: Reply with quote

changing in random_support:
Code: ›
define(CACHE_FILE, $gallery->app->albumDir . "/block-random.cache");

To
Code: ›
define(CACHE_FILE, "/home/anton/public_html/fullalbums/block-random.cache");

solves it, so why isnt $gallery->app->albumDir the same as /home/anton/public_html/fullalbums
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: Mon Aug 25, 2003 1:58 pm    Post subject: Reply with quote

$gallery->app->albumDir is stored in the config.php file in your gallery directory. it's value is whatever you entered in upon your first config of gallery.
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  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