Esempio n. 1
0
/**
 * Register custom post type for ads
 */
function cp_register_post_types()
{
    global $cp_options;
    // register post type for ads
    $labels = array('name' => __('Ads', APP_TD), 'singular_name' => __('Ad', APP_TD), 'add_new' => __('Add New', APP_TD), 'add_new_item' => __('Create New Ad', APP_TD), 'edit' => __('Edit', APP_TD), 'edit_item' => __('Edit Ad', APP_TD), 'new_item' => __('New Ad', APP_TD), 'view' => __('View Ads', APP_TD), 'view_item' => __('View Ad', APP_TD), 'search_items' => __('Search Ads', APP_TD), 'not_found' => __('No ads found', APP_TD), 'not_found_in_trash' => __('No ads found in trash', APP_TD), 'parent' => __('Parent Ad', APP_TD));
    $args = array('labels' => $labels, 'description' => __('This is where you can create new classified ads on your site.', APP_TD), 'public' => true, 'show_ui' => true, 'has_archive' => true, 'capability_type' => 'post', 'publicly_queryable' => true, 'exclude_from_search' => false, 'menu_position' => 8, 'menu_icon' => appthemes_locate_template_uri('images/admin-icon.png'), 'hierarchical' => false, 'rewrite' => array('slug' => $cp_options->post_type_permalink, 'with_front' => false, 'feeds' => true), 'query_var' => true, 'supports' => array('title', 'editor', 'author', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'sticky'));
    register_post_type(APP_POST_TYPE, $args);
}
Esempio n. 2
0
 public function __construct()
 {
     parent::__construct(array('page_title' => __('ClassiPress Dashboard', APP_TD), 'menu_title' => __('ClassiPress', APP_TD), 'icon_url' => appthemes_locate_template_uri('images/admin-icon.png')));
     $this->boxes[] = array('stats_30_days', $this->box_icon('chart-bar.png') . __('Stats - Last 30 Days', APP_TD), 'side', 'high');
     $this->boxes[] = array('support_forum', $this->box_icon('comments.png') . __('Support Forum', APP_TD), 'normal', 'low');
     $stats_icon = $this->box_icon('chart-bar.png');
     $stats = array('stats', $stats_icon . __('ClassiPress Info', APP_TD), 'normal');
     array_unshift($this->boxes, $stats);
 }
Esempio n. 3
0
/**
 * Sets the favicon to the default location.
 */
function appthemes_favicon()
{
    $uri = appthemes_locate_template_uri('images/favicon.ico');
    if (!$uri) {
        return;
    }
    ?>
<link rel="shortcut icon" href="<?php 
    echo $uri;
    ?>
" />
<?php 
}
Esempio n. 4
0
/**
 * Set up the WordPress core custom header arguments and settings.
 *
 * @uses add_theme_support() to register support for 3.4 and up.
 * @uses cp_header_style() to style front-end.
 * @uses cp_admin_header_style() to style wp-admin form.
 * @uses cp_admin_header_image() to add custom markup to wp-admin form.
 *
 * @return void
 */
