Forum Replies Created
-
In reply to: I would like to disable Email activation
Just to clarify, I’m not in favour of disabling email activation, either. The spam you’d be getting would kill your site.
However, the site I was doing this for does not allow users to post status updates in the conventional form. The site is an anonymous image sharing site. Users need to be registered to submit an image, but they needn’t be registered as themselves. Every user has the option of using [username]@domain.ext as their email address if they choose to stay anonymous.
Status updates are replaced by img tags to the uploaded image. Yes, they could spam in activity comments, but I guess that’s a risk that had to be taken. Until someone figures out how to use akismet on those comments too…
In reply to: home tab not have class "selected"Just confirming that I’m facing the same issue…
Have tried bp_is_front_page, is_front_page and is_home to check, but none of them output the class.
If this helps: I have only the activity and members features working… no forums or groups.
Also, I didn’t have a blog page earlier, but I’ve added it, since.
This might be a related issue…
In wp-admin>settings>reading, selecting activity as the front page does nothing at first try. Attempting it a second time locks it into place. I’ve faced this issue at least 3 times.
In reply to: I would like to disable Email activationTried it out… works perfect.
I just threw that code into bp-custom.php, and that’s all it took.
Instead of disabling the email entirely, perhaps you could give options of customizing the welcome mail? Or would that be too much as a core function?
In reply to: I would like to disable Email activationThanks… Will try that out.
In the activation email, I’ve reworded the text to remove the link, and made it a general “How do you do?” mail.
Added a link to recover username/password, to make the mail slightly useful.
In reply to: I would like to disable Email activationTheoretically, if we’d like to disable it, is there a way we can define it in wp-config or bp-custom?
We’ve got a workaround, but it involves changing a core file, bp-core-signup.php. We changed this line:
$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->users SET user_status = 2 WHERE ID = %d", $user_id ) );to set the user_status as 0 (activated)
$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->users SET user_status = 0 WHERE ID = %d", $user_id ) );Next, we changed a line in register.php, in a child theme, where we changed the conditional
<?php if ( bp_registration_needs_activation() ) : ?>to
<?php if ( !bp_registration_needs_activation() ) : ?>This solves the problem, but it involves modifying a core file. Any workaround for that?
I faced the same problem… and I did took the simplest measure to make it work: I shifted the WP files out of its folder… I know, not the best solution. But I’m working on a fresh site, and I could afford to…
In reply to: Single Search-Result-Pageumm.. +1?
In reply to: Security problem – how do i hide the admin account?If you don’t want to get into the database, the simplest way would be to create another administrator account, logging in as the new admin, and deleting the user named admin.
PS: @hnla Buddypress now works with regular WP, too.
In reply to: Show favourite count after each activity?@snark: Try this, for pluralization…
function my_favorite_count() {
$my_fav_count = bp_activity_get_meta( bp_get_activity_id(), 'favorite_count' );
if ($my_fav_count >= 1) : {
if (is_user_logged_in()) : {
echo '<span>(' . $my_fav_count . ')</span> favorite';
if ($my_fav_count > 1) :
{echo 's';} //this turns favorite into favorites
endif;
}
endif;
}
endif;
}
add_action( 'bp_activity_entry_meta', 'my_favorite_count' );I’ve been sidetracked by a couple of other things that needed my attention, so I haven’t been able to make it do what I’d really like it to do, ie: show the number within the favorite link, like it shows in the reply link:
[Reply (12)] [Favorite (23)].For consistency.
And the other issue of updating the number on clicking the link.
And, showing the users who’ve favourited the activity.
About the other issue, I’ve been trying to find the source of those links, too… Not much luck with that, yet.
In reply to: siteurl vs. home – getting the blog domainThis is a problem with regular WP, though. (WP 2.9.2 + BP 1.2.1)
On shifting my WP files from the parent directory (example.com) to a separate WP directory (example.com/wp/), Buddypress URLs contain a /wp/ in them, by default.
For instance, the admin profile url is example.com/wp/members/admin. Manually typing in example.com/members/admin will get you to the same page, without any errors, but all inks generated by BP contain /wp in them.
In reply to: Show favourite count after each activity?bp-custom.php goes in the plugins folder… It doesn’t exist, you’ll have to create a php file containing the code above.
<?php
?>And that’s what it does, so far. It shows the number of times each secret has been favourited by users.
[code goes here]
?>
And that's what it does, so far. It shows the number of times each secret has been favourited by users.
In reply to: Show favourite count after each activity?@r-a-y: You probably meant this plugin: https://buddypress.org/forums/topic/buddypress-like
You’re right.. it does do pretty much the same thing. But I’ll stick with this, since it’s one of my few attempts at coding something
In reply to: Show favourite count after each activity?@snark: I’ve modified the function to this:
function my_favorite_count() {
$my_fav_count = bp_activity_get_meta( bp_get_activity_id(), 'favorite_count' );
if ($my_fav_count >= 1) : {
if (is_user_logged_in()) : {
echo '<span>(' . $my_fav_count . ')</span>';
}
endif;
}
endif;
}
add_action( 'bp_activity_entry_meta', 'my_favorite_count' );Apart from shortening my function name, this shows the count only if the visitor is logged in.
This code goes into bp-custom.php, and it outputs the count next to the Favorite or Remove Favorite button.
In reply to: User RegisteringYou’ll need to go to http://yourwpinstall/wp-admin/options-general.php and check the ‘Anyone can register’ option.
In reply to: Show favourite count after each activity?Oh.. thanks.
Will get back on this later, then.
In reply to: Show favourite count after each activity?Hit a block here… how do I hook into the function where a user clicks on the favourite button, and make that do something to the database? Using bp_activity_action_mark_favorite? bp_activity_add_user_favorite?
Tried them both, with no results… I know I’m doing something wrong here, but my knowledge of PHP/mySQL is mostly trial and error… (a lot of the latter)
Right now, I’m doing this:
function my_favorite_by_add() {
$my_fav_by_current = bp_activity_get_meta( bp_get_activity_id(), 'favorite_by' );
global $current_user;
get_currentuserinfo();
$my_fav_by_new = $my_fav_by_current . ',' . $current_user->ID ;
bp_activity_update_meta( $activity_id, 'favorite_by', $my_fav_by_new );
}
add_action( 'bp_activity_add_user_favorite', 'my_favorite_by_add' );Any suggestions?
In reply to: Show favourite count after each activity?@r-a-y: Thanks, again…
Now, still trying to get the hang of the whole replacing core functions principle…
Will update this once I get some results.
In reply to: Show favourite count after each activity?Related question:
How do I show a list (or avatars) or users who’ve favourited the activity?
Here’s how I’m about to attempt to do it:
The first time an activity is favourited, I add a new row to wp_bp_activity_meta with activity_id, a meta_key named my_activity_faved_by, and the user_id as its meta_value.
With every additional favouriting, I update the corresponding meta_value with the new user_id at the end (using CONCAT?).
And in the frontend, I throw out a list of avatars of users who’ve favourited that activity.
Is that the best way about it, or is there something simpler I could be doing?
In reply to: Show favourite count after each activity?Yup… that works!
Thanks…
In reply to: Show favourite count after each activity?PS: using BP1.2 + WP 2.9.2
In reply to: How to turn Confirm Email Off?I should just remind myself to check this site each time I need something…
http://www.thinkinginwordpress.com/2009/10/autoactivate-users-and-blogs-at-buddypress-signup/
In reply to: How to turn Confirm Email Off?Here’s what I’m trying to do…
I’d like to hook into bp_after_registration_submit_buttons to run a query that will update wp_signups in the database.
If that function does what i think it does, I would set ‘activated’ to the same as ‘registered’ and set ‘active’ to 1. I’m guessing there’s more involved, like copying the ‘meta’ to wp_usermeta, and also adding their details to wp_users.
Now here’s the tricky bit: how do I hook into bp_after_registration_submit_buttons?
And, how do I get _any_ identifying value for the user who’s just registered?
In reply to: Can\'t I use bp template tags in my own template?Well…. it’s that simple?
i tried it out on a random page, and it worked… but for styling.
It really should be written somewhere… on the extend/themes page, perhaps. So people put together some themes and populate the page.
Thanks! You’ve made my life a whole lot easier.