Jump to content

Theme customization: how to add token flow table in member profile area


Tech Support

Recommended Posts

KVS provides many different functionality around tokens, here is a brief summary.

Users can get tokens via:

  • Buying tokens for money using billings (e.g. buy 100 tokens for $1.00) for later use inside KVS. Not all billings support them: Segpay, Paypal, Verotel, Crypto.
  • Getting tokens for activity, see Activity awards section in Settings -> Memberzone settings in KVS admin panel (e.g. get 10 tokens for each 1 approved comment and etc).
  • Selling premium access to their videos, or albums, or channels, or the whole profile (this should be adjusted in templates, as by default no themes support ability for users to specify price for their content or profile).
  • Involving traffic to their videos on your site, e.g. upload some videos and refer them on their other sites, or social networks and engage some new visitors to your site, they can earn N tokens for M number of unique views, see in Settings -> Memberzone settings (for example, 100 tokens for each 100 unique view on each their video).
  • Inviting other users in paid conversions.
  • Receiving donations.

Users can spend tokens on:

  • Purchasing access to other videos, albums, channels (then have access to all videos of that channel) or profiles (them have access to all videos and albums of that profile).
  • Giving tips / donations to other users (need template changes, not supported in any themes).
  • Spending tokens on conversations via internal messenger, e.g. pay 1 token for each 1 message.
  • Receiving payouts from you in real money, if you want to pay money for their activity or content.

KVS default theme only supports certain subset of these features, because it is not possible to include all features into one theme, many features are designed for different types of sites. Theme supports purchasing videos and albums for tokens, showing token balance, ability to purchase tokens for money via payment processors, e.g. something you actually need for a PPV paysite. Theme doesn't support displaying token flow (e.g. table that explains how many token awarded for each activity or content sale), doesn't support ability to specify price in tokens for content, doesn't support ability to purchase access to channels or profiles, doesn't support donations, and doesn't support payouts (displaying list of payouts with information of how much tokens and $$$ was paid and when).

There are other guides for adding some functionality related to tokens:

 

 

This guide will provide basic steps to display token inflow and outflow at the member's profile. Please note some of its functionality needs at least KVS 6.1.0 version, which is still under development at the moment of writing.

token_flow.thumb.png.3edc27ba74dc18c7660a5be0cc800c0a.png

This GUI provides 3 filters:

  • Filter by 4 possible token flows (Token spending, token buying, awards and payouts).
  • Filter by month to show only token transactions happened in that month (for the last 12 months).
  • Filter by payout, to see which payouts happened in the past (up to 10 latest). Here you can see all the awards that were paid to you in any specific payout, plus you can filter awards that are not paid yet and are due to be paid in future.

 

Step 1. In Website UI -> Language files -> Default language add the following block of texts:

memberzone.tokens_group.0 = Token flow
memberzone.tokens_group.1 = Spent tokens
memberzone.tokens_group.2 = Purchased tokens
memberzone.tokens_group.3 = Awards
memberzone.tokens_group.4 = Paid tokens
memberzone.tokens_group.5 = Donations

memberzone.tokens_label_period = Period
memberzone.tokens_label_payout = Payout
memberzone.tokens_label_payout_unpaid = Not paid yet
memberzone.tokens_label_payout_title = Payout %1%
memberzone.tokens_label_payout_title_in_progress = (in progress)
memberzone.tokens_label_payout_title_paid = (paid)

memberzone.tokens_label_action = Action
memberzone.tokens_label_tokens = Tokens
memberzone.tokens_label_info = Info
memberzone.tokens_label_info_deleted = The object has been deleted
memberzone.tokens_label_date = Date

