Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 6,501 through 6,525 (of 32,505 total)
  • Author
    Search Results
  • #174244
    MGDel
    Participant

    hello! 🙂 first of all…

    Forum Moderation

    so what? the page is empty :/

    i need to be able to set up a list of wp users to be the admin/moderators of the forum
    i need to be able to make them know about a new post (i can do it via mailing list)
    and they should be able to reply and make the question public via front end. and the op must be notified when someone replies to or publish the post.

    it’s more of a Q and A system for everyone with moderation from a list of wp userd (doctors)

    the only way i found to moderate incoming posts is a 2year old plugin with bulky backend system (it needs to be as easy as possible since the moderators wont be tech savvy guys)

    is there any other solution?

    thanks

    #174226
    pathardepavan
    Participant

    Please find the code below.. I am sure it must be a very small error

    add_action( 'rest_api_init', function() {
     register_api_field( 'topic',
        'post_parent',
        array(
           'get_callback'    => 'slug_get_post_meta_cb',
           //'update_callback' => 'slug_update_post_meta_cb',
           'update_callback' => 'slug_update_spaceship2',
           'schema'          => null,
        )
     );
    
    });
    
     
    function slug_update_spaceship2( $value, $object, $field_name ) {
       
       return update_post_meta( $object->ID, $field_name, $value);
    
    }
    function slug_get_post_meta_cb( $object, $field_name, $request ) {
        return get_post_meta( $object['id'], $field_name );
    }
    #174219
    Pascal Casier
    Moderator

    That a nice project ! Any code you can share so we see what you try to do ?
    Pascal.

    siparker
    Participant

    code works fine for me to include topics posts and replies but same as above it shows private replies.

    #174213

    In reply to: Hide top pagination

    Pascal Casier
    Moderator

    Hi,
    I would say find the ‘content-single-forum.php’ file and edit it. You will probably see twice a line with <?php bbp_get_template_part( 'pagination', 'topics' ); ?> , so you need to delete the first one to hide the top pagination.

    I didn’t test it, just guessing from what I read.

    Pascal.

    #174209
    cigar07
    Participant

    Hi,

    [bbp-topic-form] is not working. I am able to use others shortcodes and they work fine but not the new topic form.

    Please can someone tell me the cause this shortcode isn´t working?

    #174203
    maketheest
    Participant

    i have added this code from gist.github.com/ntwb/7797990 but html tags appeared on website like
    <!–more–>Go joging –> go jogging

    <span style=”line-height: 1.5;”>It’s help me have a good job–>It helps me have a good job</span>

    <!–more–>

    anyone have solution ?
    Thanks.

    #174193
    maketheest
    Participant

    i have added this code from gist.github.com/ntwb/7797990 but html tags appeared on website like
    <!–more–>Go joging –> go jogging

    <span style=”line-height: 1.5;”>It’s help me have a good job–>It helps me have a good job</span>

    <!–more–>

    anyone have solution ?

    nateonawalk
    Participant

    Had a chance to test this out locally. The URL re-writes work like a charm, without any conflicts.


    @siparker
    @netweb The plugin works almost perfectly, BUT there is still one big issue — by adding -postIDs to the end of Forum and Category URLs (mysite.com/forums/category-name-postIDstring) or (mysite.com/forums/category-name/forum-name-postIDstring), we’ve defeated the SEO purpose of re-writing these URLs.

    For authority to be passed allll the way down to the topics, we need for the forums and categories’ permalinks to live without these -postIDs. That way, (mysite.com/forums/category-name/forum-name/topic-name-postIDstring) can get the full trickle down benefit from any links /category-name/ and /forum-name/ receive.

    I’m going to play around with the plugin code to see if I can just rip the right bit out! Thanks again!

    EDIT: So removing .'-f' .$post->ID from lines 50 and 60 fixed the URLs in the CMS BUT broke the page. It seems like the plugin relies on the postIDs to associate the new URLs with the old URL structure? If so, how can we achieve this without actually using the postID in the URL?

    #174188
    tech55541
    Participant

    Hello,
    I was wondering if there was a way to get the Favorite or Subscribe link. I would like to add them to a menu, this code is an example for the BBPress admin links, I need to add one more filter to grab the Favorite and Subscribe link if possible.

    add_filter('bbp_get_topic_admin_links', 'wpmudev_bbp_admin_links_in_menu', 10, 3);
    add_filter('bbp_get_reply_admin_links', 'wpmudev_bbp_admin_links_in_menu', 10, 3);
    add_action( 'wp_footer', 'overflow_overriding' );
    function overflow_overriding() {

    Any filters laying around for this I have not found yet?

    Thanks for your help. 🙂

    #174184

    It’s actually much easier than this.

    If you set words, phrases, or IP addresses in your Settings > Discussions of WordPress’s admin, bbPress will adhere. Whatever you use for WordPress comments, also works for bbPress topics & replies.

    Hope that’s helpful!

    #174182
    Krzysztof
    Participant

    Creators plugin All in One SEO Pack bug fixed. Have to wait on updates or:
    In wp-content/plugins/all_in_one_seo_pack/admin/display/meta_import.php, change line 38 from

    }else{

    to

    }elseif(!class_exists('bbPress')){

    #174165

    In reply to: Vedrtical Forum Titles

    Pascal Casier
    Moderator

    Great. My standard answer is always the same:

    Check out the codex: https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/#1-change-how-the-forum-list-displays

    Or

    Use a plugin like ‘bbP Toolkit’ or ‘bbp style pack’

    Pascal.

    #174158

    In reply to: Formatting not loading

    brhahlen
    Participant

    If need be, I can make an account for you, so you can see what the issue is (as my forums are private).

    Adding the following to functions.php in my theme-folder, did nothing:

    if (!is_admin()) {
    wp_deregister_script('jquery');
    wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"), false, '1.11.3');
    wp_enqueue_script('jquery');
    }

    I also restarted Apache, also to no avail.

    #174153
    Ismail
    Participant

    Hello,

    I have made this a little simple, where any visitor can have an overlay division hiding the topic content and everything when there are caught words in the currently viewing topic..

    You can add this code to your theme’s functions file:

    Remember: edit $list = 'test,bad topic,'; line to insert your watched words separated by commas without a space after the commas.

    add_action('wp', function() {
    
    	/**
    	  * Add the watched words or sentences separated by commas.
     	  * Remember not to add a space before the words
     	  * Example : 'evil dog,naughty cat,pig'
    	  */
    
    	$list = 'test,bad topic,';
    	// set up a global variable for our case
    	$GLOBALS['my_filtered_words'] = explode(',', $list);
    
    });
    
    add_action('bbp_theme_after_reply_content', function() {
    
    	if( ! get_the_ID() )
    		return;
    
    	$topic = get_post( get_the_ID() );
    
    	if( ! $topic || 'topic' !== $topic->post_type )
    		return;
    
    	global $my_filtered_words;
    	$words = preg_split( "/\s+/", $topic->post_content );
    
    	foreach( $words as $i => $word )
    		$words[$i] = strtolower($word);
    
    	$occurance = 0;
    	foreach( $my_filtered_words as $string ) {
    		$string = strtolower( $string );
    		$occurance += in_array( $string, $words ) ? 1 : 0;
    	}
    
    	if( ! ( $occurance > 0 ) )
    		return; // nothing caught
    
    	$cookie = isset( $_COOKIE['se_conf_warned_topics'] ) ? explode(',', $_COOKIE['se_conf_warned_topics']) : array();
    
    	if( in_array($topic->ID, $cookie) )
    		return; // confirmed before.
    
    	?>
    
    		<style type="text/css">
    			.se-conf-wt {position: fixed; top: 0; left: 0; background: rgba(0, 0, 0, 0.78); width: 100%; height: 100%; z-index: 999;}
    			.se-conf-wt p {color: #fff; position: relative; top: 50%; display: table;margin: 0 auto;}
    			.se-conf-wt a {color:#fff;}
    		</style>
    		<div class="se-conf-wt t-<?php echo $topic->ID; ?>">
    			<p>This topic contains offensive content. <a href="javascript:;">Continue?</a></p>
    		</div>
    		<script type="text/javascript">
    			window.onload = function() {
    				var a = document.querySelector('.se-conf-wt.t-<?php echo $topic->ID; ?> a'),
    					b = document.body;
    				a.onclick = function() {
    				    var expires = new Date(),
    				    	cval = '<?php echo isset($_COOKIE['se_conf_warned_topics']) ? $_COOKIE['se_conf_warned_topics'] : ''; ?>';
    					expires.setMonth(expires.getMonth() + 6); // 6 months expiracy date
    					cval += '<?php echo $topic->ID; ?>,';
    					document.cookie = "se_conf_warned_topics=" + cval + ";  expires=" + expires;
    					// cookie set, now let's hide the warning
    					this.parentNode.parentNode.remove();
    					b.style.overflowY = '';
    					return false;
    				}
    				b.style.overflowY = 'hidden';
    			}
    		</script>
    
    	<?php
    
    });

    Tested on my local installation and it works fine.
    Let me know how it goes.

    Samuel

    #174151
    Ismail
    Participant

    Hello, here are the steps for you:

    1. Create a ‘new topic’ page at example.com/new-topic/ and add [bbp-topic-form] shortcode as content.
    2. Add this code to your child theme’s functions file:

    add_filter('the_content', function($content) {
    
    	global $post;
    
    	if( 'post' == $post->post_type && is_user_logged_in() ) {
    		$content .= '<p><a href="' . home_url('new-topic/?se_pid=' . $post->ID) . '">Generate a topic</a></p>';
    	}
    
    	return $content;
    
    });
    
    add_action('init', function() {
    
    	$content = null;
    
    	if( isset( $_GET['se_pid'] ) ) {
    		$pid = (int) $_GET['se_pid'];
    		$content = get_post( $pid );
    	}
    
    	$GLOBALS['se_post'] = $content;
    
    });
    
    add_filter('bbp_get_form_topic_title', function( $title ) {
    
    	global $se_post;
    
    	if( $se_post ) {
    		return $se_post->post_title;
    	}
    
    	return $title;
    
    });
    
    add_filter('bbp_get_form_topic_content', function( $body ) {
    
    	global $se_post;
    
    	if( $se_post ) {
    		return $se_post->post_content;
    	}
    
    	return $body;
    
    });

    Test it out, go to your posts and scroll down to the bottom, click the “generate ..” link and see if it worked.

    I am here for any further customization or if you encounter issues with implementing this.

    Regars,
    Samuel

    #174139

    In reply to: Hide top pagination

    kieranw7261
    Participant

    Hi there

    Thanks for the reply.

    For the one or two lines of code that needs to be removed from the bbpress plugin files it doesn’t seem right to go to all the effort of a child theme.

    I can always remove the code each time the plugins updated.

    Would you happen to know where it is and which line I need to remove.

    Thanks

    #174138

    In reply to: Hide top pagination

    Pascal Casier
    Moderator

    Hi,
    I suppose with ‘core’ you mean the bbPress plugin code ? NO, NEVER ! You don’t want to loose your changes at the next bbPress update, right ?

    I think @robkk answer was the most appropriate one for this topic: Just work on the template, copy it to your (child)theme and modify as he indicated.

    See probably step 5 and 6 from https://codex.bbpress.org/themes/theme-compatibility/step-by-step-guide-to-creating-a-custom-bbpress-theme/ an also https://codex.bbpress.org/functions-files-and-child-themes-explained/

    Pascal.

    #174126
    Pascal Casier
    Moderator

    Something seems very strange to me, all your links on your site have a // in front of them.
    So the login form has <form method=”post” action=”//http://www.barabajen.se/wp-login.php&#8221; class=”bbp-login-form”>

    Please try to fix that first (no idea where it comes from, but for sure it’s not bbPress.

    Pascal.

    #174125
    Tapirk
    Participant

    When i try to log in to BBpress on my site either by the bbpress-widget or with the[bbp-login] shortcode all I get is a blankscreen and nothing more happens. Everthing just stops with a blank screen on …/wp-login.php.

    I looked around and couldnt really find an answer to my problem.

    My site: http://www.barabajen.se, And there is a shortcode in the bottom or the right widget-area

    Thanks in advance.

    Manuel Fritsch
    Participant

    Thank you all for your feedback. After some thorough investigation, I managed to finally configure my caching so that it actually works (never checked that… my mistake – I entered the wrong path in .htaccess). Also, I hard-coded some tweak in my theme, something which was only recently brought to my attention.

    And this morning, one of our users finally had site load times of <1s on our forums. I can happily leave them on our main site – even if P3 reported bbpress & Associates as major sources of site load time: That it still is very little with good caching and static CSS/JS files in place (which I did not have before, they were computed on site load, thanks to my theme).

    Best
    Manuel

    #174098
    Pascal Casier
    Moderator

    OK, now I see !
    How about [bbp-lost-pass] ?
    Check out https://codex.bbpress.org/features/shortcodes/

    Pascal.

    #174097

    In reply to: Info Forum Index

    Pascal Casier
    Moderator

    Yes, I understood, so you should find your answer in one of the 3 links I provided.

    Most probably this ?

    Dashboard>forums>all forums and edit each forum
    put the banner in the description
    then download my plugin
    https://wordpress.org/plugins/bbp-style-pack/
    and tick item 6 Add Forum Description on the forum display tab

    But read the rest too.
    Pascal.

    #174084
    j_mo
    Participant

    Hi Pascal,

    I’ve used [bbp-login], [bbp-register] and [bbp-lost-pass] to create fronted profile pages so am wondering if there’s a [bbp-change-pass] shortcode or something? Or if not, are there alternatives?

    Cheers

    #174074
    cigar07
    Participant

    Hi,

    I am trying to use [bbp-topic-form] in a page, but the page displays a blank page. The shortcode [bbp-forum-form] works fine but not the topic form.

    Please can someone tell me why the page is not displaying the topic form?

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