SMF forum indexlenmesi çok pratik.[Test edildi]

Started by Webersin, August 21, 2006, 06:31:39 PM

Previous topic - Next topic

Webersin

Sitemap modifikasyonu için konunun son iletisine bakmanız şiddetle önerilir.

<?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
   LIMIT 1000"
, __FILE__, __LINE__);
$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
   LIMIT 20"
, __FILE__, __LINE__);
$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';
}

?>


yapmanız gerekenler
1.LIMIT 1000", __FILE__, __LINE__); üstte verdiğim cod da LIMIT 1000 sayısı sizin forumda kaç tane konu varsa onu belirtin

2.LIMIT 20", __FILE__, __LINE__); bu code de LIMIT 20 yazan yeri forumda kaç üyeniz varsa limit belirleyin.


1 dediğim : konu sayısını belirler.Bunu da konu sayının biraz daha üstüne ayarlarsan sorun olmaz.
2 dediğim :İkinci dediğimde 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
18 Yaşından Küçükleri Yeni msn listeme eklemiyorum.

Stt

tabi forumun ziyaretçilere açık olması gerekir di mi,, açıcaz mecbur  ::)

ankahukuk

Ben bir yerde hata yapıyorum ama nerde..
google index sayfası açıp linklerin hazırlanmasını beklerken şöyle bir hata çıktı.

----------------------
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


--------------------------------------------------------------------------------

Only one top level element is allowed in an XML document. Error processing resource 'http://..............com/forum/googlei...

<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /home2/.........../publi...

GÜNCEL HUKUK SİTESİ
http://www.ankahukuk.com [nofollow]

KaLpSiz

ßu konun bukadar önemli olmasına rağmen pek rahabet görmedi enterasan ersinin söyledikleri ile olmuşsa şuan 1000 taneye yakın sayfası indexli bir mod bunun mantığını açıklasa iyi olur sanırım

тяƒσяυм¢α.¢σм

Anlatilanlrin hepsini yaptim google'da kaydolduk

www.trforumca.com/sitemap.xml  << bu öncedende wardi ama google hep profilleri indexliyodu 100 profil indexlemişti 1 haftada bakalım yarin değişen bişey olcak mı?Eğer olursa süperrrrrr olur ;)

mgimadu

Güzel fikir vallahi, çarçabuk sitemap oluşturuyor, tebrikler
.ıl I love you simplemachines lı.
Forumgil.com - Enter my site.
My Mods        - Enter my Mods.
I wait you SMF 2.0

Varista

Arkadaşlar eğer değişme görenler olursa yazsınlar.
Ersin baba sağolasın ;)

sempoo

arkadsım cok saol
ıslem tıkır tırkır
ıslıyoo sorun yokkk

camgibi

LIMIT 10", __FILE__, __LINE__);   burada bir değişiklik yapacağızmı..güzel bir şey teşekkürler..umarım faydası olur...

fatihk34

Parse error: parse error, unexpected ';', expecting ')' in /var/www/virtual/pcgar.com/htdocs/SSI.php on line 1611

}

function ssi_shout($showform = true;)
{
global $sourcedir;

include_once("$sourcedir/shout.php");
shout_display($showform);
}
?>


1611 satırda bu var : function ssi_shout($showform = true;)

Bu hatayı alıyorum. Ne yapmalıyım. Yardım plz

Webersin

arkadaşlar bugunde sayfa indexlenme sayısı arttı hergün geceleyin indexleme yapıyor galiba :)
18 Yaşından Küçükleri Yeni msn listeme eklemiyorum.

BesTCooL

#11
aslında google nın kendı sitemap yontemı ve hesaplayıcısı va rama nasıl kullanılcak.

http://www.google.com/webmasters/sitemaps/docs/en/sitemap-generator.html
http://www.google.com/webmasters/sitemaps/docs/en/sitemap-generator.html#download

Scriptleri kendinize göre editleyin diyor google otomatik indexlesin ama tam anlamıyola cozemedım...


sonra bu dosyaları ftp ye atın demıs..
config.xml —this is the configuration file you just created using example_config.xml.
sitemap_gen.py —this is the Python script that generates your Sitemap.

osenmer

ben daha önce sitemap hazırlamıştım ve googleye tanıttım, hemen hemen foruumun tüm konuları indexlendi fakat googlede http://www.google.com.tr/search?hl=tr&client=firefox-a&rls=org.mozilla%3Atr%3Aofficial_s&q=site%3Aforumgezgini.com&meta=

baktığımızda hepsinde forum tamamen açık olmasına rağmen "Merhaba, Ziyaretçi. Lütfen giriş yapın veya üye olun" yazıyor. konuların içeriği indexlenmiyor.

acaba bunun bir çözümü varmı?

KirpiX

Quote from: osenmer on August 23, 2006, 04:10:23 AM
ben daha önce sitemap hazırlamıştım ve googleye tanıttım, hemen hemen foruumun tüm konuları indexlendi fakat googlede http://www.google.com.tr/search?hl=tr&client=firefox-a&rls=org.mozilla%3Atr%3Aofficial_s&q=site%3Aforumgezgini.com&meta=

baktığımızda hepsinde forum tamamen açık olmasına rağmen "Merhaba, Ziyaretçi. Lütfen giriş yapın veya üye olun" yazıyor. konuların içeriği indexlenmiyor.

acaba bunun bir çözümü varmı?

forumu ziyaretçilere açman gerekiyor.
bu sitemapı forum klasörünün içinemi atınca daha etkili olyor yoksa site rootunamı?
MsN Durumum Şu Anda------->
http://www.locked5.com/

osenmer

forum kururlduğundan beri ziyaretçilere açık. benim canımı sıkanda o.

KirpiX

o zaman bilemiyeceğim dostum ama googlenin indexlemeye başladığında kapalı kalmış olabilir gibi geliyor aklıma önceki sitemizde yaşamıştık bu türde bir sorunu ziyaretçiler modu yüklüyse ve o ziyaretçiyi engelliyorsa oda olabilir benim ilk aklıma gelen bunlar
MsN Durumum Şu Anda------->
http://www.locked5.com/

izmirli_

tşk valla ya sitemapı 3 kere denedim hep hata verdi inşallah bu olur...

mHD®

Gerçekten de bir çok kişini gözünden kaçabilir ya da bilmediği bi olay. Teşekkürler emeğine sağlık :)

merk112

www.kimmuh.com
www.kimyaturk.net
www.tiplit.com
www.kimyaportal.com

osenmer

arkadaşlar bence smf forumda herhangi bir mod kurmadan önce ilk kurulacak şeylerden biri sitemap. googlenin indexlemesinde çok önemli. ilk kurduğumda sitenin sadece ismi googlede çıkıyordu, sitemapı kurduktan ve googleye tanıttıktan sonra neredeyse tüm konu isimleri indexlendi.

tek sorun ise sadece konu isimlerinin indexlenmesi, konu içerikleri indexlenmedi. belki beklemek gerekiyor. ::)

Advertisement: