Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Dynamic SiteMap


Jack_mcs

Recommended Posts

Darn, no. writing the link as http://www.mysite.com/page.html does the same result as mentioned above. Weird. How in the world do people do it. *sniffles*

 

update: I think it's cause of this at the top of /includes/modules/dynamic_sitemap.php file:

$path = DIR_WS_BOXES;
$pathFileName = DIR_WS_INCLUDES . 'filenames.php';
$pathLanguage = DIR_WS_LANGUAGES . $language . '.php';

 

IF I understand it, it wants to look for ALL files only within /catalog/ .... whereas my .html pages are one level up at the root of the site. It doesn't know how to look there, regardless of how I write the path for the page/file in question.

 

How silly would it be if I made another sitemap to put on my html pages, that way I can include any and all pages I want?

Link to comment
Share on other sites

Hello,

 

I've just installed Dynamic Sitemap v 2.0 according to the installation instructions. However, when I go to catalog/dynamic_sitemap.php nothing showing up, just empty page. What's wrong? By the way, I have STS installed if it matters.

 

Any help would be appreciated.

Thanks.

Link to comment
Share on other sites

here is a function i saw on antoehr contribution:

 

// Function    : tep_html_noquote

// Arguments : string any string

// Return : strips apostrophes from strings

//Used with "Orders at a glance" to workaround problem with apostrophes

function tep_html_noquote($string) {

return str_replace("'", "", $string);

}

MS2

Link to comment
Share on other sites

I have a question. I installed v1.6 last week just fine and dandy and got my sitemap page looking fine in relation to the right hand side links.

 

Today, I was using my page as an example for another person who was going to install this contribution and noticed that my right hand side links are messed up:

 

There is a bullet with missing information ... there's no link there either when you hover your mouse - so I have no clue what link disappeared.

 

It added the new login box - added that to "False" section. Refreshed page. It then added the new paypay box - added that to the "False" section.

 

But there is still "Links" - and it's not clickable. I already have a "Links" link. I do not have a "Links" infobox. Not sure where it's finding this second "Links" nor how to get rid of it.

 

But that bullet with missing information is bugging me. I have not deleted any files within Oscommerce. Only added as I had installed a login box and paypayl box since installing this contribution. How do I delete that bullet?

 

Here's my page in question:

http://www.moonlightdelights.com/catalog/dynamic_sitemap.php

Edited by Moonlight
Link to comment
Share on other sites

Hi,

 

I installed this contribution today and have this error at the very top of the page:

Warning: is_dir(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (/home/httpd/vhosts/fitness909.com/httpdocs:/tmp) in /home/httpd/vhosts/fitness909.com/httpdocs/includes/modules/dynamic_sitemap.php on line 114

 

I tried commenting out that code and still gave a parse error.

 

How would I fix this?

 

Thank you!

Link to comment
Share on other sites

But that bullet with missing information is bugging me. I have not deleted any files within Oscommerce. Only added as I had installed a login box and paypayl box since installing this contribution. How do I delete that bullet?

Hi Barbara

 

I too have that bullet, with no links, & would like to remove it. I will be watching for the answer as well. ;)

 

Julie

Link to comment
Share on other sites

Hi,

 

This is my dynamic_sitemap.php page that I just installed and I don't have the bullet problem...only the other problem posted. Do a comparison.

 

<?php

/*

$Id: dynamic_sitemap.php,v 1.0 2005/06/29

written by Jack_mcs at www.osocmmerce-solution.com

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

require DIR_WS_FUNCTIONS . 'dynamic_sitemap.php';

 

$path = DIR_WS_BOXES;

$pathFileName = DIR_WS_INCLUDES . 'filenames.php';

$pathLanguage = DIR_WS_LANGUAGES . $language . '.php';

$boxText = array();

 

/********************* Find the infoboxes to add ***********************/

if ($handle = opendir($path))

{

if (!tep_session_is_registered('customer_id'))

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

else

$excluded_query = tep_db_query('select exclude_file from '.TABLE_SITEMAP_EXCLUDE.' where exclude_type = "1" 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'];

 

 

$found = false;

$ctr = 0;

while (false !== ($file = readdir($handle)))

{

if (substr($file, -4, 4) !== ".php")

continue;

elseif (in_array($file ,$excluded_array))

continue;

 

$file = $path . '/' . $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]);

$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--;

}

}

}

}

$ctr++;

}

closedir($handle);

}

 

/********************* Find the pages to add ***********************/

$ctr = 0;

($dir = opendir('.')) || die("Failed to open dir");

