Listing Detail "Author" link.

This topic contains 13 replies, has 4 voices, and was last updated by  Giri 7 years, 8 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #340161

    Tom Rendle
    Buyer
    Post count: 46

    What sort of customization options are their for this link and the send enquiry link? Rather than have the user email the listing owner I would like the “send enquiry” link to go to sending a private message to the user on buddypress. Is this possible? Also how about the author link, can we change this to say anything? Can this link straight to a private message?

    Thanks for any details.

    #340481

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    I’m sorry to inform that both things could only be achieved with an extensive code customization.

    Thank you

    #360480

    oliver vandenbussche
    Expired Member
    Post count: 8

    Hi Tom and Paolo,

    I was looking for the same thing and found this shortcode to use in a text widget in the side column:

    function bpfr_message_shortcode() {
    $author = get_the_author();
    $message = ‘Login to send a message to this author !’;

    if( is_user_logged_in() ) {
    return ‘Contact the author‘;
    } else {
    return $message;
    }
    }
    add_shortcode( ‘ksam’, ‘bpfr_message_shortcode’ );

    Add this to bp-custom.php or your child-theme functions.php.
    Use the shortcode [ksam] at the place you want and you’ll see a Contact the author link.

    That seemed to work. HOWEVER, the ‘Contact the author’ link is outside the side column and I can’t figure out how to automatically have the place (or event) title or URL in the message Subject. Hope this helps and maybe you can help me with the HOWEVER part?

    Thanks,
    oliver

    #361146

    Giri
    Expired Member
    Post count: 3155

    @oliver,

    Can you post your admin details in private reply.

    I’ll help you to fix the css.

    Thanks

    #361147

    Giri
    Expired Member
    Post count: 3155

    @tom

    I have added some filters in GD to modify send enquiry link. It will be availble from next version.

    Please post your wp admin details. So I can apply the changes.

    You need to use a custom function like this in code snippets

    
    
    
    function bp_custom_get_send_private_message_link($to_id,$subject=false,$message=false) {
    
    	//if user is not logged, do not prepare the link
    	if ( !is_user_logged_in() )
    	return false;
    
    	$compose_url=bp_loggedin_user_domain() . bp_get_messages_slug() . '/compose/?';
    	if($to_id)
    	$compose_url.=('r=' . bp_core_get_username( $to_id ));
    	if($subject)
    	$compose_url.=('&subject='.$subject);
    	if($message)
    	$compose_url.=('&content='.$message);
    
    	return wp_nonce_url( $compose_url ) ;
    }
    add_filter('b_send_inquiry_url', 'b_send_inquiry_url');
    function b_send_inquiry_url() {
        global $post;
    	$url = bp_custom_get_send_private_message_link($post->post_author);
    	return $url;
    }
    

    Thanks

    #361708

    oliver vandenbussche
    Expired Member
    Post count: 8

    Hi Giri,

    Thank you for your fast reply. Let me start by saying that I’m totally new to programming and that I learn through trial and error… So forgive my lack of knowledge.

    I may be completely wrong here but guessed that I needed to add the code snippet to my child theme’s function.php.
    I received an error in this line:

    $url = bp_custom_get_send_private_message_link(post->post_author);

    Any ideas on what the problem may be? Or should I just wait for the update?

    Thank you. oliver.

    #361709

    Giri
    Expired Member
    Post count: 3155

    what is the error you see?

    #361710

    oliver vandenbussche
    Expired Member
    Post count: 8

    Wow, that’s fast…

    Parse error: syntax error, unexpected ‘->’ (T_OBJECT_OPERATOR)

    #361713

    Giri
    Expired Member
    Post count: 3155

    Looks like I missed

    $

    symbol in the code.

    Change the text

    post->post_author

    to

    $post->post_author

    That will fix your syntax errors.

    But you still need the changes I added in my Geodirectory plugin in order to work.

    Thanks

    #361714

    Giri
    Expired Member
    Post count: 3155

    Hi oliver,

    you seem like you have enough skills to edit the file. 🙂

    please edit the geodirectory plugin via ftp and apply this changes.

    https://github.com/mistergiri/geodirectory/commit/3766b21e3ae265721e11976cd4b2a79bd12e219f?diff=split

    Let me know how that goes.

    Thanks

    #361742

    oliver vandenbussche
    Expired Member
    Post count: 8

    OK, I added the code snippet in my child theme’s functions.php without error, Grrreat!

    I have made the changes in geodirectory-functions/custom_fields_output_functions.php that you sent my via e-mail.

    But nothing seems to have changed… Could it be that the function is only for Geodirectory plugin and not for the Geodirectory EVENTS add-on that I am using?

    Thanks,
    oliver

    #361958

    Giri
    Expired Member
    Post count: 3155

    The code I provided would work for all listings.

    1) Have you activated the code snippet?
    2) What happens when you click the “Send Enquiry” link?
    3) Try switching to some other theme and test it.

    Let me know if none of them solve your problem.

    Thanks

    #361976

    oliver vandenbussche
    Expired Member
    Post count: 8

    Thanks Giri, however still not working. Let me tell you what I’ve done:

    1) I have added and activated the code snippet through “code-snippet” plugin for wordpress. (I don’t know how else to activate it).
    2) I don’t see “Send Enquiry” anywhere on any of the Events pages.
    3) I get nothing but errors when I change to another theme… I have tried the Main theme (of which I’m using the child theme now) but no “Send Enquiry” to be found.

    #361979

    Giri
    Expired Member
    Post count: 3155

    That seemed to work. HOWEVER, the ‘Contact the author’ link is outside the side column

    Your “Contact the author” link is called “Send Enquiry” link.

Viewing 14 posts - 1 through 14 (of 14 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount