PHPBBS安装积分的帮助文档

来源:互联网 发布:手机上平面设计软件 编辑:程序博客网 时间:2024/06/05 10:12

Installation instructions for 'Ultimate Points' version 1.1.0
Select language:
About this MOD

Title:

        Ultimate Points

Description:

        The Ultimate Points is an addition to your phpBB3 forum, where people can gain points and also are able to spend points, of course. This can be done in internal functions like the Bank, Lottery or Robbery Module. But there will be additional existing mods, which will or already support Ultimate Points, like Jeff's Arcade Mod, the Formel 1 Web Tipp from Dr. Death, the phpbb Gallery from Nickvergessen, el_teniente's Sudoku Mod, Invite a Friend and the Medal System Mod from Gremlin do already support Ultimate Points. You will find more supported mods within the user guide.

Version:

    1.1.0
Installation level:

    Intermediate
Installation time:

    ~45 minutes
Author notes:

        A very special thanks goes to Jeff (http://www.phpbbarcade.com/) as he helped us resolving one or another small problem!

Authors

Username:
    femu
Name:
    Felix Mueller
WWW:
    http://www.die-muellers.org
Contributions:
    Developer 

Username:
    Wuerzi
Name:
    Christian Nowak
WWW:
    http://www.spieleresidenz.de
Contributions:
    Developer 

Username:
    el_teniente
Email:
    admin@vfalcone.ru
Name:
    Vladimir Sokolov
WWW:
    http://vfalcone.ru/forum/
Contributions:
    Developer 

Files to edit

    adm/style/acp_attachments.html,
    adm/style/acp_forums.html,
    adm/style/acp_users_overview.html,
    includes/acp/acp_attachments.php,
    includes/acp/acp_forums.php,
    includes/acp/acp_users.php,
    includes/mcp/mcp_queue.php,
    includes/mcp/mcp_warn.php,
    includes/cache.php,
    includes/constants.php,
    includes/functions.php,
    includes/functions_content.php,
    includes/functions_posting.php,
    includes/functions_user.php,
    common.php,
    index.php,
    memberlist.php,
    posting.php,
    viewonline.php,
    viewtopic.php,
    styles/prosilver/template/index_body.html,
    styles/prosilver/template/memberlist_view.html,
    styles/prosilver/template/overall_header.html,
    styles/prosilver/template/viewtopic_body.html,
    styles/prosilver/theme/bidi.css,
    styles/prosilver/theme/buttons.css,
    styles/prosilver/theme/colours.css

Included files

    root/adm/mods/ultimate_points_check_version.php,
    root/adm/style/acp_points_bank.html,
    root/adm/style/acp_points_forum.html,
    root/adm/style/acp_points_lottery.html,
    root/adm/style/acp_points_main.html,
    root/adm/style/acp_points_robbery.html,
    root/adm/style/acp_points_userguide.html,
    root/includes/acp/info/acp_points.php,
    root/includes/acp/acp_points.php,
    root/includes/points/functions_points.php,
    root/includes/points/points_bank.php,
    root/includes/points/points_bank_edit.php,
    root/includes/points/points_info.php,
    root/includes/points/points_logs.php,
    root/includes/points/points_lottery.php,
    root/includes/points/points_main.php,
    root/includes/points/points_points_edit.php,
    root/includes/points/points_robbery.php,
    root/includes/points/points_transfer.php,
    root/includes/points/points_transfer_user.php,
    root/language/en/mods/help_points.php,
    root/language/en/mods/info_acp_points.php,
    root/language/en/mods/permissions_points.php,
    root/language/en/mods/points.php,
    root/styles/prosilver/template/points/points_bank.html,
    root/styles/prosilver/template/points/points_bank_edit.html,
    root/styles/prosilver/template/points/points_info.html,
    root/styles/prosilver/template/points/points_logs.html,
    root/styles/prosilver/template/points/points_lottery.html,
    root/styles/prosilver/template/points/points_main.html,
    root/styles/prosilver/template/points/points_points_edit.html,
    root/styles/prosilver/template/points/points_robbery.html,
    root/styles/prosilver/template/points/points_transfer.html,
    root/styles/prosilver/template/points/points_transfer_user.html,
    root/styles/prosilver/theme/images/icon_points.gif,
    root/styles/prosilver/theme/images/money.png,
    root/umil/*.*,
    root/points.php,
    root/install_ultimate_points.php

Additional MODX files

    Language:  German Language
    Template:  subsilver2

Disclaimer and other notes

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/

Before adding this MOD to your forum, you should back up all files and databases related to this MOD.

This MOD was designed for phpBB 3.0.8  and may not function as stated on other phpBB versions. MODs for phpBB 3.0 will not work on phpBB 2.0 and vice versa.
License and English support

This MOD has been licensed under the following license:

http://opensource.org/licenses/gpl-license.php GNU General Public License v2

English support can be obtained at http://www.phpbb.com/mods/ for released MODs.

Support in your language might be available at a international support site.
MOD history
Show >>
File copy

    Copy: root/adm/mods/ultimate_points_check_version.php
        To: adm/mods/ultimate_points_check_version.php

    Copy: root/adm/style/acp_points_bank.html
        To: adm/style/acp_points_bank.html

    Copy: root/adm/style/acp_points_forum.html
        To: adm/style/acp_points_forum.html

    Copy: root/adm/style/acp_points_lottery.html
        To: adm/style/acp_points_lottery.html

    Copy: root/adm/style/acp_points_main.html
        To: adm/style/acp_points_main.html

    Copy: root/adm/style/acp_points_robbery.html
        To: adm/style/acp_points_robbery.html

    Copy: root/adm/style/acp_points_userguide.html
        To: adm/style/acp_points_userguide.html

    Copy: root/includes/acp/info/acp_points.php
        To: includes/acp/info/acp_points.php

    Copy: root/includes/acp/acp_points.php
        To: includes/acp/acp_points.php

    Copy: root/includes/points/functions_points.php
        To: includes/points/functions_points.php

    Copy: root/includes/points/points_bank.php
        To: includes/points/points_bank.php

    Copy: root/includes/points/points_bank_edit.php
        To: includes/points/points_bank_edit.php

    Copy: root/includes/points/points_info.php
        To: includes/points/points_info.php

    Copy: root/includes/points/points_logs.php
        To: includes/points/points_logs.php

    Copy: root/includes/points/points_lottery.php
        To: includes/points/points_lottery.php

    Copy: root/includes/points/points_main.php
        To: includes/points/points_main.php

    Copy: root/includes/points/points_points_edit.php
        To: includes/points/points_points_edit.php

    Copy: root/includes/points/points_robbery.php
        To: includes/points/points_robbery.php

    Copy: root/includes/points/points_transfer.php
        To: includes/points/points_transfer.php

    Copy: root/includes/points/points_transfer_user.php
        To: includes/points/points_transfer_user.php

    Copy: root/language/en/mods/help_points.php
        To: language/en/mods/help_points.php

    Copy: root/language/en/mods/info_acp_points.php
        To: language/en/mods/info_acp_points.php

    Copy: root/language/en/mods/permissions_points.php
        To: language/en/mods/permissions_points.php

    Copy: root/language/en/mods/points.php
        To: language/en/mods/points.php

    Copy: root/styles/prosilver/template/points/points_bank.html
        To: styles/prosilver/template/points/points_bank.html

    Copy: root/styles/prosilver/template/points/points_bank_edit.html
        To: styles/prosilver/template/points/points_bank_edit.html

    Copy: root/styles/prosilver/template/points/points_info.html
        To: styles/prosilver/template/points/points_info.html

    Copy: root/styles/prosilver/template/points/points_logs.html
        To: styles/prosilver/template/points/points_logs.html

    Copy: root/styles/prosilver/template/points/points_lottery.html
        To: styles/prosilver/template/points/points_lottery.html

    Copy: root/styles/prosilver/template/points/points_main.html
        To: styles/prosilver/template/points/points_main.html

    Copy: root/styles/prosilver/template/points/points_points_edit.html
        To: styles/prosilver/template/points/points_points_edit.html

    Copy: root/styles/prosilver/template/points/points_robbery.html
        To: styles/prosilver/template/points/points_robbery.html

    Copy: root/styles/prosilver/template/points/points_transfer.html
        To: styles/prosilver/template/points/points_transfer.html

    Copy: root/styles/prosilver/template/points/points_transfer_user.html
        To: styles/prosilver/template/points/points_transfer_user.html

    Copy: root/styles/prosilver/theme/images/icon_points.gif
        To: styles/prosilver/theme/images/icon_points.gif

    Copy: root/styles/prosilver/theme/images/money.png
        To: styles/prosilver/theme/images/money.png

    Copy: root/umil/*.*
        To: umil/*.*

    Copy: root/points.php
        To: points.php

    Copy: root/install_ultimate_points.php
        To: install_ultimate_points.php

Edits

swxUse your keyboard to navigate the code boxes. You may also hit 's' on your keyboard to go to the first code box.
Open: adm/style/acp_attachments.html
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

    <dl>
        <dt><label for="extension_group">{L_EXTENSION_GROUP}</label></dt>
        <dd>{GROUP_SELECT_OPTIONS}</dd>
    </dl>

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

    <!-- Start Ultimate Points -->
    <dl>
        <dt><label for="points_extension">{L_EXTENSION_POINTS}</label><br />{L_EXTENSION_POINTS_EXPLAIN}</dt>
        <dd><input type="radio" class="radio" name="points_extension" value="1"<!-- IF EXTENSION_POINTS --> id="points_extension" checked="checked" <!-- ENDIF --> /> {L_YES} &nbsp;
            <input type="radio" class="radio" name="points_extension" value="0"<!-- IF not EXTENSION_POINTS --> id="points_extension" checked="checked" <!-- ENDIF --> /> {L_NO}</dd>
    </dl>
    <dl>
        <dt><label for="points_extension_costs">{L_EXTENSION_POINTS_COSTS}</label><br />{L_EXTENSION_POINTS_COSTS_EXPLAIN}</dt>
        <dd><input type="text" id="points_extension_costs" size="10" maxlength="10" name="points_extension_costs" value="{ADD_EXTENSION_POINTS_COSTS}" /> {POINTS_NAME}</dd>
    </dl>
    <!-- End Ultimate Points -->

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

        <th>{L_EXTENSION}</th>
        <th>{L_EXTENSION_GROUP}</th>

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

        <!-- Start Ultimate Points -->
        <th>{L_EXTENSION_POINTS}</th>
        <th>{L_EXTENSION_POINTS_COSTS}</th>
        <!-- End Ultimate Points -->

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

            <td class="spacer" colspan="3">&nbsp;</td>

Replace with

Tip: Replace the preceding line(s) to find with the following lines.
Code:Select all

            <!-- Start Ultimate Points - Changed colspan to 5 -->
            <td class="spacer" colspan="5">&nbsp;</td>
            <!-- End Ultimate Points -->

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

            <td><strong>{extensions.EXTENSION}</strong></td>
            <td>{extensions.GROUP_OPTIONS}</td>

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

            <!-- Start Ultimate Points -->
            <td><input type="checkbox" class="radio" name="points_extension[]" value="{extensions.EXTENSION_ID}" <!-- IF extensions.EXTENSION_POINTS --> checked="checked" <!-- ENDIF --> /></td>
            <td><input type="text" size="10" maxlength="10" name="points_extension_costs[{extensions.EXTENSION_ID}]" value="{extensions.EXTENSION_POINTS_COSTS}" /> {POINTS_NAME}</td>
            <!-- End Ultimate Points -->

<< Hide
Open: adm/style/acp_forums.html
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

            <dd><input type="text" id="topics_per_page" name="topics_per_page" value="{TOPICS_PER_PAGE}" size="4" maxlength="4" /></dd>
        </dl>
        </fieldset>

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

        <!-- Start Ultimate Points -->
        <div id="forum_points_options">
            <fieldset>
                <legend>{L_FORUM_POINT_SETTINGS}</legend>
                <p>{L_FORUM_POINT_SETTINGS_EXPLAIN}</p>
                <dl>
                    <dt><label>{L_FORUM_PERTOPIC}:</label><br /><span>{L_FORUM_PERTOPIC_EXPLAIN}</span></dt>
                    <dd><input type="text" id="forum_pertopic" maxlength="6" size="5" name="forum_pertopic" value="{FORUM_PERTOPIC}" /></dd>
                </dl>
                <dl>
                    <dt><label>{L_FORUM_PERPOST}:</label><br /><span>{L_FORUM_PERPOST_EXPLAIN}</span></dt>
                    <dd><input type="text" id="forum_perpost" maxlength="6" size="5" name="forum_perpost" value="{FORUM_PERPOST}" /></dd>
                </dl>
                <dl>
                    <dt><label>{L_FORUM_PEREDIT}:</label><br /><span>{L_FORUM_PEREDIT_EXPLAIN}</span></dt>
                    <dd><input type="text" id="forum_peredit" maxlength="6" size="5" name="forum_peredit" value="{FORUM_PEREDIT}" /></dd>
                </dl>
                <dl>
                    <dt><label>{L_FORUM_COSTS}:</label><br /><span>{L_FORUM_COSTS_EXPLAIN}</span></dt>
                    <dd><label><input type="radio" class="radio" name="forum_costs" value="1"<!-- IF S_FORUM_COSTS --> id="forum_costs" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
                        <label><input type="radio" class="radio" name="forum_costs" value="0"<!-- IF not S_FORUM_COSTS --> id="forum_costs" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
                </dl>
            </fieldset>
        </div>
        <!-- End Ultimate Points -->

<< Hide
Open: adm/style/acp_users_overview.html
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

    <dd><input type="password" id="password_confirm" name="password_confirm" value="" /></dd>
</dl>

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all


<!-- Start Ultimate Points -->
<dl>
    <dt><label>{L_USER_POINTS}:</label><br /><span>{L_USER_POINTS_EXPLAIN}</span></dt>
    <dd><input class="text" type="text" id="user_points" maxlength="16" name="user_points" value="{USER_POINTS}" /></dd>
</dl>
<!-- End Ultimate Points -->

<< Hide
Open: includes/acp/acp_attachments.php
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

        $user->add_lang(array('posting', 'viewtopic', 'acp/attachments'));

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

        // Start Ultimate Points
        $user->add_lang('mods/info_acp_points');
        // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

                        // Change Extensions ?
                        $extension_change_list    = request_var('extension_change_list', array(0));
                        $group_select_list        = request_var('group_select', array(0));

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

                        // Start Ultimate Points
                        $extension_points_list    = request_var('points_extension', array(0));
                        $extension_points_costs    = request_var('points_extension_costs', array(0.00));
                        // Start Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

                        for ($i = 0, $size = sizeof($extension_change_list); $i < $size; $i++)
                        {
                            $extensions[$extension_change_list[$i]]['group_id'] = $group_select_list[$i];
                        }

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

                        // Start Ultimate Points
                        // Generate extentions points list
                        $extensions_points = array();

                        for ($i = 0, $size = sizeof($extension_points_list); $i < $size; $i++)
                        {
                            $extensions_points[$extension_points_list[$i]] = true;
                        }
                        // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

                        $sql = 'SELECT *
                            FROM ' . EXTENSIONS_TABLE . '
                            ORDER BY extension_id';
                        $result = $db->sql_query($sql);

                        while ($row = $db->sql_fetchrow($result))
                        {

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

                            // Start Ultimate Points
                            $new_extension_points = (isset($extensions_points[$row['extension_id']]) ? 1 : 0);

                            if ($row['points_extension'] <> $new_extension_points)
                            {
                                $sql = 'UPDATE ' . EXTENSIONS_TABLE . '
                                    SET points_extension = ' . (int) $new_extension_points  . '
                                    WHERE extension_id = ' . $row['extension_id'];
                                $db->sql_query($sql);
                                add_log('admin', 'LOG_ATTACH_POINTS_EXT_UPDATE', $row['extension']);
                            }

                            if ($row['points_extension_costs'] <> $extension_points_costs[$row['extension_id']])
                            {
                                $sql = 'UPDATE ' . EXTENSIONS_TABLE . '
                                    SET points_extension_costs = ' . (float) $extension_points_costs[$row['extension_id']] . '
                                    WHERE extension_id = ' . $row['extension_id'];
                                $db->sql_query($sql);
                                add_log('admin', 'LOG_ATTACH_POINTS_EXT_UPDATE', $row['extension']);
                            }
                            // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

                    $add_extension            = strtolower(request_var('add_extension', ''));
                    $add_extension_group    = request_var('add_group_select', 0);
                    $add                    = (isset($_POST['add_extension_check'])) ? true : false;

Replace with

Tip: Replace the preceding line(s) to find with the following lines.
Code:Select all

                    $add_extension                = strtolower(request_var('add_extension', ''));
                    $add_extension_group        = request_var('add_group_select', 0);
                    // Start Ultimate Points
                    $add_extension_points        = request_var('points_extension', 0);
                    $add_extension_points_costs    = request_var('points_extension_costs', 0.00);
                    // End Ultimate Points
                    $add                        = (isset($_POST['add_extension_check'])) ? true : false;

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

                                    'group_id'    =>    $add_extension_group,
                                    'extension'    =>    $add_extension

Replace with

Tip: Replace the preceding line(s) to find with the following lines.
Code:Select all

                                    'group_id'                    =>    $add_extension_group,
                                    'extension'                    =>    $add_extension,
                                    // Start Ultimate Points
                                    'points_extension'             =>     (int) $add_extension_points,
                                    'points_extension_costs'    =>     (float) $add_extension_points_costs,
                                    // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

                    'S_EXTENSIONS'            => true,
                    'ADD_EXTENSION'            => (isset($add_extension)) ? $add_extension : '',
                    'GROUP_SELECT_OPTIONS'    => (isset($_POST['add_extension_check'])) ? $this->group_select('add_group_select', $add_extension_group, 'extension_group') : $this->group_select('add_group_select', false, 'extension_group'))
                );

Replace with

Tip: Replace the preceding line(s) to find with the following lines.
Code:Select all

                    'S_EXTENSIONS'                    => true,
                    'ADD_EXTENSION'                    => (isset($add_extension)) ? $add_extension : '',
                    'GROUP_SELECT_OPTIONS'            => (isset($_POST['add_extension_check'])) ? $this->group_select('add_group_select', $add_extension_group, 'extension_group') : $this->group_select('add_group_select', false, 'extension_group'),
                    // Start Ultimate Points
                    'ADD_EXTENSION_POINTS'            => (isset($add_extension_points)) ? $add_extension_points : '',
                    'ADD_EXTENSION_POINTS_COSTS'    => (isset($add_extension_points_costs)) ? $add_extension_points_costs : '',
                    'POINTS_NAME'                    => $config['points_name'],
                    // End Ultimate Points
                ));

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

                            'S_SPACER'        => $s_spacer,
                            'EXTENSION_ID'    => $row['extension_id'],
                            'EXTENSION'        => $row['extension'],
                            'GROUP_OPTIONS'    => $this->group_select('group_select[]', $row['group_id']))

Replace with

Tip: Replace the preceding line(s) to find with the following lines.
Code:Select all

                            'S_SPACER'                    => $s_spacer,
                            'EXTENSION_ID'                => $row['extension_id'],
                            'EXTENSION'                    => $row['extension'],
                            // Start Ultimate Points
                            'EXTENSION_POINTS'             => $row['points_extension'],
                            'EXTENSION_POINTS_COSTS'    => $row['points_extension_costs'],
                            // End Ultimate Points
                            'GROUP_OPTIONS'                => $this->group_select('group_select[]', $row['group_id']))

<< Hide
Open: includes/acp/acp_forums.php
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

                        'forum_password_confirm'=> request_var('forum_password_confirm', '', true),
                        'forum_password_unset'    => request_var('forum_password_unset', false),

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

                        // Start Ultimate Points
                        'forum_pertopic'        => request_var('forum_pertopic', 0.00),
                        'forum_perpost'            => request_var('forum_perpost', 0.00),
                        'forum_peredit'            => request_var('forum_peredit', 0.00),
                        'forum_costs'            => request_var('forum_costs', 0),
                        // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

                            'forum_password'        => '',
                            'forum_password_confirm'=> '',

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

                            // Start Ultimate Points
                            'forum_pertopic'        => 0.00,
                            'forum_perpost'            => 0.00,
                            'forum_peredit'            => 0.00,
                            'forum_costs'            => 0,
                            // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

                    'FORUM_RULES_PREVIEW'        => $forum_rules_preview,
                    'FORUM_RULES_PLAIN'            => $forum_rules_data['text'],

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

                    // Start Ultimate Points
                    'FORUM_PERTOPIC'            => $forum_data['forum_pertopic'],
                    'FORUM_PERPOST'                => $forum_data['forum_perpost'],
                    'FORUM_PEREDIT'                => $forum_data['forum_peredit'],
                    'FORUM_COSTS'                => $forum_data['forum_costs'],
                    // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

                    'S_CAN_COPY_PERMISSIONS'    => ($action != 'edit' || empty($forum_id) || ($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth'))) ? true : false,

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

                    // Start Ultimate Points
                    'S_FORUM_COSTS'                => ($forum_data['forum_costs'] == 1) ? true : false,
                    // End Ultimate Points

<< Hide
Open: includes/acp/acp_users.php
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

                        'new_password'        => request_var('new_password', '', true),
                        'password_confirm'    => request_var('password_confirm', '', true),

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

                        // Start Ultimate Points
                        'user_points'        => request_var('user_points', 0.00),
                        // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

                        if ($user_row['user_type'] != USER_FOUNDER || $user->data['user_type'] == USER_FOUNDER)
                        {
                            // Only allow founders updating the founder status...

Add before

Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:Select all

                        // Start Ultimate Points
                        if ($user_row['user_points'] != $data['user_points'])
                        {
                            $sql_ary['user_points'] = $data['user_points'];
                        }
                        // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

                    'USER_POSTS'        => $user_row['user_posts'],
                    'USER_INACTIVE_REASON'    => $inactive_reason,

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

                    // Start Ultimate Points
                    'USER_POINTS'        => $user_row['user_points'],
                    // End Ultimate Points

<< Hide
Open: includes/mcp/mcp_queue.php
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

            else
            {
                $approve_log[] = array(
                    'type'            => 'post',
                    'post_subject'    => $post_data['post_subject'],
                    'forum_id'        => $post_data['forum_id'],
                    'topic_id'        => $post_data['topic_id'],
                );
            }

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

            // Start Ultimate Points
            // Grabbing the points if UPS exists and is active
            if (defined('IN_ULTIMATE_POINTS') && $config['points_enable'])
            {
                if ($post_data['points_post_edit'])
                {
                    if ($post_data['topic_first_post_id'] == $post_id)
                    {
                        if ($post_data['forum_id'])
                        {
                            $total_topics++;
                        }
                        $topic_approve_sql[] = $post_data['topic_id'];

                        $points_add[] = array(
                            'type'                            => 'topic',
                            'poster_id'                        => $post_data['poster_id'],
                            'points_attachment_received'    => $post_data['points_attachment_received'],
                            'points_topic_received'            => $post_data['points_topic_received'],
                            'points_post_received'            => $post_data['points_post_received'],
                            'points_post_edit_temp'            => $post_data['points_post_edit_temp'],
                        );
                    }
                    else
                    {
                        $points_add[] = array(
                            'type'                            => 'post',
                            'poster_id'                        => $post_data['poster_id'],
                            'points_attachment_received'    => $post_data['points_attachment_received'],
                            'points_topic_received'            => $post_data['points_topic_received'],
                            'points_post_received'            => $post_data['points_post_received'],
                            'points_post_edit_temp'            => $post_data['points_post_edit_temp'],
                        );
                    }
                }
                else
                {
                    if ($post_data['topic_first_post_id'] == $post_id)
                    {
                        if ($post_data['forum_id'])
                        {
                            $total_topics++;
                        }
                        $topic_approve_sql[] = $post_data['topic_id'];

                        $points_add[] = array(
                            'type'                            => 'topic',
                            'poster_id'                        => $post_data['poster_id'],
                            'points_received'                => $post_data['points_received'],
                            'points_poll_received'            => $post_data['points_poll_received'],
                            'points_attachment_received'    => $post_data['points_attachment_received'],
                            'points_topic_received'            => $post_data['points_topic_received'],
                            'points_post_received'            => $post_data['points_post_received'],
                        );
                    }
                    else
                    {
                        $points_add[] = array(
                            'type'                            => 'post',
                            'poster_id'                        => $post_data['poster_id'],
                            'points_received'                => $post_data['points_received'],
                            'points_poll_received'            => $post_data['points_poll_received'],
                            'points_attachment_received'    => $post_data['points_attachment_received'],
                            'points_topic_received'            => $post_data['points_topic_received'],
                            'points_post_received'            => $post_data['points_post_received'],
                        );
                    }
                }
            }
            // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

        unset($topic_approve_sql, $post_approve_sql);

        foreach ($approve_log as $log_data)
        {
            add_log('mod', $log_data['forum_id'], $log_data['topic_id'], ($log_data['type'] == 'topic') ? 'LOG_TOPIC_APPROVED' : 'LOG_POST_APPROVED', $log_data['post_subject']);
        }

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

        // Start Ultimate Points
        if (defined('IN_ULTIMATE_POINTS') && $config['points_enable'])
        {
            if (!function_exists('add_points'))
            {
                include($phpbb_root_path . 'includes/points/functions_points.' . $phpEx);
            }

            if ($post_data['points_post_edit'])
            {
                foreach ($points_add as $adding_data)
                {
                    $adding_amount = $adding_data['points_attachment_received'] + $adding_data['points_topic_received'] + $adding_data['points_post_received'] + $adding_data['points_post_edit_temp'];

                    add_points($adding_data['poster_id'], $adding_amount);
                }
            }
            else
            {
                foreach ($points_add as $adding_data)
                {
                    $adding_amount = $adding_data['points_received'] + $adding_data['points_poll_received'] + $adding_data['points_attachment_received'] + $adding_data['points_topic_received'] + $adding_data['points_post_received'];

                    add_points($adding_data['poster_id'], $adding_amount);
                }
            }
        }
        // End Ultimate Points

<< Hide
Open: includes/mcp/mcp_warn.php
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

    // We add this to the mod log too for moderators to see that a specific user got warned.
    $sql = 'SELECT forum_id, topic_id
        FROM ' . POSTS_TABLE . '
        WHERE post_id = ' . $post_id;

Add before

Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:Select all

    // Start Ultimate Points
    if ($config['points_enable'])
    {
        global $points_values;
        substract_points($user_row['user_id'], $points_values['points_per_warn']);
    }
    // End Ultimate Points

<< Hide
Open: includes/cache.php
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

    /**
    * Get config values
    */
    function obtain_config()

Add before

Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:Select all

    /**
    * Get Ultimate Points config values
    */
    function obtain_points_config()
    {
        global $db;

        if (($points_config = $this->get('pointsconfig')) !== false)
        {
            $sql = 'SELECT config_name, config_value
                FROM ' . POINTS_CONFIG_TABLE;
            $result = $db->sql_query($sql);

            while ($row = $db->sql_fetchrow($result))
            {
                $points_config[$row['config_name']] = $row['config_value'];
            }
            $db->sql_freeresult($result);
        }
        else
        {
            $points_config = $cached_points_config = array();

            $sql = 'SELECT config_name, config_value
                FROM ' . POINTS_CONFIG_TABLE;
            $result = $db->sql_query($sql);

            while ($row = $db->sql_fetchrow($result))
            {
                $points_config[$row['config_name']] = $row['config_value'];
            }
            $db->sql_freeresult($result);

            $this->put('points_config', $cached_points_config);
        }

        return $points_config;
    }

    /**
    * Get Ultimate Points config values
    */
    function obtain_points_values()
    {
        global $db;

        $sql_array = array(
            'SELECT'    => '*',
            'FROM'      => array(
                POINTS_VALUES_TABLE => 'v',
            ),
        );
        $sql = $db->sql_build_query('SELECT', $sql_array);
        $result = $db->sql_query($sql);
        $points_values = $db->sql_fetchrow($result);
        $db->sql_freeresult($result);

        return $points_values;
    }
   

<< Hide
Open: includes/constants.php
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

define('ZEBRA_TABLE',                $table_prefix . 'zebra');

// Additional tables

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all


// Ultimate Points
define('IN_ULTIMATE_POINTS', true);
define('POINTS_BANK_TABLE',                $table_prefix . 'points_bank');
define('POINTS_CONFIG_TABLE',            $table_prefix . 'points_config');
define('POINTS_LOG_TABLE',                $table_prefix . 'points_log');
define('POINTS_LOTTERY_HISTORY_TABLE',    $table_prefix . 'points_lottery_history');
define('POINTS_LOTTERY_TICKETS_TABLE',    $table_prefix . 'points_lottery_tickets');
define('POINTS_VALUES_TABLE',            $table_prefix . 'points_values');

<< Hide
Open: includes/functions.php
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

    // The following assigns all _common_ variables that may be used at any point in a template.
    $template->assign_vars(array(

Add before

Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:Select all

    // Start Ultimate Points
    $user->add_lang('mods/points');

    // Check if Installer is already run
    if (isset($config['points_name']))
    {
        if (!function_exists('number_format_points'))
        {
            require_once($phpbb_root_path . 'includes/points/functions_points.' . $phpEx);
        }

        $template->assign_vars(array(
            'U_POINTS'                => append_sid("{$phpbb_root_path}points.$phpEx"),
            'POINTS_LINK'            => $config['points_name'],
            'USER_POINTS'            => sprintf(number_format_points($user->data['user_points'])),
            'S_POINTS_ENABLE'        => $config['points_enable'],
            'S_USE_POINTS'            => $auth->acl_get('u_use_points'),
        ));
    }
    // End Ultimate Points

<< Hide
Open: includes/functions_content.php
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

    global $template, $cache, $user;
    global $extensions, $config, $phpbb_root_path, $phpEx;

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

    // Start Ultimate Points
    global $db;
    global $ultimate_points, $points_config;

    if ($forum_id > 0)
    {
        $sql = 'SELECT forum_costs
            FROM ' . FORUMS_TABLE . '
            WHERE forum_id = ' . $forum_id;
        $result = $db->sql_query($sql);
        $forum_no_costs =  $db->sql_fetchfield('forum_costs');
    }
    // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

            $block_array += array(
                'S_DENIED'            => true,
                'DENIED_MESSAGE'    => sprintf($user->lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension'])
            );
        }

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

        // Start Ultimate Points
        else if ($forum_id > 0)
        {
            if ($attachment['points_extension'] && $forum_no_costs && $config['points_enable'])
            {
                if ($user->data['user_points'] < $attachment['points_extension_costs'])
                {
                    $denied = true;

                    $block_array += array(
                        'S_DENIED'            => true,
                        'DENIED_MESSAGE'    => sprintf($user->lang['POINTS_ATTACHMENT_COSTS'], $attachment['extension'],  $attachment['points_extension_costs'], $config['points_name']),
                    );
                }
                else
                {
                    substract_points($user->data['user_id'] , $attachment['points_extension_costs']);
                }
            }
        }
        // End Ultimate Points

<< Hide
Open: includes/functions_posting.php
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

    // Start Ultimate Points
    global $ultimate_points, $points_config, $points_values;
    // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

                'post_subject'        => $subject,
                'post_checksum'        => $data['message_md5'],
                'post_attachment'    => (!empty($data['attachment_data'])) ? 1 : 0,
                'bbcode_bitfield'    => $data['bbcode_bitfield'],
                'bbcode_uid'        => $data['bbcode_uid'],

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

                // Start Ultimate Points
                'points_post_edit'    => true,
                // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

            if ($update_message)
            {
                $sql_data[POSTS_TABLE]['sql']['post_text'] = $data['message'];
            }

Replace with

Tip: Replace the preceding line(s) to find with the following lines.
Code:Select all

            if ($update_message)
            {
                // Start Ultimate Points
                $p_poll_received = $p_topic_received = $p_post_received = '';

                // Check the forum points in the forum tables
                $p_pertopic = $p_perpost = $p_peredit = '';

                $sql = 'SELECT forum_pertopic, forum_perpost, forum_peredit
                    FROM ' . FORUMS_TABLE . '
                    WHERE forum_id = ' . $data['forum_id'];
                $result = $db->sql_query_limit($sql, 1);
                $forumrow = $db->sql_fetchrow($result);
                $db->sql_freeresult($result);

                // Now let's define the variables with the points from the forum
                $p_pertopic    = $forumrow['forum_pertopic'];
                $p_perpost     = $forumrow['forum_perpost'];
                $p_peredit     = $forumrow['forum_peredit'];

                // Check the rest of the points
                $sql = 'SELECT points_poll_received, points_topic_received, points_post_received, poster_id
                    FROM ' . POSTS_TABLE . '
                    WHERE post_id = ' . $data['post_id'];
                $result = $db->sql_query_limit($sql, 1);
                $row = $db->sql_fetchrow($result);
                $db->sql_freeresult($result);

                // Now let's define the variables with the points for the post
                $p_poll_received     = $row['points_poll_received'];
                $p_topic_received     = $row['points_topic_received'];
                $p_post_received     = $row['points_post_received'];

                // If the topic_received greater than 0 and pertopic = 1
                if (($p_topic_received > 0) && ($p_pertopic > 0) && $points_config['pertopic_enable'])
                {
                    // First substract points from user account
                    substract_points($row['poster_id'], $p_topic_received);

                    // Reset the field $p_topic_received
                    reset_topic_received($data['post_id']);

                    // Now recalculate points
                    $ultimate_points->update_topic_ch($data['poster_id'], $data['forum_id'], $data['topic_id'], $ultimate_points->strip_text($data['message']), $post_approval);
                }

                // If the post_received is greater than 0 and and perpost = 1
                if (($p_post_received > 0) && ($p_perpost > 0) && $points_config['perpost_enable'])
                {
                    // First substract old post received points from user points
                    substract_points($row['poster_id'], $p_post_received);

                    // Now substract the post received points from the post table
                    reset_post_received($data['post_id']);

                    // Now update the post table
                    $ultimate_points->update_post_ch($data['poster_id'], $data['forum_id'], $data['post_id'], $ultimate_points->strip_text($data['message']), $post_approval);
                }

                //  If the poll_reveived greater than 0 and topic received = 0  and pertopic = 1
                if (($p_poll_received > 0) && ($p_pertopic > 0) && ($p_topic_received == 0) && ($points_config['pertopic_enable']))
                {
                    // Update Poll Text with new topic
                    $ultimate_points->update_topic_ch($poster_id, $data['forum_id'], $data['topic_id'], $ultimate_points->strip_text($data['message']), $post_approval);
                }
                // End Ultimate Points
                $sql_data[POSTS_TABLE]['sql']['post_text'] = $data['message'];
            }

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

    // Submit new post
    if ($post_mode == 'post' || $post_mode == 'reply')
    {
        if ($post_mode == 'reply')
        {

Add before

Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:Select all

    // Start Ultimate Points
    if (isset($data['user_points']))
    {
        if (!$data['user_points'])
        {
            $data['user_points'] = 0;
        }
    }
    else
    {
        $data['user_points'] = 0;
    }

    if ($config['points_enable'] && $post_approval)
    {
        $sql = "UPDATE " . USERS_TABLE . ' SET user_points = user_points + ' . $data['user_points'] . ' WHERE user_id = ' . (int) $user->data['user_id'];
        $db->sql_query($sql);
    }

    // Check the forum points in the forum tables
    $p_pertopic = $p_perpost = $p_peredit = '';

    $sql = 'SELECT forum_pertopic, forum_perpost, forum_peredit
        FROM ' . FORUMS_TABLE . '
        WHERE forum_id = ' . $data['forum_id'];
    $result = $db->sql_query_limit($sql, 1);
    $forumrow = $db->sql_fetchrow($result);
    $db->sql_freeresult($result);

    // Now let's define the variables with the points from the forum
    $p_pertopic    = $forumrow['forum_pertopic'];
    $p_perpost     = $forumrow['forum_perpost'];
    $p_peredit     = $forumrow['forum_peredit'];
    // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

        $sql = 'INSERT INTO ' . POSTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_data[POSTS_TABLE]['sql']);
        $db->sql_query($sql);
        $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

        // Start Ultimate Points
        if ($post_mode == 'reply' && $config['points_enable'] && $points_config['perpost_enable'] && $p_perpost > 0)
        {
            $ultimate_points->new_post_ch($data['forum_id'], $data['post_id'], $ultimate_points->strip_text($sql_data[POSTS_TABLE]['sql']['post_text']), $post_approval);
        }
        // End Ultimate Points


<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

            $sql_data[TOPICS_TABLE]['sql'] = array(
                'topic_first_post_id'        => $data['post_id'],
                'topic_last_post_id'        => $data['post_id'],
                'topic_last_post_time'        => $current_time,
                'topic_last_poster_id'        => (int) $user->data['user_id'],
                'topic_last_poster_name'    => (!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : ''),
                'topic_last_poster_colour'    => $user->data['user_colour'],
                'topic_last_post_subject'    => (string) $subject,
            );

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

            // Start Ultimate Points
            if ($config['points_enable'] && $points_config['pertopic_enable'] && $p_pertopic > 0)
            {
                $ultimate_points->new_topic_ch($data['forum_id'], $data['topic_id'], $ultimate_points->strip_text($data['message']), $post_approval);
            }
            // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

        unset($sql_data[POSTS_TABLE]['sql']);
    }

    $make_global = false;


Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

    // Start Ultimate Points
    if ($config['points_enable'])
    {
        $sql = "UPDATE " . POSTS_TABLE . ' SET points_received = points_received + ' . $data['user_points'] . ' WHERE post_id = ' . (int) $data['post_id'];
        $db->sql_query($sql);

        $sql = "UPDATE " . POSTS_TABLE . ' SET points_post_edit_temp = ' . $data['user_points'] . ' WHERE post_id = ' . (int) $data['post_id'];
        $db->sql_query($sql);
    }
    // End Ultimate Points


<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

        if (sizeof($poll['poll_options']) < sizeof($cur_poll_options))
        {
            $sql = 'DELETE FROM ' . POLL_OPTIONS_TABLE . '
                WHERE poll_option_id > ' . sizeof($poll['poll_options']) . '
                    AND topic_id = ' . $data['topic_id'];
            $db->sql_query($sql);
        }

Add before

Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:Select all

        // Start Ultimate Points
        $p_poll_received = '';

        // Check the rest of the points
        $sql = 'SELECT points_poll_received, poster_id
            FROM ' . POSTS_TABLE . '
            WHERE post_id = ' . $data['post_id'];
        $result = $db->sql_query_limit($sql, 1);
        $row = $db->sql_fetchrow($result);
        $db->sql_freeresult($result);

        // Now let's define the variables with the points for the post
        $p_poll_received = $row['points_poll_received'];

        if ($config['points_enable'] && ($p_poll_received == 0) && $points_config['pertopic_enable'] && ($p_pertopic > 0))
        {
            $ultimate_points->new_poll($data['forum_id'], $data['post_id'], sizeof($sql_insert_ary), $post_approval);
        }
        // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

            $db->sql_query('DELETE FROM ' . POLL_VOTES_TABLE . ' WHERE topic_id = ' . $data['topic_id']);
            $db->sql_query('UPDATE ' . POLL_OPTIONS_TABLE . ' SET poll_option_total = 0 WHERE topic_id = ' . $data['topic_id']);

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

            // Start Ultimate Points
            // If the forum points per topic values is greater 0 and topic_received is greater than 0 and pertopic = 1
            if (($p_poll_received > 0) && $points_config['pertopic_enable'] && ($p_pertopic > 0))
            {
                // First substract points from user account
                substract_points($row['poster_id'], $p_poll_received);

                // Reset the field $p_poll_received
                reset_poll_received($data['post_id']);

                // Now recalculate points
                $ultimate_points->update_poll($row['poster_id'], $data['forum_id'], $data['post_id'], sizeof($poll['poll_options']), $post_approval);
            }
            // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

        if ($space_taken && $files_added)
        {
            set_config_count('upload_dir_size', $space_taken, true);
            set_config_count('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

        // Start Ultimate Points
        if ($mode == 'post' || $mode == 'reply' || $mode == 'quote' && $config['points_enable'] == 1)
        {
            $ultimate_points->new_attachment($data['forum_id'], $data['post_id'], $files_added, $post_approval);
        }
        // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

    // we need to update the last forum information
    // only applicable if the topic is not global and it is approved

Add before

Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:Select all

    // Start Ultimate Points
    if ($mode == 'edit' && $config['points_enable'] == 1)
    {
        $p_attachment_received = '';

        // Check the attachment points
        $sql = 'SELECT points_attachment_received, poster_id
            FROM ' . POSTS_TABLE . '
            WHERE post_id = ' . $data['post_id'];
        $result = $db->sql_query_limit($sql, 1);
        $row = $db->sql_fetchrow($result);
        $db->sql_freeresult($result);

        // Now let's define the variables with the points for the attachment
        $p_attachment_received     = $row['points_attachment_received'];

        // First substract points from user account
        substract_points($row['poster_id'], $p_attachment_received);

        // Recalculate the points for the field points_attachment_received
        $new_number = '';
        $sql = 'SELECT COUNT(attach_id) AS number_attachments
            FROM ' . ATTACHMENTS_TABLE . '
            WHERE post_msg_id = ' . $data['post_id'];
        $result = $db->sql_query($sql);
        $row = $db->sql_fetchrow($result);
        $new_number = $row['number_attachments'];
        $db->sql_freeresult($result);

        if (empty($new_number))
        {
            $new_points = 0;
        }
        else
        {
            $new_points = $points_values['points_per_attach'] + ($new_number * $points_values['points_per_attach_file']);
        }

        // Adding points to points_attachment_received
        update_attachment_field($data['post_id'], $new_points);

        // Update users points
        if ($config['points_enable'] && $post_approval)
        {
            add_points($poster_id, $new_points);
        }
    }
    // End Ultimate Points

<< Hide
Open: includes/functions_user.php
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

function user_add($user_row, $cp_data = false)
{
    global $db, $user, $auth, $config, $phpbb_root_path, $phpEx;

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

   
    // Start Ultimate Points
    global $points_config, $points_values;

    if ($config['points_enable'] && isset($points_values['reg_points_bonus']))
    {
        $register_points = $points_values['reg_points_bonus'];
    }
    else
    {
        $register_points = 0;
    }
    // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

        'user_inactive_reason'    => 0,
        'user_inactive_time'    => 0,

Add before

Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:Select all

        'user_points'            => $register_points,
        'user_robbery_pm'        => 1,

<< Hide
Open: common.php
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

// Set PHP error handler to ours
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');

Add before

Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:Select all

// Start Ultimate Points
require($phpbb_root_path . 'includes/points/functions_points.' . $phpEx);
// End Ultimate Points


<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

$config = $cache->obtain_config();

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all


// Start Ultimate Points
if (isset($config['points_name']))
{
    $points_config = $cache->obtain_points_config();
    $points_values = $cache->obtain_points_values();
}
// End Ultimate Points

<< Hide
Open: index.php
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

// Assign index specific vars
$template->assign_vars(array(

Add before

Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:Select all

/**
* Ultimate Points
*/
if (isset($config['points_name']))
{
    // Add points lang
    $user->add_lang('mods/points');

    // Generate the bank statistics
    $sql_array = array(
        'SELECT'    => 'SUM(holding) AS total_holding, count(user_id) AS total_users',
        'FROM'        => array(
            POINTS_BANK_TABLE => 'b',
        ),
        'WHERE'        => 'id > 0',
    );
    $sql = $db->sql_build_query('SELECT', $sql_array);
    $result = $db->sql_query($sql);
    $b_row = $db->sql_fetchrow($result);
    $bankholdings = ( $b_row['total_holding'] ) ? $b_row['total_holding'] : 0;
    $bankusers = $b_row['total_users'];

    // Create most rich users - cash and bank
    $limit = $points_values['number_show_top_points'];
    $sql_array = array(
        'SELECT'    => 'u.user_id, u.username, u.user_colour, u.user_points, b.holding',

        'FROM'        => array(
            USERS_TABLE  => 'u',
        ),
        'LEFT_JOIN' => array(
            array(
                'FROM'    => array(POINTS_BANK_TABLE => 'b'),
                'ON'    => 'u.user_id = b.user_id'
            )
        ),
    );
    $sql = $db->sql_build_query('SELECT', $sql_array);
    $result = $db->sql_query($sql);

    // Create a new array for the users
    $rich_users = array();

    // Create sorting array
    $rich_users_sort = array();

    // Loop all users array to escape the 0 points users
    while ($row = $db->sql_fetchrow($result))
    {
        if ($row['user_points'] > 0 || $row['holding'] > 0) //let away beggars
        {
            $total_points = $row['user_points'] + $row['holding'];
            $index = $row['user_id'];
            $rich_users[$index] = array('total_points' => $total_points, 'username' => $row['username'], 'user_colour' => $row['user_colour'], 'user_id' => $index);
            $rich_users_sort[$index] = $total_points;
        }
    }

    $db->sql_freeresult($result);

    // Sort by points desc
    arsort ($rich_users_sort);

    // Extract the user ids
    $rich_users_sort  = array_keys($rich_users_sort);

    // Create new sorted rich users array
    $rich_users_sorted = array();

    // Check, if number of users in array is below the set limit
    $new_limit = sizeof($rich_users) < $limit ? sizeof($rich_users) : $limit;

    for($i = 0; $i < $new_limit; $i++)
    {
        $rich_users_sorted[] = $rich_users[$rich_users_sort[$i]];
    }

    // Send to template
    foreach($rich_users_sorted as $var)
    {
        $template->assign_block_vars('rich_user', array(
            'USERNAME'            => get_username_string('full', $var['user_id'], $var['username'], $var['user_colour']),
            'SUM_POINTS'        => number_format_points($var['total_points']),
            'SUM_POINTS_NAME'    => $config['points_name'],
        ));
    }

    //Generate the points statistics
    $sql_array = array(
        'SELECT'    => 'SUM(user_points) AS total_points',
        'FROM'        => array(
            USERS_TABLE => 'u',
        ),
        'WHERE'        => 'user_points > 0',
    );
    $sql = $db->sql_build_query('SELECT', $sql_array);
    $result = $db->sql_query($sql);
    $b_row = $db->sql_fetchrow($result);
    $totalpoints = ( $b_row['total_points'] ) ? $b_row['total_points'] : 0;
    $lottery_time = $user->format_date(($points_values['lottery_last_draw_time'] + $points_values['lottery_draw_period']), false, true);

    // Run Lottery
    if ($points_values['lottery_draw_period'] != 0 && $points_values['lottery_last_draw_time'] + $points_values['lottery_draw_period'] - time() < 0)
    {
        if (!function_exists('run_lottery'))
        {
            include($phpbb_root_path . 'includes/points/functions_points.' . $phpEx);
        }
        if (!function_exists('send_pm'))
        {
            include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
        }
        run_lottery();
    }

    $template->assign_vars(array(
        'TOTAL_BANK_USER'            => sprintf($user->lang['POINTS_BUPOINTS_TOTAL'], $bankusers, $points_values['bank_name']),
        'TOTAL_BANK_POINTS'            => sprintf($user->lang['POINTS_BPOINTS_TOTAL'], number_format_points($bankholdings), $config['points_name'], $points_values['bank_name']),
        'TOTAL_POINTS_USER'            => sprintf($user->lang['POINTS_TOTAL'], number_format_points($totalpoints), $config['points_name']),
        'LOTTERY_TIME'                => sprintf($user->lang['POINTS_LOTTERY_TIME'], $lottery_time),
        'S_DISPLAY_LOTTERY'            => ($points_config['display_lottery_stats']) ? true : false,
        'S_DISPLAY_POINTS_STATS'    => ($points_config['stats_enable']) ? true : false,
        'S_DISPLAY_INDEX'            => ($points_values['number_show_top_points'] > 0) ? true : false,
    ));
}

<< Hide
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


// Start Ultimate Points
$user->add_lang('mods/points');
// End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

        $template->assign_vars(array(
            'L_POSTS_IN_QUEUE'    => $user->lang('NUM_POSTS_IN_QUEUE', $member['posts_in_queue']),

Add before

Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:Select all

        // Start Ultimate Points
        global $db, $ultimate_points, $points_config, $points_values;

        $locked = $blocked = false;

        if ($config['points_enable'])
        {
            $check_auth = new auth();
            $check_auth->acl($member);
            $locked = $check_auth->acl_get('u_use_points');
        }

        if ($points_config['bank_enable'] && $config['points_enable'])
        {
            $check_auth = new auth();
            $check_auth->acl($member);
            $blocked = $check_auth->acl_get('u_use_bank');
        }

        if (empty($holding['user_id']))
        {
            $sql_array = array(
                'SELECT'    => 'holding',
                'FROM'        => array(
                    POINTS_BANK_TABLE => 'b',
                ),
                'WHERE'        => 'user_id = ' . (int) $user_id,
            );
            $sql = $db->sql_build_query('SELECT', $sql_array);
            $result = $db->sql_query($sql);
            $bank_row = $db->sql_fetchrow($result);
            $bank_row['holding'] = ( empty($bank_row['holding']) ) ? '0' : $bank_row['holding'];
        }

        // Check if user has a bank account
        $sql_array = array(
            'SELECT'    => '*',
            'FROM'        => array(
                POINTS_BANK_TABLE => 'b',
            ),
            'WHERE'        => 'user_id = ' . (int) $user_id,
        );
        $sql = $db->sql_build_query('SELECT', $sql_array);
        $result = $db->sql_query($sql);
        $row = $db->sql_fetchrow($result);

        if (!isset($row['holding']) && $user->data['user_id'] > 0)
        {
            $template->assign_block_vars('no_account', array(
                'BANK_NO_ACCOUNT'    => sprintf($user->lang['BANK_NO_ACCOUNT'], $points_values['bank_name']),
            ));
        }
        else if ($user->data['user_id'] > 0)
        {
            $template->assign_block_vars('has_account', array());
        }

        $db->sql_freeresult($result);

        if (isset($config['points_name']))
        {
            $template->assign_vars(array(
                'L_MOD_USER_POINTS'    => ($auth->acl_get('a_points') || $auth->acl_get('m_chg_points')) ? sprintf($user->lang['POINTS_MODIFY']) : '',
                'U_POINTS_MODIFY'    => ($auth->acl_get('a_points') || $auth->acl_get('m_chg_points')) ? append_sid("{$phpbb_root_path}points.$phpEx", "mode=points_edit&amp;user_id=".$user_id."&amp;adm_points=1")  : '',
                'L_MOD_USER_BANK'    => ($auth->acl_get('a_points') || $auth->acl_get('m_chg_bank')) ? sprintf($user->lang['POINTS_MODIFY']) : '',
                'U_BANK_MODIFY'        => ($auth->acl_get('a_points') || $auth->acl_get('m_chg_bank')) ? append_sid("{$phpbb_root_path}points.$phpEx", "mode=bank_edit&amp;user_id=".$user_id."&amp;adm_points=1")  : '',
                'U_POINTS_DONATE'    => ($auth->acl_get('u_use_transfer')) ? append_sid("{$phpbb_root_path}points.$phpEx", "mode=transfer&amp;i=".$user_id) : '',
                'L_DONATE'            => ($auth->acl_get('u_use_transfer')) ? sprintf($user->lang['POINTS_DONATE']) : '',
                'BANK_GOLD'            => sprintf(number_format_points($bank_row['holding'])),
                'USE_IMAGES_POINTS'    => $points_config['images_memberlist_enable'],
                'USE_BANK'            => $points_config['bank_enable'],
                'P_NAME'            => $config['points_name'],
                'U_LOCKED'            => !$locked,
                'U_BLOCKED'            => !$blocked,
                'USE_POINTS'        => $config['points_enable'],
                'USE_IMAGES_POINTS'    => $points_config['images_memberlist_enable'],
            ));
        }
        // End Ultimate Points


<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

    );
}

function _sort_last_active($first, $second)

Add before

Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:Select all

        // Start Ultimate Points
        'U_POINTS1'            => sprintf(number_format_points($data['user_points'])),
        // End Ultimate Points

<< Hide
Open: posting.php
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

// Load draft overview
if ($load && ($mode == 'reply' || $mode == 'quote' || $mode == 'post') && $post_data['drafts'])
{
    load_drafts($topic_id, $forum_id);
}

Add before

Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:Select all

// Start Ultimate Points
$sql_array = array(
    'SELECT'    => 'user_points',
    'FROM'      => array(
        USERS_TABLE => 'v',
    ),
    'WHERE'        => 'user_id = ' . (int) $user->data['user_id'],
);
$sql = $db->sql_build_query('SELECT', $sql_array);
$result = $db->sql_query($sql);
$user_points_old = $db->sql_fetchfield('user_points');
$db->sql_freeresult($result);
// End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

            $sql = 'DELETE FROM ' . POLL_VOTES_TABLE . "
                WHERE topic_id = $topic_id";
            $db->sql_query($sql);

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

            // Start Ultimate Points
            $p_poll_received = '';

            // Check the rest of the points
            $sql = 'SELECT points_poll_received, poster_id
                FROM ' . POSTS_TABLE . '
                WHERE topic_id = ' . $topic_id;
            $result = $db->sql_query_limit($sql, 1);
            $row = $db->sql_fetchrow($result);
            $db->sql_freeresult($result);

            // Now let's define the variables with the points for the post
            $p_poll_received     = $row['points_poll_received'];

            if ($p_poll_received > 0)
            {
                // First substract points from user account
                substract_points($row['poster_id'], $p_poll_received);

                // Reset the field $p_poll_received
                reset_poll_received_topic($topic_id);
            }
            // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

            $data = array(
                'topic_title'            => (empty($post_data['topic_title'])) ? $post_data['post_subject'] : $post_data['topic_title'],
                'topic_first_post_id'    => (isset($post_data['topic_first_post_id'])) ? (int) $post_data['topic_first_post_id'] : 0,

Add before

Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:Select all

            // Start Ultimate Points
            $user->add_lang('mods/points');

            $sql_array = array(
                'SELECT'    => 'config_name, config_value',
                'FROM'        => array(
                    POINTS_CONFIG_TABLE => 'c',
                ),
            );
            $sql = $db->sql_build_query('SELECT', $sql_array);
            $result = $db->sql_query($sql);

            while ($row = $db->sql_fetchrow($result))
            {
                $points_config[$row['config_name']] = $row['config_value'];
            }
            $db->sql_freeresult($result);

            if ($config['points_enable'])
            {
                switch ($mode)
                {
                    case 'post':
                        $points = ($points_config['pertopic_enable']) ? $post_data['forum_pertopic'] : 0;
                    break;
                    case 'reply':
                        $points = ($points_config['perpost_enable']) ? $post_data['forum_perpost'] : 0;
                    break;
                    case 'edit':
                        if ($post_data['poster_id'] == $user->data['user_id'])
                        {
                            $points = ($points_config['peredit_enable']) ? $post_data['forum_peredit'] : 0;
                        }
                        else
                        {
                            $points = 0;
                        }
                    break;
                    case 'quote':
                        $points= ($points_config['perpost_enable']) ? $post_data['forum_perpost'] : 0;
                    break;
                    default:
                        $points = 0;
                    break;
                }
            }
            else
            {
                $points = 0;
            }
            // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

                'topic_approved'        => (isset($post_data['topic_approved'])) ? $post_data['topic_approved'] : false,
                'post_approved'            => (isset($post_data['post_approved'])) ? $post_data['post_approved'] : false,

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

                // Start Ultimate Points
                'user_points'            => $points,
                // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

                meta_refresh(3, $redirect_url);

                $message = ($mode == 'edit') ? 'POST_EDITED' : 'POST_STORED';
                $message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="' . $redirect_url . '">', '</a>');

Replace with

Tip: Replace the preceding line(s) to find with the following lines.
Code:Select all

                // Start Ultimate Points
                if ($auth->acl_get('u_use_points') && $config['points_enable'])
                {
                    meta_refresh(3, $redirect_url); // Increased the refresh time to give user the chance to read their points

                    $sql_array = array(
                        'SELECT'    => 'user_points',
                        'FROM'        => array(
                            USERS_TABLE => 'v',
                        ),
                        'WHERE'        => 'user_id = ' . (int) $user->data['user_id'],
                    );
                    $sql = $db->sql_build_query('SELECT', $sql_array);
                    $result = $db->sql_query($sql);
                    $user_points_new = $db->sql_fetchfield('user_points');

                    $user_points_received = ($user_points_new - $user_points_old);

                    if ($mode == 'quote' OR $mode == 'reply')
                    {
                        $points_received = sprintf($user->lang['POINTS_RECEIVED_REPLY_MESSAGE'], (number_format_points($user_points_received)), $config['points_name']);
                    }
                    else if ($mode == 'edit')
                    {
                        $points_received = sprintf($user->lang['POINTS_RECEIVED_EDIT_MESSAGE'], (number_format_points($user_points_received)), $config['points_name']);
                    }
                    else
                    {
                        $points_received = sprintf($user->lang['POINTS_RECEIVED_POST_MESSAGE'], (number_format_points($user_points_received)), $config['points_name']);
                    }

                    $message = ($mode == 'edit') ? 'POST_EDITED' : 'POST_STORED';
                    $message = $user->lang[$message] . '<br /><br />' . $points_received . '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="' . $redirect_url . '">', '</a>');
                }
                else
                {
                    meta_refresh(3, $redirect_url); // Show normal refresh time

                    $message = ($mode == 'edit') ? 'POST_EDITED' : 'POST_STORED';
                    $message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="' . $redirect_url . '">', '</a>');
                }
                // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

                'post_reported'            => $post_data['post_reported'],
                'post_time'                => $post_data['post_time'],
                'poster_id'                => $post_data['poster_id'],

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

                // Start Ultimate Points
                'points_attachment_received'    => $post_data['points_attachment_received'],
                'points_poll_received'            => $post_data['points_poll_received'],
                'points_post_received'            => $post_data['points_post_received'],
                'points_topic_received'            => $post_data['points_topic_received'],
                'points_received'                => $post_data['points_received'],
                //End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

                'post_postcount'        => $post_data['post_postcount']
            );

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

            // Start Ultimate Points
            $sql = "UPDATE " . USERS_TABLE . " SET user_points = user_points - (" . $post_data['points_received'] . ' + ' . $post_data['points_attachment_received'] . ' + ' . $post_data['points_poll_received'] . ' + ' . $post_data['points_post_received'] . ' + ' . $post_data['points_topic_received'] . ") WHERE user_id = '" . $post_data['poster_id'] . "'";
            $db->sql_query($sql);
            // End Ultimate Points

<< Hide
Open: viewonline.php
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

        default:
            $location = $user->lang['INDEX'];
            $location_url = append_sid("{$phpbb_root_path}index.$phpEx");
        break;

Add before

Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:Select all

        // Start Ultimate Points
        case 'points':
            $user->add_lang('mods/points');
            $location = $user->lang['POINTS_VIEWING'];
            $location_url = append_sid("{$phpbb_root_path}points.$phpEx");
        break;
        // End Ultimate Points

<< Hide
Open: viewtopic.php
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

// Start session management
$user->session_begin();
$auth->acl($user->data);

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

// Start Ultimate Points
$user->setup('mods/points');
// End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

    'TOPIC_AUTHOR_FULL'        => get_username_string('full', $topic_data['topic_poster'], $topic_data['topic_first_poster_name'], $topic_data['topic_first_poster_colour']),
    'TOPIC_AUTHOR_COLOUR'    => get_username_string('colour', $topic_data['topic_poster'], $topic_data['topic_first_poster_name'], $topic_data['topic_first_poster_colour']),
    'TOPIC_AUTHOR'            => get_username_string('username', $topic_data['topic_poster'], $topic_data['topic_first_poster_name'], $topic_data['topic_first_poster_colour']),

Add before

Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:Select all

    // Start Ultimate Points
    'P_NAME'            => $config['points_name'],
    'USE_POINTS'        => $config['points_enable'],
    'USE_IMAGES_POINTS'    => $points_config['images_topic_enable'],
    'USE_BANK'            => $points_config['bank_enable'],
    // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

$sql = $db->sql_build_query('SELECT', array(
    'SELECT'    => 'u.*, z.friend, z.foe, p.*

In-line Find

Tip: This is a partial match of a line for in-line operations.
Code:Select all

'u.*, z.friend, z.foe, p.*

In-line Add after

Code:Select all

, pb.id AS pb_id, pb.holding AS pb_holding

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

    'LEFT_JOIN'    => array(
        array(
            'FROM'    => array(ZEBRA_TABLE => 'z'),
            'ON'    => 'z.user_id = ' . $user->data['user_id'] . ' AND z.zebra_id = p.poster_id'
        )

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

        , array(
            'FROM'    => array(POINTS_BANK_TABLE => 'pb'),
            'ON'    => 'pb.user_id = p.poster_id'
        )

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

        if ($row['post_approved'])
        {
            $has_attachments = true;
        }
    }

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

    // Start Ultimate Points
    $has_account = true;
    $holding = (empty($holding)) ? array() : $holding;
    $pointslock = $banklock = '';

    if ($config['points_enable'])
    {
        // Get the points status
        $check_auth = new auth();
        $check_auth->acl($row);
        $pointslock = !$check_auth->acl_get('u_use_points');

        // Get the bank status
        if ($points_config['bank_enable'])
        {
            $check_auth = new auth();
            $check_auth->acl($row);
            $banklock = !$check_auth->acl_get('u_use_bank');
        }

        if (!isset($row['pb_holding']) && $poster_id > 0)
        {
            $has_account = false;
        }
        $holding[$poster_id] = ($row['pb_holding']) ? $row['pb_holding'] : '0';
    }
    else
    {
        $holding[$poster_id] = '0';
    }
    // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

        // Make sure the icon actually exists
        'icon_id'            => (isset($icons[$row['icon_id']]['img'], $icons[$row['icon_id']]['height'], $icons[$row['icon_id']]['width'])) ? $row['icon_id'] : 0,

Add before

Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:Select all

        // Start Ultimate Points
        'points'            => $row['user_points'],
        'points_lock'        => $pointslock,
        'bank_lock'            => $banklock,
        'bank_account'        => $has_account,
        // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

                'search'            => '',
                'age'                => '',

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

                // Start Ultimate Points
                'points'            => 0.00,
                'points_lock'        => true,
                'bank_lock'            => true,
                'bank_account'        => true,
                // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

                'warnings'        => (isset($row['user_warnings'])) ? $row['user_warnings'] : 0,
                'from'            => (!empty($row['user_from'])) ? $row['user_from'] : '',

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

                // Start Ultimate Points
                'points'        => $row['user_points'],
                'points_lock'    => $pointslock,
                'bank_lock'        => $banklock,
                'bank_account'    => $has_account,
                // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

        $sql = 'SELECT *
            FROM ' . ATTACHMENTS_TABLE . '
            WHERE ' . $db->sql_in_set('post_msg_id', $attach_list) . '
                AND in_message = 0
            ORDER BY filetime DESC, post_msg_id ASC';
        $result = $db->sql_query($sql);

Replace with

Tip: Replace the preceding line(s) to find with the following lines.
Code:Select all

        // Start Ultimate Points
        $sql = 'SELECT a.*, e.extension, e.points_extension, e.points_extension_costs
            FROM ' . ATTACHMENTS_TABLE . ' a
            LEFT JOIN ' . EXTENSIONS_TABLE . ' e
                ON (a.extension = e.extension)
            WHERE ' . $db->sql_in_set('post_msg_id', $attach_list) . '
                AND in_message = 0
            ORDER BY filetime DESC, post_msg_id ASC';
        $result = $db->sql_query($sql);
        // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

        'POSTER_WARNINGS'    => $user_cache[$poster_id]['warnings'],
        'POSTER_AGE'        => $user_cache[$poster_id]['age'],

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

        // Start Ultimate Points
        'POSTER_POINTS'        => number_format_points($user_cache[$poster_id]['points']),
        'POSTER_LOCK'        => $user_cache[$poster_id]['points_lock'],
        'POSTER_BANK_LOCK'    => $user_cache[$poster_id]['bank_lock'],
        'USER_ID'            => $poster_id,
        'BANK_GOLD'            => number_format_points($holding[$poster_id]),
        'BANK_ACCOUNT'        => $user_cache[$poster_id]['bank_account'],
        // End Ultimate Points

<< Hide
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

        'S_IGNORE_POST'        => ($row['hide_post']) ? true : false,
        'L_IGNORE_POST'        => ($row['hide_post']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), '<a href="' . $viewtopic_url . "&amp;p={$row['post_id']}&amp;view=show#p{$row['post_id']}" . '">', '</a>') : '',

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

        // Start Ultimate Points
        'L_MOD_USER_POINTS'        => ($auth->acl_get('a_points') || $auth->acl_get('m_chg_points')) ? sprintf($user->lang['POINTS_MODIFY']) : '',
        'U_POINTS_MODIFY'        => ($auth->acl_get('a_points') || $auth->acl_get('m_chg_points')) ? append_sid("{$phpbb_root_path}points.$phpEx", "mode=points_edit&amp;user_id=".$poster_id."&amp;adm_points=1&amp;post_id=".$row['post_id'])  : '',
        'L_BANK_USER_POINTS'    => ($auth->acl_get('a_points') || $auth->acl_get('m_chg_bank')) ? sprintf($user->lang['POINTS_MODIFY']) : '',
        'U_BANK_MODIFY'            => ($auth->acl_get('a_points') || $auth->acl_get('m_chg_bank')) ? append_sid("{$phpbb_root_path}points.$phpEx", "mode=bank_edit&amp;user_id=".$poster_id."&amp;adm_points=1&amp;post_id=".$row['post_id'])  : '',
        'L_DONATE'                => ($auth->acl_get('u_use_transfer')) ? sprintf($user->lang['POINTS_DONATE']) : '',
        'U_POINTS_DONATE'        => ($auth->acl_get('u_use_transfer')) ? append_sid("{$phpbb_root_path}points.$phpEx", "mode=transfer&amp;i=".$poster_id."&amp;adm_points=1&amp;post_id=".$row['post_id'])  : '',
        'S_IS_OWN_POST'            => ($poster_id == $user->data['user_id']) ? true : false,
        // End Ultimate Points

<< Hide
Open: styles/prosilver/template/index_body.html
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

<!-- IF NEWEST_USER -->
    <h3>{L_STATISTICS}</h3>
    <p>{TOTAL_POSTS} &bull; {TOTAL_TOPICS} &bull; {TOTAL_USERS} &bull; {NEWEST_USER}</p>
<!-- ENDIF -->

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all


<!-- Start Ultimate Points -->
<!-- IF S_DISPLAY_POINTS_STATS -->
<h3>{L_POINTS_STATISTICS}</h3>
<p>{TOTAL_POINTS_USER} &bull; {TOTAL_BANK_USER} &bull; {TOTAL_BANK_POINTS} <!-- IF S_DISPLAY_LOTTERY--> &bull; {LOTTERY_TIME} <!-- ENDIF --></p>

<!-- IF S_DISPLAY_INDEX -->
<h3>{L_POINTS_MOST_RICH_USERS}</h3>
<p><!-- BEGIN rich_user --><!-- IF not rich_user.S_FIRST_ROW --> &bull; <!-- ENDIF -->{rich_user.USERNAME} ({rich_user.SUM_POINTS} {rich_user.SUM_POINTS_NAME})<!-- END rich_user --></p>
<!-- ENDIF -->
<!-- ENDIF -->
<!-- End Ultimate Points -->

<< Hide
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_JOINED}:</dt> <dd>{JOINED}</dd>
            <dt>{L_VISITED}:</dt> <dd>{VISITED}</dd>

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

            <!-- Start Ultimate Points -->
            <!-- IF USE_POINTS -->
                <dt>{L_POINTS_CASH_ON_HAND}:</dt>
                <dd><!-- IF U_LOCKED --><b>{L_POINTS_LOCKED}</b><!-- ELSE -->{U_POINTS1} <!-- IF USE_IMAGES_POINTS --><img src="{T_THEME_PATH}/images/money.png" width="11px" height="11px" alt="" /><!-- ELSE -->{P_NAME}<!-- ENDIF --><br /><a href="{U_POINTS_DONATE}">{L_DONATE}</a> <a href="{U_POINTS_MODIFY}">{L_MOD_USER_POINTS}</a><!-- ENDIF --></dd>
            <!-- IF USE_BANK -->
                <!-- BEGIN has_account -->
                <dt>{L_BANK_BALANCE}:</dt>
                <dd><!-- IF U_BLOCKED --><b>{L_POINTS_LOCKED}</b><!-- ELSE --> {BANK_GOLD} <!-- IF USE_IMAGES_POINTS --><img src="{T_THEME_PATH}/images/money.png" width="11px" height="11px" alt="" /><!-- ELSE -->{P_NAME}<!-- ENDIF --><br /><a href="{U_BANK_MODIFY}">{L_MOD_USER_BANK}</a><!-- ENDIF --></dd>
                <!-- END has_account -->
                <!-- BEGIN no_account -->
                <dt>{L_BANK_BALANCE}:</dt>
                <dd>{no_account.BANK_NO_ACCOUNT}</dd>
                <!-- END no_account -->
            <!-- ENDIF -->
            <!-- ENDIF -->
            <!-- End Ultimate Points -->

<< Hide
Open: styles/prosilver/template/overall_header.html
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

                <li class="icon-faq"><a href="{U_FAQ}" title="{L_FAQ_EXPLAIN}">{L_FAQ}</a></li>

Add before

Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:Select all

                <!-- Start Ultimate Points -->
                <!-- IF S_POINTS_ENABLE -->
                <li class="icon-points"><a href="{U_POINTS}" title="{L_POINTS_EXPLAIN}">{POINTS_LINK}<!-- IF S_USER_LOGGED_IN and S_USE_POINTS --> [ {USER_POINTS} ] <!-- ENDIF --></a></li>
                <!-- ENDIF -->
                <!-- End Ultimate Points -->

<< Hide
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 -->
        <!-- IF postrow.POSTER_JOINED --><dd><strong>{L_JOINED}:</strong> {postrow.POSTER_JOINED}</dd><!-- ENDIF -->

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

        <!-- Begin Ultimate Points -->
        <!-- IF USE_POINTS --><dd><strong>{L_POINTS_CASH_ON_HAND}:</strong> <!-- IF postrow.POSTER_LOCK -->{L_POINTS_LOCKED}<!-- ELSE -->{postrow.POSTER_POINTS} <!-- IF USE_IMAGES_POINTS --><img src="{T_THEME_PATH}/images/money.png" width="11px" height="11px" alt="" /><!-- ELSE -->{P_NAME}<!-- ENDIF --><!-- IF not postrow.S_IS_OWN_POST and S_USER_LOGGED_IN --><br /><a href="{postrow.U_POINTS_DONATE}">{postrow.L_DONATE}</a><!-- ELSE --><br /><!-- ENDIF --><a href="{postrow.U_POINTS_MODIFY}">{postrow.L_MOD_USER_POINTS}</a><!-- ENDIF --></dd>
        <!-- IF USE_BANK --><!-- IF postrow.BANK_ACCOUNT --><dd><strong>{L_BANK_TITLE_MAIN}:</strong><!-- IF postrow.POSTER_BANK_LOCK --> {L_POINTS_LOCKED}<!-- ELSE --> {postrow.BANK_GOLD} <!-- IF USE_IMAGES_POINTS --><img src="{T_THEME_PATH}/images/money.png" width="11px" height="11px" alt="" /><!-- ELSE -->{P_NAME}<!-- ENDIF --><br /><a href="{postrow.U_BANK_MODIFY}">{postrow.L_MOD_USER_POINTS}</a><!-- ENDIF --></dd><!-- ENDIF --><!-- ENDIF --><!-- ENDIF -->
        <!-- End Ultimate Points -->

<< Hide
Open: styles/prosilver/theme/bidi.css
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

/* Icon images
---------------------------------------- */
.rtl .sitehome,

In-line Find

Tip: This is a partial match of a line for in-line operations.
Code:Select all

.rtl .sitehome,

In-line Add after

Code:Select all

 .rtl .icon-points,

<< Hide
Open: styles/prosilver/theme/buttons.css
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

.sitehome, .icon-faq, .icon-members, .icon-home, .icon-ucp, .icon-register, .icon-logout,
.icon-bookmark, .icon-bump, .icon-subscribe, .icon-unsubscribe, .icon-pages,

In-line Find

Tip: This is a partial match of a line for in-line operations.
Code:Select all

, .icon-search

In-line Add after

Code:Select all

, .icon-points

<< Hide
Open: styles/prosilver/theme/colours.css
Find

Tip: This may be a partial find and not the whole line.
Code:Select all

.icon-search                    { background-image: url("{T_THEME_PATH}/images/icon_search.gif"); }

Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:Select all

.icon-points                    { background-image: url("{T_THEME_PATH}/images/icon_points.gif"); }

<< Hide
PHP install file

There is a PHP install file that needs to be run in order to complete the installation.
To run it point your browser to, for example, domain.tld/phpBB3/install_ultimate_points.php
Code:Select All

install_ultimate_points.php

DIY instructions

These are manual instructions that cannot be performed automatically. You should follow these instructions carefully.
Code:Select all

Please delete the file root/install_ultimate_points.php after the successful installation. Basic settings, permissions and modules will be created during the installation.

Although it's already done by the installer, you may additionally refresh the cache, the template and the theme cache.

After you are done with the installation, please go to your ACP and check all the settings. Affected are the settings in the .MODS tab concerning the UPS itself and also in every single forum. Depending on additional mods installed, which support the UPS, you may find additional settings over there.

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.

原创粉丝点击