Instructions for using the Random Block
signe
![]()
Joined: 2003-07-27
Posts: 2322 |
![]() |
Instructions for installing the Random Block into *nuke, and standalone standalone Quote:
include('http://your.server/gallery/block-random.php'); postNuke 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 phpNuke 6 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 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 |
|
signe
![]()
Joined: 2003-07-27
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. |
|
jdegrijs
![]()
Joined: 2004-03-15
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: |
|
clothahump
![]()
Joined: 2002-11-26
Posts: 127 |
![]() |
Quote:
phpNuke 7 All I get is the line of code showing in an extended block, where am I going wrong? |
|
trevorh
Joined: 2005-02-17
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. |
|
jdegrijs
![]()
Joined: 2004-03-15
Posts: 38 |
![]() |
Sorry, I can't help you. Switched to Mambo months ago. PostNuke drove me mad. |
|
Tommy237
![]()
Joined: 2005-02-24
Posts: 21 |
![]() |
Whether someone tell me, how I can use the random block if I use Mambo? |
|
jdegrijs
![]()
Joined: 2004-03-15
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. |
|
Tommy237
![]()
Joined: 2005-02-24
Posts: 21 |
![]() |
Yea I have the module on my site, http://www.tommypavlik.polskiserwer.info Tommy |
|
123Testing
![]()
Joined: 2005-03-16
Posts: 4 |
![]() |
OK guys, I am lost at making this work with PostNuke .750 and Gallery 1.5-RC2. Anyway, uh... help! Thanks! |
|
Not_Public
![]()
Joined: 2002-12-13
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) |
|
twopeak
![]()
Joined: 2005-05-22
Posts: 17 |
![]() |
When I installed it standalone, it seemed to re-require some files. 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) |
|
Viper_iii
![]()
Joined: 2002-12-31
Posts: 56 |
![]() |
trevorh wrote:
If i goit this right i just ad a sample block and put that code in it and change myserver and gallery name? Did you get this running? What are you using? Post nuke or PHPNuke? |
|
profius
Joined: 2005-06-09
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. |
|
speleo
Joined: 2005-06-14
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!!! |
|
usmc_devildog
Joined: 2005-10-04
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(); $content = '<div align="center">'; ?> 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 |
|
digitaldemigod
Joined: 2005-10-06
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. <?php if (eregi("block-RandomGallery.php",$_SERVER[PHP_SELF])) { Header("Location: index.php"); die(); } ob_start(); include("http://www.servernamehere.com/nuke/modules.php?op=modload&name=gallery-name-here&file=index&include=block-random.php"); $output = ob_get_contents(); ob_end_clean(); $content = $output; ?> You can see this working at http://www.myworldofwarcraft.com |
|
Xepha
Joined: 2005-07-29
Posts: 8 |
![]() |
123Testing wrote:
OK guys, I am lost at making this work with PostNuke .750 and Gallery 1.5-RC2. 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: Quote:
include("http://your.server/modules.php?op=modload&name=your-gallery-name&file=index&include=block-random.php"); 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. |
|
Viper_iii
![]()
Joined: 2002-12-31
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 |
|
ABitDifferent
Joined: 2006-01-06
Posts: 1 |
![]() |
Quote:
standalone 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? |
|
ddhoray
Joined: 2006-04-17
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? |
|
Photolythic
Joined: 2006-04-16
Posts: 2 |
![]() |
ABitDifferent wrote:
Well you don't have to do all the searching yourself. |
|
Andy Summer
Joined: 2006-03-25
Posts: 18 |
![]() |
DavidPook
Joined: 2006-05-04
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 |
|
mephisto37
Joined: 2006-09-25
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. Quote:
<?php 3. Upload the file to your "blocks" folder at your webserver. Good luck |
|
agent_dave79
Joined: 2007-05-08
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 |
|
ataru
Joined: 2007-12-01
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. |
|