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
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
- 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
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
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
This action is, again, always used with the "FIND" action
- Code: Select all
#
#-----[ IN LINE FIND ]------------------------------------------
#
t.topic_title,
Like it's a little hard to understand like this, i give you a example
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
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
11) The "SAVE/CLOSE ALL FILES" action :
This is the last action
But don't forget : before all, backup your files and your database.
I hope this tutorial will help you
If you have any suggestions/request/problems with this tutorial, this topic is for you.
Bye.
ps : maybe someone can stick this tutorial
