Search Results for 'code'
-
AuthorSearch Results
-
March 29, 2016 at 5:39 am #173570
Topic: Delete own posts
in forum TroubleshootingLeGuerg
ParticipantHello,
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_postsSo my question is: is this intended ? Otherwise is there a fix planned for a next update?
Thank you for your help.
Regards.March 29, 2016 at 4:39 am #173567In reply to: Reverse Title Order
Pascal Casier
ModeratorHi,
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.
March 29, 2016 at 3:29 am #173562In reply to: hide Home Menu on bbPress pages
Robin W
Moderatoryou need header.php
not the body part of the codeMarch 28, 2016 at 6:09 pm #173554In reply to: hide Home Menu on bbPress pages
stewmills
ParticipantTried 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 ?>March 28, 2016 at 5:03 pm #173552In reply to: Create similar topics to several forums at once
Pascal Casier
ModeratorAdd 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.March 28, 2016 at 2:47 pm #173550In reply to: Importing Large Xenforo Forum
Wendell
ParticipantI 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.
March 28, 2016 at 9:05 am #173536In reply to: Documented import from snitz access database
Stephen Edgar
KeymasterI’m guessing the
sync-all-reply-positionsfails 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-maprepair 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?
March 28, 2016 at 8:46 am #173533In reply to: phpbb importer not finding forums
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
.sqldump 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.March 28, 2016 at 8:39 am #173532Stephen Edgar
KeymasterThere is a known issue with the
Recalculate the position of each replyrepair 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.March 28, 2016 at 8:37 am #173531Stephen Edgar
KeymasterAny 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 warningYour 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_mb4but your WordPress install is only usingutf8then you’ll run into issues. As Pascal pointed out with that link, you are using MySQL v5.0.x which doesn’t supportutf8_mb4, only MySQL v5.5.3 and above does.If the vBulletin database used
utf8rather thanutf8mb4then 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.March 28, 2016 at 8:25 am #173530In reply to: Importing from vbulletin –> strange characters!
Stephen Edgar
KeymasterFor 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
utf8database?New WordPress installs use the character set
utf8_general_ci, previously WordPress would useutf8, the Greek locale your vBulletin install is usingMarch 28, 2016 at 2:10 am #173518pattz2016
ParticipantI 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,
March 28, 2016 at 1:41 am #173517In reply to: Uploading images without placing the text
elovkoff
ParticipantHi 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.March 27, 2016 at 8:57 pm #173509TKServer
ParticipantOk @tech55541 I’ve just added a short code option! See if you can get it to work!
March 27, 2016 at 4:24 pm #173505TKServer
ParticipantNice 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…
March 27, 2016 at 3:50 pm #173502tech55541
ParticipantHey @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.
March 27, 2016 at 3:46 pm #173501tech55541
ParticipantHello,
It is more than likely custom coded.Thanks.
March 27, 2016 at 2:20 pm #173498In reply to: How to change/create fourm roles
olliewe88
Participanthi 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
March 27, 2016 at 1:14 pm #173495In reply to: How to change/create fourm roles
Robin W
Moderatorthe code is additional and goes in your functions.php
see
March 27, 2016 at 11:16 am #173492In reply to: Add link to Unsolved topics
tech55541
ParticipantHello,
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.
March 27, 2016 at 10:24 am #173489In reply to: How to put the post box on top?
tech55541
Participant@robkk, I am quite a new coder, I will have to test it later and figure out what is wrong.
Thanks.
March 27, 2016 at 9:13 am #173487In reply to: How to change/create fourm roles
olliewe88
ParticipantThank you however for the link above where do you find the code to edit @robin-w
March 27, 2016 at 7:47 am #173484In reply to: How to change/create fourm roles
Robin W
ModeratorMarch 27, 2016 at 6:23 am #173481In reply to: Add link to Unsolved topics
Robkk
ModeratorYou 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' );March 27, 2016 at 5:38 am #173480In reply to: how to add specific left/right sidebar
Pascal Casier
ModeratorStarting from this can help : https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/#26-creating-a-bbpress-specific-sidebar
Pascal.
-
AuthorSearch Results