Dustin Ames

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • in reply to: Allow authors and Administrators to delete places #389340

    Dustin Ames
    Expired Member
    Post count: 28

    So, if I understand this correctly, “Places” (the default listing type), is just a post and is categorized as such in the backend, correct? So I would need to grant permission to edit and delete other people’s posts.

    I will do this in the meantime, but my problem is that I don’t want the Sales Reps to be able to edit or modify actual content (we are a news site that also implements listings). I also don’t want the Sales Reps to have Administrator access (for obvious reasons). I just want them to be able to manage the listings, including being able to delete.

    If you guys are interested in making an add-on that works for companies that have Sales Reps (or even agencies) handling multiple listings, I’d be happy to share what I know about the needs of those companies 🙂

    I tried to do it with the franchise add-on, but it’s not quite what I’m looking for.

    in reply to: Listings Page Excerpts Length – New Topic for Kor #386436

    Dustin Ames
    Expired Member
    Post count: 28
    This reply has been marked as private.
    in reply to: Listings Page Excerpts Length #385953

    Dustin Ames
    Expired Member
    Post count: 28

    If you find a solution to this, please let me know. I have the exact same problem.

    in reply to: geode_thumbnail #379755

    Dustin Ames
    Expired Member
    Post count: 28

    I removed the custom code in functions.php that created the extra div for the company logo and it all seems fine. Anyway, we can call this topic resolved.

    in reply to: geode_thumbnail #379690

    Dustin Ames
    Expired Member
    Post count: 28

    Ah, I misunderstood. I have added them back and the logos show up, but I’m still getting duplicate images on top of one another.


    Dustin Ames
    Expired Member
    Post count: 28

    Ah, I didn’t know there were two places for redirect. I have changed it, thank you!

    in reply to: geode_thumbnail #379548

    Dustin Ames
    Expired Member
    Post count: 28

    Here is the full function:

    
    
    
    if (!function_exists('geodir_get_featured_image')) {
        /**
         * Gets the post featured image.
         *
         * @since 1.0.0
         * @package GeoDirectory
         * @global object $wpdb WordPress Database object.
         * @global object $post The current post object.
         * @global string $plugin_prefix Geodirectory plugin table prefix.
         * @param int|string $post_id The post ID.
         * @param string $size Optional. Thumbnail size. Default: thumbnail.
         * @param bool $no_image Optional. Do you want to return the default image when no image is available? Default: false.
         * @param bool|string $file Optional. The file path from which you want to get the image details. Default: false.
         * @return bool|object Image details as an object.
         */
        function geodir_get_featured_image($post_id = '', $size = '', $no_image = false, $file = false)
        {
    
            /*$img_arr['src'] = get_the_post_thumbnail_url( $post_id,  'medium');//medium/thumbnail
            $img_arr['path'] = '';
            $img_arr['width'] = '';
            $img_arr['height'] = '';
            $img_arr['title'] = '';
            return (object)$img_arr;*/
            global $wpdb, $plugin_prefix, $post;
    
            if (isset($post->ID) && isset($post->post_type) && $post->ID == $post_id) {
                $post_type = $post->post_type;
            } else {
                $post_type = get_post_type($post_id);
            }
    
            if (!in_array($post_type, geodir_get_posttypes())) {
                return false;// if not a GD CPT return;
            }
    
    

    /**
    * Filter to force the list images to be smaller.
    * @since 1.6.18
    */
    if( $size==’list-thumb’ && apply_filters(‘geodir_use_small_list_img’,false) ){
    $fimg = get_the_post_thumbnail_url($post_id,’medium’);
    if($fimg){
    $uploads = wp_upload_dir();
    $uploads_baseurl = $uploads[‘baseurl’];
    $file = str_replace($uploads_baseurl,”,$fimg);
    }
    }

    $table = $plugin_prefix . $post_type . ‘_detail’;

    if (!$file) {
    if (isset($post->featured_image)) {
    $file = $post->featured_image;
    } else {
    $file = $wpdb->get_var($wpdb->prepare(“SELECT featured_image FROM ” . $table . ” WHERE post_id = %d”, array($post_id)));
    }
    }

    if ($file != NULL && $file != ” && (($uploads = wp_upload_dir()) && false === $uploads[‘error’])) {
    $img_arr = array();

    $file_info = pathinfo($file);
    $sub_dir = ”;
    if ($file_info[‘dirname’] != ‘.’ && $file_info[‘dirname’] != ‘..’) {
    $sub_dir = stripslashes_deep($file_info[‘dirname’]);
    }

    $uploads = wp_upload_dir(trim($sub_dir, ‘/’)); // Array of key => value pairs
    $uploads_baseurl = $uploads[‘baseurl’];
    $uploads_path = $uploads[‘path’];

    $file_name = $file_info[‘basename’];

    $uploads_url = $uploads_baseurl . $sub_dir;

    in reply to: geode_thumbnail #379547

    Dustin Ames
    Expired Member
    Post count: 28

    Hi Giri,

    It looks like that is already removed:

    
    
            if ($file != NULL && $file != '' && (($uploads = wp_upload_dir()) && false === $uploads['error'])) {
                $img_arr = array();
    
                $file_info = pathinfo($file);
                $sub_dir = '';
                if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..') {
                    $sub_dir = stripslashes_deep($file_info['dirname']);
                }
    
    in reply to: geode_thumbnail #379187

    Dustin Ames
    Expired Member
    Post count: 28
    This reply has been marked as private.
    in reply to: geode_thumbnail #379184

    Dustin Ames
    Expired Member
    Post count: 28
    This reply has been marked as private.
    in reply to: geode_thumbnail #379183

    Dustin Ames
    Expired Member
    Post count: 28
    This reply has been marked as private.
    in reply to: geode_thumbnail #379181

    Dustin Ames
    Expired Member
    Post count: 28
    This reply has been marked as private.
    in reply to: geode_thumbnail #379062

    Dustin Ames
    Expired Member
    Post count: 28
    This reply has been marked as private.
    in reply to: Logo as Featured Image #370437

    Dustin Ames
    Expired Member
    Post count: 28

    Thank you.

    in reply to: Logo as Featured Image #370426

    Dustin Ames
    Expired Member
    Post count: 28

    Last question on this topic (I hope):

    In order for the new featured image thumbnail (geodir_company_logo) to adopt all the css properties necessary, do I create new css/scss rules using the new class (potplus_company_logo)?

    Basically replacing

    geodir-post-img

    with

    potplus_company_logo

    ?

    Thanks again Giri, your help is greatly appreciated.

Viewing 15 posts - 1 through 15 (of 22 total)