• 16-05-2006, 18:59:44
    #1
    Üyeliği durduruldu
    <?php 
    /*************************************************************************** 
     *                              googlesitemapgenerator.php 
     *                            ------------------- 
     *   Copyright/Support          http://www.pentapenguin.com 
     *   Last Modified: 06/05/05 
     * 
     ***************************************************************************/ 
      
    /*************************************************************************** 
     * 
     *   This program is free software; you can redistribute it and/or modify 
     *   it under the terms of the GNU General Public License as published by 
     *   the Free Software Foundation; either version 2 of the License, or 
     *   (at your option) any later version. 
     * 
     ***************************************************************************/ 
    
    define('IN_PHPBB', true); 
    $phpbb_root_path = './'; 
    include($phpbb_root_path . 'extension.inc'); 
    include($phpbb_root_path . "common.$phpEx"); 
    
    // Begin Configuration Section 
    $included_forum_ids = array(); 
    $excluded_forum_ids = array(); 
    // End Configuration Section 
    
    if ( count($included_forum_ids) > 0 ) 
    { 
       $included_forum_ids_sql = 'forum_id IN (' . implode(', ', $included_forum_ids) . ')'; 
    } 
    
    if ( count($excluded_forum_ids) > 0 ) 
    { 
       $excluded_forum_ids_sql = 'forum_id NOT IN (' . implode(', ', $excluded_forum_ids) . ')'; 
    } 
    
    if ( ( count($included_forum_ids) > 0 ) && ( count($excluded_forum_ids) > 0 ) ) 
    { 
       $and = 'AND'; 
    } 
    
    if ( ( count($included_forum_ids) > 0 ) || ( count($excluded_forum_ids) > 0 ) ) 
    { 
       $where = 'WHERE'; 
    } 
    
    $sql = "SELECT topic_id, forum_id, topic_time, topic_type FROM " . TOPICS_TABLE . " $where $included_forum_ids_sql $and $excluded_forum_ids_sql ORDER BY topic_time DESC"; 
    
    if ( !$result = $db->sql_query($sql) ) 
    { 
       message_die(GENERAL_ERROR, 'Error: could not retrive topic IDs', '', __LINE__, __FILE__, $sql); 
    } 
    
    $protocol = ( $board_config['cookie_secure'] == 0 ) ? 'http://' : 'https://'; 
    $servername = $board_config['server_name']; 
    $port = ( $board_config['server_port'] == '80' ) ? '' : ':' . $board_config['server_port']; 
    $path = $board_config['script_path']; 
    
    $output = '<' . '?xml version="1.0" encoding="UTF-8"?' . '>' . "\n"; 
    $output .= '<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">' . "\n"; 
    
    while ( $row = $db->sql_fetchrow($result) ) 
    { 
       $topic_id = $row['topic_id']; 
       $forum_id = $row['forum_id']; 
       $lastmodified = date('Y-m-d\TG:i:s+00:00', $row['topic_time']); 
       $viewtopic = "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id"; 
       $priority = ( $row['topic_type'] == POST_STICKY || $row['topic_type'] == POST_ANNOUNCE ) ? '1.0' : '0.5'; 
        
       $output .= "<url>\n"; 
       $output .= "\t<loc>$protocol$servername$port$path$viewtopic"  . "</loc>\n"; 
       $output .= "\t<lastmod>$lastmodified</lastmod>\n"; 
       $output .= "\t<changefreq>daily</changefreq>\n"; 
       $output .= "\t<priority>$priority</priority>\n"; 
       $output .= "</url>\n\n"; 
    } 
    $output .= "</urlset>\n"; 
    
    header('Content-type: application/xml'); 
    echo $output; 
    ?>

    altaki kod indexlemesini istemediğiniz forum bölümlerini gizlemek içindir. tüm forumu indexlenmesini istiyorsanız değişiklik yapmayanız. Fakat adminlerin sadece görebildiği bir bölüm varsa ve bölümün id si 15 ise aşağıdaki gibi koda 15 yazıyoruz
    $included_forum_ids = array(15, 5);
  • 16-05-2006, 19:24:07
    #2
    Misafir
    şimdi php ile uzaktan yakında hiç bir teması olmayan ama şansa bakın ki bir phpbb forumu olan bir kişi bunu nasıl düzenleyecek yoksa düzenlemeyecek mi
    nereye ne yazmamız lazım, bir yardım eden olur mu?
  • 16-05-2006, 19:36:28
    #3
    Üyeliği durduruldu
    Yukarıdaki kodlar sitemap.php olarak kaydedilip roota gönderilecek. herhangi bir değişiklik yapmaya gerek yok. sadece indexlenmesini istemediğiniz bölümü

    $included_forum_ids = array();
    kodunu bulup

    $included_forum_ids = array(15, 5);
    şeklinde değiştirmeleri gerekmektedir. Burdaki 15 ve 5 id nolu forum kategorileri sitemapta geçmeyecektir.

    Kolay gelsin
  • 16-05-2006, 19:40:39
    #4
    Misafir
    hımm oke teşekkürler...