PHP Bulletin Board Home
News About Home
Features of phpBB Test drive phpBB Downloads Support for phpBB The phpBB Community Styles for customising phpBB 3rd party modifications to phpBB

Support Home | Knowledge Base Home | Submit Article | Search Articles | Browse Articles
 How to Install MODs 
Description: These guide tells you what each action in the MOD Template means, helping you install MODs
Author: morpheus2matrix
Date: Wed Oct 29, 2003 2:09 am
Type: HowTo
Keywords: MODs, installing, help, actions
Category: MODifications
The first thing to do before all, is to backup your files and your database.


First download the MOD. Then open the install file of the MOD (usually a .txt or .mod file) and follow its instructions.

1) The "COPY" action :

If in a MOD, you see something like that :
Code:

#
#-----[ COPY ]------------------------------------------
#
copy file.php to file.php
copy file.tpl to templates/subSilver/file.tpl


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 editing them.


2) The "OPEN" action :

This is the first basic action to do :
Code:

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


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


3) The "FIND" action :

After the "OPEN" action, this is the most commonly used because you have to find something before you can do anything in the file.
Code:

#
#-----[ 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 then do any actions on or around that line that come after it.


4) The "BEFORE ADD" action :

In the install file, you should see :
Code:

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


so, after you hav find the code in a previous action, you add before what the MOD says to add. In my example, the result will be :
Code:

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:

#
#-----[ 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 you have to find, you have to add it after

Example :

Code:

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 "REPLACE WITH" action :

Code:

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


This action is always used with the "FIND" action. You have to find a section of code to replace it with.
But you have to be careful with this action if you have others MOD's installed on your forum.

It is recommended that you try not to use this action. Use In-line actions intead.

Example :

Code:

#
#-----[ 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:

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


and replace it with (This will be in my modded file) :
Code:

<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:

<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", "IN-LINE BEFORE, ADD", and the "IN-LINE REPLACE WITH" actions These are explained later on), the best action to use by the MOD's authors (i think that but it's just my opinion Rolling Eyes ).
This action is, again, always used with the "FIND" action Wink

Code:

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


It's a little hard to understand like this, I'll give you an example.

Code:

#
#-----[ 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 look for the section that is in the FIND action and then you find the code in the IN-LINE section within the piece of code you found earlier.

8 ) The "IN-LINE AFTER, ADD" action :

Looks like this :
Code:

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


In fact, it's a better way to use the "REPLACE" 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:

#
#-----[ 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_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 for some code :
Code:

t.topic_title,


and to add directly after :
Code:

t.topic_desc,


so your line will become (modded line) :
Code:

$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 to add the code before what you have to search instead of after.
Code:

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


Example :
Code:

#
#-----[ 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:

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 find :
Code:

$poll_length)


and to add directly before :
Code:

$topic_desc,


so your line will become (modded line) :
Code:

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 fields, adding tables, altering tables, etc).

Code:

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


This means you execute the queries that are in this action. The easiest way to execute these is using a program like phpMyAdmin.


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

This is the last action Very Happy. Once you have done all your modifications, save and close your files, then upload them to your site. Check your forum to make sure you have made the Modifications correctly. If you have made a mistake double check to make sure you have installed it correctly.


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

wGEric fixed grammar and updated it to fit the MOD Template

Username: Password:
News | Features | Demo | Downloads | Support | Community | Styles | Mods | Links | Merchandise | About | Home
 © Copyright 2002 The phpBB Group.