Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 10,526 through 10,550 (of 32,511 total)
  • Author
    Search Results
  • #152702
    arno8
    Participant

    Thanks 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?

    #152700

    In reply to: Which need I use?

    Robkk
    Moderator

    1. to get a full-width forums, you need to create a bbpress.php more information in this link

    https://codex.bbpress.org/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/

    after you create a bbpress.php from your page.php just delete the sidebar code that should say like
    <?php get_sidebar in the template.

    2. You can follow this tutorial on this website to replace the voice count with a views count.

    Adding Topics View Counter in BBPress

    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

    https://wordpress.org/plugins/bbp-topic-count/

    #152699
    arno8
    Participant

    Still 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 šŸ™‚

    #152695
    Robkk
    Moderator

    well a topic form should already be in content-single-forum.php

    its called with

    <?php bbp_get_template_part( 'form', 'topic' ); ?>

    #152694
    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,
    		),
    #152693
    Robkk
    Moderator

    well you can check out this topic and maybe it will help

    How to change Admin Reply

    when schmoos code has .user-id-1 well thats the id of the user

    go 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; }

    Robkk
    Moderator

    i 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.

    #152683
    Robkk
    Moderator

    @pavle123

    I 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.

    #152682

    In reply to: Full Width Forum Pages

    Robin W
    Moderator

    that’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

    Functions files and child themes – explained !

    #152670

    In reply to: Full Width Forum Pages

    bertusschoeman
    Participant

    Sorry 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!

    #152666
    ernstl
    Participant

    Hi 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 display

    Rgds from Germany,
    ernstl

    #152660

    In reply to: Full Width Forum Pages

    bertusschoeman
    Participant

    Hi 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.

    #152659
    Robin W
    Moderator

    The 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

    #152656

    In reply to: Full Width Forum Pages

    Robin W
    Moderator

    Ok, 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

    #152652
    robsward
    Participant

    Hi,

    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!

    #152651
    robsward
    Participant

    Hi,

    I’m trying to retrieve a simple list of all forums on a site, for which I need to have a loop. I’m trying to create one from within a class in my plugin using this function:

    public function forum_list(){
    
    	$forums		= array();
    
    	if ( bbp_has_forums() ) {
    		while ( bbp_forums() ) {
    
    			bbp_the_forum();
    
    			$forum_id = bbp_get_forum_id();
    			$forum_name = bbp_get_forum_title();
    			$data = array( 'ID' => $forum_id, 'name' => $forum_name );
    
    			$forums[] = $data;
    
    		} // while()
    	} // if()
    
    	return $forums;
    
    } // get_forum_list()

    Which is called inside the construcor like so:

    $this->forums = $this->forum_list();

    This is telling me there is no object (Call to a member function get() on a non-object). The function works perfectly well outside the class, but inside it fails. What am I missing?

    #152629

    In reply to: BBPress Awards Plugin

    Robkk
    Moderator

    there are two reward type plugins that integrate with bbpress i know off the top of my head.

    https://wordpress.org/plugins/mycred/
    https://wordpress.org/plugins/achievements/

    and maybe more.

    But i mean if you really have something different and unique then make the plugin.

    but hey if your just looking for plugins to develop for bbpress i wouldnt be mind if you fork this.

    https://github.com/master5o1/bbPress-Post-Toolbar

    this plugin just isnt structured well, it really slows down a site too, but has alot of good elements.

    or combine some elements of this editor to give a responsive bbcode editor, i wouldnt mind at all.

    https://github.com/wbb/WysiBB

    #152627

    In reply to: Full Width Forum Pages

    bertusschoeman
    Participant

    Hi there, thank you for the swift response. I am currently using bbpress, as stated above. I read trough and implemented the information you linked me to, but still no luck. Here is the code in my theme’s page.php file. Maybe you can help me since I can not seem to figure out the code šŸ™‚

    <?php
    
    get_header();
    
    $is_page_builder_used = et_pb_is_pagebuilder_used( get_the_ID() );
    
    ?>
    
    <div id="main-content">
    
    <?php if ( ! $is_page_builder_used ) : ?>
    
    	<div class="container">
    		<div id="content-area" class="clearfix">
    			<div id="left-area">
    
    <?php endif; ?>
    
    			<?php while ( have_posts() ) : the_post(); ?>
    
    				<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    
    				<?php if ( ! $is_page_builder_used ) : ?>
    
    					<h1 class="main_title"><?php the_title(); ?></h1>
    				<?php
    					$thumb = '';
    
    					$width = (int) apply_filters( 'et_pb_index_blog_image_width', 1080 );
    
    					$height = (int) apply_filters( 'et_pb_index_blog_image_height', 675 );
    					$classtext = 'et_featured_image';
    					$titletext = get_the_title();
    					$thumbnail = get_thumbnail( $width, $height, $classtext, $titletext, $titletext, false, 'Blogimage' );
    					$thumb = $thumbnail["thumb"];
    
    					if ( 'on' === et_get_option( 'divi_page_thumbnails', 'false' ) && '' !== $thumb )
    						print_thumbnail( $thumb, $thumbnail["use_timthumb"], $titletext, $width, $height );
    				?>
    
    				<?php endif; ?>
    
    					<div class="entry-content">
    					<?php
    						the_content();
    
    						if ( ! $is_page_builder_used )
    							wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'Divi' ), 'after' => '</div>' ) );
    					?>
    					</div> <!-- .entry-content -->
    
    				<?php
    					if ( ! $is_page_builder_used && comments_open() && 'on' === et_get_option( 'divi_show_pagescomments', 'false' ) ) comments_template( '', true );
    				?>
    
    				</article> <!-- .et_pb_post -->
    
    			<?php endwhile; ?>
    
    <?php if ( ! $is_page_builder_used ) : ?>
    
    			</div> <!-- #left-area -->
    
    			<?php get_sidebar(); ?>
    			
    		</div> <!-- #content-area -->
    	</div> <!-- .container -->
    
    <?php endif; ?>
    
    </div> <!-- #main-content -->
    
    <?php get_footer(); ?>

    Thanks a mil!

    #152620
    LaunchFocus
    Participant

    Issue came up after a user joined with with a space in his username. His profile leads to 404 when you click on his username. I researched and saw special characters and spaces aren’t allowed? Why is this and is there a simple fix rather than having to validate our code?

    #152619

    In reply to: Full Width Forum Pages

    Robin W
    Moderator

    You need to get bbpress to use the full width template

    Step by step guide to setting up a bbPress forum – Part 1

    #152614
    Robkk
    Moderator

    @pavle123 thank you for the compliment

    The progress of this is theme is probably at 65% of completion.
    Im really just removing unnecessary code in templates and css that are not useful since i made some arrangements.

    and also im really just thinking what else could i add thats different from other forum software.
    if you have any ideas on what to add please feel free to share.

    and also if i should just share a child theme of a default theme like twenty twelve for free.

    or make a theme off of _s put whatever i want in it and sell it for like 5-15 dollars.

    #152598
    Robkk
    Moderator

    i checked this out and i think you need to fix the “Filed Under” that is under every forum.

    if you havent made a bbpress.php do so to fix that.

    https://codex.bbpress.org/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/

    #152596
    arno8
    Participant

    @lynq I hope you can help me.

    As you see here, in the general section it shows the topic and posts count nicely on the correct place.
    However on the sub-forums u can see the counts are just ext to the name. how can i position these so they get on the same position like the ones above?

    I tried to add a class here

    // Parse arguments against default values
    	$r = bbp_parse_args( $args, array(
    		'before'            => '<ul class="bbp-forums-list">',
    		'after'             => '</ul>',
    		'link_before'       => '<li class="bbp-forum">',
    		'link_after'        => '</li>',
    		'count_before'      => '(',
    		'count_after'       => ' )',
    		'count_sep'         => ', ',
    		'separator'         => ', ',
    		'forum_id'          => '',
    		'show_topic_count'  => true,
    		'show_reply_count'  => true,
    	), 'list_forums' );

    Like this:

    // Parse arguments against default values
    	$r = bbp_parse_args( $args, array(
    		'before'            => '<ul class="bbp-forums-list">',
    		'after'             => '</ul>',
    		'link_before'       => '<li class="bbp-forum">',
    		'link_after'        => '</li>',
    		'count_before'      => '<div class="counts">',
    		'count_after'       => '</div>',
    		//'count_sep'         => ', ',
    		//'separator'         => ', ',
    		'forum_id'          => '',
    		'show_topic_count'  => true,
    		'show_reply_count'  => true,
    	), 'list_forums' );

    to then style it in css, but when i try this it doesnt show the count anymore and i cANT EDIT IT IN CSS.

    #152584

    In reply to: Online Magazine Theme

    Robin W
    Moderator

    ok, I downloaded the theme and had a play

    you need to create this file as bbpress.php

    <?php global $theme; get_header(); ?>
    
        <div id="main">
        
            <?php $theme->hook('main_before'); ?>
    
            <div id="content2">
                
                <?php $theme->hook('content_before'); ?>
            
                <?php 
                    if (have_posts()) : while (have_posts()) : the_post();
                        /**
                         * Find the post formatting for the pages in the post-page.php file
                         */
                        get_template_part('post', 'page');
                        
                        if(comments_open( get_the_ID() ))  {
                            comments_template('', true); 
                        }
                    endwhile;
                    
                    else :
                        get_template_part('post', 'noresults');
                    endif; 
                ?>
                
                <?php $theme->hook('content_after'); ?>
            
            </div><!-- #content -->
        
            <div id="sidebar-primary">
    
       <?php
            if(!dynamic_sidebar('sidebar-bbpress')) {
                /**
                * The primary sidebar widget area. Manage the widgets from: wp-admin -> Appearance -> Widgets 
                */
                $theme->hook('sidebar-bbpress');
            }
            $theme->hook("sidebar_primary_after");
        ?>
        
    </div><!-- #sidebar-primary -->
            
            <?php $theme->hook('main_after'); ?>
            
        </div><!-- #main -->
        
    <?php get_footer(); ?>
    
    

    Then in your style.css you need to add the following to the bottom just above the

    /* =END
    
    
    #content2 {
      float: left;
      overflow: hidden;
      width: 630px;
    }
    
    

    That should do it

    #152578

    In reply to: Online Magazine Theme

    Topknotch
    Participant

    Still doesn’t work šŸ™ this is driving me mad I have been trying it all day and when you re posted I thought woooohooooo , but sadly no šŸ™
    This is my code –

    <?php
    
    /**
    
     * Template Name: Full Width, no sidebar(s)
    
    */
    
    get_header(); ?>
    
        <div id="main-fullwidth">
    
            
    
            <?php 
    
                if (have_posts()) : while (have_posts()) : the_post();
    
                    /**
    
                     * Find the post formatting for the pages in the post-page.php file
    
                     */
    
                    get_template_part('post', 'page');
    
                    
    
                    if(comments_open( get_the_ID() ))  {
    
                        comments_template('', true); 
    
                    }
    
                endwhile;
    
                
    
                else :
    
                    get_template_part('post', 'noresults');
    
                endif; 
    
            ?>
    
            
    
        </div><!-- #main-fullwidth -->
    
        
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
Viewing 25 results - 10,526 through 10,550 (of 32,511 total)
Skip to toolbar