Mod the Wrong Way or the Right way. You choose!

mydatery posted 6th of August 2009 in Community Voice. 7 comments.

We've been getting a rash of posts in the forums lately that are directly related to HOW people are modifying their files.  Recently, I've seen people showing up after attempting to install mods for 6.0.x into 6.1.6 and not being able to reset their sites, even after doing a back-up.  I've noticed others with sections just plain old no longer functioning, database query errors and so many other things that it's getting nuts.

I will be the first one to tell you to hop into your site, create a subdomain and put a copy of your entire site on it and then do all the testing/modifying/experimenting that you want.  That is exactly how I and a lot of others learned, but please do not do it to the Production site.  This is the last place you should be trying to experiment, use your production site to input the modification once you have perfected it on the test site. 

Now, with that out of the way, let's move on to the correct way to modify files.  Each of us has our own preference for tools, I am going to list what I find to be essential when it comes to working on a Dolphin site and it has NEVER failed me to do it this way.

  1. Firefox
  2. Firebug installed into Firefox. 
  3. Notepad++
  4. WinSCP FTP Client

Note, each of the 4 items I have listed are available for free, and few will argue the quality of the items.  Now, you need to configure this to work for you and not against you.

When it comes to setting up Firefox with Firebug, just download Firebug as an add on and allow firebug to install it. 

Notepad++ needs to be set into WinSCP as your default Editor, it will allow you to open up as many files as you want at one time, keep them in one window, make changes to any/all and roll those changes back to the original file, keep accurate track of line numbers and save all files simultaneously for you saving your mouses left click button. 

Configure WinSCP to do all transfers in binary mode.  This is the only acceptable way to transfer files and if you don't listen then you will one day pay a price for not listening.  Ask any one who works on sites on a regular basis and they will tell you this.  All of this can be done in WinSCP by logging into your server with it and then clicking Options in the Top Menu Row. 

Next step, this is going to sound strange but do it this way:

  1. On your computer create a folder and label it:  Yoursite Site Files
  2. Log into your site via FTP Client
  3. Copy all of your sites files from the Server to the folder that you just created.  Yes, it will take a little time to do this, just start the copy of all files and then find something else to do while it works in the background.
  4. Close your FTP

Yep, I want you to close your FTP, we're not going to modify any files directly on the server.  To modify source files on a production site would be considered a criminal offense and probably get you executed, just imagine the number of errors that will pop while your moseying through editing one file at a time.  So, your going to edit your sites files on your computer.

 

Now, you have that mod you've been dieing to install.  In fact, you've been begging to be cut loose and get it installed.  So, let's do it.

Open the folder with the mod and open the new Folder with your site files that you created and downloaded to your computer.  Set them side by side, give each 1/2 the screen more or less.

Next, open the instructions to your modification, but do not open the instructions in Notepad ++, instead use just good old regular Notepad to read them.  Set the Notepad window with the instructions on the left side and move down past the section for uploading files/running sql's and install files.  Just go to the steps that require you to start editing your code files.

Now, you will note, inside of the folder with all your site files, because you copied them from the server, hold the same exact directory path as they do on the server.  For example:

 

inc/classes/BxDolMenu.php

will still be found by going to the inc/ folder, then /classes folder. 

Right click the file you wish to edit and open this file up in Notepad++

Use the Search Function (Binoculars) to locate the sections of code you are looking for, this option also has a search replace feature inside of it.  Caution though, it will only search for 1 line of code at a time, if there is a hard enter in the code, it will only search for the code up to the hard enter and ignore everything else after it. 

So, you've finished editing the first file and wish to move on to the second file.  Great, go ahead and save the file, but do not close the file, leave it open.  I repeat:

 

DO NOT CLOSE THE FILE!  LEAVE IT OPEN!

DO NOT CLOSE THE FILE!  LEAVE IT OPEN!

DO NOT CLOSE THE FILE!  LEAVE IT OPEN!

DO NOT CLOSE THE FILE!  LEAVE IT OPEN!

