[Tutorial] How to install a MODX modification

Discussion forum for MOD Writers regarding MOD Development.
User avatar
battye
Extension Customisations
Extension Customisations
Posts: 11051
Joined: Wed Feb 11, 2004 11:02 am
Location: Australia

[Tutorial] How to install a MODX modification

Post by battye »

How to install a MODX modification
By battye - January 26, 2008

Installing a MOD for the first time can be quite a daunting task. At some point, we all had to take the plunge, and chances are most of us at some point made a mistake. Installing MOD's soon becomes second nature though, and this simple tutorial should hopefully help guide you through the process.

Before proceeding through this tutorial, it is best that you acquaint yourself with the MOD actions. There is a detailed document explaining this at http://www.phpbb.com/mods/installing/ and a knowledge base explaining each action in detail at http://www.phpbb.com/kb/article/how-to-install-mods/




INSTALLING MODX MODIFICATIONS

Here, I hope to explain the basics of installing a MODX modification in a very easy-to-understand manner. The screenshots shown are from a typical Windows XP system, although it will be a similar process to Vista.


OPENING A MODX FILE

After you have downloaded and unzipped (using Winzip, Winrar or the inbuilt uncompressor in Windows) the MOD you wish to install, you will see several files and folders - to get an understanding of each one please view the packaging documentation. The file which contains the installation instructions will be called something like "install.xml". To read an xml (extensible markup language) file, you must open it in your web browser.

Firstly, right click the file, select "open with" and left click your internet browser (such as Internet Explorer or Firefox. If you are using Mac, it may be Safari).

Image




COPYING FILES

Copying files to your webserver, as I said above, is a very easy process and something you should have done when installing phpBB3. The COPY action in MODX looks like this:

Image

It asks you to move the local file (ie. the one on your computer from the package you just downloaded) root/ajax.php to ajax.php on the server. As it specifies no particular path (for instance, it does not say admin/ajax.php or includes/ajax.php) it means you must upload it to the root folder for phpBB3 on the server. phpBB3's root folder is the one that stores viewtopic.php, viewforum.php, etc, etc.

To drag the file, simply open a folder in Windows Explorer to show the local ajax.php, and open your FTP client in the background. In the FTP client - in this case it's SmartFTP - navigate to your forum root folder, and then drag ajax.php from your computer into the phpBB3 root folder on the server. Repeat this for every file it asks you to copy.

Image




EXECUTING SQL

An SQL action will look something like this:

Image

To execute these database queries, you will need to run them through a program such as phpMyAdmin. This step I have explained in great detail within this topic - [Tutorial] How to use phpMyAdmin.

In a nutshell, first navigate to the database your forum is located in, and then paste the query within the SQL tab of phpMyAdmin and execute it. Occasionally, a database file may be included with the MOD that you can simply run through your browser. It is important to read the DIY INSTRUCTIONS with the MOD to see whether or not this is the case.



OPENING A FILE

The action looks like this:

Image

You must open this file using a strict text editor. I use Notepad++ for these examples, as it is a popular open source editor among developers. Microsoft Frontpage and Dreamweaver are not text editors. It is recommended that users don't open any phpBB files in programs such as Frontpage and Dreamweaver as it could potentially destroy parts of the code, rendering it useless.

To open the file, generally it is a matter of opening the text editor, navigating to File -> Open, and browsing to the file you wish to open, and then double left clicking it.

Below the OPEN line are the actions you must perform (FIND, ADD AFTER, etc, etc).


FINDING CODE

Finding code is an easy process. Firstly, in the MODX file, click Select All. This will highlight the code you must find. Then, right click the code and select "Copy" to copy it to the clipboard on your computer. Example shown below:

Image

Once in your text editor, use the find function (usually Ctrl+F) to track down the code you were asked to FIND.

Image

Step 1: paste the code you copied into the find field.
Step 2: click Find Next.
Step 3: the code will be highlighted, and you can close the find box.


HOW TO APPLY AN ACTION

There are many different actions, but as they are much the same, I will only go through ADD BEFORE in detail. The MODX file may ask you to do this:

Image

Step 1: click Select All.
Step 2: right click and select "Copy" to copy the code to your clipboard.

Now you must apply the action. Go back to your text editor. As this is an ADD BEFORE action, you must add the code directly before the code you just found - ie. on the line directly above it.

Image

Step 1: before the code you found, right click once and select Paste.
Step 2: after doing this, the code will have been added.

That is it! It is extremely simple, after having done this you move on to your next action. Continue to apply the actions until you reach the end of the MOD file. You will know when you reach this point because you will see the following line:

Image


I hope this helped clear up any confusion you were having installing a MODX modification. If you have any questions, or would like me to go into greater detail on any part of this, please post a reply within this topic.

battye
Support Team Member

Edited/Updated RmcGirr83 03/11/2011
Customisations Team Member

https://github.com/battye/php-array-parser - Give it a Star! :D
User avatar
Dugi
Registered User
Posts: 1386
Joined: Sun May 25, 2008 5:36 pm

Re: [Tutorial] How to install a MODX modification

Post by Dugi »

