Custom Image Block?

andymacdonalduk

Joined: 2009-01-22
Posts: 56
Posted: Sat, 2009-02-21 03:45

Hey Guys,

I am trying to use the code that Gallery2 offers in the image block section of the admin so i can display the latest photos added to my site directly on my main website. The problem im having is when somebody clicks on an image in the custom image block on my main website, it transfers that user 'directly'to the image in my gallery2 installation directory -

however i use the Joomla Gallery Bridge, how do i get the image block to transfer users to the image they click on, but through the bridge, NOT straight to the installation directory. - if you understand me?

Basically when a user clicks an image, i want that image to display, but via the bridge, not the main /gallery2/ directory

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7934
Posted: Sat, 2009-02-21 03:56

just replace the url with your embedded url
so for mine this is the gallery url:
<?php @readfile('http://www.flashyourweb.com/gallery2/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=title'); ?>
and this is the embedded:
<?php @readfile('http://www.flashyourweb.com/media/index.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=title'); ?>

or you can try my mediaBlock which is used in the same way.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
andymacdonalduk

Joined: 2009-01-22
Posts: 56
Posted: Sat, 2009-02-21 04:00

Ahhh thanks a lot for that.

I just been checking out your media block, that is a seriously cool piece of kit. So far, i have been manually creating a table in each post i want to add images too, then adding an image to each cell in the table.

I always knew there 'must' be a better way to do it, and you just given it to me. thanks so much!!!

Andy

 
andymacdonalduk

Joined: 2009-01-22
Posts: 56
Posted: Sat, 2009-02-21 04:01

How exactly do you implement the solution sir? I just downloaded it and its a php file, what do i need to do with that if you dont mind me asking. is there an installation guide anywhere?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7934
Posted: Sat, 2009-02-21 04:09

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
andymacdonalduk

Joined: 2009-01-22
Posts: 56
Posted: Sat, 2009-02-21 04:11

Fantastic. Very easy to use, i like that.

Thank you - such a great 'plugin'!!

 
andymacdonalduk

Joined: 2009-01-22
Posts: 56
Posted: Sat, 2009-02-21 04:39

slight problem.

This is the code im trying to use, but the thumbnails link to a blank page. any idea what im doing wrong.

this is the code: <?php @readfile('http://www.mileycyrus-online.co.uk/gallery2/mediaBlock.php?g2_itemId=3880&mode=dynamic&g2_view=dynamicalbum.RandomAlbum&useThumb=1&column=4');?>

This is my line 28 area...

Quote:
function init (){
require_once( 'embed.php');
$ret = GalleryEmbed::init(array('fullInit' => true, 'embedUri' => 'http://www.mileycyrus-online.co.uk/g.html?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=title', 'g2Uri' => 'http://www.mileycyrus-online.co.uk/gallery2/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=title'));
if ($ret) {
print 'GalleryEmbed::init failed, here is the error message: ' . $ret->getAsHtml();
exit;
}
GalleryEmbed::done();
}

Secondly, ive included that "<?php @readfile('http://www.mileycyrus-online.co.uk/gallery2/mediaBlock.php?g2_itemId=3880&mode=dynamic&g2_view=dynamicalbum.RandomAlbum&useThumb=1&column=4');?>" into one of my posts html, and it doesnt show up. what am i doing wrong?

the url is http://www.mileycyrus-online.co.uk/miley-cyrus-videos/learn-hoedown-throwdown-dance-moves.html

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7934
Posted: Sat, 2009-02-21 04:42
 
andymacdonalduk

Joined: 2009-01-22
Posts: 56
Posted: Sat, 2009-02-21 04:46

Ah perfect. That sorted out the link problem - thank you!

Any idea with regards to the photos not showing up in a joomla post as per my above comment please?

Also id like to donate if you have the option anywhere. please pm me.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7934
Posted: Sat, 2009-02-21 05:03

Looks like your joomla/wordpress is filtering out the <?php tags(or more precisely not allowing it to execute). Which means the imageBlock would not work either.
mediaBlock looks to be functioning correctly:
http://www.mileycyrus-online.co.uk/gallery2/mediaBlock.php?g2_itemId=3880&mode=dynamic&g2_view=dynamicalbum.RandomAlbum&useThumb=1&column=4

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
andymacdonalduk

Joined: 2009-01-22
Posts: 56
Posted: Sat, 2009-02-21 05:09

Yeah i tried adding the same url directly to the browser and its defo functioning.

Wondering how i work out why its filtering my php tags now. ill try changing my editor, see if it could be an editor related setting or whatever.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7934
Posted: Sat, 2009-02-21 05:14

Yeah, I'd ask over at wordpress/joomla forums, they may have alternate tags like {php} or something.
I've been working on a javascript/ajax version using jQuery

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
andymacdonalduk

Joined: 2009-01-22
Posts: 56
Posted: Sat, 2009-02-21 05:16

Ive just did a quick search and it seems joomla by default reformats php code into html code, it doesnt interperat it as php apparantely, you need a plugin which will allow you to insert php into articles, so just downloading a few at the moment, will see whats best, and hopefully that will fix the problem.

THanks again for your help and advice - can i make a donation to you/your company?

 
andymacdonalduk

Joined: 2009-01-22
Posts: 56
Posted: Sat, 2009-02-21 05:24

YESSSSSSSSSSSSSSSSSSSS. IT WORKS :):):):):):)

Sorry for the slight over-reaction, but im well chuffed with the result. thanks so much for this :)

Just incase anybody has problems inserting php directly into articles in future, you need the "Sourcerer" plugin for joomla. http://www.nonumber.nl/sourcerer

Worked a treat

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7934
Posted: Sat, 2009-02-21 05:32

There is a donate button on the bottom of the mediaBlock page, or you can simply donate to Gallery :)

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7934
Posted: Sat, 2009-02-21 06:01

Oh, and there is also a minislideshow that is a handy imageblock replacement.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2