Important: This page is using cookies (cookies). Using this website without turning off cookies in browser, means that you agree for using it.
Buy Now! Features Downloads

Earn with us!

If you would like to start earning money with vBET join to Affiliate Program.
Page 1 of 8 123 ... LastLast
Results 1 to 10 of 73

Thread: Sitemap Generator integration

  1. #1
    Michał Podbielski (vBET Staff) vBET's Avatar
    Join Date
    Oct 2009
    Posts
    3,037

    Default Sitemap Generator integration

    You can simply integrate vBET with vBSEO Sitemap Generator (it is free) to include links to translated pages and cms into generated sitemap.

    If you have had your files already edited , please upload original version

    Please note that instructions below will allow you to add into your sitemap links for threads translated pages. Because of performance reason those links will not be translated - there will be only added language code. Google will find real page anyway since you will get 301 redirect. Please note that it is not best approach - Google prefers to have final links in sitemap not redirecting one, but forcing translation of thousands links in all languages in the same time could kill your server or be threated by Google as attack (if links are not cached yet).

    At first you have to find your vbseo_sitemap_functions_vbseo.php file in
    forum root -> vbseo_sitemap -> vbseo_sitemap_functions_vbseo.php
    Open and edit it with any text-editing program
    On the very begining find this line:
    PHP Code:
    global $vbulletin$vbseo_vars$vbseo_stat$vboptions$db$forumcache$bbuserinfo
    And put after it, this:
    PHP Code:
    require_once(DIR'/includes/vbenterprisetranslator_functions_vbseo.php');     $alanguages = array ('af','sq','ar','be','bg','ca','zh-CN','hr','cs','da','nl','pl','et','tl','fi','fr','gl','de','el''en','iw','hi','hu','is','id','ga','it','ja','ko','lv','lt','mk','ms','mt','no','fa','pt','ro','ru','sr','sk','sl','es','sw','sv','zh-TW','th','tr','uk','vi','cy','yi'); 

    NOTE: REMOVE YOUR DEFAULT LANGUAGE CODE from $alanguages
    Also if you disabled some languages in option panel you have to delete its codes too.

    And find this line:
    PHP Code:
    vbseo_log_entry("[showthread] forum_id: $forumid, thread_id: $threadrow[threadid], total posts: $totalposts, pages: $totalpages, views: $threadrow[views] $prior"); 
    for integrating translated threads
    and if you're using SEO links i.e.
    /en/title
    put after it:
    PHP Code:
    if(!$archived) {    $strlenhost strlen($vbseo_vars['bburl']."/");    
    $currenturl vbseo_url_thread($threadrow1$archived);   
    $currenturl_before substr($currenturl,0,$strlenhost);   
    $currenturl_after "/".substr($currenturl,$strlenhost);   
    $lastpost =& $threadrow['lastpost'];   
    global 
    $alanguages;  
    foreach(
    $alanguages as $language) {      
    vbseo_add_url($currenturl_before.$language.$currenturl_after$prior$lastpost$freq);    }  } 
    or in case you are NOT using SEO links i.e.
    address?language=en
    :
    PHP Code:
    if(!$archived) {
      global 
    $alanguages;
      
    $currentthreadurl vbseo_url_thread($threadrow1$archived) . '&language=';
      
    $vbseo_stat['t'] += sizeof($alanguages);
      
    $lastpost =& $threadrow['lastpost'];
      foreach(
    $alanguages as $language) {
        
    vbseo_add_url($currentthreadurl.$language$prior$lastpost$freq);
      } 

    Do not use both of them!



    ****This part of solution is only for vBulletin Publishing Suite users****

    Then, you have to find these two lines

    PHP Code:
                   $prior vbseo_sm_priority($vboptions['vbseo_sm_priority_cmssec'], $relp2); 
    PHP Code:
                   $prior vbseo_sm_priority($vboptions['vbseo_sm_priority_cmsent'], $relp2); 

    and if you're using SEO links i.e.
    /en/title
    put after both of them:
    PHP Code:
    global $alanguages;
    $strlenhost strlen($vbseo_vars['bburl']."/");  
    $currenturl vbseo_url_cms($drow);
    $currenturl_before substr($currenturl,0,$strlenhost); 
    $currenturl_after "/".substr($currenturl,$strlenhost); 
    foreach(
    $alanguages as $language) {            $added_urls += vbseo_add_url($currenturl_before.$language.$currenturl_after$prior$drow['lastupdated'], $vboptions['vbseo_sm_freq_cms']); } 
    or in case you are NOT using SEO links i.e.
    address?language=en
    place after each of them:
    PHP Code:
    global $alanguages;
    $strlenhost strlen($vbseo_vars['bburl']."/");  
    $currentthreadurl vbseo_url_cms($drow) . '?language=';
    foreach(
    $alanguages as $language) { 
               
    $added_urls += vbseo_add_url($currentthreadurl.$language$prior$drow['lastupdated'], $vboptions['vbseo_sm_freq_cms']); } 
    Do not use both of them(with and without seo link)!


    End editing and enjoy it!
    Good luck!
    Last edited by r.dziadusz; 23-09-11 at 15:56.

  2. #2

    Default

    Text automatically translated from: German to: English
    Translated text
    The last step with:
    PHP Code:
    $vbseo_stat[$archived?'at':'t'] += vbseo_add_2urls
    I do not quite understand.

    The original file remains vbseo_sitemap.php?
    Because here: http://www.vbenterprisetranslator.co...k-anymore.html should I change it?
    Original text

  3. #3

    Default

    Sitemap Integration doesn´t work for me.

    It stopps creating the sitemap after a certain amount of time

  4. #4

    Default

    I´m always getting an Internal Server Error if I try to include a language to vbseositemap.

    I just tried it with one language more

    Originally German is included and I tried to include English as well, but didn´t worked. Getting the Internal Server Error while creating a new sitemap.

    With German as the only language it works well.

  5. #5
    Michał Podbielski (vBET Staff) vBET's Avatar
    Join Date
    Oct 2009
    Posts
    3,037

    Default

    Quote Originally Posted by Kolbi View Post
    Text automatically translated from: German to: English
    Translated text
    The last step with:
    PHP Code:
    $vbseo_stat[$archived?'at':'t'] += vbseo_add_2urls
    I do not quite understand.

    The original file remains vbseo_sitemap.php?
    Because here: http://www.vbenterprisetranslator.co...k-anymore.html should I change it?
    Original text
    This is not last step this is optional thing. It tells you how to modify code to have included also other thread pages not only first one. Please note that if you have lot of posts in some thread then it is paged. Please let us know which part you do not understand - we will modify the description


    The only file you need to change is vbseo_sitemap_functions.php - all the rest are unchanged. The link you pointing about is unofficial solution for bug fix, which was given before integration was made. Please follow only instructions here

  6. #6
    Michał Podbielski (vBET Staff) vBET's Avatar
    Join Date
    Oct 2009
    Posts
    3,037

    Default

    Quote Originally Posted by Kolbi View Post
    Sitemap Integration doesn´t work for me.

    It stopps creating the sitemap after a certain amount of time
    What is the error message? Probably it takes you longer that your mysql connection exists. In this case you have to modify your mysql settings to support it longer. If something else - please give us some details

  7. #7
    Michał Podbielski (vBET Staff) vBET's Avatar
    Join Date
    Oct 2009
    Posts
    3,037

    Default

    Quote Originally Posted by Kolbi View Post
    I´m always getting an Internal Server Error if I try to include a language to vbseositemap.

    I just tried it with one language more

    Originally German is included and I tried to include English as well, but didn´t worked. Getting the Internal Server Error while creating a new sitemap.

    With German as the only language it works well.
    Please include me changed part of file - with some original code around. I will check does it is OK Also - what error message is included in your logs? Internal error doesn't say lot...

  8. #8

    Default

    Text automatically translated from: German to: English
    Translated text
    PHP Code:
    if($vboptions['vbseo_sm_freq_tsmart'])
                       {
                           
    $dpassed = (time() - $threadrow['lastpost'])/86400;
                           if(
    $dpassed<3)$freq 'daily';
                           else if(
    $dpassed<10)$freq 'weekly';
                           else if(
    $dpassed<100)$freq 'monthly';
                           else 
    $freq 'yearly';
                       }else
                        
    $freq $vboptions['vbseo_sm_freq_t'];
                             
                    
    vbseo_log_entry("[showthread] forum_id: $forumid, thread_id: $threadrow[threadid], total posts: $totalposts, pages: $totalpages, views: $threadrow[views] $prior");
    //additional code 
    $alanguages = array ('en'); 
    if(!
    $archived) { 
      
    $strlenhost strlen($vbseo_vars['bburl']."/"); 
      
    $currentthreadurl vbseo_url_thread($threadrow1$archived); 
      foreach(
    $alanguages as $language) { 
        
    $vbseo_stat['t']++;  
        
    $enchancedthreadurl substr($currentthreadurl,0,$strlenhost). $language."/".substr($currentthreadurl,$strlenhost); 
        
    vbseo_add_url($enchancedthreadurl$prior$threadrow['lastpost'], $freq); 
      } 
    }   
    //end additional code  
                    
    for($p=1$p<=$totalpages$p++)
                    {
                    
    $vbseo_stat[$archived?'at':'t'] += vbseo_add_2urls(
                        
    vbseo_url_thread($threadrow$p$archived),
                        
    vbseo_url_thread($threadrow$p$archivedtrue),
                        
    $prior,
                        
    $threadrow['lastpost'],
                        
    $freq
                    
    );
                    
                    } 
    That the changed part

    I also included this
    PHP Code:
    <?php 
    require_once(DIR'/includes/vbenterprisetranslator_functions_vbseo.php');
    </ B>
    Original text

  9. #9
    Michał Podbielski (vBET Staff) vBET's Avatar
    Join Date
    Oct 2009
    Posts
    3,037

    Default

    Which version of sitemap generator are you using?

  10. #10

    Default

    Text automatically translated from: German to: English
    Translated text
    I'm using the latest version. It is version 2.6 beta 1
    Original text

Page 1 of 8 123 ... LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •