[Archive] mx Sitemaps 0.0.1

Support for the phpBB2 SEO mods released in the phpBB2 SEO Toolikt forum.

Moderator: Moderators

Postby dcz » Mon May 08, 2006 10:32 pm

hedgehog wrote:Hi DCZ,

I was wondering if there is anyway to select specific forums for the "Last 10 Active Topics" ?


Actually could be a cool feature to add for an update.

I have to think about a better way to do this but for now you can just do this :

Open :

Code: Select all
includes/Sitemaps_Functions.php


Find :

Code: Select all
      $sql_auth = '(' . $sql_auth . ')';



After Add :

Code: Select all
         $sql_auth = ( strstr($sql_auth, ' ID') ) ? str_replace( ' ID', '', $sql_auth ) : $sql_auth;ID, ') ) ? str_replace( 'ID, ', '', $sql_auth ) : $sql_auth;


In which you have to change ID to the id of the specific forum you don't want to list. Be careful with spaces, they are important here. Two tests are needed cause the ID could be the last one of the list. I'll implement a
something to do this better in next version ;)

You can as well repeat those two lines of code for any other forum that need to be viewable and readable but you don't want to see listed in the site maps.

hedgehog wrote:Also, after I added a few pics to the Sitemap Index, it broke the level of "Last 10 Active Topics" and "Sitemap Index"

Is this because the size of the image?

Thank you :)


Then you can either configure the site map to show more than ten topics in the site map index so that the list is longer.
And it's cool to do this here cause it's the most linked site map (thanks to the auto link add on) and it's one of the lightest, so adding a bit more topic listing here is a good occasion to show more links without consuming to much server resources.

But you can as well edit the template.

Open :

Code: Select all
templates/subSilver/SitemapsIndex_body.tpl


Find :

Code: Select all
  <tr align="center">
   <td align="center" class="row1" colspan="3" width="100%">
   <table cellpadding="0" cellspacing="1" border="0" width="100%" align="center" class="bodyline">


Replace with :

Code: Select all
   <tr align="center">
   <td align="center" class="row1" colspan="3" width="100%" valign="top">
   <table cellpadding="0" cellspacing="1" border="0" width="100%" align="center" class="bodyline">


I think I will also implement this small one in next version.

++
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: 21376
Joined: Fri Apr 28, 2006 9:03 pm

Advertisement

Postby hedgehog » Mon May 08, 2006 11:08 pm

Open :

Code:
includes/Sitemaps_Functions.php


Find :

Code:
$sql_auth = '(' . $sql_auth . ')';



After Add :

Code:
$sql_auth = ( strstr($sql_auth, ' ID') ) ? str_replace( ' ID', '', $sql_auth ) : $sql_auth;ID, ') ) ? str_replace( 'ID, ', '', $sql_auth ) : $sql_auth;


In which you have to change ID to the id of the specific forum you don't want to list. Be careful with spaces, they are important here. Two tests are needed cause the ID could be the last one of the list. I'll implement a
something to do this better in next version Wink

You can as well repeat those two lines of code for any other forum that need to be viewable and readable but you don't want to see listed in the site maps.


Thanks DCZ,


Code: Select all
Code:
         $sql_auth = ( strstr($sql_auth, ' ID') ) ? str_replace( ' ID', '', $sql_auth ) : $sql_auth;ID, ') ) ? str_replace( 'ID, ', '', $sql_auth ) : $sql_auth;


Sounds great :)

I have part of my forum where the category could be voided out of the "last ten topics" would to be hard to do or should I just void out each forum?
hedgehog
 
Posts: 15
Joined: Sat Apr 29, 2006 10:12 pm

Postby dcz » Mon May 08, 2006 11:29 pm

Auth are based on forum, but will see if I could find a trick for entire cats ;)
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: 21376
Joined: Fri Apr 28, 2006 9:03 pm

Postby dcz » Sun May 21, 2006 10:27 am

I have found a small mistake in ForumIndex.php, making it impossible to output the last active topic listing in the forum index map. Was tricked by the 2.20 update and by the fact I do not want to double process anything in my codes ;) (here was the auth)

Solution is simple:

Open :


Code: Select all
includes/ForumIndex.php


FInd :

Code: Select all
   $display_categories = array();


After add :

Code: Select all
   $sql_auth = '';


Find :

Code: Select all
         $display_categories[$forum_data[$i]['cat_id']] = true;


After add :
Code: Select all
         $sql_auth .= ($sql_auth == '' ? '' : ', ' ) . $forum_data[$i]['forum_id'];


Find :
Code: Select all
   $Sitemaps->last_topics($Sitemaps->sitemaps_TopForum, $Indexopt, $auth_view_forum_sql);


