...

View Full Version : Embedding Images: Providing Embed Code for users to share on their site



bornegraphics
04-25-2012, 07:03 PM
I was hoping someone could shed some light on how the embed code is created for the images on this page.

http://www.charitywater.org/media/banners.php

I am looking to setup a similar concept for my non-profit organization. For the life of me I can't figure out how to generate the Embed Code:

Please help.

Thanks,
Alan

bornegraphics
05-07-2012, 04:36 PM
For those that are interested in a similar gallery.

Here is the php code I am using. Problem solved.




<?php

// Each sponsor is an element of the $sponsors array:

$sponsors = array(
array('fleming','Apply for the EVC Program today.','http://flemingcollege.ca/'),
array('rom','You belong at the ROM','http://www.rom.on.ca/'),
array('canadian_wildlife','Canadian Wildlife Federation. Celebrating 50 years.','http://www.cwf-fcf.org/en/index.html/'),
array('support','Help support Fleming College and the EVC Program.','http://flemingcollege.ca/'),
array('support','Help support Fleming College and the EVC Program.','http://flemingcollege.ca/'),
array('support','Help support Fleming College and the EVC Program.','http://flemingcollege.ca/'),
array('support','Help support Fleming College and the EVC Program.','http://flemingcollege.ca/'),
array('support','Help support Fleming College and the EVC Program.','http://flemingcollege.ca/'),
array('support','Help support Fleming College and the EVC Program.','http://flemingcollege.ca/'),
array('support','Help support Fleming College and the EVC Program.','http://flemingcollege.ca/'),
);

/* // Randomizing the order of sponsors:
shuffle($sponsors); */

?>

<?php
// Looping through the array:

foreach($sponsors as $company)
{
echo'
<div class="sponsor" title="Click to flip">
<div class="sponsorFlip">
<img src="images/collaborate/'.$company[0].'.png" alt="More about '.$company[0].'"/>
</div>

<div class="sponsorData">
<div class="sponsorDescription">
'.$company[1].'
<br /><br />
<div class="sponsorURL">
<a href="'.$company[2].'">'.$company[2].' </a>
</div></div></div></div>
';
}
?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum