Advertisement:

Author Topic: How do I modify files?  (Read 105163 times)

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
How do I modify files?
« on: January 12, 2005, 06:55:29 AM »
If you've been linked to this topic, you've probably asked if something can be changed, found a bug, or are being presented with a small tweak.

What follows should be a list of files to open, what to look for, and what to add or replace to what you find.  To do this, you'll need a text editor of some sort.  Notepad will work, but won't give you line numbers and a few other things - other editors include ConTEXT, Crimson Editor, and EditPad.

Once you have a text editor, you'll need to get to the files.  This means using FTP to download the file in question, opening it with whatever text editor you wish to use, making the changes, and then uploading it again.

Sometimes, we may leave off common paths to files.  Here's a list of some of them:
  - Admin.php, QueryString.php, etc. (files ending in .php) are usually in Sources/.
  - Something.template.php or similar is usually found in your theme's directory - for example, Themes/converted or Themes/yourtheme.  However, it's usually a bad idea to modify the default theme... instead, you should make a copy of the file and then upload the modified file to that folder.
  - Something.english.php (or any other language) should be in Themes/default/languages.

As to the changes themselves, usually they will be either "find" and "replace" (meaning, find a block of code and replace it with another block..) or "find" and add above/below/after/before.  In the latter case, you should just add the code block to said position relative to the code to find, on a separate line.  For example, if someone said you should find:

Code: [Select]
Line 1
And add after that line:

Code: [Select]
Line 2
The result should be two separate lines, like so:

Code: [Select]
Line 1
Line 2

If you're not comfortable with modifying files directly, you may wish to ask someone to do it for you, or request a package be made for use with the package manager.  Often such things take much more time, however.

Importantly, whenever modifying files, always - and I do mean always - make backups.  You don't know what could cause problems with your forum and, as much as you might want a change, your forum at least working would probably be better than no forum at all.

-[Unknown]
« Last Edit: January 22, 2005, 02:04:50 PM by [Unknown] »

Offline loudog

  • Jr. Member
  • **
  • Posts: 230
  • Gender: Male
    • The Diecast Diner
Re: How do I modify files?
« Reply #1 on: March 19, 2005, 10:18:43 AM »
Thanks Unknown :). What I've been doing, is saving them as HTML, then opening them in FP. Then when I'm done, I save it via php. I'll look at these other programs as an alternative.

Offline binary

  • Semi-Newbie
  • *
  • Posts: 32
  • Gender: Male
    • Net-Force
Re: How do I modify files?
« Reply #2 on: July 14, 2005, 01:41:00 PM »
thanks unknown, you have helped out a lot


Not even in /Dev/Null/ no one can hear u scream.Join Net-force For all your Security Needs, click here to enter

Offline David_Q

  • Newbie
  • *
  • Posts: 4
Re: How do I modify files?
« Reply #3 on: September 25, 2005, 04:10:57 AM »
Ok, but will this action solve my problem upgrading to PHP 4.4.0 or what? I have followed above mentioned tips and the forum seems to run fine but i cant upgrade to PHP 4.4.0... :(

Offline xenovanis

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,988
  • Gender: Female
    • Taxibalk
Re: How do I modify files?
« Reply #4 on: September 25, 2005, 04:34:48 AM »
Ok, but will this action solve my problem upgrading to PHP 4.4.0 or what? I have followed above mentioned tips and the forum seems to run fine but i cant upgrade to PHP 4.4.0... :(

David Q,

This is just a link to give you some advise on how to modify files. What you need to do is:

http://www.simplemachines.org/community/index.php?topic=50478.0

So your forum will run with PHP 4.4.0.
"An idiot could find that code. The cancellation code. And he'd keep on typing, keep on fighting. Anything to save his friends."

Offline morningwood

  • Newbie
  • *
  • Posts: 1
Re: How do I modify files?
« Reply #5 on: October 18, 2005, 01:12:51 AM »
Also I use Putty to log into my server and then use 'vi' (linux) to edit files..

Works great for me.

Offline That70sHeidi

  • Newbie
  • *
  • Posts: 3
Re: How do I modify files?
« Reply #6 on: November 30, 2005, 04:55:03 PM »
sorry, wrong place. but thanks anyway, this WAS helpful ;)

Offline Leipe Po

  • Sr. Member
  • ****
  • Posts: 700
  • Gender: Male
  • Bookmark Mod 1.0
    • PhpScripters(under construction)
Re: How do I modify files?
« Reply #7 on: November 30, 2005, 05:37:43 PM »
Quote
Importantly, whenever modifying files, always - and I do mean always - make backups.  You don't know what could cause problems with your forum and, as much as you might want a change, your forum at least working would probably be better than no forum at all.

*does that also apply to me?*  :P

http://www.phpscripters.net  :o
There is only one thing more importend to me then coding:
My Girlfriend

Microsoft - "You've got questions.  We've got dancing paperclips."

Offline NarrativeKnight

  • Semi-Newbie
  • *
  • Posts: 14
  • Gender: Male
Re: How do I modify files?
« Reply #8 on: December 30, 2005, 10:47:49 AM »
I have never had a board at all before in my life.  Where are the files at that I want to modify for doing the upgrade that makes my board compatible with 4.4.0 and if I am directly modifying them then why do I need to upload changes?  Do I need to upload changes and if so how?

Timothy

Offline Syrinx

  • Newbie
  • *
  • Posts: 5
Re: How do I modify files?
« Reply #9 on: February 21, 2006, 12:15:55 AM »
What follows should be a list of files to open, what to look for, and what to add or replace to what you find.  To do this, you'll need a text editor of some sort.  Notepad will work, but won't give you line numbers and a few other things - other editors include hxxp:www.context.cx/ [nonactive], hxxp:www.crimsoneditor.com/ [nonactive], and hxxp:www.editpadpro.com/index.html [nonactive].

One more to add to the list, is hxxp:notepad-plus.sourceforge.net/uk/site.htm [nonactive].  This is the one that I always use, and it includes line numbers and a tabbed workspace.

Offline Webrunner

  • Full Member
  • ***
  • Posts: 525
  • Gender: Male
    • Vrouwenpower
Re: How do I modify files?
« Reply #10 on: February 23, 2006, 05:28:17 AM »
I would like to recommend PSPAD. Of all the hundreds of editors i have tried this is by far the best one. It has loads of handy tools and features, is fast and most important, completely free!

Give it a try!

BTW. i am in no way related to this programm.
There is a difference between knowing the path and walking the path.

=========================================
Vrouwen Power! | Sprintweb: No nonsense e-Business consultancy

Offline Mr. Khan

  • Jr. Member
  • **
  • Posts: 115
  • Gender: Male
  • The Future Champ!
    • Religionism
Re: How do I modify files?
« Reply #11 on: November 16, 2007, 08:12:50 PM »
thnx



Offline nick09

  • Full Member
  • ***
  • Posts: 429
Re: How do I modify files?
« Reply #12 on: November 16, 2007, 08:21:47 PM »
Notepad++

is the best program i have seen so far

you can test your files on a browser.

many different coding languages including XML.

you should try it. ;)

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 23,004
  • Master of BBC Abuse