thanks for the info :)
PM me for custom extension pricing / My validated MODs / My MODs in development
xsimulator.net
Registered User
Posts: 6
Joined: Thu Jan 24, 2008 9:09 pm

Re: [Tutorial] How to install a MODX modification

Post by xsimulator.net »

Thanks for sharing this it will be helpful
Hottest Mafia Game Ever http://www.themafiawar.com

Image
coolor
Registered User
Posts: 107
Joined: Sun Apr 22, 2007 7:29 am
Location: I'm in the military

Re: [Tutorial] How to install a MODX modification

Post by coolor »

EXECUTING SQL

An SQL action will look something like this:

Image

To execute these database queries, you will need to run them through a program such as phpMyAdmin. This step I have explained in great detail within this topic - [Tutorial] How to use phpMyAdmin.

In a nutshell, first navigate to the database your forum is located in, and then paste the query within the SQL tab of phpMyAdmin and execute it. Occasionally, a database file may be included with the MOD that you can simply run through your browser. It is important to read the DIY INSTRUCTIONS with the MOD to see whether or not this is the case.
Hey how to execute the sql query? exlpain me clearly. take example ;)
phpbb3 user
vb user
RS premium user
W4r3z u53r
GOOGLE user

User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean

Re: [Tutorial] How to install a MODX modification

Post by Erik Frèrejean »

Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)
User avatar
battye
Extension Customisations
Extension Customisations
Posts: 11051
Joined: Wed Feb 11, 2004 11:02 am
Location: Australia

Re: [Tutorial] How to install a MODX modification

Post by battye »

Or read the link where I said it was explained in great detail
http://www.phpbb.com/community/viewtopi ... 0&t=588697 ;)
Customisations Team Member

https://github.com/battye/php-array-parser - Give it a Star! :D
jabhawk
Registered User
Posts: 2
Joined: Wed Nov 12, 2008 5:24 pm

Re: [Tutorial] How to install a MODX modification

Post by jabhawk »

:o HELP! Newb in trouble! v3.0.2

I just setup my first board and tried to install my first MOD. I wanted the "update attachment" mod for my site and read all the guides and help on installing mods. This is a simple update of 5 files with no SQL or new files listed.

I edited the files in Notepad, uploaded them to the server, verified that they were in place and then went to the affected module to view the result. I do not see that any of the changes were applied!!

I double checked all the changes and the source files show that they are updated and should be showing something. I even added some random text to the template but that does not even show. The view that should be showing a visible change is the posting editor "styles/prosilver/template/posting_editor.html".

Is there another step to push the updated template files into production? I am getting a headache from bashing my head into my desk.

There are no other updates to the source files and it is a normal 3.0.2 installation on an internal fully patched Win2003 server; IIS, mySQL, PHP.

Jon Black
User avatar
RMcGirr83
Former Team Member
Posts: 22060
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: [Tutorial] How to install a MODX modification

Post by RMcGirr83 »

You have to go into the ACP->styles->template and refresh the style whose html file you edited.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then you can support me by buying a beer 🍺
User avatar
A_O_C
Registered User
Posts: 2383
Joined: Sun Jul 01, 2007 11:26 pm
Location: phpbb_

Re: [Tutorial] How to install a MODX modification

Post by A_O_C »

jabhawk wrote:I edited the files in Notepad
also, dont use notepad. use a free text editor. ;)
coendeurloo
Registered User
Posts: 1
Joined: Fri Nov 28, 2008 2:52 pm

Re: [Tutorial] How to install a MODX modification

Post by coendeurloo »

I'm kind of shocked to see that there is no plugin manager incorporated in the phpbb forum software. This basically makes everything extremely more difficult for people like me who have almost no knowledge on PHP...Even SMF has a plugin manager!
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Re: [Tutorial] How to install a MODX modification

Post by igorw »

We have just released the beta of our automated MOD installer "AutoMOD". Check this topic: http://www.phpbb.com/community/viewtopi ... &t=1370895
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three
User avatar
alhitary
Registered User
Posts: 868
Joined: Wed Jan 17, 2007 7:51 am
Location: ROY
Name: Bassel Taha

Re: [Tutorial] How to install a MODX modification

Post by alhitary »

I wonder How to make MODX file rtl ??
How to change it from ltr to rtl ??
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Re: [Tutorial] How to install a MODX modification

Post by igorw »

I believe it works when you select a RTL language.
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three
User avatar
alhitary
Registered User
Posts: 868
Joined: Wed Jan 17, 2007 7:51 am
Location: ROY
Name: Bassel Taha

Re: [Tutorial] How to install a MODX modification

Post by alhitary »

eviL<3 wrote:I believe it works when you select a RTL language.
When i change to RTL , the style changes in bad look. and not all writing goes to right
Can you send me latest file of MODX ??
userkiller
I've Been Banned!
Posts: 189
Joined: Sun Dec 07, 2008 5:02 am
Location: student

Re: [Tutorial] How to install a MODX modification

Post by userkiller »

when there 2 file with the same name do you add both of them
Requesting people that can develop softwares pm me.
example gaming trainers.
If you are a rpgmmo gamers pm me.

Return to “[3.0.x] MOD Writers Discussion”