Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 4,001 through 4,025 (of 32,504 total)
  • Author
    Search Results
  • Hi there!

    If you’re looking for an off-the-shelf solution, BuddyPress and the Private Messages component sounds like the best one. You’d still need to tune it a bit with some custom code to lock it down exactly how you’ve described, but it gives you isolated message threads with invitees, notifications, an inbox, etc…

    Technically, in the next major version of bbPress (2.6) you could use the new engagements API to keep those conversations a forum topic, but limit them to specific invited users, but that’s probably more work and less obvious to end users what it’s for & doing.

    #196634
    writersabroad
    Participant

    I created a list of 5 forums some with sub forums and used the short code to display the index of forums on a page which I added to my navigation menu. Today it is only showing the first forum and none of the others. I’ve tried refreshing the page, renewing the page with the shortcode and gone back over some of the steps (I’ve been trying to remove a sidebar from the forum page) but nothing seems to work. All the forums are listed and I haven’t changed any of the settings within the forums…

    I’m using the Ruby theme – but have tried it with twenty fifteen, sixteen and seventeen and the problem persists. I’m using bbpress Version 2.5.14 and the bbpress style plug in Version 4.0.3 which was updated today.

    My site is not published as I’m still working on it, ironing out some of these issues.

    Thanks for any advice

    #196624
    dmalkin
    Participant
    // Time Variable
    $localTime = str_replace('at ', '', $localTime);
    
    $localTime = do_shortcode('[localize_time before_local=" " after_local=" " fmt="F j, Y g:i a"]'.$localTime.'[/localize_time]');
    echo $localTime;
    
    #196623
    dmalkin
    Participant

    Having a really difficult time figuring out a way to output topic reply time stamps in a users local timezone. I have a forum with global users and this is a necessity.

    WP version: 4.9.8
    bbPress version: 2.5.14

    Currently using this plugin: Localize Time (https://wordpress.org/plugins/localize-time/)

    I am wrapping the bbp_get_reply_post_date() with the shortcode [localize_time]; however, I cannot alter the format of the output date from the shortcode.

    I need an alternate solution.

    #196611
    Wasca
    Participant

    I should also not that this is only happening in Chrome not Firefox. I’m seeing this in the console. (sanitized)

    Uncaught DOMException: Failed to read the 'cssRules' property from 'CSSStyleSheet': Cannot access rules
        at et_core_page_resource_fallback (https://mydomain.com/topic/test-video/embed/:12:160)
        at HTMLLinkElement.onload (https://mydomain.com/topic/test-video/embed/#?secret=HEI33yuPgo:158:289)
    et_core_page_resource_fallback @ (index):12
    onload @ VM2025 :158
    wreckcox
    Participant

    What is the best way to add login and a register link to “You must be logged in to reply to this topic”

    I found this but I realized I cannot edit a code as I am very new to PHP.
    Please suggest.

    	<div id="no-topic-<?php bbp_topic_id(); ?>" class="bbp-no-topic">
    		<div class="bbp-template-notice">
    			<p><?php is_user_logged_in() ? _e( 'You cannot create new topics.', 'bbpress' ) : _e( 'You must be logged in to create new topics.', 'bbpress' ); ?></p>
    		</div>
    	</div>
    #196598
    Robin W
    Moderator

    ok, take the change above out.

    Then find
    wp-content/plugins/bbpress/templates/default/bbpress/loop-single-reply.php
    Make a copy of this file to your pc

    The edit this file to be this

    <?php
    
    /**
     * Replies Loop - Single Reply
     *
     * @package bbPress
     * @subpackage Theme
     */
    
    ?>
    <div class='rew-border'>
    <div id="post-<?php bbp_reply_id(); ?>" class="bbp-reply-header">
    
    	<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(); ?> -->
    
    <div <?php bbp_reply_class(); ?>>
    
    	<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' ); ?>
    
    			<div class="bbp-reply-ip"><?php bbp_author_ip( bbp_get_reply_id() ); ?></div>
    
    			<?php do_action( 'bbp_theme_after_reply_author_admin_details' ); ?>
    
    		<?php endif; ?>
    
    		<?php do_action( 'bbp_theme_after_reply_author_details' ); ?>
    
    	</div><!-- .bbp-reply-author -->
    
    	<div class="bbp-reply-content">
    
    		<?php do_action( 'bbp_theme_before_reply_content' ); ?>
    
    		<?php bbp_reply_content(); ?>
    
    		<?php do_action( 'bbp_theme_after_reply_content' ); ?>
    
    	</div><!-- .bbp-reply-content -->
    
    </div><!-- .reply -->
    </div>
    
    <div class='rew-spacer'><p/> </div>

    Then put this in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/loop-single-reply.php

    Finally in your theme’s custom css area put

    
    #bbpress-forums ul.bbp-replies {
    border : none ;
    }		
    
    .rew-border {
    border: 1px solid #eee;
    }		
    #196596
    wreckcox
    Participant

    Thank you so much. This code added the space between replies.
    Can this also be done with css? If yes, how?

    #196595
    wreckcox
    Participant

    Thank you so much. This code added the space between replies but pushed the border below.

    #196588
    Robin W
    Moderator

    ok,

    create a directory on your theme called ‘bbpress’
    ie wp-content/themes/%your-theme-name%/bbpress

    where %your-theme-name% is the name of your theme

    find
    wp-content/plugins/bbpress/templates/default/bbpress/loop-replies.php
    Make a copy of this file to your pc

    The edit this file to add this line after line 50

    <div class='rew-spacer'> <p/> </div>

    so you end up with

    <?php bbp_get_template_part( 'loop', 'single-reply' ); ?>
    
    <div class='rew-spacer'> <p/> </div>

    Then put this in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/loop-replies.php

    You may need to do some styling to get it how you want it, but I would need to see your site to help on that

    #196562
    stracy2
    Participant

    As Robin pointed out (thank you), “My SQL Workbench” is likely the tool or at least a starting tool. I’ve tried its “Migration Wizard” going from a MS SQL database, but unfortunately the wizard errors out on MS ntext fields that contain 4 byte unicode characters (the error is “Inserting Data: Incorrect string value:” on the MySql side) despite both src and dst database fields having utf8mb4 as the character set, and even ensuring all of MySQL database connections are utf8mb as per here.

    Since it is not too practical to try and filter out the offending 4 byte unicode chars, so as an alternative now I’m trying saving the src data to CSV and importing CSV on the MySQL side – but apparently the CVS libraries disagree on encoding/decoding – the dst table ends up with more records than the source, not sure who is a fault.

    #196506
    vladlu
    Participant

    bbp_[get]_reply_post_date( bbp_get_topic_id() );

    Really the bbp_reply_post_date() function doesn’t analyze post_type so you can give it anything you want, not only with type “reply”.

    P.S. Topics (and everything) is bbPress is a post (class WP_Post), and every post has post_date (https://codex.wordpress.org/images/2/25/WP4.4.2-ERD.png).

    I think this way is the most elegant and straightforward.

    #196493
    stracy2
    Participant

    Can a custom (forum) import, import from “any SQL” database or does it have to be an “MySQL” database?

    The high level custom import documentation here states “to setup an import from any SQL database”.

    And the deeper link here state “to setup an import from any MySQL database.”

    #196490
    Robin W
    Moderator

    you can put the code in your child theme functions file or put it in a plugin like this which is probably easier

    Code Snippets

    #196486
    frog65
    Participant

    Hy RobinW
    nice plugin 🙂
    additional, iam interessted in where i build in your code?
    Armin

    #196471
    Robin W
    Moderator
    function custom_bbp_sub_forum_list() {
      $args['separator'] = ';' ;
      return $args;
    }
     add_filter('bbp_after_list_forums_parse_args', 'custom_bbp_sub_forum_list' );

    or use

    bbp style pack

    to get the lists vertical

    #196438
    van24
    Participant

    We’ve been told that our forum may be causing an issue with Google’s thin content algorithm, so I’m looking to find a way to noised some of the pages with little content.

    I’ve already managed to noindex all the views, replies, users, and topics with replies (see the code below, if anyone’s interested).

    I would also like to noindex any forum topic that has total content of less than X words/characters. Is there any way to do that in functions.php? Thanks in advance!

    Here’s what I have so far:

    add_action( 'wp_head', 'topic_add_noindex' );
    function topic_add_noindex()
    {
      if (bbp_is_single_user())
      {
        wp_no_robots();
      }	
      if ( bbp_is_single_topic() && bbp_get_topic_reply_count()==0)
      {
        wp_no_robots();
      }
      if (bbp_is_single_view())
      {
        wp_no_robots();
      }	
      if (bbp_is_single_reply())
      {
        wp_no_robots();
      }	
    }
    #196421
    Robin W
    Moderator

    Import Forums

    although the best that offers is from version 1.1

    #196408

    In reply to: Custom Fields

    Clivesmith
    Participant

    Hi,
    I think that “custom post meta boxes” is more complicated than I need, it creates a new menu on the dashboard and I have to include what I want there, as I will use unique labels on each new topic I think it goes too far. I can see the fields I want with the code above on the front end ‘new topic’, I just want the code to show up in the backend “create new topic” if there is no way to include them in the backend ‘New Topic’ I will accept that.

    I then need to include these fields at the end of the content before posting both in the topic and the replies — content = content + bbp_extra_field1 + bbp_extra_field2 do you know where I can get at the content before it is written to the table.

    Thanks

    daniellekong
    Participant

    I found these instructions from Buddypress and followed the steps in “C. Set Up Group Forums Only” but it still doesn’t work. I still get taken to a non-group page when I click on sub-forums.

    Installing Group and Sitewide Forums

    daniellekong
    Participant

    I have a forum under a buddypress group with the permalink structure /groups/group-name/forum/
    I’ve created a sub-forum but when I click on it the permalink structure changes to /forums/forum/parent-forum-name/sub-forum-name/
    Which means that I’m now taken out of the groups page and in a separate forums page instead.

    Is it possible to change it so that all sub-categories and sub-forums stay within the group?

    I’m not great with code so I’m hoping there’s a really simple solution!

    #196380

    In reply to: Forum relpy deletion

    Robin W
    Moderator

    Custom Capabilities

    and add

    delete replies to participants

    #196379
    ehasimon
    Participant

    I would like to enable my users more power with their replies – i.e. if they wish to delete one they have posted. Where do I need to change the code?

    Robin W
    Moderator

    so 303 should read

    $sticky_query['perm'] = $r['perm'];

    yes ?

    robertstaddon
    Participant

    Here is the incorrect piece of code that is currently there:

    	// Lean on the 'perm' query var value of 'readable' to provide statuses
    	} else {
    		$sticky_query['post_status'] = $r['perm'];
    	}

    And here is how the code should read:

    	// Lean on the 'perm' query var value of 'readable' to provide statuses
    	} else {
    		$sticky_query['perm'] = $r['perm'];
    	}
Viewing 25 results - 4,001 through 4,025 (of 32,504 total)
Skip to toolbar