Replace with :
Code: Select all
   $Sitemaps->last_topics($Sitemaps->sitemaps_TopForum, $Indexopt, $sql_auth);


And you are done. The last active topic list will now show up when you set it in ACP on the forum index map.
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: 21376
Joined: Fri Apr 28, 2006 9:03 pm

Postby AmirAbbas » Fri Jun 02, 2006 6:25 am

excuse me
whats this error message

Code: Select all
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/pishro/public_html/forum/includes/ForumsSitemaps.php on line 154

Warning: Cannot modify header information - headers already sent by (output started at /home/pishro/public_html/forum/includes/ForumsSitemaps.php:154) in /home/pishro/public_html/forum/includes/page_header.php on line 614

Warning: Cannot modify header information - headers already sent by (output started at /home/pishro/public_html/forum/includes/ForumsSitemaps.php:154) in /home/pishro/public_html/forum/includes/page_header.php on line 616

Warning: Cannot modify header information - headers already sent by (output started at /home/pishro/public_html/forum/includes/ForumsSitemaps.php:154) in /home/pishro/public_html/forum/includes/page_header.php on line 617


see this address

http://forum.pishrosoft.com/forum-map8.html
User avatar
AmirAbbas
phpBB SEO Team
phpBB SEO Team
 
Posts: 534
Joined: Thu May 11, 2006 3:30 pm
Location: IRAN

Postby AmirAbbas » Fri Jun 02, 2006 6:30 am

I think if you don't have any post in a forum
you will recieve this error message
User avatar
AmirAbbas
phpBB SEO Team
phpBB SEO Team
 
Posts: 534
Joined: Thu May 11, 2006 3:30 pm
Location: IRAN

Postby PhotonLight » Fri Jun 02, 2006 8:33 am

I have been having trouble with the db_install.php part and have been getting error messages indicating it was unable to create the phpbb_sitemaps_index table. Apparently the [] brackets in some of the field names are causing the problem. Running the same sql command within phpMyAdmin to create the table gave an error message indicating a syntax error. By removing all of the fields with [] in the field names from the sql statement, I was finally able to get the table created and now the sitemap mod works great. Since it doesn't seem that others have run into this problem, I assume it has something to do with my sql installation (MySQL - 4.1.18) but it might be worth looking into just to insure compatibility. The forum is on a shared server so I don't have any control over the MySQL configuration. Fortunately I don't need any of the languages with the []. :D
PhotonLight
 
Posts: 5
Joined: Fri Jun 02, 2006 8:19 am
Location: Eugene, OR, USA

Postby dcz » Fri Jun 02, 2006 9:38 am

amir abbas wrote:I think if you don't have any post in a forum
you will receive this error message


So this is happening because of some server settings (error reporting) to be higher on your server than on mines. Anyway, no error should not occur, and you are right this happens when forums are empty.

You could just add an "@" at the beginning of array_merge(), like this @array_merge(), but this is a good occasion to get rid of this useless piece of code.

So the fix that will be implemented in next version is this one :

Code: Select all
#
#-----[ OPEN ]------------------------------------------
#
includes/ForumsSitemaps.php
#
#-----[ FIND ]------------------------------------------
#
while( $row = $db->sql_fetchrow($result) )
{
   $topic_rowset2[] = $row;
   $total_topics++;
}
#
#-----[ REPLACE WITH]------------------------------------------
#
while( $row = $db->sql_fetchrow($result) )
{
   $topic_rowset[] = $row;
   $total_topics++;
}
#
#-----[ FIND ]------------------------------------------
#
$topic_rowset = array_merge($topic_rowset, $topic_rowset2);
#
#-----[ REPLACE WITH]------------------------------------------
# MEANING DELETE THIS LINE

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM



PhotonLight wrote:I have been having trouble with the db_install.php part and have been getting error messages indicating it was unable to create the phpbb_sitemaps_index table. Apparently the [] brackets in some of the field names are causing the problem. Running the same sql command within phpMyAdmin to create the table gave an error message indicating a syntax error. By removing all of the fields with [] in the field names from the sql statement, I was finally able to get the table created and now the sitemap mod works great. Since it doesn't seem that others have run into this problem, I assume it has something to do with my sql installation (MySQL - 4.1.18) but it might be worth looking into just to insure compatibility. The forum is on a shared server so I don't have any control over the MySQL configuration. Fortunately I don't need any of the languages with the []. :D


Sorry I cannot find any "[" nor "]" in the files or in the db, could you be more precise.
This installer is tested ok up to mysql 4.1.9, so ... I need to understand more here.

By the way welcome ;)
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: 21376
Joined: Fri Apr 28, 2006 9:03 pm

Postby PhotonLight » Tue Jun 06, 2006 12:02 am

