Not working with custom forum URLs from mixed rewrite mod

The GYM Sitemaps & RSS module for phpBB. Sitemaps and RSS feeds for Google Yahoo! and MSN Live, support, add ons etc ...

Moderator: Moderators

Not working with custom forum URLs from mixed rewrite mod

Postby Bibliophile » Mon Mar 02, 2009 9:59 pm

I have the mixed rewrite mod installed and working, but when I install the sitemaps mod, the sitemaps do not use the custom forum URLs that specified in the rewrite mod. I am also using virtual folders. For example, I have one forum set up to rewrite as phpbb/someforum-f1/. This implements correctly for all the links on my board, but it does not implement correctly in the sitemap. In the sitemap, the forum location is rewritten as phpbb/test-forum-11/ (it's forum name is "test forum"). So it looks like the sitemaps mod is not using the custom rewrites from the seo mod.

I have URL Rewriting activated in the sitemaps mod (on main configuration, with override activated). And I have updated my .htaccess file with the most recent auto-generated version from the rewrite mod.

What else do I need to do to get the custom forum urls working on the sitemap?
Bibliophile
 
Posts: 12
Joined: Mon Mar 02, 2009 4:35 pm

Advertisement

Re: Not working with custom forum URLs from mixed rewrite mod

Postby Bibliophile » Wed Mar 04, 2009 4:18 am

I've gone through a complete reinstall of the forum and still can't get this to work. The sitemap still does not show the custom forum URLs or the virtual folder structure. Could someone take a look?

http://www.sawyerbrook.com/salon/sitemapindex.xml

Thanks.

(UPDATE: Actually, it looks now like the virtual folder structure is working, but it is still not using the custom urls. It is simply defaulting to the /name-of-the-forum/ behavior rather than /my-specified-custom-name/ )
Bibliophile
 
Posts: 12
Joined: Mon Mar 02, 2009 4:35 pm

Re: Not working with custom forum URLs from mixed rewrite mod

Postby SeO » Sat Mar 07, 2009 10:33 am

It's not normal. Are both GYM and the mod rewrite of the last version released ?
Try to overwrite all files in gym_sitemaps/ with the latest one, and then hit the gym update script (cannot hurt).
And make sure that your phpbb_seo_class.php file is actually up to date (since you need to manually update it in most cases).

It may be a bug, but I need to make sure we're talking about the same code.
SeO
Admin
Admin
 
Posts: 6334
Joined: Wed Mar 15, 2006 9:41 pm

Re: Not working with custom forum URLs from mixed rewrite mod

Postby Bibliophile » Sat Mar 07, 2009 5:17 pm

Thank you for the reply -- I've been in much need of help with this.

I am using:
- phpbb 3.04
- phpbb-SEO Mixed Mod Rewrite 0.4.8
- phpbb-SEO GYM Sitemaps RSS 2.0.RC3
(All of these installs were first-time, not upgrade patches. I imported my old phpbb 2.23 dbase and installed the phpbb mods for the first time.)

I have just tried your suggestions:
- grabbed a fresh version of phpbb_seo_class.php, made my setting changes from scratch and copied over current file.
- copied over the gym_sitemaps directory with a fresh copy from the installation zip. Ran the gym update script.
- then I cleared my phpbb cache, and I cleared the gymrss cache through the ACP.
- then, for good measure, I updated my .htaccess with the latest from the mixed mod rewrite panel

Unfortunately, I'm still having the problem. It still doesn't use my custom forum urls in the sitemaps (or rss).

Please let me know what other info you need from me to help troubleshoot this -- thanks again!!
Bibliophile
 
Posts: 12
Joined: Mon Mar 02, 2009 4:35 pm

Re: Not working with custom forum URLs from mixed rewrite mod

Postby SeO » Sat Mar 07, 2009 6:33 pm

On thing you could try would be to take the latest code from the svn :http://code.google.com/p/phpbb-seo/source/checkout
To see if it's already fixed, my main matter on the concern being that some pretty big commits will soon occur meaning that we are already working on some different code. What is for sure is that this issue will be locked at in the new code to make sure it gets fixed in next version (will most likely be another RC).

Until then, do not submit your sitemaps, you can keep feeds as long as url are redirected properly, which should at least be the case for topics.

If the svn is not a solution for you, please report and I'll see if I can come up with a quick temporary fix.
SeO
Admin
Admin
 
Posts: 6334
Joined: Wed Mar 15, 2006 9:41 pm

Re: Not working with custom forum URLs from mixed rewrite mod

Postby Bibliophile » Sun Mar 08, 2009 3:19 pm

Thanks SeO. I looked at the SVN, and I think this solution is a little above my knowledge/skill level -- I'm not quite sure which files to grab, update, edit, etc. Maybe it's best if I wait for the next RC.

I will hold off on submitting the sitemap for now. The links in the RSS feeds do redirect correctly for the topics, and I can set up some additional redirects to handle the forum links (which currently return errors).

If you have any additional suggestions on how to handle this for now, I would be very glad to hear them. Also, if there anything I should do to make sure that this bug is properly reported to the folks developing the next RC?

Thanks again.
Bibliophile
 
Posts: 12
Joined: Mon Mar 02, 2009 4:35 pm

Re: Not working with custom forum URLs from mixed rewrite mod

Postby dcz » Sun Mar 08, 2009 7:22 pm

Open gym_sitemaps/includes/google_forum.php, find :
Code: Select all
            $forum_data['forum_url'] = $phpbb_seo->seo_path['phpbb_urlR'] . (!empty($this->url_config['forum_pre']) ? $this->url_config['forum_pre'] . $forum_id . $this->url_config['forum_ext'] : $phpbb_seo->set_url($forum_data['forum_name'], $forum_id, $phpbb_seo->seo_static['forum']) . $this->url_config['forum_ext']);

replace with :
Code: Select all
            $forum_data['forum_url'] = $phpbb_seo->seo_path['phpbb_urlR'] . $phpbb_seo->set_url($forum_data['forum_name'], $forum_id, $phpbb_seo->seo_static['forum']) . $this->url_config['forum_ext'];

find :
$forum_url = $phpbb_seo->seo_path['phpbb_urlR'] . ( !empty($this->url_config['forum_pre'] ) ? $this->url_config['forum_pre'] . $forum_id : $phpbb_seo->set_url($forum_data['forum_name'], $forum_id, $phpbb_seo->seo_static['forum']) );
replace with :
Code: Select all
               $forum_url = $phpbb_seo->seo_path['phpbb_urlR'] . $phpbb_seo->set_url($forum_data['forum_name'], $forum_id, $phpbb_seo->seo_static['forum']);


Should be a working temporary fix.

We will fix this in next release ;)

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21411
Joined: Fri Apr 28, 2006 9:03 pm

