Search Results for 'code'
-
AuthorSearch Results
-
November 15, 2014 at 3:44 pm #154566
In reply to: Can't Format the Lead Topic in CSS
Robkk
Moderatortry combining the two into this and try it.
i tested in twenty-fourteen and it worked.
#bbpress-forums ul.bbp-lead-topic li.bbp-body div.topic { background-color: #0099FF; border: 1px solid #dd6; }November 15, 2014 at 3:38 pm #154565In reply to: Parabola theme – profile bug
Robkk
Moderator@pilxy the uppercase thing is in your themes css
like i said if your theme author just changes every instance of
.replyin his theme to.comment-reply-linkeverything should be fine.November 15, 2014 at 3:26 pm #154562In reply to: bbpress iphone compatibility problems
Robkk
Moderatorif you are a web designer from the website thats mentioned at the bottom of the website
you can do alot of things to make it where a forum doesnt look awkward
changing posts, voices, freshess, topics lalbes at the top to just icons
and more depending on where your imagination takes you.
i suggest maybe only showing the topic count in the forum archive
and move the freshness stats below the title of each forum
and showing only the posts stats for any forum you have just entered
and move the freshness stats below the title of each topic.
more info on designing can be found at the docs
November 15, 2014 at 3:11 pm #154560In reply to: Change the color of individual role names
Robkk
Moderatorit worked when i tryed it
remember to make sure you add the right css
like for example for the keymaster role use this
.bbp-author-role-keymaster { background:blue; color:white; padding:0 5px; }November 15, 2014 at 3:10 pm #154559Preston
ParticipantI’m finally getting back around to working on this and realized I’ll need to hide the topics from a specific user role as well. I can’t just remove spectate/participate capabilities because I need them to be able to post topics, just like users who aren’t logged in.
I’m having trouble finding a way to get the current user’s role for bbPress so I can use it in the same manner I used the user’s ID above.
I found this function, but it returns the WordPress role (administrator, editor, etc):
function get_user_role() { global $current_user; $user_roles = $current_user->roles; $user_role = array_shift($user_roles); return $user_role; }Can I somehow adapt it to return the bbPress role instead? (keymaster, moderator, etc.)
November 15, 2014 at 2:46 pm #154558In reply to: Truncated usernames
Robkk
Moderatorlong characters are going to show up like this anyway
splitboard.co
myou could lower the font-size a little bit more with css to allow maybe 2-3 more characters
but its still going to break the word apart if there is a certain amount of characters anywayyou could add more width to div.reply-author
maybe to about 150pxadd this anywhere where you can put custom css
#bbpress-forums div.bbp-topic-author, #bbpress-forums div.bbp-reply-author { width: 150px; }you also might have to add some @media query css too if i missed it.
November 15, 2014 at 1:54 pm #154555In reply to: Activate page
Robin W
Moderatorthere is no [bbp-activate] shortcode
https://codex.bbpress.org/shortcodes/
what are you trying to do?
November 14, 2014 at 7:04 pm #154541Topic: Count number of unique people who comment
in forum Requests & FeedbackAnneMarie
ParticipantDo you know how to count the number of unique people who comment per day/week/month?
Is there a plug-in that will do that?
Or code I can use?
November 14, 2014 at 5:48 pm #154496In reply to: User registration on multisite
Nicolas Korobochkin
ParticipantI have solution for this issue!
First of all — in web published a lot of strange and bad solutions for this issue. Add some rules to
.htaccess, changewp-signup.phpdirectly, blah blah blah…I dig into the source code and found something interesting. WordPress have
wp_signup_locationfilter which set up the signup page URL (location).require_once (TEMPLATEPATH . '/wp-signup.php'); function selena_signup_page () { return home_url () . '/signup/'; } add_filter ('wp_signup_location', 'selena_signup_page');After this create page-signup.php template in your theme folder with your custom forms (buttons, inputs, etc). Forms and other stuff can be grabbed from
wp-signup.php. So I tookwp-signup.phpfrom root WP folder and put them to my theme folder. But it needs to edit. I remove some requires, functions and function calls (checkout thewp-signup.php). Be careful!Right now I dont know how this technique works with caching (but I use Memcached and Batcache on my sites and all works great).
Next problem is – activate account page. Similar solution. Create
page-activate.phptemplate withrequire_once ( TEMPLATEPATH . '/wp-activate.php');call inside. And copywp-activate.phpto your theme folder and then edit them (remove requires, filters and actions). Don’t delete this:if ( is_object( $wp_object_cache ) ) $wp_object_cache->cache_enabled = false;This line for caching (I write about this above). Maybe someone tell us about object caching in WP? 🙂
Now you need disable activation letters (WP sends its twice after this manipulations :). Use
wpmu_signup_user_notificationfilter and your function needs to send emails and returnFALSE(or WP send second activation email).And that’s all!
Working example is my sites:
Activation:
It’s a multisite! And both sites also have:
November 14, 2014 at 5:47 pm #154470In reply to: Change the color of individual role names
Robkk
Moderatoryou add this to your themes functions.php or a functionality plugin.
you then use css to style the roles from there.
add_filter('bbp_before_get_reply_author_role_parse_args', 'ntwb_bbpress_reply_css_role' ); function ntwb_bbpress_reply_css_role() { $role = strtolower( bbp_get_user_display_role( bbp_get_reply_author_id( $reply_id ) ) ); $args['class'] = 'bbp-author-role bbp-author-role-' . $role; $args['before'] = ''; $args['after'] = ''; return $args; } add_filter('bbp_before_get_topic_author_role_parse_args', 'ntwb_bbpress_topic_css_role' ); function ntwb_bbpress_topic_css_role() { $role = strtolower( bbp_get_user_display_role( bbp_get_topic_author_id( $topic_id ) ) ); $args['class'] = 'bbp-author-role bbp-author-role-' . $role; $args['before'] = ''; $args['after'] = ''; return $args; }It grabs the topic or reply author role and adds another CSS class with prefix bbp-role- so you now have a new set of CSS classes e.g. bbp-role-keymaster, bbp-role-moderator, bbp-role-participant etc that you can then add your custom CSS styles to.
link this was from
more info about a functionality plugin
November 14, 2014 at 6:46 am #154518In reply to: How to add latest reply or topic to forum list
Julia_B
ParticipantI’d like to add this function to my Forum index page. Where do I need to paste this code? Thanks 🙂
November 14, 2014 at 4:35 am #154515In reply to: How to Stop Admin subscription emails…
tharsheblows
ParticipantThe reason for this is that sending out subscription emails one by one was appreciably slowing down some large sites, so in the last update they switched to bcc’ing in subscribers.
It’s fairly straightforward to change how the subscription emails are handled once you know how. If you unhook ‘bbp_notify_topic_subscribers’ you can then hook in your own subscription function.
Below is similar to what I did – I have it in a plugin but you could put it in your bbpress-functions.php file too, I think – this should be in a child theme. If you do this, please test it first as this is simply an example and not necessarily working code. I’ve gone ahead and simply pasted in the function that was used in the previous version of bbPress so you don’t have to find it.
//custom topic subscription emails, unhook old function, hook in new one remove_action( 'bbp_new_reply', 'bbp_notify_topic_subscribers', 11, 5 ); add_action( 'bbp_new_reply', 'mjj_bbp_notify_topic_subscribers', 11, 5 ); /** * from bbpress / includes / common / functions.php * this is taken from 2.5.3 - I've left in all comments to make it easier to understand **/ /** Subscriptions *************************************************************/ /** * Sends notification emails for new replies to subscribed topics * * Gets new post's ID and check if there are subscribed users to that topic, and * if there are, send notifications * * @since bbPress (r2668) * * @param int $reply_id ID of the newly made reply * @uses bbp_is_subscriptions_active() To check if the subscriptions are active * @uses bbp_get_reply_id() To validate the reply ID * @uses bbp_get_topic_id() To validate the topic ID * @uses bbp_get_forum_id() To validate the forum ID * @uses bbp_get_reply() To get the reply * @uses bbp_is_reply_published() To make sure the reply is published * @uses bbp_get_topic_id() To validate the topic ID * @uses bbp_get_topic() To get the reply's topic * @uses bbp_is_topic_published() To make sure the topic is published * @uses bbp_get_reply_author_display_name() To get the reply author's display name * @uses do_action() Calls 'bbp_pre_notify_subscribers' with the reply id, * topic id and user id * @uses bbp_get_topic_subscribers() To get the topic subscribers * @uses apply_filters() Calls 'bbp_subscription_mail_message' with the * message, reply id, topic id and user id * @uses apply_filters() Calls 'bbp_subscription_mail_title' with the * topic title, reply id, topic id and user id * @uses apply_filters() Calls 'bbp_subscription_mail_headers' * @uses get_userdata() To get the user data * @uses wp_mail() To send the mail * @uses do_action() Calls 'bbp_post_notify_subscribers' with the reply id, * topic id and user id * @return bool True on success, false on failure */ function mjj_bbp_notify_subscribers( $reply_id = 0, $topic_id = 0, $forum_id = 0, $anonymous_data = false, $reply_author = 0 ) { // Bail if subscriptions are turned off if ( !bbp_is_subscriptions_active() ) return false; /** Validation ************************************************************/ $reply_id = bbp_get_reply_id( $reply_id ); $topic_id = bbp_get_topic_id( $topic_id ); $forum_id = bbp_get_forum_id( $forum_id ); /** Reply *****************************************************************/ // Bail if reply is not published if ( !bbp_is_reply_published( $reply_id ) ) return false; /** Topic *****************************************************************/ // Bail if topic is not published if ( !bbp_is_topic_published( $topic_id ) ) return false; /** User ******************************************************************/ // Get topic subscribers and bail if empty $user_ids = bbp_get_topic_subscribers( $topic_id, true ); if ( empty( $user_ids ) ) return false; // Poster name $reply_author_name = bbp_get_reply_author_display_name( $reply_id ); /** Mail ******************************************************************/ do_action( 'bbp_pre_notify_subscribers', $reply_id, $topic_id, $user_ids ); // Remove filters from reply content and topic title to prevent content // from being encoded with HTML entities, wrapped in paragraph tags, etc... remove_all_filters( 'bbp_get_reply_content' ); remove_all_filters( 'bbp_get_topic_title' ); // Strip tags from text $topic_title = strip_tags( bbp_get_topic_title( $topic_id ) ); $reply_content = strip_tags( bbp_get_reply_content( $reply_id ) ); $reply_url = bbp_get_reply_url( $reply_id ); $blog_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); // Loop through users foreach ( (array) $user_ids as $user_id ) { // Don't send notifications to the person who made the post if ( !empty( $reply_author ) && (int) $user_id === (int) $reply_author ) continue; // For plugins to filter messages per reply/topic/user $message = sprintf( __( '%1$s wrote: %2$s Post Link: %3$s ----------- You are receiving this email because you subscribed to a forum topic. Login and visit the topic to unsubscribe from these emails.', 'bbpress' ), $reply_author_name, $reply_content, $reply_url ); $message = apply_filters( 'bbp_subscription_mail_message', $message, $reply_id, $topic_id, $user_id ); if ( empty( $message ) ) continue; // For plugins to filter titles per reply/topic/user $subject = apply_filters( 'bbp_subscription_mail_title', '[' . $blog_name . '] ' . $topic_title, $reply_id, $topic_id, $user_id ); if ( empty( $subject ) ) continue; // Custom headers $headers = apply_filters( 'bbp_subscription_mail_headers', array() ); // Get user data of this user $user = get_userdata( $user_id ); // Send notification email wp_mail( $user->user_email, $subject, $message, $headers ); } do_action( 'bbp_post_notify_subscribers', $reply_id, $topic_id, $user_ids ); return true; }November 14, 2014 at 3:27 am #154491Topic: No sidebar in the root of the forum!
in forum Troubleshootingchrischros34
ParticipantHi everyone, I need help, so I am appealing to the community.
I spent many hours trying to fix this display, but I can not.
Version of WordPress: 4.0
Version of bbpress: 2.5.4
Template: WP-CritiqueI can not be specific to the forum sidebar to the racine, but I have elsewhere (subjects, answers …).
Here is my forum http://www.googland.fr/forums/
I carefully followed the help provided on https://codex.bbpress.org/step-by-step-guide-to-setting-up-a-bbpress-forum/ (part 8), I have certainly misunderstood.I created my bbpress.php based on page.php, here is the code.
<?php get_header(); ?> <?php global $wp_query; $postid = $wp_query->post->ID; ?> <div id="page" class="clearfix"> <div id="contentleft"> <?php if ( get_post_meta( $postid, 'post_featcontent', true ) == "Narrow Width Featured Content Slider" ) { ?> <?php include (TEMPLATEPATH . '/featured-narrow.php'); ?> <?php } ?> <?php if ( get_post_meta( $postid, 'post_featgalleries', true ) == "Yes" ) { ?> <?php include (TEMPLATEPATH . '/featured-galleries.php'); ?> <?php } ?> <div id="content" class="maincontent"> <?php if ( function_exists('yoast_breadcrumb') ) { yoast_breadcrumb('<p id="breadcrumbs">','</p>'); } ?> <?php include (TEMPLATEPATH . '/banner468.php'); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="post clearfix" id="post-main-<?php the_ID(); ?>"> <div class="entry"> <h1 class="page-title"><?php the_title(); ?></h1> <?php if ( get_post_meta( $post->ID, 'video_embed', true ) ) { ?> <div class="single-video"> <?php echo get_post_meta( $post->ID, 'video_embed', true ); ?> </div> <?php } ?> <?php the_content(); ?> <div style="clear:both;"></div> <?php wp_link_pages(); ?> </div> </div> <?php endwhile; endif; ?> </div> <?php include (TEMPLATEPATH . '/sidebar-narrow.php'); ?> </div> <?php get_sidebar(); ?> <?php get_footer(); ?>Can anyone tell me how to edit the file and what I have to put into it.
I would be very grateful for help.
Thank youNovember 13, 2014 at 7:41 pm #154508In reply to: bbpress iphone compatibility problems
Robkk
Moderatortry this
this removes some black padding when you reach a device width of 480px
15px or a little bit less should be good.
if you want more just change 15px to whatever you want.@media only screen and (max-width: 480px) { .site { box-shadow: 0px 2px 6px rgba(100, 100, 100, 0.3); margin: 48px auto; max-width: 960px; overflow: hidden; padding: 0px 15px; } }this makes your bbpress forums full width
@media only screen and (max-width: 480px) { .site-content { background: none repeat scroll 0% 0% transparent; float: left; min-height: 150px; width: 100%; } }if you made a bbpress.php file put
.bbpressin the begginning so it would be.bbpress .site-contentmore on creating a bbpress.php file.
November 13, 2014 at 3:24 pm #154506Topic: Adding a custom page under the bbPress directory
in forum Troubleshootingrock17
ParticipantWhat’s the best way to go about adding a custom page under the bbPress directory (/forums)?
I’ve created a new page in WordPress that uses bbPress shortcodes. I’d like the URL to remain under ‘/forums’ like ‘/forums/new-page’. WordPress automatically converts the directory to /forumsnew-page (due to a conflict with bbPress using /forums)
Any help would be greatly appreciated!
November 13, 2014 at 2:41 pm #154502Topic: How to Stop Admin subscription emails…
in forum Troubleshootingmanheim
ParticipantWe’re getting an email to noreply@ourwebsite.com every single time someone posts a reply. Looking into
bbpress/includes/common/function.phpstarting on line 1023 it looks like this is the intended behavior. It sends an email to:$do_not_reply = '<noreply@' . ltrim( get_home_url(), '^(http|https)://' ) . '>';…and it BCC’s any users who are subscribed:
wp_mail( $do_not_reply, $subject, $message, $headers );This seems silly. Am I really reading this right? Why can we not disable emails coming to noreply@ ? Big forums will get hundreds of emails a day….
November 13, 2014 at 1:18 pm #154499In reply to: bbPress homepage customization
Robin W
ModeratorNovember 13, 2014 at 1:11 pm #154498In reply to: bbPress homepage customization
webUI1
ParticipantThanks Robin for your reply.
I am giving 2 short codes on main page:
[bbp-forum-index]
[bbp-topic-index]
By doing so, there are two search box display just above of Forum block, and Topic Block. Which is not correct, on same page two search boxes.
How can we fix it?Cheers 🙂
November 13, 2014 at 1:05 pm #154497In reply to: bbPress homepage customization
Robin W
ModeratorNovember 13, 2014 at 8:51 am #154489biscuitier0
ParticipantNow I just need to hide the toolbar for non-admins (code for this is above – thanks, Robin) and put and edit profile link where I need it to be in the menu to display only when users are logged in.
***Apologies for all the posts I have made but there is a bug with this forum that was stopping me posting (and worse, deleting my posts so I needed to type them again). The only way I could get it to work was to split the post into smaller parts***
November 13, 2014 at 8:47 am #154487biscuitier0
ParticipantOkay I managed to do roughly what I wanted without changing the functions.php. Here’s how:
1) I installed bbP Members Only plugin https://wordpress.org/plugins/bbpress-members-only/, I then created a test forum and topic
2) I created a page called ‘member login’ and put the [bbp-login] shortcode in this page (no menu link for this page)….
November 13, 2014 at 1:35 am #154474Topic: Show topic title top of Each topic
in forum TroubleshootingnM_WP
ParticipantHi,
WP-4.0 & BB-2.5.4 on localhost.
Everything working fine except, I am not able to show the “Topic title” at the top of each topic, as the topic title “Show topic title top of Each topic” appearing above.
I have tried
bbp_get_topic_title()with no luck.November 12, 2014 at 7:48 pm #154472In reply to: Change the color of individual role names
Robkk
Moderatoryou add this to your themes functions.php or a functionality plugin.
you then use css to style the roles from there.
add_filter('bbp_before_get_reply_author_role_parse_args', 'ntwb_bbpress_reply_css_role' ); function ntwb_bbpress_reply_css_role() { $role = strtolower( bbp_get_user_display_role( bbp_get_reply_author_id( $reply_id ) ) ); $args['class'] = 'bbp-author-role bbp-author-role-' . $role; $args['before'] = ''; $args['after'] = ''; return $args; } add_filter('bbp_before_get_topic_author_role_parse_args', 'ntwb_bbpress_topic_css_role' ); function ntwb_bbpress_topic_css_role() { $role = strtolower( bbp_get_user_display_role( bbp_get_topic_author_id( $topic_id ) ) ); $args['class'] = 'bbp-author-role bbp-author-role-' . $role; $args['before'] = ''; $args['after'] = ''; return $args; }It grabs the topic or reply author role and adds another CSS class with prefix bbp-role- so you now have a new set of CSS classes e.g. bbp-role-keymaster, bbp-role-moderator, bbp-role-participant etc that you can then add your custom CSS styles to.
link this was from
November 12, 2014 at 7:18 pm #154469In reply to: is it possible to allow all users create new forum ?
Robkk
Moderatori dont think this would be great idea to allow participants to create new forums.
i can see a reason why maybe you would want moderators though, but i mean it still isnt a great idea.
there is also a limit on the number of forums i think like 50 or so, so take that into consideration.
think you should have a site suggestion forum on upcoming improvements , and if your users want a specific forum to be added to your site you should post what they want and then you can choose from there.
you can create a page and add this shortcode to display the forum form in the front-end.
[bbp-forum-form]
you can also download @netwebs plugin from this link which will add a forum form for users who can moderate on their profile home
November 12, 2014 at 6:46 pm #154466Topic: Having "Trash" option and not "Spam" for moderators
in forum Troubleshootingkendorama
ParticipantI noticed for Keymasters you are able to “Trash” posts and of course “Spam”. For Moderators there is no “Trash” post.
I had though I could just edit this in the capabilities.php but looking at the code it seems they have the exact same permissions when it comes to Topics. Does the moderator need the “delete” for Forums to be able to Trash topics?
Thanks
-
AuthorSearch Results