random block stop working...
edfel
Joined: 2004-02-08
Posts: 7 |
![]() |
Don't know what happened after ugrading PNphpBB2 to 1.2f ... Dunno if that is related.... It shows no error, only... nothing black block... any idea? |
|
signe
![]()
Joined: 2003-07-27
Posts: 2322 |
![]() |
Well... the random-block doesn't have anything to do with pnphpbb2, so there shouldn't be any influence there. How are you using the random block? Just as a normal postnuke module? |
|
edfel
Joined: 2004-02-08
Posts: 7 |
![]() |
if (pnModAvailable('your-gallery-name')) I replace with my info, the block _was_ working. Thats the strage and odd part... The block is blank only displays block title. |
|
signe
![]()
Joined: 2003-07-27
Posts: 2322 |
![]() |
Make sure that Gallery is initialized and activated in postnuke, or remove the 'if' and 'else' statements. |
|
skyttegaard
Joined: 2003-07-21
Posts: 14 |
![]() |
edfel wrote:
... the block _was_ working. Thats the strage and odd part... I've just experienced exactly the same problem - block has been working for some time - suddenly stops showing images. - Peter - |
|
skyttegaard
Joined: 2003-07-21
Posts: 14 |
![]() |
Well - I managed to get it working again but I'm not sure what the problem really was. I moved the following files from the postnuke_home/modules/gallery/album/ directory: |
|
skyttegaard
Joined: 2003-07-21
Posts: 14 |
![]() |
Problem returned after 24 hours. It seems that the problem is in the rebuild part of block-random.php // Check the cache file to see if it's up to date $rebuild = 1; if ($rebuild) { If the cache file does not exist or is older than the max cache time, the scanAlbum and saveCache functions are called. When I call the random block directly, it correctly discovers the old cache file and performs the rebuild - including update of the cache file - and then everything works fine until the next cache expiry time. You can try the same by entering the URL: http://your_postnuke_home/modules/gallery/block-random.php That should update the file and show a random picture - it will then also work in Postnuke for some time. I don't know why the rebuil doesn't work under Postnuke. - Peter - |
|
signe
![]()
Joined: 2003-07-27
Posts: 2322 |
![]() |
skyttegaard, which version of Gallery are you running? That code is not what's in the 1.4.4 version of block-random.php. Particularly, the 'CACHE_EXPIRED' should be a Gallery variable, not a defined value like it is in what you pasted. There was lots of other work done, too. |
|
skyttegaard
Joined: 2003-07-21
Posts: 14 |
![]() |
Gallery version is 1.4.4-pl1 The CACHE_EXPIRED is a gallery variable defined in gallery\config.php It may well be, however, that my gallery\block-random.php is a leftover from an older version, which could explain the problem - the full code of the file I have is: <? /* */ require(dirname(__FILE__) . "/init.php"); /* Initializing the seed */ define('CACHE_FILE', $gallery->app->albumDir . "/block-random.dat"); // Check the cache file to see if it's up to date $rebuild = 1; if ($rebuild) { $album = chooseAlbum(); if (!empty($album)) { if (!empty($index)) { $caption = $album->getCaption($index); echo "<br><center>From: " /* function saveCache() { function readCache() { $sCache = getFile(CACHE_FILE); function choosePhoto($album) { $count = $cache[$album->fields["name"]]; return $choose; function chooseAlbum() { /* $total += $count; if ($choose) { function scanAlbums() { $cache = array(); |
|
signe
![]()
Joined: 2003-07-27
Posts: 2322 |
![]() |
That is definitely not the version of block-random that comes with 1.4.4 |
|
skyttegaard
Joined: 2003-07-21
Posts: 14 |
![]() |
I admit that it looks different because the Gallery Forum deletes all leading spaces so you can't see the code hierachy. |
|
signe
![]()
Joined: 2003-07-27
Posts: 2322 |
![]() |
I must have been really tired when I responded last night, because I completely missed this part... define('CACHE_FILE', $gallery->app->albumDir . "/block-random.dat"); define('CACHE_EXPIRED', $gallery->app->blockRandomCache); as well as the header and file revision from CVS. Yes.. it is from 1.4.4 I can't say why you're running into the issue you are, since many, many people run the random-block from inside nuke with no issues. Unless your postnuke and gallery installations run as different users on the webhost, I can't see any reason why this would fail. How do you include the random block in your nuke block? Do you use the web include, or a file include. (http://..., or /home/...) |
|
skyttegaard
Joined: 2003-07-21
Posts: 14 |
![]() |
I use the random block as a web include in a Core/PHP block: if (pnModAvailable('gallery')) I just did a complete reinstall of Gallery and that solved the problem. Guess I must have messed up the previous installation somehow. Thanks. |
|