Forum Replies Created
-
Not tested thoroughly as I was sidetracked, but it seems to work fine.
I was looking for a solution to this a while back, Shane provided one here:
https://buddypress.org/support/topic/private-message-friends-only/
the code goes into the bp-custom.php file.
Without it private messages can be sent to anyone, friend or not.
This might work to hide it for logged out users (put in bp-custom.php):
function hide_bubble_logged_out () { if ( !is_user_logged_in() ) { ?><style type="text/css">.bubble { display: none; }</style><?php } } add_action( 'bp_ready', 'hide_bubble_logged_out' );
This is generally what you need to do to change text:
Hi @aminipix,
This css should work:
#footer-menu ul li.bubble { transform: translate(0, 20%); min-width: 22px; height: 22px; padding: 4px; border: 1px solid #000; border-radius: 50%; margin: 0 10px 0 0; background: #fff; color: #000; font-size: 11px; line-height: normal; text-align: center; }
The problem seemed to be mainly caused by the line-height properties of your .tab class which is also being used by the text in your bubble. If you use the F12 button and locate the line
ul id="menu-app-footer" class="footer-menu tabs tabs-icon-top"
(its just above where the bubble is), then scroll down the Styles window to the .tabs selector, you will see what i mean about the line-height (set to be 49px).The php code shows the notification count for the logged in user, so check that what is being displayed for a user is actually the correct number of notifications. If viewing the profile page of another user for example, the numbers will stay the same since the logged in user is the same. If the numbers are changing, then maybe there is a conflict with another function or plugin. As for when you are logged out, do you even need to see the notification bubbles? If not then maybe just prevent them being visible from anyone who is not logged in.
Hi @aminipix ,
From the pic, your selector should be something like
#footer-menu ul li.bubble
. It may be slightly different to that (there maybe something between the#footer-menu
andul
part) but without a link to that page of your site it is tricky to say. It could also bediv#footer-menu #menu-app_footer ul li.bubble
, like i said, tricky for me to say without hands on.You are on the right track though looking at the pic. If the above doesn’t work you could try clicking on the
li id=menu-item-1633...
as your pic shows and look in the ‘Styles’ window. See what the selector path being used for that is and add the.bubble
onto the end.As for showing the wrong number, not sure what that’s about. Is there a code conflict with another function or plugin you are using?
The size of your site-branding (header logo) is what is causing your site-header (green banner) to be so large in height. So by adjusting the height of your site-branding, you can reduce the height of the banner and as a result your header menu will fall alongside it.
Add this to your style.css :
.site-branding { min-width: initial; max-width: 35%; }
If you want to change your banner height to a specific value rather than letting it automatically adjust depending on what is inside it, then use:
.site-header { height: 120px; }
If you find the php file with the html inside it for that page, moving the div with
class=col-sm-12 col-md-5
(these relate to your profile field blocks), immediately below the div with theclass=col-sm-12 col-md-7
seems to work (at least for me using the browser developer tools on your page).Hi @neijisly, I tried your updated code but had no success with it. Thank you for trying though!
Hi @shanebp, your code works great. Thank you! I don’t have any other plugins apart from BuddyBoss Global Search and BuddyBoss Edit Activity. So unless your code affects the functioning of another part of BuddyPress, then there shouldn’t be any conflicts.
While looking at messaging I have just noticed that Private Messages don’t send when you select a recipient via the autocomplete dropdown (get a failed message saying username is incorrect). However if you manually type out the same username, the message sends fine. I haven’t yet searched the forum on this matter though so there may already be a solution out there. I’ll have a look.
Thanks Henry for the pointer! I’ll give it a look 🙂
Hi @neijisly ,
Thank you for your response. I tried the function
neiji_fillfield_only_if_friends()
you posted above with a minor amendments to the last if statement condition (due to the ‘is_friend’ which i assume is something else you have in your functions.php?), but no luck. (I already have a function in place similar to your first remove button function).From what i understand of your second function , it is meant to prevent the Message > Compose page loading and redirect if the users are not friends? (Correct me if I’m wrong). The issue I am having though is that when I am already on the Message > Compose page, I am still able to type in someone’s username and send a message to them even though they aren’t a friend.
Hi,
Copy the line file activity-loop.php into your child theme (maintaining the same file structure), and replace the line:
<?php if ( bp_has_activities( bp_ajax_querystring( 'activity' ) ) ) : ?>
with the line:
<?php if ( bp_has_activities( bp_ajax_querystring( 'activity' ) . '&per_page=10' ) ) : ?>
Hi Ray. Yeah that’s what I assumed. Was just wondering what effects removing one from the Settings Visibility drop down would have (if any) as they currently seem to serve pretty much the same purpose on my site now (with the code I’ve introduced preventing visibility to non logged in users)
Cheers
It’s not your
.activity-header
. Its thep
inside it that currently has the background. This does the trick:#buddypress #activity-stream .activity-content .activity-header p { background: transparent; border: none; }
Similarly for
.item-list-tabs
its the list inside it#buddypress div.item-list-tabs ul { background: transparent; border: none; }
and the subnav….
#buddypress div#subnav.item-list-tabs ul { background: transparent; }
and the subnav select box…
#buddypress div#subnav.item-list-tabs ul li.last { background: transparent; }
the select box…
#buddypress div#subnav.item-list-tabs ul li.last select { background: #fff; }
🙂
Thanks for response Shane. I did see that post, but even with button removed it still allows a user to compose a message and send to someone who isn’t a friend, hence why i was still searching.
I have already introduced a text limit on the compose field to discourage spamming, but it is only Javascript. So with Javascript turned off it is still possible to send big messages. Looking for the PHP validation database solution.
Guess I’ll weigh up the value of PM’s on my site (not live atm) against the possible annoyance of spam to users. Better to introduce PMs at a later date rather than have it initially, find a problem with spam annoying people in the community and then having to remove the feature.
Ouch! At least you got there in the end.
There is probably a way via php using an
if
statement. Javascript may also be an avenue usinggetElementsByClassName("bubble").innerHTML
. Tried a few out but no success at moment.Not used Compliments myself, but maybe someone on their support can help with that.
I was just taking a shot in the dark, that if line 107 was the one :
if ( $image = genesis_get_image( array( ‘format’ => ‘url’, ‘size’ => genesis_get_option( ‘image_size’ ) ) ) ) {
then change the
=
to==
.But the problem maybe something incorrect prior to the = sign. A missing semicolon, bracket etc. Does the function work properly in its original state (i.e. before alterations were made?).
May be useful to ask your theme support as to where the link from Shane should go, as I’m not familiar with it.
hi,
Yeah looks good :). With the current properties you’ve used, to center your text the minimum width for your button needs to be:
width: 90px;
.The height is automatically calculated at the moment (combination of the text height, padding and border thickness). It adds up to 30px. So you can either remove the height property from your css or just set it equal to
height: 30px;
.have a play around:
#bp-login-widget-submit { width: 50px; height: 20px; padding: 4px 10px; border: 1px solid #0e532c; border-radius: 4px; background: linear-gradient(#4f7c8f, #84D0EF); background: -webkit-linear-gradient(#4f7c8f, #84D0EF); background: -o-linear-gradient(#4f7c8f, #84D0EF); background: -moz-linear-gradient(#4f7c8f, #84D0EF); box-shadow: 0 4px 4px #4f7c8f; -webkit-box-shadow: 0 4px 4px #4f7c8f; -moz-box-shadow: 0 4px 4px #4f7c8f; font-size: 14px; }
You can set the width, height, padding properties etc to reduce the size of the button. Without a link to your site though it’s not possible to suggest anything further 🙂
what is on line 107 of your functions.php file? is it the code above? if it is, try and replace it with
==
You need to get the css selectors for the title and the button to style them. Easily done using the developer tools on your browser (hit F12 in your browser).
Then you’ll have something like this to remove the title:
#idoftitle { display: none; }
and to style your button something like:
#idofloginbutton { border: 1px solid #ff00ff; border-radius: 4px; background: #ff00ff; color: #fff; }
etc.
There are lots of variables that go into styling so the above are just examples. Put your custom code in your style.css file within your child theme and your changes will show.
Hi @mosesyoon,
In the second code of yours above I think you may be missing an opening bracket on the
printf
line. Btw use the code button when posting on here, so it’s easier to read.Anyway maybe try this:
function streamline_post_image() { if ( is_page() || ! genesis_get_option( ‘content_archive_thumbnail’ ) ) return; if ( $image = genesis_get_image( array( ‘format’ => ‘url’, ‘size’ => genesis_get_option( ‘image_size’ ) ) ) ) { printf( ‘%s‘, bp_core_get_user_domain( $post->post_author ), $image, the_title_attribute( ‘echo=0’ ) ); } } add_action( ‘genesis_entry_header’, ‘streamline_post_image’, 1 );
Hi,
If you’re referring to the profile page of a member, the function
<?php bp_user_firstname(); ?>
may work for you. Just add it into the file creating the page title within the H1 tags.Or if you created profile fields in your WP Dashboard > Users > Profile field, then another option might be to use:
<?php bp_member_profile_data ( 'field=First Name' ); ?>
. Change the First Name text to whatever you called the field for the user’s first name.