Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 3,326 through 3,350 (of 32,481 total)
  • Author
    Search Results
  • #205937
    Robin W
    Moderator

    I’m just looking at that code are to try and understand it.

    Yes, admins and moderators skip the moderation rules.

    Thanks for the useful testing of the first part – ie the links.

    Images and videos are just links as far as I can see, so should obey the same rules as above and be included in the count.

    so 1 links, I video and 1 image = 3 links.

    can you retest based on that and see if just 1 image is going into pending, or if it is the combination.

    #205935
    rederis
    Participant

    Hi, I am trying to grab all replies and count them (7 days old only)
    Then I want to put on my nav menu message “There is new posts in formum ( 4hours 21mins ago )
    1. Problem post_type Reply doesn’t work
    2. Can’t access bbp functions in main-theme
    3. It counts and renews only new TOPICS

    function count_new_forum_posts() {
    
    $today = date("Y-m-d");
    
    $date2 = date("Y-m-d", strtotime($today . "-7 Day")); 	
    $args = array(
    		'post_type' => 'topic',
    		'meta_query' => array(
    			array(
    				'key' => '_bbp_last_active_time',
    				'value' => $date2,
    				'type' => 'DATE',
    				'compare' => '>='
    					),
    				)
    );
    
    $posts_query = new WP_Query($args);
    $the_count = $posts_query->post_count;
    
    return $the_count;
    
    }
    add_filter('wp_nav_menu_items', 'new_forums_notice_to_menu', 10, 2);
     
     function new_forums_notice_to_menu($items, $args) {
    	 if(count_new_forum_posts() > 0){
              if( $args->theme_location == 'primary' )
              $items .= '<li><a href="http://apygarda/forums/" text-transform="lowercase" text-shadow="2px 1px 2px black"><font color="red">Šios savaitės naujos žinutės forume: <span>'.count_new_forum_posts().' ('.bbp_forum_freshness_link().')</span></font></a></li>';
         return $items;
     }else{
    	           if( $args->theme_location == 'primary' )
              $items .= '<li><a href="http://apygarda/forums/" text-transform="lowercase" text-shadow="2px 1px 2px black"><font color="gray">Šią savaitę forume dar niekas nepasisakė</span></font></a></li>';
         return $items;
     }
    }
    #205899
    thierrytregaro
    Participant

    sorry to disagree. This is not a 3rd party plugin issue but a feature from bbpress that should be optional. Or, at least, that admin should be able to not use.

    You do not fight spam with manual approve. I got days with over a thousands spams, GL doing it one by one LOL. Spamming is anti-spam business, not forum job (using server anti-spam + CleanTalk, maybe I had to remove one post this whole year. Out of 300k posts).

    Today, I had to approve over 350 posts. Some of wich I had no clue why any piece of code could think of it as spam. And that included topics I, as admin, moved from one forum to another.

    Whatever, migrating to Discourse is on its way and should be up tomorrow (it is but not public). There’s no way I can use a manually validating forum anymore. Those 5 years with bbpress were fun (in spite of some epic crashes).

    #205897

    Since the problem appears to be with a third party plugin, you’re unlikely to get a lot of support from the bbPress development team here for code that isn’t theirs.

    In addition, you have not clearly stated what the actual problem is. You have clearly stated your complaints and how you feel about them, but you haven’t included instructions on how to replicate your problem.

    Naturally, these forums are using bbPress, and we aren’t having the same moderation issues that you are. That doesn’t mean there isn’t something wrong, simply that no one knows where to look unless you can show them.

    #205891
    Chuckie
    Participant

    I can confirm that a basic post with no attachments (reply) is going to pending. It did not before and would like this resolved please. I wish I could help.

    Tied very closely to this is my other discussion where I have shown the code that displays moderation feedback to the user for new topics but the same code is missing for replies. It needs to be there. The user must be told there post has gone to the moderation queue. We have the code and phrases in the files. We just got to drop them into the replies mechanics (except it should go after the post and before the edit control.

    Tied very closely with this is that by design the admin staff should be sent an email if a post goes to moderation without the need for external plugins. Atleast an option to do so.

    Great plugin!

    #205887
    Robin W
    Moderator

    this is related to your theme

    you could put this in your theme custom css area

    @media only screen and (max-width: 600px) {
    .bbp-topic-content p{
    margin : 0 0 0 0 ;
    line-height : 1.2 ;
    }
    }
    #205884
    cj74
    Participant

    wordpress 5.3
    bbpress 2.6.1

    Hello,
    I am noticing in the last few days and that is even prior to upgrading to wordpress 5.3 the bbpreply widget which lists the recent replies does not list the replies CLEARLY as it used to.

    After the listing there is line now added next to all new replies that says”<span class=”dashicons dashicons-visibility wvrbbp-fav-sub” style=”font-size:80%;vertical-align:middle;”></span>”.

    This added line obviously is taking away the clean clear quality of the webpage making it look ugly like a coded page. Please advise. Any help is appreciated. Thank you.

    Chuckie
    Participant

    Sorted my issue. I forgot to add styling for bbp-topic-content classes! Doh!

    #205858
    willysbd
    Participant

    I tried to make a custom plugin with this code, but it didn’t work so…Any solution?
    Thanks!

    #205842
    Robin W
    Moderator

    try this

    #bbpress-forums li.bbp-header .bbp-reply-author {
    display : none ;
    }
    #205839
    Robin W
    Moderator

    ok change

    <div class="bbp-reply-content"><?php bbp_show_lead_topic()
    			? esc_html_e( 'Replies', 'bbpress' )
    			: esc_html_e( 'Posts',   'bbpress' );
    		?></div><!-- .bbp-reply-content -->

    to

    <div class="bbp-reply-content"><?php bbp_show_lead_topic()
    			? esc_html_e( 'Replies', 'bbpress' )
    			: _e( ‘<div align=”center” style =”color:#ff0000″>Please check out all the replies below,<br> if you find a post helpful please vote using the arrows</div>’, ‘bbpress’ ); 
    ?></div><!-- .bbp-reply-content -->

    You should really put this file into a child theme if you have one

    so you would do the following

    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

    then upload the new file to this directory so you end up with
    wp-content/themes/%your-theme-name%/bbpress/loop-replies.php
    bbPress will now use this template instead of the original

    #205832
    Chuckie
    Participant

    In the template.php file it has the following code:

    	// Get the topic status
    	switch ( $topic_status ) {
    
    		// Spam notice
    		case bbp_get_spam_status_id() :
    			$notice_text = esc_html__( 'This topic is marked as spam.', 'bbpress' );
    			break;
    
    		// Trashed notice
    		case bbp_get_trash_status_id() :
    			$notice_text = esc_html__( 'This topic is in the trash.', 'bbpress' );
    			break;
    
    		// Pending notice
    		case bbp_get_pending_status_id() :
    			$notice_text = esc_html__( 'This topic is pending moderation.', 'bbpress' );
    			break;
    
    		// Standard status
    		default :
    			$notice_text = '';
    			break;
    	}

    As you can see, it has specific notices for feedback to the user.

    The above work when it is a “topic” they are creating. What we now need is exactly the same code, but for “replies”. In addition though, this warning needs to be placed just above the empty editor and just after the previous reply.

    It is this code that is lacking for replies. So IMHO your comments don’t apply here. It is not about redirection or anything. It is about consistency with informing the user just like it does for a new topic.

    I hope this helps you in resolving this issue and thank you so much for your time in looking into this.

    The above begins on line 3029:

    /**
     * Displays topic notices
     *
     * @since 2.0.0 bbPress (r2744)
     */
    function bbp_topic_notices() {
    #205815
    Robin W
    Moderator

    ok, the message in red show what I think is fine on my browser – can you say if you still have an issue with that part.

    On the mobile, you could have

    @media only screen and (max-width: 600px) {
    
    #bbpress-forums .bbp-reply-author {
    	display	: none ;
    }
    
    }

    which would take the author part out for mobiles

    #205807
    Chuckie
    Participant

    I had a look at the code in 2.6.1.

    Lines 618 – 622 in functions.php in replies folder:

    /** Reply Bad Words *******************************************************/
    
    if ( ! bbp_check_for_moderation( $anonymous_data, $reply_author, $reply_title, $reply_content, true ) ) {
    	bbp_add_error( 'bbp_reply_moderation', __( '<strong>ERROR</strong>: Your reply cannot be edited at this time.', 'bbpress' ) );
    }

    Notice that it makes use of the bbp_add_error call to notify the user? Well, look at lines 624 – 636:

    /** Reply Status **********************************************************/

    // Maybe put into moderation
    if ( ! bbp_check_for_moderation( $anonymous_data, $reply_author, $reply_title, $reply_content ) ) {
    
    	// Set post status to pending if public
    	if ( bbp_get_public_status_id() === $reply->post_status ) {
    		$reply_status = bbp_get_pending_status_id();
    	}
    
    // Use existing post_status
    } else {
    	$reply_status = $reply->post_status;
    }

    There does not appear to be any code to flag the user. Either way, if a “reply” is flagged as pending (for example, I insert 3 images) it just vanishes with no feedback to the user. This also happens here in this forum.

    I confess I don’t know the code enough and could be barking up the wrong tree.

    #205802
    Chuckie
    Participant

    As previously mentioned. At root level all freshness are wrong when topics are created and replies made:

    Category 1
       Forum
       Forum
       Forum
    
    Category 2
       Forum
       Forum
       Forum
    
    Category 3
       Forum
       Forum
       Forum

    Similarly, if I drill down a level:

    Category 3
       Forum
       Forum
       Forum

    This is still wrong. Freshness not showing the most recemt topic / reply info right. Unless I run the tool to rebuild freshness.

    If I drill down a level:

    Forum
       Topic
       Topic
       Topic

    This always showed it correctly with the most recent freshness for the topic / reply in each forum.

    I don’t think I can provide more info.

    Andrew

    #205757
    Chris Taylor
    Participant

    I upgraded to 2.6.1 and my topic replies are not being displayed. Debug toolbar shows that there are two database errors being thrown, both like this:

    SELECT COUNT(wp_posts.ID)
    FROM wp_posts FORCE INDEX (PRIMARY, post_parent)
    LEFT JOIN wp_postmeta ON wp_postmeta.post_id = wp_posts.ID AND wp_postmeta.meta_key = '_bbp_reply_to'
    WHERE 1=1 AND (wp_posts.ID = 76 OR wp_posts.post_parent = 76)
    AND wp_posts.post_type IN ('topic', 'reply')
    AND wp_postmeta.meta_key IS NULL
    AND (wp_posts.post_status = 'publish')
    ORDER BY wp_posts.post_date ASC
    
    Table 'site_name.wp_posts' doesn't exist

    The list of forums and topics works fine.

    Like many WordPress installations I have a custom prefix for my database tables (“wp_****_”) and it appears that bbPress 2.6.1 is using that for some queries and not others.

    Tom
    Participant

    Nope. I just tried with short codes and still shows no forums/threads.

    Danishsard
    Participant

    Hello, maybe it would be worth to add voices to the settings panel in the bbpress options. Most people do not want to use it, why impose it. At home I turned it off by cutting out in the code of the page https://infomiasto.eu/forum/tematy/rozmowy/ but it is a solution that you need to repeat when updating, and maybe it would be such a setting

    #205745
    Robin W
    Moderator

    ok, I think I’ve got it – yes it is my style pack plugin that adds the table – some code I wrote quite a while ago. It works fine on 2.5.14 as that does the display differently.

    I’ll need to re-write a part for 2.6.

    In the meantime if you uncheck the registration and logins for

    dashboard>settings>bbp style pack>Topic/Rely Styling

    and
    dashboard>settings>bbp style pack>Topic/Reply Display

    then apart from registration, these should now be ok.

    I’ll come back when I have fixed that part

    #205736
    Robin W
    Moderator

    there is a function

    bbp_is_user_forum_moderator

    so a stament like

    if (bbp_is_user_forum_moderator()) {
    
    //do something
    }

    or if you need to pass user_id or forum_id

    if (bbp_is_user_forum_moderator( $user_id, $forum_id)) {
    
    //do something
    }
    #205731
    Robin W
    Moderator

    yes, that looks like it, and yes it should not be in that part as it gets overwritten. Good that you had a copy !

    so from

    function add_new_roles( $bbp_roles )

    to the end and put this in the functions file of your child theme

    Robin W
    Moderator

    ok, is your forums page using the shortcode ?

    #205725
    scabbrox
    Participant

    Hi there and thanks for the reply.

    The trouble is I’m not entirely sure how we did it as it was a while ago and the person that did it is no longer with us.

    I’m not seeing anything in functions.php which is where I understand that code is normally put for this so I’m assuming it’s in the capabilities.php file that the update is overriding as this does refer to treating wp_roles as bbpress roles.

    I can send a copy of the capabilities file (not seeing an upload button) or perhaps you can give me an idea where else to look?

    Sorry to be so vague, but it works fine with the previous version of bbpress so I’m guessing it’s something that gets overwritten when I update.

    The roles were created by clicking duplicate on a bbpress role and then changing the name, but if I try that now it just created a wp-role and not a forum role.

    #205724

    In reply to: Child CSS

    raydelvec
    Participant

    Yes, I can also confirm that renaming to bbpress.min.css brings back the styles.

    #205720
    Robin W
    Moderator

    the bit you have altered is in my style pack plugin :

    dashboard>settings>bbp style pack>topic/reply display>item 20.

    However as bbpress now wraps this part in a <ul> you can’t use a <table> in that part.

    However the new template gives you the login part below it which the old did not, so it gets you most of the way there.

    Alternatively you could amend the template which is

    templates/default/bbpress/form-topic.php if you know how to FTP files

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