<a href="http://www.mypagerank.ir/" title="Google Page Rank" target="_blank"><img src="http://www.mypagerank.ir/?a=getCode&s=Box" border="0px" alt="PageRank" /></a>
// Create a new PR object
require_once(PATH_LIB . 'class.kPageRank.php');
$pr = new kPageRank($cfg->getVar('path_pr_images'), $cfg->getVar('url_pr_images'));
if((!empty($_REQUEST['a'])) && ($_REQUEST['a'] == 'getCode'))
{
$style = (!empty($_REQUEST['s'])) ? $_REQUEST['s'] : $cfg->getVar('pr_image_default');
if((!empty($_SERVER['HTTP_REFERER'])))
{
$url = $_SERVER['HTTP_REFERER'];
$pagerank = $pr->getPageRank($url, $pr->hosts[0]);
$im = $pr->getImage($pagerank, $style);
if($im)
{header('Cache-Control: max-age=1');
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Expires: -1");
header("Content-type: image/gif");
imagegif($im);
}
else
{
header('Location:' . $pr->url_images . $style . '/pr0.gif');
}
}
else
{
header('Location:' . $pr->url_images . $style . '/pr0.gif');
}
}
else
{
$tpl->parse('body');
$tpl->parse('pr_form');
$styles = $pr->getStyles();
foreach($styles as $key=>$style)
{
$images = $pr->getImages($style);
$tpl->assign_d('pr_image', 'pr_image_src', $images[5]);
$tpl->assign_d('pr_image', 'pr_style', $style);
$tpl->parse_d('pr_image');
}
require_once(PATH_INCLUDE . 'footer.php');
$tpl->render_all();
}
<script language="javascript" type="text/javascript">
var num=Math.random()*10000;
document.write('<a href="http://www.mypagerank.ir/" title="Google Page Rank" target="_blank">');
document.write('<img src="http://www.mypagerank.ir/?a=getCode&s=Box&rand='+num+'" border="0px" alt="PageRank" />');
document.write('</a>');
</script>
<?php
echo("<script language=\"javascript\" type=\"text/javascript\">");
$num=rand(1000,100000);
echo("document.write('<a href=\"http://www.mypagerank.ir/\" title=\"Google Page Rank\" target=\"_blank\">');");
echo("document.write('<img src=\"http://www.mypagerank.ir/?a=getCode&s=Box&rand=$num\" border=\"0px\" alt=\"PageRank\" />');");
echo("document.write('</a>');");
echo("</script>");
?>
<script language="javascript" type="text/javascript" src="code.php"></script>
راه حلی که به ذعنم میرسه اینه :چون آن موقع سایت ما از بک لینک محروم میشه،( روبوت های گوگل جاوا اسکریپت را دنبال نمی کنند)
<script language="javascript" type="text/javascript">
var num=Math.random()*10000;
</script>
<a href="http://www.mypagerank.ir/" title="Google Page Rank" target="_blank">
<script language="javascript" type="text/javascript">
document.write('<img src="http://www.mypagerank.ir/?a=getCode&s=Box&rand='+num+'" border="0px" alt="PageRank" />');
</script>
</a>
ممنون از راه حلت، اما فکر نمی کنم، مثلا گوگل لینکی که داخلش چیزی قابل خواندن نباشه بهش ارزش بده!
یعنی لینک به یک فایل جاوا اسکریپت اصلا جالب نیست.
در کل کمک بزرگی کردی ممنون. اما باز اگه راه حلی به ذهنت خورد بهم خبر بده.
مشکل الان سئو این روش است.
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script language="javascript" type="text/javascript">
function check(id){
if (document.getElementById(id) == null) {
alert(id+' : No Exists');
}
else
alert(id+': Exists');
}
</script>
</head>
<body>
<div id="hamid"></div>
<script language="javascript" type="text/javascript">
check('hamid');
check('meysam');
</script>
</body>
</html>
ممنون حمید جان، تو آخرشی. می بینم که پارتی بازی هم کردی :d