Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 451 through 475 (of 32,294 total)
  • Author
    Search Results
  • #236573
    Robin W
    Moderator

    ok, again untested but this

    add_filter ('bbp_topic_admin_links' , 'surpress_moderator_links', 10 , 2) ;
    add_filter ('bbp_reply_admin_links' , 'surpress_moderator_links', 10 , 2) ;
    
    function surpress_moderator_links ($links , $id) {
    	
    	if (bbp_is_topic( $id)) $forum = bbp_get_topic_forum_id( $id ) ;
    	if (bbp_is_reply( $id)) $forum = bbp_get_reply_forum_id( $id) ;
    	if (!in_array($forum, array ('12345','34567','78945'))) return $links ;
    	//if user is moderator but not a keymaster...
    	$user_id = wp_get_current_user()->ID ;
    	if (bbp_is_user_keymaster($user_id)) return $links ;
    	if (current_user_can( 'moderate')) {
    		//check if the topic/reply is posted by another moderator, and if so unset the links
    		if (bbp_is_topic( $id)) $author_id = bbp_get_topic_author_id( $id ) ;
    		if (bbp_is_reply( $id)) $author_id = bbp_get_reply_author_id( $id ) ;
    		if (bbp_get_user_role( $author_id)  == 'bbp_moderator') {
    			 unset ( $links ['approve'] );
    			 unset ( $links ['spam'] );
    			 unset ( $links ['trash'] );
    			 unset ( $links ['move'] );
    			 unset ( $links ['split'] );
    			 unset ( $links ['edit'] );
    			 unset ( $links ['move'] );
    			unset ( $links ['merge'] );
    			unset ( $links ['close'] );
    			unset ( $links ['stick'] );
    		
    		}
    	}
    return $links ;
    }

    just change ‘array (‘12345′,’34567′,’78945′))’ to have a list of the forum ID’s you want to check against

    #236572
    Philippe Roussel
    Participant

    Thank you.

    I will definitely keep this code handy. I will have several forums and need the code to function only for what will be the “Training” category of forums. Can this category be implemented in the code?

    #236569
    Robin W
    Moderator

    @ph59 – ah I see, then yes try the code above, if it doesn’t work, let me know and I’ll try and find time to fix it

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

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

    or use

    Code Snippets

    #236567
    Robin W
    Moderator

    maybe …not one the bbpress authors allowed for 🙂

    anyway, totally untested as I need to be doing other things, but this might do it
    revised code below

    of course if moderators are allowed into the backend, then this becomes pointless, but I would argue that only admins should be backend access 🙂

    #236561
    fearless359
    Participant

    I put the code in the child theme functions.php file.

    #236544

    In reply to: Problem with theme

    Robin W
    Moderator

    I presume you are adding the adrotate with a shortcode – yes?

    #236498
    lmstearn
    Participant

    Hi,
    WordPress 6.2.2 running Twenty Twenty-Three theme, BBPress 2.6.9.
    Moved the only hidden (pending) topic from a public forum to a private forum, and published it. Topic, and moved replies all look fine in the private forum.
    The public forum from whence it was moved still has this:

    This forum has NN topics (+1 hidden), NNN replies …

    As expected, clicking the +1 hidden doesn’t change the number of topics displayed. Repaired the forum, cleared site cache, no change to the +1 hidden.
    If a detail in the move topic process was missed, please advise.
    Thanks.

    Ronny Kreuzberg
    Participant

    Hello, i am using this code Part to show latest Topics in certain Forums. It is giving the correct Topic ids but wont show them except of original Language even if i opened it in a different language first.

    <section class=”topics”>

    <div id=”bbpress-forums” class=”bbpress-wrapper”>

    <h3><?php echo __(‘Recent Topics’, ‘WordPress’); ?></h3>

    <?php

    $topic_parents = array();

    foreach ($match_parent_ids as $match_parent_id) {

    $match_ids = get_children(array(
    ‘post_parent’ => $match_parent_id,
    ‘post_type’ => ‘forum’,
    ‘fields’ => ‘ids’,
    ));

    foreach ($match_ids as $match_id) {

    $topic_ids = get_children(array(
    ‘post_parent’ => $match_id,
    ‘post_type’ => ‘topic’,
    ‘fields’ =>’ids’,
    ));

    foreach ($topic_ids as $topic_id) {
    echo $topic_id;
    }

    $topic_parents = array_merge($topic_parents, $topic_ids);

    }

    }

    $args3 = array(
    ‘post__in’ => $topic_parents,
    ‘post_type’ => ‘topic’,
    ‘post_status’ => bbp_get_public_status_id(),
    ‘posts_per_page’ => 10,
    ‘orderby’ => ‘freshness’,
    ‘order’ => ‘DESC’,
    );

    if (bbp_has_topics($args3)) :

    bbp_get_template_part(‘loop’, ‘topics’);

    else :

    bbp_get_template_part( ‘feedback’, ‘no-topics’ );

    endif;?>

    </div>

    </section>

    Thanks for helping

    #236487
    Neha wilas
    Participant

    You can update your .htaccess something like.
    RewriteEngine On

    # Redirect forum index URLs to shortcoded pages
    RewriteCond %{REQUEST_URI} ^/forum-index$
    RewriteRule ^(.*)$ /shortcoded-page [L,R=301]
    
    # Exception: Exclude specific paths from redirection
    RewriteCond %{REQUEST_URI} !^/forum1$
    RewriteCond %{REQUEST_URI} !^/forum2$
    RewriteRule ^(.*)$ - [L]
    

    With these rules, any request to /forum-index will be redirected to /shortcoded-page, except for requests to /forum1 and /forum2 which will not be redirected.

    #236483
    Robin W
    Moderator

    try this

    add_action( 'wp_footer', 'bsp_supports_js' );
    
    function bsp_supports_js() {
    	echo '<script>document.body.classList.remove("no-js");</script>';
    }

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

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

    or use

    Code Snippets

    #236471
    Robin W
    Moderator

    create a new page and title it what you want the title to be

    add a shortcode block

    with

    [bbp-forum-index]

    then add this page to your menus

    #236444
    tapiohuuhaa
    Participant

    If the extension works on backend, it is is useless for me. I would need extensions only frontend. I have site for solving crosswords. Honoring other peoples all hints should give as default hided.

    I tried to find the button definitions for text editor. My idea is just replace
    DEL or CODE with SPOILER. If I would find the source code, maybe I could add some codes. That apparently needs alo finding filter code, which defines, which codes are allowed.

    I though also that I could replace some code and related texts and icons of TinyMCE with another code, texts an icons.

    So I would not need to add anything. But I didn’t find, where buttons have been defined for the text editor s d TinyMCE.

    BTW. I didn’t get frontend texts translated in your GD bbPress Tools. I deleted entire translation, which I made for it because filtering worked better, but filtering works only for texts, which don’t have dynamic texts (%s etc). I get with “My WP Translate” translated “WP Sitemap Page”, so the translation tool works. I have another issue here https://wordpress.org/support/topic/translating-into-finnish/. So could you answer there.

    #236443
    markfluk
    Participant

    Yes, it’s a BNFWP shortcode on our register page.

    #236442
    Robin W
    Moderator

    and through what are they doing these?

    eg page with shortcode etc.

    #236440
    Milan Petrovic
    Participant

    Yeah, TinyMCE editor is very problematic when it comes to expanding it, it is way to complicated and easily broken.

    With by GD bbPress Toolbox Pro plugin, I have two additions for editing: BBCode Toolbar (simple extension of the basic editor with all BBCodes in the toolbar, and click on the button brings it into editor, or it can wrap selected text), and support for the Markdown. And, every BBCode can be disabled, or controlled for the Toolbar inclusion.

    Milan

    #236414
    tapiohuuhaa
    Participant

    I would lije to fork the cire code of WordPress concerning editors. I found TinyMCE related fike but I didn’t find where te’he button set if the text editor has been defined. I would fork the front-end side.

    #236397
    tapiohuuhaa
    Participant

    See my current sokution.
    https://imgbox.com/puH0BgPp

    If I mark carefully the needed code I can drag it to the editing field.

    #236396
    tapiohuuhaa
    Participant

    I have used your free version of GD bbPress Tools. I added SPOILER and few other tags with BBCode Deluxe. I edited the pugin. I commented all BBCode tags, which belongs to your plugin or which I don’t need.

    I have list fir extra code. I tryed to use JQuery to drag codes to the textare. Dragging cause that code disappears, but it just caused that the ekement disappeared from my list but but not went to the textarea.
    [CODE]$(“document”).ready(function() {
    $(“.tags”).draggable({
    revert: true
    });

    $(“.bbp-the-content”).droppable({
    accept: \’.tags\’,
    drop: function(event, ui) {
    $(this).append($(ui.draggable));
    }
    });
    });
    [/CODE]

    #236394
    Milan Petrovic
    Participant

    Hey,

    My GD bbPress Toolbox Pro plugin has 50 major new features, including BBCodes implementation that has 40+ shortcodes/BBCodes for bbPress forums, including SPOILER and HIDE, as well as full syntax highlighting SCODE shortcode.

    As for changing the main text editor buttons on the front end, I don’t know of any plugin that does it, and even the plugins that do it on the backend, don’t work on the frontend for some reason.

    Milan

    #236389
    Neha wilas
    Participant

    Use conditional logic to display the shortcode only when it’s not within the tab content.

    #236388

    In reply to: Ajax bbpress reply

    Neha wilas
    Participant

    Using JavaScript or a library like jQuery, create an Ajax request. To process the request, create a server-side endpoint (for instance, a PHP file). In the server-side code, retrieve the content of the response from the database. Then, return the response’s content in JSON or HTML format. Using the obtained content, modify the HTML elements on the website using JavaScript.
    Hope this help you.

    #236386
    tapiohuuhaa
    Participant

    Hi
    It is easy to customize backend buttons with the pugin “Post Editor Buttons Fork”, but it does work only in the backend. How I could add and remove buttons in front-end. I would like to add at least [SPOILER][/SPOILER] tag and i would lke to use [CODE][/CODE] insteaf of the default code button.

    Where is the code, which defines editor? Could I hardcode changes, which I want?

    Controlling the graphic editor TinyMCE Advanced might be more difficult. Is the alternatives for TinyMCE andvanced in the front-end. I would be nice to get.

    I have a temporary solution by using an additional menu. See https://www.sanaristikkofoorumi.net/wordpress/forums/topic/uusia-ominaisuuksia/?view=all#post-28829

    #236350

    In reply to: Is bbPress alive?

    Dale Reardon
    Participant

    I too am looking forward to hearing whether dev work is continuing.
    I’m not sure how to see from the code repositry if work is being done but just not released or not yet.

    Dale.

    #236312

    In reply to: Sidebar in Blocksy

    petalos2123
    Participant

    Blocksy requires to pay for upgrade to have different bars in every page. I can’t do that at the moment. I thought I could use a php code or css to change only the forum side bar. I am not an expert in any codex.
    Thanks for your reply.

    #236308
    Masahiko Kawai
    Participant

    I have eliminated the need to enter my email address by doing the following

    
    function bbp_set_default_email( $post_author_email ) {
    	if ( empty( $post_author_email ) ) {
    		$post_author_email = 'anonymous@example.com';
    	}
    	return $post_author_email;
    }
    add_filter( 'bbp_pre_anonymous_post_author_email', 'bbp_set_default_email', 10, 1 );
    
    function bbp_remove_default_email( $r, $args ) {
    	if ( $r['bbp_anonymous_email'] == 'anonymous@example.com' ) {
    		$r['bbp_anonymous_email'] = '';
    	}
    	return $r;
    }
    add_filter( 'bbp_filter_anonymous_post_data', 'bbp_remove_default_email', 10, 2 );
    

    First, use the filter hook “bbp_pre_anonymous_post_author_email” to set the default email address if the email address is blank.
    This avoids the “Invalid email address.” error.

    Second, if the return value “$r[‘bbp_anonymous_email’]” is set to the email address set earlier, return it blank.

    This way, if an email address is entered, its value is returned, if it is blank, it is returned blank.

Viewing 25 results - 451 through 475 (of 32,294 total)
Skip to toolbar