- Microlancer Beta Tester
- Author had a File in an Envato Bundle
- Author was Featured
- Bought between 50 and 99 items
- Exclusive Author
- Has been a member for 3-4 years
- Item was Featured
- Sold between 100 000 and 250 000 dollars
Ok, ok.. don’t get excited: it’s not a plugin
, it’s a core modification, but it works. Tried the plugin way but there are not many / none good resources on the internet about Vanilla Addons, so would have taken me much more if it was even possible.
- Download and install latest vanilla forums ( ’2.0.17.8’ )
- Open _install/conf/config.php and make sure the registration methor line looks like this
$Configuration['Garden']['Registration']['Method'] = 'Basic';
- Open _install/applications/dashboard/views/entry/registerbasic.php and make sure it looks like this -> http://pastie.org/2404174
- Download Purchase Verificator from http://wiki.envato.com/selling/tips-selling/essential-resources-for-marketplace-authors/
- Unpack and edit config.php to match your details
- Open _install/applications/controllers/ and copy both config.php and Envato_marketplaces.php
- Open _install/applications/controllers/class.entrycontroller.php and add at line 806 or so ( function RegisterBasic )
require dirname(__FILE__).'/Envato_marketplaces.php'; require dirname(__FILE__).'/config.php'; $e = new Envato_marketplaces(); $e->set_api_key($config['api_key']); $v = $e->verify_purchase($config['username'],$_POST['User/DiscoveryText']); if(!isset($v->buyer)){ die('Press Back Button and enter the correct purchase code..'); } - All done!
Demo ( setup in my forums ) -> http://bit.ly/q9fhre
Download link to the already customised package -> http://bit.ly/mX527H
- United Kingdom
- Community Superstar
- Attended a Community Meetup
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Sold between 5 000 and 10 000 dollars
- Has been a member for 2-3 years
- Microlancer Beta Tester
- Bought between 100 and 499 items
- Referred between 10 and 49 users
I dont get what this is?
aaranmcguire said
I dont get what this is?
Vanilla is a forum software package you can put on your website. The modification ZoomIt shows here allows you to create a customers only forum which only lets people view/post to the forum if they’ve been verified with Envato that they have infact made a purchase from you.
Pretty neat actually! I was thinking about opening up some forums, so I’ll bookmark this for later. 
- Envato Staff
- Sold between 100 000 and 250 000 dollars
- Support Staff
- United States
- Author had a Free File of the Month
- Microlancer Beta Tester
- Beta Tester
- Interviewed on the Envato Notes blog
That looks great! I’m going to bookmark this and give it a try sometime. 
coolies!
Now, can we get this for bbpress?

- Microlancer Beta Tester
- Author had a Free File of the Month
- Has been a member for 3-4 years
- Item was Featured
- Author was Featured
- Austria
- Exclusive Author
- Referred between 200 and 499 users
I was searching in the past for such a solution and came up with this:
-
add a new registration method to the list:

