Location : Web Hosting - Web Hosting Knowledge Base - phpBB Tutorial

manually install phpBB MODs Tutorial

There is nothing better than installing things manually, you get the chances of understanding the in and out of the entire process and what files are added and changed, this is going to help a lot when it comes to debugging an error, but installing programs manually generally requires some technical knowledge to handle files in the hosting server, and does takes longer time to apply any new updates, for people that prefer a more automated way for installing MODs, you can choose to install phpbb MODs using EasyMOD.

NOTE: Before doing anything, backup your database and phpbb program folder, do not skip this step otherwise you risk loosing your phpbb forum if there is anything wrong in the MOD installation process. Disable your forum board before making the backup to avoid missing any data in he backups.

NOTE: Install the MOD in an identical test forum board before attempt to install in your live phpbb forum, this can avoid problem caused by the MOD installation to your live forum if there is any, note that MODs are member contributed codes and there are possibilities that different MODs installed in the forum may have compatibility issues. Install on a test forum can avoid messing up your live forum board in case there are any issues.

Installing mod manually require understanding on the standard form define for mods installation, this instruction is usually found in the install.txt in the MODs compressed file, this file follow the standard guide lines set by phpbb as to what are to be done in order to install the MOD to a phpbb forum, below explain the standard guide lines :-

"COPY" action :

If you notice there are instruction below this line, that means you will need to copy the files as stated in it, for example :-

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

This means you need to copy the file.php found in the expanded MODs folder in your PC to the phpbb root folder in your hosting account, and the file.tpl in to the templates/subsilver/ folder.

"OPEN" action :

This is a simple instruction to open the file in a text editor, for example :-

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

This instruction is straight forward, just open the file common.php using a text editor (notepad, wordpad etc.).

"FIND" action :

This is yet another simple instruction to find the line specified in the opened file, for example :-

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

Find the line (around line 184) in the file just opened (common.php), place your cursor there.

"BEFORE ADD" action :

after placing the cursor at the line specified in above instruction, insert the following text before the found line, for example below is the "BEFORE ADD" instruction :-

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

After executing the above instruction, the end result will look like below :-

include($phpbb_root_path . 'attach_mod/attachment_mod.'.$phpEx);
//
// Show 'Board is disabled' message if needed.
//

"AFTER ADD" action :

This is similar to the "BEFORE ADD" action, just that this round the text is added AFTER the found line, for example, below is the "AFTER ADD" instruction :-

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

After apply above instruction, the result should look like this :-

//
// Show 'Board is disabled' message if needed.
//
include($phpbb_root_path . 'attach_mod/attachment_mod.'.$phpEx);

"REPLACE WITH" action :

This action is always associated with the "FIND" action, where you will replace the text found with the given text in this section, for example :-

#
#-----[ REPLACE WITH ]------------------------------------------
#
<

NOTE: You have to be careful not to replace anything that is needed by other MODs (that is why test installing in an identical test environment is always recommended)

following example shows that we have follow the "FIND" action to locate the line, and then follow the "REPLACE WITH" action to replace the line with the given line :-

#
#-----[ 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 the example, we have follow the instruction to locate the line :-

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

and replace with the following line

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

and the end result in the program file will be

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

"IN-LINE FIND" action

This action is similar to "FIND" action, but slightly different, "FIND" action finds an entire line in the file, whereas "IN-LINE FIND" look for certain piece of text within a line, "IN-LINE FIND" is generally associated wth the "FIND" action, for example :-

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

above code is seen below the "FIND" action, see below :-

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

Above action instruct to look for the piece of code listed below the "IN-LINE FIND" section in the line found in the "FIND" action.

"IN-LINE AFTER, ADD" action

This action is generally associated with the "IN-LINE FIND" action, where you are instructed to add the given piece of code AFTER the text found in the 'IN-LINE FIND" action, for example :-

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

above code instruct to add a piece of code after the "IN-LINE FIND" action, see below for a more complete flow of the action :-

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
t.topic_desc,
#
#-----[ 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,

Above action instruct to look for the line in "FIND" action, then locate the piece of code listed under the "IN-LINE FIND" section, and then append the piece of code listed below the "IN-LINE AFTER, ADD" action. The end result will look like :-

$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" : '';

"IN-LINE BEFORE, ADD" action

This action is similar to the "IN-LINE AFTER, ADD" action, but instead of appending the piece of code to the back of the found text, this action instruct to prepend the piece of code to the found text, which means inserting the piece of code before the text found. For example :-

$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" : '';
#
#-----[ 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,

The end result from above code will look like this :-

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);

"INCREMENT" action

The INCREMENT action is used to add or subtract numbers. This is usually used for changing colspans or rowspans in templates.

#
#-----[ FIND ]------------------------------------------
#
Powered by <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB</a> © 2001, {%:1} phpBB Group
{TRANSLATION_INFO}</span></div>
#
#-----[ INCREMENT ]-------------------------------------
#
%:1 +10

The INCREMENT action has to be associated with a "FIND" or an "IN-LINE FIND"action, the number needed to be add or subtract must be replaced with {%:1}. If there are multiple numbers within the line require to add or subtract, use {%:2}, {%:3}, and so on.

In the INCREMENT action, the values to be added of subtracted from the number found in the "FIND" action are specified . For add, a "+" is used and "-" for subtract. With nothing specified, it will default to "+1". Below are some examples :-

#
#-----[ INCREMENT ]-------------------------------------
#
%:1

#
#-----[ INCREMENT ]-------------------------------------
#
%:2 -3

#
#-----[ INCREMENT ]-------------------------------------
#
%:3 +5

"SQL" action

This action instruct to execute a mysql statement, you can do this via phpMyAdmin, or enter it directly in the MySQL shell

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

NOTE: don't forget to backup your database before making any changes, otherwise you risk loosing your database should anything bad happen.

"DIY INSTRUCTIONS" action

This action requires the admin to manually make the changes, this is generally related to setting of file permissions or any other task that needs to be done manually.

#
#-----[ DIY INSTRUCTIONS ]------------------------------------------
#
CHMOD foo.php and bar.php to 777
Open in your web browser and follow the instructions in db_install.php

"SAVE/CLOSE ALL FILES" action

This action simply means that the modification is completed and you should save and close all files. You should check through everything in your phpbb forum to ensure they are working as expected before allowing your member to enter the forum.