Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Problems With Site Map Contrib


fatmcgav

Recommended Posts

I just downloaded the latest version of SiteMap with Extra Pages-InfoBox CROSSOVER, to make it work with Extra pages-info box w/ admin.

However i now get an error when tryin to view the sitemap:

 

1054 - Unknown column 'pages_title' in 'field list'

 

select pages_id, pages_title, pages_html_text, sort_order, status from pages where status = 1 and sort_order >0 order by sort_order, pages_title

 

[TEP STOP]

 

The code in sitemap.php that this corresponds to is:

 
// Extra Pages ADDED BEGIN
$page_query = tep_db_query("select pages_id, pages_title, pages_html_text, sort_order, status from " . TABLE_PAGES . " where status = 1 and sort_order >0 order by sort_order, pages_title");
$rows = 0;

while ($page = tep_db_fetch_array($page_query)) {
 $rows++;

 if($page['pages_title'] != 'Contact Us'){
   $link = FILENAME_PAGES . '?pages_id=' . $page['pages_id'];
 }else{
   $link = FILENAME_CONTACT_US;
 }

 echo '<li><a href="' . tep_href_link($link) . '">' . $page['pages_title'] . '</a></li>';
}
// Extra Pages ADDED END

 

Any ideas on what might be causin this?

 

Cheers

Fatmcgav

Link to comment
Share on other sites

  • 1 month later...

Right, i've just got back round to tryin to sort this problem.

 

From the looks of it, the DB query is incorrect. The query it's using is this:

$page_query = tep_db_query("SELECT pages_id, pages_title, sort_order, status FROM " . TABLE_PAGES_DESCRIPTION . " WHERE status = 1 and sort_order >0 ORDER BY sort_order, pages_title");

The problem is, that the field 'sort_order' and 'status' are stored in a different table, TABLE_PAGES.

So how can i go about editing the SQL query so that it works???

 

Cheers

Fatmcgav

Link to comment
Share on other sites

  • 2 weeks later...

Hi

 

You would need to do something like this

 

[CODE]$page_query = tep_db_query("SELECT pd.pages_id, pd.pages_title, tb.sort_order, tb.status FROM " . TABLE_PAGES_DESCRIPTION . "pd, " .  TABLE_PAGES . "tb, " WHERE status = 1 and sort_order >0 ORDER BY sort_order, pages_title");

 

This may not be 100% correct but you can see what is going on

 

You need to tell/define the query what fields to query in each table.

 

Ie "tb.sort_order, pd.pages_title . TABLE_PAGES_DESCRIPTION . "pd, " . TABLE_PAGES . "tb, "

 

As you can see you are telling the query that sort_order is in TABLE_PAGES by putting in the "tb"

 

Hope that helps

 

Cheers

 

Mike

Edited by Mighty Mike
Link to comment
Share on other sites

Hi

 

You would need to do something like this

 

[CODE]$page_query = tep_db_query("SELECT pd.pages_id, pd.pages_title, tb.sort_order, tb.status FROM " . TABLE_PAGES_DESCRIPTION . "pd, " .  TABLE_PAGES . "tb, " WHERE status = 1 and sort_order >0 ORDER BY sort_order, pages_title");

 

This may not be 100% correct but you can see what is going on

 

You need to tell/define the query what fields to query in each table.

 

Ie "tb.sort_order, pd.pages_title . TABLE_PAGES_DESCRIPTION . "pd, " .  TABLE_PAGES . "tb, "

 

As you can see you are telling the query that sort_order is in TABLE_PAGES by putting in the "tb"

 

Hope that helps

 

Cheers

 

Mike

Yeh, i just managed to get it working by comparing it to the cat desc sql query, so the code now looks like this:

$page_query = tep_db_query("SELECT c.pages_id, c.pages_title, cd.sort_order, cd.status from " . TABLE_PAGES_DESCRIPTION . " c, " . TABLE_PAGES . " cd WHERE cd.status = 1 and cd.sort_order >0  and cd.page_type >0 ORDER BY sort_order, pages_title");

 

which solves the mysql error, and displays the pages, but not correctly.

 

It appears to be duplicating all the pages and all the names - so even though i've only got 6 pages in my db, it's showing 20 or so links, many of which link to the same page. If ure not sure what i mean, have a look here

 

Any ideas on how to solve this prob?

Once i get this fixed, i'll be sure to upload it for others to use, cus this has taken me ages to fix :)

 

Cheers

Fatmcgav

Link to comment
Share on other sites

It looks like it is just repeating your information pages, your products look ok, i also have the sitemap contrib installed but did not use the "Extra Pages-InfoBox CROSSOVER" bit as it is so easy to just manually put in and take out info pages you want.

 

sorry, not sure what to suggest as i dont have that part of the contrib.

Link to comment
Share on other sites

It looks like it is just repeating your information pages, your products look ok, i also have the sitemap contrib installed but did not use the "Extra Pages-InfoBox CROSSOVER" bit as it is so easy to just manually put in and take out info pages you want.

 

sorry, not sure what to suggest as i dont have that part of the contrib.

Yeh, i would usually do it that way, but this is for a client, so i want to elimiate any code editing on their part if they want to add new pages.

 

I'm pretty sure the problems still with the query, somewhere... not sure where yet though.

 

This is the code that i added to the page:

// Extra Pages ADDED BEGIN
$page_query = tep_db_query("SELECT c.pages_id, c.pages_title, cd.sort_order, cd.status from " . TABLE_PAGES_DESCRIPTION . " c, " . TABLE_PAGES . " cd WHERE cd.status = 1 and cd.sort_order >0  and cd.page_type >0 ORDER BY sort_order, pages_title");
$rows = 0;

while ($page = tep_db_fetch_array($page_query)) {
 $rows++;

 if($page['pages_title'] != 'Contact Us'){
 }else{
   $link = FILENAME_CONTACT_US;
 }

 echo '<li><a href="' . tep_href_link($link) . '">' . $page['pages_title'] . '</a></li>';
}
// Extra Pages ADDED END

Now it must be something in there thats causing the problem. Could it be someting to do with '$rows++;'???

 

Cheers anyways

Fatmcgav

Edited by fatmcgav
Link to comment
Share on other sites

  • 2 weeks later...
It looks like it is just repeating your information pages, your products look ok, i also have the sitemap contrib installed but did not use the "Extra Pages-InfoBox CROSSOVER" bit as it is so easy to just manually put in and take out info pages you want.

 

sorry, not sure what to suggest as i dont have that part of the contrib.

I've looking for this for ages! How do you add infoboxes to the sitemap?

 

Thanks in advance

Link to comment
Share on other sites

  • 1 month later...

Hi,

I'm so surprised that I found I have no TABLE_PAGES table in my mysql database.

I think there some contri use it, such as the site map.

I just want to know, if the table was added by some other contri or is default in the oscommerce?

I'm use the oscommerce MS2. And when I install this sitemap contri I realized this problem. what version of the oscommerce the sitemap fit for?

 

I'm so confused. Hope you guys can help me out here.

 

Thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...