function cp_custom_header_setup()
{
    global $cp_options;
    if (strpos($cp_options->stylesheet, 'black') !== false) {
        $default_text_color = '#EFEFEF';
        $default_image = appthemes_locate_template_uri('images/cp_logo_white.png');
    } else {
        $default_text_color = '#666666';
        $default_image = appthemes_locate_template_uri('images/cp_logo_black.png');
    }
    $args = array('default-text-color' => $default_text_color, 'header-text' => true, 'default-image' => $default_image, 'flex-height' => true, 'flex-width' => true, 'height' => 80, 'width' => 300, 'random-default' => false, 'wp-head-callback' => 'cp_header_style', 'admin-preview-callback' => 'cp_admin_header_image');
    add_theme_support('custom-header', $args);
}
function cp_google_maps_js($coordinates)
{
    //var_dump($coordinates);
    ?>
<script type='text/javascript' src='http://maps.googleapis.com/maps/api/js?sensor=false&#038;language=en&#038;region=US&#038;ver=3.0'></script>
<script type="text/javascript">
//<![CDATA[
		jQuery(document).ready(function($) {
			var clicked = false;

			if( $('#priceblock1').is(':visible') ) {
				map_init();
			} else {
				jQuery('a[href=#priceblock1]').click( function() {
					if( !clicked ) {
						map_init();
						clicked = true;
					}
				});
			}

		});

		<?php 
    if (!empty($coordinates) && is_array($coordinates)) {
        echo 'var SavedLatLng = new google.maps.LatLng(' . $coordinates['lat'] . ', ' . $coordinates['lng'] . ');';
        $location_by = "'latLng':SavedLatLng";
        $marker_position = "SavedLatLng";
    } else {
        $location_by = "'address': address";
        $marker_position = "results[0].geometry.location";
    }
    ?>

    //var directionDisplay;
    //var directionsService = new google.maps.DirectionsService();
    var map = null;
    var geocoder = null;
    var fromAdd;
    var toAdd;
    var redFlag = "<?php 
    echo esc_js(appthemes_locate_template_uri('images/red-flag.png'));
    ?>
";
    var shadow = "<?php 
    echo esc_js(appthemes_locate_template_uri('images/red-flag-shadow.png'));
    ?>
";
    var noLuck = "<?php 
    echo esc_js(appthemes_locate_template_uri('images/gmaps-no-result.gif'));
    ?>
";
    var adTitle = "<?php 
    session_start();
    echo $_SESSION["name_show"];
    ?>
"
    var contentString = '<div id="mcwrap"><span>' + adTitle + '</span><br />' + address + '</div>';

		function map_init() {
			jQuery(document).ready(function($) {
				$('#map').hide();
				load();
				$('#map').fadeIn(1000);
				codeAddress();
			});
		}


    function load() {
        geocoder = new google.maps.Geocoder();
        //directionsDisplay = new google.maps.DirectionsRenderer();
        var newyork = new google.maps.LatLng(40.69847032728747, -73.9514422416687);
        var myOptions = {
            zoom: 14,
            center: newyork,
            mapTypeId: google.maps.MapTypeId.ROADMAP,
            mapTypeControlOptions: {
                style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
            }
        }
        map = new google.maps.Map(document.getElementById('map'), myOptions);
        //directionsDisplay.setMap(map);
    }


    function codeAddress() {
        geocoder.geocode( { <?php 
    echo $location_by;
    ?>
 }, function(results, status) {
          if (status == google.maps.GeocoderStatus.OK) {
            map.setCenter();

            var marker = new google.maps.Marker({
                map: map,
                icon: redFlag,
                shadow: shadow,
                //title: title,
                animation: google.maps.Animation.DROP,
                position: <?php 
    echo $marker_position;
    ?>
            });

            var infowindow = new google.maps.InfoWindow({
                maxWidth: 270,
                content: contentString,
                disableAutoPan: false
            });

            infowindow.open(map, marker);

            google.maps.event.addListener(marker, 'click', function() {
              infowindow.open(map,marker);
            });

          } else {
            (function($) {
                $('#map').html('<div style="height:400px;background: url(' + noLuck + ') no-repeat center center;"><p style="padding:50px 0;text-align:center;"><?php 
    echo esc_js(__('Sorry, the address could not be found.', APP_TD));
    ?>
</p></div>');
                return false;
            })(jQuery);
          }
        });
      }

    function showAddress(fromAddress, toAddress) {
        calcRoute();
        calcRoute1();
    }
    function calcRoute() {
        var start = document.getElementById("fromAdd").value;
        var end = document.getElementById("toAdd").value;
        var request = {
            origin: start,
            destination: end,
            travelMode: google.maps.DirectionsTravelMode.DRIVING
        };
        directionsService.route(request, function(response, status) {
            if (status == google.maps.DirectionsStatus.OK) {
                directionsDisplay.setDirections(response);
            }
        });
    }
//]]>
</script>


<?php 
}
    ?>
            
            <div id="step3">
            
                <h2 class="dotted">
                    <?php 
    if (cp_payments_is_enabled() && $order['total_cost'] > 0) {
        _e('Final Step', APP_TD);
    } else {
        _e('Membership Updated', APP_TD);
    }
    ?>
                </h2>
            
                <img src="<?php 
    echo appthemes_locate_template_uri('images/step3.gif');
    ?>
" alt="" class="stepimg" />
            
                <div class="thankyou">
            
                    <?php 
    // call in the selected payment gateway as long as the price isn't zero
    if (cp_payments_is_enabled() && $order['total_cost'] > 0) {
        $membership_order = appthemes_new_order();
        $membership_order->add_item(CP_ITEM_MEMBERSHIP, $order['total_cost']);
        do_action('appthemes_create_order', $membership_order);
        echo html('h3', __('Payment', APP_TD));
        echo html('p', __('Please wait while we redirect you to our payment page.', APP_TD));
        echo html('p', html('small', __('(Click the button below if you are not automatically redirected within 5 seconds.)', APP_TD)));
        cp_js_redirect($membership_order->get_return_url(), __('Continue to Payment', APP_TD));
 function cp_get_image_url_feat($post_id = '', $size = 'medium', $class = '', $num = 1)
 {
     global $cp_options;
     $images = get_posts(array('post_type' => 'attachment', 'numberposts' => $num, 'post_status' => null, 'post_parent' => $post_id, 'order' => 'ASC', 'orderby' => 'ID', 'no_found_rows' => true));
     if ($images) {
         foreach ($images as $image) {
             $alt = get_post_meta($image->ID, '_wp_attachment_image_alt', true);
             $iarray = wp_get_attachment_image_src($image->ID, $size, $icon = false);
             $img_check = '<img class="' . $class . '" src="' . $iarray[0] . '" width="' . $iarray[1] . '" height="' . $iarray[2] . '" alt="' . $alt . '" title="' . $alt . '" />';
         }
     } else {
         if ($cp_options->ad_images) {
             $img_check = '<img class="preview" alt="" title="" src="' . appthemes_locate_template_uri('images/no-thumb-sm.jpg') . '" />';
         }
     }
     echo $img_check;
 }
Esempio n. 8
0
 function cp_get_image_url()
 {
     global $post;
     // go see if any images are associated with the ad
     $images = get_children(array('post_parent' => $post->ID, 'post_status' => 'inherit', 'numberposts' => 1, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'ID'));
     if ($images) {
         // move over bacon
         $image = array_shift($images);
         $alt = get_post_meta($image->ID, '_wp_attachment_image_alt', true);
         // see if this v3.0.5+ image size exists
         $adthumbarray = wp_get_attachment_image_src($image->ID, 'large');
         $img_medium_url_raw = $adthumbarray[0];
         // grab the large image for onhover preview
         $adlargearray = wp_get_attachment_image_src($image->ID, 'large');
         $img_large_url_raw = $adlargearray[0];
         // must be a v3.0.5+ created ad
         if ($adthumbarray) {
             echo '<a href="' . $img_large_url_raw . '" class="img-main" data-rel="colorbox" title="' . the_title_attribute('echo=0') . '"><img class="img-responsive" src="' . $img_medium_url_raw . '" title="' . $alt . '" alt="' . $alt . '" /></a>';
         }
         // no image so return the placeholder thumbnail
     } else {
         echo '<img class="attachment-medium img-responsive" alt="" title="" src="' . appthemes_locate_template_uri('images/no-thumb-500x375.png') . '" />';
     }
 }
Esempio n. 9
0
<?php

/**
 * ClassiPress Theme Support
 * This file defines 'theme support' so WordPress knows what new features it can handle.
 */
global $cp_options;
// Theme supports
add_theme_support('app-versions', array('update_page' => 'admin.php?page=app-settings&firstrun=1', 'current_version' => CP_VERSION, 'option_key' => 'cp_version'));
add_theme_support('app-wrapping');
add_theme_support('app-search-index', array('admin_page' => true, 'admin_top_level_page' => 'app-dashboard', 'admin_sub_level_page' => 'app-system-info'));
add_theme_support('app-login', array('login' => 'tpl-login.php', 'register' => 'tpl-registration.php', 'recover' => 'tpl-password-recovery.php', 'reset' => 'tpl-password-reset.php', 'redirect' => $cp_options->disable_wp_login, 'settings_page' => 'admin.php?page=app-settings&tab=advanced'));
add_theme_support('app-feed', array('post_type' => APP_POST_TYPE, 'blog_template' => 'index.php', 'alternate_feed_url' => $cp_options->feedburner_url));
add_theme_support('app-open-graph', array('default_image' => get_header_image() ? get_header_image() : appthemes_locate_template_uri('images/cp_logo_black.png')));
add_theme_support('app-payments', array('items' => cp_get_addons(), 'items_post_types' => array(APP_POST_TYPE), 'options' => $cp_options));
add_theme_support('app-price-format', array('currency_default' => $cp_options->currency_code, 'currency_identifier' => $cp_options->currency_identifier, 'currency_position' => $cp_options->currency_position, 'thousands_separator' => $cp_options->thousands_separator, 'decimal_separator' => $cp_options->decimal_separator, 'hide_decimals' => $cp_options->hide_decimals));
add_theme_support('app-plupload', array('max_file_size' => $cp_options->max_image_size, 'allowed_files' => $cp_options->num_images, 'disable_switch' => false));
add_theme_support('app-stats', array('cache' => 'today', 'table_daily' => 'cp_ad_pop_daily', 'table_total' => 'cp_ad_pop_total', 'meta_daily' => 'cp_daily_count', 'meta_total' => 'cp_total_count'));
add_theme_support('app-reports', array('post_type' => array(APP_POST_TYPE), 'options' => $cp_options, 'admin_top_level_page' => 'app-dashboard', 'admin_sub_level_page' => 'app-settings'));
add_theme_support('app-comment-counts');
add_theme_support('post-thumbnails');
add_theme_support('automatic-feed-links');
add_theme_support('app-form-progress', array('checkout_types' => array('create-listing' => array('steps' => array('select-category' => array('title' => __('Select Category', APP_TD)), 'listing-details' => array('title' => __('Details', APP_TD)), 'listing-preview' => array('title' => __('Preview', APP_TD)), 'select-plan' => array('title' => __('Options/Pay', APP_TD)), 'gateway-select' => array('map_to' => 'select-plan'), 'gateway-process' => array('map_to' => 'select-plan'), 'listing-submit-free' => array('title' => __('Thank You', APP_TD)), 'order-summary' => array('title' => __('Thank You', APP_TD)))), 'membership-purchase' => array('steps' => array('select-membership' => array('title' => __('Select Membership', APP_TD)), 'preview-membership' => array('title' => __('Preview', APP_TD)), 'gateway-select' => array('title' => __('Pay', APP_TD)), 'order-summary' => array('title' => __('Thank You', APP_TD)), 'gateway-process' => array('map_to' => 'gateway-select'))))));
/**
 * AppThemes updater not found notice.
 *
 * @since 3.5
 */
add_theme_support('app-require-updater', true);
/**
 * Media Manager.
Esempio n. 10
0
/**
 * Sets the favicon to the default location.
 */
function appthemes_favicon()
{
    $uri = apply_filters('appthemes_favicon', appthemes_locate_template_uri('images/favicon.ico'));
    if (!$uri) {
        return;
    }
    ?>
<link rel="shortcut icon" href="<?php 
    echo esc_url($uri);
    ?>
" />
<?php 
}