Plugin Directory

Changeset 1198757


Ignore:
Timestamp:
07/14/2015 01:30:30 PM (11 years ago)
Author:
CoCeCa
Message:

modified coupan code with new version 1.6

Location:
coceca
Files:
18 added
4 edited

Legend:

Unmodified
Added
Removed
  • coceca/trunk/coceca.php

    r1191630 r1198757  
    44    Description: CTA plugin is an innovative solution designed to help you grow your WordPress blog. It creates an opportunity for you to promote your WordPress Websites & Blogs and engage your site visitors, in more ways than one.
    55    Author: CoCeCa
    6     Version: 1.5
     6    Version: 1.6
    77    Plugin URI: http://coceca.com/
    88    Author URI: http://coceca.com/help/
     
    1313
    1414    defined( 'ABSPATH' ) or die( 'Plugin file cannot be accessed directly.' );
    15     define( 'COCECA_PLUGIN_VERSION', '1.5' );
     15    define( 'COCECA_PLUGIN_VERSION', '1.6' );
    1616    define( 'PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
    1717    define( 'COCECA_PLUGIN_NAME', trim( dirname( PLUGIN_BASENAME ), '/' ) );
  • coceca/trunk/includes/coceca_plugin-class.php

    r1191630 r1198757  
    228228            $coupon_code = $_POST['coupon_code'];
    229229            if(isset($coupon_code) && $coupon_code!=''){
     230                $coupon_sepcial_chr = preg_replace('/[^a-zA-Z0-9 \[\]\.\-]/s', '', $coupon_code);
    230231                $coupon_data = checkValidCoupon($coupon_code);
     232
    231233                if($coupon_data!='' && count($coupon_data) > 0){
    232234                    $response['flag'] = 'success';
    233235                    $response['msg'] = 'Valid coupon code.';
    234                     $coupon_data_sr = serialize($coupon_data);
     236                    $coupon_data_sr = toPublicId($coupon_data['id']);
    235237                }
    236238                else{
     
    249251
    250252            $encrpted_string = syonencryptor('encrypt',getHost().':'.absint($_GET['plugin_id']));
    251             $redirect_url = EXT_SITE_URL.'wpapi/purchase_plugins/?check_host='.getHost().'&plugin_id='.absint($_GET['plugin_id']).'&pass_code='.$encrpted_string.'&coupon_data='.$coupon_data_sr.'&paypal_payment='.$paypal_payment.'&redirect_url='.$admin_redirect_uri;
     253            $redirect_url = EXT_SITE_URL.'wpapi/purchase_plugins/?check_host='.getHost().'&plugin_id='.absint(toPublicId($_GET['plugin_id'])).'&pass_code='.$encrpted_string.'&coupon_data='.$coupon_data_sr.'&paypal_payment='.$paypal_payment.'&redirect_url='.$admin_redirect_uri;
    252254
    253255            if(!empty($coupon_data)){
  • coceca/trunk/includes/functions.php

    r1191630 r1198757  
    290290    return json_decode($result,true);
    291291}
     292
     293if(!function_exists('toPublicId')){
     294    function toPublicId($id)
     295    {
     296        return $id * 14981488888 + 8259204988888;
     297    }
     298}
     299
     300if (!function_exists('toInternalId')) {
     301    function toInternalId($publicId)
     302    {
     303        return ($publicId - 8259204988888) / 14981488888;
     304    }
     305}
  • coceca/trunk/readme.txt

    r1191630 r1198757  
    9090== Changelog ==
    9191
     92= 1.6 =
     93* Modified coupan code
     94
    9295= 1.5 =
    9396* Resolved issue of duplicate functions
Note: See TracChangeset for help on using the changeset viewer.