Mei Ling (@mei-ling)

Forum Replies Created

Viewing 17 replies - 1 through 17 (of 17 total)
  • @mei-ling

    Participant

    Hi winwin1,

    You could use Jetpack

    Publicize ==> extend to the required cpt (topics, replies)
    Sharing button are displayed. Depending on the the theme, you should have to add them via CSS

    have a nice day

    In reply to: Tag

    @mei-ling

    Participant

    I thank you Barry. We will try this solution, simple and elegant.

    In reply to: Jetpack publicize

    @mei-ling

    Participant

    Hi,

    I thank you. I didn’t not know if it was “topic” or “topis”.

    MeiLing

    @mei-ling

    Participant

    Hi,

    Here is the code that we use with the child theme. As we run a large forum, we must modify some setting of the server but we use a VPS.

    <?php
    
    add_action( 'bulk_edit_custom_box', 'manage_wp_posts_be_qe_bulk_quick_edit_custom_box', 10, 2 );
    
    function manage_wp_posts_be_qe_bulk_quick_edit_custom_box( $column_name, $post_type ) {
    
    	switch ( $post_type ) {
    		case 'topic':
    			switch( $column_name ) {	
    				case 'bbp_topic_forum':
    					?><fieldset class="inline-edit-col-left">
    						<div class="inline-edit-col">
    							<label>
    								<span class="title">Deplacer dans le forum</span>
    								<span class="input-text-wrap">
    									<select name="deplacer">
    									<option value="Null"></option>
    								<?php	/* recuperation des forums "forum" */
    								$args = array(
    												'post_parent__not_in'=> array( 0 ) ,
    												'post_type' => 'forum'
    								);
    								$forums = new WP_Query( $args );	
    								// boucle  forum
    								if ( $forums->have_posts() ) {
    									while ( $forums->have_posts() ) {
    										$forums->the_post();	
    										echo '<option value="'.$forums->post->ID.'">'.get_the_title() . '</option>' ;
    									}
    								}	
    								wp_reset_postdata();?>
    									
    									</select>
    								</span>
    							</label>
    						</div>
    					</fieldset><?php
    					break;	
    			}	
    			break;	
    	}
    }
    
    /* lance le javascript */
    add_action( 'admin_print_scripts-edit.php', 'manage_wp_posts_be_qe_enqueue_admin_scripts' );
    function manage_wp_posts_be_qe_enqueue_admin_scripts() {
    
    	wp_enqueue_script( 'manage-wp-posts-using-bulk-quick-edit', trailingslashit( get_bloginfo( 'stylesheet_directory' ) ) . 'js/bulk_quick_edit.js', array( 'jquery', 'inline-edit-post' ), '', true );
    	
    }
    
    /* enregistre modif forum et repare */
    add_action( 'save_post', 'save_deplacer');
    function save_deplacer() {
    	global $wpdb;
    	
    	
    	if( $_GET['post_type']='topic' && $_GET['bulk_edit']='Mettre à jour'){
    	
    	$post_ids= $_GET['post'];
    	$forum_id = $_GET['deplacer'];
    		foreach($post_ids as $post_id){
    			
    	$wpdb->query("UPDATE wp_posts SET post_parent = $forum_id	WHERE ID = $post_id ");
    		}
    
    				$messages = array();
    				$messages[] = bbp_admin_repair_forum_meta();
    			//	$messages[] = bbp_admin_repair_topic_meta();
    				$messages[] = bbp_admin_repair_freshness();
    			//	$messages[] = bbp_admin_repair_reply_menu_order();
    				$messages[] = bbp_admin_repair_forum_topic_count();	
    				$messages[] = bbp_admin_repair_forum_reply_count();
    			//	$messages[] = bbp_admin_repair_topic_reply_count();
    			//	$messages[] = bbp_admin_repair_topic_voice_count();
    			//	$messages[] = bbp_admin_repair_user_topic_count();
    			//	$messages[] = bbp_admin_repair_user_reply_count(); 
    			 
    							
    				$messageori = sprintf( _n( 'Topic déplacé.', '%s topics déplacés.', $_REQUEST['deplacer'] ), number_format_i18n( $_REQUEST['deplacer'] ) );
    			
    				foreach ($messages as $message){
    					echo'<div class=\"updated\"><p>'.$message[1].'</p></div>';
    				
    				}		
    				echo "<div class=\"updated\"><p>{$messageori}</p></div>";	
    
    		
    	}
    }
     	
    
    ?>
    

    Do you think this is a right way? Is there a way to improve it?

    I thank you in advance

    Regards

    Mei Ling

    @mei-ling

    Participant

    Hello,

    We have done this… we are still testing it. Be careful use VPS:

    <?php

    /**
    * Now that you have your custom column, it’s bulk/quick edit showtime!
    * The filters are ‘bulk_edit_custom_box’ and ‘quick_edit_custom_box’. Both filters
    * pass the same 2 arguments: the $column_name (a string) and the $post_type (a string).
    *
    * Your data’s form fields will obviously vary so customize at will. For this example,
    * we’re using an input. Also take note of the css classes on the <fieldset> and <div>.
    * There are a few other options like ‘inline-edit-col-left’ and ‘inline-edit-col-center’
    * for the fieldset and ‘inline-edit-col’ for the div. I recommend studying the WordPress
    * bulk and quick edit HTML to see the best way to layout your custom fields.
    */
    add_action( ‘bulk_edit_custom_box’, ‘manage_wp_posts_be_qe_bulk_quick_edit_custom_box’, 10, 2 );
    //add_action( ‘quick_edit_custom_box’, ‘manage_wp_posts_be_qe_bulk_quick_edit_custom_box’, 10, 2 );
    function manage_wp_posts_be_qe_bulk_quick_edit_custom_box( $column_name, $post_type ) {

    switch ( $post_type ) {
    case ‘topic’:
    switch( $column_name ) {
    case ‘bbp_topic_forum’:
    ?><fieldset class=”inline-edit-col-left”>
    <div class=”inline-edit-col”>
    <label>
    <span class=”title”>Deplacer dans le forum</span>
    <span class=”input-text-wrap”>
    <select name=”deplacer”>
    <option value=”Null”></option>
    <?php /* recuperation des forums “forum” */
    $args = array(
    // ‘post_parent__not_in’=> array( 0 ) ,
    ‘post_type’ => ‘forum’
    );
    $forums = new WP_Query( $args );
    // boucle de test affiche en debug id et titre forum
    if ( $forums->have_posts() ) {
    while ( $forums->have_posts() ) {
    $forums->the_post();
    echo ‘<option value=”‘.$forums->post->ID.'”>’.get_the_title() . ‘</option>’ ;
    }
    }
    wp_reset_postdata();?>

    </select>
    </span>
    </label>
    </div>
    </fieldset><?php
    break;
    }
    break;
    }
    }

    /**
    * When you click ‘Quick Edit’, you may have noticed that your form fields are not populated.
    * WordPress adds one ‘Quick Edit’ row which moves around for each post so the information cannot
    * be pre-populated. It has to be populated with JavaScript on a per-post ‘click Quick Edit’ basis.
    *
    * WordPress has an inline edit post function that populates all of their default quick edit fields
    * so we want to hook into this function, in a sense, to make sure our JavaScript code is run when
    * needed. We will ‘copy’ the WP function, ‘overwrite’ the WP function so we’re hooked in, ‘call’
    * the original WP function (via our copy) so WordPress is not left hanging, and then run our code.
    *
    * Remember where we wrapped our column data in a <div> in Step 2? This is where it comes in handy,
    * allowing our Javascript to retrieve the data by the <div>’s element ID to populate our form field.
    * There are other methods to retrieve your data that involve AJAX but this route is the simplest.
    *
    * Don’t forget to enqueue your script and make sure it’s dependent on WordPress’s ‘inline-edit-post’ file.
    * Since we’ll be using the jQuery library, we need to make sure ‘jquery’ is loaded as well.
    *
    * I have provided several scenarios for where you’ve placed this code. Simply uncomment the scenario
    * you’re using. For all scenarios, make sure your javascript file is in the same folder as your code.
    */
    add_action( ‘admin_print_scripts-edit.php’, ‘manage_wp_posts_be_qe_enqueue_admin_scripts’ );
    function manage_wp_posts_be_qe_enqueue_admin_scripts() {

    // if code is in theme functions.php file
    wp_enqueue_script( ‘manage-wp-posts-using-bulk-quick-edit’, trailingslashit( get_bloginfo( ‘stylesheet_directory’ ) ) . ‘js/bulk_quick_edit.js’, array( ‘jquery’, ‘inline-edit-post’ ), ”, true );

    // if using code as plugin
    //wp_enqueue_script( ‘manage-wp-posts-using-bulk-quick-edit’, trailingslashit( plugin_dir_url( __FILE__ ) ) . ‘js/bulk_quick_edit.js’, array( ‘jquery’, ‘inline-edit-post’ ), ”, true );

    }

    add_action( ‘save_post’, ‘save_deplacer’);
    function save_deplacer() {
    global $wpdb;

    if( $_GET[‘post_type’]=’topic’ && $_GET[‘bulk_edit’]=’Mettre à jour’){

    $post_ids= $_GET[‘post’];
    $forum_id = $_GET[‘deplacer’];
    foreach($post_ids as $post_id){

    $wpdb->query(“UPDATE $wpdb->posts SET post_parent = $forum_id WHERE ID = $post_id “);
    }
    }
    }
    /*echo ‘

    ';
    	print_r($post_type);
    	echo '

    ‘;
    die();

    Array
    (
    [s] =>
    [post_status] => all
    [post_type] => topic
    [_wpnonce] => dcfdf56a2d
    [_wp_http_referer] => /public/wptest/wp-admin/edit.php?post_type=topic&paged=1
    [action] => edit
    [m] => 0
    [bbp_forum_id] =>
    [paged] => 1
    [mode] => excerpt
    [_status] => -1
    [tax_input] => Array
    (
    [topic-tag] =>
    )

    [Deplacer] => 39
    [bulk_edit] => Mettre à jour
    [post_view] => excerpt
    [screen] => edit-topic
    [post] => Array
    (
    [0] => 43
    [1] => 41
    )

    [action2] => -1
    )*/

    /**
    * Step 3: display an admin notice on the Posts page after deplacer
    */
    add_action(‘admin_notices’, ‘custom_bulk_admin_notices’);
    function custom_bulk_admin_notices() {
    global $post_type, $pagenow ;

    if( $_GET[‘post_type’]=’topic’ && $_GET[‘bulk_edit’]=’Mettre à jour’){

    $messages = array();
    $messages[] = bbp_admin_repair_forum_meta();
    $messages[] = bbp_admin_repair_topic_meta();
    $messages[] = bbp_admin_repair_freshness();
    $messages[] = bbp_admin_repair_reply_menu_order();
    $messages[] = bbp_admin_repair_forum_topic_count();
    $messages[] = bbp_admin_repair_forum_reply_count();
    $messages[] = bbp_admin_repair_topic_reply_count();
    $messages[] = bbp_admin_repair_topic_voice_count();
    $messages[] = bbp_admin_repair_user_topic_count();
    $messages[] = bbp_admin_repair_user_reply_count();

    //if($pagenow == ‘edit.php’ && $post_type == ‘topic’ && isset($_GET[‘deplacer’])) {

    $messageori = sprintf( _n( ‘Topic déplacé.’, ‘%s topics déplacés.’, $_REQUEST[‘deplacer’] ), number_format_i18n( $_REQUEST[‘deplacer’] ) );

    foreach ($messages as $message){
    echo'<div class=\”updated\”><p>’.$message[1].'</p></div>’;
    }
    echo “<div class=\”updated\”><p>{$messageori}</p></div>”;
    }
    }

    ?>

    @mei-ling

    Participant

    Hi,

    I thank you Robkk. But how can I see the content a post flagged as spam by Akismet?

    In reply to: SMF Import Help Needed

    @mei-ling

    Participant

    However, I am still having the same issues many replies and topics are being left off. After the conversion I ran all the applicable repair tools in the importer but still no change.

    Do you have any other suggestions?

    We met the same issue. Check your url. Delete each signs: ” , ?, …, etc. The topic are imported but not showed because of “bad url”.

    @mei-ling

    Participant

    If your theme gets a breadcrumb, then disable Yoast’s one. You may have two breadcrumb:

    First ==> WordPress
    Second==> BBPress

    You do this:

    */
    function tempera_breadcrumbs1() {
    	$temperas= tempera_get_theme_options();
    	foreach ($temperas as $key => $value) { ${"$key"} = $value ; }
    	global $post;
    	$separator = "<i class='icon-angle-right'></i> ";
    	
     if( !is_bbpress()){	
    	
    	if (is_page() && !is_front_page() || is_single() || is_category() || is_archive()) {
    		echo '<div class="breadcrumbs">';
            echo '<a href="'.home_url().'"><i class="icon-homebread"></i></a>'.$separator ;
            if (is_page()) {
    
    			$ancestors = get_post_ancestors($post);
                if ($ancestors) {
    
    				$ancestors = array_reverse($ancestors);
                    foreach ($ancestors as $crumb) {
                        echo '<a href="'.get_permalink($crumb).'">'.get_the_title($crumb).$separator.'</a>';
                    }
                }
            }
            if (is_single()) {
    			if (has_category()) {
    				$category = get_the_category();
    				echo '<a href="'.get_category_link($category[0]->cat_ID).'">'.$category[0]->cat_name.$separator.'</a>';
    			}
            }
            if (is_category()) {
                $category = get_the_category();
                echo ''.$category[0]->cat_name.'';
            }		
    		if (is_tag()) {
    			echo ''.__('Tag','tempera').''.$separator.single_tag_title('', false);
    		} 
            // Current page
            if (is_page() || is_single()) {
                echo ''.get_the_title().'';
            }
           echo '</div>';
        }
    	elseif (is_home() && $tempera_frontpage!="Enable" ) {
            // Front page
            echo '<div class="breadcrumbs">';
            echo '<a href="'.home_url().'"><i class="icon-homebread"></i></a> '.$separator;
            _e('Home Page','tempera');
            echo '</div>';
        }
     }	
    } // tempera_breadcrumbs()
    add_action('after_setup_theme','remove_fonction_parent2');
    function remove_fonction_parent2() {
       remove_action('cryout_before_content_hook','tempera_breadcrumbs');
       add_action ('cryout_before_content_hook','tempera_breadcrumbs1');
    }
    /*

    You have to change the information about your theme.

    @mei-ling

    Participant

    I’ve done it. It’s just perfect and I never drink. Thks Robkk 🙂

    @mei-ling

    Participant

    I got it! The picture is not displayed and that’s good. I want to use this feature to manage what is shared.
    Thank you

    Regards

    Mei Ling

    @mei-ling

    Participant

    Hi Robkk,

    I have tested your code. Well I can select in the admin panel “edit topic” or “new topic” “featured image”, I select the picture…when I turn back to the topic, no picture. It doesn’t remain selected.
    I use the latest WordPress: 4.30.

    Could you help me?

    I thank you in advance

    Mei Ling

    In reply to: SMF Import to bbPress

    @mei-ling

    Participant

    Thank you for this importer. It allows us to do a great job without any problem.

    Mei Ling

    In reply to: Check box

    @mei-ling

    Participant

    I am a newbie. I have seen functions in the codex I’d like to activate: site of the member or limit the access to the admin panel, etc.
    Do we have to add the functions to the child theme or in the core of bbpress. Is there a more intuitive way to do such a thing.
    We do not want a lot of plugin.

    I thank you for your feedback

    Mei-Ling

    @mei-ling

    Participant

    You can use this plugin: Author Avatars List.

    In reply to: Image

    @mei-ling

    Participant

    I thank you.

    In reply to: SMF Import to bbPress

    @mei-ling

    Participant

    Hi timsilva_

    We have the same issue.
    SMF = we have created a user : “Guest” All the posts were attribute to “Guest”.
    Import = a new member “Guest”.

    The other solution:

    If “keymaster” has no post
    Create an account “guest”
    Create a new “keymaster”
    Delete the previous “keymaster” attribute post to guest.

    In reply to: SMF Import to bbPress

    @mei-ling

    Participant

    Yes bbcode. We use “Aeva media”

Viewing 17 replies - 1 through 17 (of 17 total)