Recent image block isnt working! (im using PHPnuke)

ICANSEEYOU7687

Joined: 2004-11-08
Posts: 4
Posted: Mon, 2004-11-08 23:59

Hey yall whats up, first lemme say that i read through the faw and searced and couldnt find anything, so sorry if I did happen to miss something, but im having problems showing the most recent image. Im using PHP nuke and I try and create a block and have it show the most recent image, but its just blank...lemme get some URL's up...
dododo

http://zoki.mybesthost.com is the main site, You can see the Recent Image block on the bottom left, but as u can see theres not really anything there, now lemme find my glalery URL...

http://zoki.mybesthost.com/main/modules/gallery2 (which btw the gallery is working well.

but I want it to show the most recent image on the site, and ideas what im doing wrong, I simply go to create block and I put this code in there

<?php @readfile('http://zoki.mybesthost.com/main/modules/gallery2/main.php?g2_view=imageblock:External&g2_blocks=recentImage&g2_show=title'); ?> 

I believe this is my version information just in cas it will help
gallery-2.0-alpha-3

and thanks for tryin to help me out!
----

Login or register to post comments
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13452
Posted: Tue, 2004-11-09 00:15

[moving to G2 forum]

Login or register to post comments
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8598
Posted: Tue, 2004-11-09 01:33

Do view-source in your browser for your site's main page and you'll find the <?php @readfile.... thing right in the html.. ie, it is being sent with the html instead of being processed by PHP..

Login or register to post comments
ICANSEEYOU7687

Joined: 2004-11-08
Posts: 4
Posted: Tue, 2004-11-09 01:36

hmm thats wierd, its in a php file, I hope theres a way to fix this, any ideas?

Login or register to post comments
ICANSEEYOU7687

Joined: 2004-11-08
Posts: 4
Posted: Tue, 2004-11-09 21:32

well i kinda figured it out, but now it shows the most recent image, but displays it outside the little box, and it says no content availiable at this time.

http://zoki.mybesthost.com on the bottom left.

I figured i needed to do it as a file not html, sorry im slow, LoL, but i cant figure out why its doing that...any suggestions?

Login or register to post comments
valiant

Joined: 2003-01-04
Posts: 32356
Posted: Tue, 2004-11-09 21:45

G2 generates

http://zoki.mybesthost.com/main/modules/gallery2/main.php?g2_view=core:DownloadItem& amp;g2_itemId=12& amp;g2_serialNumber=2 (without the space between the & and the amp;)
instead of
http://zoki.mybesthost.com/main/modules/gallery2/main.php?g2_view=core:DownloadItem&g2_itemId=12&g2_serialNumber=2

"& amp;" (without the space between the & and the amp;) instead of just "&".

With "&" it works.

Any ideas why?

Login or register to post comments
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8598
Posted: Tue, 2004-11-09 21:59

ICANSEEYOU7687, I don't know how PHPnuke blocks work.. the readfile() php function will output the results right when the function is called.. if you want to get the contents in a variable use file_get_contents instead of readfile.. then you can give the content to PHPnuke however it wants it.

Login or register to post comments
Xper

Joined: 2004-11-08
Posts: 3
Posted: Tue, 2004-11-09 22:45

ICANSEEYOU7687, it appears you got it working, beside the random image part.
I'm encountering the same issue and I'm wondering how exactly you fixed it.
You said you changed the block to file and it worked. I know I'm a noob but how did you do that. If I create a new block and put the code:
<?php @readfile('http://www.egoodies.be/nele_php/modules/gallery2/main.php?g2_view=imageblock:External&g2_blocks=randomImage&g2_show=title'); ?>
in it, then it always get saved as a HTML block.

I'm a bit lost I'm afraid ...

Greetz,
Bert

Login or register to post comments
ICANSEEYOU7687

Joined: 2004-11-08
Posts: 4
Posted: Wed, 2004-11-10 00:52

well are u using phpnuke? cause thats were my problem was. if so, I created a custom blocked, with this inside

<?php 

if (eregi("block-recent_Image.php", $_SERVER['PHP_SELF'])) { 
    Header("Location: index.php"); 
    die(); 
} 

ob_start(); 
include('http://zoki.mybesthost.com/main/modules/gallery2/main.php?g2_view=imageblock:External&g2_blocks=recentImage&g2_show=title'); 
$output = ob_get_contents(); 
ob_end_clean(); 
$content = $output; 

?> 

and then i simply loaded it
the http://www.karakas-online.de/ phpnuke forums are great, gotta love them! and its the most recent image, not a random image, but I cant find out were u resize the thumb nails, the image is to big for the menu for phpnuke, how can I resise them? can i put it in the code?

Login or register to post comments
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8598
Posted: Wed, 2004-11-10 02:23

hmm.. you can create a modules/imageblock/templates/ImageBlock.tpl.local and change the maxSize=140 parameter you'll find in there to whatever value you like.. this will affect both external image block and any image block in the G2 sidebar..

Login or register to post comments