phpBB SEO
Boards
Directory  
SEO  
Downloads
  phpBB SEO : Search Engine Optimization, Directory, Forums  
Index
Forums
Annuaire
Référencement
Télécharger
 
  Search Rechercher
    Register
Username :  Password :  Log me on automatically each visit  
S'enregistrer  
 
   
How to add MKPortal into sitemap

 
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB SEO TooLKit  » GYM Sitemaps
::  
Author Message
RedFoxy



Joined: 03 Nov 2006
Posts: 12

How to add MKPortal into sitemapPosted: Thu Apr 19, 2007 3:21 pm    Post subject: How to add MKPortal into sitemap

Hi!
I use MKPortal (and Subdreamer CMS), how can I add a support for that mod to generate a sitemap.xml for cms and forum?
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 14131

How to add MKPortal into sitemapPosted: Thu Apr 19, 2007 4:08 pm    Post subject: Re: How to add MKPortal into sitemap

Well, it's not that hard to do if you know a bit of code.

The idea would be to start with google_forum.php and to rename it to google_mkportal.php and to inspire from its coding to perform the correct queries in it to list mkportal content whatever it is.
In the file, the action = 'forum' case, would be action ='mkportal', and mkportal could or not host values as well if needed, such as mkportal=28 or mkportal=some_text_var.

The mod would auto generate a sitemap.php?mkportal ( mkportal-sitemap.xml rewritten) sitemap, showing up in the sitemapindex by itself and working without any other changes.

Once the mod will turn stable, we really will start to write down plug-ins, but you can start if you like, the general standard won't change.

++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
RedFoxy



Joined: 03 Nov 2006
Posts: 12

How to add MKPortal into sitemapPosted: Thu Apr 19, 2007 4:17 pm    Post subject: Re: How to add MKPortal into sitemap

Thank's! I'll do it now!
If you want i'll send to you the code ^^
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 14131

How to add MKPortal into sitemapPosted: Thu Apr 19, 2007 4:41 pm    Post subject: Re: How to add MKPortal into sitemap

That would be a great addition to the GYM sitemap module Very Happy

So to go further in describing the api, the principle in google_forum.php is very simple in the end.

The module could use more options, as per the rss feeds, but I guess you should be able to handle all interesting cases with the one already provided.

The input file, sitemap.php, is grabbing vars in the following way :

it will check the gym sitemaps include folder and match all files name following this pattern google_*.php.

When it's matching google_forum.php, 'forum' becomes a possible GET var for the module.
So after the possible list of GET var was build, the module will check the $_GET array to see if any of these was sent, and if its the case, will treat it as a text string at first :

Code:
      $action = trim(htmlspecialchars(strtolower($key)));
      $list_id = (!empty($value)) ? trim(htmlspecialchars(strtolower($value))) : 0;


And pass it in the gym_sitemap class.

This means you can go for three type of case at this stage :

-sitemap.php?forum
-sitemap.php?forum=something
-sitemap.php

In google_forum.php, since we only need integer to list forum ids, we additionnaly do :
Code:

// Filter $this->actions['list_id'] var type
$this->actions['list_id'] = intval($this->actions['list_id']);


To narrow the possible value sent to the DB to something reasonable.

Once this is done, you've got the same three case repeated :