Re: Not working with custom forum URLs from mixed rewrite mod

Postby Bibliophile » Sun Mar 08, 2009 11:27 pm

Thanks dcz. I have implemented your fix, but I don't see any change unfortunately. One issue: my google_forums.php file is in the gym_sitemaps/modules/ directory, not the gym_sitemaps/includes/ directory. I made the changes to the file in the modules directory, uploaded the new file, and cleared my caches. But my sitemaps still don't use the custom urls. Is there anything else I need to do to get the fix to take?

Thanks for working on this with me. Glad to hear the fix will be part of the next release.
Bibliophile
 
Posts: 12
Joined: Mon Mar 02, 2009 4:35 pm

Re: Not working with custom forum URLs from mixed rewrite mod

Postby SeO » Mon Mar 09, 2009 11:55 am

mm the fix should have changed something, is forum url caching activated in the phpbb seo class settings ?
SeO
Admin
Admin
 
Posts: 6334
Joined: Wed Mar 15, 2006 9:41 pm

Re: Not working with custom forum URLs from mixed rewrite mod

Postby Bibliophile » Mon Mar 09, 2009 1:58 pm

Yes, forum URL caching is activated in the phpbb SEO class settings. It do not have caching activated on the gym sitemaps settings (cache tab) -- should it be activated there?
Bibliophile
 
Posts: 12
Joined: Mon Mar 02, 2009 4:35 pm

Re: Not working with custom forum URLs from mixed rewrite mod

Postby dcz » Tue Mar 10, 2009 9:43 am

Now this is strange. Could you post here the content of you phpbb_seo/cache/phpbb_cache.php ?
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21411
Joined: Fri Apr 28, 2006 9:03 pm

