Türkiye'nin En Eski Webmaster Forumu İyinet'e Hoşgeldiniz!

SMF forum indexlenmesi çok pratik.[Test edildi]

theersin

0
Onaylı Üye
Üye
Katılım
2 Şubat 2006
Mesajlar
1,410
Açılan Konu
124
Tepki puanı
4
Konum
Pendik
Kod:
<?php

require_once('SSI.php');

if ($modSettings['smfVersion'] < '1.1')
    ob_start('ob_sessrewrite');

header('Content-Type: text/plain');

echo '<?xml version="1.0" encoding="UTF-8"?' . '>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">';

$request = db_query("
    SELECT posterTime
    FROM {$db_prefix}messages
    WHERE ID_MSG >= " . ($modSettings['maxMsgID'] - 30) . "
    ORDER BY ID_MSG DESC
    LIMIT 10", __FILE__, __LINE__);
$latest_post_times = array(time());
while ($row = mysql_fetch_assoc($request))
    $latest_post_times[] = $row['posterTime'];
mysql_free_result($request);

$request = db_query("
    SELECT ID_BOARD
    FROM {$db_prefix}boards", __FILE__, __LINE__);
$boards = array();
while ($row = mysql_fetch_assoc($request))
{
    $request2 = db_query("
        SELECT posterTime
        FROM {$db_prefix}messages
        WHERE ID_BOARD = $row[ID_BOARD]" . ($modSettings['totalMessages'] > 100000 ? "
            AND ID_MSG >= " . ($modSettings['maxMsgID'] * 0.5) : '') . "
        ORDER BY ID_MSG DESC
        LIMIT 10", __FILE__, __LINE__);
    $board_post_times = array(time());
    while ($row2 = mysql_fetch_assoc($request2))
        $board_post_times[] = $row2['posterTime'];
    mysql_free_result($request2);

    $boards[] = array(
        'id' => $row['ID_BOARD'],
        'times' => $board_post_times,
    );
}
mysql_free_result($request);

$request = db_query("
    SELECT ID_TOPIC
    FROM {$db_prefix}topics
    ORDER BY numViews + numReplies DESC
[COLOR=Red]    LIMIT 1000", __FILE__, __LINE__);[/COLOR]
$topics = array();
while ($row = mysql_fetch_assoc($request))
{
    $request2 = db_query("
        SELECT posterTime
        FROM {$db_prefix}messages
        WHERE ID_TOPIC = $row[ID_TOPIC]
        ORDER BY ID_MSG DESC
        LIMIT 10", __FILE__, __LINE__);
    $topic_post_times = array(time());
    while ($row2 = mysql_fetch_assoc($request2))
        $topic_post_times[] = $row2['posterTime'];
    mysql_free_result($request2);

    $topics[] = array(
        'id' => $row['ID_TOPIC'],
        'times' => $topic_post_times,
    );
}
mysql_free_result($request);

$request = db_query("
    SELECT ID_MEMBER
    FROM {$db_prefix}members
    ORDER BY totalTimeLoggedIn DESC
[COLOR=Red]    LIMIT 20", __FILE__, __LINE__);[/COLOR]
$members = array();
while ($row = mysql_fetch_assoc($request))
{
    $request2 = db_query("
        SELECT posterTime
        FROM {$db_prefix}messages
        WHERE ID_MEMBER = $row[ID_MEMBER]" . ($modSettings['totalMessages'] > 100000 ? "
            AND ID_MSG >= " . ($modSettings['maxMsgID'] * 0.5) : '') . "
        ORDER BY ID_MSG DESC
        LIMIT 10", __FILE__, __LINE__);
    $member_post_times = array(time());
    while ($row2 = mysql_fetch_assoc($request2))
        $member_post_times[] = $row2['posterTime'];
    mysql_free_result($request2);

    $members[] = array(
        'id' => $row['ID_MEMBER'],
        'times' => $member_post_times,
    );
}
mysql_free_result($request);

// First, the forum URL.  Highest priority!
echo '
    <url>
        <loc>', $scripturl, '</loc>
        <lastmod>', posts_max_time($latest_post_times), '</lastmod>
        <changefreq>', posts_to_freq($latest_post_times), '</changefreq>
        <priority>1.0</priority>
    </url>';

// Now the boards!
foreach ($boards as $board)
{
    echo '
    <url>
        <loc>', $scripturl, '?board=', $board['id'], '.0</loc>
        <lastmod>', posts_max_time($board['times']), '</lastmod>
        <changefreq>', posts_to_freq($board['times']), '</changefreq>
        <priority>', posts_to_priority(0.8, $board['times']), '</priority>
    </url>';
}

// Popular topics too...
foreach ($topics as $topic)
{
    echo '
    <url>
        <loc>', $scripturl, '?topic=', $topic['id'], '.0</loc>
        <lastmod>', posts_max_time($topic['times']), '</lastmod>
        <changefreq>', posts_to_freq($topic['times']), '</changefreq>
        <priority>', posts_to_priority(0.7, $board['times']), '</priority>
    </url>';
}

// Most active members?
foreach ($members as $member)
{
    echo '
    <url>
        <loc>', $scripturl, '?action=profile;u=', $member['id'], '</loc>
        <lastmod>', posts_max_time($member['times']), '</lastmod>
        <changefreq>', posts_to_freq($member['times']), '</changefreq>
        <priority>', posts_to_priority(0.5, $board['times']), '</priority>
    </url>';
}

echo '
</urlset>';

function posts_max_time($post_times)
{
    if (empty($post_times) || count($post_times) == 1)
        return gmstrftime('%Y-%m-%dT%H:%M:%S+00:00', time() - 3600 * 24 * 10);

    return gmstrftime('%Y-%m-%dT%H:%M:%S+00:00', max($post_times));
}

function posts_to_priority($base, $post_times)
{
    if (empty($post_times) || count($post_times) == 1)
        return sprintf('%1.1f', $base);

    $s = (max($post_times) - min($post_times)) / count($post_times);

    if ($s < 3600 * 24)
        $mod = 0.1;
    else
        $mod = 0;

    return sprintf('%1.1f', $base + $mod);
}

function posts_to_freq($post_times)
{
    if (empty($post_times) || count($post_times) == 1)
        return 'yearly';

    $s = (max($post_times) - min($post_times)) / count($post_times);

    // Changes more often than every hour.
    if ($s < 3600)
        return 'always';
    elseif ($s < 3600 * 12)
        return 'hourly';
    elseif ($s < 3600 * 24 * 4)
        return 'daily';
    else
        return 'monthly';
}

?>

İlkinin değeri konu sayısını belirler.Bunu da konu sayının biraz daha üstüne ayarlarsan sorun olmaz. İkinci kırmızı da kullanıcı profilleri. kaç tane istersen ayarlayabilirsiniz.


SMF kullanan bir sürü arkadaş forum indexlenmiyor diye dert yanmıştı bende çok sıkıntı çekiyordum bu konuda bir sürü program denedim fakat çok uzun sürdüğü için hep yarıda bıraktım üssteki code ise herşeyi kolaşlaştırıyor.

yukardaki kodu boş tane .php dosyası oluşturun içine atın codeleri ve kaydettikten sonra ftp forum ana dizine atın .php dosyasını ondan sonra
siteadi.com/forum/xxx.php açın ve bekleyin size herşeyi hazırlıcak sitemap hazırlama işi bittikten sonra sitemap.xml diye dosya yaratın ve xxx.php deki tüm linkleri sitemap.xml içine aktarın gerisi biliyorsun google.com/webmasters/sitemap sitemap kaydedin 2 önce yaptım ve bugun kontrol ettim forum daki konular indexlenmiş

örnek:
site:www.geceninrengi.net/forum - Google'da Ara
 

leet

0
Onaylı Üye
Üye
Katılım
6 Temmuz 2006
Mesajlar
602
Açılan Konu
16
Tepki puanı
0
pıratik değiL pratik oLacak..
 

Varista

0
Onaylı Üye
Üye
Katılım
12 Haziran 2006
Mesajlar
973
Açılan Konu
30
Tepki puanı
0
Konum
Samsun
Deniyorum inşallah işe yarar yoksa bu smf'den çekeceğimiz var :(
 

Gookhan

0
Onaylı Üye
Üye
Katılım
15 Ağustos 2005
Mesajlar
1,040
Açılan Konu
24
Tepki puanı
6
Konum
Ardeşen
sitemap gibi bişe kurmuştum bi işe yaramadı. topu topu 40 sayfam indexlenmişti.
Birde bu yolu deniyelim.
Paylaşımın için çok teşekkürler sağolasın
 

theersin

0
Onaylı Üye
Üye
Katılım
2 Şubat 2006
Mesajlar
1,410
Açılan Konu
124
Tepki puanı
4
Konum
Pendik
arkadaşlar bugunde kontrol ettim yine bugun indexleme yapmış konuları hergün alıyor galiba :)
 

Hostmaster

0
Onaylı Üye
Üye
Katılım
26 Ağustos 2006
Mesajlar
1,486
Açılan Konu
29
Tepki puanı
0
Kaan Aykutun Çok İşine Yarıycak Bu O Da Çok Gıcık Oluyodu SMF'nin Indexlenme Olayına :)
 

eksiksizlisans

eksiksiz.com
Onaylı Üye
Üye
Katılım
3 Ocak 2004
Mesajlar
353
Açılan Konu
45
Tepki puanı
5
Konum
istanbul
google.com/webmasters/sitemap hesabıma ekledim ama karşısında error diye birşey çıktı. indexleme filanda yapmamış karşısında verify var nasıl verify yapabilirim smf yi?
 

Forum53.Com

0
Onaylı Üye
Üye
Katılım
9 Eylül 2006
Mesajlar
26
Açılan Konu
3
Tepki puanı
0
bunun çalışması için sitenin ziyaretçilere açık olması mı gerekio ? bugünde kadar kullandığım indxleme çeşitlerinde hep açık olması gerekti de . tşkrler paylşm için bi denylim baklm...
 

Beyaz

0
Onaylı Üye
Üye
Katılım
10 Eylül 2006
Mesajlar
256
Açılan Konu
31
Tepki puanı
1
google botlar siteye üye olamadığı için mecburen açık olması gerekiyor bende denedim bunu oldu ama tamamını indexlemiyor..
 
Üst