Showing random photo from Gallery 2 on my Php-Nuke 7.9 site

pexel

Joined: 2006-02-16
Posts: 36
Posted: Fri, 2006-02-17 19:43

Hello
As the subject says, I have a php-nuke 7.9 site.
I also yesterday installed Gallery 2 on the same server.
I really would like to show random pictures from Gallery 2 in a block showing on my php-nuke 7.9 site.
But, i dont know how to do this.
Im a bit newbie on php in general, and dont understand all that scripting language and where to put it.
But, i have though managed to install php-nuke 7.9 on the server, and know how to confingure it.
I also managed to install the gallery, so some iq i do have ;-)
If anyone PLEASE could explain me thoroughly what i should do, in order to show a random pic from the gallery on my php-nuke site i would really appreciate it. Hopefully as thorough as possible.
Appreciate any answers
Best regards

 
ckdake
ckdake's picture

Joined: 2004-02-18
Posts: 2258
Posted: Sat, 2006-02-18 05:29

Try out the nuke-g2 integration and use the random image block. Or just use the external random image block. Search the forum for more information about these.

 
pexel

Joined: 2006-02-16
Posts: 36
Posted: Sat, 2006-02-18 12:19

Hello :)
Thanx for replying.
I tried the nuke-gt integrations yesterday, before i wrote the post.
But, i didnt manage it to work.
I come as far as when i inside my php-nuke site, logged in as administrator, shall configure my gallery2-module.
When i hit the Gallery2-module-icon i get to a page, where it at the top of the site says:
"Integration Package Status = "Socket connection error: Connection timeout".
Below i have to fill out the Gallery 2 Integration Settings which says:
Url to your embedded gallery
Url to your standalonegallery
Url for user login
Active user id
Cookie path

All tehse fields are blanc now.
The first time i hit the gallery2-button as an admin, these fields were filled out. But, accidently i
closed the webbrowser-windows before i managed to hit the "verify settings" button.
The nedt time i logged in as admin, and hit the gallery2-module-button, i got this error message, and all these fields blanc.
And, i DONT HAVE A CLUE, what to write inside them :-(
If i jsut fill inn the urls mentioned in the readme-file, i only get a blanc window with no content at all, so these values has to be wrong.
Since im a bit newbie on php-programming, i dont understand php-links at all.
I would appreciate it if you could help me with this, how i find the correct info for the different fields etc.
Would surely appreciate it.
Best regards

 
pexel

Joined: 2006-02-16
Posts: 36
Posted: Sat, 2006-02-18 17:19

I really would appreciate the input :)

 
pexel

Joined: 2006-02-16
Posts: 36
Posted: Sat, 2006-02-18 19:03

