563 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Bought between 10 and 49 items
  • Contributed a Blog Post
  • Exclusive Author
  • Germany
  • Has been a member for 5-6 years
+1 more
radykal says

Ok, but for me its not working. I can select the Purchasecode method in the dashboard, but when I go to the register form for the users I dont see any additional input field that I add in the registerpurchasecode.php, which is located in the same folder as the other register php files.

When I select the purchase code option and save it, it still use the registerbasic.php. I test it on my local machine, maybe that why its not working?!

21 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Referred between 1 and 9 users
  • United Kingdom
AgileApricot says

I’ve got the same problem as radykal.

5391 posts
  • Australia
  • Bought between 100 and 499 items
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 4-5 years
  • Interviewed on the Envato Notes blog
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
Australia says

Latest build is 2.0.18.1

Contact x00 at vanillaForums.org he my be interested doing this as a paid mod

4 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 2-3 years
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
  • United States
nook_themes says

Good stuff. Thank you!

346 posts Gambit
  • Bought between 100 and 499 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 4-5 years
  • Philippines
  • Referred between 10 and 49 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 50 000 and 100 000 dollars
bfintal says

I know this is an old thread, but I’m currently making my own support forum and the code posted earlier in the thread doesn’t work anymore with Vanilla’s current version. Using the original code as an inspiration, I made a few changes and it now works. Woot!

First off, I removed the new registration method and stuck with the basic (aka. recaptcha) registration method instead and modified the core scripts for that one.

Here’re the changes I made:

1. In the script applications/dashboard/controllers/class.entrycontroller.php, modify the private function RegisterCaptcha.. add this code right after the first IF statement:

$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.'));
}

2. Append this function to the end of the entry controller class (same file as above):

    private function verifyPurchasecode($purchasecode) {
        $username = 'ENVATO_USERNAME'; // authors username
        $api_key = 'ENVATO_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'];
   }

3. Edit the registration view script (or create a new theme then create a registration view script there): applications/dashboard/views/entry/registercaptcha.php and add the necessary input in the form:

      <li>
        <?php
            echo $this->Form->Label('Purchase Code', 'InvitationCode');
            echo $this->Form->TextBox('InvitationCode', array('value' => $this->InvitationCode));
        ?>
      </li>

This works for me in version 2.0.18.2

You’ll have to tailor the registration fields to what you want afterwards :)

33 posts
  • Elite Author
  • Sold between 50 000 and 100 000 dollars
  • Author had a File in an Envato Bundle
  • Exclusive Author
  • United States
  • Has been a member for 6-7 years
  • Bought between 50 and 99 items
Tricycle says

Hi Bfintal, thanks for this code for the most recent VF version. I will try it out today and let you know if I get it running.

Best Regards, Oisin

346 posts Gambit
  • Bought between 100 and 499 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 4-5 years
  • Philippines
  • Referred between 10 and 49 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 50 000 and 100 000 dollars
bfintal says

Cool! Just for reference, here’s my forum where I got it working: http://support.gambit.ph/entry/register

1674 posts Multimedia Artistry
  • Author had a Free File of the Month
  • Has been a member for 3-4 years
  • Referred between 100 and 199 users
  • Bought between 10 and 49 items
  • Exclusive Author
  • Most Wanted Bounty Winner
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
dnp_theme says

Cool! Just for reference, here’s my forum where I got it working: http://support.gambit.ph/entry/register

Awesome!! Thanks!! Will definitly replace my phpBB3 forum with vanilla and your awesome code.

phpBB3 is better but it cannot have Envato verification code and it’s tooooo BIG to manage.

45 posts
  • Grew a moustache for the Envato Movember competition
  • Bought between 10 and 49 items
  • Has been a member for 2-3 years
  • United States
premiumwd says

hey all is it possible to direct me to a wordpress modification so users can register only by the purchase code? I have the api and the file buy I need a little help implementing it and testing it?

Thanks in advance

98 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Referred between 50 and 99 users
  • Romania
  • Sold between 10 000 and 50 000 dollars
ThemeFuzz says

Hi,

If you want a wordpress solution, i recommend you search on codecanyon were you will find an awesome plugin created for the envator authors ( i don’t want to give direct link because i am not allowed :P ).

Best regards, Stefan

by
by
by
by
by
by