Instructions for installing the Random Block into *nuke, and standalone
standalone
Add the following to your PHP-based pages:
Quote:
include('http://your.server/gallery/block-random.php');
postNuke
Create a Core/PHP block with the following
if (pnModAvailable('your-gallery-name'))
include("http://your.server/modules.php?op=modload&name=your-gallery-name&file=index&include=block-random.php");
else
echo ' ';
Change the URL above to match the information for your server (your.server and your-gallery-name).
phpNuke 7
Create a Core/PHP block with the following
include("http://your.server/modules.php?op=modload&name=your-gallery-name&file=index&include=block-random.php");
Change the URL above to match the information for your server (your.server and your-gallery-name).
phpNuke 6
You must modify the themesidebox() function of each theme where you want to use this block. You need to add the following code at the top of the themesidebox() function:
if (@file_exists($block[content])) {
$fp = fopen ($block[content], "r");
$block[content] = fread($fp, filesize($block[content]));
fclose ($fp);
$block[content] = "?>$block[content]<?";
$block[content] = eval($block[content]);
} else if (eregi("^http", $block[content])) {
$fp = fopen ($block[content], "r");
$block[content] = fread($fp, 65535);
fclose ($fp);
}
Then create an HTML block containing the following url - change the bold text to match the information for your server.
http://your.server/modules.php?op=modload&name=your-gallery-name&file=index&include=block-random.php
phpNuke 5
You must modify the themesidebox() function of each theme where you want to use this block. You need to add the following code at the top of the themesidebox() function:
if (@file_exists($content)) {
$fp = fopen ($content, "r");
$content = fread($fp, filesize($content));
fclose ($fp);
$content = "?>$content<?";
$content = eval($content);
} else if (eregi("^http", $content)) {
$fp = fopen ($content, "r");
$content = fread($fp, 65535);
fclose ($fp);
}
Then create an HTML block containing the following url - change the bold text to match the information for your server.
http://your.server/modules.php?op=modload&name=your-gallery-name&file=index&include=block-random.php
Posts: 2322
The random block does not create any layout... it displays the image and the album name and nothing more. If HTML is missing, that's something you'll need to correct with your site configuration.
Posts: 38
Is the "your-gallery-name" just "gallery" if I didn't change anything? Or is it the name which is displayed on the main gallery page? I used both, but nothing happens. Using both names didn't work out. http://jeffrey.degrijs.com/modules/gallery/block-random.php works
The code I entered in the php block:
if (pnModAvailable('gallery')) include("http://jeffrey.degrijs.com/modules.php?op=modload&name=gallery&file=index&include=block-random.php");
else
echo ' ';
Posts: 127
All I get is the line of code showing in an extended block, where am I going wrong?
Posts: 6
If i goit this right i just ad a sample block and put that code in it and change myserver and gallery name?
Photos should show up?
I get
Random Photos what i named the block.
The content you want in your new block goes here
Any help would be appreciated.
Posts: 38
Sorry, I can't help you. Switched to Mambo months ago. PostNuke drove me mad.
Posts: 21
Whether someone tell me, how I can use the random block if I use Mambo?
Posts: 38
See http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&t=26336&sid=bb8a89b631b25b0e3be460e5ebe07499, but isn't working perfectly as I understand.
I have my template for chosing a random pic, not gallery.
Posts: 21
Yea I have the module on my site, http://www.tommypavlik.polskiserwer.info
but it's not what I've been looking for.
The module has 2 bad sites:
- the first one is that I cannot indicate a patch to all gallery but only to one folder of images.
- the second one when I click on a random image, I don't get the same image in a full size, but I can only set in module configuration a path that can be used when I click a random image.
The bad sites cannot be accepted by me.
I've thought that there is any second method to put a random image block using the file "block-random" that You can find in gallery folder.
Are You sure that it ain't possible to use it?
Tommy
Posts: 4
OK guys, I am lost at making this work with PostNuke .750 and Gallery 1.5-RC2.
I put the code as written in the 1st message and all I get is an empty block. Played around with the gallery name and the 'your.server' name and still nothing.
It must work cause there is one working on this site's home page... right?
Anyway, uh... help!
Thanks!
Posts: 31
is it possible to resize an image with the existant random block?
or specify an album to pull random images from?
or can I make those feature requests for future tweaks?
(gallery 1.5 / postnuke .76rc4)
Posts: 17
When I installed it standalone, it seemed to re-require some files.
I got a php error about "function is already declared" so I went into this block random and changed the require (.....
into require_once(.....
So this files do not get included once again if they have already been and they do get included if they haven't been included yet.
I was trying to include it in albums.php because I thought it would randomize the highlight pictures... (and thus it got included twice and made an error)
Posts: 56
Did you get this running?
What are you using? Post nuke or PHPNuke?
Posts: 1
I have PhP Nuke 7.5
I create a block with this code inside: include("http://your.server/modules.php?op=modload&name=your-gallery-name&file=index&include=block-random.php");
It creates a block with the code text inside. On the other hand when I try it separately:
http://your.server/modules.php?op=modload&name=your-gallery-name&file=index&include=block-random.php
It gives me nice random picture.
So what I am doing wrong?
You can even try if you want:
http://wall.gwguards.com/modules.php?op=modload&name=gallery&file=index&include=block-random.php
Looks like something is wrong with the code that supposed to "attach" the code string to PHP.
Posts: 13
Long file names cause the mambo Gallery Random Block module to exceed the column width they are enclosed in. Anyone got any pointers on how to manipulate this to wrap the image text? You can't turn the filename text off either.
Is this something I can add in the parameters section of the module?
or do I need to muck around with CSS?
Any help most appeciated!!!
Posts: 3
I am not sure if anyone has tried this and been successful with Dragonfly. I have the gallery up and running (and working beautifully). However I am having issues with creating a block. The block text I have (as stated in the instructions, but tweaking it for use with Dragonfly) are as follows:
<?php
if (!defined('CPG_NUKE')) { exit; }
ob_start();
include( 'http://www.intothemind.com/index.php?name=gallery&file=index&include=block-random.php' );
$content = '<div align="center">';
$content = ob_get_clean();
$content .= '</div>';
?>
However no picture is shown. But if I go to that URL the random image/caption is generated just fine. If I used the following as the "include" then it pulls the image/caption but gets errors when trying to go to that picture/album (with LEO turned on/off):
include( 'modules/gallery/block-random.php' );
Is there a certain way this file needs to be included for it to work properly in Dragonfly CMS? Any assistance would be greatly appreciated =)
Normalcy is the playground of the unimaginative
Posts: 1
I was struggling with the info provided here too and I went and look at the "how to" on phpnuke.org and a combination of the two got me working.
I am using nuke 7.5 and gallery 1.4.4. Here's my working code.
You can see this working at http://www.myworldofwarcraft.com
Posts: 8
I'm using Gallery (v. 1.5.1) embedded into PostNuke (v. 0.75b) and I got a blank block unless I ONLY put this part into the block:
I only have one problem though. I have all albums except for one set so that only logged-in users can view the photos. My guest viewable album only has one picture in it. This guest viewable album/photo is the only one that ever shows up in the random block, even if I'm logged in as a normal user or an admin.
Is there any way I can allow it to pull thumbnails from any album? I don't mind if non-logged-in guests can view thumbnails from restricted albums, as long as that somehow doesn't give them full viewing access to the album when they click on it, but it's ok if guests cannot view thumbnails from restricted albums as long as logged-in users can view them.
Posts: 56
I have had this working and recently had to deny because of excessive traffic.... I denied the site the ability to redirect to itself apparently...LOL
It has eliminated my max mysql requests problem with postnuke and that is now solved... but now My random block won't work...
is the code not clean? is it getting into a constant loop of some sort?
It had approximately 30k hits from itself with merely 1300 visitors so far... wtf.. what have I done...
Using Postnuke 761
gallery 1.5.1
Pnphpbb2 12g + patches
Ipower Hosting (yeah I know Ipower isn't the best)
www.oceanodunes.org
let me know what you think of the error when inside the gallery or forums... it doesn't error on the index only inside the site... Like here http://oceanodunes.org/beta/index.php?name=Gallery&include=albums.php
Posts: 1
Someone want to be a bit more descriptive on this one for me. There are over 100 php files and I have only looked in two folders. I am guessing that number will raise well past 200 php files in all. Which files need this added?
Also what exacly is this script going to do? I am looking to have random ordered gallies, random highlights, and random image order. Is this the purpose of the script?
Posts: 1
I can't find the block-random.php file? Does this come by default with the gallery or do I have to create it?
Any help here is appreciated.
Posts: 2
Well you don't have to do all the searching yourself.
Posts: 18
Same problem here, any help someone?
Posts: 11
Guys....... Does ANYONE have a solution for having a random block of images for either postnuke site or a MDPro website ?
Followed the instructions at the top of this topic but couldnt get it to work for me. I know that i had to change the filename to gallery_random.php when entering in my information in the code section, I also had to add $safe URL into my gallery index.php file. Did all of this but still..........NO image showed up !!!!!
PLEASE, would someone give me some help and I am sure it will ALSO benefit others here which have gone without a random block for some time now.
Thanks in advance
Posts: 1
This may help someone. Im running Gallery 1.5.3 and PhpNuke 7.5.
1. Create a file called "block-random.php" in your notepad.
2. Insert the code below:
3. Upload the file to your "blocks" folder at your webserver.
4. Go to the admin panel in phpNuke and create a new block by selecting the "random" file.
5. The random image block should now be working.
Good luck
Posts: 2
is there an official way to make the random block select pictures only from a specifiv album? all posts on that subject are a bit confusing.
maybe you could include that into your installing instructions? might help many people and avoid several posts.
thx for your help
dave
Posts: 3
OK, is there a way to do this with basic PHP? As in, enter Dreamweaver, create a PHP file, write PHP code to display random images. I'm not on PostNuke or anything.