Dustin Ames
Forum Replies Created
-
AuthorPosts
-
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.
This reply has been marked as private.If you find a solution to this, please let me know. I have the exact same problem.
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.
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.
May 22, 2017 at 10:22 pm in reply to: Home page redirects on first load even though it is set not to #379595Ah, I didn’t know there were two places for redirect. I have changed it, thank you!
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;
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']); }
This reply has been marked as private.This reply has been marked as private.This reply has been marked as private.This reply has been marked as private.This reply has been marked as private.Thank you.
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.
-
AuthorPosts