Code:
if ($this->actions['action'] === 'forum') {


We are asked for a sitemap, not a sitemapindex, now filter the possible forum= something cases

Code:
   if ($this->actions['list_id'] > 0) {

Here we would list the forum number $this->actions['list_id'] urls.

Or :
Code:
   } else {


We are in the case where forum is here as a GET var, but is empty, and we take this occasion here to output a nice list of all forums

And in the end :
Code:
} else { // it's a sitemap index call


When forum isn't even submitted, it means we need to output a sitemapindex listing, which in the forum sitemap example gives a list of all forum=xx sitemaps, plus the special sitemap.php?forum link.

Now remember we only want to list public content in these.

and once done, everything is working, cache, gzip handling, url rewriting and so on will be used.

So in the mkportal case, the idea is the same.

You can even imagine to use both mkportal=number and mkportal=text_string if you perform the required testing in google_mkportal.php.

The only tricky thing wll be mod rewrite, in case you are using some rul rewriting on mkportal and would like to list them rewritten.

It's pretty simple if you only want to deal with one type of url standard for mkportal, unlike the phpBB SEO mod that can be of three different kinds.

If you would only go for an on/off thing, between non rewritten and rewritten url of just one kind, you would just have to test if $this->mod_r_config['mod_rewrite'] is true, like for the forum sitemap links :

Code:
   $sitemap_forums_url = ($this->mod_r_config['mod_rewrite']) ? 'forum-sitemap.xml' . $this->ext_config['gzip_ext_out'] : 'sitemap.'.$phpEx.'?forum';


Fro the mkportal sitemapindex sitemap link it would be here :

Code:
   $sitemap_mkportal_url = ($this->mod_r_config['mod_rewrite']) ? 'mkportal-sitemap.xml' . $this->ext_config['gzip_ext_out'] : 'sitemap.'.$phpEx.'?mkportal';


And as said, these would be handled directly with gym sitemaps rewriterules.

Hope this helps ;

++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
RedFoxy



Joined: 03 Nov 2006
Posts: 12

How to add MKPortal into sitemapPosted: Fri Apr 20, 2007 8:06 am    Post subject: Re: How to add MKPortal into sitemap

i see a troubles with that sitemap for phpbb forum with ch, in the list forum of the sitemap index, i found some id that are of private forum (non listened to non registered user) like staff areas and private forum... I must add that id in the acp to remove it...

it's normal?
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 14131

How to add MKPortal into sitemapPosted: Fri Apr 20, 2007 8:35 am    Post subject: Re: How to add MKPortal into sitemap

Well, CH isn't supported yet.

The forum structure is pretty similar to phpBB's but, as it seems, not fully Wink

Besides, aren't the forum url in the end linked to index.php with CH ?

Isn't it the real issue here, unless you're using mod rewrite ?

About the authorisations, I though that CH was using the same auth_view and auth_read fields in the forum tables, but I need to check, together with other possible issue before we release a CH compatible version of GYM sitemaps.

++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
RedFoxy



Joined: 03 Nov 2006
Posts: 12

How to add MKPortal into sitemapPosted: Fri Apr 20, 2007 10:22 am    Post subject: Re: How to add MKPortal into sitemap

dcz wrote:
Well, CH isn't supported yet.
no? i'm using ch 2.1.4 and i read that it's supported

Quote:
The forum structure is pretty similar to phpBB's but, as it seems, not fully Wink
I know... i'm a phpbb and ch developer Razz

Quote:
Besides, aren't the forum url in the end linked to index.php with CH ?
yep!

Quote:
Isn't it the real issue here, unless you're using mod rewrite ?
no i'm not using rewrite, i want use it but not now... i've some troubles

Quote:
About the authorisations, I though that CH was using the same auth_view and auth_read fields in the forum tables, but I need to check, together with other possible issue before we release a CH compatible version of GYM sitemaps.

++
ch 2.1.6 it's a bit different (realy different) but aut_view and read are present... but... it's used in different way in the db...
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 14131

How to add MKPortal into sitemapPosted: Sat Apr 21, 2007 8:51 am    Post subject: Re: How to add MKPortal into sitemap

2.14 is supported by the phpBB SEO simple mod rewrite 0.0.2 so far, so no it isn't supported by GYM sitemaps, but should not be this much of a big deal to fix the output, especially if you know some coding.

About the forums urls, really easy, just take a look at the $this->mod_r_config array in ggs_functions.php, you'll find :

Code:
                  'forum_forum'=> "viewforum.$phpEx?" . POST_FORUM_URL . "=",


Just change it to
Code:
                  'forum_forum'=> "index.$phpEx?" . POST_FORUM_URL . "=",


if you haven't already.

Then, for the Google sitemaps, it's only a matter of dealing with auth properly, the SQL queries should work with CH, since empty forums (forum without post) are not outputted, CH categories won't show up with nothing inside as a sitemap.

In the google_forum.php file, you'll find :
Code:
// Build unauthed array
$this->set_exclude_list($this->ggsitemaps_config['ggs_exclude_forums']);
// Filter forums & build sql components
if (!empty($this->output_data['exclude_list'])) {
   $not_in_id_sql = " f.forum_id NOT IN (" . implode(",", $this->output_data['exclude_list']) . ") AND f.auth_view = " . AUTH_ALL . " AND f.auth_read = " . AUTH_ALL;
} else {
   $not_in_id_sql = "f.auth_view = " . AUTH_ALL . " AND f.auth_read = " . AUTH_ALL;
}


All you need here is basically to find the Google auth criteria for public forums. SQL queries are build using NOT IN ( forums_ids ).

In phpBB case, we do not need to calculate authorisation n such case, but take a look at what's done in rss.php to handle private feeds :

Code:
   // Full auth loockup
   $not_auth_ary = auth(AUTH_ALL, AUTH_LIST_ALL, $userdata);
   $auth_checked = TRUE;
   foreach ($not_auth_ary as $f_id => $f_auth) {
      // only keep unauthed ids
      if ( $not_auth_ary[$f_id]['auth_view'] && $not_auth_ary[$f_id]['auth_read']) {
         unset($not_auth_ary[$f_id]);
      } else {
         // Only keep forum id for unauhted
         $not_auth_ary[$f_id] = $f_id;
      }
   }


Must be pretty similar for CH in case there is no easy method to grab auth. We just want to populate an array with only the unauthed forum IDs in it (key = value to make it simpler).

In rss.php, you'll just have to mod the SQL a bit, when they use CATEGORIES_TABLE, but this is simple.

Tell me about the authorisation criteria, I'll be happy to help you out Wink

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB SEO TooLKit  » GYM Sitemaps
Page 1 of 1

Navigation Similar Topics

Jump to: