Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 6,626 through 6,650 (of 32,519 total)
  • Author
    Search Results
  • #173570
    LeGuerg
    Participant

    Hello,

    I get an issue with the bbPress capabilities. My forum Participants are set with edit_replies, delete_replies, edit_topics, delete_topics capabilities, but they can not delete their own posts because the links are not displayed. Keymasters and Moderators have no problem since they are moderators on the whole forum.

    So I checked the code in ./includes/topics/capabilities.php and includes/replies/capabilities.php and added the code below to fix the issue:

    ./includes/topics/capabilities.php, line 174 and
    ./includes/replies/capabilities.php, line 156

    // Moderators can always edit forum content
    	} elseif ( user_can( $user_id, 'moderate' ) ) {
    		$caps[] = 'moderate';
    					
    // -------------------------------- 
    // User is author so allow edit if not in admin
    	} elseif ( !is_admin() && ( (int) $user_id === (int) $_post->post_author ) ) {
    	        $caps[] = $post_type->cap->delete_posts;
    // --------------------------------
    					
    // Unknown so map to delete_others_posts

    So my question is: is this intended ? Otherwise is there a fix planned for a next update?
    Thank you for your help.
    Regards.

    #173567

    In reply to: Reverse Title Order

    Pascal Casier
    Moderator

    Hi,
    Copy this code into your functions.php:

    function casiepa_bbp_has_topics() {
      $args['order'] = 'ASC'; // 'ASC' (Ascending), 'DESC' (Descending, Default)
      return $args;
    }
    add_filter('bbp_before_has_topics_parse_args', 'casiepa_bbp_has_topics' );

    Pascal.

    #173562
    Robin W
    Moderator

    you need header.php
    not the body part of the code

    #173554
    stewmills
    Participant

    Tried the CSS route and could not get it to work.

    So, in looking at Robin W suggestion I could not locate the exact section to wrap. I could not locate <div class=”header-area”> with a closing of </div>. Here is what I have (starting with the body section of my page code)

    <body <?php body_class(); ?>>
    <?php if ( 'true' == $boxedlayout ) {echo '<div id="tt-boxed-layout">';}else{echo '<div id="tt-wide-layout">';} ?>
    <div id="wrapper" <?php if (is_page_template('template-homepage-3D.php') || is_page_template('template-homepage-jquery-2.php')) {echo 'class="big-banner"';} ?>>
    <div id="header" <?php if (is_page_template('template-homepage-3D.php')){echo "style='height: 560px;'";} ?>>
    <?php 
    // show the toolbar if selected by the user :
    if ($ka_toolbar == "true"): 
    ?>
    <div class="top-block">
    <div class="top-holder">
    
      <?php truethemes_before_top_toolbar_menu_hook();// action hook, see truethemes_framework/global/hooks.php ?>
      <?php if(has_nav_menu('Top Toolbar Navigation')): ?>
      <div class="toolbar-left">  
      <ul>
      <?php wp_nav_menu(array('theme_location' => 'Top Toolbar Navigation' , 'depth' => 0 , 'container' =>false )); ?>
      </ul>
      </div><!-- end toolbar-left -->
    
      <?php
      //if top toolbar menu not set, we show dynamic sidebar  
      elseif(is_active_sidebar(1)): 
      ?>
      <div class="toolbar-left">  
      <ul><?php dynamic_sidebar("Toolbar - Left Side"); ?></ul>
      </div><!-- end toolbar-left -->
      <?php endif; ?>
      
      <?php if(is_active_sidebar(2)): ?>
      <div class="toolbar-right">
      <?php dynamic_sidebar("Toolbar - Right Side"); ?>
      </div><!-- end toolbar-right -->
      <?php endif; ?>
    
    <?php truethemes_after_top_toolbar_menu_hook();// action hook, see truethemes_framework/global/hooks.php ?>
    </div><!-- end top-holder -->
    </div><!-- end top-block -->
    <?php endif; //end if($toolbar == 'true') ?>
    
    <?php truethemes_before_header_holder_hook();// action hook, see truethemes_framework/global/hooks.php ?>
    <div class="header-holder">
    <div class="rays">
    <div class="header-area<?php if (is_search()) {echo ' search-header';} ?><?php if (is_404()) {echo ' error-header';} ?><?php if (is_page_template('template_sitemap.php')) {echo ' search-header';} ?>">
    
    <?php // Website Logo
    if ($ka_logo_text == ''){
    ?>
    <a href="<?php echo home_url(); ?>" class="logo"><img src="<?php echo $ka_sitelogo; ?>" alt="<?php bloginfo('name'); ?>" /></a>
    <?php }else{?>
    <a href="<?php echo home_url(); ?>" class="custom-logo"><img src="<?php echo get_template_directory_uri(); ?>/images/_global/<?php echo $ka_logo_icon; ?>" alt="<?php bloginfo('name'); ?>" /><span class="logo-text"><?php echo $ka_logo_text; echo '</span></a>';}?>
    
    <?php truethemes_before_primary_navigation_hook();// action hook, see truethemes_framework/global/hooks.php ?>
    <?php if(has_nav_menu('Primary Navigation')): ?>
    <nav>
    <ul id="menu-main-nav">
    <?php wp_nav_menu(array('theme_location' => 'Primary Navigation' , 'depth' => 0 , 'container' =>false , 'walker' => new description_walker() )); ?>
    </ul>
    </nav>
    <?php endif; ?>
    
    <?php truethemes_after_primary_navigation_hook();// action hook, see truethemes_framework/global/hooks.php ?>
    #173552
    Pascal Casier
    Moderator

    Add this in your functions.php or in a plugin:

    add_filter( 'manage_edit-forum_columns', 'casiepa_edit_forum_column' ) ;
    function casiepa_edit_forum_column( $columns ) {
    	$columns['id'] = __('ID');
    	return $columns;
    }
    
    add_action('manage_forum_posts_custom_column', 'casiepa_manage_forum_columns', 10, 2);
    function casiepa_manage_forum_columns($column_name, $id) {
        global $wpdb;
        switch ($column_name) {
        case 'id':
            echo $id;
                break;
        default:
            break;
        } // end switch
    }   
    

    It will add the ID column when you go in your Dashboard to ‘Forums’.
    Pascal.

    #173550
    Wendell
    Participant

    I reset the forum, then upgraded to bbpress 2.6 alpha, checked the “purge previous import” checkbox (just to be sure), then started the import process again and got this lovely error message:

    “WordPress database error: [Specified key was too long; max key length is 1000 bytes]
    CREATE TABLE blp_bbp_converter_translator ( meta_id mediumint(8) unsigned not null auto_increment, value_type varchar(25) null, value_id bigint(20) unsigned not null default ‘0’, meta_key varchar(255) null, meta_value varchar(255) null, PRIMARY KEY (meta_id), KEY value_id (value_id), KEY meta_join (meta_key, meta_value) ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci”

    So I unchecked the purge option and tried again. It’s currently importing the users.

    #173536
    Stephen Edgar
    Keymaster

    I’m guessing the sync-all-reply-positions fails because of some incorrect meta for the replies, theres also a few known issues with this tool timing out when used on sites with lots of replies.

    The user-role-map repair tool should work fine, no known issues with this one.

    What happens if you create a new user, just a new WordPress user, can that user login, create topics and replies etc? What happens if you now remove all the imported users and run this repair tool again, theoretically it would only be running on “native” WordPress users and not any imported users, (i.e. “admin” and “test user” only), does the repair tool still fail?

    #173533
    Stephen Edgar
    Keymaster

    @eoppegaard The database actually needs to be active in the same MySQL server your WordPress site is running on, not the same database, just available as a database in the MySQL server. Uploading the MySQL .sql dump file or phpBB files to yor site will have no effect and will not work.

    Some of the docs here might also help you out.


    @evildrome
    It might be easy for you, it’s not for me, if it was I’d have done it, if you’d be able to help out and help with some code for a solution to that that would be awesome.

    Stephen Edgar
    Keymaster

    There is a known issue with the Recalculate the position of each reply repair tool, even once it times out can you run it again? In theory the tool is working correctly but on larger batches it times out, running it again resumes from where it left off.

    Stephen Edgar
    Keymaster

    Any chance you could talk to your webhost and have the MySQL version updated?

    WordPress’ minimum requirements per https://wordpress.org/about/requirements/ are WordPress also works with PHP 5.2.4+ and MySQL 5.0+ which you are using but I suspect the phpMyAdmin warning Your PHP MySQL library version 5.1.49 differs from your MySQL server version 5.0.51a. you see are probably related to this issue.

    If your vBulletin database uses utf8_mb4 but your WordPress install is only using utf8 then you’ll run into issues. As Pascal pointed out with that link, you are using MySQL v5.0.x which doesn’t support utf8_mb4, only MySQL v5.5.3 and above does.

    If the vBulletin database used utf8 rather than utf8mb4 then I’d expect the import to work just fine, but because of the different character sets and collation differences the only way around this I see is to resolve this by upgrading to at least MySQL v5.5.3.

    #173530
    Stephen Edgar
    Keymaster

    For sure this would be related to the character set used.

    Have you installed WordPress using the Greek language pack?

    Any chance you could install WordPress using the same character set as the character set used by your Greek vBulletin install and try importing? Or maybe converting your vBulletin database to use a utf8 database?

    New WordPress installs use the character set utf8_general_ci, previously WordPress would use utf8, the Greek locale your vBulletin install is using

    pattz2016
    Participant

    I am using BBpress recent topic widget and i reaslied that it only gives me an option of adding topic author and date. How can i add the recent answers category like it is on this forum? Is there a Plugin for that? If there is not, is there a code i can fix in my templates to get this fuctionality?

    Many thanks,

    #173517
    elovkoff
    Participant

    Hi Rob, thanks for the advice. And thanks to everybody else who took the time to chime in.
    You said: “Also I cannot seem to find the code in the bbPRess plugin responsibe for the no redirect to post after submit after using using this code.”
    Anny pointers where would I look for it, or should I hire a dev to do that?

    When you refer to inline image upload – is that something that would require users to know how to use img html tags? Will it allow multiple image upolads too?

    Thank you.
    Elijah.

    TKServer
    Participant

    Ok @tech55541 I’ve just added a short code option! See if you can get it to work!

    https://wordpress.org/plugins/tk-bbpress-stats/

    TKServer
    Participant

    Nice plugin you created. Do you think it would be possible to create shortcodes in the next update? My theme is so old it does not have widget areas LOL.

    Thanks, cool plugin BTW.

    That’s an interesting suggestion. It would not be hard but for the settings. Since the widget settings are set inside the widget itself, I’d have to redo the settings and make them part of the plugin settings.

    I’ll see what I can do…

    tech55541
    Participant

    Hey @tkserver,
    Nice plugin you created. Do you think it would be possible to create shortcodes in the next update? My theme is so old it does not have widget areas LOL.

    Thanks, cool plugin BTW.

    tech55541
    Participant

    Hello,
    It is more than likely custom coded.

    Thanks.

    #173498
    olliewe88
    Participant

    hi again @robin-w

    Ok so I have put the code below in the functions.php

    function add_new_roles( $bbp_roles )
    {
    /* role the new role*/
    $bbp_roles[‘bbp_Facepainter’] = array(
    ‘name’ => ‘Facepainter’,
    ‘capabilities’ => custom_capabilities( ‘bbp_Facepainter’ )
    );

    return $bbp_roles;
    }

    add_filter( ‘bbp_get_dynamic_roles’, ‘add_new_roles’, 1 );

    function add_role_caps_filter( $caps, $role )
    {
    /* Only filter for roles we are interested in! */
    if( $role == ‘bbp_Facepainter’ )
    $caps = custom_capabilities( $role );

    return $caps;
    }

    add_filter( ‘bbp_get_caps_for_role’, ‘add_role_caps_filter’, 10, 2 );

    function custom_capabilities( $role )
    {
    switch ( $role )
    {

    /* Capabilities for ‘Facepainter’ role */
    case ‘bbp_Facepainter’:
    return array(
    // Primary caps
    ‘spectate’ => true,
    ‘participate’ => true,
    ‘moderate’ => false,
    ‘throttle’ => false,
    ‘view_trash’ => false,

    // Forum caps
    ‘publish_forums’ => false,
    ‘edit_forums’ => false,
    ‘edit_others_forums’ => false,
    ‘delete_forums’ => false,
    ‘delete_others_forums’ => false,
    ‘read_private_forums’ => true,
    ‘read_hidden_forums’ => false,

    // Topic caps
    ‘publish_topics’ => true,
    ‘edit_topics’ => true,
    ‘edit_others_topics’ => false,
    ‘delete_topics’ => false,
    ‘delete_others_topics’ => false,
    ‘read_private_topics’ => true,

    // Reply caps
    ‘publish_replies’ => true,
    ‘edit_replies’ => true,
    ‘edit_others_replies’ => false,
    ‘delete_replies’ => false,
    ‘delete_others_replies’ => false,
    ‘read_private_replies’ => true,

    // Topic tag caps
    ‘manage_topic_tags’ => false,
    ‘edit_topic_tags’ => false,
    ‘delete_topic_tags’ => false,
    ‘assign_topic_tags’ => true,
    );

    break;

    default :
    return $role;
    }
    }}

    However, it is still not working. It shows when I go to Users,user,Forum Role and set it to facepainter but when I save it, it still doesn’t set their fourm role to face painter?!

    Thanks for you help

    #173495
    Robin W
    Moderator

    the code is additional and goes in your functions.php

    see

    Functions files and child themes – explained !

    #173492
    tech55541
    Participant

    Hello,
    That code worked great. Could you please help me make another view for solved topics?

    I almost did it myself, but I do not know what or how to find the meta_value that I need.

    Thanks for your help.

    #173489
    tech55541
    Participant

    @robkk, I am quite a new coder, I will have to test it later and figure out what is wrong.

    Thanks.

    #173487
    olliewe88
    Participant

    Custom Capabilities

    Thank you however for the link above where do you find the code to edit @robin-w

    #173484
    Robin W
    Moderator
    #173481
    Robkk
    Moderator

    You can create a custom view, use this shortcode in a page [bbp-single-view id='unresolved'], then just link to it in a menu or use the views widget bbPress provides.

    function rkk_register_unresolved_view() {
     	bbp_register_view( 'unresolved', __( 'Unresolved Topics' ), array( 'meta_key' => 'bbr_topic_resolution', 'meta_value' => '2', 'orderby' => 'post_date', 'post_status' => 'publish' ), false );
     }
     add_action( 'bbp_register_views', 'rkk_register_unresolved_view' );
    #173480
    Pascal Casier
    Moderator
Viewing 25 results - 6,626 through 6,650 (of 32,519 total)
Skip to toolbar