So ya wanna learn how to install a MOD huh? - phpBB 3

phreakwars

Wakka Wakka Wakka
Joined
Sep 26, 2005
Messages
2,504
OK, it's been a while now since PhPBB3 has been out, PhPBB2 will be phased out by the end of this year, so it's time to update this tutorial a bit and help out those who are now using a PhPBB3 forum.

Now we are getting into things that are a tad more advanced. You don't have the benefit of an EasyMOD app to help you in PhPBB3, so much of the work is going to have to be done manually. This tutorial will cover PHPBB3,MODX & PhPMyAdmin. For the example in this tutorial, I am going to be using the MOD called "User Reputation Points 0.1.1" which can be found HERE: http://www.phpbb.com/community/viewtopic.php?f=70&t=780735

I chose this particular MOD because it contains alot of the key elements I wanted to cover (DISCLAIMER, THIS IS A BETA MOD, IF YOUR GONNA TRY USING THIS MOD AS WELL, KNOW THAT IT HAS NOT BEEN ACCEPTED FOR GENERAL USE YET AND IS STILL BEING DEVELOPED BY IT'S AUTHOR).

When you download and extract this MOD your gonna see 3 subfolders,the install file, the licence file and something called "modx.prosilver.en.xsl" what THAT is, is the file that makes the color scheme for the XML install file. It's not really a file you should be too concerned with. What you want, is the file called "INSTALL.XML".

So how do you read it? Just right click on it, and choose to open it with your favorite web browser. I generally use Firefox to open them, but every once in a while, firefox might not open it correctly, in which case you will need to use Internet Explorer or something else. Another thing to remember is your gonna need a code editor like CRISON EDITOR mentioned in the first tutorial on this topic.

In PhPBB2, what we were used to seeing is something like this in the install file:
PHP:
# 
#-----[ OPEN ]------------------------------------------ 
# 
language/lang_english/lang_admin.php
# 
#-----[ FIND ]------------------------------------------ 
# 
$lang['Enable_prune'] = 'Enable Forum Pruning';
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
$lang['Topics_on_index'] = 'How many topics to show in recent active topics';
# 
#-----[ OPEN ]------------------------------------------ 
#
NOW with MODX, we see something very different, the code is broken down into different sections, and the instructions are even easier then ever. So, to break down this MOD piece by piece, lets take a look at it.

Starting with our list of files to upload and modify


So, first things first, lets get the "INCLUDED FILES" where they are supposed to be, upload all the files onto your server/localhost under the corresponding locations.. for example root/reputation.php is gonna go under your root folder, the ROOT folder is the same place you will find things like "viewtopic.php, and memberlist.php"

OK, now that that minor task is out of the way, lets scroll down on the install file and find our next instruction, and that... would be the SQL


Now sometimes the MOD author might have made this job easier for you by creating an install file to run. If we are not that lucky and have to do it manually... no big deal. Lets stick to the basics, don't worry about advanced options, and get through this part with confidence.

Log in to your servers PhPMyAdmin account from your control panel, and lets take a look at what's going on.

OK, here it is, the brains of your forum, not something you wanna be messing with if you don't know what your doing, because one false move could wipe out something very important that makes your forum tick.
On the left hand side, this is a list of all the different tables that make up your forum, on the right, is our utility to add/modify these tables


What you wanna do, is run a query on your database to add the new rep systems functionality. You might be thinking to yourself "Oh I know, I'll just click the query tab and enter it from there"... Yes you COULD do that, but your gonna need to know key info to get it right (a little too advanced for this tutorial), so what you wanna do instead, is click the "SQL" tab instead, click the SELECT ALL link on the SQL instruction from your install.xml file, and this should highlight all of the SQL code you will need to copy and paste into the box in PhPMyAdmin that says: Run SQL query/queries on database phpbb3


Click the "GO" button after you have pasted this in, and we should get the following screen, we should now also see a new table called "phpbb_reputations" created in the left hand column


If you made it this far, pat yourself on the back, and lets keep going, there is much more to learn.

We made it past the SQL, now it's time to start modifying files.

Our first code instruction line, looks like this:
See that arrow I drew? That "SELECT ALL" link and all the others after should now be considered your very best friend until this mod install is complete. Clicking on it, highlights code you need to find and highlights code you need to add or replace.


So, we "OPEN VIEWTOPIC.PHP" in our code editor and do just like the instructions say... we use the FIND function, paste in
PHP:
                'viewonline'    => $row['user_allow_viewonline'],
Find it's on line 1055

We then go to the END of it, hit enter on our keyboard to start a new line, and (ADD AFTER) paste the new line(s):
PHP:
// user reputation points                
                'hidereputation'    => $row['user_hide_reputation'],
                'reputation_text'    => $row['user_reputation'],
// end user reputation points
underneath it. What we end up with, is this:



Basically, we follow that same protocol for every instruction line in every file it tells us to modify... yeah, a pain in the butt, I know... but ya gotta do what ya gotta do...

So then, what happens if you come across an instruction like this:


In-line Find? HUH?

OK, what this means, is we need to take that previous "FIND" and find a key element of something in that line and either add something to it, or modify it.
PHP:
, 'group_founder_manage'
Is shown in this example highlighted in black, our next instruction is going to be placed right after it.


So the modified line, should now look like THIS:


Once you have completed all the file edits... your still not done, this particular mod has instructions on how to add the control panel settings for the ACP at the end that you will have to follow, and IN ADDITION, you will need to upload the "reputation_body.html" files for each template into its corresponding sub folder AND follow the xml file instructions there to get this mod running on your template.

This MOD comes with the 2 basic instruction files, one for prosilver, and one for subsilver2. If you are using a theme OTHER then these 2, you will have to modify the styles for that theme as well.

Basically, most styles will run under 2 types of coding. Prosilver, or subsilver2, you might need to check with your styles author to find out what his theme is based off of to know which .xml file instructions you should use.

But, like I have said before, PRACTICE PRACTICE PRACTICE on a local version of your forum first.

And LAST BUT NOT LEAST, ALWAYS PURGE THE CACHE in the ACP before you go to see if the changes you made worked. If you don't do that, you'll be looking at your forum and thinking "HEY, I DID ALL THE FILE MODS... WHERE IS MY NEW MOD AT"

Purge the cache, make a few adjustments in the ACP to turn it on, and you should end up with something like this, A NEW REP SYSTEM FOR PHPBB3 !!:


.
.
 
Last edited:

Alex.

The Ancient Dragon
Joined
Jul 1, 2007
Messages
11,579
Eric, would you like for me to split the phpBB2 and phpBB3 tutorials and sticky them both?
 

phreakwars

Wakka Wakka Wakka
Joined
Sep 26, 2005
Messages
2,504
Yes, I think that would probably simplify things a bit, thanks.
.
.
 

TDM6046

Neophyte
Joined
Aug 20, 2008
Messages
1
Thank you so much, phreakwars, for writing this tutorial! I'm new to phpBB and just started a few days ago. I had been trying to install a portal and epically failed to the point that I had to reinstall phpBB.

Thanks to you and your tutorial, though, I have sucessfully installed it and I have most of my hair left.
:jiggy: :tup:
 

phreakwars

Wakka Wakka Wakka
Joined
Sep 26, 2005
Messages
2,504
Glad I could be of some assistance... kinda hard to explain the full process without confusing some people, but once you get it down, it's almost like child's play.
.
.
 

Cadet

Hitler loved his banjo
Joined
Aug 13, 2008
Messages
852
Where is this "phpmyadmin" and how do I get to it? :( I'm momentarily down with a SQL error and I have no idea how to fix this issue without getting at that. Can I fix it from my Lunarpages CP?

EDIT: I found it, and ran through the query, but I'm still getting this error message:

General Error
SQL ERROR [ mysql4 ]

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3 [1064]

SQL

SELECT group_reputation_power FROM phpbb_groups WHERE group_id =

BACKTRACE

FILE: includes/db/mysql.php
LINE: 158
CALL: dbal_mysql->sql_error()

FILE: includes/functions_reputation.php
LINE: 61
CALL: dbal_mysql->sql_query()

FILE: viewtopic.php
LINE: 588
CALL: get_rep_power()


... :(

How do I fix it? I did everything as I was supposed to. If this a problem with the coding I did, or have I missed something?


EDIT: Restored backup files, and now I get this:

Fatal error: Call to a member function on a non-object in /home/mtgda0/public_html/forums/index.php on line 24

WTF? ?!?!?!?
 
Last edited:

J0Y

TAZ TAZ TAZ
Joined
Feb 15, 2008
Messages
130
I still don't get it. :S

Included Files
root/*.*

I don't know where to install the Root folder (The mod I downloaded has a folder called Root).
 
Last edited:

Cadet

Hitler loved his banjo
Joined
Aug 13, 2008
Messages
852
Install the contents of the Root folder in the folder of your forum. For example, if you have:

Public_HTML
-Forums
-Other

Then the root files go here:
Public_HTML
-Forums
--
-Other

In forums.
 

JDesigns

Neophyte
Joined
Feb 3, 2009
Messages
7
I haven't installed a mod yet but easy tutorial to understand. I will definitely be back to reference. Thanks for the work.
 

phreakwars

Wakka Wakka Wakka
Joined
Sep 26, 2005
Messages
2,504
AutoMOD addendum

OK, Now for part 2 of this tutorial

WORKING WITH AUTOMOD AND XML

So PhPBB3 now has a MOD installer program that works quite well, but sometimes that dang MOD still won't install. Well, I'm here to help.

The MOD for this part of the tutorial is Handyman's very popular Ajax Chat 2.0.0B8 Mod which can be found here: http://startrekguide.com/community/viewtopic.php?f=127&t=8675

I chose this MOD because on a Clean install of PhPBB3, this MOD does not install in AutoMOD the way it is supposed to. This is because of a few errors in the MODS XML install file, while I am sure Handyman will eventually correct the MOD when it becomes an RC (Release Candidate), for now, it makes the perfect instructional MOD for correcting XML problems.

When you click INSTALL in AUTOMOD for this MOD what you will see are these various errors

ai18.photobucket.com_albums_b149_phreakwars_automod_Image1.jpg
ai18.photobucket.com_albums_b149_phreakwars_automod_Image2.jpg

ai18.photobucket.com_albums_b149_phreakwars_automod_Image3.jpg

ai18.photobucket.com_albums_b149_phreakwars_automod_Image4.jpg

Not to worry, were going to use basically the same MOD THE MOD method like I outlined in the PhPBB2 tutorial HERE but this time, we are working with an XML file.

So again, we start out by opening up the mods install file in our code editor. The first error we have is AUTOMOD doesn't know what a "*" means when it comes to copying new files over.

Our error is on line 141 as shown below

ai18.photobucket.com_albums_b149_phreakwars_automod_Image6.jpg

So what this first fix requires is that we add the path lines for each of the images that need to go into the MOD, you'll have to look them up in the imageset folder.

The corrected lines will look like so

ai18.photobucket.com_albums_b149_phreakwars_automod_Image5.jpg

Pretty easy so far, yes? OK, Our next error is a FIND error that the MOD can't find, this error is on line 153, the problem is an easy fix, it's just a simple spacing problem in the MOD

ai18.photobucket.com_albums_b149_phreakwars_automod_Image7.jpg

Remedied by opening language/en/common.php in our editor, looking for key words that match what the MOD wants, copying the needed section to the instructions and replacing the erroneous line. The correct line in this example is found on line 119

ai18.photobucket.com_albums_b149_phreakwars_automod_Image8.jpg

The same with the other errors

ai18.photobucket.com_albums_b149_phreakwars_automod_Image9.jpg

ai18.photobucket.com_albums_b149_phreakwars_automod_Image10.jpg

After all the corrections are made, you should now be able to install the MOD in AUTOMOD

ai18.photobucket.com_albums_b149_phreakwars_automod_Image11.jpg

Now it's time for the do it yourself part, but first, lets REFRESH the templates CACHE

Navigate to STYLES>TEMPLATES>PROSILVER in your ACP and click REFRESH on your templates CACHE

ai18.photobucket.com_albums_b149_phreakwars_automod_Image12.jpg

Now that this is done, return to the board index. What you'll see is this

ai18.photobucket.com_albums_b149_phreakwars_automod_Image13.jpg

Not to worry, you are getting this error because the MOD doesn't have the new SQL installed yet, so following the MODS DIY instructions, we type in the command for the install from the index by entering
PHP:
chat_install.php?mode=install
AFTER your sites main index URL.

For example, if we were installing this mod on the adminzone, we would enter
PHP:
http://www.theadminzone.com/chat_install.php?mode=install
After you have done this part, you should see the following screen

ai18.photobucket.com_albums_b149_phreakwars_automod_Image17.jpg

So now we can delete chat_install.php and proceed back to our home page, if you followed along with me here, YOU TOO should now have a new shoutbox on your forum

ai18.photobucket.com_albums_b149_phreakwars_automod_Image18.jpg

Still a bit confused here? Not a problem, I included a BONUS attachment in this post of the CORRECTED XML install file for the Shoutbox

Examine it, or use it yourself in AUTOMOD to get the Shoutbox working for you. :tiphat:
.
.
 

Attachments

amprawin

Neophyte
Joined
Mar 24, 2009
Messages
3
how to install in easy way?
please help!!
am searching how to install mod for past 1 week!!
pl
 

phreakwars

Wakka Wakka Wakka
Joined
Sep 26, 2005
Messages
2,504
What your probably looking for is the AUTOMOD program, you can find it at:

http://www.phpbb.com/mods/automod/

You'll want to read through the documentation first to get a better understanding of what your dealing with. After that, come back to THIS tutorial, and even the one for PhPBB2.
.
.
 

dorin

Neophyte
Joined
Nov 25, 2009
Messages
1
Now that I managed to install the chat mod, how would I go about making sure that it's only visible to users who are logged in?
 

phreakwars

Wakka Wakka Wakka
Joined
Sep 26, 2005
Messages
2,504
Now that I managed to install the chat mod, how would I go about making sure that it's only visible to users who are logged in?
Open index_body.html

Find
PHP:
<!-- INCLUDE chat_body.html -->
Replace with:
PHP:
<!-- IF S_USER_LOGGED_IN -->
<!-- INCLUDE chat_body.html -->
<!-- ENDIF -->
.
.
 

EvanP

Aspirant
Joined
Oct 8, 2009
Messages
19
I have tried countless times installing Modifications, and i fail everytime. I am currently trying to find someone to install some Modifications for me, PM me if your interested, i'm paying well. ;)
 
Top