Re: How do I modify files?
« Reply #13 on: November 23, 2007, 06:26:38 AM »
I would like to recommend PSPAD. Of all the hundreds of editors i have tried this is by far the best one. It has loads of handy tools and features, is fast and most important, completely free!

Give it a try!

BTW. i am in no way related to this programm.
Ok, sounds good but for a beginner would it have so many functions a to be confusing?
Would something simpler be easier to use, or is the operating system easy to get the hang of for basics?

ETA: Ok, I bit the bullet and installed it. Now I just have to learn how to use it.
Should be more fun than a barrel of monkeys. Expect more stoopid questions.  :D
« Last Edit: November 24, 2007, 01:33:47 AM by antechinus »
Mods - Manky Old Themes - Apocalypse theme (WIP)

Quote
(11:43:45 AM) Antechinus: of course, it's also possible that I'm an arrogant know it all bastard
(11:43:59 AM) Eliana Tamerin: you are :P
(11:44:21 AM) Antechinus: hmmph

Offline depo23

  • Newbie
  • *
  • Posts: 1
Re: How do I modify files?
« Reply #14 on: March 09, 2008, 06:38:24 AM »
NotePade++

Offline MF30

  • Jr. Member
  • **
  • Posts: 119
    • Futebol Tuga
Re: How do I modify files?
« Reply #15 on: July 07, 2009, 07:01:08 PM »
Thanks Unknown.

Offline seojoe

  • Semi-Newbie
  • *
  • Posts: 41
Re: How do I modify files?
« Reply #16 on: August 28, 2010, 02:19:11 PM »
can this mod be made to prevent posts by a certain user with links? for example, i have rss feeder. i would like to create a user that is strickly used to post the rss feeds but block any posts that have urls in them in order to prevent ads on my forum. basically i am trying to have auto content generation with auto advertising/link posting prevention as well. doesnt seem to be a mod that does this and since i am not a programmer i am trying to find mods that could achieve thisby using the multiple mod functions together. please advise.

Offline ivan91tran

  • Newbie
  • *
  • Posts: 6
Re: How do I modify files?
« Reply #17 on: October 12, 2010, 01:04:45 PM »
Thanks that was very helpful. I followed your exact instructions, but I couldn't get it right initially. I was using Text editor on my mac (which is far better than notepad in my opinion), but I then realized I had the 'rich text' option enabled :(, so there was a whole load of background code that messed everything up! I could have just gone back to plain text, but I decided to use EditPad as the OP suggested. Worked like a charm, thanks a lot.

Offline impreza

  • Sophist Member
  • *****
  • Posts: 1,041
    • Open Artykuły i Porady
Re: How do I modify files?
« Reply #18 on: October 17, 2010, 04:46:28 PM »
hi  The problem with the modem bad addresses sitemap

http://www.simplemachines.org/community/index.php?topic=405232.new#new

Help

Offline impreza

  • Sophist Member
  • *****
  • Posts: 1,041
    • Open Artykuły i Porady
Re: How do I modify files?
« Reply #19 on: October 19, 2010, 06:42:15 AM »
in sitemap.template.php  code - edit = work