$files = array();

 

if (!tep_session_is_registered('customer_id'))

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

else

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

$excluded_array = array();

if (tep_db_num_rows($excluded_query))

while($ex = tep_db_fetch_array($excluded_query))

$excluded_array[] = $ex['exclude_file'];

 

while(false !== ($file = readdir($dir)))

{

//if((! is_dir($file) && substr($file, -4, 4) === ".php") && !in_array($file ,$excluded_array))//only look at php files and skip that are excluded

//{

$engFile = DIR_WS_LANGUAGES . $language . '/' . $file;

if (file_exists($engFile) && IsViewable($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['name'][] = str_replace('%s', '', ucfirst(substr($fp[$idx], $p_start + 1, $p_stop - $p_start - 1)));

$files['path'][] = $file;

break;

}

}

}

}

}

?>

Link to comment
Share on other sites

I have a question. I installed v1.6 last week just fine and dandy and got my sitemap page looking fine in relation to the right hand side links.

 

Today, I was using my page as an example for another person who was going to install this contribution and noticed that my right hand side links are messed up:

 

There is a bullet with missing information ... there's no link there either when you hover your mouse - so I have no clue what link disappeared.

 

It added the new login box - added that to "False" section. Refreshed page. It then added the new paypay box - added that to the "False" section.

 

But there is still "Links" - and it's not clickable. I already have a "Links" link. I do not have a "Links" infobox. Not sure where it's finding this second "Links" nor how to get rid of it.

 

But that bullet with missing information is bugging me. I have not deleted any files within Oscommerce. Only added as I had installed a login box and paypayl box since installing this contribution. How do I delete that bullet?

 

Here's my page in question:

http://www.moonlightdelights.com/catalog/dynamic_sitemap.php

I don't know what page that is but the pages are added as they appear in the shop, alphabetically. So the page before the missing one is create_account.php and the one after is login.php. There are only a few files in between there. Try excluding them all and see what happens. As for the links box, if you installed the latest Links Manager, then there is a Links box in it. That might be what you are seeing.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hi,

 

I installed this contribution today and have this error at the very top of the page:

