Code: Selecteer alles
Installation Instructions for 'Cash MOD' Version 1 0 0 B1
Select Language : English
About this MOD
Title:Cash MOD
Description:Customizable rewards system.
Allows board users to receive cash for posting, replies, voting, polls and attachments.
Everything is customizable through the ACP and with permissions (Forum permissions)
You can receive any of the above mentioned rewards based on what is selected in the permissions.
Donate cash to other users.
Configurable amounts and currencies to receive for each of the available rewards.
Version:1 0 0 B1
Installation Level:Easy
Installation Time:~10minutes
Author
Username:Handyman
Email:francis@michaellewismusic.com
Name:Handyman
WWW:http://startrekguide.com
Files to Edit
includes/functions_posting.php,
viewtopic.php,
common.php,
styles/prosilver/template/viewtopic_body.html,
styles/prosilver/template/memberlist_body.html,
memberlist.php,
styles/prosilver/template/memberlist_view.html,
language/en/acp/permissions_phpbb.php
Included Files
root/adm/style/mods/cash/acp_cash.html,
root/adm/mods/cash_mod_version.php,
root/language/en/mods/info_acp_cash.php,
root/language/en/mods/cash_mod.php,
root/language/en/mods/info_ucp_bank.php,
root/styles/prosilver/template/mods/bank/ucp_bank_donate.html,
root/includes/mods/cash/cash_class.php,
root/includes/acp/acp_cash.php,
root/includes/acp/info/acp_cash.php,
root/includes/db/create_schema.php,
root/includes/ucp/ucp_bank.php,
root/includes/ucp/info/ucp_bank.php
Additional MODX Files
This MOD has no additional MODX files.
--------------------------------------------------------------------------------
Disclaimer
For security purposes, please check: http://www.phpbb.com/mods/ for the latest version of this MOD. Downloading this MOD from other sites could cause malicious code to enter into your phpBB Forum. As such, phpBB will not offer support for MODs not offered in our MODs database, located at: http://www.phpbb.com/mods/
Author Notes
MOD History
2006-10-12- Version 0 0 1
[change] Beta Release
2007-02-03- Version 0 1 0
[change] Added display on viewtopic and memberlist
2007-03-03- Version 0 2 0
[change] Added cash toggle switches so it only works if you have it set in the ACP
2007-05-27- Version 0 3 0
[change] Added view all users cash amounts in profile
[change] Added Bank Management for Admins and Mods with permission to edit users cash
[change] Added permissions for admins and mods to edit users cash
[change] Added prosilver and subsilver2 instructions
[fix] Updated to work with RC1
[change] Cash on/off on per forum basis
[change] Limit Cash per time period
2007-06-26- Version 0 3 2
[fix] Serious code cleanup and overhaul
[change] Made all cash instances into functions for easy upgrading
[change] Finished the ACP so it now controls all currently available options
[change] Made link to Bank in viewtopic
2008-07-13- Version 1 0 0 B1
[change] Complete code rewrite
[change] Included a Cash Class for other MODs to integrate
[fix] Fixed all current issues with the ACP… can add/edit all currencies correctly.
[change] Added a cash_rates table to keep track of currency exchange rates.
[change] Added a donate link in viewtopic, viewprofile and memberlist for users to donate to eachother.
[change] Installer now supports all DBMS types.
[change] Added the ability to select which currency you want to donate.
[fix] Fixed current issues with the permissions
[change] Added ability to receive cash for adding polls, voting, posting, replying, adding attachments.
License
This MOD has been licensed under the following license:
http://opensource.org/licenses/gpl-license.php GNU General Public License v2
Other Notes
Before adding this MOD to your forum, you should back up all files related to this MOD
This MOD was designed for phpBB 3.0.2and may not function as stated on other phpBB versions. MODs for phpBB3.0 will not work on phpBB2.0 and vice versa.
This MOD is development quality. It is not recommended that you install it on a live forum.
English Support
English support can be obtained at http://www.phpbb.com/mods/ for released MODs.
--------------------------------------------------------------------------------
File Copy
Copy: root/adm/style/mods/cash/acp_cash.html
To: adm/style/mods/cash/acp_cash.html
Copy: root/adm/mods/cash_mod_version.php
To: adm/mods/cash_mod_version.php
Copy: root/language/en/mods/info_acp_cash.php
To: language/en/mods/info_acp_cash.php
Copy: root/language/en/mods/cash_mod.php
To: language/en/mods/cash_mod.php
Copy: root/language/en/mods/info_ucp_bank.php
To: language/en/mods/info_ucp_bank.php
Copy: root/styles/prosilver/template/mods/bank/ucp_bank_donate.html
To: styles/prosilver/template/mods/bank/ucp_bank_donate.html
Copy: root/includes/mods/cash/cash_class.php
To: includes/mods/cash/cash_class.php
Copy: root/includes/acp/acp_cash.php
To: includes/acp/acp_cash.php
Copy: root/includes/acp/info/acp_cash.php
To: includes/acp/info/acp_cash.php
Copy: root/includes/db/create_schema.php
To: includes/db/create_schema.php
Copy: root/includes/ucp/ucp_bank.php
To: includes/ucp/ucp_bank.php
Copy: root/includes/ucp/info/ucp_bank.php
To: includes/ucp/info/ucp_bank.php Edits
s↑↓
Use your keyboard to navigate the code boxes. You may also hit 's' on your keyboard to go to the first code box.
Open: includes/functions_posting.php
Find
Tip: This may be a partial find and not the whole line.
Code: Select All
$data['topic_id'] = $db->sql_nextid();
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code: Select All
$cash->new_topic($data['forum_id'], $sql_data[POSTS_TABLE]['sql']['post_text']);
Find
Tip: This may be a partial find and not the whole line.
Code: Select All
$data['post_id'] = $db->sql_nextid();
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code: Select All
$cash->new_post($data['forum_id'], $sql_data[POSTS_TABLE]['sql']['post_text']);
Find
Tip: This may be a partial find and not the whole line.
Code: Select All
$db->sql_multi_insert(POLL_OPTIONS_TABLE, $sql_insert_ary);
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code: Select All
$cash->new_poll($data['forum_id'], sizeof($sql_insert_ary));
Find
Tip: This may be a partial find and not the whole line.
Code: Select All
if ($space_taken && $files_added)
{
set_config('upload_dir_size', $config['upload_dir_size'] + $space_taken, true);
set_config('num_files', $config['num_files'] + $files_added, true);
}
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code: Select All
$cash->new_attachment($data['forum_id'], $files_added);
Find
Tip: This may be a partial find and not the whole line.
Code: Select All
global $db, $auth, $user, $config, $phpEx, $template, $phpbb_root_path;
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code: Select All
global $cash;
Open: viewtopic.php
Find
Tip: This may be a partial find and not the whole line.
Code: Select All
$user->set_cookie('poll_' . $topic_id, implode(',', $voted_id), time() + 31536000);
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code: Select All
$cash->voted_poll();
Find
Tip: This may be a partial find and not the whole line.
Code: Select All
// Generate online information for user
Add before
Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code: Select All
// grab the cash for the users in this topic
$cash->user_cache($id_cache, $user_cache);
Find
Tip: This may be a partial find and not the whole line.
Code: Select All
// Dump vars into template
Add before
Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code: Select All
// assign the users cash to the postrow
$postrow['CASH'] = (isset($user_cache[$poster_id]['cash']) ? $user_cache[$poster_id]['cash'] : 0);
$postrow['U_CASH_DONATE'] = append_sid($phpbb_root_path . 'ucp.' . $phpEx, 'i=bank&mode=donate&user_id=' . $poster_id);
Find
Tip: This may be a partial find and not the whole line.
Code: Select All
// Does this topic contain a poll?
Add before
Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code: Select All
$cash->cash_name();
Find
Tip: This may be a partial find and not the whole line.
Code: Select All
// Setup look and feel
$user->setup('viewtopic', $topic_data['forum_style']);
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code: Select All
$user->add_lang('mods/cash_mod');
Open: common.php
Find
Tip: This may be a partial find and not the whole line.
Code: Select All
require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code: Select All
// include the cash class
require($phpbb_root_path . 'includes/mods/cash/cash_class.' . $phpEx);
Open: styles/prosilver/template/viewtopic_body.html
Find
Tip: This may be a partial find and not the whole line.
Code: Select All
<!-- IF postrow.POSTER_POSTS != '' --><dd><strong>{L_POSTS}:</strong> {postrow.POSTER_POSTS}</dd><!-- ENDIF -->
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code: Select All
<!-- IF postrow.CASH -->
<dd><strong>{CASH_NAME}:</strong> {postrow.CASH}</dd>
<dd><a href="{postrow.U_CASH_DONATE}">{L_DONATE}</a></dd>
<!-- ENDIF -->
Open: styles/prosilver/template/memberlist_body.html
Find
Tip: This may be a partial find and not the whole line.
Code: Select All
<th class="posts"><a href="{U_SORT_POSTS}#memberlist">{L_POSTS}</a></th>
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code: Select All
<th class="cash"><a href="{U_SORT_CASH}#memberlist">{CASH_NAME}</a></th>
Find
Tip: This may be a partial find and not the whole line.
Code: Select All
<th class="posts"> </th>
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code: Select All
<th class="cash"> </th>
Find
Tip: This may be a partial find and not the whole line.
Code: Select All
<td class="posts"><!-- IF memberrow.POSTS --><a href="{memberrow.U_SEARCH_USER}" title="{L_SEARCH_USER_POSTS}">{memberrow.POSTS}</a><!-- ELSE -->{memberrow.POSTS}<!-- ENDIF --></td>
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code: Select All
<td class="posts"><!-- IF memberrow.CASH --><a href="{memberrow.U_EDIT_CASH}" title="{L_CASH_MANAGE}">{memberrow.CASH}</a><!-- ELSE -->{memberrow.CASH}<!-- ENDIF --></td>
Find
Tip: This may be a partial find and not the whole line.
Code: Select All
<td colspan="<!-- IF U_SORT_ACTIVE -->{:%1}<!-- ELSE -->
Increment
Tip: This allows you to alter integers. For help on what each operator means, click here.
Code: Select All
{:%1} + 1
Find
Tip: This may be a partial find and not the whole line.
Code: Select All
<td colspan="<!-- IF U_SORT_ACTIVE -->{:%1}<!-- ELSE -->{:%2}<!-- ENDIF -->"> </td>
Increment
Tip: This allows you to alter integers. For help on what each operator means, click here.
Code: Select All
{:%2} + 1
Open: memberlist.php
Find
Tip: This may be a partial find and not the whole line.
Code: Select All
$user->setup(array('memberlist', 'groups'));
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code: Select All
$user->add_lang('mods/cash_mod');
Find
Tip: This may be a partial find and not the whole line.
Code: Select All
$sql = $db->sql_build_query('SELECT', array(
Add before
Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code: Select All
$cash_ary = $cash->get_user_cash(array_unique(array_merge($admin_id_ary, $mod_id_ary)));
Find
Tip: This may be a partial find and not the whole line.
Code: Select All
if (!empty($profile_fields['row']))
Add before
Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code: Select All
$cash->viewprofile($user_id);
Find
Tip: This may be a partial find and not the whole line.
Code: Select All
for ($i = 0, $end = sizeof($user_list); $i < $end; ++$i)
Add before
Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code: Select All
$cash_cache = $cash->get_user_cash($user_list);
$cash->cash_name();
Open: styles/prosilver/template/memberlist_view.html
Find
Tip: This may be a partial find and not the whole line.
Code: Select All
<dt>{L_TOTAL_POSTS}:</dt> <dd>{POSTS} | <strong><a href="{U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a></strong><!-- IF POSTS_PCT --><br />({POSTS_PCT} / {POSTS_DAY})<!-- ENDIF --></dd>
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code: Select All
<dt>{CASH_NAME}:</dt> <dd>{CASH} | <strong><a href="{U_CASH_DONATE}">{L_DONATE}</a><!-- IF U_CASH_MANAGE --> | <a href="{U_CASH_MANAGE}">{L_CASH_MANAGE}</a><!-- ENDIF --></strong></dd>
Open: language/en/acp/permissions_phpbb.php
Find
Tip: This may be a partial find and not the whole line.
Code: Select All
// Define categories and permission types
$lang = array_merge($lang, array(
'permission_cat' => array(
Replace With
Tip: Replace the preceding line(s) to find with the following lines.
Code: Select All
if (!isset($lang['permission_cat']) || !is_array($lang['permission_cat']))
{
$lang['permission_cat'] = array();
}
// Define categories and permission types
$lang['permission_cat'] = array_merge($lang['permission_cat'], array(
Find
Tip: This may be a partial find and not the whole line.
Code: Select All
),
// With defining 'global' here we are able to specify what is printed out if the permission is within the global scope.
'permission_type' => array(
Replace With
Tip: Replace the preceding line(s) to find with the following lines.
Code: Select All
));
if (!isset($lang['permission_type']) || !is_array($lang['permission_type']))
{
$lang['permission_type'] = array();
}
// With defining 'global' here we are able to specify what is printed out if the permission is within the global scope.
$lang['permission_type'] = array_merge($lang['permission_type'], array(
Find
Tip: This may be a partial find and not the whole line.
Code: Select All
),
));
// User Permissions
Replace With
Tip: Replace the preceding line(s) to find with the following lines.
Code: Select All
));
// User Permissions
DIY Instructions
These are manual instructions that cannot be performed automatically. You should follow these instructions carefully.
Code: Select All
Browse to your Administration control panel->System (tab)->Administration control panel (under module management).
Then select "Cash Settings" from the dropdown menu (on the right side) and click "Add Module".
Then it should say it was installed successfully.
Now click System (tab) and you'll see a .MODS tab appear… click on that tab and you'll see the Cash MOD Settings.
Have fun :)
--------------------------------------------------------------------------------
Save all files. End of MOD.
You have finished the installation for this MOD. Upload all changed files to your website. If the installation went bad, simply restore your backed up files.
MOD UA XSLT File Copyright © 2007 The phpBB Group, this MOD is copyright to the authors listed above.