JavaScript and PHP codes to remove DiggBar جافا سكريبت و [فب رموز لإزالة 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 يسو مؤخرا introduced DiggBar عرض DiggBar to mixed reactions. ردود فعل مختلطة. We also shared a Greasemonkey script to علينا أيضا أن تشترك في البرنامج النصي لغرسمونكي remove DiggBar إزالة DiggBar , only to discover later that it can be ، ليكتشف لاحقا أنه يمكن أن يكون turned off from Digg preferences شعال يسو من التفضيلات . . 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 يفعل 200 المتشعب رمز (وبالتالي حرمان من المواقع Google juice عصير جوجل ). ). If a hundred sites link to your blog using the Digg shortened URL, all that juice goes to Digg. إذا كان مئات من مواقع الارتباط الخاصة بك لبلوق باستخدام يسو اختصار عنوان ، كل ذلك يذهب إلى عصير يسو.

Can rel=”canonical” be used to suggest a canonical url on a completely different domain? هل يمكن استخدام rel = "المقبول" أن يشير إلى وجود رابط المقبول على نطاق مختلف تماما؟

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. جوجل حاليا سوف تأخذ بعين الاعتبار الاقتراحات التوافق عبر النطاقات الفرعية (أو داخل النطاق) ، ولكن ليس عبر المجالات. 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 حول rel = الكنسي , 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. في البداية ، وهذه المادة لا يتضمن سوى طريقة وجافا سكريبت ، ولكن بعد مزيد من البحث ، كما أنني وجدت رمز بي. Both methods are shown here, and each is useful for different scenarios. كلا أساليب ترد هنا ، وكل مفيد لمختلف السيناريوهات.

Javascript code شفرة جافا سكريبت

The JavaScript method redirects the user to the actual page. الأسلوب جافا سكريبت إعادة توجيه المستخدم إلى صفحة الفعلية. Enter this code block within head tags of your pages. يدخل ضمن هذه الكتلة رمز السمات رئيس صفحاتك.

ADVERTISEMENT إعلان

<script language="JavaScript" type="text/javascript"> <scriptlanguage="JavaScript" type="text/javascript">
if (top.location != self.location) top.location.replace(self.location); إذا كان (top.location! = self.location) top.location.replace (self.location) ؛
</script> </ النصي>

The above code removes all frames, including the frames created by Google Image search. رمز أعلاه يزيل جميع الأطر ، بما في ذلك الأطر التي أنشأتها مجموعات البحث عن الصور. 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 فب] رمز

John Gruber جون غروبر posted a PHP snippet نشر مقتطف [فب] that detects DiggBar (from the URL) and shows them a greeting message. أن يكشف DiggBar (من العنوان) ، وتبين لهم رسالة التهنئة.

This PHP snippet merely shows a message to the visitor and stops loading the page – without redirecting the user. هذا مقتطف [فب] مجرد رسالة يبين للزائر وتوقف تحميل الصفحة -- دون إعادة توجيه المستخدم. You may want to show a hyperlink to the actual page. قد ترغب في عرض ارتباط تشعبي إلى صفحة الفعلية.

<?php if (preg_match('#http://digg.com/\w{1,8}/?$#', <؟ [فب] إذا (preg_match ( '# http://digg.com/ \ ث (1،8}/؟$#'،
$_SERVER['HTTP_REFERER']) ) { $ _SERVER [ 'HTTP_REFERER'])) (
echo "<p>Special message for Digg users here.</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 تعليقات §