[TH] Credits [Deleted]

Question, does this allow members in a particular user group to receive a monthy amount of credits, kinda like an allowance or paycheck? Also, does can you trigger credit award events by uses interaction with XenMedia and XenResource - as well as posting thread replies and new threads, etc?

Thanks @Dalton Prock - I have a current credits system but I am about to toss it as it is does not function well and is not at all user friendly for the end user.
 
Question, does this allow members in a particular user group to receive a monthy amount of credits, kinda like an allowance or paycheck? Also, does can you trigger credit award events by uses interaction with XenMedia and XenResource - as well as posting thread replies and new threads, etc?

Thanks @Dalton Prock - I have a current credits system but I am about to toss it as it is does not function well and is not at all user friendly for the end user.
Such features are shown on the product information page here. But here are some of the events that it allows when it comes to sending credits to users.
  • Daily Login: Triggers the first time a user views the board each day
  • Upload Avatar: Triggers when a user first uploads an avatar
  • Create New Thread: Triggers when a user creates a new thread
  • Thread Deleted: Triggers when a user's thread is deleted
  • Create New Post: Triggers when a user creates a new post
  • Post Deleted: Triggers when a user's post is deleted
  • Like Content: Triggers when a user likes content (Applies to the 'liker')
  • Content Received Like: Triggers when a user likes content (Applies to the 'likee')
  • Registration: Triggers when a user creates a new account
  • Trophy Received: Triggers when a user receives a new trophy
  • Vote On Poll: Triggers when a user votes on a poll
  • Follow User: Triggers when a user follows another user (Applies to the follower)
  • Get A Follower: Triggers when a user follows another user (Applies to the user followed)
  • Download Attachment: Triggers when a user downloads an attachment for the first time (Applies to the downloader)
  • Attachment Downloaded: Triggers when a user downloads an attachment for the first time (Applies to the uploader)
  • Create resource: Triggers when using the XenForo Resource Manager and someone creates a resource
  • Rate a resource: Triggers when using the XenForo Resource Manager and someone rates a resource
  • Share media: Triggers when using the XenForo Media Gallery and someone posts any media
  • Give Rating: Triggers when someone rates a post via Post Ratings
 
In my opinion both addons (credits and shop) are useful, but in beta-status.
There are a lot of small things that should be fixed. The breadcrumps for example dont follow the same logic.
In the sidebar everything is bold when selected, but not the transactions. To fix this example, find template
adcredit_wrapper
and

add the red word

<li><a
class="{xen:if "{$selectedKey} == 'credits/transactions'", 'secondaryContent', 'primaryContent'}"
href="{xen:link adcredits}">


I will try to fix everything i can find now. If you are interested in this addon and have something found that should be repaired, please let me know. Maybe we can improve it together.
 
1. I add a credits page instead to show the transactions.
My breadcrump is changed to
Shop (=credits), no h1
Shop
Transactions (or purchases ...)

With the shop we have also a problem, because with more than one cat, we have

credits / shop / categories / categoriy name (in the original the links are wrong) I will rename and change to

Shop (credits) / Products (product-cats) / Product-category
the formerly shop must go, because it has no own page.

adcreditshop shows the same like adcreditshop-categories/

Finally i have now:

Shop => New page with a welcome and explain, what we do here (earn credits and buy nice things), h1 = &nbsp;

Shop => actions like transactions log, packages, transfer, withdraw as h1
like
Forum > Shop
transactions

Shop >
Products (or Productcats)

with

Shop > Products(cats)
CatName

or

Shop > Products(cats)
Purchases

Maybe the purchases shoul be also here:

Shop
Purchases


Now the navi makes sense to me.
I also have moved the admin stuff (in my example) in the sidebar to the area we had shop before. (transfer, withdraw)

Also the Popup needs to be shown in the same order like the sidebar.
 
There are smaller issues.
adcredit_withdraw
has no breadcrump at all. Add something like

<xen:navigation>
<xen:breadcrumb href="{xen:Link adcredits}">{xen:phrase adcredit_credits}</xen:breadcrumb>
</xen:navigation>

BTW: Is there any mod that checks if a smilie has a space behind? Else you have that problems here. It happens also in normal text without code.
There is an addon adding a space after a smilie from Chris D. maybe? It should be installed here. :)
 
If i could do this in some hours, i cant imagine what you pros could do in the same time

a) new page for credits itself to explain what we do here
b) logical and consistent breadcrumps
c) Showing the categories in the sidebar

Missing: color the choosen cat in the next step

credits.webp
 
Any hope for the 2x upgrade?
Reward members if the refer Users and the refer users are promoted to a certain usergroups?
Buy sticky?
Buy thread bump?
 
For refering users we need another update, correct? There should be one from TH and one with "competition" in the name.
If installed we can handle that. At the moment i care for other things like random action, but later i can try to solve that.
What means "buy sticky"? To make a thread or a post sticky?
For bumbing you also need a "bump"-addon before, correct?
 
Some things i dont understand, may someone has an idea about?

A product can expire. But what this means?
Say i sell a ticket for a show you can see the whole year, but it will expire in two weeks.
What happens after this time? It seems it is still in my basket. And there is still a button to gift it.
When i try to gift it, i get an error "invalid product".

For tickets with a special date we miss a field "expires at date", right?
 
