بسم الله الرَّحمن الَّرحيم.


Veuillez patienter SVP...

Please wait for loading the page...

الرجاء الإنتظار حتى يتم تحميل الصَّفحة..

By: SAMI BETTAYEB.جميع الحقوق محفوظة لِـ: سامي بالطيب

تحسين أرشفة المنتديات ( منتديات phpbb )





دائما في إطار تحسين أرشفة المنتديات (أنا أقصد هنا منتديات phpbb )

الآن بعد أن صنعنا خريطة لموقعنا و قدمناها الى قوقل كما شرحنا في الموضوع السابق

http://www.djelfa.info/vb/showthread.php?t=326436

يتسائل البعض لماذا لا تبقى روبوتات الفهرسة طويلا في منتداي ؟؟؟

لماذا يختفي روبوت فهرسة قوقل بمجرد أن أحدث الصفحة ؟؟؟؟

الإجابة قد تكون بسبب الروابط الخاريجة، يعني الجميع يضع روابط لتحميل صور و لتحميل برامج أو روابط لمواقع

أخرى أو ماشابه

عندما تأتي روبوتات الفهرسة و تجد هذه الروابط تقوم بتتبعها و بهذا تخرج من المنتدى........

الحل

هو ما سنتحدث عنه اليوم أو ما يسمى بــ Nofollow ( عدم التتبع)

هذا مجرد كود و عند وضعه ستقوم محركات أو روبوتات الفهرسة بتجاهل هذه الروابط و عدم تتبعها

و هكذا تبقى لمدة أطول في المنتدى

مع الإبقاء على خاصية تتبع الروابط الداخلية التي تخص منتداك

كما تستطيع إضافة قائمة مواقع صديقة تستثنيها من هذا الكود.

كيف نضع الكود

أولا إفتح ملف viewtopic.php

إبحث عن

كود:
$message = bbcode_nl2br($message);
 $message = smiley_text($message);
أضف بعدها في سطر جديد
كود:
// BEGIN nofollow
    // February 5th, 2010 By Liv Jones
    //www.ikseb.info/phpBB

    // *Custom Variables:
       
       // If your server variable isn't set you may need to replace
       // this line with an example such as:
       // $home_url=greensboring.com;

       $home_url=$_SERVER['HTTP_HOST'];

    // *Option Custom Variables:

       // هنا تستطيع وضع قائمة مواقع صديقة لا تريد تطبيق النو فلو عليها
       
        
       $short_list=array(
       'www.extra-pc.com',
       'www.phpbbarabia.com',
       'www.phpbb.com',
    'www.ikseb.info',
       );

       // تفعيل روابط الدو فلو في الرد الأول فقط
       //الحالة الحالية معطلة
     

        $follow_fp='disable';


    // ************ CHANGE NOTHING BELOW HERE ****************

    // Make all the links the same format regardless of url tag
    $message = preg_replace('/(a class="postlink" href="(.*?)")/','a href="$2" class="postlink"',$message);
   
    // replace all links with nofollow             
    $message = preg_replace('/(class="postlink")/','class="postlink" rel="nofollow" onclick="********open(this.href);return false;"',$message);

    // parse out local links to remove nofollow
    $message = preg_replace('/(a href="http:\/\/'.$home_url.'(.*?)" class="postlink" rel="nofollow" onclick="********open\(this.href\)\;return false\;")/','a href="http://'.$home_url.'$2" class="postlink-local"',$message);

// DoFollow on First Post only like a blog
    if (($row['post_id'] == $topic_data['topic_first_post_id']) && ($follow_fp != 'disable') && ($user_cache[$poster_id]['posts'] > 3)) {
    $message = preg_replace('/(rel="nofollow")/','',$message);
    }

    // Licensing
    $message = preg_replace(base64_decode('LyBHcmVlbnNib3JvIC8='),base64_decode('PGEgaHJlZj0iaHR0cDovL2dyZWVuc2JvcmluZy5jb20vIj4gR3JlZW5zYm9ybyA8L2E+'),$message);

    // Optional WhiteList for dofollowing
    // (But still open in new window)

    foreach($short_list as $sl) {
    $message = preg_replace('/(href="http:\/\/'.$sl.'(.*?)" class="postlink" rel="nofollow")/','href="http://'.$sl.'$2" class="postlink" rel="dofollow"',$message);
    }

    // Parsing Image Sizes
    if ($row['post_id'] == $topic_data['topic_first_post_id']) {
    $message = preg_replace('/(alt="Image")/','alt="Image" style="max-width:400px;"',$message); } else {
    $message = preg_replace('/(alt="Image")/','alt="Image" style="max-width:650px;"',$message); }

    // END - nofollow



يفضل استخدام برنامج Notepad++ للتعديل على الملف

تم بحمد الله و أتمنى أن الجميع يستفيد من الشرح البسيط..........



منقول من منتديات الجلفة

0 commentaires:

Enregistrer un commentaire

الرَّجاء كتابة تعليقك حول الموضوع في هذا المستطيل...

Go to: This page. for more informations.
By: SAMI BETTAYEB.

 
Hello