هاست لینوکس

آخرین بسته‌ی MyBB: نسخه‌ی 1.8.27 MyBB منتشر شد


امتیاز موضوع:
  • 0 رأی - میانگین امتیازات: 0
  • 1
  • 2
  • 3
  • 4
  • 5
sitemap plugin
#1
دوستان من بعد از اينكه كلي دنبال يه سايت مپ گشتم ديدم آب د ركوزه و ما گرد جهان ميگرديم :d سايت ماي بي بي يك پلاگين سايت مپ گذاشته بود همه چيز اين پلاگين درست كار ميكنه اما براي submit كردنش در گوگل با ارور مواجه ميشم ميگه كه Invalid URL
This is not a valid URL. Please correct it and resubmit. و خطا رو از خط چهارم تشخيص ميده ، كسي ميدونه اين مشكل مربوط به چيه ؟؟ اينم كد sitemap.php

ممنون.


کد php:
<?php

//Output will be an XML Doc
header("Content-Type: text/xml");

//Hook into MyBB
define("IN_MYBB"1);
require_once(
"./global.php");


//Check if SEO URLs are active
$result mysql_query("SELECT * FROM ".TABLE_PREFIX."settings WHERE name = 'seourls'");

if(
mysql_num_rows($result) > 0){
   
   
$row mysql_fetch_assoc($result);
   if(
$row['value'] == "no"){
      
$seoactive 0;
   }else{
      
$seoactive 1;
   }
   
}else{
   
$seoactive 0;
}

  function 
getRemoteIP ()
  {
  
    
// check to see whether the user is behind a proxy - if so,
    // we need to use the HTTP_X_FORWARDED_FOR address (assuming it's available)

    
if (strlen($_SERVER["HTTP_X_FORWARDED_FOR"]) > 0) { 

      
// this address has been provided, so we should probably use it

      
$f $_SERVER["HTTP_X_FORWARDED_FOR"];

      
// however, before we're sure, we should check whether it is within a range 
      // reserved for internal use (see http://tools.ietf.org/html/rfc1918)- if so 
      // it's useless to us and we might as well use the address from REMOTE_ADDR

      
$reserved false;

      
// check reserved range 10.0.0.0 - 10.255.255.255
      
if (substr($f03) == "10.") {
        
$reserved true;
      }

      
// check reserved range 172.16.0.0 - 172.31.255.255
      
if (substr($f04) == "172." && substr($f42) > 15 && substr($f42) < 32) {
        
$reserved true;
      }

      
// check reserved range 192.168.0.0 - 192.168.255.255
      
if (substr($f08) == "192.168.") {
        
$reserved true;
      }

      
// now we know whether this address is any use or not
      
if (!$reserved) {
        
$ip $f;
      }

    } 

    
// if we didn't successfully get an IP address from the above, we'll have to use
    // the one supplied in REMOTE_ADDR

    
if (!isset($ip)) {
      
$ip $_SERVER["REMOTE_ADDR"];
    }

    
// done!
    
return $ip;

  }

//Log this visit
$db->insert_query("sitemap_crawls",

            array(
                
"useragent" => $_SERVER['HTTP_USER_AGENT'],
                
"remoteip" => getRemoteIP(),
                
"timestamp" => time()
            )

         );

$itemcount 0;

$items = array();

//Dont forget the homepage
$now date(c);
$items[$itemcount] = Array('loc'=>$mybb->settings['homeurl'],'lastmod'=>$now,'priority'=>'1','changefreq'=>'daily');
$itemcount++;


//Get Threads
$result mysql_query("SELECT * FROM ".TABLE_PREFIX."threads ORDER BY tid DESC");

while(
$thread mysql_fetch_array($result)){

   if(
$seoactive == 0){
      
$threadfilename "showthread.php?tid=".$thread['tid'];
   }else{
      
$threadfilename "thread-" $thread['tid'] . ".html";
      
//$threadfilename = strtolower(str_replace(" ","-",str_replace(array("&","*","^","?","#",":","!",";","$","£"),"",$thread['subject'])))."-t-".$thread['tid'].".html";
   
}

   
$lastmod date(c,$thread['lastpost']);
   
$items[$itemcount] = Array('loc'=>$mybb->settings['homeurl']."/".$threadfilename,'lastmod'=>$lastmod,'priority'=>'0.5','changefreq'=>'daily');
   
$itemcount++;
}

