Plugin Directory

Changeset 715799


Ignore:
Timestamp:
05/20/2013 11:25:29 PM (13 years ago)
Author:
Sanskript
Message:

Update Sync Process
Added License Capabilities

Location:
soldpress/branches/0.9.5A
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • soldpress/branches/0.9.5A/adapter.php

    r715144 r715799  
    66class soldpress_adapter{
    77
    8     private $loginURL = 'http://sample.data.crea.ca/Login.svc/Login';
    9     private $userId = 'CXLHfDVrziCfvwgCuL8nUahC';
    10     private $pass = 'mFqMsCSPdnb5WO1gpEEtDCHH';
     8    private $loginURL;//'http://sample.data.crea.ca/Login.svc/Login';
     9    private $userId;//'CXLHfDVrziCfvwgCuL8nUahC';
     10    private $pass;//'mFqMsCSPdnb5WO1gpEEtDCHH';
    1111    private $templateLocation = "wp-content/plugins/soldpress/template/";
    1212    private $service;
     
    3434        $this->service->AddHeader('Accept', '/');   
    3535       
    36         $this->loginURL = get_option("sc-url","http://sample.data.crea.ca/Login.svc/Login");
    37         $this->userId = get_option("sc-username","CXLHfDVrziCfvwgCuL8nUahC");
    38         $this->pass= get_option("sc-password","mFqMsCSPdnb5WO1gpEEtDCHH");
     36        $this->loginURL = get_option("sc-url");
     37        $this->userId = get_option("sc-username");
     38        $this->pass= get_option("sc-password");
    3939        $this->templateLocation = get_option("sc-template","wp-content/plugins/soldpress/template/");
    4040    }
     
    293293                    //  $this->WriteLog('Begin CoAgent Picture Sync' . $post_id . 'CoAgentKey' . $coagentKey);                 
    294294                        $this->sync_agentobject($coagentKey, 'ThumbnailPhoto',$post_id,'coagent');
    295                         update_post_meta($post_id,'sc-sync-picture-agent', true,'coagent');
     295                       
    296296                    }
     297                    //We Have Complete The Agent and CoAgent Sunc Process
     298                    update_post_meta($post_id,'sc-sync-picture-agent', true);
    297299
    298300                }
     
    307309                //  $this->WriteLog('Begin Office Picture Sync' . $post_id . 'AgentKey' . $officeKey);                 
    308310                    $this->sync_listingobject($officeKey, 'ThumbnailPhoto',$post_id);
     311                    //We Have Complete The Listing Process
     312                    update_post_meta($post_id,'sc-sync-picture-office', true);
    309313                   
    310314                }
     
    371375            $filename = $id .'-agent-' . $type . '.jpg';               
    372376            $wp_upload_dir = wp_upload_dir();
    373             $filePath = $wp_upload_dir['basedir']. '/soldpress/'.$filename;     
    374             file_put_contents($filePath,$image["Data"]); //We Change This In Settings
    375             update_post_meta($post_id,'sc-sync-picture-'.$metatype.'-file', $filename);     
     377            $filePath = $wp_upload_dir['basedir']. '/soldpress/'.$filename;
     378            if($image["Data"] == ""){   
     379                file_put_contents($filePath,$image["Data"]);
     380                update_post_meta($post_id,'sc-sync-picture-'.$metatype.'-file', $filename);
     381            }
     382            else{
     383                update_post_meta($post_id,'sc-sync-picture-'.$metatype.'-file', '');   
     384            }           
    376385        }   
    377386       
     
    386395            $filename = $id .'-listing-' . $type . '.jpg';             
    387396            $wp_upload_dir = wp_upload_dir();
    388             $filePath = $wp_upload_dir['basedir']. '/soldpress/'.$filename;     
    389             file_put_contents($filePath,$image["Data"]); //We Change This In Settings
    390             update_post_meta($post_id,'sc-sync-picture-office-file', $filename);                   
     397            $filePath = $wp_upload_dir['basedir']. '/soldpress/'.$filename;
     398            if($image["Data"] == ""){
     399                file_put_contents($filePath,$image["Data"]);
     400                update_post_meta($post_id,'sc-sync-picture-office-file', $filename);   
     401            }
     402            else{
     403                update_post_meta($post_id,'sc-sync-picture-office-file', '');   
     404            }
    391405        }   
    392406       
  • soldpress/branches/0.9.5A/custom_field_types.php

    r711125 r715799  
    11<?php
    22
     3
     4
    35function custom_post_type() {
    4 
     6        $slug = get_option('sc-slug','listing');
     7       
    58        $labels = array(
    69            'name'                => _x( 'Listings', 'Post Type General Name', 'text_domain' ),
     
    2023
    2124        $rewrite = array(
    22             'slug'                => 'listing',
     25            'slug'                => $slug,
    2326            'with_front'          => true,
    2427            'pages'               => true,
  • soldpress/branches/0.9.5A/settings.php

    r715428 r715799  
    11<?php
     2
     3
    24
    35add_action( 'admin_menu', 'soldpress_admin_menu' );
     
    911
    1012function register_mysettings() {
     13
    1114    register_setting( 'sc-settings-credentials', 'sc-username' );
    1215    register_setting( 'sc-settings-credentials', 'sc-password' );
    1316    register_setting( 'sc-settings-credentials', 'sc-url' );
    14     register_setting( 'sc-settings-credential', 'sc-template' );
    15     register_setting( 'sc-settings-credential', 'sc-language' );
     17    register_setting( 'sc-settings-credentials', 'sc-template' );
     18    register_setting( 'sc-settings-credentials', 'sc-language' );
     19
     20   
    1621    register_setting( 'sc-settings-sync', 'sc-sync-enabled' );
     22    register_setting( 'sc-settings-sync', 'sc-sync-days' );
     23   
    1724    register_setting( 'sc-settings-layout', 'sc-layout-agentlisting' );
    1825    register_setting( 'sc-settings-layout', 'sc-layout-ariealmap' );
     
    2330    register_setting( 'sc-settings-layout', 'sc-layout-analyticsview' );
    2431    register_setting( 'sc-settings-layout', 'sc-layout-soldpresslogo' );
    25    
     32    register_setting( 'sc-settings-layout', 'sc-slug' );
     33   
     34    register_setting( 'sc-settings-about', 'sc-license' );
    2635}
    2736
    2837function soldpress_account_options() {
    2938
     39    include_once(dirname(__FILE__).'/license.php');
     40   
    3041    if ( !current_user_can( 'manage_options' ) )  {
    3142            wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
     
    7283                <h3 class="title">General</h3>
    7384                <table class="form-table">
    74                     <!-- <tr valign="top">
    75                     <th scope="row">Template Location</th>
    76                     <td><input type="text" class="regular-text" name="sc-template" value="<?php //echo get_option('sc-template','wp-content/plugins/soldpress/template/'); ?>" /></td>
    77                     </tr>-->
     85                   
    7886                    <tr valign="top">
    7987                    <th scope="row">Language</th>
     
    148156                                if($job == 'soldpress_photo_sync' || $job == 'soldpress_listing_sync'){
    149157                                    echo '<tr>';
    150                                     //echo '<th scope="row" class="check-column"><input type="checkbox" name="schedules[]" class="entries" value="1"></th>';
    151158                                    echo '<td><strong>'.$job.'</strong><div class="row-actions" style="margin:0; padding:0;"><a href="options-general.php?page=soldpress&tab=sync_options&spa=runevt&job='.$job.'">Run Now</a></div></td>';                             
    152159                                    echo '<td>'.date("r", $key).'</td>';                           
     
    178185                <h3 class="title">Agent</h3>
    179186                <table class="form-table">
     187                    <tr>
    180188                    <th scope="row">Display Listing Agent</th>
    181189                        <td>
     
    183191                        </td>
    184192                    </tr>
     193                    <tr valign="top">
     194                    <th scope="row">Slug</th>
     195                    <td><input type="text" disabled class="regular-text" id ="sc-slug" name="sc-slug" value="<?php echo get_option('sc-slug','listing'); ?>" /> *(Avalible in Premium)</td>
     196                    </tr>
    185197                </table>
    186198                <h3 class="title">Map</h3>
    187199                <table class="form-table">
     200                    <tr>
    188201                    <th scope="row">Display Arieal Map</th>
    189202                        <td>
    190                             <input name="sc-layout-ariealmap" id ="sc-layout-ariealmap" value="1" type="checkbox" <?php checked( '1', get_option( 'sc-layout-ariealmap',1 ) ); ?>  />
    191                         </td>
    192                     </tr>
     203                            <input name="sc-layout-ariealmap" id ="sc-layout-ariealmap" value="1" type="checkbox" <?php checked( '1', get_option( 'sc-layout-ariealmap',0 ) ); ?> *(Avalible in Premium) />
     204                        </td>
     205                    </tr>
     206                    <tr>
    193207                    <th scope="row">Display StreetView Map</th>
    194208                        <td>
    195                             <input name="sc-layout-streetviewmap" id ="sc-layout-streetviewmap" value="1" type="checkbox" <?php checked( '1', get_option( 'sc-layout-streetviewmap',0 ) ); ?>  />
    196                         </td>
    197                     </tr>
     209                            <input name="sc-layout-streetviewmap" id ="sc-layout-streetviewmap" value="1" type="checkbox" <?php checked( '1', get_option( 'sc-layout-streetviewmap',0 ) ); ?>  *(Avalible in Premium)/>
     210                        </td>
     211                    </tr>
     212
    198213                </table>
    199214                <h3 class="title">Color</h3>
    200215                <table class="form-table">
     216                    <tr>
    201217                    <th scope="row">Primary Color</th>
    202218                        <td>
    203                             <input name="sc-layout-primarycolor" id ="sc-layout-primarycolor" value="" />
    204                         </td>
    205                     </tr>
     219                            <input name="sc-layout-primarycolor" id ="sc-layout-primarycolor" value="" /> *(Avalible in Premium)
     220                        </td>
     221                    </tr>
     222                    <tr>
    206223                    <th scope="row">Secondary Color</th>
    207224                        <td>
    208                             <input name="sc-layout-secondarycolor" id ="sc-layout-secondarycolor" value="" />
     225                            <input name="sc-layout-secondarycolor" id ="sc-layout-secondarycolor" value="" /> *(Avalible in Premium)
    209226                        </td>
    210227                    </tr>
     
    212229                <h3 class="title">Relator(tm) Analytics</h3>
    213230                <table class="form-table">
     231                    <tr>
    214232                    <th scope="row">Click Analytics</th>
    215233                        <td>
    216                             <input name="sc-layout-analyticsclick" id ="sc-layout-analyticsclick" value="1" type="checkbox" <?php checked( '1', get_option( 'sc-layout-analyticsclick',0) ); ?>  />
    217                         </td>
    218                     </tr>
     234                            <input name="sc-layout-analyticsclick" id ="sc-layout-analyticsclick" value="1" type="checkbox" <?php checked( '1', get_option( 'sc-layout-analyticsclick',0) ); ?>  /> *(Avalible in Premium)
     235                        </td>
     236                    </tr>
     237                    <tr>
    219238                    <th scope="row">View Analytics</th>
    220239                        <td>
    221                             <input name="sc-layout-analyticsview" id ="sc-layout-analyticsview" value="1" type="checkbox" <?php checked( '1', get_option( 'sc-layout-analyticsview',0 ) ); ?>  />
     240                            <input name="sc-layout-analyticsview" id ="sc-layout-analyticsview" value="1" type="checkbox" <?php checked( '1', get_option( 'sc-layout-analyticsview',0 ) ); ?>  /> *(Avalible in Premium)
    222241                        </td>
    223242                    </tr>
     
    227246    <?php } ?>
    228247    <?php if( $active_tab == 'about_options' ) {  ?>
    229         A product of Sanskript Solution, Inc.
    230        
    231         Licsense Key:  "Premium Beta"
    232        
    233                
     248   
     249        <form method="post" action="options.php">
     250            <?php settings_fields( 'sc-settings-about' ); ?>   
     251                <h3 class="title">License</h3>
     252                <table class="form-table">
     253                    <tr>
     254                    <th scope="row">License Key</th>
     255                        <td>
     256                            <input type="text" class="regular-text" id ="sc-license" name="sc-license" value="<?php echo get_option('sc-license',''); ?>" />
     257                           
     258                        </td>
     259                    </tr>
     260                </table>
     261        </form>
     262        Licsense Key:  <?php echo get_option('sc-license',''); ?> . "Premium Beta"             
    234263    <?php } ?>
    235264    <?php if( $active_tab == 'debug_options' ) {  ?>
     
    270299                        <?php submit_button('Clear Listings', 'secondary', 'delete', false); ?>
    271300                        <?php submit_button('Delete Log', 'secondary', 'deletelog', false); ?>
     301                        <?php submit_button('Delete Photo Meta', 'secondary', 'removephotometadata', false); ?>
     302                       
    272303                    </form>
    273304            <?php if (get_option('sc-status' ) == true) { ?>
     
    348379            }
    349380        }
     381       
     382        if (isset($_POST["removephotometadata"])) {         
     383            global $wpdb;
     384            $deleteQuery = $wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE meta_key = 'sc-sync-picture--file'");
     385            $wpdb->query($deleteQuery);
     386        }
    350387    }
    351388
  • soldpress/branches/0.9.5A/single-sp_property.php

    r715428 r715799  
    2121}
    2222
    23 add_action( 'wp_enqueue_scripts', 'my_scripts_method' ); // wp_enqueue_scripts action hook to link only on the front-end
     23add_action( 'wp_enqueue_scripts', 'soldpress_analytics' ); // wp_enqueue_scripts action hook to link only on the front-end
    2424
    2525
     
    2828<?php get_header(); ?>
    2929    <h2><?php the_title(); ?></h2> 
     30    <div id="sp_disclaimer" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="sp_disclaimer" aria-hidden="true">
     31          <div class="modal-header">
     32            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
     33            <h3 id="myModalLabel">Terms of Use Agreement</h3>
     34          </div>
     35          <div class="modal-body">
     36            <p>Terms of Use Agreement
     37BY ACCESSING ANY OF THE WEB SITES OPERATED BY THE CANADIAN REAL ESTATE ASSOCIATION, INCLUDING REALTOR.ca, THE USER AGREES TO BE BOUND BY ALL OF THE TERMS FOR USE AND AGREES THAT THESE TERMS CONSTITUTE A BINDING CONTRACT BETWEEN THE USER AND THE CANADIAN REAL ESTATE ASSOCIATION (CREA)
     38
     39These Terms of Use apply to all users, except to the extent that CREA has developed specific policies for member real estate Boards, Associations and brokers/salespersons who are members of CREA. Those organizations and entities should also refer to the Policies of the MLS® and Technology Council.
     40
     41Copyright
     42This database and all materials on this site are protected by copyright laws and are owned by The Canadian Real Estate Association (CREA) or by the member who has supplied the data. Property listings and other data available on this site are intended for the private, non-commercial use by individuals. Any commercial use of the listings or data in whole or in part, directly or indirectly, is specifically forbidden except with the prior written authority of the owner of the copyright.
     43
     44Users may, subject to these Terms and Conditions, print or otherwise save individual pages for private use. However, property listings and/or data may not be modified or altered in any respect, merged with other data or published in any form, in whole or in part. The prohibited uses include “screen scraping”, “database scraping” and any other activity intended to collect, store, reorganize or manipulate or publish data on the pages produced by, or displayed on the CREA web sites.
     45
     46Trade Marks
     47REALTOR®, REALTORS® and the REALTOR® logo are certification marks owned by REALTOR® Canada Inc., a corporation jointly owned by the National Association of REALTORS® and The Canadian Real Estate Association. The REALTOR® trade marks are used to identify real estate services provided by brokers and salespersons who are members of CREA and who accept and respect a strict Code of Ethics, and are required to meet consistent professional standards of business practice which is the consumer's assurance of integrity.
     48
     49MLS®, Multiple Listing Service®, and the associated logos are all registered certification marks owned by CREA and are used to identify real estate services provided by brokers and salespersons who are members of CREA.
     50
     51Other trade marks used on the CREA web sites may be owned by real estate boards and other third parties. Nothing contained on this site gives any user the right or license to use any trade mark displayed on this site without the express permission of the owner.
     52
     53Links
     54All links to any CREA website must be accompanied by a prominent notice which makes it clear to a browser that the link leads to a website of The Canadian Real Estate Association.
     55
     56This notice may make reference to the domain name itself (e.g. REALTOR.ca or ICX.CA) or may refer to CREA.
     57No materials, names or marks may be used with the link to give the erroneous impression to a user that the individual, entity or website is somehow affiliated with CREA or any of CREA’s web sites;
     58Unless CREA expressly agrees otherwise, all links to any CREA website must connect to the home page of the website;
     59All links must be displayed in text or by using the graphic buttons used by CREA;The link must result in a new, fully functional, full screen browser window occupied solely by the pages created by the CREA® website.
     60Framing
     61Consumers and third parties may not under any circumstances use technology to display the content of CREA's web sites in a frame or in any other manner that is different from how it would appear if a user typed the URL into the browser line.
     62
     63Liability and Warranty Disclaimer
     64CREA makes no representations about the suitability of the data or graphics published on this site. Everything on this site is provided "As Is" without warranty of any kind including all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement. Neither CREA nor any of its suppliers shall be liable for any direct, incidental, consequential, indirect or punitive damages arising out of your access to or use of this site.
     65
     66Revisions
     67CREA may at any time revise these Terms of Use by updating this posting. All users of this site are bound by these conditions and should therefore periodically visit this page to review any changes to these requirements.</p>
     68          </div>
     69          <div class="modal-footer">
     70            <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
     71            <button class="btn btn-primary">Accept</button>
     72          </div>
     73    </div>
    3074    <div class="well2">
    3175        <div class="cycle-slideshow" data-cycle-fx="carousel" data-cycle-timeout="2000">
     
    4185            ?>         
    4286        </div>
    43         <div id="disclaimer1">Test</div>
    4487        <script>
    4588
    46             var j = jQuery.noConflict()
    47             if (j('#disclaimer').length > 0) {
    48                 alert('g');
    49                 if (j.cookie('disclaimer_accepted') != 'yes') {
    50                     j('#disclaimer').modal({backdrop:'static',keyboard:false})
    51 
    52                     j('#disclaimer').on('hide',function(){
    53                         j.cookie('disclaimer_accepted','yes',{expires:30});
    54                     })
    55                 }   
     89                               
     90                var j = jQuery.noConflict();
     91               
     92                j( document ).ready(function() {
     93                    if (j('#sp_disclaimer').length > 0) {
     94                        if (j.cookie('disclaimer_accepted') != 'yes') {
     95                            j('#sp_disclaimer').modal({backdrop:'static',keyboard:false})
     96                            j('#sp_disclaimer').on('hide',function(){
     97                                j.cookie('disclaimer_accepted','yes',{expires:30});
     98                            })
     99                        }           
     100                    }
     101                });
    56102           
    57             }   
    58103        </script>
    59        
    60104        <div class="well3">
    61105            <div class="row">
     
    266310                    </table>   
    267311                </div>             
    268                 <script src="http://maps.google.com/maps/api/js?sensor=false&.js"></script>
    269312                <script>
    270313                    // Enable the visual refresh
  • soldpress/branches/0.9.5A/soldpress.php

    r714737 r715799  
    44Plugin URI: http://www.sanskript.com/products/soldpress
    55Description: SoldPress is a WordPress plugin to enable CREA’s members to easily disseminate MLS® listing content on WordPress Sites.
    6 Version:  0.9.5.2 Beta
     6Version:  0.9.5.3 Beta
    77Author: Amer Gill
    88Author URI: http://www.sanskript.com
     
    1010*/
    1111
     12    define('SOLDPRESS_VERSION', '0953');
     13    define('SOLDPRESS_PLUGIN_URL', plugin_dir_url( __FILE__ ));
     14   
    1215    ini_set('max_execution_time', 600);
    1316    ini_set('mysql.connect_timeout', 600);
     
    4245
    4346    function soldpress_activation() {
    44 
     47       
     48        //Perform Version Upgrades
     49        $currentVerison = get_option( 'sc-version', '0922');
     50       
     51        if(currentVerison == 0922)
     52        {
     53            //We need to delete the username and password and get the user to reenter because fundlement changes have occurent to the application
     54            update_option( 'sc-version', SOLDPRESS_VERSION);
     55            update_option( 'sc-username','' );
     56            update_option( 'sc-password', SOLDPRESS_VERSION);
     57        }
     58   
    4559        update_option( 'sc-status', '');
    4660        update_option( 'sc-sync-start','' );
  • soldpress/branches/0.9.5A/theme.php

    r715428 r715799  
    2929        '2',
    3030        true);
     31       
     32    wp_enqueue_script(
     33        'jquery.cookie.js',
     34        plugins_url( 'lib/jquery.cookie/jquery.cookie.js' , __FILE__ ),
     35        array('jquery'),
     36        '1.3.1',
     37        false);
     38   
     39    wp_enqueue_script(
     40        'google.maps',
     41        '//maps.google.com/maps/api/js?sensor=false&.js',
     42        array('jquery'),
     43        '3.0.0',
     44        false);
    3145}
    3246
Note: See TracChangeset for help on using the changeset viewer.