JavaScript and PHP codes to remove DiggBar जावास्क्रिप्ट और PHP कोड DiggBar हटाने के लिए

ADVERTISEMENT विज्ञापन
To get our software and web/tips via email, sign up for हमारे सॉफ़्टवेयर और वेब ईमेल द्वारा / सुझाव हो, साइन अप करने के लिए daily email newsletter दैनिक ईमेल न्यूज़लेटर . .
Subscribe to RSS feed आरएसएस फ़ीड की सदस्यता लें or या follow me मुझे का पालन करें on Twitter? पर चहचहाना?

Digg recently Digg हाल ही में introduced DiggBar DiggBar शुरू to mixed reactions. मिश्रित प्रतिक्रिया है. We also shared a Greasemonkey script to हम भी एक Greasemonkey स्क्रिप्ट को साझा remove DiggBar DiggBar हटा , only to discover later that it can be केवल बाद में पता चलता है कि हो सकता है turned off from Digg preferences वरीयताओं Digg से बंद कर दिया . . However, DiggBar is enabled by default, and most readers are unlikely to turn it off themselves. हालांकि, DiggBar डिफ़ॉल्ट रूप से सक्षम है, और सबसे अधिक पाठकों के लिए यह अपने आप बंद की संभावना नहीं है. Here is a JavaScript code to remove DiggBar – bloggers and webmasters who find DiggBar damaging would probably find this useful. यहाँ एक जावास्क्रिप्ट कोड को DiggBar दूर - ब्लॉगर्स और वेबमास्टरों जो मिल DiggBar शायद यह उपयोगी पाते हैं हानिकारक है.

Reasons to remove DiggBar कारण DiggBar हटाने के लिए

So, what is the damage? तो, क्या नुकसान है? DiggBar does a 200 HTTP code (hence depriving sites of DiggBar एक HTTP 200 कोड है (इसलिए साइटों से वंचित Google juice गूगल का रस ). ). If a hundred sites link to your blog using the Digg shortened URL, all that juice goes to Digg. अगर एक सौ अपने ब्लॉग के लिए लिंक साइटों यूआरएल छोटा Digg उपयोग करते हुए, सब रस Digg जाता है.

Can rel=”canonical” be used to suggest a canonical url on a completely different domain? रिलायंस एनर्जी = "विहित कर सकता हूँ" को पूरी तरह से अलग डोमेन पर विहित url सुझाव इस्तेमाल हो सकता है?

No. To migrate to a completely different domain, permanent (301) redirects are more appropriate. नहीं, एक पूरी तरह से अलग डोमेन की ओर पलायन करने के लिए, (301) स्थायी रीडायरेक्ट अधिक उपयुक्त हैं. Google currently will take canonicalization suggestions into account across subdomains (or within a domain), but not across domains. गूगल फ़िलहाल उप भर के खाते में (या एक डोमेन के भीतर), लेकिन डोमेन भर canonicalization सुझाव लेंगे. So site owners can specify a canonical page on www.example.com from a set of pages on example.com or help.example.com, but not on example-widgets.com तो साइट मालिकों www.example.com पर example.com या help.example.com पर पृष्ठों का एक सेट से एक विहित पृष्ठ निर्दिष्ट कर सकते हैं बल्कि उदाहरण पर widgets.com नहीं

- -- About rel=canonical रिलायंस एनर्जी के बारे में विहित = , Google Webmasters help , गूगल की मदद वेबमास्टर्स

Canonical tag which would not work (because canonical tags work only within a domain, not cross-domain). कैनन का टैग जो काम नहीं करेगा (क्योंकि विहित टैग केवल एक डोमेन के भीतर, पार नहीं डोमेन) काम करते हैं.

How to remove DiggBar (code) कैसे DiggBar हटाने के लिए कोड ()