Re: Not working with custom forum URLs from mixed rewrite mod

Postby Bibliophile » Tue Mar 10, 2009 2:29 pm

Here are my phpbb_cache.php contents:

Code: Select all
<?php
/**
* phpBB_SEO Class
* www.phpBB-SEO.com
* @package Advanced phpBB3 SEO mod Rewrite
*/
if (!defined('IN_PHPBB')) {
   exit;
}
$this->cache_config['settings'] = array ( 'url_rewrite' => true, 'profile_inj' => false, 'profile_vfolder' => false, 'profile_noids' => false, 'rewrite_usermsg' => false, 'rem_sid' => true, 'rem_hilit' => true, 'rem_small_words' => false, 'virtual_folder' => true, 'virtual_root' => false, 'cache_layer' => true, 'rem_ids' => false, 'copyrights' => array ( 'img' => true, 'txt' => '', 'title' => '', ), );
$this->cache_config['forum'] = array ( 1 => 'your-vision-f1', 2 => 'runway-your-way-f2', 3 => 'sewing-buttons-f3', 4 => 'handbag-discussion-f4', 5 => 'information-desk-f5', 6 => 'moderator-talk-f6', 7 => 'fabric-care-f7', 8 => 'linings-support-f8', 9 => 'sew-alongs-f9', 10 => 'beginner-sewing-f10', 11 => 'sewing-how-to-f11', 12 => 'sewing-books-f12', 13 => 'sewing-projects-f13', 14 => 'project-runway-f14', 15 => 'ask-savvy-sewer-f15', 16 => 'video-sew-alongs-f16', 17 => 'concierge-f17', 18 => 'sewing-collaboration-f18', 19 => 'art-of-sewing-f19', 20 => 'capri-jacket-sew-along-f20', 21 => 'popular-jacket-sew-along-f21', 22 => 'sew-a-coat-f22', 23 => 'spring-shirt-sew-along-f23', 24 => 'pants-sew-along-f24', 25 => 'tee-shirt-sew-along-f25', 26 => 'fall-jacket-sew-along-f26', 27 => 'rayon-batik-sew-along-f27', 28 => 'sewing-lifestyle-f28', 29 => 'trench-coat-sew-along-f29', );
?>


Thanks for checking it out.
Bibliophile
 
Posts: 12
Joined: Mon Mar 02, 2009 4:35 pm

Re: Not working with custom forum URLs from mixed rewrite mod

Postby dcz » Tue Mar 10, 2009 2:44 pm

I don't see anything wrong in your cache file, it's really strange, because :
Code: Select all
$forum_url = $phpbb_seo->seo_path['phpbb_urlR'] . $phpbb_seo->set_url($forum_data['forum_name'], $forum_id, $phpbb_seo->seo_static['forum']);

