567 posts
  • Has referred 200+ members
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+6 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
  • Has been part of the Envato Community for over 3 years
  • Has referred 1+ members
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
AgileApricot says

I’ve got the same problem as radykal.

5492 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Located in Australia
  • Has sold $1,000+ on Envato Market
+4 more
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
  • Has been part of the Envato Community for over 3 years
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 1+ items on Envato Market
+2 more
nook_themes says

Good stuff. Thank you!

350 posts Gambit
  • Has been part of the Envato Community for over 4 years
  • Has referred 10+ members
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has collected 100+ items on Envato Market
+4 more
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
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has collected 50+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Had an item featured in an Envato Bundle
+4 more
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

350 posts Gambit
  • Has been part of the Envato Community for over 4 years
  • Has referred 10+ members
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has collected 100+ items on Envato Market
+4 more
bfintal says

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

1703 posts Multimedia Artistry
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 3 years
  • Contributed a free file of the month
  • Won a Most Wanted contest
+4 more
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
  • Has collected 10+ items on Envato Market
  • Pulled off some great moustache to raise money or awareness for Movember Australia
  • Has been part of the Envato Community for over 2 years
  • Located in 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

188 posts
  • Has been part of the Envato Community for over 3 years
  • Has sold $40,000+ on Envato Market
  • Has referred 50+ members
  • Has collected 10+ items on Envato Market
+2 more
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