- 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:
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
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):
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.
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 !!:
.
.
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 ]------------------------------------------
#
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'],

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

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'

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: