<html>
<head>
<style type="text/css">
table {
width:100%;
border-width: 2px;
border-spacing: 3px;
border-style: outset;
border-color: #808080;
border-collapse: separate;
background-color: #ffffff;
}
th {
border-width: 1px;
padding: 5px;
border-style: inset;
border-color: #808080;
background-color: #ffffff;
}
td {
border-width: 1px;
padding: 5px;
border-style: inset;
border-color: #808080;
background-color: #ffffff;
}
</style>
</head>
<body>
<table><tr>
<?php
require("../class/accessClass.php");
function extractText($pat1,$pat2,$page) {
$result = '';
$result = @explode($pat1, $page);
if (sizeof($result)>1){
$result = @explode($pat2, $result[1]);
$result = $result[0];
$result = ereg_replace("<br>", "", $result);
$result = trim($result);
} else{
$result='';
}
return $result;
}
$friendid='';
$user='';
$pass='';
$t=new myspace("t");
$t->myspaceCreds($user,$pass);
$t->newLocation('http://viewmorepics.myspace.com/index.cfm?fuseaction=user.viewPicture&friendID='.$friendid);
$loc = html_entity_decode(extractText('class="photo_image" href="','"><',$t->page));
$numpics = extractText('Listing 1-','</div>',$t->page);
$pos = strpos($numpics, 'of ');
$numpics = substr($numpics, $pos+3);
for($i=1;$i<$numpics;$i++){
$t->newLocation($loc);
$src= extractText('onload="FixImage()" src="','" style=',$t->page);
$src = ereg_replace("l_", "m_", $src);
$src = ereg_replace("_l", "_m", $src);
$cap = extractText('ImageView_lblCaption">','</span></div>',$t->page);
$lastposter = extractText('<td style="text-align: center;" rowspan="2">','</a>',$t->page);
$lastcomment = extractText('</strong>','</td>',$t->page);
echo '<td><a href="'.$loc.'"><img src="'.$src.'"></a><br>'.$cap;
$list = extractText("Listing 1","</td>",$t->page)." ";
$pos = strpos($list, 'of ');
if ($pos === false) {
echo '<br><br>No Comments</td>';
}else{
echo '<br>'.substr($list, $pos+3).' Comments';
echo '<br><br>Last on: '.extractText("<strong>","</strong>",$t->page);
echo '<br>By: '.$lastposter."</a>";
echo '<br>'.$lastcomment."</td>";
}
$loc = extractText('Previous</a> | <a href="','" title',$t->page);
if ($i%4==0){
echo '</tr><tr>';
}
}
?>
</table>
</body>
</html>