[Tutorial] How to install a MOD

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

[Tutorial] How to install a MOD

Postby morpheus2matrix » Sun Dec 15, 2002 9:43 pm

Like i've seen a lot of post asking "how to install a MOD", i've decided to make this little tutorial, which is not perfect but which will, i hope, help you to install your MOD.
I've used the Attachment MOD install file and the topic description MOD install file to do this tutorial, but it's the same thing for all the MOD's.

Let's go :wink:


The first thing to do before all, is to backup your files and your database.
Then, open the install file of the MOD and see what is written (it's depend of the MOD you are trying to install) :

1) The "COPY" action :

If in a MOD, you see something like that :

Code: Select all

#
#-----[ COPY ]------------------------------------------
#
file.php -> phpBB/
file.tpl -> phpBB/templates/subSilver/


This just mean that you have to upload the file "file.php" into the phpBB root dir, and the file "file.tpl" into the template directory, directly without modify them.


2) The "OPEN" action :

This is the first basic action to do :

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
common.php


Not hard to do : open the specify file into a text editor (notepad, wordpad, editplus,......)


3) The "FIND" action :

After the "OPEN" action, it's the most used :wink:

Code: Select all

#
#-----[ FIND ]------------------------------------------
# around line 184
//
// Show 'Board is disabled' message if needed.
//


After you have opened a file in your text edit editor, search for what the MOD say to search :wink:


4) The "BEFORE ADD" action :

In the install file, you should see :

Code: Select all

#
#-----[ BEFORE, ADD ]--------------------------------------
#
include($phpbb_root_path . 'attach_mod/attachment_mod.'.$phpEx);


so, after you hav find the code to search, add before what the MOD say to add. In my example, the result will be :

Code: Select all

include($phpbb_root_path . 'attach_mod/attachment_mod.'.$phpEx); // -> Test to add before

//
// Show 'Board is disabled' message if needed. -> Text to search
//



5) The "AFTER ADD" action :

Code: Select all

#
#-----[ AFTER, ADD ]------------------------------------------
#
include($phpbb_root_path . 'attach_mod/attachment_mod.'.$phpEx);


It's the same thing of the "BEFORE" action, but instead of adding your code before the text to search, you have to add it [u}after[/u]

Example :

Code: Select all

include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/' . $lang_file . '.' . $phpEx); // -> Text to search
include($phpbb_root_path . 'attach_mod/attachment_mod.'.$phpEx); // -> Test to add after



6) The "REMPLACE WITH" action :

Code: Select all

#
#-----[ REPLACE WITH ]------------------------------------------
#
<form action="{S_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this)" {S_FORM_ENCTYPE}>


This action is always (like this others :P ) used with the "FIND" action. I mean : you have a code to search, then the code to used instead of the previous code.
But you have to be careful with this action if you have others MOD's installed on your forum.

Example :

Code: Select all

#
#-----[ FIND ]---------------------------------------------
# around line 225
<form action="{S_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this)">

#
#-----[ REPLACE WITH ]---------------------------------------
#
<form action="{S_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this)" {S_FORM_ENCTYPE}>



In this example, i have to search for (This is in my original file) :

Code: Select all

<form action="{S_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this)">



and to remplace by (This will be in my modded file) :

Code: Select all

<form action="{S_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this)" {S_FORM_ENCTYPE}>


so, in my modded file, i will have :

Code: Select all

<form action="{S_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this)" {S_FORM_ENCTYPE}>



7) The "IN-LINE FIND" action :

This is, with the "IN-LINE AFTER, ADD" and "IN-LINE BEFORE, ADD" actions (see the next actions), the best action to use by the MOD's authors (i think that but it's just my opinion :roll: ).
This action is, again, always used with the "FIND" action :wink:

Code: Select all

#
#-----[ IN LINE FIND ]------------------------------------------
#
t.topic_title,


Like it's a little hard to understand like this, i give you a example :wink:

Example :

Code: Select all

#
#-----[ FIND ]------------------------------------------
#
$select_sql = ( !$submit ) ? ", t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, pt.post_subject, pt.post_text, pt.bbcode_uid, u.username, u.user_id, u.user_sig" : '';
#
#-----[ IN LINE FIND ]------------------------------------------
#
t.topic_title,


You have just to search for " t.topic_title, " and to prepare you for the action which will arrive :wink:


8 ) The "IN LINE AFTER ADD" action :

Looks like this :

Code: Select all

#
#-----[ IN LINE AFTER ADD ]------------------------------------------
#
t.topic_desc,


In fact, it's a better way to use the "REMPLACE" action (in the case that you have others MOD's installed)
This action is used with the "FIND" action and the "IN LINE FIND" action.

Example :

Code: Select all

#
#-----[ FIND ]------------------------------------------
#
$select_sql = ( !$submit ) ? ", t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, pt.post_subject, pt.post_text, pt.bbcode_uid, u.username, u.user_id, u.user_sig" : '';
#
#-----[ IN LINE FIND ]------------------------------------------
#
t.topic_title,
#
#-----[ IN LINE AFTER ADD ]------------------------------------------
#
t.topic_desc,


Here, you have to search for an entire line (original line) :

Code: Select all

$select_sql = ( !$submit ) ? ", t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, pt.post_subject, pt.post_text, pt.bbcode_uid, u.username, u.user_id, u.user_sig" : '';


in this line, you have to search something :

Code: Select all

t.topic_title,


and to add that, directly after :

Code: Select all

t.topic_desc,


so your line will become (modded line) :

Code: Select all

$select_sql = ( !$submit ) ? ", t.topic_title, t.topic_desc, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, pt.post_subject, pt.post_text, pt.bbcode_uid, u.username, u.user_id, u.user_sig" : '';



9) The "IN LINE BEFORE ADD" action :

It's the same thing that the "IN LINE AFTER ADD" action but you have just to add the code before what you have to search instead of after.

Code: Select all

#
#-----[ IN LINE BEFORE, ADD ]------------------------------------------
#
, $topic_desc


Example :

Code: Select all

#
#-----[ FIND ]------------------------------------------
#
prepare_post($mode, $post_data, $bbcode_on, $html_on, $smilies_on, $error_msg, $username, $bbcode_uid, $subject, $message, $poll_title, $poll_options, $poll_length);
#
#-----[ IN LINE FIND ]------------------------------------------
#
$poll_length)
#
#-----[ IN LINE BEFORE, ADD ]------------------------------------------
#
$topic_desc,


You have to search for an entire line (original line) :

Code: Select all

prepare_post($mode, $post_data, $bbcode_on, $html_on, $smilies_on, $error_msg, $username, $bbcode_uid, $subject, $message, $poll_title, $poll_options, $poll_length);


in this line, you have to search :

Code: Select all

$poll_length)


and to add that, directly before :

Code: Select all

$topic_desc,


so your line will become (modded line) :

Code: Select all

prepare_post($mode, $post_data, $bbcode_on, $html_on, $smilies_on, $error_msg, $username, $bbcode_uid, $subject, $message, $poll_title, $poll_options, $topic_desc, $poll_length);



10 ) The "SQL" action :

This is the action to do for altering the database(adding a fiels, a table,...).

Code: Select all

#
#-----[ SQL ]------------------------------------------
#
ALTER TABLE phpbb_topics ADD topic_desc varchar(255) DEFAULT '' AFTER topic_title


The best way for you to do this action is to use a basic management tool of database via Internet, like phpMyadmin

Once you have installed phpMyadmin, it's simple :

go into it, clic on the name of your database on the left. On the right, you will see a blank textarea : copy and paste the SQL query to do into this area, then clic on "Execute" and see the result :wink:


11) The "SAVE/CLOSE ALL FILES" action :

This is the last action :D. Once you have done all your modifications, save and close your files, thn upload tem onto your ftp server and go in your forum : see the result of your job :wink:




But don't forget : before all, backup your files and your database.



I hope this tutorial will help you :D


If you have any suggestions/request/problems with this tutorial, this topic is for you.



Bye.



ps : maybe someone can stick this tutorial :wink:
Last edited by morpheus2matrix on Mon Dec 16, 2002 3:14 pm, edited 1 time in total.
Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:

User avatar
ZoliveR
Former Team Member
Posts: 11899
Joined: Sun Jul 14, 2002 7:36 pm
Location: floating in the light, never forgotten
Contact:

