Thread: SitemapXML v.2

Page 127 of 222 FirstFirst ... 2777117125126127128129137177 ... LastLast
Results 1,261 to 1,270 of 2213
  1. #1261
    Join Date
    Aug 2012
    Posts
    23
    Plugin Contributions
    0

    bug Re: CEON URI Mapping Ezpage sitemap fix

    Hi Guys,


    As a_berezin would not entertain a bug hunt I started one myself and have fixed the problem.

    The problem being that if you use ceon uri mappings they were not generated in the sitemap that this module creates.

    To correct this you need to edit the following file:

    /includes/modules/pages/sitemapxml/sitemapxml_ezpages.php

    Delete all of the code and replace with:

    PHP Code:
    <?php
    /**
     * Sitemap XML
     *
     * @package Sitemap XML
     * @copyright Copyright 2005-2012 Andrew Berezin eCommerce-Service.com
     * @copyright Copyright 2003-2012 Zen Cart Development Team
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: sitemapxml_ezpages.php, v 3.2.2 07.05.2012 19:12 AndrewBerezin $
     */

    echo '<h3>' TEXT_HEAD_EZPAGES '</h3>';
    $select '';
    $from '';
    $where '';
    $order_by '';
    if (
    SITEMAPXML_EZPAGES_ORDERBY != '') {
      
    $order_by SITEMAPXML_EZPAGES_ORDERBY;
    }

    if (
    $sitemapXML->dbColumnExist(TABLE_EZPAGES'status_meta_robots')) {
      
    $where .= " AND status_meta_robots=1";
    } elseif (
    $sitemapXML->dbColumnExist(TABLE_EZPAGES'status_rel_nofollow')) {
      
    $where .= " AND status_rel_nofollow!=1";
    }


    if (
    $sitemapXML->dbTableExist('TABLE_EZPAGES_TEXT')) {
      
    $from .= " LEFT JOIN " TABLE_EZPAGES_TEXT " pt ON (p.pages_id = pt.pages_id)";
      if (
    $sitemapXML->dbColumnExist(TABLE_EZPAGES_TEXT'language_id')) {
        
    $where .= " AND pt.language_id IN (" $sitemapXML->getLanguagesIDs() . ") ";
      } elseif (
    $sitemapXML->dbColumnExist(TABLE_EZPAGES_TEXT'languages_id')) {
        
    $select .= ", pt.languages_id as language_id";
        
    $where .= " AND pt.languages_id IN (" $sitemapXML->getLanguagesIDs() . ") ";
      }
    }
    if (
    $sitemapXML->dbColumnExist(TABLE_EZPAGES'date_added') && $sitemapXML->dbColumnExist(TABLE_EZPAGES'last_modified')) {
        
    $select .= ", GREATEST(IFNULL(p.date_added, '0001-01-01 00:00:00'), IFNULL(p.last_modified, '0001-01-01 00:00:00')) AS last_date";
      if (
    $order_by != '') {
        
    $order_by .= ", ";
      }
      
    $order_by .= "last_date DESC";
      
    $last_date_sql "SELECT MAX(GREATEST(IFNULL(p.date_added, '0001-01-01 00:00:00'), IFNULL(p.last_modified, '0001-01-01 00:00:00'))) AS last_date
                                 FROM " 
    TABLE_EZPAGES " p " $from "
                                 WHERE alt_url_external = ''" 
    $where;
      
    $last_date $db->Execute($last_date_sql);
      
    $table_status $db->Execute("SHOW TABLE STATUS LIKE '" TABLE_EZPAGES "'");
      
    $last_date max($table_status->fields['Update_time'], $last_date->fields['last_date']);
      if (
    $last_date <= '0001-01-01 00:00:00') {
        
    $last_date 0;
      }
    } else {
      
    $last_date 0;
    }
    if (
    $sitemapXML->SitemapOpen('ezpages'$last_date)) {
      
    $page_query_sql "SELECT p.toc_chapter
                         FROM " 
    TABLE_EZPAGES " p " $from "
                         WHERE alt_url_external = ''
                           AND (   (status_header = 1 AND header_sort_order > 0)
                                OR (status_sidebox = 1 AND sidebox_sort_order > 0)
                                OR (status_footer = 1 AND footer_sort_order > 0)
                                )
                           AND status_toc != 0" 
    $where "
                         GROUP BY toc_chapter"
    ;
      
    $page_query $db->Execute($page_query_sql); // pages_id
      
    $toc_chapter_array = array();
      while (!
    $page_query->EOF) {
        
    $toc_chapter_array[$page_query->fields['toc_chapter']] = $page_query->fields['toc_chapter'];
        
    $page_query->MoveNext();
      }
      if (
    sizeof($toc_chapter_array) > 0) {
        
    $where_toc " OR toc_chapter IN (" implode(','$toc_chapter_array) . ")";
      } else {
        
    $where_toc '';
      }
      
    $page_query_sql "SELECT *" $select "
                         FROM " 
    TABLE_EZPAGES " p " $from "
                         WHERE alt_url_external = ''
                           AND (   (status_header = 1 AND header_sort_order > 0)
                                OR (status_sidebox = 1 AND sidebox_sort_order > 0)
                                OR (status_footer = 1 AND footer_sort_order > 0)
                                " 
    $where_toc "
                                )" 
    $where .
                         (
    $order_by != '' " ORDER BY " $order_by '');
      
    $page_query $db->Execute($page_query_sql); // pages_id
      
    $sitemapXML->SitemapSetMaxItems($page_query->RecordCount());
      while (!
    $page_query->EOF) {
        if (
    $page_query->fields['alt_url'] != '') { // internal link
          
    $link = (substr($page_query->fields['alt_url'],0,4) == 'http') ?
                  
    $page_query->fields['alt_url'] :
                  
    zen_href_link($page_query->fields['alt_url'], '', ($page_query->fields['page_is_ssl']=='0' 'NONSSL' 'SSL'), falsetruetrue);
          
    $link str_replace('&amp;''&'$link);
          
    $link preg_replace('/&&+/''&'$link);
          
    $link preg_replace('/&/''&amp;'$link);
          
    $linkParm '';
          
    $parse_url parse_url($link);
          if (!isset(
    $parse_url['path'])) $parse_url['path'] = '/';
          
    $link_base_url $parse_url['scheme'] . '://' $parse_url['host'];
          if (
    $link_base_url != HTTP_SERVER && $link_base_url != HTTPS_SERVER) {
            echo 
    sprintf(TEXT_ERRROR_EZPAGES_OUTOFBASE$page_query->fields['alt_url'], $link) . '<br />';
            
    $link false;
          } else {
            if (
    basename($parse_url['path']) == 'index.php') {
              
    $query_string explode('&amp;'$parse_url['query']);
              foreach(
    $query_string as $query) {
                list(
    $parm_name$parm_value) = explode('='$query);
                if (
    $parm_name == 'main_page') {
                  if (
    defined('ROBOTS_PAGES_TO_SKIP') && in_array($parm_valueexplode(','constant('ROBOTS_PAGES_TO_SKIP'))) || $parm_value == 'down_for_maintenance') {
                    echo 
    sprintf(TEXT_ERRROR_EZPAGES_ROBOTS$page_query->fields['alt_url'], $link) . '<br />';
                    
    $link false;
                    break;
                  }
                }
              }
            }
          }
        } else { 
    // use EZPage ID to create link
          
    $link zen_href_link(FILENAME_EZPAGES'id=' $page_query->fields['pages_id'] . ($page_query->fields['toc_chapter'] > '&chapter=' $page_query->fields['toc_chapter'] : ''), ($page_query->fields['page_is_ssl']=='0' 'NONSSL' 'SSL'));
          
    $linkParm 'id=' $page_query->fields['pages_id'] . ((int)$page_query->fields['toc_chapter'] > '&chapter=' $page_query->fields['toc_chapter'] : '');
        }
        if (
    $link != false) {
          if (isset(
    $page_query->fields['last_date']) && $page_query->fields['last_date'] != null) {
            if (
    zen_not_null($page_query->fields['last_date']) && $page_query->fields['last_date'] > '0001-01-01 00:00:00') {
              
    $last_date $page_query->fields['last_date'];
            } else {
              
    $last_date '';
            }
          } else {
            
    $last_date '';
          }
          
    $page_query->fields['language_id'] = (isset($page_query->fields['language_id']) ? $page_query->fields['language_id'] : 0);
          
    $sitemapXML->writeItem($link$linkParm$page_query->fields['language_id'], $last_dateSITEMAPXML_EZPAGES_CHANGEFREQ);
        }


        
    $page_query->MoveNext();
      }
      
    $sitemapXML->SitemapClose();
    }
    unset(
    $page_query);

    // EOF
    Now when you force a rebuild of your site maps it will use the ceon uri mappings for your ezpages rather than the standard zen cart query string.

    Here is the small section of code that has been changed - just for reference:

    Original: (line 115)

    PHP Code:
    $link FILENAME_EZPAGES
    Changed to:

    PHP Code:
    $link zen_href_link(FILENAME_EZPAGES'id=' $page_query->fields['pages_id'] . ($page_query->fields['toc_chapter'] > '&chapter=' $page_query->fields['toc_chapter'] : ''), ($page_query->fields['page_is_ssl']=='0' 'NONSSL' 'SSL')); 

    Hope this helps someone
    We Fix Information Technology - we're making I.T. simple!
    www.wefixitonline.co.uk

  2. #1262
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: SitemapXML v.2

    Quote Originally Posted by DH010010 View Post
    I have a small problem with url's that are generated in the sitemap for ezpages. I use ceon uri mapping this replaces the query sting to something more memorable/ pleasing. These cleansed links are displayed in the categories and products sitemaps but not in the ezpage one. Any idea how to rectify this?

    Here is the sitemap index file for reference.

    Thanks in advance for any help :o)


    Edit: We are using zencart 1.5.1 and the latest sitemapxml release
    Quote Originally Posted by a_berezin View Post
    Hi,

    I fully agree with Conor:

    I have already said that I do not use and do not intend to use the module CEON URI Mapping, so I can't quickly check. On a more serious research I have neither the time, nor the desire.

    If the error is manifest in a different situation, of course, I will search for bug and fix it.

    By the way, it is likely that in the latest version 3.2.9 this bug has already does not manifest itself, because in the latest version were corrected a number of errors. If you want to try, I can send you a link to the download.
    Since the question about EZ Pages URLs not using the URIs created when folks have installed the Ceon URI Mappings module and this module has been asked about frequently on the Ceon URI support thread going back at least a year, I thought that it was about time that someone cross posted the author's response here..

    Andrew I posted the references from Conor in this support thread not because I thought you would address the issue.. (I kinda suspected that you would respond as you did) I wanted to provide folks a HINT on where the issue lie in case someone with the skillset and the inclination to do so could address the issue and so that folks who use BOTH modules knew that the answer lay somewhere in the XML Sitemap code.

    It appears that my HINT helped and DH010010 not only found a solution he shared it with the community.. AND he was kind enough to cross post the solution on the CEON URI thread as well.. Whether you decide to (or have already done so) incorporate those changes (or similar changes) into the add-on is fully up to you. I'm just happy that NOW there is a posted solution for those affected by the issue.
    Last edited by DivaVocals; 6 Apr 2013 at 03:46 PM.
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  3. #1263
    Join Date
    Aug 2004
    Location
    Saint Petersburg, Russia
    Posts
    1,786
    Plugin Contributions
    13

    Default Re: SitemapXML v.2

    Quote Originally Posted by 'Mike' View Post
    Is it required in the root dir for search engines to function ? Can we place it in the sitemap folder and get the seo desired results ?
    I want to clarify - Sitemap file location.

  4. #1264
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: SitemapXML v.2

    1) Is there a way to eliminate the generation of sitemap/sitemapezpages.xml and sitemap/sitemapreviews.xml ? As some people do not want them to get them submitted!

    2) Which .xml file would you use, if you are submitting your site's xml, to other search engines through other means other that zen-cart?

    3) Can sitemap/sitemapcategories.xml and or sitemap/sitemapproducts.xml be submitted individually and not together?
    Using Zen Cart 1.5.1

  5. #1265
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: SitemapXML v.2

    Is there a way to limit the number of products being indexed?

    Is there a limit to the number of products a search engines accept? Before they kick you.
    Using Zen Cart 1.5.1

  6. #1266
    Join Date
    Aug 2004
    Location
    Saint Petersburg, Russia
    Posts
    1,786
    Plugin Contributions
    13

    Default Re: SitemapXML v.2

    Quote Originally Posted by Kevin205 View Post
    1) Is there a way to eliminate the generation of sitemap/sitemapezpages.xml and sitemap/sitemapreviews.xml ? As some people do not want them to get them submitted!

    2) Which .xml file would you use, if you are submitting your site's xml, to other search engines through other means other that zen-cart?

    3) Can sitemap/sitemapcategories.xml and or sitemap/sitemapproducts.xml be submitted individually and not together?
    1. Remove the appropriate modules
    2. Did not understand the question
    3. Yes

  7. #1267
    Join Date
    Aug 2004
    Location
    Saint Petersburg, Russia
    Posts
    1,786
    Plugin Contributions
    13

    Default Re: SitemapXML v.2

    Quote Originally Posted by Kevin205 View Post
    Is there a way to limit the number of products being indexed?
    No, of course
    Quote Originally Posted by Kevin205 View Post
    Is there a limit to the number of products a search engines accept? Before they kick you.
    No, of course

  8. #1268
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: SitemapXML v.2

    Quote Originally Posted by a_berezin View Post
    1. Remove the appropriate modules
    2. Did not understand the question
    3. Yes
    Thank you for your reply.

    1. Remove the appropriate modules
    Where can these modules be found?

    2. Did not understand the question
    Some sites allow you to submit your web site to more than just Google, Bing and ask. You would have show the path to your site's xml, in order for them to submit your site.

    For example: The direct path that shows the .xml for all your products (http : // www DOT YourDomain DOT com/Directory?/File?.xml)
    I hope it makes sense?

    3. Yes
    How can they individually be submitted?

    I would appreciate your help. Thank you.
    Using Zen Cart 1.5.1

  9. #1269
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: SitemapXML v.2

    Sorry for the re-post, did not meet the 7 minute time allowance.

    Looking for the direct path that shows the .xml for all your products.

    Is the this the path: http:// MyDomain.com/Store/sitemap.xml?

    it shows:
    http: //MyDomain.com/sitemap/sitemapcategories.xml 2013-04-15
    http: //MyDomain.com/sitemap/sitemapezpages.xml 2013-04-15
    http: //MyDomain.com/sitemap/sitemapmainpage.xml 2013-04-15
    http: //MyDomain.com/sitemap/sitemapmanufacturers.xml 2013-04-15
    http: //MyDomain.com/sitemap/sitemapproducts.xml 2013-04-15

    And I do not want to show sitemapcategories.xml and sitemapezpages.xml

    I hope it makes sense?
    Last edited by Kevin205; 15 Apr 2013 at 03:36 PM.
    Using Zen Cart 1.5.1

  10. #1270
    Join Date
    Aug 2004
    Location
    Saint Petersburg, Russia
    Posts
    1,786
    Plugin Contributions
    13

    Default Re: SitemapXML v.2

    Quote Originally Posted by Kevin205 View Post
    Thank you for your reply.

    1. Remove the appropriate modules
    Where can these modules be found?

    2. Did not understand the question
    Some sites allow you to submit your web site to more than just Google, Bing and ask. You would have show the path to your site's xml, in order for them to submit your site.

    For example: The direct path that shows the .xml for all your products (http : // www DOT YourDomain DOT com/Directory?/File?.xml)
    I hope it makes sense?

    3. Yes
    How can they individually be submitted?

    I would appreciate your help. Thank you.
    1. includes/modules/pages/sitemapxml/

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR