DragonByte Credits: Change Charge BBCode Styling

fakemasked

Well-known member
Registered
Joined
Apr 10, 2023
Messages
77
Points
8

Reputation:

4.png

@BattleKing Bro kindly tell how to get this what line should I edit ?


#Solved Thanks to @BattleKing
 
Last edited:

Pr0fesseur

Moderator
Staff member
Moderator
+Lifetime VIP+
V.I.P Member
Collaborate
Registered
Joined
Nov 20, 2019
Messages
367
Points
103

Reputation:

@BattleKing this would be the dopest thing! literally dragonbyte does nothing to make their products better visually
 

BuffsPlx

Member
Registered
Joined
Mar 4, 2023
Messages
5
Points
13

Reputation:

Could anyone help me achieve the result above Pr0fesseur post? This is for 5.8.5, thanks much in advance :cool:

PHP:
    protected static function renderButtonForUser(int $userId, \DBTech\Credits\Entity\Charge $charge): ?string
    {
        $visitor = \XF::visitor();

        if (!$visitor->user_id)
        {
            return '
                <span>
                    <input type="button" class="button" value="' . \XF::phrase('dbtech_credits_costs_x_y', [
                    'param1' => $charge->Currency->getFormattedValue($charge->cost),
                    'param2' => $charge->Currency->title
                ]) . '" />
                </span>
            ';
        }
        elseif (
            $userId
            && $userId != $visitor->user_id
            && !$charge->Purchases->offsetExists($visitor->user_id)
        ) {
            return '
                <span>
                    <input
                        type="button"
                        class="button"
                        data-xf-click="overlay"
                        data-href="' . \XF::app()->router('public')->buildLink('dbtech-credits/currency/buy-content', $charge->Currency, ['content_type' => $charge->content_type, 'content_id' => $charge->content_id, 'content_hash' => $charge->content_hash]) . '"
                        value="' . \XF::phrase('dbtech_credits_view_for_x_y', [
                    'param1' => $charge->Currency->getFormattedValue($charge->cost),
                    'param2' => $charge->Currency->title
                ]) . '"
                    />
                </span>
            ';
        }

        return null;
    }
 
Top