TinyPortal
Development => Block Codes => Topic started by: m771401 on August 11, 2006, 04:44:11 PM
First let me say that I do not know php at all. So getting this to work was a lot of trial and error + a ton of browsing the forums.
I'm not even sure if this the correct way to write this out, but it does work for me. The only thing I can't figure out is the extra space below the image. So if someone has a better way of doing this please let me know.
Also the Image block module needs to be installed and active in Gallery2.
echo '<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td valign="middle" align="center">';
@readfile('http://www.yourdomain-here.com/forum/index.php?action=gallery&g2_view=imageblock.External&g2_blocks=randomImage&g2_show=title');
echo '</td></tr></table>';
Just figured out the extra space issue. I set g2_show=title in the url to g2_show=none
title would obviously show the title of the image, but none of my test images had titles.. so..
Great share. Thanks m771401!
Can a "target" tag can be used to open the photo in a new window?
Thanks a lot!
Cool idea....Trying the code, but no luck. Can you outline the steps you took to implement?
In the G2 site admin, under image block settings there is some code that differs...
Are you going into TP settings, edit blocks, adding a new block with that code? What type are you selecting in the drop down...
Sorry for the questions. It's just a great thing if I can get it to work.
Scott
OK, here is what I did.....And it seems to work...Your code seemed to try to insert another forum into that block....
I HAVE NO CLUE whatsoever on PHP....So take this with a grain of salt......
echo '<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td valign="middle" align="center">';
@readfile('http://www.yourdomain.com/gallery2/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=title');
OK....
Now my cheezy version was throwing off the format at the bottom of the page.....
So I eliminated this part:
echo '<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td valign="middle" align="center">';
And all I have in the block is this part:
@readfile('http://www.yourdomain.com/gallery2/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=title');
And that seems and I quote "SEEMS" to work perfect......
Thanks for the idea....
Scott