Here's the portion of the output I get when running db_install.php showing the error message. I have highlighted the language names with "[]" that seem to be causing the problem.


[Error or Already added] line: 22 , CREATE TABLE phpbb_sitemaps_index ( sm_id mediumint(8) NOT NULL auto_increment, sm_cat mediumint(8) NOT NULL default '0', sm_order mediumint(8) NOT NULL default '0', sm_auth smallint(1) NOT NULL default '0', sm_title varchar(100) NOT NULL default '', sm_url varchar(100) NOT NULL default '', sm_img varchar(100) NOT NULL default '',sm_title_albanian varchar(100) NOT NULL default '', sm_title_arabic varchar(100) NOT NULL default '', sm_title_asturian varchar(100) NOT NULL default '', sm_title_azerbaijani varchar(100) NOT NULL default '', sm_title_bosnian varchar(100) NOT NULL default '', sm_title_bulgarian varchar(100) NOT NULL default '', sm_title_catalan varchar(100) NOT NULL default '', sm_title_chinese [ traditional - taiwan ] varchar(100) NOT NULL default '', sm_title_chinese [ simplified ] varchar(100) NOT NULL default '', sm_title_chinese [ traditional ] varchar(100) NOT NULL default '', sm_title_croatian varchar(100) NOT NULL default '', sm_title_czech varchar(100) NOT NULL default '', sm_title_dutch varchar(100) NOT NULL default '', sm_title_english varchar(100) NOT NULL default '', sm_title_estonian varchar(100) NOT NULL default '', sm_title_french varchar(100) NOT NULL default '', sm_title_galego varchar(100) NOT NULL default '', sm_title_german varchar(100) NOT NULL default '', sm_title_german [ sie ] varchar(100) NOT NULL default '', sm_title_greek varchar(100) NOT NULL default '', sm_title_hebrew varchar(100) NOT NULL default '', sm_title_hungarian varchar(100) NOT NULL default '', sm_title_icelandic varchar(100) NOT NULL default '', sm_title_indonesian varchar(100) NOT NULL default '', sm_title_italian varchar(100) NOT NULL default '', sm_title_japanese varchar(100) NOT NULL default '', sm_title_korean varchar(100) NOT NULL default '', sm_title_kurdish varchar(100) NOT NULL default '', sm_title_lithuanian varchar(100) NOT NULL default '', sm_title_macedonian varchar(100) NOT NULL default '', sm_title_mongolian varchar(100) NOT NULL default '', sm_title_norwegian varchar(100) NOT NULL default '', sm_title_polish varchar(100) NOT NULL default '', sm_title_portuguese varchar(100) NOT NULL default '', sm_title_portuguese [ brazil ] varchar(100) NOT NULL default '', sm_title_romanian varchar(100) NOT NULL default '', sm_title_romanian [ no - diacritics ] varchar(100) NOT NULL default '', sm_title_russian varchar(100) NOT NULL default '', sm_title_russian [ tu ] varchar(100) NOT NULL default '', sm_title_serbian varchar(100) NOT NULL default '', sm_title_serbian [ cyrillic ] varchar(100) NOT NULL default '', sm_title_slovak varchar(100) NOT NULL default '', sm_title_spanish varchar(100) NOT NULL default '', sm_title_spanish [ argentina ] varchar(100) NOT NULL default '', sm_title_thai varchar(100) NOT NULL default '', sm_title_turkish varchar(100) NOT NULL default '', sm_title_uighur varchar(100) NOT NULL default '', sm_title_ukrainian varchar(100) NOT NULL default '', sm_title_welsh varchar(100) NOT NULL default '', PRIMARY KEY (sm_id) )

If you get some Errors, Already Added or Updated messages, relax, this is normal when updating modules


When I enter this same sql statement directly into MyPhpAdmin, it gives a more detailed error message:

MySQL said:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[ traditional - taiwan ] varchar(100) NOT NULL default '', sm_title_chinese [ si' at line 1


I was only able to create the table after removing all of the language names with brackets from the statement.

Since this issue obviously hasn't come up before, I suspect it has something to do with the mysql configuration of my host(www.bluehost.com) not liking the brackets.
PhotonLight
 
Posts: 5
Joined: Fri Jun 02, 2006 8:19 am
Location: Eugene, OR, USA

Postby dcz » Tue Jun 06, 2006 12:42 am

All right I see,
It seems you are using language folders with "[" and "]" in their name for some reason, like lang_[something]/, correct ?.

Anyway, S2B's code should be more strict here, before creating db tables, so here is a fix that should do it :

Open :

Code: Select all
includes/Sitemaps_Common_Admin.php


Find :


Code: Select all
         $name = trim(str_replace('lang_', '', $file));
         $displayname = preg_replace("/^(.*?)_(.*)$/", "\\1 [ \\2 ]", $name);
         $displayname = preg_replace("/\[(.*?)_(.*)\]/", "[ \\1 - \\2 ]", $displayname);


After add :

Code: Select all
         $displayname = ereg_replace('[^a-zA-Z0-9]', '', $displayname);


And no more brackets nor anything besides "a-zA-Z0-9", regular characters and numbers in the db table names.

This should help you with what seem to be a massively international board ;)
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: 21376
Joined: Fri Apr 28, 2006 9:03 pm

