Search Results for 'code'
-
AuthorSearch Results
-
September 24, 2014 at 8:21 pm #152734
In reply to: Topic background color depending on role
Robkk
Moderatoryou put the add filter code into your child themes functions.php or if you have a functionality plugin put it there.
and well i havent really tested that css code before so i didnt know if it really did work.
i just tried it a while ago and i cant get it to work at all.if you got it to work send a link to the post so i can check it out.
September 24, 2014 at 7:22 pm #152732In reply to: Which need I use?
Icaroferreira
ParticipantI have “WordPress”, forum “bbPress”, plugin “UserPro” … And I want to give points, rewards for users of my website, when they share articles, make comments, create forum topic, etc and has appears in his profile for everybody to see (points and medals).
So what should I use ?
Plugin mycred? Plugin WPAchievements codecanyon? or what?
Help me please.
September 24, 2014 at 6:21 pm #152731In reply to: Is there a ban users system plugin out there?
Robkk
ModeratorI want to make sure that there is not an existing alternative before start writing code (Iām not very familiar at writing code for bbpress).
ok alright , some other users want this functionality so it will be great for someone to make it š
September 24, 2014 at 9:03 am #152726In reply to: Is there a ban users system plugin out there?
JBBoY
ParticipantThank you again for your response! yes, that’s exactly what I want. But I can’t believe there is not a plugin to do this kind of moderation on bbpress.
I want to make sure that there is not an existing alternative before start writing code (I’m not very familiar at writing code for bbpress).
September 24, 2014 at 7:45 am #152722In reply to: Topic background color depending on role
arno8
ParticipantAnd where would I add the add_filter code please?
September 23, 2014 at 7:26 pm #152710In reply to: Display list of topics under specific forum
selenii
Participant<?php if ( bbp_has_topics( array( 'author' => 0, 'show_stickies' => false, 'order' => 'DESC', 'post_parent' => 'any', 'posts_per_page' => 10 ) ) ) bbp_get_template_part( 'bbpress/loop', 'topics' ); ?>I had put this code to my template. But how can I change the post_parent Parameter automatik, that the plugin know in wich forum he is and show me the right topics.
Thx
September 23, 2014 at 6:51 pm #152709In reply to: Roles under username (.bbp-author-role)
Stephen Edgar
KeymasterSee the code I just posted here, add’s the CSS classes without template modifications š
Also going to close this, rather than others bumping it in the future š
September 23, 2014 at 6:44 pm #152707In reply to: Which need I use?
Stephen Edgar
KeymasterFor #3 the user topic and reply counts underneath their role in each topic/reply will be in the next release of bbPress.
And images based on forum roles can be achieved using the same code I just posted here by inserting the image using CSS
:beforeor:afterpseudo elements .September 23, 2014 at 6:30 pm #152706In reply to: Topic background color depending on role
Stephen Edgar
KeymasterThis should do the trick without any template modifications:
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-participantetc that you can then add your custom CSS styles to.September 23, 2014 at 12:42 pm #152703In reply to: Topic background color depending on role
Robkk
Moderatorwell first i think you have to seperate the role from the author link and author avatar
then to do add this you have to either add conditionals like
if user is admin {or wrap the role in a class and add something like ($role)
will post later when i feel like going into templates and fiddling with them again.
September 23, 2014 at 12:30 pm #152702In reply to: Topic background color depending on role
arno8
ParticipantThanks this did it man , could you help me with this to:
im trying to add small images in front of the roles, every role has a different one, so im trying to add a class depending on the role, i know i gotta make edits in loop-single-reply.php
right here somewhere
<div class="bbp-reply-author"> <?php do_action( 'bbp_theme_before_reply_author_details' ); ?> <?php bbp_reply_author_link( array( 'sep' => '<br />', 'show_role' => true ) ); ?> <?php if ( bbp_is_user_keymaster() ) : ?> <?php do_action( 'bbp_theme_before_reply_author_admin_details' ); ?>You got any ideas?
September 23, 2014 at 12:10 pm #152700In reply to: Which need I use?
Robkk
Moderator1. to get a full-width forums, you need to create a bbpress.php more information in this link
after you create a bbpress.php from your page.php just delete the sidebar code that should say like
<?php get_sidebarin the template.2. You can follow this tutorial on this website to replace the voice count with a views count.
there are other ways to display views in bbpress also like by using this plugin
https://wordpress.org/plugins/bbpress-simple-view-counts/
3. Are you talking about the layout of the reply author area on ip board where it shows an image based on user role and the total post count of the user??
images based on forum role i cant find a solution just yet , might post solution later . Its most likey just going to include alot of conditionals based on forum role.
total post count for users is easy, you can easily just use robins plugin
September 23, 2014 at 12:06 pm #152699In reply to: Roles under username (.bbp-author-role)
arno8
ParticipantStill no clue where to add `$reply_id = bbp_get_reply_id( $reply_id );
$abc_role = bbp_get_user_display_role( bbp_get_reply_author_id( $reply_id ) );`I tried on the location where u said, like this:
<div id="post-<?php bbp_reply_id(); ?>" class="bbp-reply-header"> $reply_id = bbp_get_reply_id( $reply_id ); $abc_role = bbp_get_user_display_role( bbp_get_reply_author_id( $reply_id ) ); <div class="bbp-meta"> <span class="bbp-reply-post-date"><?php bbp_reply_post_date(); ?></span> <?php if ( bbp_is_single_user_replies() ) : ?> <span class="bbp-header"> <?php _e( 'in reply to: ', 'bbpress' ); ?> <a class="bbp-topic-permalink" href="<?php bbp_topic_permalink( bbp_get_reply_topic_id() ); ?>"><?php bbp_topic_title( bbp_get_reply_topic_id() ); ?></a> </span> <?php endif; ?> <a href="<?php bbp_reply_url(); ?>" class="bbp-reply-permalink">#<?php bbp_reply_id(); ?></a> <?php do_action( 'bbp_theme_before_reply_admin_links' ); ?> <?php bbp_reply_admin_links(); ?> <?php do_action( 'bbp_theme_after_reply_admin_links' ); ?> </div><!-- .bbp-meta --> </div><!-- #post-<?php bbp_reply_id();?>-->But this just shows the custom code on the website instead of running it.
please help on this š
September 23, 2014 at 10:45 am #152695In reply to: Change template for /forums/forum/…
Robkk
Moderatorwell a topic form should already be in content-single-forum.php
its called with
<?php bbp_get_template_part( 'form', 'topic' ); ?>September 23, 2014 at 10:22 am #152694In reply to: how to disable hyperlinks in bbpress forum
Robkk
Moderator-well i have not tried this but to disable any link on a post appearing you can go to settings>disscussion and then change the number of links to 1. So that you arent totally stripping links and only trying to only allow approved links like youtube.com from appearing.
Hold a comment in the queue if it contains [1] or more links. (A common characteristic of comment spam is a large number of hyperlinks.)
yes i know this is usually for comments but ive read some of these settings are either working on bbpress now or in the future.
-you can also just strip the links from either working by using this function.
plop it into your child themes funcitons.php or a functionality plugin.add_filter( 'bbp_kses_allowed_tags', 'ntwb_bbpress_custom_kses_allowed_tags' ); function ntwb_bbpress_custom_kses_allowed_tags() { return array( // Links 'a' => array( 'class' => false, 'href' => false, 'title' => false, 'rel' => false, 'class' => false, 'target' => false, ), // Quotes 'blockquote' => array( 'cite' => true, ), // Span 'span' => array( 'class' => true, ), // Code 'code' => array(), 'pre' => array( 'class' => true, ), // Formatting 'em' => array(), 'strong' => array(), 'del' => array( 'datetime' => true, ), // Lists 'ul' => array(), 'ol' => array( 'start' => true, ), 'li' => array(), // Images 'img' => array( 'class' => true, 'src' => true, 'border' => true, 'alt' => true, 'height' => true, 'width' => true, ), // Tables 'table' => array( 'align' => true, 'bgcolor' => true, 'border' => true, ), 'tbody' => array( 'align' => true, 'valign' => true, ), 'td' => array( 'align' => true, 'valign' => true, ), 'tfoot' => array( 'align' => true, 'valign' => true, ), 'th' => array( 'align' => true, 'valign' => true, ), 'thead' => array( 'align' => true, 'valign' => true, ), 'tr' => array( 'align' => true, 'valign' => true, ) ); }you might just delete all of the code specified for the a tag too and you will be fine
delete
// Links 'a' => array( 'class' => false, 'href' => false, 'title' => false, 'rel' => false, 'class' => false, 'target' => false, ),September 23, 2014 at 10:04 am #152693In reply to: Topic background color depending on role
Robkk
Moderatorwell you can check out this topic and maybe it will help
when schmoos code has
.user-id-1well thats the id of the usergo to user>all users search for all your sites keymasters.
then click edit by each users avatar
after that you are in the edit profile page for that particular user and in the url it says
user_id=(number)get all the user id numbers and then you can stack them using commas in a css code like this
.type-reply.user-id-1,.type-reply.user-id-2,.type-reply.user-id-3 { background: yellow; }September 23, 2014 at 9:46 am #152692Robkk
Moderatori liked https://wordpress.org/plugins/oa-social-login/ before i went to another solution
im not sure if it has integration with bbpress or not though.
and this requires an account to their website.https://wordpress.org/plugins/loginradius-for-wordpress has bad support and i couldnt get the plugin to work well when i tried it.
you can also find some paid social login plugins in codecanyon , im for sure there is one that offers social login and has compatibility with bbpress. I think it cost like 28 dollars or something close to that.
September 23, 2014 at 8:42 am #152683In reply to: My Forum Layout (in progress)
Robkk
ModeratorI understand that man, I would rather have this as a plugin or just a template for my forums opposed to a theme, as I do not want to change a theme.
well if i make a child theme you can just take whatever code is in the templates and the bbpress.css file i have.
I know this info about quicksprout because I am an active member of a community and it has been mentioned by the owner (i think there is even a sticky post about forum cost since many people ask this over and over).
J just saw the topic , it even says he plans to spend 20,000 when its all set and done. When I really looked at it I can see there is some modified plugins like bbpress direct quotes and new ones like how it has reputation under each user, but c’mon 20,000!!!
What I do not like about their theme is that you have to click on the subforms in order to see if there is a latest post already there.
well i like to keep some freshness stats when the forum is mobile. And how i have it right now is the latest post time goes to the latest topic in that forum.
September 23, 2014 at 8:10 am #152682In reply to: Full Width Forum Pages
Robin W
Moderatorthat’s a bit of styling needed
add
#bbpress-forums {
margin: 25px !important;
width: 960px !important;
}to your theme’s style sheet, or preferably to your child theme
September 23, 2014 at 3:42 am #152670In reply to: Full Width Forum Pages
bertusschoeman
ParticipantSorry about that š So the gaol is for the forum’s sub pages, the topic and discussions pages, IE – http://secularsociety.co.za/forum/topic/sass-logo-vote to look exactly like the forum’s main page over here http://secularsociety.co.za/forum. The main forum page (this one http://secularsociety.co.za/forum) is full width, but the forum interface is blocked within the full width page, see image – https://www.dropbox.com/s/rcmc1c0kewu4frb/Screen-Shot-Correct-Layout.jpg?dl=0. The sub pages, the focus of this discussion, are now full width (thanks to your help), but the forum interface is not blocked, see image – https://www.dropbox.com/s/a6o0b8x7sqiuvah/Screen-Shot-Incorrect-Layout.jpg?dl=0. In conclusion, the sub pages need to be full width (as we’ve achieved by duplicating the theme’s full width page.php, reanaming it and changing some of the code), with the forum interface blocked as shown in this image – https://www.dropbox.com/s/rcmc1c0kewu4frb/Screen-Shot-Correct-Layout.jpg?dl=0. Hope this makes sense š Looking forward to your response. Thanks a mil!
September 22, 2014 at 8:25 pm #152666In reply to: Can't change forum's index meta title
ernstl
ParticipantHi Folks,
i came across the same problem. To prevent bbpress adding a prefix ala “Forum: lalala” to the meta title do this:
function my_generate_titles( $new_title ){ // reset the format to title only $new_title['format'] = '%s'; return $new_title; } add_filter( 'bbp_before_title_parse_args', 'my_generate_titles' );
@saulmarq you can query your title data within the function and set the $new_title[‘text’] var with the value you want to displayRgds from Germany,
ernstlSeptember 22, 2014 at 3:34 pm #152660In reply to: Full Width Forum Pages
bertusschoeman
ParticipantHi Robin, that worked… too well š So it is completely full width now – http://secularsociety.co.za/forum/topic/ask-an-atheist, but it is not full width and blocked as the the forum’s home page – http://secularsociety.co.za/forum. In other words the the forum’s sub pages need to resemble the forum’s home page – http://secularsociety.co.za/forum. I am trying my best to also figure out the code, but no luck so far. Thank you so much for all your help, really appreciate it.
September 22, 2014 at 1:40 pm #152659In reply to: Change Forum ID for a Given Topic
Robin W
ModeratorThe forum is held as the post_parent in wp_posts
so you would update this
eg
// Update topic 37 $my_post = array( 'ID' => 37, 'post_parent' => 27 ); // Update the post into the database wp_update_post( $my_post );where 27 is the id of the parent forum
September 22, 2014 at 1:18 pm #152656In reply to: Full Width Forum Pages
Robin W
ModeratorOk, you’ll need to copy this and rename it bbpress as per the above
As this is a theme file, I’m having to guess a bit about what it is doing, so this may or may not work.
So once you have this as bbpress.php
delete
$is_page_builder_used = et_pb_is_pagebuilder_used( get_the_ID() );and replace it with
$is_page_builder_used = TRUE ;come back and let us know if that works
September 22, 2014 at 9:57 am #152652Topic: Change Forum ID for a Given Topic
in forum Troubleshootingrobsward
ParticipantHi,
How can I move a topic from one forum to another programmatically? Iām hoping to send a post variable with the new forum ID, and then update the topic like so:
// Update the Status Meta After Changes are Posted if ( isset( $_POST['bbps_forum_option'] ) ) { $new_forum = $_POST['bbps_forum_option']; bbp_update_topic( $this->topic_id, $new_forum ); } // if()Thanks!
-
AuthorSearch Results