Warning: is_dir(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (/home/httpd/vhosts/fitness909.com/httpdocs:/tmp) in /home/httpd/vhosts/fitness909.com/httpdocs/includes/modules/dynamic_sitemap.php on line 114

 

I tried commenting out that code and still gave a parse error.

 

How would I fix this?

 

Thank you!

That error is due to a server setting so you will need to contact your host and see if they will change it.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hi Jack,

 

It is my server and I have all the vhost.conf files setup to stop this error except for this contribution.

 

If I remove a ( bracket from that line then I get a parse error and when I put it back I get the open-base error.

 

I think there is something wrong with this one line.

Link to comment
Share on other sites

I don't know what page that is but the pages are added as they appear in the shop, alphabetically. So the page before the missing one is create_account.php and the one after is login.php. There are only a few files in between there. Try excluding them all and see what happens. As for the links box, if you installed the latest Links Manager, then there is a Links box in it. That might be what you are seeing.

 

Jack

Thanks Jack :thumbsup:

That helped me too. It proved to be the index.php. Now I do not have a blank bullet point in my site map.

 

Julie

Link to comment
Share on other sites

Hi Jack,

 

It is my server and I have all the vhost.conf files setup to stop this error except for this contribution.

 

If I remove a ( bracket from that line then I get a parse error and when I put it back I get the open-base error.

 

I think there is something wrong with this one line.

No, I'm pretty sure it is a server problem. Take a look at the open_basedir setting and make sure it is set to "no value".

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Jack,

 

I found this code on line 125:

if (strpos($fp[$idx], "define('HEADING_TITLE") !== FALSE)

 

I changed it to:

if (strpos($fp[$idx], define('HEADING_TITLE') !== FALSE)

 

and with the previous code left as is on line 114 I don't get the open_base error but do get this error:

Parse error: parse error in /home/httpd/vhosts/fitness909.com/httpdocs/includes/modules/dynamic_sitemap.php on line 125

 

This is the whole listing from line 114 down to 125:

 

if((! is_dir($file) && substr($file, -4, 4) === ".php") && !in_array($file ,$excluded_array))//only look at php files and skip that are excluded

{

$engFile = DIR_WS_LANGUAGES . $language . '/' . $file;

if (file_exists($engFile) && IsViewable($file))

{

 

$fp = file($engFile);

 

for ($idx = 0; $idx < count($fp); ++$idx)

{

 

// gives open base error if enabled

// if (strpos($fp[$idx], "define('HEADING_TITLE") !== FALSE)

 

// using this one removes open base error but gives parse error

if (strpos($fp[$idx]), "define('HEADING_TITLE") !== FALSE)

Link to comment
Share on other sites

It is set like this:

;open_basedir =

 

which means it's commented out. I use plesk so I have to setup vhost.conf and vhost_ssl.conf files to set the open_base like this:

 

<Directory /home/httpd/vhosts/fitness909.com/httpdocs>

php_admin_flag engine on

php_admin_value safe_mode 0

php_admin_value register_globals 1

php_admin_value open_basedir /home/httpd/vhosts/fitness909.com/httpdocs:/tmp:/usr/share/pear

</Directory>

 

which is the domain I'm having the problems with.

Link to comment
Share on other sites

I don't know what page that is but the pages are added as they appear in the shop, alphabetically. So the page before the missing one is create_account.php and the one after is login.php. There are only a few files in between there. Try excluding them all and see what happens. As for the links box, if you installed the latest Links Manager, then there is a Links box in it. That might be what you are seeing.

Jack

 

Like I said, I am using v1.6 - no Links box. Nor do I want one. The ONLY changes I made to Oscommerce after installing Links Manager was the Login Box and PayPal Box, both of which only dealt with a few files, none of which would affect Links Manager - so I still do not know where that extra "Links" came from. It literally showed up out of the blue.

 

I have so many files commented out to begin with - have no way to figure out which one is missing. And why would a file just arbitrarily disappear? When I installed this contribution, it was perfect. And was perfect for 2 days. Now ... weird things are happening.

 

Would posting my modules/dynamic_sitemap.php help in anyway?

Link to comment
Share on other sites

Jack,

 

I found this code on line 125:

if (strpos($fp[$idx], "define('HEADING_TITLE") !== FALSE)

 

I changed it to:

if (strpos($fp[$idx], define('HEADING_TITLE') !== FALSE)

That's invalid code.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

php_admin_value open_basedir /home/httpd/vhosts/fitness909.com/httpdocs:/tmp:/usr/share/pear

</Directory>

Take a look at the open_basedir setting and make sure it is set to "no value".

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Jack,

 

I tried it with and without those vhost files and still the same error.

 

I changed the code back to the original in modules/dynamic_sitempa.php and got the open_base error again so I commented out this code:

 

//if((! is_dir($file) && substr($file, -4, 4) === ".php") && !in_array($file ,$excluded_array))//only look at php files and skip that are excluded

{

$engFile = DIR_WS_LANGUAGES . $language . '/' . $file;

if (file_exists($engFile) && IsViewable($file))

{

 

$fp = file($engFile);

 

for ($idx = 0; $idx < count($fp); ++$idx)

{

// gives open base error

if (strpos($fp[$idx], "define('HEADING_TITLE") !== FALSE)

 

 

 

Then I got this error:

 

Warning: file(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (/home/httpd/vhosts/fitness909.com/httpdocs:/tmp:/usr/share/pear) in /home/httpd/vhosts/fitness909.com/httpdocs/includes/functions/dynamic_sitemap.php on line 45

 

Warning: file(..): failed to open stream: Operation not permitted in /home/httpd/vhosts/fitness909.com/httpdocs/includes/functions/dynamic_sitemap.php on line 45

 

 

So I went to the includes/functions/dynamic_sitemap.php and commented out line 45 which is:

// $fp = file($file);

and now it is clear with the exception of the "Information" and "Manufacturer" names are not linked whereas they were before. Please take another look at this:

http://www.fitness909.com/dynamic_sitemap.php

Edited by modom
Link to comment
Share on other sites

  • 3 weeks later...

Can anyone help me with this error?

 

Warning: is_dir(): Stat failed for httpsdocs (errno=40 - Too many levels of symbolic links)

 

 

How can I get the modules/dynamic_sitemap.php file to ignore this file?

 

 

Thanks in advance!

 

Trina

Link to comment
Share on other sites

What does this mean in the readme file in v. 2.0? There is not that kind of lines in admin/includes/boxes/tools.php.

 

Is there somekind of error? which version should I download?

 

6) In admin/includes/boxes/tools.php

 

FIND:

define('BOX_TOOLS_WHOS_ONLINE', 'Who\'s Online');

AFTER IT ADD:

define('BOX_TOOLS_SITEMAP', 'Sitemap');

 

FIND:

define('IMAGE_UPLOAD', 'Upload');

AFTER IT ADD:

define('IMAGE_EXCLUDE', 'Exclude');

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.

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...