Reputation:
Hello,
Is there a way to change the styling of the charge bbcode to something like this
Instead of just a button?
Reputation:
Did you faked that screenshot or where did you took this from
Reputation:
from Nulledbb.com
Reputation:
send the link to that post please I do not want to search for it
Reputation:
send the link to that post please I do not want to search for it
<div style="display: flex;border-style: solid;border-color: blue;color: #4DA9F4;background-color: rgba( 46, 61, 150, 0.15);align-items: center !important;">
<span>Click any button to proceed</span>
<span style="margin-left: auto !important;">
<input type="button" style="float:right!important" class="button" value="' . \XF::phrase('dbtech_credits_costs_x_y', [
'param1' => $charge->Currency->getFormattedValue($charge->cost),
'param2' => $charge->Currency->title
]) . '" />
</span>
</span>
</div>
Reputation:
View attachment 30024
You can change the src\addons\DBTech\Credits\BbCode\Charge.php script in renderButtonForUser to your needs, like:
PHP:<div style="display: flex;border-style: solid;border-color: blue;color: #4DA9F4;background-color: rgba( 46, 61, 150, 0.15);align-items: center !important;"> <span>Click any button to proceed</span> <span style="margin-left: auto !important;"> <input type="button" style="float:right!important" class="button" value="' . \XF::phrase('dbtech_credits_costs_x_y', [ 'param1' => $charge->Currency->getFormattedValue($charge->cost), 'param2' => $charge->Currency->title ]) . '" /> </span> </span> </div>
But I would suggest to use css classes for such kind of things.
if (!$visitor->user_id)
{
elseif (
$userId
&& $userId != $visitor->user_id
&& !$charge->Purchases->offsetExists($visitor->user_id)
) {
return '
Reputation:
PHP:if (!$visitor->user_id) {
Pasting the code after this doesn't change anything.
PHP:elseif ( $userId && $userId != $visitor->user_id && !$charge->Purchases->offsetExists($visitor->user_id) ) { return '
And pasting it after this makes the styling work but not the button. Button returns not clickable.
Reputation:
Reputation:
Reputation:
Reputation:
I guess it is the ELESIF part. did u tried to change that as well
Reputation:
Reputation:
Did you faked that screenshot or where did you took this from
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?
Reputation:
I want know too
@BattleKing
I hope I will find to check it again this week with the latest version and get back to you
Reputation:
Thank you dude, we will wait
protected static function renderButtonForUser(int $userId, \DBTech\Credits\Entity\Charge $charge): ?string
{
$visitor = \XF::visitor();
if (!$visitor->user_id)
{
return '
<div style="display: flex;border-style: solid;border-color: blue;color: #4DA9F4;background-color: rgba( 46, 61, 150, 0.15);align-items: center !important;">
<span>Click any button to proceed</span>
<span style="margin-left: auto !important;">
<input type="button" style="float:right!important" class="button" value="' . \XF::phrase('dbtech_credits_costs_x_y', [
'param1' => $charge->Currency->getFormattedValue($charge->cost),
'param2' => $charge->Currency->title
]) . '" />
</span>
</span>
</div>
';
}
elseif (
$userId
&& $userId != $visitor->user_id
&& !$charge->Purchases->offsetExists($visitor->user_id)
) {
return '
<div style="display: flex;border-style: solid;border-color: blue;color: #4DA9F4;background-color: rgba( 46, 61, 150, 0.15);align-items: center !important;">
<span>Click any button to proceed</span>
<span style="margin-left: auto !important;">
<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>
</span>
</div>
';
}
return null;
}
Reputation:
@BattleKing which file did you edited! To archive this style ?
Reputation:
@BattleKing which file did you edited! To archive this style ?
Reputation:
Hello,
Can anyone tell me how can hide "Richest Users" from events tab please?
I tried many times, but can't
Regards!
You can use a template modification to remove that, or show it only to specific groups