เหมือนของพี่หมวดadsene5438 หรือเปล่าครับ
หรือว่าคนละแนว
ของพี่หมวดจะประมาณนี้ครับ
<?php
$myshop = "http://astore.amazon.de/<# YOUR AMAZON aSTORE ACCOUNT #>";
function getTheShop($myshop) {
$url = $_SERVER['QUERY_STRING'];
$url = explode("linkurl=index.php&linkurl=",$url);
if (strpos($url[1],"&") == true) {
$url[1] = strrchr($url[1],"/");
if (strpos($url[1],"?") == true) { $url[1] = strrchr($url[1],"?"); }
else $url[1] = strchr($url[1],"&"); $url[1] = substr_replace($url[1],"?",0,1);
$shopid = explode("/",$myshop);
$url[1] = $shopid[3].$url[1]; }
else { }
if ($url[1]=="") {
$var['content'] = file_get_contents($myshop);
$var['extra'] = ' <# YOUR UNIQUE CONTENT (HTML or PLAINTEXT) #> '; }
else
$var['content'] = file_get_contents("http://astore.amazon.de/".$url[1]);
return $var;
}
function getMetaTitle($content){
$pattern = "|<[\s]*title[\s]*>([^<]+)<[\s]*/[\s]*title[\s]*>|Ui";
if(preg_match($pattern, $content, $match))
return $match[1];
else
return false;
}
$content = getTheShop($myshop);
$extra = $content['extra'];
$content = preg_replace("/\/\d{3}\-\d{7}\-\d{7}/", "", $content['content']);
// $content = $content['content'];
$tabletext = explode('alt="',$content);
for($i = 0; $i < count($tabletext); $i++) { $tabletext[$i] = substr($tabletext[$i], 0, strpos($tabletext[$i], '"')); }
$title = getMetaTitle($content);
$title = explode(" - ",$title);
$content = explode("</title>",$content);
unset($content[0]);
$content = implode("</title>",$content);
$content = str_replace('action="', ' action="http://astore.amazon.de', $content);
$content = str_replace('</title>', '', $content);
$content = str_replace('<title>', '', $content);
$content = str_replace('</body>', '', $content);
$content = str_replace('</html>', '', $content);
$content = str_replace('<body>', '', $content);
$content = str_replace('<html>', '', $content);
$tiler = substr (strrchr ($content, '<body>'), 0);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title><?php echo "Buy ".$title[1]." in our Shop. ".$title[0]." - ".$title[1] ?></title>
<meta name="description" content="<?php echo "You search ".$title[0]."? Look around, we provide ".$title[0]." - ".$title[1] ?>" />
<meta name="keywords" content="<?php echo $title[1].", ".$title[0].", "; for($i = 8; $i < 18; $i++) { echo trim($tabletext[$i]).", "; } ?>" />
<meta name="robots" content="index,follow" />
<meta name="revisit-after" content="1" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php echo trim($content);
echo '<br style="clear:both;" />';
echo $extra; ?>
</body>
<# YOUR GOOGLE ANALYTICS CODE #>
</html>