Soda Tasting, an online show for those who love soda

Bookmark and Share

Adding Hacks to phpBB 3 Styles

Adding Hacks to phpBB 3 Styles

Postby ~HG~ » March 3rd 2008, 2:58 am

One of the best things about phpBB 3 is that when adding mods (or hacks), there is generally a minimum of editing required which makes it a lot easier for the novices and gives the advanced administrators a lot less headaches.

phpBB 3 ships with two default styles which means that in a lot of cases you need to edit both template files within the styles folder if both styles are being used on the forum.

Most forum administrators tend to set up a forum and set a default style which the users cannot over ride.

If this is the case with you, then you need only edit the style that you are using in order for a hack to work.

If you have a forum that uses different styles, then the templates for each style used will need to be edited.

Note: Edits to .php files are the same throughout as both styles use the same .php files.

phpBB 3 mod authors use .xml documents to spell out the installation instructions so open the .xml file that is relevant to the style you are using and follow the edits to the letter. Some mod authors still use .txt files to describe the installation so it is a matter of looking at what is included in the download to find the installation instructions.

If you are using a style other than prosilver or subsilver2, then you will need to know which of the above styles were used for the basis of the style you are using. You can determine this by opening styles/prosilver/template/index_body.html. The first line of code will be:

Code: Select all
<p class="{S_CONTENT_FLOW_END}<!-- IF S_USER_LOGGED_IN --> rightside<!-- ENDIF -->"><!-- IF S_USER_LOGGED_IN -->

If this is the first line of code in your current style, then it is based on prosilver and you should follow only the steps for editing prosilver.

In styles/subsilver2/template/index_body.html, the first lines of code will be:

Code: Select all
<!-- IF U_MCP -->
	<div id="pageheader">
		<p class="linkmcp">[ <a href="{U_MCP}">{L_MCP}</a> ]</p>
	</div>

If this is the first line of code in your current style then it is based on subsilver2 and you should follow only the steps for editing subsilver2.

Now that you have established which style your style is based on, you can follow the instructions in the .xml file which ships with the hack you are installing.

Note: Some "easy" to install hacks simply use a .txt file for instructions.

Read the instructions carefully and if you follow them exactly as they are written then you should be successful in installing the hack.

Note: Some mod authors only give you the edits for one of the default templates and it may well be that you are using the other one and in such cases, you need to find "similar" code in the relevant files and place the edit where you think it should go. It is generally trial and error in this case and you can work it out as you go until you get it the way you want it.

SQL Queries: A lot of hacks require SQL queries to be run in order to change or alter the database to ensure they work the way the author designed them to so if your hack includes an SQL query then you must also carry out that part of the instructions.

SQL queries can be applied in two ways. The first and now most common is to run the install file that ships with the hack by running it in your browser. This will make the changes for you automatically. Always delete the file from your server after it has been successfully run.

The second way is to manually add the SQL and this needs only to be done where the author has not included an install file in the package.

To manually run an SQL query, you will need to access phpMyAdmin through your website hosting control panel. When you open phpMyAdmin you will see a "querybox." Cut/paste the queries (from a hack install file) into the querybox and hit the "Go!" Button and you will see if you was successful or not.

Once you have completed any edits and uploaded all the relevant files to your server, you need to go into your phpBB admin control panel and, if you have had to change a template file, you need to go to the "Styles" tab and click on "Templates" and refresh all the templates you have just edited.

Install one hack at a time and fully test it before continuing with other hacks. Otherwise, tracking down a problem can be rather confusing.

If the changes included the addition of imagesets, again you need to click on the imageset links and refresh them as well.

Alternately, you can go to the "General" tab and purge the cache which will complete the installation of the hack.

Important: Keep a backup copy of all files that you edit at least until you are sure that the hack has been successful.
~HG~
Dedicated User
 
Posts: 3913
Joined: November 8th 2003, 8:54 pm
Location: Australia

Return to phpBB 3: Installation

Who is online

Users browsing this forum: No registered users and 0 guests