Initially, this article contained only the JavaScript method, but upon further searching, I also found a PHP code. शुरू में, इस अनुच्छेद केवल जावास्क्रिप्ट विधि समाहित है, पर पर आगे की खोज, मैं भी एक PHP कोड मिला. Both methods are shown here, and each is useful for different scenarios. दोनों तरीकों यहाँ दिखाया गया है, और एक अलग परिदृश्यों के लिए उपयोगी है.

Javascript code जावास्क्रिप्ट कोड

The JavaScript method redirects the user to the actual page. जावास्क्रिप्ट पद्धति वास्तविक पेज पर उपयोगकर्ता redirects. Enter this code block within head tags of your pages. आपके पृष्ठों के प्रमुख टैग के भीतर इस कोड को ब्लॉक दर्ज करें.

ADVERTISEMENT विज्ञापन

<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> <स्क्रिप्ट />

The above code removes all frames, including the frames created by Google Image search. इसके बाद के संस्करण कोड Google छवि खोज के द्वारा बनाई गई फ्रेम सहित सभी फ्रेम, हटा देता है. If you do not like image search visitors seeing the above code, use it always. यदि आप छवि खोज कोड के ऊपर देखकर दर्शक, यह हमेशा उपयोग पसंद नहीं है. If you wish to remove DiggBar only, use it only when your blog is Dugg/about to be dugg. यदि आप DiggBar निकालना चाहते हैं केवल, यह केवल का उपयोग करें जब आपके ब्लॉग Dugg है / के बारे में हो dugg है. That way, you can have the best of both worlds – image search visitors see the frame on top while DiggBar is removed during the influx of visitors (which is when your visitors will link to you and bookmark you. इस तरह, तुम दोनों दुनिया के सर्वश्रेष्ठ - छवि खोज आगंतुकों शीर्ष पर फ्रेम जबकि DiggBar आगंतुकों की बाढ़ के दौरान हटा दिया जाता है देख सकते हैं (जो है, जब आप अपने दर्शकों के लिए लिंक और आप बुकमार्क होगा.

PHP code PHP कोड

John Gruber जॉन Gruber posted a PHP snippet एक टुकड़ा PHP पोस्ट that detects DiggBar (from the URL) and shows them a greeting message. कि (URL से) DiggBar का पता लगाता है और उन्हें एक बधाई संदेश दिखाता है.

This PHP snippet merely shows a message to the visitor and stops loading the page – without redirecting the user. इस PHP टुकड़ा मात्र आगंतुक के लिए एक संदेश से पता चलता है और पेज लोड हो रहा है रुक - उपयोगकर्ता पुनः निर्देशित कर के बिना. You may want to show a hyperlink to the actual page. आप वास्तविक पृष्ठ पर एक हाइपरलिंक दिखाना चाहते हो सकता है.

<?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]')) (
echo "<p>Special message for Digg users here.</p>"; उपयोगकर्ताओं को यहाँ Digg के लिए "<p> विशेष संदेश गूंज. / p>" <;
exit; बाहर;
} )
?> ?>

The above code checks whether the referral URL is digg.com followed by 1 to 8 characters – which is typical of the DiggBar. ऊपर कोड की जाँच है कि क्या रेफरल यूआरएल digg.com 1-8 अक्षर - जो DiggBar की खासियत है इसके बाद है. If yes, it shows a message to the visitors (written within quotes on line 2) and stops loading page. यदि हाँ, यह दर्शकों के लिए एक संदेश दिखाता है (2 लाइन पर उद्धरण चिह्नों के भीतर लिखित) और पृष्ठ लोडिंग बंद हो जाता है.

To get our latest articles, हमारे नवीनतम लेख हो, click here to sign up यहाँ क्लिक करें साइन अप करने के लिए for our free email newsletter or subscribe to हमारे निःशुल्क ईमेल न्यूज़लेटर के लिए या सदस्यता लेने के लिए RSS feed आरएसएस फ़ीड

§ Comments § टिप्पणियाँ