open theapplications/dashboard/class.settingscontroller.phpfile and add followin line to theRegistrationMethodsarray (around line 630):'Purchasecode' => "New users need an Envato purchase code."
-
now modify the
applications/dashboard/class.entrycontroller.php:
Add this new private function:private function RegisterPurchasecode($InvitationCode) { if ($this->Form->IsPostBack() === TRUE) { $this->InvitationCode = $this->Form->GetValue('InvitationCode'); $verify = $this->verifyPurchasecode($this->InvitationCode); if(!$verify['success']){ $this->UserModel->Validation->AddValidationResult('InvitationCode', T('The provided purchase code is invalid.')); } // Add validation rules that are not enforced by the model $this->UserModel->DefineSchema(); // $this->UserModel->Validation->ApplyRule('Name', 'Username', $this->UsernameError); $this->UserModel->Validation->ApplyRule('TermsOfService', 'Required', T('You must agree to the terms of service.')); $this->UserModel->Validation->ApplyRule('Password', 'Required'); $this->UserModel->Validation->ApplyRule('Password', 'Match'); // $this->UserModel->Validation->ApplyRule('DateOfBirth', 'MinimumAge'); try { $Values = $this->Form->FormValues(); unset($Values['Roles']); $AuthUserID = $this->UserModel->Register($Values); if (!$AuthUserID) { $this->Form->SetValidationResults($this->UserModel->ValidationResults()); } else { // The user has been created successfully, so sign in now. Gdn::Session()->Start($AuthUserID); if ($this->Form->GetFormValue('RememberMe')) Gdn::Authenticator()->SetIdentity($AuthUserID, TRUE); $this->FireEvent('RegistrationSuccessful'); $this->UserModel->SendWelcomeEmail($AuthUserID, '', 'Register'); // ... and redirect them appropriately $Route = $this->RedirectTo(); if ($this->_DeliveryType != DELIVERY_TYPE_ALL) { $this->RedirectUrl = Url($Route); } else { if ($Route !== FALSE) Redirect($Route); } } } catch (Exception $Ex) { $this->Form->AddError($Ex); } } else { $this->InvitationCode = $InvitationCode; } $this->Render(); }and this one:private function verifyPurchasecode($purchasecode) { $username = 'YOUR_ENVATO_USERNAME'; // authors username $api_key = 'YOUR_API_KEY'; // api key from my account area $url = "http://marketplace.envato.com/api/edge/$username/$api_key/verify-purchase:$purchasecode.json"; $ch = curl_init($url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); $json_res = curl_exec($ch); $data = json_decode($json_res,true); if(!empty($data['verify-purchase'])){ $data['verify-purchase']['success'] = true; }else{ $data['verify-purchase']['success'] = false; } return $data['verify-purchase']; }(courtesy dtbaker) -
Let’s add the “view” for this:
create a new file:
applications/dashboard/views/entry/registerpurchasecode.phporthemes/YOUR_THEMENAME_/views/entry/registerpurchasecode.php
This contains the HTML of the registrations Form. Copy the content from theapplications/dashboard/views/entry/registerbasic.phpand append or prepend this to the list:< li > <?php echo $this?>Form->Label('Purchase Code', 'InvitationCode'); echo $this->Form->TextBox('InvitationCode', array('value' => $this->InvitationCode)); ?> < /li > - Now you have access to a new registration mode in the dashboard
I did this with vanilla 2.18.2b: http://rxa.li/support
Unfortunately it’s not possible to wrap it in a plugin and you can’t “simple” update your forum. But I guess repeating these steps will do it. At least you can switch back to “normal” registration mode any time
- Author had a File in an Envato Bundle
- Author was Featured
- Bought between 1 and 9 items
- Exclusive Author
- Has been a member for 3-4 years
- Interviewed on the Envato Notes blog
- Item was Featured
- Referred between 10 and 49 users
- Repeatedly Helped protect Envato Marketplaces against copyright violations
Been looking for something like this since quite some time. Will be trying it quite soon. Thanks much revaxarts.
Now that’s pure masterclass
I’ve been looking for something like this for quite some time.
Well done mates!
- Author was Featured
- Bought between 10 and 49 items
- Contributed a Blog Post
- Exclusive Author
- Germany
- Has been a member for 3-4 years
- Item was Featured
- Referred between 100 and 199 users
@ revaxarts
I tried your solution. It´s working but without the new registerpurchasecode.php. I put the code in registerbasic.php, so I think you forgot to mention how to tell the registration which form to select?!
You know what I mean??
- Microlancer Beta Tester
- Author had a Free File of the Month
- Has been a member for 3-4 years
- Item was Featured
- Author was Featured
- Austria
- Exclusive Author
- Referred between 200 and 499 users
radykal said
@ revaxartsI tried your solution. It´s working but without the new registerpurchasecode.php. I put the code in registerbasic.php, so I think you forgot to mention how to tell the registration which form to select?!
You know what I mean??
In my case it uses the RegisterPurchasecode method because is choose the Purchasecode option at the dashboard > registrations. If the file registerpurchasecode.php exists it will use this one.
All other registration methods work the same way (i think
)
