DragonByte Credits: Change Charge BBCode Styling

juabo10

Well-known member
Registered
Joined
Aug 20, 2020
Messages
72
Points
28

Reputation:

Dude this function looks great for Resources section, for example: "This resource has been locked. You can unlock it with 2 credits".
How could I do it? Would someone be kind to share a guide?
 

Roland

Well-known member
Registered
Joined
Sep 19, 2022
Messages
89
Points
8

Reputation:

Dude this function looks great for Resources section, for example: "This resource has been locked. You can unlock it with 2 credits".
How could I do it? Would someone be kind to share a guide?
juabo10good idea?

@BattleKing
 
View previous repliesā€¦

leanndamiann1

Well-known member
Registered
Joined
Apr 22, 2021
Messages
190
Points
28

Reputation:

Once you show me the content, can it be displayed like this?

4.png
 

fakemasked

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

Reputation:

View previous repliesā€¦

BattleKing

Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
Joined
May 24, 2020
Messages
3,519
Points
523

Reputation:

which line of charge.php should I edit for unlocked content style
fakemaskedhere it is, but I would do this normally in a different style and way, but for now it is ok:

Before purchase:
1682522861850.png


After purchase:
1682523051404.png


Same file as before need to be changed, it is the charge.php one:
PHP:
        // If users have paid for this
        $test = $renderer->renderSubTree($tag['children'], $options);
        return ' 
            <div class="bbCodeBlock">
                <div class="bbCodeBlock-title">
                    <xf:fa icon="fa-eye" />
                    ' . \XF::phrase('Content unlocked') . ' for ' . $charge->Currency->getFormattedValue($charge->cost) . ' ' .  $charge->Currency->title .
                    '
                <br>
                Unlocked content not working or different what you expected? Feel free to ask for a credits refund bz creating a new <a href="">support ticket</a>.
                </div>
                <hr>
                <div class="bbCodeBlock-content">
                    <div class="bbCodeBlock-expandContent">' .
                        $test
                        . '
                    </div>
                </div>
            </div>';
        // old code
       // $renderer->renderSubTree($tag['children'], $options);
    }
 

fakemasked

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

Reputation:

here it is, but I would do this normally in a different style and way, but for now it is ok:

Before purchase:
View attachment 34748

After purchase:
View attachment 34749

Same file as before need to be changed, it is the charge.php one:
PHP:
        // If users have paid for this
        $test = $renderer->renderSubTree($tag['children'], $options);
        return ' 
            <div class="bbCodeBlock">
                <div class="bbCodeBlock-title">
                    <xf:fa icon="fa-eye" />
                    ' . \XF::phrase('Content unlocked') . ' for ' . $charge->Currency->getFormattedValue($charge->cost) . ' ' .  $charge->Currency->title .
                    '
                <br>
                Unlocked content not working or different what you expected? Feel free to ask for a credits refund bz creating a new <a href="">support ticket</a>.
                </div>
                <hr>
                <div class="bbCodeBlock-content">
                    <div class="bbCodeBlock-expandContent">' .
                        $test
                        . '
                    </div>
                </div>
            </div>';
        // old code
       // $renderer->renderSubTree($tag['children'], $options);
    }
BattleKingThankyou so much i will take care of CSS šŸ˜
 

leanndamiann1

Well-known member
Registered
Joined
Apr 22, 2021
Messages
190
Points
28

Reputation:

here it is, but I would do this normally in a different style and way, but for now it is ok:

Before purchase:
View attachment 34748

After purchase:
View attachment 34749

Same file as before need to be changed, it is the charge.php one:
PHP:
        // If users have paid for this
        $test = $renderer->renderSubTree($tag['children'], $options);
        return ' 
            <div class="bbCodeBlock">
                <div class="bbCodeBlock-title">
                    <xf:fa icon="fa-eye" />
                    ' . \XF::phrase('Content unlocked') . ' for ' . $charge->Currency->getFormattedValue($charge->cost) . ' ' .  $charge->Currency->title .
                    '
                <br>
                Unlocked content not working or different what you expected? Feel free to ask for a credits refund bz creating a new <a href="">support ticket</a>.
                </div>
                <hr>
                <div class="bbCodeBlock-content">
                    <div class="bbCodeBlock-expandContent">' .
                        $test
                        . '
                    </div>
                </div>
            </div>';
        // old code
       // $renderer->renderSubTree($tag['children'], $options);
    }
BattleKingI understand but I don't use the charge, I use the HIDE tag, can it be modified?
 

leanndamiann1

Well-known member
Registered
Joined
Apr 22, 2021
Messages
190
Points
28

Reputation:

May be yes I have to check that code
Code:
\XF:phrase('Content unlocked') . ' for ' . $charge->Currency->getFormattedValue($charge->cost) . ' ' . $charge->Currency->title .
fakemaskedI understand but those codes are from charge.ph of the dragon credits addon, and I don't use the CHARGE tag, I use the HIDE tag of the addon [XenConcept] Hide BBCode] maybe it can also be edited to put some text when it unlocks the content.

For example I want to add some text above for when it is unlocked
Sin tĆ­tulo.png

I leave you an example maybe you understand
 

fakemasked

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

Reputation:

I understand but those codes are from charge.ph of the dragon credits addon, and I don't use the CHARGE tag, I use the HIDE tag of the addon [XenConcept] Hide BBCode] maybe it can also be edited to put some text when it unlocks the content.

For example I want to add some text above for when it is unlocked
View attachment 34761
I leave you an example maybe you understand
leanndamiann1Understood you want same in hideBb code addon Right?
 

BattleKing

Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
Joined
May 24, 2020
Messages
3,519
Points
523

Reputation:

I understand but those codes are from charge.ph of the dragon credits addon, and I don't use the CHARGE tag, I use the HIDE tag of the addon [XenConcept] Hide BBCode] maybe it can also be edited to put some text when it unlocks the content.

For example I want to add some text above for when it is unlocked
View attachment 34761
I leave you an example maybe you understand
leanndamiann1But gentlemen what is the title of that thread? It was a question for DBTech Credits Charge box, not about hide bbcode.

Open new thread for hide question. This is much more easy than the credit one
 

Sagex

Well-known member
Registered
Joined
Sep 10, 2021
Messages
59
Points
28

Reputation:

So has anyone found a way to make that?
 

fakemasked

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

Reputation:

fakemasked

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

Reputation:

if you get it, then please share it with the users
if not I will have a look into it later
BattleKingi only got it for locked content not for unlocked one šŸ„² just tell me which template or line i have to edit and i will do it and post it full code here for both
 
Last edited:

fakemasked

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

Reputation:

Last edited:
Top