should return the forum url stored in cache, and they all includes the -fxx bit.
Is the second code change online now (the result is here :http://www.sawyerbrook.com/salon/forum-sitemap.xml) ?
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21411
Joined: Fri Apr 28, 2006 9:03 pm

Re: Not working with custom forum URLs from mixed rewrite mod

Postby Bibliophile » Tue Mar 10, 2009 3:34 pm

Yep, I made the changes you mentioned in the earlier post. This is the gym_sitemaps/modules/google_forum.php file that is currently online:

Code: Select all
<?php
/**
*
* @package phpBB SEO GYM Sitemaps
* @version $id: google_forum.php - 18582 12-20-2008 14:40:10 - 2.0.RC3 dcz $
* @copyright (c) 2006 - 2008 www.phpbb-seo.com
* @license http://opensource.org/osi3.0/licenses/lgpl-license.php GNU Lesser General Public License
*
*/
// First basic security
if ( !defined('IN_PHPBB') ) {
   exit;
}
/**
* google_forum Class
* www.phpBB-SEO.com
* @package phpBB SEO
*/
class google_forum {
   var $url_config = array();
   var $actions = array();
   var $module_auth = array();
   var $module_config = array();
   var $output_data = array();
   /**
   * constuctor
   */
   function google_forum(&$gym_master) {
      $this->gym_master = &$gym_master;
      $this->actions = &$this->gym_master->actions;
      $this->module_auth = &$this->gym_master->module_auth;
      $this->output_data = &$this->gym_master->output_data;
      $this->url_config = &$this->gym_master->url_config;
      $this->module_config = array_merge(
         // Global
         $this->gym_master->google_config,
         // Other stuff required here
         array(
            'google_sticky_priority' => $this->gym_master->gym_config['google_forum_sticky_priority'],
            'google_announce_priority' => $this->gym_master->gym_config['google_forum_announce_priority'],
            'google_exclude' => trim($this->gym_master->gym_config['google_forum_exclude'], ','),
         )
      );
      // Build exclude_list array
      $this->module_config['exclude_list'] = $this->gym_master->set_exclude_list($this->module_config['google_exclude']);
      // Wee need to check auth here (Only public and postable forums for sitemaps)
      $this->gym_master->check_forum_auth(true);
      // Only consider publicly readable and postable forums
      $this->actions['auth_guest_read'] = $this->actions['auth_view_read'] = array_diff_assoc($this->module_auth['forum']['read_post'], $this->module_config['exclude_list']);
      $this->init_url_settings();
   }
   /**
   * Initialize mod rewrite to handle multiple URL standards.
   * Only one 'if' is required after this in THE loop to properly switch
   * between the four types (none, advanced, mixed and simple).
   * @access private
   */
   function init_url_settings() {
      global $phpbb_seo, $phpEx;
      // vars will fell like rain in the code ;)
      $this->url_config['forum_pre'] = "viewforum.$phpEx?f=";
      $this->url_config['topic_pre'] = "viewtopic.$phpEx?t=";
      $this->url_config['forum_ext'] = '';
      $this->url_config['topic_ext'] = '';
      $this->url_config['start_delim'] = $this->url_config['start_default'];
      $this->url_config['google_forum_pre'] = $this->url_config['google_default'] . '?forum=';
      $this->url_config['google_forum_default'] = $this->url_config['google_default'] . '?forum';
      $this->url_config['google_annouces_default'] = $this->url_config['google_forum_pre'] . 'announces';
      $this->url_config['google_forum_ext'] = '';
      // Mod rewrite type auto detection
      $this->url_config['modrtype'] = ($phpbb_seo->modrtype >= 0) ? intval($phpbb_seo->modrtype) : intval($this->gym_master->gym_config['gym_modrtype']);
      // make sure virtual_folder uses the proper value
      $phpbb_seo->seo_opt['virtual_folder'] = $this->url_config['modrtype'] > 0 ? $phpbb_seo->seo_opt['virtual_folder'] : false;
      $this->url_config['google_forum_delim'] = !empty($phpbb_seo->seo_delim['forum']) ? $phpbb_seo->seo_delim['forum'] : '-f';
      $this->url_config['google_forum_static'] = !empty($phpbb_seo->seo_static['forum']) ? $phpbb_seo->seo_static['forum'] : 'forum';
      $this->url_config['modrewrite'] = $this->module_config['google_modrewrite'];
      if ($this->url_config['modrewrite']) { // Module links
         $this->url_config['google_forum_pre'] = ($this->url_config['modrtype'] >= 2) ? '' : $this->url_config['google_forum_static'] . $this->url_config['google_forum_delim'];
         $this->url_config['google_forum_ext'] = '.xml' . $this->url_config['gzip_ext_out'];
         $this->url_config['google_forum_default'] = 'forum-sitemap' . $this->url_config['google_forum_ext'];
         $this->url_config['google_annouces_default'] = 'forum-announces' . $this->url_config['google_forum_ext'];
      }
      if (!@isset($phpbb_seo->seo_opt['url_rewrite'])) {
         $phpbb_seo->seo_opt['url_rewrite'] = $this->url_config['modrtype'] > 0 ? true : false;
      }
      if ($phpbb_seo->seo_opt['url_rewrite']) {
         $this->url_config['forum_index'] = !empty($phpbb_seo->seo_static['index']) ? $phpbb_seo->seo_static['index'] . $phpbb_seo->seo_ext['index'] : '';
         if ($this->url_config['modrtype'] >= 1) { // Simple mod rewrite, default is none (0)
            $this->url_config['start_delim'] = $phpbb_seo->seo_delim['start'];
            $this->url_config['forum_pre'] = $phpbb_seo->seo_static['forum'];
            $this->url_config['topic_pre'] = $phpbb_seo->seo_static['topic'];
            $this->url_config['forum_ext'] = $phpbb_seo->seo_ext['forum'];
            $this->url_config['topic_ext'] = $phpbb_seo->seo_ext['topic'];
         }
         if ($this->url_config['modrtype'] >= 2) { // +Mixed
            $this->url_config['forum_pre'] = '';
         }
         if ($this->url_config['modrtype'] >= 3) { // +Advanced
            $this->url_config['topic_pre'] = '';
         }
      } else {
         $this->url_config['forum_index'] = 'index.php';
         $phpbb_seo->seo_opt['virtual_folder'] = false;
      }
      return;
   }
   /**
   * sitemap, builds the sitemap
   * @access private
   */
   function sitemap() {
      global $config, $phpbb_seo, $db, $user, $auth;
      if ($this->actions['module_sub'] === 'announces') {
         // Start with forums info
         $forum_data = array();
         $forum_data['replies_key'] = 'topic_replies';
         $forum_data['forum_url'] = $phpbb_seo->seo_path['phpbb_urlR'] . ($phpbb_seo->seo_opt['virtual_folder'] ? $phpbb_seo->seo_static['global_announce'] . $phpbb_seo->seo_ext['global_announce'] : '' );
         // Do we want to list all the global announces from the forum
         // Count items
         $sql = "SELECT COUNT(topic_id) AS topic
            FROM " . TOPICS_TABLE . "
            WHERE forum_id = 0
            AND topic_type = " . POST_GLOBAL;
         $result = $db->sql_query($sql);
         $row = $db->sql_fetchrow($result);
         $db->sql_freeresult($result);
         if(empty($row['topic'])) {
            $this->gym_master->gym_error(404, 'GYM_TOO_FEW_ITEMS',  __FILE__, __LINE__);
            exit;
         } else {
            $forum_data['topic_count'] = (int) $row['topic'];
            unset($row);
         }
         // it's the announces sitemap
         $announces_sitemap_url = $this->module_config['google_url'] . $this->url_config['google_annouces_default'];
         $this->gym_master->seo_kill_dupes($announces_sitemap_url);
         // Forum index location
         $this->gym_master->parse_item($phpbb_seo->seo_path['phpbb_urlR'] . $this->url_config['forum_index'], 1, 'always', time());
         $forum_sql = ' forum_id = 0 AND topic_type = ' . POST_GLOBAL . ' AND ';
         $this->list_topics($forum_sql, $forum_data, '');
      } else {
         // Filter $this->actions['module_sub'] var type
         $this->actions['module_sub'] = intval($this->actions['module_sub']);
         if ($this->actions['module_sub'] > 0) {
            // then It's a forum sitemap
            // Check forum auth and grab necessary infos
            $sql = "SELECT *
               FROM ". FORUMS_TABLE ." f
               WHERE forum_id = " . $this->actions['module_sub'];
            $result = $db->sql_query($sql);
            $forum_data = $db->sql_fetchrow($result);
            $db->sql_freeresult($result);
            if ( empty($forum_data) ) {
               $this->gym_master->gym_error(404, '', __FILE__, __LINE__, $sql);
            }
            $forum_id = (int) $forum_data['forum_id'];
            if ( $forum_data['forum_type'] !=  FORUM_POST || !isset($this->actions['auth_view_read'][$forum_id]) ) {
               $this->gym_master->gym_error(401, '',  __FILE__, __LINE__);
            }
            // This forum is allowed, so let's start
            $forum_url_title = $phpbb_seo->format_url($forum_data['forum_name'], $phpbb_seo->seo_static['forum']);
            $forum_sitemap_url = $this->module_config['google_url'] . ( !empty($this->url_config['google_forum_pre']) ? $this->url_config['google_forum_pre'] . $forum_id . $this->url_config['google_forum_ext'] : $forum_url_title . $this->url_config['google_forum_delim'] .  $forum_id . $this->url_config['google_forum_ext']);
            // Approval and pagination
            $paginated = $config['posts_per_page'];
            $forum_data['topic_count'] = $forum_data['forum_topics'];
            $forum_data['replies_key'] = 'topic_replies';
            $approve_sql = ' AND topic_approved = 1';
            $forum_data['approve'] = 0;
            // Do not serve content if there is no topic in the forum
            if ( $forum_data['topic_count'] < $this->module_config['google_threshold'] ) {
               $this->gym_master->gym_error(404, 'GYM_TOO_FEW_ITEMS', __FILE__, __LINE__, $sql);
            }
            $this->gym_master->seo_kill_dupes($forum_sitemap_url);
            // SB Mod: seo mixed mod patch
                $forum_data['forum_url'] = $phpbb_seo->seo_path['phpbb_urlR'] . $phpbb_seo->set_url($forum_data['forum_name'], $forum_id, $phpbb_seo->seo_static['forum']) . $this->url_config['forum_ext'];
            $this->gym_master->parse_item($forum_data['forum_url'], 1.0, 'always', $forum_data['forum_last_post_time']);


            $forum_sql = ' forum_id = ' .  $forum_id . ' AND topic_type <> ' . POST_GLOBAL . ' AND ';
            $this->list_topics($forum_sql, $forum_data, $approve_sql);
         } else {
            // it's the forums sitemap
            $forum_sitemap_url = $this->module_config['google_url'] . $this->url_config['google_forum_default'];
            $this->gym_master->seo_kill_dupes($forum_sitemap_url);
            // Forum index location
            $this->gym_master->parse_item($phpbb_seo->seo_path['phpbb_urlR'] . $this->url_config['forum_index'], 1, 'always', time());
            $sql = "SELECT *
               FROM ". FORUMS_TABLE . " WHERE " . $db->sql_in_set('forum_id' , $this->actions['auth_view_read'], false, true) . "
               ORDER BY forum_last_post_id " . $this->module_config['google_sort'];
            $result = $db->sql_query($sql);
            // Forums loop
            while( $forum_data = $db->sql_fetchrow($result) ) {
               $forum_id = (int) $forum_data['forum_id'];
               // Make sure that the forum is auth
               if (!isset($this->actions['auth_view_read'][$forum_id])) {
                  continue;
               }
               $topics_count = $forum_data['forum_topics'];
               // Not enough topics in this forum, skip
               if ($topics_count < $this->module_config['google_threshold']) {
                  continue;
               }
               $paginated = $forum_data['forum_topics_per_page'] ? $forum_data['forum_topics_per_page'] : $config['topics_per_page'];
               $pages = ceil( ($topics_count + 1) / $paginated);
               // SB Mod: seo mixed mod patch
               $forum_url = $phpbb_seo->seo_path['phpbb_urlR'] . $phpbb_seo->set_url($forum_data['forum_name'], $forum_id, $phpbb_seo->seo_static['forum']);
               $forum_priority = $this->gym_master->get_priority($forum_data['forum_last_post_time'], $pages);
               $forum_change = $this->gym_master->get_changefreq($forum_data['forum_last_post_time']);
               $this->gym_master->parse_item( $forum_url . $this->url_config['forum_ext'], $forum_priority, $forum_change, $forum_data['forum_last_post_time']);
               if ($pages > 1 && $this->module_config['google_pagination']) {
                  // Reset Pages limits for this topic
                  $pag_limit1 = $this->module_config['google_limitdown'];
                  $pag_limit2 = $this->module_config['google_limitup'];   
                  // If $pag_limit2 too big for this topic, lets output all pages
                  $pag_limit2 = ( $pages < $pag_limit2 ) ?  ($pages - 1) :  $pag_limit2;
                  $i=1;
                  while ( ($i < $pages) ) {
                     if ( ( $i <= $pag_limit1 ) || ( $i > ($pages - $pag_limit2 ) ) ) {
                        $url = $forum_url . ( $phpbb_seo->seo_opt['virtual_folder'] ? '/' . $phpbb_seo->seo_static['pagination'] . $paginated * $i . $phpbb_seo->seo_ext['pagination'] : $this->url_config['start_delim'] . $paginated * $i . $this->url_config['forum_ext'] );
                        $this->gym_master->parse_item( $url, $forum_priority, $forum_change, $forum_data['forum_last_post_time']);
                        $i++;
                     } else {
                        $i++;
                     }
                  }
               }
            } // End Forum map loop
            $db->sql_freeresult($result);
            unset ($forum_data);
         }
      }
      return;
   }
   /**
   * sitemapindex, builds the sitemapindex
   * @access private
   */
   function sitemapindex() {
      global $phpbb_seo, $db, $config, $user, $auth;
      // It's global list call, add module sitemaps
      // Reset the local counting, since we are cycling through modules
      $this->output_data['url_sofar'] = 0;
      // Announces map location ?
      // Count items
      $sql = "SELECT COUNT(topic_id) AS topic
         FROM " . TOPICS_TABLE . "
         WHERE forum_id = 0
         AND topic_type = " . POST_GLOBAL;
      $result = $db->sql_query($sql);
      $row = $db->sql_fetchrow($result);
      $db->sql_freeresult($result);
      if (!empty($row['topic'])) {
         unset($row);
         $announces_sitemap_url = $this->module_config['google_url'] . $this->url_config['google_annouces_default'];
         $this->gym_master->parse_sitemap($announces_sitemap_url, $user->time_now - rand(1,150));
      }
      $sql = "SELECT *
         FROM ". FORUMS_TABLE . "
            WHERE " . $db->sql_in_set('forum_id', $this->actions['auth_view_read'], false, true) . "
         ORDER BY forum_last_post_id " . $this->module_config['google_sort'];
      $result = $db->sql_query($sql);
      // Reset vars
      $forum_sitemap_urls = '';
      $sitemap_data = array();
      $last_ever = 0;
      while( $forum_data = $db->sql_fetchrow($result) ) {
         $forum_id = (int) $forum_data['forum_id'];
         // Make sure that the forum is auth
         if (!isset($this->actions['auth_view_read'][$forum_id])) {
            continue;
         }
         $topics_count = $forum_data['forum_topics'];
         // Not enough topics in this forum, skip
         if ($topics_count < $this->module_config['google_threshold']) {
            continue;
         }
         // Set mod rewrite type
         $sitemap_data[$forum_id]['url'] = $this->module_config['google_url'] . ( !empty($this->url_config['google_forum_pre']) ? $this->url_config['google_forum_pre'] . $forum_id . $this->url_config['google_forum_ext'] : $phpbb_seo->format_url($forum_data['forum_name'], $phpbb_seo->seo_static['forum']) . $this->url_config['google_forum_delim'] .  $forum_id . $this->url_config['google_forum_ext']);
         $sitemap_data[$forum_id]['lastmod'] = $forum_data['forum_last_post_time'] > $config['board_startdate'] ? $forum_data['forum_last_post_time'] : $config['board_startdate'];
      }// End Forum map loop
      $db->sql_freeresult($result);
      unset ($forum_data);   
      if (!empty($sitemap_data)) {
         // only add the Forum map location if showing enough forums
         if (sizeof($sitemap_data) > $this->module_config['google_threshold']) {
            // Forum map location
            $forum_sitemap_url = $this->module_config['google_url'] . $this->url_config['google_forum_default'];
            $this->gym_master->parse_sitemap($forum_sitemap_url, $user->time_now);
         }
         foreach ($sitemap_data as $data) {
            $this->gym_master->parse_sitemap($data['url'], $data['lastmod']);
         }
         unset ($sitemap_data);
      }
      // Add the local counting, since we are cycling through modules
      $this->output_data['url_sofar_total'] = $this->output_data['url_sofar_total'] + $this->output_data['url_sofar'];
      return;
   }
   /**
   * list_topics($forum_sql, $forum_data, $approve_sql = '') builds the output for topic listing
   * From a forum and from all forums
   * @access private
   */
   function list_topics($forum_sql, $forum_data, $approve_sql = '') {
      global $db, $phpbb_seo, $auth, $config, $user;
      // initial setup
      $topic_sofar = 0;
      $topics = array();
      $sql_first = "SELECT topic_id, forum_id, topic_approved, topic_reported, topic_title, topic_type, topic_status, topic_replies, topic_replies_real, topic_last_post_id, topic_last_post_time
            FROM " . TOPICS_TABLE . "
            WHERE $forum_sql
               topic_status <> " . ITEM_MOVED . "
               $approve_sql
               ORDER BY topic_last_post_id " . $this->module_config['google_sort'];
      $paginated = $config['posts_per_page'];
      while( ( $topic_sofar <  $forum_data['topic_count'] ) && ($this->output_data['url_sofar'] < $this->module_config['google_url_limit']) ) {
         $result = $db->sql_query_limit($sql_first, $this->module_config['google_sql_limit'], $topic_sofar);
         while ($topic = $db->sql_fetchrow($result)) {
            $forum_id = (int) $topic['forum_id'];
            // Make sure that the forum is auth
            if (!isset($this->actions['auth_view_read'][$forum_id])) {
               continue;
            }
            if ( $topic['topic_reported'] == 1 ) { // Skip for now if reported, approved are checked above when required
               continue;
            }
            $pages = ceil( ($topic[$forum_data['replies_key']] + 1) / $paginated);
            $topic['topic_title'] = censor_text($topic['topic_title']);
            $topic_url = ( $phpbb_seo->seo_opt['virtual_folder'] ? $forum_data['forum_url'] : $phpbb_seo->seo_path['phpbb_urlR'] ) . ( !empty($this->url_config['topic_pre']) ? $this->url_config['topic_pre'] . $topic['topic_id'] : $phpbb_seo->format_url($topic['topic_title']) . $phpbb_seo->seo_delim['topic'] .  $topic['topic_id'] );
            if ($topic['topic_type'] == POST_NORMAL ) {
               $topic_priority = $this->gym_master->get_priority($topic['topic_last_post_time'], $pages);
            } else {
               $topic_priority = $topic['topic_type'] == POST_STICKY ? $this->module_config['google_sticky_priority'] : $this->module_config['google_announce_priority'];
            }
            $topic_change = ($topic['topic_status'] == ITEM_LOCKED) ? 'never' : $this->gym_master->get_changefreq($topic['topic_last_post_time']);
            $topic_time = gmdate('Y-m-d\TH:i:s'.'+00:00', $topic['topic_last_post_time']);
            $this->gym_master->parse_item($topic_url . $this->url_config['topic_ext'], $topic_priority, $topic_change, $topic['topic_last_post_time']);
            if ($pages > 1 && $this->module_config['google_pagination']) {
               // Reset Pages limits for this topic
               $pag_limit1 = $this->module_config['google_limitdown'];
               $pag_limit2 = $this->module_config['google_limitup'];   
               // If $pag_limit2 too big for this topic, lets output all pages
               $pag_limit2 = ( $pages < $pag_limit2 ) ?  ($pages - 1) :  $pag_limit2;
               $i=1;
               while ( ($i < $pages) ) {
                  if ( ( $i <= $pag_limit1 ) || ( $i > ($pages - $pag_limit2 ) ) ) {
                     $start = $this->url_config['start_delim'] . $paginated * $i;
                     $this->gym_master->parse_item($topic_url . $start . $this->url_config['topic_ext'], $topic_priority, $topic_change, $topic['topic_last_post_time']);
                     $i++;
                  } else {
                     $i++;
                  }
               }
            }
         }// End topic loop
         // Used to separate query
         $topic_sofar = $topic_sofar + $this->module_config['google_sql_limit'];
         $db->sql_freeresult($result);
         unset($topic);
      }// End Query limit loop
   }
}
?>


As I mentioned in the earlier post, I found this file in modules/ instead of includes/ but I made the changes you suggested. This is pretty strange given what you've said. Please let me know what further info it would help you to have...
Bibliophile
 
Posts: 12
Joined: Mon Mar 02, 2009 4:35 pm

Re: Not working with custom forum URLs from mixed rewrite mod

Postby Professional » Tue Mar 10, 2009 5:03 pm

strange thing one of my friend had installed mix with GYM and had same problem,but when he installed advanced instead of it,problem solved
انجمن تخصصی نسل جدید موبایل ها-Apple Portal
My Handwritings: Professional Dreams
Every Thing That U Feel,Is Every Thing That I Feel.
User avatar
Professional
PR5
PR5
 
Posts: 550
Joined: Mon Apr 07, 2008 5:41 am
Location: 1/2 of the World

Next

Return to GYM Sitemaps & RSS

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 5 guests