Subscribe to RSS feed आरएसएस फ़ीड की सदस्यता लें or या follow me मुझे का पालन करें on Twitter? पर चहचहाना?
Last week, we shared JavaScript and PHP code snippets to पिछले हफ्ते, हम जावास्क्रिप्ट और PHP कोड के टुकड़े को साझा block DiggBar DiggBar ब्लॉक . . While they served the purpose fairly well, each had its own flaws. जब वे उद्देश्य सेवा की काफी अच्छी तरह से, प्रत्येक की अपनी खामियां हैं.
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. यहाँ एक नया, बेहतर तरीका है कि दो और दो को एक साथ कहते हैं - PHP और जावास्क्रिप्ट कोड का संयोजन से दोनों दुनिया की सबसे अच्छी हो रही है. 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 विधि एक संदेश प्रदर्शित होता प्रदान की है और पृष्ठ बंद कर दे, जबकि जावास्क्रिप्ट कोड गूगल छवियाँ सहित सभी फ्रेम - दूर होगी. This means that visitors who see the image from, say archive pages, would not have a link to click through to the actual page. इसका मतलब यह है कि जो आगंतुकों से छवि देखते हैं, संग्रह पृष्ठों कहते हैं, के माध्यम से वास्तविक पृष्ठ पर क्लिक करने के लिए एक लिंक नहीं होता.
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. तो, मैं तो दो कि कोड की जाँच है कि क्या आगंतुक एक छोटा यूआरएल Digg देखने है (नीचे DiggBar की विशिष्ट संयुक्त), और यदि हां, तो कुछ जावास्क्रिप्ट के लिए मूल वेब पृष्ठ के लिए उपयोगकर्ता अनुप्रेषित करता है. This method can be used not just in WordPress, but in any CMS/app that supports PHP. इस पद्धति में सिर्फ WordPress, इस्तेमाल नहीं किया जा सकता है, लेकिन किसी भी सीएमएस में / app कि PHP का समर्थन करता है.
<?php if (preg_match('#http://digg.com/\w{1,8}/?$#', ? <php अगर preg_match ( '(# http://digg.com/ \ (1,8 }/?$#', w
$_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); अगर top.location (! = self.location) (self.location) top.location.replace;
</script> <स्क्रिप्ट />
<?php <? php?
exit; बाहर;
} )
?> ?>
And by the way, even Engadget, a gadget blog that hits Digg on a regular basis, has और वैसे भी Engadget, एक ब्लॉग है कि हिट एक नियमित आधार पर Digg है, गैजेट blocked Digg Bar Digg बार अवरुद्ध . . If a top publisher should block the DiggBar, I hope Digg realizes DiggBar's problems and does some serious thinking over it. अगर एक शीर्ष प्रकाशक DiggBar ब्लॉक, मुझे उम्मीद है कि Digg चाहिए DiggBar समस्याओं का पता चलता है और इस पर कुछ गंभीर सोच रही है.
Related reading संबंधित पठन
- How to remove DiggBar (Greasemonkey script) कैसे DiggBar (Greasemonkey स्क्रिप्ट निकालने के लिए)
- JavaScript and PHP codes to remove DiggBar जावास्क्रिप्ट और PHP कोड DiggBar हटाने के लिए
- DiggBar Remover removes DiggBar the smart way DiggBar हटानेवाला DiggBar स्मार्ट तरीका निकाल
- How to block popups and ads in Google Chrome कैसे गूगल क्रोम में पॉपअप और विज्ञापनों खंड को