Postby ZoliveR » Sun Dec 15, 2002 9:45 pm

Good idea for stick-it. ;)
No more Team Chocolate Member. I decided to leave, it's my choice. Thanks to all for all these years.
I'm always near if you need news of me. But no more support is given (private notification disabled)

User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

Postby morpheus2matrix » Sun Dec 15, 2002 9:46 pm

ZoliveR wrote:Good idea for stick-it. ;)


i fink same thing :wink: :P
Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:

Rine
Registered User
Posts: 27
Joined: Thu Nov 28, 2002 10:05 am

Postby Rine » Mon Dec 16, 2002 12:01 pm

it would also like to note this:

It's rather hard (much work) to always copy paste things with a normal text editor like wordpad.

I recommend using a script editor like Crimson editor to easily alter the different files.

User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

Postby morpheus2matrix » Mon Dec 16, 2002 1:05 pm

there is a lot of text editor : i've talked about notepad and wordpad only because they are with Windows :wink:

But you can choose the one you want :wink:
Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:

Rine
Registered User
Posts: 27
Joined: Thu Nov 28, 2002 10:05 am

Postby Rine » Mon Dec 16, 2002 1:45 pm

u think it would be usefull to give some extra explanation on the database thing and how to upgrade tables and so on?
If yes, i'm willing to create it

User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

Postby morpheus2matrix » Mon Dec 16, 2002 3:15 pm

it could be a good idea :wink:
Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:

User avatar
spacefem
Registered User
Posts: 63
Joined: Sun Dec 22, 2002 1:06 am
Contact:

Postby spacefem » Wed Jan 08, 2003 3:27 am

you know, it'd be nice if there was a link to this thread on http://www.phpbb.com/mods/faq.php or somewhere similar. I felt equally clueless about all this, wasn't sure if I was supposed to install something or what, and hate to think what I would have done if this thread were hidden away more somewhere.

Anyway, thanks a lot for writing this tutorial morpheus!

User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

Postby morpheus2matrix » Wed Jan 08, 2003 8:14 am

spacefem wrote:you know, it'd be nice if there was a link to this thread on http://www.phpbb.com/mods/faq.php or somewhere similar.
(/quote]

i know this, but i can't do it :wink:

Anyway, thanks a lot for writing this tutorial morpheus!


no problem :P
Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:

User avatar
phpbbiLLiterate
Registered User
Posts: 68
Joined: Sun Dec 29, 2002 5:57 am
Location: Support Forum

Postby phpbbiLLiterate » Sat Jan 18, 2003 5:49 pm

i dont get this....if it says before add u add it after?

User avatar
phpbbiLLiterate
Registered User
Posts: 68
Joined: Sun Dec 29, 2002 5:57 am
Location: Support Forum

Postby phpbbiLLiterate » Sat Jan 18, 2003 6:07 pm

why when i do the hacks they never work?

User avatar
ZoliveR
Former Team Member
Posts: 11899
Joined: Sun Jul 14, 2002 7:36 pm
Location: floating in the light, never forgotten
Contact:

Postby ZoliveR » Sat Jan 18, 2003 10:34 pm

First, it's called "mods". Please forget the "hack" terminology.
Secundo, please explain what do you can't do.
No more Team Chocolate Member. I decided to leave, it's my choice. Thanks to all for all these years.
I'm always near if you need news of me. But no more support is given (private notification disabled)

User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

Postby morpheus2matrix » Sat Jan 18, 2003 11:31 pm

yes, i don't understand your problem :roll:
Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:

User avatar
monkey46219
Registered User
Posts: 192
Joined: Fri Feb 28, 2003 8:22 pm
Location: Indiana
Contact:

Postby monkey46219 » Sat Mar 01, 2003 8:41 pm

I have downloaded the change_logo chat and PM_hack/MOD how do iput these on my forum and where please reply ASAP

User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

Postby morpheus2matrix » Sun Mar 02, 2003 11:06 am

just open the install file with a text editor, then follow the instructions : use my tutorial to help you
Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:


Return to “[2.0.x] MODs in Development”

Who is online

Users browsing this forum: No registered users and 4 guests