starynightskyz Posted May 6, 2006 Posted May 6, 2006 It seems a silly question, but I am trying to add a contribution and the instructins say to put certain things on certain pages with out reference to what might be around it ( clues ) So if I have to insert the code into line 397 I am just wondering where I start, At the very top? Also do I just count the lines of text? Or do I include blank lines in my counting spree? Just want to avoid putting the code into the wrong place and want to be certain before I continue. Thanx for your help!! Nancy:D
Guest Posted May 6, 2006 Posted May 6, 2006 The best way, I have found, is to copy the entire file's test into a html editor which lists the line numbers. Personally, I use 1st page, free. I'm sure other folks have their suggestions. All are valid. Once you have made your changes, copy the changes back over. Hope that helps you somehow.
Terra Posted May 6, 2006 Posted May 6, 2006 Every line counts, even if it's blank and counting starts from top. Having said that with over 500 lines of code on many pages, you'd get potty so best to use a text editor with line count as Moonlight said. I'm using Crimson Editor but there are lots more out there. If you use a text editor, you can use it for all your amendments, so no need to copy back & forth between different programmes. Terra My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad) and how to solve the invoice already paid error General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **
spax Posted May 6, 2006 Posted May 6, 2006 And if you are copying code into a text editor, make sure Word Wrap is disabled. If it is enabled, that will add extra lines.
Terra Posted May 6, 2006 Posted May 6, 2006 And if you are copying code into a text editor, make sure Word Wrap is disabled. If it is enabled, that will add extra lines. Not in a proper editor - Crimson Editor does not count wordwrap as lines, even if the code on screen appears on several lines. :thumbsup: Terra My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad) and how to solve the invoice already paid error General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **
spax Posted May 6, 2006 Posted May 6, 2006 Not in a proper editor - Crimson Editor does not count wordwrap as lines, even if the code on screen appears on several lines. :thumbsup: Terra :P
starynightskyz Posted May 7, 2006 Author Posted May 7, 2006 Thanx, All of you!! I downloaded Crimson tonight..... HOWA! sure beats the .... out of counting each line !! Thanx Again!! Nancy :D
starynightskyz Posted May 7, 2006 Author Posted May 7, 2006 OH I should have asked. When your adding how do you insert the new code. if its meant to go on line 30 and there is already something there do you add onto that line. or bump the pre existing code on line 30 up, or down? before putting in the new code? Thanx :D
knifeman Posted May 7, 2006 Posted May 7, 2006 OH I should have asked. When your adding how do you insert the new code. if its meant to go on line 30 and there is already something there do you add onto that line. or bump the pre existing code on line 30 up, or down? before putting in the new code? Thanx :D All the mods I have added to my shop have stated 'add right after' or ' add right before' or 'replace with'. Line counting only works if your file is not modified. Once you add more lines of code, your line 30 won't match my line 30. Since most people add more than one contribution, there is no way to tell what is on line 30 in everybodys file. With that said, there are some basic principles. Maybe the experts can add to this. If you are adding 'defines' in a langauge file, placement is not really important. If you are adding tables or calls in a page file, then placement is everything. You can change the position of the boxes in column left, by merely changing the order in column_left.php. Tim
HSMagic Posted May 7, 2006 Posted May 7, 2006 PHP Designer 2006. Free and excellent. http://www.mpsoftware.dk/
starynightskyz Posted May 7, 2006 Author Posted May 7, 2006 All the mods I have added to my shop have stated 'add right after' or ' add right before' or 'replace with'.Line counting only works if your file is not modified. Once you add more lines of code, your line 30 won't match my line 30. Since most people add more than one contribution, there is no way to tell what is on line 30 in everybodys file. With that said, there are some basic principles. Maybe the experts can add to this. If you are adding 'defines' in a langauge file, placement is not really important. If you are adding tables or calls in a page file, then placement is everything. You can change the position of the boxes in column left, by merely changing the order in column_left.php. Tim Well then. It is probably wrong to start with that I am trying to include this on an site design differnt from a clean oscommerce site. And I should probably scrap it and start from scratch ? Nancy:D
ozcsys Posted May 7, 2006 Posted May 7, 2006 Well then. It is probably wrong to start with that I am trying to include this on an site design differnt froma clean oscommerce site. And I should probably scrap it and start from scratch ? Nancy:D No you can add as many different contributions or code changes to a site as you want, use the line numbers in the instructions as a guide to where the code you are looking for is located. The code is the important thing not the line numbers, they are just there to give you a hand finding the code. The Knowledge Base is a wonderful thing. Do you have a problem? Have you checked out Common Problems? There are many very useful osC Contributions Are you having trouble with a installed contribution? Have you checked out the support thread found Here BACKUP BACKUP BACKUP!!! You did backup, right??
Guest Posted May 7, 2006 Posted May 7, 2006 If you are adding in a contribution to your site - nearly all contributions do something like this: Find line 201 and look for this code (a block of code is shown). Replace with this code (the new code shown). So, if your files are already modified and your line 201 is different from what they say line 201 is - they show you what code to look for that will need modifying. Still, having an editor as we have suggested is standard equipment for anyone maintaining a website of any variety.
Terra Posted May 8, 2006 Posted May 8, 2006 To add to Moonlight's note - Crimson Editor has a "find" function for searching in the open page, so that makes it easy to search for the first line of code mentioned in the contrib install instruction - e.g. line 30, right before code [this code] insert this. With Crimson Editor you can search for [this code], regardless of the line number. Installing contribs is usually easier if you know basic PHP syntax (nothing fancy, just how the whole opening / closing thing works, a quick google will bring up resources) and how HTML table structures work. Terra My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad) and how to solve the invoice already paid error General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **
Recommended Posts
Archived
This topic is now archived and is closed to further replies.