Postby PhotonLight » Tue Jun 06, 2006 2:36 am

hehe. Thanks. I'm really not sure why I would need all those languages since the only language the board is configured for is english. As I said, I was able to get the sitemap mod working just fine without them but wanted to report the error anyway in case it is an issue for anyone else. Thanks for a bunch of great mods!
PhotonLight
 
Posts: 5
Joined: Fri Jun 02, 2006 8:19 am
Location: Eugene, OR, USA

Postby PhotonLight » Tue Jun 06, 2006 4:50 am

Another question: Is it possible to remove the "index.php" from the links to the forum index? The rest of my forum has been modified to point directly to "http://forum.photonlight.com/" (by changing the U_INDEX variable in page_header.php) and I would like to keep the index.php out of the url in the sitemap section as well for simplicity and to avoid duplication issues with page rank.

Also, I did find a small error in the .htaccess lines for the sitemap url rewrite. Looks like the last two lines should read:

RewriteRule ^.+-fmp([0-9]+)-([0-9]+)\.html$ /sitemaps.php?fmp=$1&start=$2 [QSA,L]
RewriteRule ^.+-fmp([0-9]+)\.html$ /sitemaps.php?fmp=$1 [QSA,L]
PhotonLight
 
Posts: 5
Joined: Fri Jun 02, 2006 8:19 am
Location: Eugene, OR, USA

Postby dcz » Tue Jun 06, 2006 9:07 am

PhotonLight wrote:
Also, I did find a small error in the .htaccess lines for the sitemap url rewrite. Looks like the last two lines should read:

Code: Select all
RewriteRule ^.+-fmp([0-9]+)-([0-9]+)\.html$ /sitemaps.php?fmp=$1&start=$2 [QSA,L]
RewriteRule ^.+-fmp([0-9]+)\.html$ /sitemaps.php?fmp=$1 [QSA,L]


You are talking about the phpBB SEO advanced & Mixed mod Rewrite, from the auto link trick ?

What is the problem, you had to get rid of :

Code: Select all
RewriteRule ^.+-sc([0-9]+)\.html$ /sitemaps.php?c=$1 [QSA,L]


This stands for Categories in the configurable sitemaps index.


PhotonLight wrote:Another question: Is it possible to remove the "index.php" from the links to the forum index? The rest of my forum has been modified to point directly to "http://forum.photonlight.com/" (by changing the U_INDEX variable in page_header.php) and I would like to keep the index.php out of the url in the sitemap section as well for simplicity and to avoid duplication issues with page rank.


You must be talking about one of the phpBB mod Rewrite here, this should be posted as a new thread, and the answer should be yes, no reason, but you may need to add a DirectoryIndex in the .htaccess to make sure index.ph is loaded ;)
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: 21376
Joined: Fri Apr 28, 2006 9:03 pm

Postby AmirAbbas » Thu Jun 22, 2006 9:42 am

i tried to make a new category in sitemap index but i get this error message

Code: Select all
Could not create sitemap entry

DEBUG MODE

SQL Error : 1054 Unknown column 'sm_title_farsi' in 'field list'

INSERT INTO phpbb_sitemaps_index (sm_cat, sm_order, sm_auth, sm_title, sm_url, sm_img, sm_title_english, sm_title_farsi) VALUES( -1, 1, -1, 'موضوعات مهم', '', '' , 'موضوعات مهم', 'موضوعات مهم' )

Line : 121
File : admin_mx_sitemapIndex.php
User avatar
AmirAbbas
phpBB SEO Team
phpBB SEO Team
 
Posts: 534
Joined: Thu May 11, 2006 3:30 pm
Location: IRAN

Postby dcz » Thu Jun 22, 2006 11:30 am

This is strange, have you checked it the sm_title_farsi exists in the sitemaps_index table with phpMyAdmin ?

These fields are the additional languages fields, auto build during the install.
As well, there is the SQL line in the first post to add an extra language after you installed the mod.

Tell me more about it ;)
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: 21376
Joined: Fri Apr 28, 2006 9:03 pm

PreviousNext

Return to phpBB2 SEO MODS

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 7 guests