Build a Niche Store Affiliate Contest

Build a Niche Store Sitemap MOD - Complete version!

September 13, 2007 | Author: Mark | Filed under: Build a Niche Store Mods, Build a Niche Store

Hi All -

Before I get too involved in explaining this BANS sitemap MOD, I want to state that you should ALWAYS make a backup of your original files before attempting any modifications. I will generally rename my files with a BAK extension to have a working copy in case of emergency :-) (ex: FrontControlBAK.php.)

The reason I created this MOD is to give website visitors and search spiders a single place to go and find all information about the store categories in one location. The sitemap will create a single page that lists all of your categories and the meta description you have completed within your store administration. At this point, I have not included the custom content pages and may not even do so. In addition, the product listings from the ebay feed are not included due to the frequency of change. The sitemap is intended to be a basic contents section, very similar to a table of contents in a book.

That being said - lets get to the BANS sitemap MOD!

Begin by downloading the BANS site MOD text files to avoid html code jacking up the copy/paste function. There is also a set of directions included in the zip file.

The files contained in this zip will enable you to include a public sitemap on your BANS store.

Before changing any of your site files - be sure to make a backup in case of emergency. Also remember that if you update your  BANS store with a newer version in the future, you will have to make these changes again, which may or may not work, depending on how the new release is done.

I know for sure that this MOD works on the BANS 2.0 stores - I have not tested it on anything prior.

Files included:

stylecss-changes.txt (Changes to your style.css file located in the theme you are using)
header-changes.txt (Changes to your header.php file in the theme you are using)
frontcontrol-changes.txt (Changes to the FrontControl.php file, located in the cont folder)

Instructions:

##########################################################
Step 1
##########################################################

Go into your BANS store admin and create a new CONTENT page. At the bottom of the page, use a filename that is relevant to¼br> your niche and contains no spaces.

ex: “Myniche-Sitemap” (Replace myniche with your niche market name)
##########################################################
Step 2
##########################################################
After your page is active, open your style.css file in the appropriate editor of your choice (notepad, dreamweaver etc) and¼br> add the contents of the stylecss-changes.txt file to the bottom of the file, just above the </style> tag. Save the file and upload to your server.
##########################################################
Step 3
##########################################################
Open your FrontControl.php file and search for:

function getMainPageParent(){

DIRECTLY ABOVE that code, copy and paste the text from the frontcontrol-changes.txt file. Save your changes and upload the¼br> file to your server.
##########################################################
Step 4
##########################################################

Open your header.php file from inside the theme directory you are using. This can be done within the admin of your store or¼br> in your own favorite text editor. At the very bottom of the code, you should see:

Directly ABOVE the closing head tag (</head>) Paste the following code:

 <?php
function curPageURL() {
 $pageURL = ‘http’;
 if ($_SERVER[”HTTPS”] == “on”) {$pageURL .= “s”;}
 $pageURL .= “://”;
 if ($_SERVER[”SERVER_PORT”] != “80″) {
  $pageURL .= $_SERVER[”SERVER_NAME”].”:”.$_SERVER[”SERVER_PORT”].$_SERVER[”REQUEST_URI”];
 } else {
  $pageURL .= $_SERVER[”SERVER_NAME”].$_SERVER[”REQUEST_URI”];
 }
 return $pageURL;
}
?>

This will get the current page URL from the server.

Next, look for:

<div id=”content” class=”narrowcolumn”>

Directly AFTER that code, paste the code from the header-changes.txt file shown below.

 <?php if (curPageURL() == “http://www.mynichedomainname.com/my-sitemap-filename“)
 {{echo “<div id=sitemap><ul id=’sitemap’>”;}
 {echo  $front->sitemapnav();}
 {echo “</ul></div>”;}}
 ?>

You MUST change the http:// information to reflect your own domain name and the sitemap file you created. The easy way of¼br> making sure this is exact will be to open your BANS site in a web browser and click on the menu item for your sitemap page.¼br> Once the blank page is open in front of you, highlight the entire URL in the address bar and copy/paste it into your header¼br> file section above.

After you are done - save your work and/or upload the file to your server in the same folder as your theme.

If you have any problems - feel free to email me directly at Mark@TheKidsCollegeFund.com or post to the blog or BANS forum.

Thanks and enjoy!

Mark



Stumble it!

28 people have left comments

[…] My Newest Build a Niche Store - Sorry for hiding! Build a Niche Store Sitemap MOD - Complete version! […]

[…] Add a Public Sitemap to your Build a Niche Store (Skill: 4) […]

Mark,

My BANS site is ver. 2.0 and I updated the script with your Sitemap Mod just as you described in the text file. I am not getting any output on the content page. No errors are showing, either. Any suggestions?

-Ross-
www.ratrodbarn.com

Ross wrote on October 4, 2007 - 6:38 pm |

Hi Ross -

I just visited the site and see it perfectly!

http://www.ratrodbarn.com/Rat-Rod-Sitemap

Mark

Mark wrote on October 4, 2007 - 6:46 pm |

Beats ME!!!….I could’nt get it to display today or last night. I’ve made no changes to it since the first install??

I don’t KNOW???????????????

It works now but I don’t know why?..Oh well I appreciate your help,regardless.

When I get up enough courage, I will buy Wordtracker through your link.

Thanks,

Ross

Ross wrote on October 4, 2007 - 8:20 pm |

DUH!!!!!!!

my page name is Rat_rod-Sitemap

my link points to Rat-Rod-SiteMap

Ross wrote on October 4, 2007 - 8:27 pm |

Mark,

I’m feeling really stupid right about now because I can’t figure this out. The instructions say to change the ’style.css’ file but I can’t find that. I can find a ’styles.css’ (plural) but that doesn’t have in it. What am I missing?

Rochelle

Rochelle wrote on October 13, 2007 - 3:47 pm |

Never mind as I think I got it. It is the ’styles.css’ file. Although I couldn’t find I added the code just before the final code and it works. Thanks for this :)

Rochelle wrote on October 13, 2007 - 3:57 pm |

Rochelle -

Sorry for the type in my writing.. It is referring specifically to the Sytle.css in your theme folder.

Mark

Mark wrote on October 13, 2007 - 5:27 pm |

Hi mark,

Im real new to building a site so a bit of an basic question but…
How do you make a Back up from those Ban stores with
FrontControlBAK.php ? I don’t really understand it.

Femke wrote on October 27, 2007 - 3:10 am |

@ Femke

Good question! If you use cuteftp or some other method to transfer your files back and forth to your server, just create a folder within your local bans copy, name the folder backups. Place a copy of your frontcontrol.php file into that folder.

If you do everything inside your CPanel hosting account, go into your public_html diredtory and create a new folder. Click one time over the frontcontrol.php in the cont folder and choose copy from the upper right menu, left click one time into your backups folder and you are done!

Mark

Mark wrote on October 27, 2007 - 8:01 am |

Thanks so much for this, however I get this error after taking the steps you suggest.

Parse error: syntax error, unexpected ‘:’ on line 39

Which is this line:
$pageURL .= “://”;

Spadilla wrote on October 28, 2007 - 4:05 pm |

Spadilla -

Shoot me the url of the site.

mark

Mark wrote on October 28, 2007 - 4:54 pm |

Hi Mark, I couldn’t find your email address :)
If it’s not too much of a hassle, could you email me at admin [at] pixsym . com? I don’t want to list my website here because it is a mess..LOL
Thanks so much!

Spadilla wrote on October 28, 2007 - 9:50 pm |

Mark,

My style.css file ends with /* Miscellaneous End */. Where do I add the mod?

Stephen Neilsen wrote on October 29, 2007 - 3:36 am |

@ Stephen -

If your stylesheet has no closing tag (2.0 and newer stores) You can just paste the code at the bottom of the file.

Mark

Mark wrote on October 29, 2007 - 8:17 am |

