PDA

View Full Version : Layout Snatcher Code


omen
June 3rd, 2007, 08:25 AM
While browsing through digital point I come across a pretty cool gem!

Source code to create a "Layout Snatcher"

<?
$title = $desc = "Layout Snatcher";
function getUrlContent($url)
{
if ( function_exists('curl_init') )
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT,"Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$content = curl_exec ($ch);
curl_close ($ch);
}
else
{
$content = file_get_contents($url);
}
return $content;
}
?>
<table width="670" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top" class="mainbgwholeleft2">
<div align="left">
</div>
<div align="left">
<h1>Layout Snatcher</h1>
</div>
<div>
Have you ever seen a really nice MySpace layout on someone's profile page, but didn't know where to get the code from? Well, now you can get any MySpace layout code you want! It's really easy to do, just enter the Friend ID of any profile page below... then click "Get Code" and we'll grab the MySpace layout code for you!
<br>
</div>
<div align="center">
<?
require_once( ROOT_DIR ."/include/db.php");
$sql = "select * from ad WHERE style='468x60'";
$rs = $db->Execute( $sql );
echo $rs->fields['content'];
?>
</div>
<?
if ( $_POST['action'] ):
$url = "http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid=".$_POST['id'];
$content = getUrlContent( $url );
$reg = '<style type="text/css">(.*)</style>';
preg_match_all( "|".$reg."|isU",$content,$arr );
for( $i=0;$i<sizeof($arr[0]);$i++ )
{
$cc .= $arr[0][$i]."\n";
}
?>
<br />
<div align="center">
<br />
<br />
<strong>Your layout code has been captured, just copy and paste the Layout Code below into the "About Me" section of your profile page.</strong>
<br />
<br />
<textarea onClick="highlight(this);" name="codes" style="width: 450px" rows="8"><?=$cc?><?if ( SHOWPIMP == 'ON' ):?>&lt;a href=&quot;<?=HOMEPAGE?>&quot; target=&quot;_self&quot;&gt;&lt;img src=&quot;<?=HOMEPAGE?>img/button.gif&quot; style=&quot;position:absolute; left:0px; top: 0px;&quot; border=&quot;0&quot;/&gt;&lt;/a&gt;<?endif?></textarea>
<br />
<br />
<script src="/js/source.js" type="text/javascript" language="JavaScript"></script>
</div>
<?
endif;
?>
<FORM METHOD=POST ACTION="">
Friend ID:
<a href="/myspace-tutorials" target="_blank">what is this? </a>
<br>
<input type="text" name="id" size="20"/></br>
<input type="submit" value="Get Code"/>
<input type="hidden" name="action" value="1"/>
</FORM>
</td>
</tr>
</table>

http://forums.digitalpoint.com/showthread.php?t=114965

Someone may use it :)

mcfox
June 3rd, 2007, 09:23 AM
Very nice find. :)

carlee
June 4th, 2007, 06:49 AM
It looks like you need a file called db.php and a MySQL database:
require_once( ROOT_DIR ."/include/db.php");
$sql = "select * from ad WHERE style='468x60'";
$rs = $db->Execute( $sql );
echo $rs->fields['content'];
>.<

omen
June 4th, 2007, 06:53 AM
Just remove that part. It's to call the ads from the database. It's not required, and must have been another part of the persons complete site.

digital583
August 31st, 2007, 07:38 PM
Great find man, Thanks.

Ammy
August 31st, 2007, 08:48 PM
That's awesome thank you!! =D