New and improved method to remove / block DiggBar Jaunas un uzlabotas metodes, lai novērstu / bloķēt DiggBar

ADVERTISEMENT REKLĀMA
To get our software and web/tips via email, sign up for Lai veicinātu mūsu programmatūru un web / padomus pa e-pastu, pierakstīties daily email newsletter ikdienas e-pasta biļetens . .
Subscribe to RSS feed Subscribe to RSS feed or vai follow me sekojiet man on Twitter? on Twitter?

Last week, we shared JavaScript and PHP code snippets to Pagājušajā nedēļā mēs dalītu JavaScript un PHP koda daļas, lai block DiggBar bloķēt DiggBar . . While they served the purpose fairly well, each had its own flaws. Kamēr tie kalpoja, lai diezgan labi, katram bija savi trūkumi.

Here is a new, improved method that puts two and two together – by combining the PHP and JavaScript code to get the best of both worlds. Šeit ir jauna, uzlabota metode, kas izvirza divus, un divi kopīgi - apvienojot PHP un JavaScript kodu, lai iegūtu labāko no abām pasaulēm. The PHP method provided would display a message and stop rendering the page, whereas the JavaScript code would remove all frames – including Google Images. PHP metode, kas displeja paziņojumu un apstāšanās padarīt lappuses, turpretim JavaScript kods nojauks - visi rāmji skaitā Google Images. This means that visitors who see the image from, say archive pages, would not have a link to click through to the actual page. Tas nozīmē, ka apmeklētāji, kas redz attēlu no, teiksim arhīva lappusēs, nebūtu saiti noklikšķina uz Faktiskā lappuse.

So, I combined the two so that the below code checks whether the visitor is viewing a Digg shortened URL (typical of DiggBar), and if so, serves some JavaScript to redirect the user to the original web page. Tātad, es kopā divus tā, lai zem kodu pārbauda, vai apmeklētājs ir apskates Digg saīsināts URL (tipisks DiggBar), un ja tā ir, kalpo daži JavaScript novirzīt lietotāja sākotnējo tīmekļa lapu. This method can be used not just in WordPress, but in any CMS/app that supports PHP. Šo metodi var izmantot ne tikai WordPress, bet jebkurā CMS / app, kas atbalsta PHP.

ADVERTISEMENT REKLĀMA

<?php if (preg_match('#http://digg.com/\w{1,8}/?$#', <? php if (preg_match ( '# http://digg.com/ \ w (1,8 }/?$#',
$_SERVER['HTTP_REFERER']) ) { ?> $ _SERVER [ 'HTTP_REFERER'])) (?>
<script language="JavaScript" type="text/javascript"> <script LANGUAGE="JavaScript" type="text/javascript">
if (top.location != self.location) top.location.replace(self.location); if (top.location! = self.location) top.location.replace (self.location);
</script> </ script>
<?php <? php
exit; exit;
} )
?> ?>

And by the way, even Engadget, a gadget blog that hits Digg on a regular basis, has Un tā, pat Engadget, sīkrīku blogu, kas hits Digg uz regulāri, ir blocked Digg Bar bloķēts Digg Bar . . If a top publisher should block the DiggBar, I hope Digg realizes DiggBar's problems and does some serious thinking over it. Ja top izdevējs vajadzētu bloķēt DiggBar, es ceru Digg realizē DiggBar problēmas, un tā vairākas nopietnas domas pār to.

To get our latest articles, Lai veicinātu mūsu jaunākos rakstus, click here to sign up noklikšķiniet šeit, lai piereģistrētos for our free email newsletter or subscribe to mūsu bezmaksas informatīvais biļetens e-pastu vai parakstīties uz RSS feed RSS feed

§ Leave a Reply § Atstāt Atbildēt