TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 728
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 461
  • Total: 462
  • @rjen

Image block for Gallery2

Started by m771401, August 11, 2006, 04:44:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

m771401

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>';

m771401

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..

IchBin


joelgomez

Can a "target" tag can be used to open the photo in a new window?

Thanks a lot!

scott_t

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

scott_t

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

scott_t

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

This website is proudly hosted on Crocweb Cloud Website Hosting.