I tried the external random imageblock, but didnt find out how to make it work.
I opened notepad, and pasted the following code in it:
<?php
#### Generated by Block Creator by Disipal Site (www.disipal.net) ###
if (eregi("block-Block_Creator.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
$content = "<?php @readfile('http://www.123area.com/modules/gallery2/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=fullSize&g2_maxSize=565'); ?>";
?>
Thereafter i renamed it to block-gjerm72_ee.php , and uploaded the file to the blocks-folder on the server.
Then I logged into my php-nuke 7.9 site, went to the blocks-module, chose to import block, and then imported the same file.
But, when i thereafter went to "home", there was only the name of the block showing, with no content at all :-(
No random pictures showing from the gallery, as i had hoped.
Please help me anyone! This is really frustring.
In the code above you can see the true direct link to the gallery on my site. What am i doing wrong?
I do really appreciate any feedback on this, please.
Best regards

 
ckdake
ckdake's picture

Joined: 2004-02-18
Posts: 2258
Posted: Sun, 2006-02-19 00:43

What happens when you remove the @

 
pexel

Joined: 2006-02-16
Posts: 36
Posted: Sun, 2006-02-19 08:51

Hello
Thanx for the reply.
I now tried to remove the @ , but nothing happens, im afraid :-(

As mentioned earlier i opened notepad, and pasted this code:
<?php
#### Generated by Block Creator by Disipal Site (www.disipal.net) ###
if (eregi("block-gjerm72_ee.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
$content = "<?php readfile('http://www.123area.com/modules/gallery2/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=fullSize&g2_maxSize=565'); ?>";
?>
Then i renamed the txt-file to block-gjerm72_ee.php and uploaded it to my blocks-folder on the server.
Then i logged in as admin, and went to the blocks-section, and chose to import the file by the same name as over. I named the block testblock.
As you can see, if you visit this page:
http://www.123area.com/index.php
At the bottom of the page, to the left side, all the way down, you can see that the block by the name testblock aint showing anything.
YOu have to scroll down the page very far to see the block.
Appreciate any feedback and tip on how to solve this problem.
Would surely appreciate it :)

 
ckdake
ckdake's picture

Joined: 2004-02-18
Posts: 2258
Posted: Sun, 2006-02-19 14:40

try just making a file test.php with the content <?php readfile('http://www.123area.com/modules/gallery2/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=fullSize&g2_maxSize=565'); ?> and accessing that directly. That url does work for me for a random image.

 
pexel

Joined: 2006-02-16
Posts: 36
Posted: Sun, 2006-02-19 19:43

Hello, and thx again.
When i access that url directly; www.123area.com/test.php it looks like it genereates a random ( i hope ) picture.
But, how do i make this picture appear in a block on my php-nuke site?

 
pexel

Joined: 2006-02-16
Posts: 36
Posted: Sun, 2006-02-19 19:47

Hey
I changed the code in the block-file, so that it now says:
<?php
#### Generated by Block Creator by Disipal Site (www.disipal.net) ###
if (eregi("block-gjerm72_ee.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
$content = "<?php readfile('http://www.123area.com/test.php'); ?>";
?>
But, even now the block shows no content at all.
Very strange :/

 
ckdake
ckdake's picture

Joined: 2004-02-18
Posts: 2258
Posted: Sun, 2006-02-19 21:35

you don't want the readfile to access that file. thats just a test to make sure readfile() is working right on your system.

now place just <?php readfile('http://www.123area.com/modules/gallery2/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=fullSize&g2_maxSize=565'); ?> into your block file and post what happens.

 
pexel

Joined: 2006-02-16
Posts: 36
Posted: Sun, 2006-02-19 22:03

Hello, again :)

Oh, my God it works. At last it works....
Thanx a lot for the help. Since im a newbie on php...never studied php at all, this problem has been haunting me for, believe it or not, for the last 14 days. ( The time i have spent on this the time i have not been to work or doing family stuff ).
To say it in norwegian; "Tusen takk" :) Really appreciate the time you have taken to help me out with this.
And, now since you are here... ;-) Im gonna push it and ask you another question...I just take the chance.
In Gallery 2 there is a function called showing random pictures as you know.
My question is this: If i have several albums on my gallery2, can i choose that the random pictures showing in the random pictures block, only are "collected" from one spesific album ? not random pictures from all albums ?
The reason i ask is this:
In order for me to show random pictures from gallery2 on my site, the widht of the pictures cannot be larger than a width of 120 pixels. If the widt of the picturers are larger, thats gonna mess up the design of my php-nuke 7.9 site. Thats perhaps one flaw with php-nuke sites and block content? I therefore need to collect the random pictures showing in a block on my php-nuke site, from an album where all the images has a widtn no larger than 120 pixels. I wanna make a spesific album for these random pics showing up on my site. But, i want all the rest of the pictures on my Gallery2 site show in full size, as the standard settings are, if you know what i mean. ( At least larger than a width of 120 pixels ;-) )
Appreciate any feedback on this also.
Once again, thanx for helping me out with the previous problem.

 
ckdake
ckdake's picture

Joined: 2004-02-18
Posts: 2258
Posted: Sun, 2006-02-19 22:40

Why not just have the random block limit the size? the g2_maxSize paramater can be used to specify the maximum width/height for the random image

 
pexel

Joined: 2006-02-16
Posts: 36
Posted: Mon, 2006-02-20 10:42

Ah..perhaps thats the solution.
This is an extract from the code;
fullSize&g2_maxSize=565') <--- the value 565, is that the width or the height-value ? IF e.g its the width, how do i set the height-value in the code ?
If you visit www.123area.com you can see the picture above a field called gjerm72ee. Below the field there is a box where it says its no content for this block right now. Do you know how thats possible ? Why is the picture loading above the name of the block, instead of inside the block itself, where its supposed to be?
Appreciate it if you can tell me this :)

Best regards:

 
ckdake
ckdake's picture

Joined: 2004-02-18
Posts: 2258
Posted: Mon, 2006-02-20 19:40

that is the max dimension. Aspect ratio will be maintained in the scale and the longest dimension will be that one.

as for 2. Take a look at the HTML source code. Wherever you have that block being included is not underneath any title or inside of any block.

 
pexel

Joined: 2006-02-16
Posts: 36
Posted: Mon, 2006-02-20 21:53

Hello :)

Thx for the tip one point 1
As for 2: What html-code ?
For the block in mention, i only use the php-code you told me, so there are no html-code in that block-code im afraid.

Best regards

 
ckdake
ckdake's picture

Joined: 2004-02-18
Posts: 2258
Posted: Tue, 2006-02-21 00:40

Right click and view the source of the page.. it doesn't look like the random block HTML is inside of a block. Sounds like Nuke may be confused.

 
pexel

Joined: 2006-02-16
Posts: 36
Posted: Tue, 2006-02-21 11:46

Hmm....cant find the actual html-code...
But, anyways..any way to fix this ?

 
ckdake
ckdake's picture

Joined: 2004-02-18
Posts: 2258
Posted: Tue, 2006-02-21 15:13

Right click on the page and click on view source. This sounds like a Nuke problem and not a Gallery problem, asking at www.nukedgallery.net may help.

 
pexel

Joined: 2006-02-16
Posts: 36
Posted: Tue, 2006-02-21 18:24

Ok :)

I know how to view source of a webpage, but i didnt find anything about this actoual block though.
But, thanx for all the feedback in the post.
A big releaf getting the random picture-function to work :)

Best regards:

Pexel