fatmcgav Posted February 16, 2005 Share Posted February 16, 2005 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 Quote Link to comment Share on other sites More sharing options...
fatmcgav Posted March 22, 2005 Author Share Posted March 22, 2005 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 Quote Link to comment Share on other sites More sharing options...
fatmcgav Posted March 24, 2005 Author Share Posted March 24, 2005 Somebody must know how to sort this.......... Quote Link to comment Share on other sites More sharing options...
fatmcgav Posted April 4, 2005 Author Share Posted April 4, 2005 Somebody must know how to sort this.......... <{POST_SNAPBACK}> Anybody??? Quote Link to comment Share on other sites More sharing options...
Mighty Mike Posted April 4, 2005 Share Posted April 4, 2005 (edited) 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 April 4, 2005 by Mighty Mike Quote Link to comment Share on other sites More sharing options...
fatmcgav Posted April 4, 2005 Author Share Posted April 4, 2005 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 <{POST_SNAPBACK}> 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 Quote Link to comment Share on other sites More sharing options...
Mighty Mike Posted April 4, 2005 Share Posted April 4, 2005 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. Quote Link to comment Share on other sites More sharing options...
fatmcgav Posted April 4, 2005 Author Share Posted April 4, 2005 (edited) 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. <{POST_SNAPBACK}> 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 April 4, 2005 by fatmcgav Quote Link to comment Share on other sites More sharing options...
Guest Posted April 16, 2005 Share Posted April 16, 2005 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. <{POST_SNAPBACK}> I've looking for this for ages! How do you add infoboxes to the sitemap? Thanks in advance Quote Link to comment Share on other sites More sharing options...
NerioDavid Posted May 19, 2005 Share Posted May 19, 2005 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 Quote Link to comment Share on other sites More sharing options...
baluvee Posted May 19, 2005 Share Posted May 19, 2005 sitemap not visible if you log in any idea what is the problem? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.