Ok Got Block working with PHP-Nuke

mikem

Joined: 2002-08-22
Posts: 19
Posted: Thu, 2002-09-19 21:50

Here is what I did.

Step 1.
Downlaod block-random.php from here
http://gallery.menalto.com/modules.php?op=modload&name=GalleryDocs&file=index&req=viewarticle&artid=23&artid=23&gpage=docs.php

Step 2.
in your gallery folder open index.php

Look for this
$safe_to_include =
array(
"block-random.php",
"add_comment.php",
"add_photos.php",
"album_permissions.php",.

If "block-random.php", is not there, then you have to add it. Close and save index.php, upload back to gallery folder.

Step 3.
Open your theme.php file for your current theme.

add this :

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);
}

right after :

function themesidebox($title, $content) {

Save and re-upload your theme.php file.

Step 4.
Go to Nuke admin. Blocks. Add a Block and paste this link in the text area for the block. This will be an HTML block.
http://your.server/modules.php?op=modload&amp;name=your-gallery-name&amp;file=index&amp;include=block-random.php

replace "you.server" with..well you know what to replace ti with I hope.

If it gives you errors when you activate the blcok, try opening block-random.php and look for this line

if (time() - $mtime < CACHE_EXPIRED) {
$rebuild = 0;

Change the rebuild value from 0 to 1. This worked for me. It was having trouble reading my cache file and would give errors.

If it STILL doesn't work..well. I amd no help then.

Good luck.

Back up your files before you make changes to them.

Mike

 
Rutty
Rutty's picture

Joined: 2002-10-08
Posts: 3
Posted: Tue, 2002-10-08 07:16

OK, I got the random block to work by using a combination of two methods seen in this forum! I used the block creation method from this thread:

http://gallery.menalto.com/modules.php?op=modload&amp;name=phpBB_14&amp;file=index&amp;action=viewtopic&amp;topic=903&amp;3

Then used the php file fiddles from this one. I did have to set $rebuild to 1 as I kept getting some out of range error.

Thanks all, much appreciated! :grin:

 
Rutty
Rutty's picture

Joined: 2002-10-08
Posts: 3
Posted: Tue, 2002-10-08 07:18

That was with phpNuke 5.6 btw, soon to upgrade to 6 I think...

 
Rutty
Rutty's picture

Joined: 2002-10-08
Posts: 3
Posted: Tue, 2002-10-08 07:29

Ah, but now the hyperlinks open in the block :???:

Need to read some more messages and see how to fix that.

 
pepbill

Joined: 2002-10-11
Posts: 1
Posted: Mon, 2002-10-14 21:51

I did the same thing as Rutty and got it to work BUT I would like for my icons to be at the top instead of the text. I'm a newbie at php and have tried cutting and pasting.

My site name is : <!-- BBCode Start --><A HREF="http://burbankms.lausd.k12.ca.us/index.php" TARGET="_blank">Piece of the Ocean</A><!-- BBCode End -->