Jump to content

How can I create a button to donate tokens for videos if a user wishes to voluntarily?

Recommended Posts

  • Tech Support changed the title to How can I create a button to donate tokens for videos if a user wishes to voluntarily?

Here are steps that you can have these buttons on member's profile page. NOTE: this is only for KVS Default Theme.


Step 1. Please check your theme version in Website UI -> Theme settings. If it says KVS Default (8.4) or above, then skip this step. If its version less than 8.4, then update these 2 files on your server:



Step 2. Edit member profile template in Website UI -> Page components -> include_member_profile.tpl and add the following code at the very end:

{{if $data.user_id!=$smarty.session.user_id && $lang.donations}}
	<div style="margin-top: 10px">
		{{foreach item="donation" from=","|explode:$lang.donations}}
			{{assign var="donation" value=$donation|trim|intval}}
			{{if $donation>0}}
				<div style="display: inline-block; padding: 5px">
					<form data-form="ajax" data-success="message" data-message="{{$lang.memberzone.success_message_donate|count_format:"%tokens%":$donation|replace:"%display_name%":$data.display_name}}">
						<div class="generic-error hidden"></div>
						<input type="hidden" name="function" value="donate"/>
						<input type="hidden" name="tokens" value="{{$donation}}"/>
						<input type="submit" class="submit" value="{{$lang.memberzone.button_donate|count_format:"%tokens%":$donation}}"/>


Step 3. Go into Website UI -> Texts and add the following 4 texts:

  • donations = 1, 5, 100
  • validation.common.tokens_not_enough_tokens = You don't have enough tokens to donate.
  • memberzone.button_donate = Donate [count]%tokens% tokens || 1: 1 token[/count]
  • memberzone.success_message_donate = Thank you! Your donation of [count]%tokens% tokens || 1: 1 token[/count] was send to <b>%display_name%</b>.

The first one lists possible donations in tokens, adjust it to get more or less donation buttons with the needed amounts.

  • Like 2
  • Thanks 1
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.

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...