Mark

Had a load of trouble with the double quotes not coming out in my text editor correctly.

At first I couldn’t work out why the code was failing but after checking it carefully, I noticed that the double quotes were different in the cut and pasted code I had just used, from the other quotes already in the css file.

I’m from the UK and hope this may help others out if they encounter trouble with the code.

Cheers

Jeff

Jeff wrote on November 5, 2007 - 4:24 pm |

Hi Jeff,
I’m having same problem with the double quotes.
How did you get around this?

Hi Mark,
How come you have some text in post that we need to copy and paste and it wasn’t in the zip file?

I think that’s why I keep getting errors
Craig

Craig wrote on November 15, 2007 - 8:35 pm |

Hi Craig -

Shoot me the url of the site with a problem. ALL of the code that needs to be changed is in the zip file as far as I am aware.

I will look deeper to see what you mean.

Mark

Mark wrote on November 15, 2007 - 8:41 pm |

Hi Mark,
Wow fast reply :P

the code I’m talking about is first code in step 4

Craig

Craig wrote on November 15, 2007 - 8:50 pm |

Hi Mark,
Now i feel stupid, I see that code is in the readme file, I’ll try again.
Thanks
Craig

Craig wrote on November 15, 2007 - 8:51 pm |

Mark,
Quick question, when users come to my site using www. prefix the site map using your site map mod does not display, however if they enter http://nationwidegolfshop.com and go to the site map it works like a champ.

Is there something that I need to do so that it functions properly when user types www. prefix?

Any light you can shed on this would be helpful.

Jeff

Jeff wrote on November 16, 2007 - 5:03 pm |

@ Jeff -

In the: function curPageURL() {
$pageURL = ‘http’;
if ($_SERVER[”HTTPS”] == “on”) {$pageURL .= “s”;}
$pageURL .= “://”;

portion of code, change the $pageURL .= “://”; to:

$pageURL .=”://www.”;

Mark

Mark wrote on November 16, 2007 - 6:01 pm |

Mark,

Thanks for the quick answer. Unfortunately I don’t think my explanation of my problem was correct but it led me in the right direction. What I was truly looking for was regardless of whether a user enters www or not to have the sitemap display properly.

While not the best coding practice I enter the following:

“;}
{echo $front->sitemapnav();}
{echo “”;}}
?>
“;}
{echo $front->sitemapnav();}
{echo “”;}}
?>

Essentially if no www it executes the sitemap. If www is present it executes the site map.

Checked out php.net and tried to get an OR operator working but other pages wound up defaulting to the sitemap page.

Regardless, this seemed to work. Greatly appreciate your time and effort in making BANS mods and enlightening the community in general.

Jeff wrote on November 17, 2007 - 12:30 pm |

Parse error: parse error, unexpected ‘:’ in on line 39

Hi

I see someone else asked this earlier. where is the error?

MM wrote on November 27, 2007 - 7:21 pm |

Hi Mark

Your website is a great help. I am stuck at trying to upload the sitemap. I am also having the Parse error unexpected on Line 39. I see that other people have had the same problems but I didn’t see a solution on the forum. Can you help me figure this out?
Thanks
Brad

Brad wrote on December 3, 2007 - 11:55 am |

Hi mark, I’m gettign the same error as some above:

“Parse error: syntax error, unexpected ‘:’ in /home/xxxxx/public_html/buypicassoonline/themes/yoghourt/header.php on line 10″

xxxx is my username on my host, I x’d it out.

I see the ‘:’, and expect that you are just building a string…but I don’t know how to fix it.

THanks for any help!

Suzanne wrote on December 6, 2007 - 6:11 am |

SOLVED:

The parse error I was getting was due to copying text directly from this page, and ending up with slanty double and single quotes that were not interpreted.

I recopied the text directly from the .txt file in the download, and now it works great.

Thanks Mark!

Suzanne wrote on December 6, 2007 - 6:17 am |
SUBSCRIBE TO MY FEED

 Subscribe in a reader