Skip to content

Instantly share code, notes, and snippets.

@projectxcappe
Created November 28, 2011 18:01
Show Gist options
  • Select an option

  • Save projectxcappe/1401317 to your computer and use it in GitHub Desktop.

Select an option

Save projectxcappe/1401317 to your computer and use it in GitHub Desktop.
php images
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#image-info').hide();
// class="table-image"
$('.table-image').mouseover(function(){ // the . references a class
var thisisthesrcyouwanted=$(this).attr('src');
$('#image-info').html(thisisthesrcyouwanted); //the # means an id name
$('#image-info').show();
}).mouseout(function(){
$('#image-info').html(''); //clear out html in the info div
$('#image-info').hide();
});
});
</script>
// ----- //
<div id="image-info"></div>
<table class="thumb" boarder="0" align="center" cellpadding="2">
<?php
$images = glob("images/logos/*.*");
$objDOM = new DOMDocument();
$objDOM->load('includes/logo_names_links.xml');
$logos = $objDOM->getElementsByTagName("logo");
$nameArray[] = count($images);
$urlArray[] = count($images);
$count=0;
foreach( $logos as $logo ){
$details = $logo->getElementsByTagName("logo");
$detail = $details->item(0)->nodeValue;
$nameArray[$count] = $logo->getAttribute('name');
$urlArray[$count] = $logo->getAttribute('url');
$count += 1;
for ($i=0; $i<count($images); $i+=10)
{
echo '<tr>';
for($j=0; $j<10; $j++){
if(($i + $j) == count($images)){
break;
}
$num = $images[$i + $j];
echo '<td><a href="' . $urlArray[$i + $j] . '"><img src="'.$num.'" title="' . $nameArray[$i + $j]. '" class="table-image" /></a></td>';
}
echo '</tr>';
}
?>
</table>
<div id="image-info"><!--this is where the image path will show up--></div>
<logos>
<logo name="All Things D" url="http://itunes.apple.com/us/app/all-things-digital/id316429710?mt=8" image=/>
<logo name="Discovery News" url="http://itunes.apple.com/us/app/discovery-news/id336742160?mt=8"/>
<logo name="Big App Show" url="http://itunes.apple.com/us/app/big-app-show/id368656200?mt=8"/>
....
</logos>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment