Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 1,376 through 1,400 (of 32,432 total)
  • Author
    Search Results
  • Chuckie
    Participant

    @wendylady, also, if you install the “Advanced Editor Tools” plugin you can get your TinyMCE toolbar to show the menu bar. I just tried it. This menu bar has the “Restore last draft” on it.

    But I have not added any code to include the “restoredraft” button on the toolbar itself.

    But as previously mentioned, the autosave is defaulting to 30 seconds.

    Chuckie
    Participant

    Hi @wendylady

    Thanks for trying the plugin! According to the TinyMCE documentation for autosave it simply states:

    This plugin gives the user a warning if they made modifications to the content within an editor instance but didn’t submit the changes.

    I notice there is an option autosave_interval:

    This option enables you to specify the time the editor should wait between taking snapshots of the current content and saving them to local storage. The syntax is to append the letter s to the end of a number value. For example, “30s” for 30 seconds.

    According to the documentation the default is 30 seconds. Since i do not specify this option in my plugin it must be using this default of 30 seconds.

    If you don’t mind, could you also re-produce your query in the support forum for the plugin:

    https://wordpress.org/support/plugin/add-autosave-fullscreen-to-tinymce/

    ?

    And I can add the same response there.

    Does this help?

    #223700

    In reply to: Forum Display

    Robin W
    Moderator

    sorry, copied the wrong link

    it should be

    [bbp-single-forum id=$forum_id]

    all the shortcodes are here

    Shortcodes

    #223699

    In reply to: Forum Display

    cryptobeya
    Participant

    Thank you. I tried that, however it displays the “create new topic” form and not the forum list. Is that shortcode correct?

    Coin Forums
    Create New Topic in “Coin Forum”
    Your account has the ability to post unrestricted HTML content.
    Topic Title (Maximum Length: 80):

    Topic Tags:

    Topic Type:

    #223696

    In reply to: Forum Display

    cryptobeya
    Participant

    Thank you, that makes sense. When I add the short code to each page, you say $forum Id = the category. Where can I find the forum Id for the category? Is that just the name of the category?

    The name of my category id Coin Forum. What should go in the $forum_id space below?

    [bbp-topic-form forum_id=$forum_id]

    #223676
    MrsJessicaSimpson
    Participant
    add_filter( 'bbp_get_view_query_args', 'rew_limit') ;
    
    function rew_limit ($args) {
    $args['posts_per_page'] = -1 ;
    $args['posts_per_page'] = 10 ;
    return $args ;
    }

    Following this, and looking at it: then a bracket ‘]’ might be missing where the (= 10) line is.
    Which could explain the unexpected T_FUNCTION error.

    Got this code running on my site, (in the functions.php file), and it seems to work.

    Happy-hacking.

    #223660

    In reply to: Forum Topics

    fenna4498
    Participant

    No we only have bbPress and the bbp style pack, Gamipress – bbPress integration and a plug-in for paid memberships. I don’t think this will be changing it. But there is a column underneath the sentence “you may use these HTML tags and attributes” with:

         

    #223630
    Robin W
    Moderator

    I need to know what you are using ie

    can you just clarify what this is, a widget or shortcode, and which one

    #223628
    Robin W
    Moderator

    ‘Recently Active Topics’

    can you just clarify what this is, a widget or shortcode, and which one

    #223620
    aygunoz
    Participant

    So how can I edit this code for [bbp-topic-index] shortcut and Implementation to my WordPress plugin? If you please, Can you explain more bc I didn’t understand exactly what to do :/ Sorry.
    Thank you for helping

    #223619
    Robin W
    Moderator

    amended in the original code to add the missing ;

    #223616
    aygunoz
    Participant

    Okay, I found the functions.php but I confuse about this code add_filter( 'bbp_get_view_query_args', 'rew_limit') Bc there are functions but there are not any code like this. So Shall I paste this there too? And after paste what’s gonna be shortcut ?
    Thank You!

    #223613
    Robin W
    Moderator

    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

    #223610
    aygunoz
    Participant

    Where shall I put this code? This is what exactly I was looking for :)?

    #223606
    Robin W
    Moderator

    I’d suggest you check out

    function bbp_new_topic_handler

    on line 96 of

    includes\topics\functions.php

    for how a new topic is created

    #223605
    NeoTechni
    Participant

    Using this code I am able to programmatically create a forum post, but it only shows to users who are logged in (when using the bbp-single-topic shortcode) How can I get that topics to show while logged out?

    
    	function createforumpost($text, $forums_id, $unique_id, $fighter_name = false){
    		if(is_null($forums_id) || !$forums_id){
    			if(!$fighter_name){
    				$fighter_name	= explode("-", $unique_id);
    				foreach($fighter_name as $index => $word){
    					$fighter_name[$index] = ucfirst($word);
    				}
    			}
    			$forum_post = array(
    			  'post_title'    	=> $fighter_name,
    			  'post_content'  	=> $text,
    			  'post_name'	  	=> $unique_id,
    			  'post_status'   	=> 'publish',
    			  'comment_status'	=> 'closed',
    			  'post_type'		=> 'topic',
    			  'post_parent'		=> 75857,
    			  'post_author'   	=> 1,
    			);
    			$forum_post["ID"] = wp_insert_post($forum_post);
    			return $forum_post["ID"];
    		}
    		return $forums_id;
    	}
    
    #223561
    tiaestel
    Participant

    Hello
    I found bbpress registration is used by “form-user-register.php”
    I added extra field code (
    <div class=”bbp-email”>
    <label for=”user_email”><?php esc_html_e( ‘Email’, ‘bbpress’ ); ?>: </label>
    <input type=”text” name=”이메일” value=”<?php bbp_sanitize_val( ‘user_password’ ); ?>” size=”20″ id=”user_password” maxlength=”100″ autocomplete=”off” />
    </div>)
    to edit the registeration form but it didnt work
    what is the problem do you think?

    #223536

    In reply to: Forum Display

    Robin W
    Moderator

    create 2 categories and make your forums subs of these, create 2 pages and use a shortcode in each

    [bbp-topic-form forum_id=$forum_id] where $forum_id is the category

    #223513
    qlqlo
    Participant

    After I Install and activate bbPress nothing shows up in my admin area sidebar (Forum, Topics, Replies do not appear). When I create a new page and paste there a shortcode for displaying the whole forum index, the page shows an error. I don’t know what went wrong, I tested on my localhost and it worked fine.
    I also tried to delete the plugin and install it again.

    #223511
    regnalf
    Participant

    as no one answer this, i tried it by myself. i found a function in bbp-style-pack plugin for that.

    if (function_exists('bsp_is_forum_unread_amount'))
    {
    	
    	add_shortcode( 'bbp_count_new', 'bbpress_count_new' );
    	function bbpress_count_new( $atts )
    	{
    		
    		$output = "";
    		$count_new = 0;
    		
    
    		$query_foren = new WP_Query(array( 'post_type' => 'forum' ));
    		
    		
    		while($query_foren->have_posts())
    		{
    			$query_foren->the_post();
    			
    			$post_id = get_the_id();
    			
    			$bbp_forum_privategroups = get_post_meta( $post_id, '_private_group');			
    			$bbp_user_privategroups = preg_split('/\*/', get_user_meta (get_current_user_id(), 'private_group', true), -1, PREG_SPLIT_NO_EMPTY);
    			
    			if ( count( $bbp_forum_privategroups ) == 0 )
    			{
    				$amount_unr = bsp_is_forum_unread_amount( $post_id );
    				$count_new += $amount_unr->amount;
    			}
    			else
    			{
    				if ( count( array_intersect( $bbp_forum_privategroups, $bbp_user_privategroups )) > 0 )
    				{
    					$amount_unr = bsp_is_forum_unread_amount( $post_id );
    					$count_new += $amount_unr->amount;
    				}
    			}
    		}
    		
    		if ($count_new > 0 )
    		{
    			ob_start();
    			?><span style="margin-left: 0.3rem; font-size: 0.8rem; padding: 0.4rem;"> <?php echo($count_new); ?></span><?php
    			$output = ob_get_contents();
    			ob_end_clean();
    		}
    		
    		return $output;
    	}
    
    	
    }

    i hope i didn’t oversee something, because it is also combined with private forum groups!

    huetherb
    Participant

    I suppose this isn’t WordPress or BBPress specific, but trying to figure out if there is a WordPress way of doing this.

    I am using BBPress, and on some page, such as https://somesite.com/lesson/some-lesson/, I have a block with a link to a discussion topic. That link is of form

    <a href="javascript:void(0);" data-target="#myModal" data-href="somesite.com/forums/topic/required-discussion-1/" data-toggle="modal" class="openPopup"><h3 class="topictype-title">required discussion 1</h3></a>

    The modal popup is handled in bootstrap via

    
    <div class="modal fade" id="myModal" role="dialog">
       <div class="modal-dialog modal-xl">
          <div class="modal-content">
             <div class="modal-header"><button type="button" class="close" data-dismiss="modal">×</button><h4 class="modal-title">Class Discussion</h4>
             </div>
             <div class="modal-body"></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
          </div>
       </div>
    </div>
    

    And with jQuery

    
        $('body').on('click', '[data-toggle="modal"]', function(){
            $($(this).data("target")+' .modal-body').load($(this).data("href"));
        });
    

    What happens now, is after hitting submit, the modal goes away, and the forum topic page with the submitted reply is loaded: url https://somesite.com/forums/topic/required-discussion-1/#post-25847

    The thing is, after user submits from the modal, I want either

    **1) the refresh (so, going to https://somesite.com/forums/topic/required-discussion-1/#post-25847) to happen in the modal, or**

    **2) for the modal to simply close and user is returned to exactly as they were prior to modal popping up, that is, to https://somesite.com/lesson/some-lesson/**

    Ideas on how to ideally achieve these two behaviors? I have never worked with modals before, so curious what are some best practices here to get the desired behavior.

    Thanks!

    #223501
    Robin W
    Moderator

    ok, that’s development rather than support.

    so you will need to alter templates and put these in your child theme.

    look for

    \templates\default\bbpress\loop-topics.php
    does topic list headers
    
    calls loop-single-topic
    \templates\default\bbpress\loop-single-topic.php
    lists each topic in the forum, last post and freshness
    
    lists topic content

    so for each find the file

    transfer this to your pc and edit

    and save

    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 transfer the file you saved above and put in in the directory called bbpress that you created above

    bbPress will now use this template instead of the original

    #223488
    regnalf
    Participant

    I know there is a widget to show somewhere on the page if there is new activity in the forums. But is there a possibility (maybe a shortcode?) to show only an icon when there is new activity in any forum? Or better yet an info with the number of new posts?

    #223481
    dalton125
    Participant

    I’ve been searching for a way to return the titles and links of every topic on my forum. I’m familiar with HTML and CSS, but a PHP novice, which I think is my downfall here.

    I found a call to

    <?php the_content();?>

    which seems to be generating the big grey box with a list of all the topics (image link: https://imgur.com/a/fKamtGH)

    However, I just want to return the topic titles and links to each topic, not the entire box. I can’t seem to find / write a PHP method that does this, does anyone have any advice?

    #223475
    Robin W
    Moderator
Viewing 25 results - 1,376 through 1,400 (of 32,432 total)
Skip to toolbar