Listing Detail "Author" link.
This topic contains 13 replies, has 4 voices, and was last updated by Giri 7 years, 10 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketTagged: author, customizations, detail
-
AuthorPosts
-
January 10, 2017 at 6:57 am #340161
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.
January 10, 2017 at 6:12 pm #340481Hi,
I’m sorry to inform that both things could only be achieved with an extensive code customization.
Thank you
February 11, 2017 at 11:08 pm #360480Hi 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,
oliverFebruary 13, 2017 at 1:38 pm #361146February 13, 2017 at 1:45 pm #361147I 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
February 15, 2017 at 1:17 pm #361708Hi 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.
February 15, 2017 at 1:21 pm #361709what is the error you see?
February 15, 2017 at 1:25 pm #361710Wow, that’s fast…
Parse error: syntax error, unexpected ‘->’ (T_OBJECT_OPERATOR)
February 15, 2017 at 1:28 pm #361713Looks 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
February 15, 2017 at 1:32 pm #361714Hi oliver,
you seem like you have enough skills to edit the file. 🙂
please edit the geodirectory plugin via ftp and apply this changes.
Let me know how that goes.
Thanks
February 15, 2017 at 2:06 pm #361742OK, 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,
oliverFebruary 16, 2017 at 8:58 am #361958The 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
February 16, 2017 at 10:20 am #361976Thanks 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.February 16, 2017 at 10:38 am #361979That seemed to work. HOWEVER, the ‘Contact the author’ link is outside the side column
Your “Contact the author” link is called “Send Enquiry” link.
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket