Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

copy to all files???


WEBMISSIE

Recommended Posts

Just looking at a couple of contributions specifically the cool menu where it says copy a bit of code to every page in the catalog folder. Every page in the catalog folder, they must be kidding. How am I supposed to do this? Is there a program or something that I should be using. thanks

Link to comment
Share on other sites

Yep, a batch replacer is a valuable tool for any web developer to have. I use UltraEdit 9 which has a batch replacer built in (and many other cool features). But you can go to hotfiles.com and download many freeware applications that do similar things.

Link to comment
Share on other sites

I don't know about that specific contribution, but it seems odd to have to edit every file. Duplicated code seems like an HTML thing. To me part of the beauty of PHP is that if the includes are used properly you only have to make your change in one place and it shows up on all the pages.

In olden times the men were made of iron and the ships were made of wood; now it's the other way around. :wink:

Link to comment
Share on other sites

When it says every file it will only be talking about the main directory files, not EVERY file.

 

i.e. you wouldnt add it to /includes files or /language files etc.

 

Only the ones that are called directly in browser when you view the site, i.e. default.php, account.php, login.php .......

 

I havent installed this mod, but if it is based on javascript then it doesnt want to be in seperate core files.

 

I think the total file count in /catalog is about 30-35, so it aint that bad if you DO have to do it manually.

 

CC.

Link to comment
Share on other sites

Orchard, yeah...you are right. However, since osC doesn't really include all the functionality that might be needed, its necessary to copy files to a whole set of pages on occasion. Even if you want an include file as part of every page, you have to get it on each page at least originally :)

 

I think as osC development progresses (especially along the lines of theming/headers/footers, etc), these kinds of global mods should be reduced :)

Link to comment
Share on other sites

This contribution is supposed to allow you to edit 99% of the site text from an administrative area not having to modify the language files. Here is where it says to add this snippet to all of the osc pages.

 

Second, for all of the osc pages, at the very top above the code line:



require('includes/application_top.php');

 

add in the following lines of code:



 global $page_name;

 

 $page_name = 'default'

.

How am I supposed to make sure I get the code in the right place? I don't see where the batch file edit program will allow me to specify where I want the file addition to be placed. Am I just wasting my time with this contribution though. Is there really that much text to edit that just modifying the language files is out of the question? Any assistance appreciated I have a fresh install that Im trying to surf the forums getting ideas about useful contributions that others are recommending and this text editor was one of the contribs that was recommended.

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