Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 6,151 through 6,175 (of 32,505 total)
  • Author
    Search Results
  • #176314
    grant512
    Participant

    Hi I am using shortcode [bbp-forum-index] in my wp-page to display my forum.

    My objective is to show sub topics in my main forum homepage

    [IMG]http://i63.tinypic.com/2mcfwnq.jpg[/IMG]

    How can I achieve this? I tried using bb stylepack and its now showing my subtopics.

    Thanks!

    #176309

    In reply to: BBPress slowness save

    Stephen Edgar
    Keymaster

    The “Notice: bbp_setup_current_user was called incorrectly.” will be caused by either your theme or a plugin.

    Try switching theme to Twenty Fifteen to see if the error is fixed, if not deactivate all your plugins except bbPress and then reactivate each plugin one-by-one until the error appears again, then you’ll know which one is causing the problem.

    bbp_setup_current_user was called incorrectly

    #176304
    yckelvin
    Participant

    Dear Sir/Madam,

    I install the bbPress and find the search box and button are in separate line, I review the code of form-search.php

    <form role="search" method="get" id="bbp-search-form" action="<?php bbp_search_url(); ?>">
    	<div>
    		<label class="screen-reader-text hidden" for="bbp_search"><?php _e( 'Search for:', 'bbpress' ); ?></label>
    		<input type="hidden" name="action" value="bbp-search-request" />
    		<input tabindex="<?php bbp_tab_index(); ?>" type="text" value="<?php echo esc_attr( bbp_get_search_terms() ); ?>" name="bbp_search" id="bbp_search" />
    		<input tabindex="<?php bbp_tab_index(); ?>" class="button" type="submit" id="bbp_search_submit" value="<?php esc_attr_e( 'Search', 'bbpress' ); ?>" />
    	</div>
    </form>
    

    There is not line break tag <br> between the input element, does anyone know how I can remove the break?

    Best regards,

    Kelvin.

    Schoelje
    Participant

    Glad you found it useful and thanks for posting back your code.

    Dan
    Participant

    @shoelje this worked great for me. Thank you!
    I made a few small tweaks that will make the next person’s set that much easier.

    
    <?php
    include "../wp-config.php";
    
      // If all else fails, use this url.
      $defaulturl = "http://your_domain_goes_here/forums/";
    
      // Build the query according to url parameters p or t.
      $query = '';
      if (!empty($_GET['p'])) {
          $query = "SELECT {$table_prefix}posts.guid FROM {$table_prefix}postmeta
                    INNER JOIN {$table_prefix}posts ON {$table_prefix}posts.ID = {$table_prefix}postmeta.post_id
                    WHERE {$table_prefix}postmeta.meta_key = '_bbp_old_reply_id'
                    AND {$table_prefix}postmeta.meta_value = '" . $_GET['p'] . "';";
      }else if (!empty($_GET['t'])) {
          $query = "SELECT {$table_prefix}posts.guid FROM {$table_prefix}postmeta
                    INNER JOIN {$table_prefix}posts ON {$table_prefix}posts.ID = {$table_prefix}postmeta.post_id
                    WHERE {$table_prefix}postmeta.meta_key = '_bbp_old_topic_id'
                    AND {$table_prefix}postmeta.meta_value = '" . $_GET['t'] . "';";
      }
    
      // Set the new url to the default url
      $url = $defaulturl;
    
      // Check if we need to make a database connection.
      if (!empty($query)) {
        //echo "connecting...<br>";
        // Make a connection
        $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME) or die("mysqli connect error: "+mysqli_connect_error());
    
        // Check the connection.
        if (!mysqli_connect_errno()) {
          // Run the query.
          //echo $query."<br>";
          $result = mysqli_query($mysqli,$query) or die("mysqli query error: ".mysql_error($mysqli));
    
          // Get the new URL.
          if ($result) {
            $row = $result->fetch_array(MYSQLI_ASSOC);
            $guid = trim($row["guid"]);
            if (!empty($guid)) {
              $url = $guid;
            }
          }
    
          // Free the result set.
          $result->free();
    
          // Close the connection.
          mysqli_close($mysqli);
        }
      }
    
      //var_dump($url);
    
      // Write the header.
      header("Location: " . $url, true, 301);
    ?>
    
    #176294
    Barry
    Participant

    If you want to take a custom CSS based approach, you could use the body.bbpress selector.

    In your case, an extra selector is needed for the main forum page. It’s not ideal to hardcode page IDs in CSS this way and normally that wouldn’t be required – but you seem to be using a custom page instead of a regular forum archive there.

    Example:

    body.page-id-174,
    body.bbpress {
      background: white url("http://replace.me/with-image.png") repeat top left !important;
    }

    If you add the above to your child theme stylesheet it should get you in the right direction. Please also note if you are able to add it after the existing custom background CSS rule, you can drop the !important modifier.

    Of course, don’t forget to add a legit URL in there!

    Hope that helps 🙂

    #176292
    Barry
    Participant

    Would this snippet work for you? You could add to a custom plugin, or to your theme’s functions.php file if that’s how you like to do things.

    function bbpress_unhook_email_notifications() {
    	remove_action( 'bbp_new_reply', 'bbp_notify_topic_subscribers', 11 );
    	remove_action( 'bbp_new_topic', 'bbp_notify_forum_subscribers', 11 );
    }
    
    add_action( 'init', 'bbpress_unhook_email_notifications', 100 );
    #176282

    In reply to: BBPress slowness save

    TriiXx
    Participant

    Hi,

    Thanks for your answer.

    I’ve run the repair tools after importing and before my last post.

    I have a error on my log :
    “[08-Jul-2016 14:48:02 UTC] PHP Notice: bbp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 2.3.) in /wp-includes/functions.php on line 3897″

    I’ve seen it’s not important but i don’t have other error.

    #176269
    nm
    Participant

    Hi Robkk, Thanks for reverting. I cannot disable subscriptions as that would render my website useless since the core is forum discussions. My use case would be, a user subscribes to a topic, anytime they come back to the site they get a notification with the number of replies via the buddypres notification component. As it is, that seems to be working, however I need to stop emails from going out that’s all.

    Another workaround would be having a counter for all unread replies on subscribed topics via bbress code, know how I can achieve this? Either way I need to completely turn off email subscription notifications.

    #176264
    Stephen Edgar
    Keymaster

    What do you have your permalinks set to? /wp-admin/options-permalink.php?

    #176259
    Robkk
    Moderator

    You are going to have to create this by yourself.

    bbPress comprises of custom post types, so you should be able to use post_meta.

    https://developer.wordpress.org/reference/functions/get_post_meta/

    https://codex.wordpress.org/Function_Reference/add_post_meta

    https://codex.wordpress.org/Function_Reference/add_post_meta

    Here is a good example of using custom post meta with bbPress.

    https://wp-dreams.com/articles/2013/06/adding-custom-fields-bbpress-topic-form/

    There are some bbPress support forum plugins that you may need to look into that may add something similar of the features you want.

    You can create a custom topic form input for the users to explain why this is important, a topic status that indicates where the topic is at and indicate by color, resolution deadline could be time it was closed.

    There is also many hooks that might be helpful.

    http://hookr.io/plugins/bbpress/2.5.8/#index=a

    #176255
    Robkk
    Moderator

    1. An answer to this is really a personal opinion on what you prefer specifically from each.

    2. For WordPress you need a theme, Im sure its the same for others.

    3. Just so you know WordPress is the CMS and bbPress is just piggybacking and using APIs from such. WordPress is updated quite frequently. You can allow bbPress to update automatically if you want through some plugin.

    4. I don’t know why you brought up phpbb here, but bbPress can be automatically updated using a plugin. WordPress is updated automatically for security releases, and sometimes hosts cann allow you to just allow it to update automatically all the time.

    5. Blog functionality comes packaged with WordPress, you can add other features using plugins or themes.

    6. Read this for hardening WordPress.

    https://codex.wordpress.org/Hardening_WordPress

    7. For captcha plugins that work with bbPress check out this guide.

    https://codex.bbpress.org/getting-started/forum-moderation/dealing-with-spam/#registration-spam

    8. Use a plugin, or online service, or check your hosting provider.

    https://codex.bbpress.org/getting-started/before-installing/backing-up-your-database-and-files/

    9. Yes this forum has more than 100k topics. Users you will be fine.

    Also which plugins will be better for users and forums so that their updation does not affect the live site once it is launched.

    IF you are talking about plugin/theme/WordPress updates. Try to avoid automatic updates so you do not come across issues during an update and check to see if the update does not have any issues below rolling it out. Or just take frequent backups to avoid update issues and just roll back to a previous state.

    #176245
    roshansachan
    Participant

    You can test this behaviour on any topic on https://bbpress.org/forums . As per the docs for roles and capabilities a participant should be able to only assign tags and not delete them.

    #176236
    Robkk
    Moderator

    Maybe something like this, not sure of what you are after.

    Put the custom CSS in a custom CSS plugin or place it into a child themes style.css if you already created a child theme.

    #bbpress-forums li.bbp-body ul.forum {
      border-top: 1px solid #E91E63;
    }
    #176202
    theredheadhenry
    Participant

    I have a question on this method. I’m working on a site that’s currently not live yet and I used this snippit of code, and it worked great!

    However the joined date for all my subscribed users profiles are all showing the same date and year as my admins profile. I set these users up as dummy profiles on the same computer I made the admin.

    Does this have something to do with the IP address?

    Thanks!

    #176193
    Nik_S
    Participant

    Managed to solve the problem using this code:

    <?php
    
    //this function changes the bbp freshness data (time since) into a last post date for forums
    function change_freshness_forum ($forum_id = 0 ) {
    
    // Verify forum and get last active meta
    		$forum_id = bbp_get_forum_id( $forum_id );
    
    			// Get the date for the most recent reply and topic in each forum
    			$reply_id = bbp_get_forum_last_reply_id( $forum_id );
    			if ( !empty( $reply_id ) ) {
    				$last_active_reply_date = get_the_date( '', $reply_id );
    			}
    			$topic_id = bbp_get_forum_last_topic_id( $forum_id );
    			if ( !empty( $topic_id ) ) {
    				$last_active_topic_date = get_the_date('', $topic_id );
    			}
    
    			// Compare the reply and topic dates, and assign the most recent one to $last_active_date
    				if ( !empty($last_active_reply_date ) && !empty($last_active_topic_date) ) {
    					$last_active_date = ((strtotime($last_active_topic_date) >= strtotime($last_active_reply_date)) ? $last_active_topic_date : $last_active_reply_date );
    				} elseif (empty($last_active_reply_date)) {
    					$last_active_date = $last_active_topic_date ;
    				} else {
    					$last_active_date = $last_active_reply_date ;
    				}
    
    			// Get the time for the most recent reply and topic in each forum
    			if ( !empty( $reply_id ) ) {
    				$last_active_reply_time = get_the_time( '', $reply_id );
    			}
    			if ( !empty( $topic_id ) ) {
    				$last_active_topic_time = get_the_time('', $topic_id );
    			}
    
    			// Compare the reply and topic times, and assign the most recent one to $last_active_time
    				if ( !empty($last_active_reply_time ) && !empty($last_active_topic_time) ) {
    					$last_active_time = ((strtotime($last_active_topic_time) >= strtotime($last_active_reply_time)) ? $last_active_topic_time : $last_active_reply_time );
    				} elseif (empty($last_active_reply_time)) {
    					$last_active_time = $last_active_topic_time ;
    				} else {
    					$last_active_time = $last_active_reply_time ;
    				}
    			
    		$last_active_date = bbp_convert_date( $last_active_date ) ;
    		$last_active_time = bbp_convert_date( $last_active_time ) ;
    		$date_format = get_option( 'date_format' );
    		$time_format = get_option( 'time_format' );
    		$date= date_i18n( "{$date_format}", $last_active_date );
    		$time=date_i18n( "{$time_format}", $last_active_time );
    		$active_time = sprintf( _x( '%1$s at %2$s', 'date at time', 'bbp-last-post' ), $date, $time );  
    		return $active_time ;
    		}
    add_filter( 'bbp_get_forum_last_active', 'change_freshness_forum', 10, 2 );
    
    //this function changes the bbp freshness data (time since) into a last post date for topics
    function change_freshness_topic ($last_active, $topic_id) {
    
    $topic_id = bbp_get_topic_id( $topic_id );
    
    		// Try to get the most accurate freshness date possible
    		if ( empty( $last_active_date ) ) {
    		$reply_id = bbp_get_topic_last_reply_id( $topic_id );
    		if ( !empty( $reply_id ) ) {
    			$last_active_date = get_the_date( '', $reply_id );
    		} else {
    				$last_active_date = get_the_date( '', $topic_id );
    			}
    		}
    
    		// Try to get the most accurate freshness time possible
    		if ( empty( $last_active_time ) ) {
    		$reply_id = bbp_get_topic_last_reply_id( $topic_id );
    		if ( !empty( $reply_id ) ) {
    			$last_active_time = get_the_time( '', $reply_id );
    		} else {
    				$last_active_time = get_the_time( '', $topic_id );
    			}
    		}
    		
    		
    		$last_active_date = bbp_convert_date( $last_active_date ) ;
    		$last_active_time = bbp_convert_date( $last_active_time ) ;
    		$date_format = get_option( 'date_format' );
    		$time_format = get_option( 'time_format' );
    		$date= date_i18n( "{$date_format}", $last_active_date );
    		$time=date_i18n( "{$time_format}", $last_active_time );
    		$active_time = sprintf( _x( '%1$s at %2$s', 'date at time', 'bbp-last-post' ), $date, $time );
    		return $active_time ;
    		}
    add_filter( 'bbp_get_topic_last_active', 'change_freshness_topic', 10, 2 );
    
    //This function changes the heading "Freshness" to the name created in Settings>bbp last post
    function change_translate_text( $translated_text ) {
    	$text = 'Freshness' ;
    	if ( $translated_text == $text ) {
    	global $rlp_options;
    	$translated_text = $rlp_options['heading_label'];
    	}
    	return $translated_text;
    }
    add_filter( 'gettext', 'change_translate_text', 20 );

    But now another issue has become apparent – the permalinks and anchor tag titles still refer to either bbp_get_forum_last_topic_permalink or bbp_get_forum_last_reply_url (I think) and not to the most recent post or topic as I have defined it above. Any ideas on how I can change the last_topic or last_reply permalinks to match the ones corresponding to the displayed dates? This is just a touch beyond my current PHP skills and so would greatly appreciate any suggestions.

    #176189
    Nik_S
    Participant

    WordPress Version: 4.5.3
    bbPress Version: 2.5.9
    Website Link: http://www.sva.bc.ca/newforums/

    Hello,

    After setting up bbPress I “imported” forum posts manually from an older system, setting the “Published On” date to match the date of each original topic/reply. I then found that bbPress’s “freshness” ignored this date and used the date/time I had manually added these posts.

    So I installed the bbPress last post plugin ( https://en-gb.wordpress.org/plugins/bbp-last-post/ ) and modified it a little. The following code is what is currently being used, and is almost what I want:

    <?php
    
    //this function changes the bbp freshness data (time since) into a last post date for forums
    function change_freshness_forum ($forum_id = 0 ) {
    
    // Verify forum and get last active meta
    		$forum_id         = bbp_get_forum_id( $forum_id );
    
    			$reply_id = bbp_get_forum_last_reply_id( $forum_id );
    			if ( !empty( $reply_id ) ) {
    				$last_active_date = get_the_date( '', $reply_id );
    			} else {
    				$topic_id = bbp_get_forum_last_topic_id( $forum_id );
    				if ( !empty( $topic_id ) ) {
    					$last_active_date = get_the_date('', $topic_id );
    				}
    			}
    
    			if ( !empty( $reply_id ) ) {
    				$last_active_time = get_the_time( '', $reply_id );
    			} else {
    				if ( !empty( $topic_id ) ) {
    					$last_active_time = get_the_time('', $topic_id );
    				}
    			}
    			
    		$last_active_date = bbp_convert_date( $last_active_date ) ;
    		$last_active_time = bbp_convert_date( $last_active_time ) ;
    		$date_format = get_option( 'date_format' );
    		$time_format = get_option( 'time_format' );
    		$date= date_i18n( "{$date_format}", $last_active_date );
    		$time=date_i18n( "{$time_format}", $last_active_time );
    		$active_time = sprintf( _x( '%1$s at %2$s', 'date at time', 'bbp-last-post' ), $date, $time );  
    		return $active_time ;
    		}
    add_filter( 'bbp_get_forum_last_active', 'change_freshness_forum', 10, 2 );
    
    //this function changes the bbp freshness data (time since) into a last post date for topics
    function change_freshness_topic ($last_active, $topic_id) {
    
    $topic_id = bbp_get_topic_id( $topic_id );
    
    		// Try to get the most accurate freshness date possible
    		if ( empty( $last_active_date ) ) {
    		$reply_id = bbp_get_topic_last_reply_id( $topic_id );
    		if ( !empty( $reply_id ) ) {
    			$last_active_date = get_the_date( '', $reply_id );
    		} else {
    				$last_active_date = get_the_date( '', $topic_id );
    			}
    		}
    
    		// Try to get the most accurate freshness time possible
    		if ( empty( $last_active_time ) ) {
    		$reply_id = bbp_get_topic_last_reply_id( $topic_id );
    		if ( !empty( $reply_id ) ) {
    			$last_active_time = get_the_time( '', $reply_id );
    		} else {
    				$last_active_time = get_the_time( '', $topic_id );
    			}
    		}
    		
    		
    		$last_active_date = bbp_convert_date( $last_active_date ) ;
    		$last_active_time = bbp_convert_date( $last_active_time ) ;
    		$date_format = get_option( 'date_format' );
    		$time_format = get_option( 'time_format' );
    		$date= date_i18n( "{$date_format}", $last_active_date );
    		$time=date_i18n( "{$time_format}", $last_active_time );
    		$active_time = sprintf( _x( '%1$s at %2$s', 'date at time', 'bbp-last-post' ), $date, $time );  
    		return $active_time ;
    		}
    add_filter( 'bbp_get_topic_last_active', 'change_freshness_topic', 10, 2 );
    
    //This function changes the heading "Freshness" to the name created in Settings>bbp last post
    function change_translate_text( $translated_text ) {
    	$text = 'Freshness' ;
    	if ( $translated_text == $text ) {
    	global $rlp_options;
    	$translated_text = $rlp_options['heading_label'];
    	}
    	return $translated_text;
    }
    add_filter( 'gettext', 'change_translate_text', 20 );

    The only problem now is that from the forum index view, the “Last Post” column will show the date of the most recent reply, even if there is a newer topic.

    Is there a way to compare the dates and make sure the Last Post column displays the most recent topic or reply, whichever is newer?

    Thanks!

    #176188
    boomeraudio
    Participant

    Hi All,

    I just created a really nice working table that I wanted to post as a sticky topic on my bbpress forums. I’m set up as an admin and have full html capabilities.

    When I preview my html & css in Coda, it works great! Upon typing in the code as a new sticky topic, it is not inheriting any of the CSS styling.

    Is this possible? I’m positive that styling and everything is done correctly. The forum just isn’t seeing it.

    Thanks for the help.

    – Boomer

    #176184
    haddly
    Participant

    Hi,
    When searching through the forum and not being logged in, a message appears at the bottom saying you must be logged in to post a reply……
    Is there any way you can send me the code, so that there is a direct link to the forum login from this message or next to the message.

    bbPress version is up to date. and wordpress version is a unique one created by web dev company.
    Thanks in advance for your help

    #176176
    Robkk
    Moderator
    #176169

    Topic: List Followed Posts?

    in forum Plugins
    BlueIvoryCreative
    Participant

    Hi all!

    I’m using bbPress as part of a membership website. I know that a member can select to have post responses sent to their email. But is it possible to include a list of each specific member’s posts on the dashboard (account) page that I’m creating? This seems like an easy way for them to access what they’re posted, and track responses. Is there a shortcode for this, or will it require customization?

    Thanks!

    #176156
    Stephen Edgar
    Keymaster

    All those topics in those forums are “super sticky”

    Go to topics dashboard https://example.com/wp-admin/edit.php?post_type=topic

    On each of those topics in the list click “Unstick”

    Your issue should be fixed now

    See https://codex.bbpress.org/getting-started/forum-moderation/common-tasks/#sticking-a-topic for more info

    #176150
    Joel James
    Participant
    #176146
    darkoned12000
    Participant

    There are all of the tables from my WP database:

    Table Rows Type Collation Size
    wp_commentmeta 0 MyISAM utf8mb4_unicode_ci 4 KiB
    wp_comments 1 MyISAM utf8mb4_unicode_ci 7.2 KiB
    wp_links 0 MyISAM utf8mb4_unicode_ci 1 KiB
    wp_options 147 MyISAM utf8mb4_unicode_ci 408.1 KiB 372B
    wp_postmeta 281,003 MyISAM utf8mb4_unicode_ci 22.3 MiB
    wp_posts 67,398 MyISAM utf8mb4_unicode_ci 72 MiB
    wp_termmeta 0 MyISAM utf8mb4_unicode_ci 4 KiB
    wp_terms 1,448 MyISAM utf8mb4_unicode_ci 146.7 KiB
    wp_term_relationships 2,891 MyISAM utf8mb4_unicode_ci 191.3 KiB
    wp_term_taxonomy 1,448 MyISAM utf8mb4_unicode_ci 110.5 KiB
    wp_usermeta 17 MyISAM utf8mb4_unicode_ci 11.1 KiB
    wp_users 1 MyISAM utf8mb4_unicode_ci 8.1 KiB

    One thing I noticed is that it didn’t convert the users even though I checked that box, I might re-install WP/bbpress and do this process again. I did download bbpress 2.6a and installed it via browse file and activated it when it was done and went directly to forum -> tools -> import forums to start the process. But it looks like that table you were looking for DID NOT get created during this process. If there is a missed step in here to create missing tables please let me know.

    Even though I will need to reinstall running the repair tools to see if it returns or shows any errors.

    #176144
    theredheadhenry
    Participant

    I’ve seen a few people post about this issue I can’t seem to find a resolution however. I’m using 2.5.9 and when you click on a users profile it shows the date they joined as January 1, 1970. However, when I look at my profile it shows the correct date. What could I be missing?

    This is a snippet of code I have in the user-profile.php page.
    <?php
    echo '<b>Joined:</b> '.date("F, Y", strtotime(get_userdata(bbp_get_reply_author_id())->user_registered));?>

    Does that look correct?

Viewing 25 results - 6,151 through 6,175 (of 32,505 total)
Skip to toolbar