Tips and tricks

Setup Vanilla Forums With Envato API Purchase Verification

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.

Enough talk:

  1. Download and install latest vanilla forums ( ‘2.0.17.8’ )
  2. Open _install/conf/config.php and make sure the registration methor line looks like this
    $Configuration['Garden']['Registration']['Method'] = 'Basic';
  3. Open _install/applications/dashboard/views/entry/registerbasic.php and make sure it looks like this
    [php]<?php if (!defined('APPLICATION')) exit(); ?>
    <h1><?php echo T("Apply for Membership") ?></h1>
    <div class="Box">
       <?php
       $TermsOfServiceUrl = Gdn::Config('Garden.TermsOfService', '#');
       $TermsOfServiceText = sprintf(T('I agree to the <a id="TermsOfService" class="Popup" target="terms" href="%s">terms of service</a>'), Url($TermsOfServiceUrl));
       // Make sure to force this form to post to the correct place in case the view is
       // rendered within another view (ie. /dashboard/entry/index/):
       echo $this->Form->Open(array('Action' => Url('/entry/register'), 'id' => 'Form_User_Register'));
       echo $this->Form->Errors();
       ?>
       <ul>
          <li>
             <?php
                echo $this->Form->Label('Email', 'Email');
                echo $this->Form->TextBox('Email');
                echo '<span id="EmailUnavailable" class="Incorrect" style="display: none;">'.T('Email Unavailable').'</span>';
             ?>
          </li>
          <li>
             <?php
                echo $this->Form->Label('Username', 'Name');
                echo $this->Form->TextBox('Name');
                echo '<span id="NameUnavailable" class="Incorrect" style="display: none;">'.T('Name Unavailable').'</span>';
             ?>
          </li>
          <li>
             <?php
                echo $this->Form->Label('Password', 'Password');
                echo $this->Form->Input('Password', 'password');
             ?>
          </li>
          <li>
             <?php
                echo $this->Form->Label('Confirm Password', 'PasswordMatch');
                echo $this->Form->Input('PasswordMatch', 'password');
                echo '<span id="PasswordsDontMatch" class="Incorrect" style="display: none;">'.T("Passwords don't match").'</span>';
             ?>
          </li>
          <li>
             <?php
                echo $this->Form->Label('Purchase code? <a href="http://farm7.static.flickr.com/6002/5929085164_d858b3f7dc_b.jpg">Find it here</a>', 'DiscoveryText');
                echo $this->Form->TextBox('DiscoveryText', array('MultiLine' => FALSE));
             ?>
          </li>
          <li>
             <?php
                echo $this->Form->CheckBox('TermsOfService', $TermsOfServiceText, array('value' => '1'));
                echo $this->Form->CheckBox('RememberMe', T('Remember me on this computer'), array('value' => '1'));
             ?>
          </li>
          <li class="Buttons">
             <?php echo $this->Form->Button('Sign Up'); ?>
          </li>
       </ul>
       <?php echo $this->Form->Close(); ?>
    </div>[/php]
  4. Download Purchase Verificator from http://wiki.envato.com/selling/tips-selling/essential-resources-for-marketplace-authors/
  5. Unpack and edit config.php to match your details
  6. Open _install/applications/controllers/ and copy both config.php and Envato_marketplaces.php
  7. Open _install/applications/controllers/class.entrycontroller.php and add at line 806 or so ( function RegisterBasic )
        [php]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..');
            }[/php]
  8. All done!
[button link=”http://digitalzoomstudio.net/downloads/vanilla.zip”]Download Customized Version[/button]
{"type":"main_options","images_arr":"'#ffffff'","enable_ajax":"off","soundcloud_apikey":"","bg_isparallax":"off","bg_slideshow_time":"0","bg_transition":"slidedown","site_url":"https:\/\/digitalzoomstudio.net","theme_url":"https:\/\/digitalzoomstudio.net\/wp-content\/themes\/qucreative\/","blur_ammount":"26","width_column":"50","width_section_bg":"","width_gap":"30","border_width":"0","border_color":"#ffffff","translate_cancel_comment":"Cancel reply","translate_leave_a_comment":"Leave a comment","translate_leave_a_comment_to":"Leave a comment to","is_customize_preview":"off","width_blur_margin":"30","gallery_w_thumbs_autoplay_videos":"off","content_enviroment_opacity":"30","menu_enviroment_opacity":"70","base_url":"https:\/\/digitalzoomstudio.net"}
{"type":"darkfull"}