Search Results for 'code'
-
AuthorSearch Results
-
April 18, 2016 at 11:13 pm #174192
nateonawalk
ParticipantHad 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->IDfrom 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?April 18, 2016 at 7:58 pm #174188Topic: Function to get Favorite and Subscribe link
in forum Showcasetech55541
ParticipantHello,
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. 🙂
April 18, 2016 at 2:51 pm #174184In reply to: Content warning if posts contain certain words
John James Jacoby
KeymasterIt’s actually much easier than this.
If you set words, phrases, or IP addresses in your
Settings > Discussionsof WordPress’s admin, bbPress will adhere. Whatever you use for WordPress comments, also works for bbPress topics & replies.Hope that’s helpful!
April 18, 2016 at 11:11 am #174182In reply to: All in One SEO Pack – error
Krzysztof
ParticipantCreators 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')){April 18, 2016 at 3:57 am #174165In reply to: Vedrtical Forum Titles
Pascal Casier
ModeratorGreat. 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.
April 18, 2016 at 2:28 am #174158In reply to: Formatting not loading
brhahlen
ParticipantIf 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.
April 17, 2016 at 12:49 pm #174153In reply to: Content warning if posts contain certain words
Anonymous User
InactiveHello,
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
April 17, 2016 at 11:45 am #174151In reply to: Create new forum topic from a WP post?
Anonymous User
InactiveHello, 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,
SamuelApril 16, 2016 at 7:30 am #174139In reply to: Hide top pagination
kieranw7261
ParticipantHi 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
April 16, 2016 at 3:34 am #174138In reply to: Hide top pagination
Pascal Casier
ModeratorHi,
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.
April 15, 2016 at 10:12 am #174126In reply to: BBpress login doesn´t work
Pascal Casier
ModeratorSomething 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” class=”bbp-login-form”>Please try to fix that first (no idea where it comes from, but for sure it’s not bbPress.
Pascal.
April 15, 2016 at 10:03 am #174125Topic: BBpress login doesn´t work
in forum TroubleshootingTapirk
ParticipantWhen 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.
April 14, 2016 at 3:30 pm #174100Manuel Fritsch
ParticipantThank 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
ManuelApril 14, 2016 at 2:54 pm #174098In reply to: Custom change password page
Pascal Casier
ModeratorOK, now I see !
How about[bbp-lost-pass]?
Check out https://codex.bbpress.org/features/shortcodes/Pascal.
April 14, 2016 at 2:52 pm #174097In reply to: Info Forum Index
Pascal Casier
ModeratorYes, 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 tabBut read the rest too.
Pascal.April 14, 2016 at 11:42 am #174084In reply to: Custom change password page
j_mo
ParticipantHi 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
April 14, 2016 at 9:03 am #174074Topic: Topic form issue
in forum Troubleshootingcigar07
ParticipantHi,
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?
April 14, 2016 at 8:20 am #174073In reply to: User Info Column too Narrow
officerofthewatch
Participantsolved with the following custom CSS
#bbpress-forums div.reply { height: auto; width: inherit !Important; }April 14, 2016 at 7:03 am #174072Topic: Custom change password page
in forum Troubleshootingj_mo
ParticipantHi there,
Is there a shortcode, plugin or script that will allow me to create a custom change password page?
I have created custom reg, login and lost password pages but can’t find any documentation on the change password page.
Thanks
April 14, 2016 at 4:31 am #174061In reply to: Change SMTP settings for BBPress
Pascal Casier
ModeratorI fully understand the need for the SMTP plugin, I think we should all use it !
But I meant that if your standard FROM is changed, it probably means that there is another plugin somewhere manipulating it.
I had similar issues in the beginning and that why I switched to the other SMTP plugin mentioned above, but with this code, it should work too.
Pascal.April 14, 2016 at 4:29 am #174060In reply to: Avatar issue
Pascal Casier
ModeratorHi,
That seems like a CSS issue, but I would need a link to the site to be able to provide you the correct code.
Pascal.April 13, 2016 at 6:07 pm #174052In reply to: Change SMTP settings for BBPress
Pascal Casier
ModeratorTHat code should work ! I used it about 2 years ago for a quick fix.
But if you need this code, it means there is somewhere a plugin that is doing strange things !April 13, 2016 at 5:23 pm #174050In reply to: Print bbp_forum_title() inside/before topic title?
HoggeHog
ParticipantSo I’ve got
<?php do_action( 'bbp_theme_before_topic_title' ); ?><span class="bbp-topic-started-in"><?php printf( __('%2$s', 'bbpress' ), bbp_get_forum_permalink( bbp_get_topic_forum_id() ), bbp_get_forum_title( bbp_get_topic_forum_id() ) ); ?></span>
And if the forum id equals 8397, I want to assign a different class to it…
<?php if ( bbp_get_topic_forum_id() == 8397 )But I’m a bit stuck here. Any suggestions?
April 13, 2016 at 5:06 pm #174049In reply to: Print bbp_forum_title() inside/before topic title?
HoggeHog
ParticipantSo I figured out how to do it, now I’m trying to color-code every forum.
April 13, 2016 at 3:43 pm #174047In reply to: Change SMTP settings for BBPress
tech55541
ParticipantHello,
I found some working code, could you please just check it to make sure it is 100% valid and I am not missing anything?/*BBPress email fix*/ add_filter( 'wp_mail_from_name', 'email_sent_from_name' ); function email_sent_from_name( $name ) { return 'SITE NAME'; } add_filter( 'wp_mail_from', 'email_sent_from' ); function email_sent_from( $email ) { return 'email@example.com'; }Yes, I did replace the values with required ones such as the address and send from name.
Thanks.
-
AuthorSearch Results