//Get Forums
$result mysql_query("SELECT * FROM ".TABLE_PREFIX."forums ORDER BY fid DESC");

while(
$forum mysql_fetch_assoc($result)){
    
   if(
$seoactive == 0){
      
$forumfilename "forumdisplay.php?fid=".$forum['fid'];
   }else{
      
$forumfilename "forum-" $forum['fid'] . ".html";
   }
   
   
$lastmod date(c$forum['lastpost']);
   
$items[$itemcount] = Array('loc'=>$mybb->settings['homeurl']."/".$forumfilename,'lastmod'=>$lastmod,'priority'=>'0.5','changefreq'=>'daily');
   
$itemcount++;
}

//So now we have all of our items, build the sitemap
echo<<<END
<?xml version="1.0" encoding="UTF-8"?>
<!-- Auto Sitemap for MyBB by Goughy000 -->
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
END;

foreach(
$items AS $item){
   echo 
"\t<url>\r\n";
   echo 
"\t\t<loc>".$item['loc']."</loc>\r\n";
   echo 
"\t\t<lastmod>".$item['lastmod']."</lastmod>\r\n";
   echo 
"\t\t<priority>".$item['priority']."</priority>\r\n";
   echo 
"\t\t<changefreq>".$item['changefreq']."</changefreq>\r\n";
   echo 
"\t</url>\r\n";
}
?>
</urlset> 
پاسخ
 سپاس شده توسطHOssE!N-B (۱۳۹۰/۶/۳۱، ۱۸:۱۹:۵۱ عصر)


پیام‌های داخل این موضوع
sitemap plugin - توسط siavash-cena - ۱۳۹۰/۶/۳۱، ۱۸:۱۷:۴۳ عصر
RE: sitemap plugin - توسط siavash-cena - ۱۳۹۰/۶/۳۱، ۲۰:۰۱:۳۸ عصر
RE: sitemap plugin - توسط M48D1 - ۱۳۹۰/۶/۳۱، ۲۰:۱۱:۴۰ عصر
RE: sitemap plugin - توسط siavash-cena - ۱۳۹۰/۶/۳۱، ۲۱:۲۲:۲۱ عصر
RE: sitemap plugin - توسط Christian - ۱۳۹۰/۶/۳۱، ۲۱:۳۰:۳۱ عصر
RE: sitemap plugin - توسط siavash-cena - ۱۳۹۰/۶/۳۱، ۲۱:۴۲:۰۴ عصر
RE: sitemap plugin - توسط M48D1 - ۱۳۹۰/۷/۱، ۰۰:۵۶:۲۹ صبح
RE: sitemap plugin - توسط siavash-cena - ۱۳۹۰/۷/۱، ۰۱:۰۳:۳۵ صبح
RE: sitemap plugin - توسط M48D1 - ۱۳۹۰/۷/۱، ۰۱:۴۲:۳۷ صبح
RE: sitemap plugin - توسط siavash-cena - ۱۳۹۰/۷/۱، ۰۱:۴۴:۴۶ صبح
RE: sitemap plugin - توسط M48D1 - ۱۳۹۰/۷/۱، ۰۱:۴۸:۳۳ صبح
RE: sitemap plugin - توسط siavash-cena - ۱۳۹۰/۷/۱، ۰۱:۵۳:۳۵ صبح
RE: sitemap plugin - توسط M48D1 - ۱۳۹۰/۷/۱، ۰۲:۰۲:۱۸ صبح
RE: sitemap plugin - توسط Farhoodi - ۱۳۹۰/۷/۱، ۰۲:۱۲:۴۱ صبح
RE: sitemap plugin - توسط siavash-cena - ۱۳۹۰/۷/۱، ۱۱:۲۹:۲۹ صبح
RE: sitemap plugin - توسط Farhoodi - ۱۳۹۰/۷/۱، ۱۳:۰۱:۴۴ عصر
RE: sitemap plugin - توسط siavash-cena - ۱۳۹۰/۷/۱، ۱۴:۱۲:۰۶ عصر
RE: sitemap plugin - توسط Cancer9003 - ۱۳۹۰/۷/۲، ۱۳:۲۶:۳۰ عصر

پرش به انجمن:


کاربرانِ درحال بازدید از این موضوع: 1 مهمان