memberzone.tokens_flow_types.purchase_video = Video purchased
memberzone.tokens_flow_types.purchase_album = Album purchased
memberzone.tokens_flow_types.purchase_dvd = Channel subscription purchased
memberzone.tokens_flow_types.purchase_user = Member subscription purchased
memberzone.tokens_flow_types.purchase_access_package = Premium access purchased
memberzone.tokens_flow_types.purchase_tokens = Tokens purchased
memberzone.tokens_flow_types.purchase_messages = Internal messages paid
memberzone.tokens_flow_types.award_signup = Signup award
memberzone.tokens_flow_types.award_login = Login award
memberzone.tokens_flow_types.award_avatar = Avatar upload award
memberzone.tokens_flow_types.award_cover = Cover upload award
memberzone.tokens_flow_types.award_comment = Comment submit award
memberzone.tokens_flow_types.award_video_upload = Video submit award
memberzone.tokens_flow_types.award_album_upload = Album submit award
memberzone.tokens_flow_types.award_post_upload = Post submit award
memberzone.tokens_flow_types.award_video_sale = Your video sold
memberzone.tokens_flow_types.award_album_sale = Your album sold
memberzone.tokens_flow_types.award_user_sale = Your subscription sold
memberzone.tokens_flow_types.award_dvd_sale = Your channel subscription sold
memberzone.tokens_flow_types.award_referral = Your referral revenue
memberzone.tokens_flow_types.award_donation = You were donated
memberzone.tokens_flow_types.award_video_traffic = Your video views
memberzone.tokens_flow_types.award_album_traffic = Your album views
memberzone.tokens_flow_types.award_embed_traffic = Your video embedded
memberzone.tokens_flow_types.award_messages = Your earning from messages
memberzone.tokens_flow_types.payout = You were paid out
memberzone.tokens_flow_types.donation = You've donated

 

Step 2. In Website UI -> Pages open [Memberzone] My Profile page for editing and put the following line into its template code somewhere under <div class="main-container-user">. This DIV renders a list of different blocks (e.g. profile info, fav videos and etc.), so you need to choose where you want token flow to be located on the page structure:

{{insert name="getBlock" block_id="list_members_tokens" block_name="My Tokens"}}

Save the changes.

 

Step 3. Locate the newly created My Tokens block on this page and open it for editing. Under Block parameters enable these:

  • items_per_page = 10 (or whatever number of items you want to be displayed at a time)
  • var_from = from_tokens
  • sort_by = Date
  • var_flow_group = group
  • var_date_from = date_from
  • var_date_to = date_to
  • var_payout_id = payout_id
  • redirect_unknown_user_to = /?login

Put the following code into its block template:

{{assign var="list_tokens_title" value=$lang.memberzone.tokens_group.$flow_group|default:$lang.memberzone.tokens_group.0}}
{{if $payout.payout_id}}
	{{assign var="payout_title" value=$payout.added_date|date_format:"%Y-%m-%d"}}
	{{assign var="list_tokens_title" value=$lang.memberzone.tokens_label_payout_title|replace:"%1%":$payout_title}}
	{{if $payout.status_id==1}}
		{{assign var="list_tokens_title" value="`$list_tokens_title` `$lang.memberzone.tokens_label_payout_title_in_progress`"}}
	{{elseif $payout.status_id==2}}
		{{assign var="list_tokens_title" value="`$list_tokens_title` `$lang.memberzone.tokens_label_payout_title_paid`"}}
	{{/if}}
{{elseif $payout_unpaid==1}}
	{{assign var="list_tokens_title" value=$lang.memberzone.tokens_label_payout_unpaid}}
{{/if}}

<div id="{{$block_uid}}">
	<div class="headline">
		<h{{$list_tokens_header_level|default:"2"}}>{{$list_tokens_title}}</h{{$list_tokens_header_level|default:"2"}}>

		{{if count($payouts)>0}}
			<div class="sort">
				<span class="icon type-sort"></span>
				<strong>
					{{if $payout.payout_id}}
						{{$payout.added_date|date_format:"%Y-%m-%d"}}
					{{elseif $payout_unpaid==1}}
						{{$lang.memberzone.tokens_label_payout_unpaid}}
					{{else}}
						{{$lang.memberzone.tokens_label_payout}}
					{{/if}}
				</strong>
				<ul id="{{$block_uid}}_payout_list">
					{{if $payout.payout_id || $payout_unpaid==1}}
						<li>
							<a data-action="ajax" data-container-id="{{$block_uid}}_payout_list" data-block-id="{{$block_uid}}" data-parameters="payout_id:">{{$lang.memberzone.tokens_label_payout}}</a>
						</li>
					{{/if}}
					{{if $payout_unpaid!=1}}
						<li>
							<a data-action="ajax" data-container-id="{{$block_uid}}_payout_list" data-block-id="{{$block_uid}}" data-parameters="payout_id:0">{{$lang.memberzone.tokens_label_payout_unpaid}}</a>
						</li>
					{{/if}}
					{{foreach from=$payouts item="item" name="payouts"}}
						{{if $item.payout_id!=$payout.payout_id && $smarty.foreach.payouts.iteration<=10}}
							<li>
								<a data-action="ajax" data-container-id="{{$block_uid}}_payout_list" data-block-id="{{$block_uid}}" data-parameters="payout_id:{{$item.payout_id}}">{{$item.added_date|date_format:"%Y-%m-%d"}}</a>
							</li>
						{{/if}}
					{{/foreach}}
				</ul>
			</div>
		{{/if}}
		<div class="sort">
			<span class="icon icon-calendar"></span>
			<strong>
				{{if $date_from}}
					{{$date_from|strtotime|date_format:"%Y-%m"}}
				{{else}}
					{{$lang.memberzone.tokens_label_period}}
				{{/if}}
			</strong>
			<ul id="{{$block_uid}}_period_list">
				<li>
					<a data-action="ajax" data-container-id="{{$block_uid}}_period_list" data-block-id="{{$block_uid}}" data-parameters="group:{{$flow_group}};date_from:;date_to:">{{$lang.memberzone.tokens_label_period}}</a>
				</li>
				{{section name="calendar" start=0 loop=12}}
					{{assign var="month1" value=$smarty.section.calendar.index}}
					{{assign var="month2" value=$smarty.now|date_format:"%m"}}
					{{assign var="year1" value=$smarty.now|date_format:"%Y"}}
					{{assign var="month1" value=$month2-$month1}}
					{{if $month1<1}}
						{{assign var="month1" value=$month1+12}}
						{{assign var="year1" value=$year1-1}}
					{{/if}}
					{{assign var="month2" value=$month1+1}}
					{{assign var="year2" value=$year1}}
					{{if $month2>12}}
						{{assign var="month2" value=$month2-12}}
						{{assign var="year2" value=$year2+1}}
					{{/if}}
					{{if $month1<10}}
						{{assign var="month1" value="0`$month1`"}}
					{{/if}}
					{{if $month2<10}}
						{{assign var="month2" value="0`$month2`"}}
					{{/if}}
					{{assign var="period_from" value="`$year1`-`$month1`-01"}}
					{{assign var="period_to" value="`$year2`-`$month2`-01"|strtotime}}
					{{assign var="period_to" value=$period_to-86400}}
					{{assign var="period_to" value=$period_to|date_format:"%Y-%m-%d"}}
					{{if $period_from!=$date_from}}
						<li>
							<a data-action="ajax" data-container-id="{{$block_uid}}_period_list" data-block-id="{{$block_uid}}" data-parameters="group:{{$flow_group}};date_from:{{$period_from}};date_to:{{$period_to}}">{{$year1}}-{{$month1}}</a>
						</li>
					{{/if}}
				{{/section}}
			</ul>
		</div>
		<div class="sort">
			<span class="icon type-sort"></span>
			<strong>{{$lang.memberzone.tokens_group.$flow_group|default:$lang.memberzone.tokens_group.0}}</strong>
			<ul id="{{$block_uid}}_group_list">
				{{section name="groups" start=0 loop=5}}
					{{assign var="group" value=$smarty.section.groups.index}}
					{{if $flow_group!=$group}}
						<li>
							<a data-action="ajax" data-container-id="{{$block_uid}}_group_list" data-block-id="{{$block_uid}}" data-parameters="group:{{$group}};date_from:{{$date_from}};date_to:{{$date_to}}">{{$lang.memberzone.tokens_group[$group]}}</a>
						</li>
					{{/if}}
				{{/section}}
			</ul>
		</div>
	</div>

	<div class="box">
		<div class="list-tokens">
			{{if count($data)>0}}
				<table width="100%">
					<tr>
						<th>{{$lang.memberzone.tokens_label_action}}</th>
						<th>{{$lang.memberzone.tokens_label_tokens}}</th>
						<th>{{$lang.memberzone.tokens_label_info}}</th>
						<th>{{$lang.memberzone.tokens_label_date}}</th>
					</tr>
					{{foreach item="item" from=$data}}
						<tr>
							<td>
								{{$lang.memberzone.tokens_flow_types[$item.flow_type]|default:$item.flow_type}}
							</td>
							<td>{{$item.tokens}}</td>
							<td>
								{{if $item.object_info!=''}}
									{{$item.object_info}}
								{{elseif $item.object_id>0}}
									{{$lang.memberzone.tokens_label_info_deleted}}
								{{/if}}
								{{if $item.notes!=''}}
									({{$item.notes}})
								{{/if}}
							</td>
							<td>{{$item.date|date_format:"%Y-%m-%d %H:%M:%S"}}</td>
						</tr>
					{{/foreach}}
				</table>
			{{else}}
				<div class="empty-content">{{$lang.common_list.no_data}}</div>
			{{/if}}
		</div>
	</div>

	{{assign var="pagination_custom_parameters" value="group:`$flow_group`;payout_id:`$payout.payout_id`;date_from:`$date_from`;date_to:`$date_to`"}}
	{{include file="include_pagination_block_common.tpl"}}
