vBulletin 4, the most powerful community software + vBSEO 3.5, the ultimate SEO solution = Your ultimate platform for 2010 and beyond. Click below to learn more.

Results 1 to 2 of 2

Sitemap Function to Map vBPicGallery

This is a discussion on Sitemap Function to Map vBPicGallery within the Sitemap Features Archive forums, part of the vBulletin Links & Resources category; I'm posting the code I am using currently to write my vBPicGallery URLs to vBSEO Sitemaps. This function was coded ...

  1. #1
    Member
    Join Date
    Nov 2005
    Posts
    84

    Sitemap Function to Map vBPicGallery

    I'm posting the code I am using currently to write my vBPicGallery URLs to vBSEO Sitemaps. This function was coded a long time ago, I can't even remember when. The file version of the sitemaps I am using is for 3.x.x, I have no idea which one.

    I had customized the vBSEO sitemaps hack to put my sitemaps in the ROOT folder of my sites so I didn't have to use the rewrite rule. I was back then appling any updates to the vBSEO sitemaps hack by hand to stay current. At some point I stopped updating however, so I have no idea how old this code is. No, my root folder was not writable to do this.

    Anyway, I'm installing vBSEO now and rather then have something different, I'm installing vBSEO sitemaps by the book. That however caused me to think of two necessities.

    First, of course I want my vBPicGallery pages in the sitemaps. But...

    Second, I'd like to have my vBPicGallery URLs rewritten.

    So, I'd like to work with someone on getting rules and options in vBSEO for vBPicGallery. So, I'm posting the code I currently use for getting vBPicGallery URLs in the vBSEO sitemaps.

    Of course it's old, but it works, however I dunno if it will fit in the current version of sitemaps. I have not read the code yet, I figured a cooperative effort would better serve everyone. As I always say, there's more then one way to skin a cat, so this posted code is a suggestion and reference point to get the ball rolling. My goal is to get this plan implemented before I install vBSEO so I can do it all as a package deal.

    Thanks for everyones help and consideration.

    Function added to vbseo_sitemap_functions.php
    PHP Code:
    // vBPicGallery Hack
           
    function vbseo_sitemap_vbpicgallery($do_pics true)
           {
               global 
    $db$vboptions;

               
    vbseo_log_entry("[SECTION START] vBPicGallery"true);

               
    $added_urls 0;
              
            
    // Halls/Members
            
    $getmembers $db->query("
                  SELECT DISTINCT userid,lastactivity
                  FROM " 
    TABLE_PREFIX "vbpicgallery_users
              "
    );
              
              while (
    $member $db->fetch_array($getmembers))
              {
                  
    vbseo_log_entry("[vBPicGallery] userid: $member[userid]");
              
                  
    $added_urls++;
                  
    vbseo_add_url(
                      
    $vboptions['bburl'].'/vbpicgallery.php?do=hall&u='.$member[userid],
                       
    $vboptions['vbseo_sm_priority_m'],
                      
    $member[lastactivity],
                    
    $vboptions['vbseo_sm_freq_m']
                  );
              }
              
    $db->free_result($getmembers);
              
            
    // Galleries
            
    $getmembers $db->query("
                  SELECT vbpicgalleryid,lastactivity
                  FROM " 
    TABLE_PREFIX "vbpicgallery_users
              "
    );
              
              while (
    $member $db->fetch_array($getmembers))
              {
                  
    vbseo_log_entry("[vBPicGallery] galleryid: $member[vbpicgalleryid]");
              
                  
    $added_urls++;
                  
    vbseo_add_url(
                      
    $vboptions['bburl'].'/vbpicgallery.php?do=view&g='.$member[vbpicgalleryid],
                       
    $vboptions['vbseo_sm_priority_m'],
                      
    $member[lastactivity],
                    
    $vboptions['vbseo_sm_freq_m']
                  );
              }
              
    $db->free_result($getmembers);        

            
    // Pictures
            
    if( $do_pics )
            {
                
    $getmembers $db->query("
                      SELECT vbpicgalleryid,u_date
                      FROM " 
    TABLE_PREFIX "vbpicgallery_images
                  "
    );
              
                  while (
    $member $db->fetch_array($getmembers))
                  {
                      
    vbseo_log_entry("[vBPicGallery] pictureid: $member[vbpicgalleryid]");
              
                      
    $added_urls++;
                      
    vbseo_add_url(
                          
    $vboptions['bburl'].'/vbpicgallery.php?do=big&p='.$member[vbpicgalleryid],
                           
    $vboptions['vbseo_sm_priority_m'],
                          
    $member[u_date],
                        
    $vboptions['vbseo_sm_freq_m']
                      );
                  }
                  
    $db->free_result($getmembers);                
            }
            return 
    $added_urls;
           }
    // vBPicGallery Hack 
    This is how I called it from within vbseo_sitemap.php just before vbseo_flush_index();
    PHP Code:
    if( isset($vbulletin->options['vbpgenable']) )
    {
        
    $vbseo_stat['vBPicGallery'] = vbseo_sitemap_vbpicgallery($vbulletin->options['vbpgpopups']);

    Check out vBPicGallery the Photo Gallery for vBulletin.
    Talk about motorcycles with bikers around the world.
    Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook!

  2. #2
    Member
    Join Date
    Nov 2005
    Posts
    84
    Thanks to BamaStangGuy and Keith Cohen, I see where I need to go and get this done as a simple add on option for vBPicGallery.

    Appreciate the help guys!
    Last edited by noppid; 11-03-2006 at 01:37 AM.
    Check out vBPicGallery the Photo Gallery for vBulletin.
    Talk about motorcycles with bikers around the world.
    Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook!

Similar Threads

  1. Forum Site Map vs General Sitemap
    By Lonny in forum General Discussion
    Replies: 3
    Last Post: 04-19-2006, 12:00 PM
  2. Memory Problem:
    By TraumTeam in forum Troubleshooting
    Replies: 1
    Last Post: 04-06-2006, 08:24 AM
  3. Site map doesnt respond when clicking Run Sitemap Generator
    By NICEGUY77 in forum Troubleshooting
    Replies: 3
    Last Post: 03-23-2006, 07:43 PM
  4. Replies: 0
    Last Post: 12-17-2005, 01:11 PM