My tickets cann now by sold for a date also. Expires at 12/12/2019 for example.
And a prodcut that is expired, should not be giftet, right?
 
For actionGift we have

if (!$purchase['giftable'] || !$purchase['active']) {
return $this->responseError(new XenForo_Phrase('adcredit_invalid_purchase'));
}

but there is no $purchase['giftable'] , it is only $purchase['active'] from the purchase.
If you change a product from giftable to not giftable, a sold product is still giftable.

Here we need to decide; if a product was giftable and is sold, then it should stay giftable? For all times or only one time?
Or should the trigger from the product also decide about the sold product?

There are fetchoptions for the product also; but it seems the giftable is not here, i will try to debug the array ...
 
There are so many small issues ... like
{not linked user} Test sent you a gift

but

You sent a gift ... to {linked user} Test
 
If you search for
adcredit_transaction_list_gift
you can find a solution with:
Code:
<xen:if is="{$transaction.sender_id} == {$visitor.user_id}">
    <xen:comment><!-- you send someone credits --></xen:comment>
    {xen:phrase adcredit_you_sent_gift_X_to_Y,
    'name={xen:if $transaction.receiver_id, {xen:helper username, $transaction.receiver, 'primaryText'}, '<span class="primaryText">{$transaction.receiver_username}</span>'}',
    'productName={$transaction.extra_data.product_title}','credits={xen:helper credit, $transaction.credits, $transaction.currency_id}',
    'credits={xen:helper credit, $transaction.credits, $transaction.currency_id}'}
<xen:else />
    <xen:comment><!-- someone sent you credits --></xen:comment>
    {xen:phrase adcredit_x_sent_gift_y_to_you,
        'name={xen:if $transaction.sender_id, {xen:helper username, {xen:array 'user_id={$transaction.sender_id}', 'username={$transaction.sender_username}'},'primaryText'}, '<span class="primaryText">{$transaction.sender_username}</span>'}',
        'productName={$transaction.extra_data.product_title}','credits={xen:helper credit, $transaction.credits, $transaction.currency_id}',
        'credits={xen:helper credit, $transaction.credits, $transaction.currency_id}'}
</xen:if>

-- {xen:helper expire, $transaction.extra_data.product_id,$transaction.transaction_date}


Probably there should be next to the large array $transaction two small arrays $transaction.receiver and $transaction.sender;
but sender is not here. While checking the query:

Code:
        return $this->fetchAllKeyed('
            SELECT transaction.*,
                sender.username AS sender_user_username,
                sender.avatar_date AS sender_user_avatar_date,
                sender.avatar_width AS sender_user_avatar_width,
                sender.avatar_height AS sender_user_avatar_height,
                sender.gravatar AS sender_user_gravatar,

                receiver.username AS receiver_user_username,
                receiver.avatar_date AS receiver_user_avatar_date,
                receiver.avatar_width AS receiver_user_avatar_width,
                receiver.avatar_height AS receiver_user_avatar_height,
                receiver.gravatar AS receiver_user_gravatar
                ' . $joinOptions['selectFields'] . '
            FROM adcredit_transaction AS transaction
                LEFT JOIN xf_user AS sender ON(sender.user_Id = transaction.sender_id)
                LEFT JOIN xf_user AS receiver ON(receiver.user_Id = transaction.receiver_id)
                ' . $joinOptions['joinTables'] . '
            ORDER BY transaction.transaction_date DESC
            ', 'transaction_id');

I cant find the point, so the solution from above:
1: {xen:helper username, $transaction.receiver, 'primaryText'} but
2: {xen:helper username, {xen:array 'user_id={$transaction.sender_id}', 'username={$transaction.sender_username}'},'primaryText'} helps.
 
It looks like that the problem is here:
class Audentio_Credit_Core_ViewPublic_Credit_Transactions

seems that the sender is only done with the action "transfer", but not with a gift for example.

This helps:

Code:
            case 'transfer':
                return true;
                break;
            case 'gift':
                return true;
                break;
            default:
                return false;
                break;

Then we can use for
adcredit_transaction_list_gift

Code:
<xen:if is="{$transaction.sender_id} == {$visitor.user_id}">
    <xen:comment><!-- you send someone credits --></xen:comment>
    {xen:phrase adcredit_you_sent_gift_X_to_Y,
    'name={xen:if $transaction.receiver_id, {xen:helper username, $transaction.receiver, 'primaryText'}, '<span class="primaryText">{$transaction.receiver_username}</span>'}',
    'productName={$transaction.extra_data.product_title}','credits={xen:helper credit, $transaction.credits, $transaction.currency_id}',
    'credits={xen:helper credit, $transaction.credits, $transaction.currency_id}'}
<xen:else />
    <xen:comment><!-- someone sent you credits --></xen:comment>
    {xen:phrase adcredit_x_sent_gift_y_to_you,
        'name={xen:if $transaction.sender_id, {xen:helper username, $transaction.sender,'primaryText'}, '<span class="primaryText">{$transaction.sender_username}</span>'}',
        'productName={$transaction.extra_data.product_title}','credits={xen:helper credit, $transaction.credits, $transaction.currency_id}',
        'credits={xen:helper credit, $transaction.credits, $transaction.currency_id}'}
</xen:if>

-- {xen:helper expire, $transaction.extra_data.product_id,$transaction.transaction_date}


Maybe we should build in the avatars also in the next step.
 
Top Bottom