Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 12,326 through 12,350 (of 32,504 total)
  • Author
    Search Results
  • #144203
    batmanfan
    Participant

    Is it possible let users view their newly created topic prior to ‘submit’ it live? is there a plugin or a code to add to it? Thanks.

    #144201
    Robin W
    Moderator

    do you have a root page as such?

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

    Step 3 method 2

    #144193
    Robin W
    Moderator

    put this code into your style.css in your theme

    #bbpress-forums li.bbp-header {
    	background: #dc9e5a !important ;
    }

    You should select the color you want

    #144191

    In reply to: simple registration

    Robin W
    Moderator
    #144190

    In reply to: Bar users

    Stephen Edgar
    Keymaster

    Yes, bbPress uses the same system as WordPress, how to do that is explained here:

    https://codex.wordpress.org/Combating_Comment_Spam#Default_Comment_Spam_Tools

    You can and should also enable and use the Akismet plugin.

    #144180
    Robin W
    Moderator

    Without spending time going back through this thread, I presume you have tried all the bits of code above. The fact that they didn’t work for the OP whose site we couldn’t see doesn’t mean they won’t work for you.

    If you have done all that, come back with a link and I’ll take a look.

    #144179
    webbud65
    Participant

    Désolé, je n’avais pas vu la réponse.
    C’est bien ça, le problème est résolu.
    Juste une erreur dans le code fourni (_ à la place de -).
    Le code rectifié :

    function bbp_increase_forums_per_page( $args = array() ) {
    	$args['posts_per_page'] = get_option( '_bbp_forums_per_page', 150 );
        return $args;
    }
    add_filter( 'bbp_before_has_forums_parse_args', 'bbp_increase_forums_per_page' ); 

    Merci beaucoup !

    blessedtoes
    Participant

    Hi friends-

    I’ve been using iframes to embed pages on my blog from time to time and not only do I not love the look, but I’ve recently noticed some conversations about some sites having objections to this application.

    Does anyone know if there’s code I can use on my WP blog that looks like the FB page links, where it shows a relevant image from the page and the article headline?

    Just to be clear, this is for use on my WP bbPress blog, using an OptimizePress theme – not for a Facebook page… I asked on another forum and had no luck.

    Thanks in advance – grateful for your wisdom and experience!

    Matthew

    #144169
    Stephen Edgar
    Keymaster

    Ok, most likely duplicating page.php would be the way to go, you may have to add what is also inside loop-page.php though looking at your other pages on your site these also don’t have a sidebar so again it’s hard to say exactly what is needed as I don’t have access to this theme as it is a commercial theme.

    Did you post (and or look) on http://organicthemes.com/support/ to see if they have instructions on using bbPress with that theme?

    Stephen Edgar
    Keymaster

    I tried your code you provided, unfortunately the conversion results were the same as I described originally. Same results running the tools after the import/conversion as well.

    There is a chance I got the code wrong, I based it on the snippets you posted above.

    I think it will be a matter of just working out the correct fields to grab the correct data from in and around the topics table with topic_id, parent_id and forum_id and similarly for the replies table so that the correct value is being added to post_parent.

    If you want to dump all the code so I can take a closer look dump it into a gist here on GitHub.

    https://gist.github.com/

    I am going to run some test queries on the databases just to try to figure out where things are breaking down, probably tomorrow. 🙂 Do you know of a way to echo the SELECT queries to the old Database tables forums, replies, and topics during import?

    Us e Google Chrome/Firefox’s Inspector, simply right click in the yellow window and select ‘Inspect Element’, we have all the MySQL queries that are used during import echo’d out in the page source, just not rendered on the page.

    adressler
    Participant

    Thank you @netweb. I tried your code you provided, unfortunately the conversion results were the same as I described originally. Same results running the tools after the import/conversion as well.

    I am going to run some test queries on the databases just to try to figure out where things are breaking down, probably tomorrow. 🙂 Do you know of a way to echo the SELECT queries to the old Database tables forums, replies, and topics during import?

    Thanks again.

    #144158
    virusek89
    Participant

    Hello,

    How to change the color of stranded author (the freshness)

    or give advice in the code below to insert a color somewhere?

    <span class="bbp-topic-freshness-author"><?php bbp_author_link( array( 'post_id' => bbp_get_forum_last_active_id(), 'size' => 14 ) ); ?></span>

    Please help.

    Sorry for my bad english

    #144157
    virusek89
    Participant

    Hello,

    How to change the color of stranded author (the freshness)

    or give advice in the code below to insert a color somewhere?

    `<span class=”bbp-topic-freshness-author”><?php bbp_author_link( array( ‘post_id’ => bbp_get_forum_last_active_id(), ‘size’ => 14 ) ); ?></span>

    Please help.

    Sorry for my bad english

    Stephen Edgar
    Keymaster

    -”Recalculate the parent topic for each post” did nothing

    The 3rd bit of code ‘Reply parent topic id (If no parent, then 0)’ will fix that.

    -”Recalculate the parent forum for each post” set all of the Topics in Admin panel to “(No Forum)”, where before that was the only text that was actually displaying properly.

    The last piece of code I posted above ‘Topic parent forum id’ will fix that.

    It just seems strange that before I tried the tools it was properly mapping topics.forum_id to forums.forum_id to retrieve the forum title that was displayed in the Admin Topics page, and only on the Admin Topics page.

    bbPress stores all sorts of extra ‘meta data’ in WordPress’ wp_postmeta table relating to each of bbPress’ custom post types. Essentially without the additions of the above bbPress only knows a partial set of the data it needs and as such when the repair tools are run it tries to repair all this data but if some key aspects of the data is missing, in this case post_parent it will end up with the results you are now seeing in the dashboard where each topic is not associated with a forum and each reply is not associated with a topic.

    Clear as mud, hey? 😉 I’ve been here many times and am right now writing a BuddyPress importer update and am currently here again 😉

    When I view the public Topic page, the forum is excluded in the breadcrumb.

    Stephen Edgar
    Keymaster

    @adressler Nice work and you are sooooo close 🙂

    As Robin has said run the repair tools and that should fix pretty much everything from what I can see.

    If it doesn’t I’d take a close look at the before and after import relationships between the replies parent topic ID topics.topic_id and replies.topic_id

    Looking at the replies section of your converter scrip, you have this:

    
      // Reply parent topic id (If no parent, then 0. Stored in postmeta)
      $this->field_map[] = array(
      'from_tablename'  => 'replies',
      'from_fieldname'  => 'topic_id',
      'to_type'         => 'reply',
      'to_fieldname'    => '_bbp_topic_id'
    

    I’d suggest adding the following to help the initial import know which forum each reply should be associated with:

    
    // Reply parent forum id (If no parent, then 0. Stored in postmeta)
      $this->field_map[] = array(
      'from_tablename'  => 'replies',
      'from_fieldname'  => 'forum_id',
      'to_type'         => 'reply',
      'to_fieldname'    => '_bbp_forum_id',
      'callback_method' => 'callback_topicid_to_forumid'
    );
    

    Adding this is what you need to fix things as currently you are assigning a topic ID to each reply but this is needed in two places, the _bbp_topic_id and post_parent which the later you are missing. In this case the replies ‘post parent’ is also the topic ID.

    
      // Reply parent topic id (If no parent, then 0)
      $this->field_map[] = array(
      'from_tablename'  => 'replies',
      'from_fieldname'  => 'topic_id',
      'to_type'         => 'reply',
      'to_fieldname'    => 'post_parent',
      'callback_method' => 'callback_topicid'
    );
    

    Also for good measure you should probably do the same for your topic section and add the forum ID as post_parent for each topic:

    
      // Topic parent forum id (If no parent, then 0)
      $this->field_map[] = array(
      'from_tablename'  => 'topics',
      'from_fieldname'  => 'forum_id',
      'to_type'         => 'topic',
      'to_fieldname'    => 'post_parent',
      'callback_method' => 'callback_forumid'
    );
    
    #144149
    Stephen Edgar
    Keymaster

    Here you go bbp_template_before_single_forum

    SubstreamAI
    Participant

    I want to keep site members who are spectators from seeing private forums (normally visible to anyone logged in. Participants should be able to see and post to private forums.

    I suspect this will require a very small amount of code, so I don’t want to use an overkill plugin. I’ve been searching for 2 days to find a plugin that can do this and I’ve failed miserably.

    Would some kind guru help me to code this?

    #144136
    Robin W
    Moderator

    If it’s just where it says forums, then the same code should work, it just needs a different function name – each function needs to be unique so

    function change_translate_text2( $translated_text ) {
    	if ( $translated_text == 'Forums' ) {
    	$translated_text = 'whatever-new-word-you-want';
    	}
    	return $translated_text;
    }
    add_filter( 'gettext', 'change_translate_text2', 20 );

    If you want to change it in url’s and breadcrumbs, then

    dashboard>settings>forums and change the forum root slug

    rafferjr
    Participant

    Ok so i guess im confused. i too want the forums to look more like the way it was mentioned above. where the category has the forums under it like this site. http://teamoverpowered.com/forums/

    I see that bbpress creates or uses the pages forums to put its code there. im not a code master. can someone point me in the right direction? im not looking for the nice pictures, just a category as a header and the forums of that category below.

    #144132
    Majijiboo
    Participant

    Do you have similar code to change the word “Forum” to something else? Thanks.

    adressler
    Participant

    Hi everyone, this is my first time posting, and I really dig BBPress so far.

    I’m running WP v3.8.1 with BBPress 2.5.3. I’ve encountered a problem when converting a custom MYSQL database into BBPress. I have successfully exported a Lotus Notes / Domino DB (yes, it still exists…) into a simple MySQL DB containing just 3 tables.

    After a “successful” conversion (of over 35K forums, topics and replies) into BBPress, I can see all of the Forums, Topics, and Replies listed in the BBPress Admin panel. However, there seems to be issues with the Foreign Keys being imported/linked, even though I have double and triple checked the forum_id, topic_id values for the Topics->Forums and Replies->Topics relationships within the Example.php converter included with BBPress. All data has been properly formatted into WordPress friendly values (dates, slugs, etc..) before importing into MySQL.

    In the admin panel, under Forums, it lists all forums in their hierarchical order, as expected. It also lists the topic and reply counts, date, and creator next to each parent / child forum. However, under “Freshness” is says “No Topics”. The Topics Admin page is even more intriguing; it lists all of the Topic Titles, the Forum title which that topic is assigned to (!), reply count, author, creation date, and freshness. Browsing to the Replies Admin page lists all reply titles, author, and creation date, however under Forum it says “No Forum” and under Topic it says “No Topic”.

    When you browse to the forums (mysite.local/forums/forum/the-forum), the forum title and child-forums are displayed, along with topic and reply counts for each child. However, under “Freshness”, it says “No Topics”. When I browse to a child forum, it lists the topic and reply counts, however it says “No Topics were found”.

    When I browse to a topic (mysite.local/forums/topic/the-topic), I see the date, title, content, and reply count. However, there are no replies listed.

    When I browse to a reply (by clicking “View” under the reply listed in the Admin Replies page), it directs me to http://mysite.dev/wp-admin/edit.php?post_type=reply/#post-######, saying “Invalid Post Type”.

    I figured this would be rather straightforward, since I am not importing Users or Tags. Eventually I would like all authors to be “Archived Author”, should I try to tackle this now or after a fully successful import?

    I can supply screen shots, converter output (which really says nothing unexpected), or the full source code for the converter if needed. I’ve included my table structure and simplified converter code for reference.

    I hope that someone with a bit more experience converting forums for BBPress will be able to shed some light on this, my forehead is really starting to hurt from banging my head against the wall. It seems there is very limited information out there on this converter. Any and all help is greatly appreciated!

    My tables to import/convert are laid out as follows:

    forums table {
      forum_id  PRIMARY KEY INT(11)
      title
      slug
      parent_id (Self referencing FK)
      last_mod (DATETIME)
      num_topics
      num_replies
    }
    topics table {
      topic_id PRIMARY KEY INT(11)
      parent_id FK (set to 0 for no parent)
      forum_id FK (matches corresponding <code>forums</code>.forum_id)
      subject (title)
      slug (slug of title)
      body (the post content)
      from
      date
      date_gmt
      num_replies
    }
    replies table {
      reply_id PRIMARY KEY INT(11)
      topic_id FK INT(11) (matches corresponding <code>topics</code>.topic_id)
      forum_id FK INT (11) (matches corresponding <code>forums</code>.forum_id)
      date
      date_gmt
      subject
      body
    }

    And now, here’s the converter I’m using (starting at the Forum section Line#26 of /plugins/bbpress/includes/admin/converters/Example.php). I’ve removed commented lines for brevity.

    
    /** Forum Section *****************************************************/
    
    		// Setup table joins for the forum section at the base of this section
    
    		 // Forum id (Stored in postmeta)
    		$this->field_map[] = array(
    			 'from_tablename'  => 'forums',
    			 'from_fieldname'  => 'forum_id',
    			 'to_type'         => 'forum',
    			 'to_fieldname'    => '_bbp_forum_id'
    		);
    
    		// Forum parent id (If no parent, then 0. Stored in postmeta)
     		$this->field_map[] = array(
    			'from_tablename'  => 'forums',
    			'from_fieldname'  => 'parent_id',
    			'to_type'         => 'forum',
    			'to_fieldname'    => '_bbp_forum_parent_id'
    		 );
    
     		// Forum topic count (Stored in postmeta)
     		$this->field_map[] = array(
    			 'from_tablename' => 'forums',
    			'from_fieldname' => 'num_topics',
    			'to_type'        => 'forum',
    			'to_fieldname'   => '_bbp_topic_count'
    		 );
    
    		 // Forum reply count (Stored in postmeta)
    		$this->field_map[] = array(
    			'from_tablename' => 'forums',
     			'from_fieldname' => 'num_replies',
     			'to_type'        => 'forum',
    			'to_fieldname'   => '_bbp_reply_count'
    		 );
    
     		// Forum total topic count (Stored in postmeta)
    		$this->field_map[] = array(
    			' from_tablename' => 'forums',
    			'from_fieldname' => 'num_topics',
    			'to_type'        => 'forum',
    			'to_fieldname'   => '_bbp_total_topic_count'
    		 );
    
    		 // Forum total reply count (Stored in postmeta)
    		$this->field_map[] = array(
    			 'from_tablename' => 'forums',
    			 'from_fieldname' => 'num_replies',
    			 'to_type'        => 'forum',
    			 'to_fieldname'   => '_bbp_total_reply_count'
    		 );
    
    		 // Forum title.
    		$this->field_map[] = array(
    			'from_tablename'  => 'forums',
    			'from_fieldname'  => 'title',
    			'to_type'         => 'forum',
    			'to_fieldname'    => 'post_title'
    		 );
    
    		 // Forum slug (Clean name to avoid confilcts)
    		$this->field_map[] = array(
    			'from_tablename'  => 'forums',
    			'from_fieldname'  => 'slug',
    			'to_type'         => 'forum',
     			'to_fieldname'    => 'post_name'
     		);
    		
    		 // Forum dates.
    		 $this->field_map[] = array(
    			 'to_type'         => 'forum',
    			'to_fieldname'    => 'post_date',
    			 'default' => date('Y-m-d H:i:s')
     		);
    		 $this->field_map[] = array(
    			 'to_type'         => 'forum',
    			 'to_fieldname'    => 'post_date_gmt',
    			 'default' => date('Y-m-d H:i:s')
    		 );
    		 $this->field_map[] = array(
    			 'to_type'         => 'forum',
    			 'to_fieldname'    => 'post_modified',
    			 'default' => date('Y-m-d H:i:s')
     		);
    		 $this->field_map[] = array(
    			'to_type'         => 'forum',
    			'to_fieldname'    => 'post_modified_gmt',
    			'default' => date('Y-m-d H:i:s')
    		);
    
    		
    /** Topic Section *****************************************************/
    
    		// Setup table joins for the topic section at the base of this section
    
    		// Topic id (Stored in postmeta)
    		$this->field_map[] = array(
    			'from_tablename'  => 'topics',
    			'from_fieldname'  => 'topic_id',
    			'to_type'         => 'topic',
    			'to_fieldname'    => '_bbp_topic_id'
    		);
    
    		// Topic reply count (Stored in postmeta)
    		$this->field_map[] = array(
    			'from_tablename'  => 'topics',
    			'from_fieldname'  => 'num_replies',
    			'to_type'         => 'topic',
    			'to_fieldname'    => '_bbp_reply_count'
    		);
    
    		// Topic total reply count (Stored in postmeta)
    		$this->field_map[] = array(
    			'from_tablename'  => 'topics',
    			'from_fieldname'  => 'num_replies',
    			'to_type'         => 'topic',
    			'to_fieldname'    => '_bbp_total_reply_count'
    		);
    
    		// Topic parent forum id (If no parent, then 0. Stored in postmeta)
    		$this->field_map[] = array(
    			'from_tablename'  => 'topics',
    			'from_fieldname'  => 'forum_id',
    			 'to_type'         => 'topic',
    			 'to_fieldname'    => '_bbp_forum_id'
    		);
    
     		// Topic content.
    		$this->field_map[] = array(
    			'from_tablename'  => 'topics',
    			'from_fieldname'  => 'body',
    			'to_type'         => 'topic',
    			'to_fieldname'    => 'post_content'
    		);
    
    		// Topic title.
    		$this->field_map[] = array(
    			'from_tablename'  => 'topics',
     			'from_fieldname'  => 'subject',
     			'to_type'         => 'topic',
    			'to_fieldname'    => 'post_title'
    		);
    
    		// Topic slug (Clean name to avoid conflicts)
    		$this->field_map[] = array(
    			'from_tablename'  => 'topics',
    			'from_fieldname'  => 'slug',
    			'to_type'         => 'topic',
    			'to_fieldname'    => 'post_name'
    		);
    		// Topic dates.
    		$this->field_map[] = array(
    			'from_tablename'  => 'topics',
    			'from_fieldname'  => 'date',
    			'to_type'         => 'topic',
    			'to_fieldname'    => 'post_date'
    		);
    
    		$this->field_map[] = array(
    			'from_tablename'  => 'topics',
    			'from_fieldname'  => 'date_gmt',
    			'to_type'         => 'topic',
    			'to_fieldname'    => 'post_date_gmt'
    		);
    		$this->field_map[] = array(
    			'from_tablename'  => 'topics',
    			'from_fieldname'  => 'date',
    			'to_type'         => 'topic',
    			'to_fieldname'    => 'post_modified'
    		);
    		$this->field_map[] = array(
    			'from_tablename'  => 'topics',
    			'from_fieldname'  => 'date_gmt',
    			'to_type'         => 'topic',
    			'to_fieldname'    => 'post_modified_gmt'
    		);
    		$this->field_map[] = array(
    			'from_tablename'  => 'topics',
    			'from_fieldname'  => 'date',
    			'to_type'         => 'topic',
    			'to_fieldname'    => '_bbp_last_active_time'
    		);

    And skipping to the Replies section (Tags and Users are not converted)

    	/** Reply Section *****************************************************/
    
    		// Setup table joins for the reply section at the base of this section
    
    		// Reply id (Stored in postmeta)
    		$this->field_map[] = array(
    			'from_tablename'  => 'replies',
    			'from_fieldname'  => 'reply_id',
    			'to_type'         => 'reply',
    			'to_fieldname'    => '_bbp_post_id'
    		);
    		// Reply parent topic id (If no parent, then 0. Stored in postmeta)
    		$this->field_map[] = array(
    			'from_tablename'  => 'replies',
    			'from_fieldname'  => 'topic_id',
    			'to_type'         => 'reply',
    			'to_fieldname'    => '_bbp_topic_id'
    		);
    		// Reply title.
    		$this->field_map[] = array(
    			'from_tablename'  => 'replies',
    			'from_fieldname'  => 'subject',
    			'to_type'         => 'reply',
    			'to_fieldname'    => 'post_title'
    		);
    		// Reply content.
    		$this->field_map[] = array(
    			'from_tablename'  => 'replies',
    			'from_fieldname'  => 'body',
    			'to_type'         => 'reply',
    			'to_fieldname'    => 'post_content'
    		);
    		// Reply dates.
    		$this->field_map[] = array(
    			'from_tablename'  => 'replies',
    			'from_fieldname'  => 'date',
    			'to_type'         => 'reply',
    			'to_fieldname'    => 'post_date'
    		);
    		$this->field_map[] = array(
    			'from_tablename'  => 'replies',
    			'from_fieldname'  => 'date',
    			'to_type'         => 'reply',
    			'to_fieldname'    => 'post_date_gmt'
    		);
    		$this->field_map[] = array(
    			'from_tablename'  => 'replies',
    			'from_fieldname'  => 'date',
    			'to_type'         => 'reply',
    			'to_fieldname'    => 'post_modified'
    		);
    		$this->field_map[] = array(
    			'from_tablename'  => 'replies',
    			'from_fieldname'  => 'date',
    			'to_type'         => 'reply',
    			'to_fieldname'    => 'post_modified_gmt'
    		);
    #144124
    Robin W
    Moderator

    sorry I wasn’t being clear.

    but you answer does throw up a fix, you can take out the display of that out either by changing the “show forum prefix” in settings>forums, or changing what is displayed :

    Layout and functionality – Examples you can use

    On you original Q :

    1. Do you still have this problem if you try that change
    2. are you getting the ‘cheating’ problem anywhere else

    #144105
    sowmya
    Participant

    Hi,

    Refer to https://codex.bbpress.org/type/actions/. You can use the hooks and plave your social media sharing buttons wherever you want by including the code in your themes functions.php.

    Thanks!

    #144102
    Robin W
    Moderator

    no official one, but plenty if you google

    Also check out the documentation

    Codex

    including the layout and functionality examples

    Robin W
    Moderator

    Sorry, but there is no short code to display topics by user

Viewing 25 results - 12,326 through 12,350 (of 32,504 total)
Skip to toolbar