Forum Replies Created
-
In reply to: Update custom table field when posting activity
An update on this, and help required.
I’m trying to attach a file upload, but this hook doesn’t let me return the $_FILES array for some reason.
I have updated post-form.php to have an
enctypeofmultipart/form-databut when I run my function ontobp_activity_addno data is in the$_FILESarray.Any ideas? I’m kinda stuck here.
In reply to: Does BuddyPress comply with disability W3C standardsGreat to hear this also.
In reply to: Xprofile custom fields – imageSorry, can’t help you here maybe someone else here is familiar with it.
In reply to: Change colors of fields‘#signup_username { border: green !important; }
#signup_email { border: yellow !important; }
#signup_password { border: blue !important’ }
#signup_password_confirm { }
ul.reg_groups_list_multiselect { }
#field_1 { }
#field_4 { }
#field_7 { }
#field_5 { }
#field_6 { }
iframe { }`field 1 = name
field 4 = city
field 7 = age
field 5 = facebook
field 6 = other profile
iframe = about meYou may be able to write this without
!importantbut if you can’t apply that to provide almost absolute over ride to existing and troublesome styles in your theme.In reply to: Update custom table field when posting activityThanks a lot, that’s really helpful.
In reply to: Open Source Theme: Your Voice is NeededI would however be the steer in this scenario.
I’m sorry,
groups_is_user_admin()is the wrong function, you need something more like thiscurrent_user_can('editor') || current_user_can('administrator'). That needs to be wrapped in an IF statement.You would put that in
your-theme/buddypress/activity/post-form.php.This is a similar problem https://buddypress.org/support/topic/how-to-stop-topic-creation-for-groups/
I believe this is the default functionality of a BuddyPress powered site.
Your theme may be hijacking this, I’d look in the theme files first for a template.
In reply to: how to add new members to groups automatically?First you are creating a custom function called
automatic_group_membership()this takes one parameter$user_id.This function terminates if there is no
$user_idprovided, meaning you don’t run rogue code and your site is more optimised.When a
$user_idis present thegroups_accept_invite()function is run. This function is a BuddyPress core function you can find it inwp-content/plugins/buddypress/bp-groups/bp-groups-functions.phpon line 1400.It accepts two parameters a
$user_idand a$group_id. You need both in order to create the relationship.This function is “hooked” with
add_action()which is a WordPress core function. This functionadd_action()has many hooks available for various situations. You can read more about hooks here https://codex.wordpress.org/Plugin_API/Hooks.Essentially it’s an opportunity to run your own code against WordPress core, or in this case BuddyPress core. BuddyPress provides the hook and we use them to achieve cool things.
So the hook in this case is
bp_core_activated_userand the code we want to run when this hook is available would be the customer functionautomatic_group_membershipwhich is passed as a second parameter.I’m not sure where the
$user_idgets populated along the way here, nor the$group_idmaybe someone can help?Otherwise, I would do this not on activation but when a user has logged in for the first time.
Then we have access to
global $bpwhich contains aloggedin_user->idwhich can be used with this function and you could manually set the$group_idin bp-custom.phpIn reply to: Login RedirectYou can achieve this with a custom login link which is accessed by a user on your site front…
<?php echo wp_login_url(home_url('/')); ?>When clicked the login form will process a redirect after logging in.
That wont work if you access the wp-login.php directly.
@coffeewebdev looks like he’s given you a more all-round solution.
You can fix this with CSS, it’s the easiest way for this type of thing.
Look in your CSS and do something like this
`div.activity-header img { display: none; }’
In reply to: How to stop Topic Creation for Groups@sharmavishal I hear you. @magicvish If you can’t work this out (we’ve given you some good help) you should probably pay someone who can.
How about using Custom Fields?
I use a shared hosting environment and performance is sluggish at best and I’ve taken a lot of time to develop a theme that is barebones with regard to what WordPress and BuddyPress both give you.
So, you may want to setup in an environment where you can be provisioned for more hardware resources or better hardware.
Like Paul says though, there are many successful sites out there. I’d do your research and speak with the host.
I’m not savvy in this area, only speaking from experience,
In reply to: How to modify extended profile picture by HTML formYour form will have a field like this
<input type="file" name="file">You will capture the upload with
$_FILES['files']You can pass that into
wp_handle_upload()Look here http://php.net/manual/en/reserved.variables.files.php for each item the
$_FILESarray will capture for you.In reply to: How to stop Topic Creation for Groups@sharmavishal what @magicvish said but instead of removing you could check
groups_is_user_admin()and show form if true.In reply to: Poor Avatar qualityYou reminded me @danbp worth mentioning that if you upload a larger photo than default cropping dimensions (let’s say 150 x 150) the crop only takes what it sees in the viewport not the actual size of the image.
So you could crop a face which is small because it’s max-width is 100% of viewport (or parent div) that translated into a small face in a 150 x 150px actual crop. Meaning the crop of a face (larger than 150 x 150) but shows at like 75 x 75 ends up looking pixelated.
I suggest the BP Devs look at this, it’s pretty antiquated.
In reply to: Show member’s groups in members loopTidy
In reply to: Video post not responsive!!You need to make the video responsive. First add a wrapper div to your media, something like
<div class="video-wrapper">your video</div>. Then in CSS do something like ‘div.video-wrapper { width: 100%; }`.There are better ways, but that’s a start
In reply to: Login and registration on one pageIf you know what you’re doing inside register.php it can be done. Why would you want to go to this trouble when yoursite.com/wp-login.php and yoursite.com/register.php work just fine?
In reply to: How to modify extended profile picture by HTML formYou can create a multitype form with html and process it with PHP, or an existing WordPress function.
https://codex.wordpress.org/Function_Reference/wp_handle_upload
You would need to modify the database to store your file upload paths also.
In reply to: Public postsSounds like you’re using a theme that’s stopping this or when you publish a post you have it set to private.
It’s more for WordPress forums given posts are a WordPress feature and not a BuddyPress one.
Look at your theme files, index.php and look for anything that looks like it’s making those posts only accessible to logged in users. Something like
is_user_logged_in().In reply to: Struggling with Group InvitesThanks again, I’ll leave it live for a while but don’t expect much interest.
In reply to: Struggling with Group InvitesI’ve published the theme for sale now, if it gets enough interest I’ll roll in support for the other areas.
Thanks for the help.