Yes, it needed saying 5 times.  Instead, go on to the next file, notice how it opens the 2nd file your editing into a new tab?  After you finish editing the 2nd file save it and leave it open also.  Go on to the 3rd file until you have completely finished.  Under no circumstances do you close any files though.  Leave them all open, as long as they are open in Notepad++ you are safe, save a file and you just screwed yourself harder than Katrina & Hugo having a month long orgy in a New Orleans trailer park.

 

Now, go back to the beginning of your instructions after you have edited and saved all files and follow these steps:

 

  1. Upload files to the server that the instructions told you to upload
  2. Upload files to the server that you just edited.  Make sure all files are saved but STILL OPEN in your Notepad++ Editor.  I promise, with Notepad++ and WinSCP they will transfer without a problem.
  3. Run any SQL or Install.php files that the mod instructions tell you to run. 
  4. Start going through your site.  Review every nook and cranny, even those that you don't think apply.  I have seen blog comments disappear because I added Admin to Members e-mail to a site.  It happens and you need to be prepared for it.

So, let's say you have an error as  in the case of the person who tried to install a mod developed for 6.0.x to a 6.1.6 site, what do you?

Well, you could install a back up of your site, but you don't need to do that, instead you can go to your Notepad++ and if you can't figure the error out, just start hitting the green reverse button until it turns gray for each file and then save and reupload the original files back onto the server. 

The best part of editing/modifying your site this way is that everything can be returned to normal within a matter of seconds thansk to the handy undo option inside of Notepad++, I have yet to run into a time yet where I could not return a file to it's original status with this tool as long as I left them open. 

 

Now, moving on, let's say you want to modify the look of your site, colors/positioning/font and so on.  Great, we can do this also.

 

  1. Go to the page you wish to modify in Firefox
  2. Right click on the area you wish to change and then click Inspect
  3. At the bottom of the screen, to the right, you will see the css of the page.
  4. Go ahead and begin to experiment.  All changes will happen on the page, please take notes of any/all changes you are happy with.
  5. Follow the above steps for installing a mod and upload the changed files to the server.
  6. Check your site.

Please note, the only time you should ever close a Notepad++ file is when you are 100% sure that all changes have been successful and ALL parts of your site are functioning.  While a mod can be installed in a few minutes, if you are truly conscientious of your work, you will spend at least 2 hours playing on the site to test ALL parts of the site to make sure they working correctly.  I know we get in a hurry to finish and neglect this part, but this is the only way to know if what your doing is going to work and not effect other parts of the site in a negative way.

As far as the tools list goes, others will use different tools, but still the same tool in essence of what it does.  For me, these tools work wonders and provide the results I want every time.  Notice, I DO NOT use Dreamweaver to modify a dolphin site.  No particular reason for me, just never have liked it myself.

 

**OH yeah, when I say copy ALL SITE FILES, I mean, all site files including your members' media files. 

 

Good luck and have fun modifying your sites!

 
Comments
·Oldest
·Top
Please login to post a comment.
nix1602
Thanks MD I somehow us different program and set up but your blog is very helpful, thanks for the post. very helpful
mydatery
Thanks nix, would love to know which tools you use when modding/editing the site files. The more information people have the better choices they can make on what works best for them.
nix1602
I use Firefox and Firebug, I use Textpad for text editing, just used to it, but I decided to check Notepad++. I also use Filezilla for FTP because I have several sites, other than the Dolphin ones and I am just use to it
LightWolf
I use Top Dawg Html editor, and Filezilla ftp, also use notepad for my files.
deano92964
Nice information. Hopefully your message on the importance of backups will be taken seriously.

I also use firefox with firebug.
Instead of Notepad++ I use EditPlus. Very similar to each other.

For FTP i use WS_FTP. I like it because i can tell it which file extension to treat as ascii or binary during transfer.

However i might take a look at your client. Sounds like it has better features.
mydatery
I like WinSCP Dean because it has the Binary transfer option, side by side computer/server file lists, drag and drop transfers, SSH included inside of it and so on.

Never tried WS_FTP so I can't comment as to which is better.
DeeEmm
FireFTP - then everything is integrated into Firefox.
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.
PET:0.05708909034729