Hello Buddydev
I have recieved email complants from visitors who don’t know how to get the url for an individual post.
At the top of each Buddypress post is a time posted link with a url that will create a page with only that post on it.
Example == -User123- posted an update (a day ago)
Example == https://buddypress-site.com/activity-page/p/8803/
Is it possible to put some code into “bp-custom.php” or “functions.php” that would make a copy to clip board button for visitors that are not logged in ?
Thank You
webbuddyHi,
Welcome to BuddyDev.It is certainly doable. How to do it will depend on theme/template pack you are using.
You will need to do the following:-
1. Load a js file like ClipBoard.js – https://clipboardjs.com/
2. Inject the button for copying (most of the time usingbp_activity_entry_meta
action)
3. Enable the copyThere is a minor issue that you will face when new activity is posted on current page, you will need to activate this copy js again for that specific activity.
Regards
BrajeshHey Brajesh
Hey , Thanks for the great reply. I’ll look into that, but —
maybe there’s an easer way ? — A link button, or just some link text that would appear
below the post for logged and non-logged in users. Then users could right click menu to
get the Url. Could that be done functions code ?
——–
——–On that — other thing, I’ll try to find one that doesn’t require a phone. Thats not going to be easy.
Thank You
WebBuddy- This reply was modified 6 days, 3 hours ago by
Web Buddy.
- This reply was modified 6 days, 3 hours ago by
Hi,
Try adding the following code to your functions.php or bp-custom.phphttps://gist.github.com/sbrajesh/ed8298d085f6b58e1838f6f4db97d877
It would add a “Link” text to each post and clicking on it, users can access the permalink.
Regards
BrajeshYou are welcome.
I am looking forward to your fedeback.About the email:- My main concern is that someone may access it and reset your account’s pass and do something undesirable(spam). That’s why I suggested changing it.
Regards
BrajeshHi Brajesh
That code worked great !
The link appeared with the others below the post with ‘ comment ‘ favorite’ ect.
I looked at it with the browsers web developer. You already know this but here is the html
div container it operates in
<div class=”activity-meta”>
this is the permalink function in that container
<a href=”https://buddypress123.com/activity-page/p/8816/” target=”_blank”
class=”bp-activity-permalink”>Link
Is there a way to give the new link a logged in exception ? It disappears with the
other functions when non-logged in visitors view the activity feed.————————–
————————–
The mail address and password for this account are only used here. It’s unlikely
anyone is going to get inI tried to add a number sequence to the mail address that for practical purposes becomes
the mail service account password. Got a red banner – ” settings have been changed ” but it didn’t change.————–
————–
Thank You
WebBuddy- This reply was modified 1 day, 10 hours ago by
Web Buddy.
- This reply was modified 1 day, 10 hours ago by
You must be logged in to reply to this topic.