Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 11,851 through 11,875 (of 32,504 total)
  • Author
    Search Results
  • Brent Brooks
    Participant

    Hey Guys!

    I am new to using BBpress. I have been learning a little bit each day and you guys rock!

    My theme is DIVI from elegant themes.

    Here is the start of my open forum:
    http://blankstageproductions.com/forums/forum/bsp/

    When I went to see how the forum looked on my smartphone it looked odd. All the words are bunched up on the RIGHT side of the screen making it difficult to read. Is there a plugin or some CSS coded I can drop in? I have done several searches but may not be looking in the right place for this.

    For CSS I have learned to drop in code using the ePanel in the theme. I found a thread here with code, copied it in and the code took pretty well. I still have so much to learn in terms of CSS and how to change it but figure as long as the ePanel works I should be good.

    #146518
    Stephen Edgar
    Keymaster

    dear Stephen don’t be angry …english is not my language

    Do not worry about that, I understand you fine 🙂

    Edit: Your MySQL is Excellent 😉

    Forums and Topic status = Done (F_TOPICS & F_COUNT)

    Forum Topics and Replies Counts = Done (T_REPLIES)

    Last Reply Date = Done (T_LAST_POST)

    Due to limitations with the importer configuration we can’t include the FORUM_TOTALS or FORUM_CATEGORY tables. You will need to manually reassign your your forum categories after importing, usually there is only a small number of these so this shouldn’t be much of an issue. The ‘Total’ Counts’ are also not actually needed, we do this slightly different and are recalculated by bbPress after the import has finished with the ‘Repair Tools’.

    Edit: After the import has finished we actually recount all the ‘counts’ so these are not very important to the import, they kind of just help a few things on the way.

    #146507
    gianjj
    Participant

    To know which Forum or Topic are open and permit to receive new Topic reply, we need this fields

    Forum area
    FORUM_FORUM => F_STATUS 1=open | 0=close

    Single Topic
    FORUM_TOPICS => T_STATUS 1=open | 0=close

    ===========

    To know the categories we need to query the table FORUM_CATEGORYwhere we have

    CAT_ID Unique ID used to join in FORUM_FORUM => CAT_ID table
    CAT_NAME as is …the name
    CAT_STATUS need a mention this field, Category locked = 0 | Category Open = 1

    Ex of query select for all category and related forum

    SELECT FORUM_CATEGORY.CAT_ID, FORUM_CATEGORY.CAT_NAME, FORUM_FORUM.FORUM_ID, FORUM_FORUM.F_SUBJECT
    FROM FORUM_CATEGORY LEFT OUTER JOIN
    FORUM_FORUM ON FORUM_CATEGORY.CAT_ID = FORUM_FORUM.CAT_ID
    GROUP BY FORUM_CATEGORY.CAT_ID, FORUM_CATEGORY.CAT_NAME, FORUM_FORUM.FORUM_ID, FORUM_FORUM.F_SUBJECT

    ===========

    #146506
    gianjj
    Participant

    dear Stephen don’t be angry …english is not my language 😛
    ..however…

    FORUM_FORUM => F_TOPICS
    This information is refer to all topics (Only Topic) in specific forum ex: “Forum_name => Total Number of topic”

    FORUM_FORUM => F_COUNT
    This information is refer of all replies (Only Reply) in specific forum ex: “Forum_name => Total Number of replis”

    I think a sum of this two information give us a total like here, ex: “Troubleshooting => 30,051”

    ================

    In this Table FORUM_TOTALS, Snitz save information of whole BB, a sum of all replies and all topics
    FORUM_TOTALS => T_COUNT whole topic
    FORUM_TOTALS => P_COUNT whole replies

    ================

    About FORUM_TOPICS => T_REPLIES
    is this field Snitz save number of replies relate to single topic ex this one:
    “Documented import from snitz access database” > “18 replies”

    ================

    with minor importance, also stored in this table FORUM_TOPICS we have

    T_LAST_POST_AUTHOR ID value of last member have posted reply
    ex: Last reply from: Stephen Edgar

    T_LAST_POST data value of last reply added (same format yyyymmddhhmmss)
    ex: Last activity: 5 hours, 57 minutes ago

    T_LAST_POST_REPLY_ID ID value of last reply added actually used for link in email (?)
    ex: Post Link: https://bbpress.org/forums/topic/documented-import-from-snitz-access-database/#post-146492

    #146503
    Robin W
    Moderator

    no plugin, but this page shows how to add them using code

    (I haven’t quite finished it, but it should work!)

    Custom Capabilities

    #146498
    Stephen Edgar
    Keymaster

    OK, try this instead, put this code in the bbpress.php file instead:

    
    <?php
    /**
     * bbPress wrapper template.
     */
    
    get_header(); ?>
    
    <?php while( have_posts() ): the_post(); ?>
    
    	<?php the_content(); ?>
    
    <?php endwhile; ?>
    
    <?php get_footer(); ?>
    
    #146493
    Stephen Edgar
    Keymaster

    Ah…. I know why, apologies for saying not cool 😉

    Make a copy of your page.php file and save it as bbpress.php in your themes folder (you can use page-sidebar.php if you prefer) and then bbPress will ‘wrap’ all of it’s pages in that template for you.

    #146492
    Stephen Edgar
    Keymaster

    There are actually a couple more fields that can be added that I just realized are not in the Example.php file (which I will add)

    Forum type – Is this a forum or category?

    
    		// Forum type (Category = 0 or Forum = 1, Stored in postmeta)
    		$this->field_map[] = array(
    			'from_tablename'  => 'forums_table',
    			'from_fieldname'  => 'the_forum_type',
    			'to_type'         => 'forum',
    			'to_fieldname'    => '_bbp_forum_type',
    			'callback_method' => 'callback_forum_type'
    		);
    

    Forum status, can new topics be created in the forum?

    
    		// Forum status (Unlocked = 0 or Locked = 1, Stored in postmeta)
    		$this->field_map[] = array(
    			'from_tablename'  => 'forums_table',
    			'from_fieldname'  => 'the_forum_status',
    			'to_type'         => 'forum',
    			'to_fieldname'    => '_bbp_status',
    			'callback_method' => 'callback_forum_status'
    		);
    

    Topic status – Can new replies be created for this topic?

    
    
    		// Topic status (Open or Closed)
    		$this->field_map[] = array(
    			'from_tablename'  => 'topics_table',
    			'from_fieldname'  => 'the_topic_status',
    			'to_type'         => 'topic',
    			'to_fieldname'    => 'post_status',
    			'callback_method' => 'callback_topic_status'
    		);
    
    #146491
    Stephen Edgar
    Keymaster

    Firstly I only included the fields Robin had supplied, I do not have a copy of Snitz to test either. So I commented out but didn’t remove any of the code so that it would stand out and you could update any of these as needed which you have done.

    The forum ‘counts’ I think you may have incorrect in your post above:
    * _bbp_topic_count – The number of topics that are ‘publicly’ visible
    * _bbp_reply_count – The number of replies that are ‘publicly’ visible
    * _bbp_total_topic_count – The total number of topics (includes topics that are are unapproved or hidden)
    * _bbp_total_reply_count – The total number of replies (includes replies that are are unapproved or hidden)

    A clearer explanation of each of these would be helpful and also are each of these fields in the FORUM_FORUM database table:
    * F_TOPICS
    * F_COUNT
    * T_COUNT
    * P_COUNT

    The topic ‘counts’ is the same:
    * _bbp_reply_count – The number of replies that are ‘publicly’ visible
    * _bbp_total_reply_count – The total number of replies (includes replies that are are unapproved or hidden)

    A clearer explanation of T_REPLIES would be helpful and is this fields in the FORUM_TOPICS database table?

    Whilst you answer those I’ll add Topic Author IP, Stickies and Member Status 🙂

    #146487
    gianjj
    Participant

    I forgot this, I’m migrating from Snitz Forums 2000 Version 3.4.06 🙂
    Can find this information on Table: FORUM_CONFIG_NEW

    #146486
    Stephen Edgar
    Keymaster

    Here is our ‘Official’ stance on the ‘Unread’ feature/functionality:

    https://bbpress.trac.wordpress.org/ticket/1937

    The primary issue is performance, we have not seen a plugin that will work well for larger sites, if we implement this as a feature it must work for everyone who uses bbPress.

    I just updated the list of ‘Unread’ type plugins I know of here:

    Feature Plugins Tracking

    #146485
    gianjj
    Participant

    Member status
    1 = Active
    0 = No Active

    		// User status.
    		$this->field_map[] = array(
    			'from_tablename' => 'FORUM_MEMBERS',
    			'from_fieldname' => 'M_STATUS',
    			'to_type'        => 'user',
    			'to_fieldname'   => 'user_status'
    		);
    #146484
    gianjj
    Participant

    Stiky Status
    1 = Stycky
    0 = No Sticky

    		// Sticky status (Stored in postmeta))
    		$this->field_map[] = array(
    			'from_tablename'  => 'FORUM_TOPICS',
    			'from_fieldname'  => 'T_STICKY',
    			'to_type'         => 'topic',
    			'to_fieldname'    => '_bbp_old_sticky_status',
    			'callback_method' => 'callback_sticky_status'
    		);
    #146483
    gianjj
    Participant

    really many thanks for your help….

    On first look I see comments block of topic and reply count not supported in snitz… but is a mistake….. (is it ?)

    		// Forum topic count (Stored in postmeta)
    		$this->field_map[] = array(
    			'from_tablename' => 'FORUM_FORUM',
    			'from_fieldname' => 'F_TOPICS',
    			'to_type'        => 'forum',
    			'to_fieldname'   => '_bbp_topic_count'
    		);
     
    		// Forum reply count (Stored in postmeta)
    		$this->field_map[] = array(
    			'from_tablename' => 'FORUM_FORUM',
    			'from_fieldname' => 'F_COUNT',
    			'to_type'        => 'forum',
    			'to_fieldname'   => '_bbp_reply_count'
    		);
     
    		// Forum total topic count (Stored in postmeta)
    		$this->field_map[] = array(
    			'from_tablename' => 'FORUM_TOTALS',
    			'from_fieldname' => 'T_COUNT',
    			'to_type'        => 'forum',
    			'to_fieldname'   => '_bbp_total_topic_count'
    		);
     
    		// Forum total reply count (Stored in postmeta)
    		$this->field_map[] = array(
    			'from_tablename' => 'FORUM_TOTALS',
    			'from_fieldname' => 'P_COUNT',
    			'to_type'        => 'forum',
    			'to_fieldname'   => '_bbp_total_reply_count'
    		);

    And I’m Not sure what the difference is from this two information….. but there is a total replies per topic

    		// Topic reply count (Stored in postmeta)
    		$this->field_map[] = array(
    			'from_tablename'  => 'FORUM_TOPICS',
    			'from_fieldname'  => 'T_REPLIES',
    			'to_type'         => 'topic',
    			'to_fieldname'    => '_bbp_reply_count',
    			'callback_method' => 'callback_topic_reply_count'
    		);
     
    		// Topic total reply count (Stored in postmeta)
    		$this->field_map[] = array(
    			'from_tablename'  => 'FORUM_TOPICS',
    			'from_fieldname'  => 'T_REPLIES',
    			'to_type'         => 'topic',
    			'to_fieldname'    => '_bbp_total_reply_count',
    			'callback_method' => 'callback_topic_reply_count'
    		);

    There is also this 🙂

    		// Topic author ip (Stored in postmeta)
    		$this->field_map[] = array(
    			'from_tablename'  => 'FORUM_TOPICS',
    			'from_fieldname'  => 'T_IP',
    			'to_type'         => 'topic',
    			'to_fieldname'    => '_bbp_author_ip'
    		);

    This one is for replies

    FORUM_REPLY > R_IP

    tnks
    J

    #146482
    Stephen Edgar
    Keymaster

    1) An easy WYSIWYG editor in bbpress for normal users(frontend).

    You can enable the TinyMCE Visual Editor with instructions shown here:

    Enable Visual Editor

    2) With an image “upload” feature, but is not working like an attachment like “GD bbPress Attachments”.

    I’m only aware of the “GD bbPress Attachments” plugin that offers this for bbPress, you should be asking in their support forums for any issues relating to why this plugin doesn’t work for you.

    3) All the uploaded images will be separated by folder(user name or individual name for an user).

    bbPress does NOT support attachments or media uploads ‘out of the box’
    I would also suggest you also contact the “GD bbPress Attachments” support forum to request any enhancements you would like to see in the plugin.

    #146481
    Stephen Edgar
    Keymaster

    Set WP_DEBUG to false define('WP_DEBUG', false); in your wp-config.php file, this is a known issue.

    More info on this:

    https://bbpress.trac.wordpress.org/ticket/2309 https://core.trac.wordpress.org/ticket/24169

    Stephen Edgar
    Keymaster

    If you only have a few forums you could design a page with each forum title and below each forum title use the following shortcode [bbp-single-forum id=$forum_id]

    e.g.

    
    My Forums Page
    
    My First Forum
    [bbp-single-forum id=123]
    My Second Forum
    [bbp-single-forum id=456]
    My Third Forum
    [bbp-single-forum id=789]
    
    #146477
    Stephen Edgar
    Keymaster

    bbPress doesn’t actually support the use of signatures ‘out of the box’.

    What we can do though is still import that data and store it in the wp_usermeta table, then if you do add a plugin that supports signatures in bbPress you can then copy that data (Using phpMyAdmin for example) from your imported database to however that plugin supports signatures.

    Simply add this field map:

    
    // User Signature (Stored in usermeta)
    $this->field_map[] = array(
    	'from_tablename'  => 'FORUM_MEMBERS',
    	'from_fieldname'  => 'M_SIG',
    	'to_type'         => 'user',
    	'to_fieldname'    => '_bbp_snitz_user_sig'
    );
    

    Thus once you (if you do) add a plugin to support signatures to can then query against the _bbp_snitz_user_sig field directly with MySQL and update your user profile fields.

    I just added the above to the Gist also, you can see the changes via the ‘revisions’ link.

    #146475
    gianjj
    Participant

    Ok STEPHEN, tomorrow I’ll try to config a new SNITZ.PHP with all information and run it!
    (hope will be my friend hihihihi)

    Actually the only doubt is where store the signature, Snitz stored in
    FORUM_MEMBERS > M_SIG

    And ….I think can be more helpful indicate which fieldname are required in bbp …may be ther is but I didn’t find it

    Tnks
    Bye J

    #146473
    Stephen Edgar
    Keymaster

    And just because I could and it was quick and easy, here is a copy of the Snitz.php based on the latest Example.php with Robin’s fields mappings.

    https://gist.github.com/ntwb/2f057071dd05f9758570

    You can also compare the revisions (Seeing the changes made from the source Example.php)
    https://gist.github.com/ntwb/2f057071dd05f9758570/revisions

    #146471
    Stephen Edgar
    Keymaster

    One more thing, when making a custom importer always base it of the Example.php importer, I keep that updated with examples and any other changes I make for bbPress.

    The latest (updated 3 days ago) is here:
    https://bbpress.trac.wordpress.org/browser/trunk/src/includes/admin/converters/Example.php

    As Robin points out, you just delete/remove the sections or fields that are not applicable to your import e.g. ‘tags’ or if your database doesn’t include the ‘counts’ for topics in forums then remove that part in the forum section.

    #146470
    Stephen Edgar
    Keymaster

    Cool, I just edited a couple of the posts above to wrap some code in ‘code’ tags to make things a little clearer 🙂

    #146468
    Robin W
    Moderator

    ok, the answer is somewhere in this function

    function bbp_title( $title = '', $sep = '&raquo;', $seplocation = '' ) {
    
    	// Title array
    	$new_title = array();
    
    	/** Archives **************************************************************/
    
    	// Forum Archive
    	if ( bbp_is_forum_archive() ) {
    		$new_title['text'] = bbp_get_forum_archive_title();
    
    	// Topic Archive
    	} elseif ( bbp_is_topic_archive() ) {
    		$new_title['text'] = bbp_get_topic_archive_title();
    
    	/** Edit ******************************************************************/
    
    	// Forum edit page
    	} elseif ( bbp_is_forum_edit() ) {
    		$new_title['text']   = bbp_get_forum_title();
    		$new_title['format'] = esc_attr__( 'Forum Edit: %s', 'bbpress' );
    
    	// Topic edit page
    	} elseif ( bbp_is_topic_edit() ) {
    		$new_title['text']   = bbp_get_topic_title();
    		$new_title['format'] = esc_attr__( 'Topic Edit: %s', 'bbpress' );
    
    	// Reply edit page
    	} elseif ( bbp_is_reply_edit() ) {
    		$new_title['text']   = bbp_get_reply_title();
    		$new_title['format'] = esc_attr__( 'Reply Edit: %s', 'bbpress' );
    
    	// Topic tag edit page
    	} elseif ( bbp_is_topic_tag_edit() ) {
    		$new_title['text']   = bbp_get_topic_tag_name();
    		$new_title['format'] = esc_attr__( 'Topic Tag Edit: %s', 'bbpress' );
    
    	/** Singles ***************************************************************/
    
    	// Forum page
    	} elseif ( bbp_is_single_forum() ) {
    		$new_title['text']   = bbp_get_forum_title();
    		$new_title['format'] = esc_attr__( 'Forum: %s', 'bbpress' );
    
    	// Topic page
    	} elseif ( bbp_is_single_topic() ) {
    		$new_title['text']   = bbp_get_topic_title();
    		$new_title['format'] = esc_attr__( 'Topic: %s', 'bbpress' );
    
    	// Replies
    	} elseif ( bbp_is_single_reply() ) {
    		$new_title['text']   = bbp_get_reply_title();
    
    	// Topic tag page
    	} elseif ( bbp_is_topic_tag() || get_query_var( 'bbp_topic_tag' ) ) {
    		$new_title['text']   = bbp_get_topic_tag_name();
    		$new_title['format'] = esc_attr__( 'Topic Tag: %s', 'bbpress' );
    
    	/** Users *****************************************************************/
    
    	// Profile page
    	} elseif ( bbp_is_single_user() ) {
    
    		// User is viewing their own profile
    		if ( bbp_is_user_home() ) {
    			$new_title['text'] = esc_attr_x( 'Your', 'User viewing his/her own profile', 'bbpress' );
    
    		// User is viewing someone else's profile (so use their display name)
    		} else {
    			$new_title['text'] = sprintf( esc_attr_x( "%s's", 'User viewing another users profile', 'bbpress' ), get_userdata( bbp_get_user_id() )->display_name );
    		}
    
    		// User topics created
    		if ( bbp_is_single_user_topics() ) {
    			$new_title['format'] = esc_attr__( "%s Topics",        'bbpress' );
    
    		// User rueplies created
    		} elseif ( bbp_is_single_user_replies() ) {
    			$new_title['format'] = esc_attr__( "%s Replies",       'bbpress' );
    
    		// User favorites
    		} elseif ( bbp_is_favorites() ) {
    			$new_title['format'] = esc_attr__( "%s Favorites",     'bbpress' );
    
    		// User subscriptions
    		} elseif ( bbp_is_subscriptions() ) {
    			$new_title['format'] = esc_attr__( "%s Subscriptions", 'bbpress' );
    
    		// User "home"
    		} else {
    			$new_title['format'] = esc_attr__( "%s Profile",       'bbpress' );
    		}
    
    	// Profile edit page
    	} elseif ( bbp_is_single_user_edit() ) {
    
    		// Current user
    		if ( bbp_is_user_home_edit() ) {
    			$new_title['text']   = esc_attr__( 'Edit Your Profile', 'bbpress' );
    
    		// Other user
    		} else {
    			$new_title['text']   = get_userdata( bbp_get_user_id() )->display_name;
    			$new_title['format'] = esc_attr__( "Edit %s's Profile", 'bbpress' );
    		}
    
    	/** Views *****************************************************************/
    
    	// Views
    	} elseif ( bbp_is_single_view() ) {
    		$new_title['text']   = bbp_get_view_title();
    		$new_title['format'] = esc_attr__( 'View: %s', 'bbpress' );
    
    	/** Search ****************************************************************/
    
    	// Search
    	} elseif ( bbp_is_search() ) {
    		$new_title['text'] = bbp_get_search_title();
    	}
    
    	// This filter is deprecated. Use 'bbp_before_title_parse_args' instead.
    	$new_title = apply_filters( 'bbp_raw_title_array', $new_title );
    
    	// Set title array defaults
    	$new_title = bbp_parse_args( $new_title, array(
    		'text'   => $title,
    		'format' => '%s'
    	), 'title' );
    
    	// Get the formatted raw title
    	$new_title = sprintf( $new_title['format'], $new_title['text'] );
    
    	// Filter the raw title
    	$new_title = apply_filters( 'bbp_raw_title', $new_title, $sep, $seplocation );
    
    	// Compare new title with original title
    	if ( $new_title === $title )
    		return $title;
    
    	// Temporary separator, for accurate flipping, if necessary
    	$t_sep  = '%WP_TITILE_SEP%';
    	$prefix = '';
    
    	if ( !empty( $new_title ) )
    		$prefix = " $sep ";
    
    	// sep on right, so reverse the order
    	if ( 'right' === $seplocation ) {
    		$new_title_array = array_reverse( explode( $t_sep, $new_title ) );
    		$new_title       = implode( " $sep ", $new_title_array ) . $prefix;
    
    	// sep on left, do not reverse
    	} else {
    		$new_title_array = explode( $t_sep, $new_title );
    		$new_title       = $prefix . implode( " $sep ", $new_title_array );
    	}
    
    	// Filter and return
    	return apply_filters( 'bbp_title', $new_title, $sep, $seplocation );
    }
    

    a filter such as

    function amend_title () {
    	if ( bbp_is_single_forum() ) {
    		$new_title['text']   = 'YA book forum' ;
    		$new_title['format'] = esc_attr__( 'YA book Forum', 'bbpress' );
    		}
     return $new_title;
    }
    add_filter('bbp_before_title_parse_args', 'amend_title' );
    

    should sort it but doesn’t, and I’m too tired to work out why 🙂

    Over to you !

    JBBoY
    Participant

    Hahaha It’s better easy, but the hard doesn’t scares me! Yeah it would be great to know your idea, because I’m completely lost.
    You’re right about forum categories, I didn’t realise.

    I’ve tried with a code from this site who shows the last topics of all forums in a different table, but not the last (4?,5?,6?… variable who control the number ) topics in the same table. And not each topic under his Forum. 🙂

    #146459
    Robin W
    Moderator

    I think I understand

    go into dashboard>settings>forums and change the slugs for forum root and single forum root. that will change the url

    If you want to change the breadcrumb, then see

    Layout and functionality – Examples you can use

    you can also set

    ‘home_text’ , ‘root_text’ and ‘current_text’

    using this code

    If that’s not what you are after – come back !

Viewing 25 results - 11,851 through 11,875 (of 32,504 total)
Skip to toolbar