How do i install a mod in a phpBB. any answers..??
How do i install a Mod in PHPBB
| pashmina wrote: |
| How do i install a mod in a phpBB. any answers..?? |
Read the installation file that comes with it, it will tell you what to do.
There are a few simple actions, like...
| Quote: |
| BEFORE, ADD
AFTER, ADD REPLACE WITH REMOVE FIND IN-LINE, FIND IN-LINE, REPLACE WITH |
All you have to do is follow the instructions. (note that some MOD's are poorly coded and some have not been updated to 2.0.22. The MOD's will still work but the code that it tells you to find may be incorrect).
Are you having difficulty with a MOD? If so I will walk you through the steps of changing the file. Usually, I just offer to do it for you, but that's like installing phpbb with fantastico [you never learn yourself!]
I actually want to install the Cash Mod in my forum. and i am totally confused. i had the habit of installing scripts from the fantastico, its totally true. now i want to install this cash Mod. is it possible?
| pashmina wrote: |
| I actually want to install the Cash Mod in my forum. and i am totally confused. i had the habit of installing scripts from the fantastico, its totally true. now i want to install this cash Mod. is it possible? |
Additional Note:
This post is pretty long but please don't be alarmed by it. I suggest skim-reading the whole of it first. You need to download the cash MOD and you should follow the cm_install_223.txt which is in the cash mod download, available here. Only follow the install file however after reading the whole of this thread.
Extremely, although it is one of the most complicated MOD's out there to install (and also not the best coded but that is just my opinion). Once you install a handful of MOD's though you can install them all (unless two or more MOD's don't work correctly in which case you have to tweak them slightly). I will walk you through the beginning of the installation file. If you find this too difficult then feel free to PM me your hosting details and I will do it for you. However, please try and install it at least once, that way you learn from your mistakes and I can post the fixes, this way you'll know where you went wrong (note that the very first time I installed a MOD it took me a number of times to successfully achieve it, so don't worry if you cannot do it first time around).
1. Executing the SQL myqueries.
I could use an installation script to edit the database but this is very easy to do (a little like using fantastico). Most MOD's do not come with a database installation script so the only way to edit the database to fit the MODs is to do it via raw mySQL queries.
*Login to http://pashmina.frih.net/phpmyadmin with your username and password
*On the left-hand side panel choose the forum database from the drop-down menu -
*On the panel that appears, click "SQL", located at the top of the -
*On the screen that appears next, copy the following code below and paste it in the textbox area (note that it is possible to use the upload feature at this point, but usually MOD's only have a few db queries, the odd one out's being mainly the cash and attachment MOD, so will use the old copy/paste method):
| Code: |
| INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_disable',0);
INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_display_after_posts',1); INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_post_message','You earned %s for that post'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_disable_spam_num',10); INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_disable_spam_time',24); INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_disable_spam_message','You have exceeded the alloted amount of posts and will not earn anything for your post'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_installed','yes'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_version','2.2.3'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_adminbig','0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('cash_adminnavbar','1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('points_name','Points'); CREATE TABLE phpbb_cash ( cash_id smallint(6) NOT NULL auto_increment, cash_order smallint(6) NOT NULL default '0', cash_settings smallint(4) NOT NULL default '3313', cash_dbfield varchar(64) NOT NULL default '', cash_name varchar(64) NOT NULL default 'GP', cash_default int(11) NOT NULL default '0', cash_decimals tinyint(2) NOT NULL default '0', cash_imageurl varchar(255) NOT NULL default '', cash_exchange int(11) NOT NULL default '1', cash_perpost int(11) NOT NULL default '25', cash_postbonus int(11) NOT NULL default '2', cash_perreply int(11) NOT NULL default '25', cash_maxearn int(11) NOT NULL default '75', cash_perpm int(11) NOT NULL default '0', cash_perchar int(11) NOT NULL default '20', cash_allowance tinyint(1) NOT NULL default '0', cash_allowanceamount int(11) NOT NULL default '0', cash_allowancetime tinyint(2) NOT NULL default '2', cash_allowancenext int(11) NOT NULL default '0', cash_forumlist varchar(255) NOT NULL default '', PRIMARY KEY (cash_id) ); CREATE TABLE phpbb_cash_events ( event_name varchar(32) NOT NULL default '', event_data varchar(255) NOT NULL default '', PRIMARY KEY (event_name) ); CREATE TABLE phpbb_cash_exchange ( ex_cash_id1 int(11) NOT NULL default '0', ex_cash_id2 int(11) NOT NULL default '0', ex_cash_enabled int(1) NOT NULL default '0', PRIMARY KEY (ex_cash_id1,ex_cash_id2) ); CREATE TABLE phpbb_cash_groups ( group_id mediumint(6) NOT NULL default '0', group_type tinyint(2) NOT NULL default '0', cash_id smallint(6) NOT NULL default '0', cash_perpost int(11) NOT NULL default '0', cash_postbonus int(11) NOT NULL default '0', cash_perreply int(11) NOT NULL default '0', cash_perchar int(11) NOT NULL default '0', cash_maxearn int(11) NOT NULL default '0', cash_perpm int(11) NOT NULL default '0', cash_allowance tinyint(1) NOT NULL default '0', cash_allowanceamount int(11) NOT NULL default '0', cash_allowancetime tinyint(2) NOT NULL default '2', cash_allowancenext int(11) NOT NULL default '0', PRIMARY KEY (group_id,group_type,cash_id) ); CREATE TABLE phpbb_cash_log ( log_id int(11) NOT NULL auto_increment, log_time int(11) NOT NULL default '0', log_type smallint(6) NOT NULL default '0', log_action varchar(255) NOT NULL default '', log_text varchar(255) NOT NULL default '', PRIMARY KEY (log_id) ); |
After you click "Go" you should be taken to a page saying how many queries were successfully executed. If you received an error at this point, do not go one any further.
If there are no errors, close the window and move onto the next stage.
2. Editing the Files.
OK, now its time to edit the following files (you can do this via DirectAdmin or FTP (although I suggest you do it via www.web2ftp.com)):
| Quote: |
|
## common.php ## memberlist.php ## posting.php ## privmsg.php ## profile.php ## viewtopic.php ## includes/functions.php ## includes/functions_post.php ## includes/usercp_viewprofile.php ## templates/subSilver/memberlist_body.tpl ## templates/subSilver/profile_view_body.tpl ## templates/subSilver/viewtopic_body.tpl |
I will not walk you through every single change, but I will walk you through the actions that this MOD requires (I mentioned the different type of actions in a previous post).
OK, the first code change is probably one of the easiest to do ...
| Quote: |
|
#-----[ OPEN ]------------------------------------------ # common.php # #-----[ FIND ]------------------------------------------ # include($phpbb_root_path . 'includes/db.'.$phpEx); # #-----[ AFTER, ADD ]------------------------------------------ # if ( defined('IN_CASHMOD') ) { include($phpbb_root_path . 'includes/functions_cash.'.$phpEx); } |
Basically, all you have to do is open ((([OPEN]))) the file common.php. Do not worry about what all the code in it means or does, you don't need to know this unless your creating your own MOD. When common.php is open, use your browser's find function (usually ctrl + f) and find the line that it tells you to find. When it is fount, you need to perform the action [ AFTER, ADD ]. All this means is you have to add the [ AFTER, ADD ] code after the code that you had to find. When you add this code, the MOD installation moves onto another file so make sure you save the file common.php. Now, somewhere in your common.php file (I believe it is very close to the beginning), you shoud have the following:
| Code: |
|
include($phpbb_root_path . 'includes/db.'.$phpEx); if ( defined('IN_CASHMOD') ) { include($phpbb_root_path . 'includes/functions_cash.'.$phpEx); } |
Next, you need to edit the memberlist.php file. I have missed the first code change since it is a [ FIND ] / [ AFTER, ADD ] action, which I have already covered. You must to this code change.
So, the next action we are going to deal with is the yet again, very simple [ BEFORE, ADD ] action. It is very similar to the [ AFTER, ADD ] action but you have to insert the code before the [ FIND ] code and not after.
| Quote: |
|
# #-----[ FIND ]------------------------------------------ # $select_sort_mode = '<select name="mode">'; # #-----[ BEFORE, ADD ]------------------------------------------ # $cm_memberlist->droplists($mode_types_text,$mode_types); |
Find the code using your browsers find function and insert the code above the find line, so somewhere in your memberlist.php file you'll have the following...
| Code: |
|
$cm_memberlist->droplists($mode_types_text,$mode_types); $select_sort_mode = '<select name="mode">'; |
There are other [ FIND ] / [ AFTER, ADD] and [ FIND ] / [ BEFORE, ADD ] code changes that have to be performed in the memberlist.php file that you should follow in the cm_install_223.txt which is in the cash mod download, available here
Next we'll move onto another action, this time [ IN-LINE FIND ] and [ IN-LINE AFTER, ADD ] actions. These actions only appear if the [ IN-LINE AFTER, ADD ] code is put into an already existing line or if the [ IN-LINE FIND ] code appears more than once. By now you should have completed all of the code changed in common.php and memberlist.php so we're now moving on to posting.php. Like memberlist.php, i have missed a few code changes in posting.php because we have already covered the actions that need to be used [ FIND ] / [ BEFORE, ADD ] and [ FIND ] / [ AFTER, ADD ].
| Quote: |
|
# #-----[ FIND ]------------------------------------------ # $sql = "SELECT f.*, t.topic_status, t.topic_title, t.topic_type # #-----[ IN-LINE FIND ]------------------------------------------ # t.topic_type # #-----[ IN-LINE AFTER, ADD ]------------------------------------------ # , t.topic_poster |
the above will become:
| Code: |
| $sql = "SELECT f.*, t.topic_status, t.topic_title, t.topic_type, t.topic_poster |
Use the broswers find function again to find the first line. When the code is highlighted by the broswer, use the find function again to find the [ IN-LINE FIND ] code. Alternatively, you can manually search the line of code but I strongly advise you not too.
You should finish all of the other code changes that have to be made to posring.php before moving on. The actions that are involved have already been mentioned so I will not go on about them again.
The next new action we come across is [ IN-LINE FIND ] / [ IN-LINE REPLACE WITH ] action, which is pretty straight forward. Like the action mentioned above, you first have to find the [ FIND ] line. You then have [ IN LINE FIND ] and replace this code with the code that is in the [ REPLACE WITH ] action.
| Quote: |
| #
#-----[ FIND ]------------------------------------------ # in subSilver, the full line is # <td class="catBottom" colspan="8" height="28"> </td> # colspan="8" # #-----[ IN-LINE FIND ]------------------------------------------ # 8 # #-----[ IN-LINE REPLACE WITH ]------------------------------------------ # {NUM_COLUMNS} |
The above will become
| Code: |
| <td class="catBottom" colspan="{NUM_COLUMNS}" height="28"> </td> |
I have now gone through all of the actions that this MOD does. I haven't mentioned all of the code changes so make sure you follow them all. Please try and if you fail I will do it for you.
After the code changes have been done all you have to do is upload the files that come with the download, like so:
| Quote: |
| copy cash.php -----> to -----> cash.php
copy admin/admin_cash.php -----> to -----> admin/admin_cash.php copy admin/cash_config.php -----> to -----> admin/cash_config.php copy admin/cash_currencies.php -----> to -----> admin/cash_currencies.php copy admin/cash_events.php -----> to -----> admin/cash_events.php copy admin/cash_exchange.php -----> to -----> admin/cash_exchange.php copy admin/cash_forums.php -----> to -----> admin/cash_forums.php copy admin/cash_groups.php -----> to -----> admin/cash_groups.php copy admin/cash_help.php -----> to -----> admin/cash_help.php copy admin/cash_log.php -----> to -----> admin/cash_log.php copy admin/cash_recount.php -----> to -----> admin/cash_recount.php copy admin/cash_reset.php -----> to -----> admin/cash_reset.php copy admin/cash_settings.php -----> to -----> admin/cash_settings.php copy includes/classes_cash.php -----> to -----> includes/classes_cash.php copy includes/functions_cash.php -----> to -----> includes/functions_cash.php copy language/lang_english/lang_cash.php -----> to -----> language/lang_english/lang_cash.php copy templates/subSilver/cash_donate.tpl -----> to -----> templates/subSilver/cash_donate.tpl copy templates/subSilver/cash_exchange.tpl -----> to -----> templates/subSilver/cash_exchange.tpl copy templates/subSilver/cash_modedit.tpl -----> to -----> templates/subSilver/cash_modedit.tpl copy templates/subSilver/cash_viewprofile.tpl -----> to -----> templates/subSilver/cash_viewprofile.tpl copy templates/subSilver/cash_viewtopic.tpl -----> to -----> templates/subSilver/cash_viewtopic.tpl copy templates/subSilver/admin/cash_config.tpl -----> to -----> templates/subSilver/admin/cash_config.tpl copy templates/subSilver/admin/cash_currencies.tpl -----> to -----> templates/subSilver/admin/cash_currencies.tpl copy templates/subSilver/admin/cash_event.tpl -----> to -----> templates/subSilver/admin/cash_event.tpl copy templates/subSilver/admin/cash_events.tpl -----> to -----> templates/subSilver/admin/cash_events.tpl copy templates/subSilver/admin/cash_exchange.tpl -----> to -----> templates/subSilver/admin/cash_exchange.tpl copy templates/subSilver/admin/cash_forum.tpl -----> to -----> templates/subSilver/admin/cash_forum.tpl copy templates/subSilver/admin/cash_group.tpl -----> to -----> templates/subSilver/admin/cash_group.tpl copy templates/subSilver/admin/cash_groups.tpl -----> to -----> templates/subSilver/admin/cash_groups.tpl copy templates/subSilver/admin/cash_help.tpl -----> to -----> templates/subSilver/admin/cash_help.tpl copy templates/subSilver/admin/cash_log.tpl -----> to -----> templates/subSilver/admin/cash_log.tpl copy templates/subSilver/admin/cash_menu.tpl -----> to -----> templates/subSilver/admin/cash_menu.tpl copy templates/subSilver/admin/cash_navbar.tpl -----> to -----> templates/subSilver/admin/cash_navbar.tpl copy templates/subSilver/admin/cash_reset.tpl -----> to -----> templates/subSilver/admin/cash_reset.tpl copy templates/subSilver/admin/cash_resetting.tpl -----> to -----> templates/subSilver/admin/cash_resetting.tpl copy templates/subSilver/admin/cash_settings.tpl -----> to -----> templates/subSilver/admin/cash_settings.tpl |
(note that I am writing this at 4am so there may be errors in it)
It really helped me out. This is very great help. I really appreciate it. Couldn't have done without you. ever!!
Great help. hi 5. i guess my problem is solved.
i guess this topic can be locked
Great help. hi 5. i guess my problem is solved.
i guess this topic can be locked
| pashmina wrote: |
| It really helped me out. This is very great help. I really appreciate it. Couldn't have done without you. ever!!
Great help. hi 5. i guess my problem is solved. i guess this topic can be locked |
WOW, congratulations on installing it correctly first time round.
This thread then is now -locked-
If you need any help on installing another then feel free to PM me.
wumingsden
P.S - Have a great New Year
