Jump to content
Latest News: (loading..)
Jack_mcs

Dynamic SiteMap

Recommended Posts

I meant checking for the code that determines if the page should be secure, but as I went to bed I realized that bandwidth isn't used here.

 

I don't understand what you mean by "checking for the code." Bandwidth usage is determined by the size of the page and the sitemap page is small as page sizes go so if that is what you are concerned about, there's no need.

 

Jack

Share this post


Link to post
Share on other sites

Oh, I see. You didn't reference a previous post so I thought you were just asking in general.

 

Jack

Share this post


Link to post
Share on other sites

Jack,

here is what I have come up with to make the appropriate links SSL or not. In catalog/dynamic_sitemap.php: (I appologize in advance for the formatting,). This looks into each page only as far as the doctype tag and see if the breadcrumb link is SSL, if it reaches the doctype tag it exits and assumes nonssl. Works for me as far as I can tell.

 

<td width="50%" class="main" valign="top">

<ul class="sitemap">

<?php if (count($files['name']) > 0) {

for ($b = 0; $b < count($files['name']); ++$B) {

 

// check each page to see if it should be ssl

$securelink= 'NONSSL'; // assume a non ssl page

$SSLfp = file($files['path'][$b] ); // load the root file into a variable

for ($SSLidx = 0; $SSLidx < count($SSLfp); ++$SSLidx){ //go through root file line by line until the doctype tag is encountered

if ((strpos($SSLfp[$SSLidx], "breadcrumb->add") !== FALSE) && (strpos($SSLfp[$SSLidx], "'SSL") !== FALSE)){ // determine if the bread crumb variable is in this line and it has the letter S S L in it Site Map

$securelink= 'SSL'; // set the ssl link to true

break;

}elseif(strpos($SSLfp[$SSLidx], "<!doctype") !== FALSE){ //doctype tag is found(too soon?), exit loop and do not use SSL

break; // exit the loop and do not set ssl link to true

}

}

?>

<li><?php echo '<a title="'. $files['name'][$b] .'" href="' . tep_href_link($files['path'][$b], '',$securelink). '">' . $files['name'][$b] . '</a>'; ?></li>

//end SSL change

 

<?php

}

}

if (count($boxHeading) > 0) {

for ($b = 0; $b < count($boxHeading); ++$B) {

Share this post


Link to post
Share on other sites

New code for use with Article_Manager

 

Simply add this to catalog/dynamic_sitemap.php where ever you want it to appear.

 

 

 

 

 

 

<?php

//ARTICLE MANAGER START

echo '<ul class="sitemap">';

echo '<li><a href="' . tep_href_link(FILENAME_ARTICLES, '',

 

'NONSSL') . '">' . BOX_ALL_ARTICLES . '</a></li>' . "";

$topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id from " .

 

TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.parent_id = '" . (int)

 

$topic_links[$i] . "' and t.topics_id = td.topics_id and td.language_id = '" . (int)

 

$languages_id . "' order by sort_order, td.topics_name");

if (tep_db_num_rows($topics_query) > 0) {

$row = 0;

while ($topics = tep_db_fetch_array($topics_query)) {

$row++;

echo '<li><a href="' . tep_href_link(FILENAME_ARTICLES, 'topics_id=' . $topics

 

['topics_id']) . '">' . $topics['topics_name'] . '</a></li>' . "";

}

}

echo '</ul>';

//ARTICLE MANAGER END

?>


Follow the community build:

BS3 to osCommerce Responsive from the Get Go!

Check out the new construction:

Admin Gone to Total BS!

Share this post


Link to post
Share on other sites

Hi

 

OK this is :blink:

 

I have installed V2.0 Kit 7/7/06. I have Jacks 25/10/05 on my other site & it works great.

 

I have the catalogue side fine, but a blank white page on admin. I have double checked all the amendments INC typo in readme, & uploaded the files included again (just in case the catalog/admin/sitemap.php & catalog/admin/includes/languages/english/sitemap.php were the wrong way round.)

 

It has got to be on the admin side, as the cataolg side is working fine...but please tell me what I am missing?

 

So blank admin & no error. database sql success.

 

Thanks

Julie :thumbsup:

Share this post


Link to post
Share on other sites
Hi

 

OK this is :blink:

 

I have installed V2.0 Kit 7/7/06. I have Jacks 25/10/05 on my other site & it works great.

 

I have the catalogue side fine, but a blank white page on admin. I have double checked all the amendments INC typo in readme, & uploaded the files included again (just in case the catalog/admin/sitemap.php & catalog/admin/includes/languages/english/sitemap.php were the wrong way round.)

 

It has got to be on the admin side, as the cataolg side is working fine...but please tell me what I am missing?

 

So blank admin & no error. database sql success.

 

Thanks

Julie :thumbsup:

Hi

 

OK I cannot get the admin to show. I have only installed Ultimate SEO URL's & Header tags Controller & spiders.txt & it was all working before I added this one.

 

I will undo all the new files & amendments so I can install Jack msc v1.6 because I know that works for me....but I have never undone a sql.

 

Please could you advise me how I do this please?

 

Thanks

Knew I should have stuck to Jacks! >_<

 

Julie

Share this post


Link to post
Share on other sites

Hi

 

I have downloaded the contribution again & when I use Winmerge the following files are all yellow & do not say "no difference"

 

catalog/admin/sitemap.php

catalog/admin/languages/english/sitemap.php

 

but I confess to not understanding it? :blush:

 

I have tried the tutorial but am getting more confused. I cannot see a difference, but all orange & not all white mean something must be wrong. This is why the admin is blank, but please can you tell me what I need to do next? Do I have any embedded stuff ( :blink: ) whatever that is or white lines. so frustrating...if I had a brain I'd be dangerous! :lol:

 

Please talk to me. :D

 

Thanks

Julie

Share this post


Link to post
Share on other sites

I can't help with the version you are using since I haven't looked at them. I assume they work but many times such uploads do not or the authors don't support them. The first version of 2.0 does work so you may want to backup to there. I know this wasn't of much help but I thought it would be better than not getting a reply at all.

 

Jack

Share this post


Link to post
Share on other sites
I can't help with the version you are using since I haven't looked at them. I assume they work but many times such uploads do not or the authors don't support them. The first version of 2.0 does work so you may want to backup to there. I know this wasn't of much help but I thought it would be better than not getting a reply at all.

 

Jack

Hi Jack

 

I am using the first version of V2.0 by Kit. You mentioned this one in a previous post, so I did this one instead of using yours (my first choice) I am more than happy to go back to your version1.6 as I have found all of your contributions easy to install & with little errors. As you say you support your contributions. I have never removed a .sql that I have added to a database so I do not know how to remove it safely? Could you tell me how to do this please?

 

I can't even access admin so that I can restore the previous database. There may be other alternatives but I cannot understand how?

 

Just incase you can see what is making these files show as wrong I'll post them, but really I'd be happy with yours.

 

catalog/admin/sitemap.php

 

<?php
/*
 $Id: sitemap.php,v 2.0 2006/07/07
 Released under the GNU General Public License
*/

 require('includes/application_top.php');

require(DIR_WS_FUNCTIONS. 'dynamic_sitemap.php');

 $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

 if (tep_not_null($action)) {
switch ($action) {
  case 'ex_file':
	if ($_POST['ex_type'] == 'all')
		$ex_type = 1;

	if ($_POST['ex_type'] == 'unreg')
		$ex_type = 2;

	  $file = tep_db_prepare_input($_POST['file']);
			if (tep_not_null($file) && tep_not_null($ex_type))
						 tep_db_query('insert into '.TABLE_SITEMAP_EXCLUDE.' values(NULL,"'.$file.'","'.$ex_type.'",0)');

	tep_redirect(tep_href_link(FILENAME_SITEMAP));
	break;
  case 'ex_box':
	if ($_POST['ex_type'] == 'all')
		$ex_type = 1;

	if ($_POST['ex_type'] == 'unreg')
		$ex_type = 2;

	  $file = $_POST['box'];
			if (tep_not_null($file) && tep_not_null($ex_type))
						 tep_db_query('insert into '.TABLE_SITEMAP_EXCLUDE.' values(NULL,"'.$file.'","'.$ex_type.'",1)');

	tep_redirect(tep_href_link(FILENAME_SITEMAP));
	break;
  case 'include':
			if ($eID = tep_db_prepare_input($_GET['eID']))
						tep_db_query('delete from '.TABLE_SITEMAP_EXCLUDE.' where exclude_id="'.$eID.'"');

	tep_redirect(tep_href_link(FILENAME_SITEMAP));
	break;
}
 }
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title>
<?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
</tr></td><tr><td>
<table border="0" width="100%" cellspacing="2" cellpadding="2">
 <tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr>
	<td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
		<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
	  </tr>
	</table></td>
  </tr>
<?php

//get all files in catalog/

 $excluded_query = tep_db_query('select exclude_file from '.TABLE_SITEMAP_EXCLUDE.' where exclude_type != "0" and is_box="0"');
 $excluded_array = array();
 $files = array();
 if (tep_db_num_rows($excluded_query))
  while($ex = tep_db_fetch_array($excluded_query))
  			$excluded_array[] = $ex['exclude_file'];


 if ($handle = opendir(DIR_FS_CATALOG)){
while (false !== ($file = readdir($handle))){
		if(! is_dir($file) && substr($file, -4, 4) === ".php") //only look at php files
		{
					if (!in_array($file ,$excluded_array)){
					$engFile = DIR_FS_CATALOG.DIR_WS_LANGUAGES . $language . '/' . $file;
					if (file_exists($engFile) && IsViewable(DIR_FS_CATALOG.$file))
					{
					   $fp = file($engFile);

					   for ($idx = 0; $idx < count($fp); ++$idx)
					   {
						 if (strpos($fp[$idx], "define('HEADING_TITLE") !== FALSE)
						 {
							$fp[$idx] = stripslashes($fp[$idx]);
							$p_start = strpos($fp[$idx], ",");
							$p_start = strpos($fp[$idx], "'", $p_start);
							$p_stop = strpos($fp[$idx], "'", $p_start + 2);
							$files[] = array('id' => $file,
																			 'text' => ucfirst(substr($fp[$idx], $p_start + 1, $p_stop - $p_start - 1)).' ('.$file.')');
							break;
						 }
					   }
					}
			}
		}
	}
	closedir($handle);

} else echo ERROR_CANNOT_OPEN_CATALOG_DIR . DIR_FS_CATALOG.'<br>';


//get all catalog boxes

 $excluded_query = tep_db_query('select exclude_file from '.TABLE_SITEMAP_EXCLUDE.' where exclude_type != "0" and is_box="1"');
 $excluded_array = array();

 if (tep_db_num_rows($excluded_query))
  while($ex = tep_db_fetch_array($excluded_query))
  			$excluded_array[] = $ex['exclude_file'];

 if ($handle = opendir(DIR_FS_CATALOG.DIR_WS_BOXES)){
$ctr = 0;
while (false !== ($file = readdir($handle)))
{
   if (substr($file, -4, 4) !== ".php")
	  continue;
		 elseif (in_array($file ,$excluded_array))
			continue;

   $file = DIR_FS_CATALOG.DIR_WS_BOXES . $file;
   $fp = file($file);

   for ($idx = 0; $idx < count($fp); ++$idx)
   {
	 if ($posStart = strpos($fp[$idx], "BOX_HEADING") !== FALSE)
	 {
		 $parts = explode(" ", $fp[$idx]);
		 for ($i = 0; $i < count($parts); ++$i)
		 {
			if (strpos($parts[$i], "BOX_HEADING") === FALSE)
			  continue;
			$parts = explode(")", $parts[$i]);  //$parts has full box heading text
			$name = explode("_", $parts[0]);	//ignore the BOX_HEADING part
			for ($x = 3; $x < count($name); ++$x) //name may be more than one word
			{
			  if (tep_not_null($name[$x]))
				$name[2] .= ' ' . $name[$x];
			}
			$name[2] = strtolower($name[2]);
			$name[2] = ucfirst($name[2]);
			$boxes[$ctr]['text'] = $name[2].' ('.basename($file).')';
		 }
		  $boxes[$ctr]['id'] = basename($file);
	 }
   }
   $ctr++;
}
closedir($handle);

}  else echo ERROR_CANNOT_OPEN_CATALOG_BOXES_DIR . DIR_FS_CATALOG.DIR_WS_BOXES.'<br>';
?>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td valign="top"><table border="0" cellspacing="0" cellpadding="2">
								<tr>
									<td class="main" width="50%"><?=TITLE_CATALOG_FILES?></td>
									<td class="main" width="50%"><?=TITLE_CATALOG_BOXES?></td>
								</tr>
								<tr>
									<td class="main"><table border="0" cellspacing="0" cellpadding="2">
													<tr>
														<td colspan="2" class="main"><? echo tep_draw_form('ex_file', FILENAME_SITEMAP,'action=ex_file').tep_draw_pull_down_menu('file',$files);?></td>
													</tr>
													<tr>
														<td class="main"><? echo TEXT_EXCLUDE_FOR_ALL.tep_draw_radio_field('ex_type','all', true).'<br>'.TEXT_EXCLUDE_FOR_UNREG.tep_draw_radio_field('ex_type','unreg');?></td>
														<td class="main" align="right"><?=tep_image_submit('button_exclude.gif', IMAGE_EXCLUDE)?></form></td>
													</tr>
										</table></td>
									<td class="main"><table border="0" cellspacing="0" cellpadding="2">
													<tr>
														<td><? echo tep_draw_form('ex_box', FILENAME_SITEMAP,'action=ex_box').tep_draw_pull_down_menu('box',$boxes);?></td>
													</tr>
													<tr>
														<td class="main"><? echo TEXT_EXCLUDE_FOR_ALL.tep_draw_radio_field('ex_type','all', true).'<br>'.TEXT_EXCLUDE_FOR_UNREG.tep_draw_radio_field('ex_type','unreg');?></td>
														<td class="main" align="right"><?=tep_image_submit('button_exclude.gif', IMAGE_EXCLUDE)?></form></td>
													</tr>
										</table></td>
								</tr>
					</table></td>
				</tr>
		  <tr>
						<td class="main"><?=" "?></td>
				</tr>
		  <tr>
			  <td valign="top"><table border="0" cellspacing="0" cellpadding="2" width="100%">
								<tr>
									<td class="main" width="50%" valign="top" align="center"><table border="0" cellspacing="0" cellpadding="2" width="90%">
													<tr>
													<td class="formAreaTitle"><?=TITLE_EXCLUDED_CATALOG_FILES?></td>
												  </tr>
													<tr>
													  <td class="main"><?
	$exclude_query = tep_db_query('select exclude_id, exclude_file, exclude_type from '.TABLE_SITEMAP_EXCLUDE.' where is_box="0" and exclude_type!="0" order by exclude_type, exclude_file');
	if (tep_db_num_rows($exclude_query))
			while($exclude = tep_db_fetch_array($exclude_query)){
							 echo '<table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td class="main">'.$exclude['exclude_file'].'</td><td class="main">('.( $exclude['exclude_type'] == 1 ? TEXT_ALL : TEXT_UNREG ).')</td><td class="main" align="right"><a href="'.tep_href_link(FILENAME_SITEMAP, 'action=include&eID='.$exclude['exclude_id']).'">'.TEXT_INCLUDE.'</a></td></tr></table>';
					}
													?></td>
													</tr>
										</table></td>
		 					<td class="main" width="50%" valign="top" align="center"><table border="0" cellspacing="0" cellpadding="2" width="90%">
													<tr>
													<td class="formAreaTitle"><?=TITLE_EXCLUDED_CATALOG_BOXES?></td>
												  </tr>
													<tr>
													  <td class="main"><?
	$exclude_query = tep_db_query('select exclude_id, exclude_file, exclude_type from '.TABLE_SITEMAP_EXCLUDE.' where is_box="1" and exclude_type!="0" order by exclude_type, exclude_file');
	if (tep_db_num_rows($exclude_query))
			while($exclude = tep_db_fetch_array($exclude_query)){
							 echo '<table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td class="main">'.$exclude['exclude_file'].'</td><td class="main">('.( $exclude['exclude_type'] == 1 ? TEXT_ALL : TEXT_UNREG ).')</td><td class="main" align="right"><a href="'.tep_href_link(FILENAME_SITEMAP, 'action=include&eID='.$exclude['exclude_id']).'">'.TEXT_INCLUDE.'</a></td></tr></table>';
					}
													?></td>
													</tr>
										</table></td>
								</tr>
					</table></td>
				</tr>
	  </tr>
	</table></td>
  </tr>
</table></td>
<!-- body_text_eof //-->
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

catalog/admin/includes/languages/english/sitemap.php

 

<?php
/*
 $Id: specials.php,v 1.10 2002/03/16 15:07:21 project3000 Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License
*/

define('HEADING_TITLE', 'Sitemap');

define('TITLE_CATALOG_FILES', 'Files in Catalog<br /><small>('.DIR_FS_CATALOG.')</small>');
define('TITLE_CATALOG_BOXES', 'Catalog boxes<br /><small>('.DIR_FS_CATALOG.DIR_WS_BOXES.')</small>');
define('TEXT_EXCLUDE_FOR_ALL', 'Exclude completely');
define('TEXT_EXCLUDE_FOR_UNREG', 'Exclude for unregistered users');
define('TEXT_INCLUDE', 'Include');
define('TEXT_ALL', 'all');
define('TEXT_UNREG', 'guests');
define('TITLE_EXCLUDED_CATALOG_FILES', 'Excluded catalog files');
define('TITLE_EXCLUDED_CATALOG_BOXES', 'Excluded catalog boxes');

define('ERROR_CANNOT_OPEN_CATALOG_BOXES_DIR', 'Error! Can\'t open catalog boxes dir : ');
define('ERROR_CANNOT_OPEN_CATALOG_DIR', 'Error! Can\'t open catalog dir : ');


?>

 

I tried it the last two blank lines removed too. :(

 

And the .sql which needs to be removed from the database so I can go back to v1.6

 

CREATE TABLE `sitemap_exclude` (
`exclude_id` INT NOT NULL AUTO_INCREMENT ,
`exclude_file` VARCHAR( 255 ) NOT NULL ,
`exclude_type` INT( 2 ) DEFAULT '0' NOT NULL ,
`is_box` INT( 1 ) DEFAULT '0' NOT NULL,
PRIMARY KEY ( `exclude_id` )
);

insert into `sitemap_exclude` values (NULL, 'best_sellers.php','1','1');
insert into `sitemap_exclude` values (NULL, 'categories.php','1','1');
insert into `sitemap_exclude` values (NULL, 'currencies.php','1','1');
insert into `sitemap_exclude` values (NULL, 'languages.php','1','1');
insert into `sitemap_exclude` values (NULL, 'manufacturer_info.php','1','1');
insert into `sitemap_exclude` values (NULL, 'manufacturer.php','1','1');
insert into `sitemap_exclude` values (NULL, 'order_history.php','1','1');
insert into `sitemap_exclude` values (NULL, 'product_notifications.php','1','1');
insert into `sitemap_exclude` values (NULL, 'reviews.php','1','1');
insert into `sitemap_exclude` values (NULL, 'shopping_cart.php','1','1');
insert into `sitemap_exclude` values (NULL, 'search.php','1','1');
insert into `sitemap_exclude` values (NULL, 'specials.php','1','1');
insert into `sitemap_exclude` values (NULL, 'tell_a_friend.php','1','1');
insert into `sitemap_exclude` values (NULL, 'whats_new.php','1','1');

insert into `sitemap_exclude` values (NULL, 'product_info.php','1','0');
insert into `sitemap_exclude` values (NULL, 'create_account_success.php','1','0');
insert into `sitemap_exclude` values (NULL, 'links_submit_success.php','1','0');
insert into `sitemap_exclude` values (NULL, 'checkout_process.php','1','0');

 

Sorry for long post, but I have been trying allsorts & still a blank admin, but a sitemap on the catalog side?

 

Thank you so much

Julie

Share this post


Link to post
Share on other sites
Hi Jack

 

I am using the first version of V2.0 by Kit. You mentioned this one in a previous post, so I did this one instead of using yours (my first choice) I am more than happy to go back to your version1.6 as I have found all of your contributions easy to install & with little errors. As you say you support your contributions. I have never removed a .sql that I have added to a database so I do not know how to remove it safely? Could you tell me how to do this please?

 

I can't even access admin so that I can restore the previous database. There may be other alternatives but I cannot understand how?

 

Just incase you can see what is making these files show as wrong I'll post them, but really I'd be happy with yours.

 

catalog/admin/sitemap.php

There's probably no reason to remove the database entries. At the most there will be extra entries so it shouldn't hurt anything. But if you wanted to remove them, you would have to go into phpmyadmin and remove them one at a time, which isn't recommended unless you are familiar with how to do that. If this is a live shop, you wouldn't want to restore the database at this point since you will lose whatever new customer or order data there is.

 

The screen showing white is usually due to a file that belongs in the english directory being put in the root (admin in this case) directory. But since the files in this contribution are not base files for the admin, that shouldn't matter unless you actually tried displaying the site map section in admin. My guess is that the admin/includes/filenames.php or database_tables.php filef have been edited incorrectly. I suggest replacing those with your originals to see what happens.

 

Jack

Share this post


Link to post
Share on other sites
There's probably no reason to remove the database entries. At the most there will be extra entries so it shouldn't hurt anything. But if you wanted to remove them, you would have to go into phpmyadmin and remove them one at a time, which isn't recommended unless you are familiar with how to do that. If this is a live shop, you wouldn't want to restore the database at this point since you will lose whatever new customer or order data there is.

 

The screen showing white is usually due to a file that belongs in the english directory being put in the root (admin in this case) directory. But since the files in this contribution are not base files for the admin, that shouldn't matter unless you actually tried displaying the site map section in admin. My guess is that the admin/includes/filenames.php or database_tables.php filef have been edited incorrectly. I suggest replacing those with your originals to see what happens.

 

Jack

Thanks Jack

 

I am going round in circles with this one. >_<

 

As it is a new install (not live) :-" then I am going to (if this is ok) completely delete both the "files" & "database" & upload again & install 0806ms2 again. (with a new database & folder)

 

HTC (your version) is first followed by Ultimate SEO URLs (Chemo) followed by Dynamic sitemap (your version 1.6)

 

Thanks for your help Jack

 

Julie

Share this post


Link to post
Share on other sites

B) Umm, I hope this is not a dumb question but I am a bit new at this.

 

I have installed this contribution and have it working with no problems.

 

I want to submit my site to google with a site map.

 

Can I just point google to the dynamic_sitemap.php file in my catalog directory or do I have to install a sitemap contribution that generates a xml file???

 

I would appreciate any replies that can put me right on this.

 

Cheers all

Share this post


Link to post
Share on other sites

No, this isn't the kind of sitemap google needs. You should install the google sitemap contribution by Chemo for doing that.

 

Jack

Share this post


Link to post
Share on other sites
No, this isn't the kind of sitemap google needs. You should install the google sitemap contribution by Chemo for doing that.

 

Jack

 

Thank you for the reply

Share this post


Link to post
Share on other sites

Hi Jack,

 

I am a little perplexed at this point as I have the sitemap working ok displaying articles and infopages. I have also excluded all of the infoboxes as I dont need them to be shown in the sitemap.

 

However I have 3 custom infoboxes, 2 which display rotating banners in the left column and one that is a news letter sign up infobox.

 

I have read through the thread and really can not see a solution to my dilemma, here is the very simple code out of the infoboxes. I hope you can shed some light on why I get 2 empty <li> tags at the top of my sitemap before the first infopage link.

 

Email InfoBox

<?php
/*
 $Id: visitoremail.php,v 1.16 2003/06/10 18:26:33 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
?>
<!-- visitor_e-mail //-->
	  <tr>
		<td>
<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => '<table width="100%" height="20" border="0" cellspacing="0" cellpadding="4"><tr><td class="SideinfoBoxHeading" align="center">' . BOX_HEADING_VISITOR_EMAIL . '</td></tr></table>');

 new SideinfoBoxHeading($info_box_contents);

 $info_box_contents = array();
 $info_box_contents[] = array('form' => tep_draw_form('email', tep_href_link(FILENAME_VISITOR_EMAIL, 'action=process')),
						   'align' => 'center',
						   'text' =>  '<table width="95%" border="0" cellspacing="0" cellpadding="2" align="center"><tr><td width="12" class="main" align="right">' . tep_image(DIR_WS_IMAGES . 'email_tick.gif', '', '12', '13') . '</td><td width="160" class="main">' . TEXT_EMAIL_1 . '</td></tr><tr><td width="12" class="main" align="right">' . tep_image(DIR_WS_IMAGES . 'email_tick.gif', '', '12', '13') . '</td><td width="160" class="main">' . TEXT_EMAIL_2 . '</td></tr><tr><td width="12" class="main" align="right">' . tep_image(DIR_WS_IMAGES . 'email_tick.gif', '', '12', '13') . '</td><td width="160" class="main">' . TEXT_EMAIL_3 . '</td></tr></table><table width="95%" border="0" cellspacing="0" cellpadding="0" align="center"><tr><td class="email_main" align="center">' . tep_draw_separator('pixel_trans.gif', '100%', '10') . TEXT_EMAIL_ADDRESS . '</td></tr><tr><td align="center">' . tep_draw_input_field('to_email_address', '', 'size="20"') . '</td></tr><tr><td align="center">' . tep_image_submit('button_visitor_email.gif', BOX_HEADING_VISTOR_EMAIL) . '</td></tr></table>');

 new SideinfoBox($info_box_contents);
?>
		</td>
	  </tr>
<!-- visitor_email_eof //-->

 

Column Banner Infobox

		  <tr>
		<td>
<?php

if ($banner = tep_banner_exists('dynamic', '125x125')) {

 $info_box_contents = array();
 $info_box_contents[] = array('align' => 'center',
						   'text'  => tep_display_banner('static', $banner)
						  );
 new SideinfoBox($info_box_contents);

}
?>
		</td>
	  </tr>

 

Thank you.

 

Mark


Lifes a bitch, then you marry one, then you die!

Share this post


Link to post
Share on other sites
The code doesn't support that sort of box.

 

Jack

 

Jack, do you mean that sort of box class or say the banner code or input fields???????

 

Please expand on what you mean.

 

Thanks

 

Mark


Lifes a bitch, then you marry one, then you die!

Share this post


Link to post
Share on other sites

It only supports infoboxes that have links in the standard format. Compare the code of the failing box to one that works to see the difference.

 

Jack

Share this post


Link to post
Share on other sites
It only supports infoboxes that have links in the standard format. Compare the code of the failing box to one that works to see the difference.

 

Jack

 

Thanks Jack,

 

I decided that as I dont need any of the infoboxes in the sitemap I have removed this piece of code from the sitemap module

 

 for ($idx = 0; $idx < count($fp); ++$idx)
   {
	 if ($posStart = strpos($fp[$idx], "BOX_HEADING") !== FALSE)
	 {				 
		 $parts = explode(" ", $fp[$idx]);
		 for ($i = 0; $i < count($parts); ++$i)
		 {
			if (strpos($parts[$i], "BOX_HEADING") === FALSE)
			  continue;
			$parts = explode(")", $parts[$i]);  //$parts has full box heading text
			$name = explode("_", $parts[0]);	//ignore the BOX_HEADING part
			for ($x = 3; $x < count($name); ++$x) //name may be more than one word
			{
			  if (tep_not_null($name[$x]))
				$name[2] .= ' ' . $name[$x];
			}
			$name[2] = strtolower($name[2]);
			$name[2] = ucfirst($name[2]);
			$boxHeading[$ctr]['heading'][$ctr] = $name[2];
		 }
	 }  
	 else if ($posStart = strpos($fp[$idx], "FILENAME") !== FALSE)
	 {
	   $str = str_replace("'<a href=\"' . tep_href_link(", "", $fp[$idx]);
	   $str = str_replace("\$info_box_contents[] = array('text' => ", "", $str);

	   $parts = explode(")", $str);
	   $parts[0] = trim($parts[0]);

	   $boxParts = explode(".", $parts[1]);
	   $boxParts[2] = trim($boxParts[2]);	  

	   if (tep_not_null($boxParts[2]))
	   {	 
		  $boxHeading[$ctr]['filename'][] = getFileName($pathFileName, $parts[0]);
		  $boxHeading[$ctr]['boxtext'][] = getBoxText($pathLanguage, $boxParts[2]);
	   }
	   else
	   { 
		  if (tep_not_null($box_heading))
		  {
			echo 'Invalid code for this module found in the following infobox: '.$boxHeading[$ctr]['heading'][$ctr].'<br>';
			array_pop($boxHeading);
			$ctr--;
		  }
	   }
	 }			   
   }

 

After a bit of testing there seems to be no mal effects unless you can think of any.

 

Mark


Lifes a bitch, then you marry one, then you die!

Share this post


Link to post
Share on other sites

I have installed this on my local host and it works great no errors. so I did the exact same thing and installed in my live server.

 

I now have this error when I try to create the xml file

 

Warning: fopen(/var/www/domains/seawayhobby.com/docs/sitemaps.xml) [function.fopen]: failed to open stream: Permission denied in /var/www/domains/seawayhobby.com/docs/admin/create_xml_sitemaps.php on line 102

Unable to create site map index file!

 

Is this my host causing this or am I missing something such as a permission set wrong somewhere?

 

here is the line in create_xml.php where it says the error is..$fh = fopen($sm, 'w') or die(ERROR_INDEX_FILE);

Thanks Chris.

Edited by christoph100

Share this post


Link to post
Share on other sites

I think it is failing because it is seeing phpmyadmin (or a file within that directory) as a file to be linked to and when it tries to link to it, the server prevents it since it is a protected section. Go to admin and exclude the directory (or files within) and that should fix it.

 

By the way, if your host provides phpmyadmin in their control panel (most do), then you should delete that one. If they don't, you should move it to your admin directory.

 

Jack

Share this post


Link to post
Share on other sites
I think it is failing because it is seeing phpmyadmin (or a file within that directory) as a file to be linked to and when it tries to link to it, the server prevents it since it is a protected section. Go to admin and exclude the directory (or files within) and that should fix it.

 

By the way, if your host provides phpmyadmin in their control panel (most do), then you should delete that one. If they don't, you should move it to your admin directory.

 

Jack

 

In admin I dont see that directory to exclude is there another way to exlcude the offending direcory?........What do you mean delete that one? I do have access to phpmyadmin.

 

Thanks again

Chris.

Share this post


Link to post
Share on other sites

If you are using version 2.0, then there should be a option to exclude files in admin->Tools->Sitemap. If not, you have to edit the files to exclude them. If you have access to phpmyadmin in your hosts control panel, then delete the whole phpmyadmin directory in your shop and that should fix this problem.

 

Jack

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×