</div>

 

Link to comment
Share on other sites

  • 5 months later...

When you put this block into [Memberzone] My Profile page:

{{insert name="getBlock" block_id="list_members_tokens" block_name="My Tokens"}}

You can wrap it into some condition like other blocks, see for example how video_edit block is inserted, e.g.:

{{if $page_type=='tokens'}}
{{insert name="getBlock" block_id="list_members_tokens" block_name="My Tokens"}}
{{/if}}

Then find this block on top:

{{assign var="page_type" value="profile"}}
{{if $smarty.request.type=='videos' || $smarty.request.type=='albums' || $smarty.request.type=='channels' || $smarty.request.type=='channel' || $smarty.request.type=='friends' || $smarty.request.type=='fav_videos' || $smarty.request.type=='fav_albums' || $smarty.request.type=='playlists' || $smarty.request.type=='subscriptions' || $smarty.request.type=='purchases' || $smarty.request.type=='messages' || $smarty.request.type=='conversation' || $smarty.request.type=='upload_video' || $smarty.request.type=='upload_album'}}
	{{assign var="page_type" value=$smarty.request.type}}
{{/if}}

You also need to add tokens to the list of allowed pages:

{{assign var="page_type" value="profile"}}
{{if $smarty.request.type=='videos' || $smarty.request.type=='albums' || $smarty.request.type=='channels' || $smarty.request.type=='channel' || $smarty.request.type=='friends' || $smarty.request.type=='fav_videos' || $smarty.request.type=='fav_albums' || $smarty.request.type=='playlists' || $smarty.request.type=='subscriptions' || $smarty.request.type=='purchases' || $smarty.request.type=='messages' || $smarty.request.type=='conversation' || $smarty.request.type=='upload_video' || $smarty.request.type=='upload_album' || $smarty.request.type=='tokens'}}
	{{assign var="page_type" value=$smarty.request.type}}
{{/if}}

Then you can put link to this page passing ?type=tokens in request URL, e.g.

https://domain.com/my/?page=tokens

Or add a rewrite into .htaccess file like this:

RewriteRule ^my/tokens/$                         member_profile_my.php?type=tokens [L,QSA]

And then use this URL:

https://domain.com/my/tokens/

Link to comment
Share on other sites

  • 7 months later...
On 2/23/2023 at 3:32 AM, Tech Support said:

Involving traffic to their videos on your site, e.g. upload some videos and refer them on their other sites, or social networks and engage some new visitors to your site, they can earn N tokens for M number of unique views, see in Settings -> Memberzone settings (for example, 100 tokens for each 100 unique view on each their video).

I want to ask about this point and how it works.

When you say unique views, how many time per day can a single person be counted across the entire website? Is it once per video, or maybe once per uploader?

Is there any protection against someone buying traffic and sending it to a specific video link? Either real or fake traffic.

This feature sounds good, but also dangerous at the same time. I assume there will need to be some relatively aggressive monetization methods to be able to support this model.

Link to comment
Share on other sites

7 hours ago, Ashl said:

When you say unique views, how many time per day can a single person be counted across the entire website? Is it once per video, or maybe once per uploader?

1 unique IP per 24 per video is considered as a unique view.

7 hours ago, Ashl said:

Is there any protection against someone buying traffic and sending it to a specific video link? Either real or fake traffic.

No, there is no any protection except IP unique. In theory someone would be able to use proxies and fake the unique views. The feature is not designed for monetization, but it is designed for motivating users to share their videos and earn some tokens, that can later be used on your site for purchasing some premium access.

What you probably need is some tool for purchasing traffic and paying for it, such tools normally have analytics and protection that can be used together to decide about payments. For example if the analytics decides that the quality of some traffic is bad, it should reduce payment rates for this traffic.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...