Search Results for 'code'
-
AuthorSearch Results
-
March 28, 2020 at 2:55 pm #209772
Topic: Display number of new posts/threads since last post?
in forum Installationthetoolman123
ParticipantHi there,
Is there a simple PHP code snippet that will display the number of new posts/threads a user has after the logo in? I’m looking to add a simple text displaying these figures after a user logs in?
If there is a snippet available, that would be great!
Thanks
March 28, 2020 at 2:28 pm #209769In reply to: Change forum default text
Robin W
ModeratorPut this in your child theme’s function file – or use
add_filter( 'ngettext', 'rew_bbpress_translate' , 20 , 5 ); function rew_bbpress_translate( $translation, $single, $plural, $number, $domain ) { if ($domain == 'bbpress') { if ($translation == 'Viewing %1$s topic') $translation = 'Viewing %1$s messages' ; if ($translation == 'Viewing %1$s topics') $translation = 'Viewing %1$s messages' ; if ($translation == 'Viewing topic %2$s (of %4$s total)') $translation = 'Viewing message %2$s (of %4$s total)' ; if ($translation == 'Viewing %1$s topics - %2$s through %3$s (of %4$s total)') $translation = 'Viewing %1$s messages - %2$s through %3$s (of %4$s total)' ; } return apply_filters ('rew_bbpress_translate', $translation, $single, $plural, $number, $domain ) ; }March 28, 2020 at 10:42 am #209762In reply to: Setting forums as my homepage
thetoolman123
ParticipantThank you, I have created a new page and a new template and now added in the shortcode via PHP:
<?php /* Template Name: HOMEPAGE */ /** * The template for displaying 404 pages (not found) * * @package olympus */ get_header(); ?> <?php echo do_shortcode("[bbp-forum-index]"); ?>Thanks again
March 28, 2020 at 10:31 am #209761In reply to: Setting forums as my homepage
Robin W
Moderatorcreate a homepage called anything you like.
then put this shortcode in it
[bbp-forum-index]March 28, 2020 at 5:23 am #209756In reply to: Which widget is this
Robin W
Moderator@sirlouen – thanks, I’ve incorporated all those changes in 4.4.2
Let me know if I missed anything
and thanks so much for helping me improve my plugin – as a one man developer/tester it’s hard to spot where code can be improved !
March 27, 2020 at 3:40 pm #209749In reply to: Which widget is this
Manuel Camargo
ParticipantAlso, I’m not sure if this is intended but similarly to the other elements this last two don’t have their “show-icon” class with
font-family: 'dashicons'; content: '\f155';and
font-family: 'dashicons'; content: '\f147';But could be included with this CSS code (I’ve included in my custom anyway but just to get the same format)
.sidebar .bsp-st-info-list li.topic-favorite:before { font-family: 'dashicons'; content: '\f155'; } .sidebar .bsp-st-info-list li.topic-subscribe:before, .sidebar .bsp-sf-info-list li.forum-subscribe:before { font-family: 'dashicons'; content: '\f147'; }About the other topic here the two snippets (I’m copying a little in the top and in the bottom:
Around 555
<?php if ( !empty( $time_since ) ) : ?> <li class="topic-freshness-time <?php echo $show_iconla ; ?> "> <?php echo $settings['last_activity']; echo $time_since ; ?></li> <?php endif; ?> <?php if ( is_user_logged_in() ) : ?> <?php $_topic_id = bbp_is_reply_edit() ? bbp_get_reply_topic_id() : $topic_id; ?> <li class="topic-subscribe"><?php bbp_topic_subscription_link( array( 'before' => '', 'topic_id' => $_topic_id ) ); ?></li> <li class="topic-favorite"><?php bbp_topic_favorite_link( array( 'topic_id' => $_topic_id ) ); ?></li> <?php endif; ?> <?php echo '</ul>' ; // end of '<ul class="bsp-st-info-list">; echo '</div>'; // end of '<div class="bsp-st-title-container">'; }Around 725
<li class="topic-freshness-time <?php echo $show_iconla ; ?> "> <?php echo $settings['last_activity']; echo $time_since ; ?></li> <?php endif; ?> <?php if ( is_user_logged_in() ) : ?> <li class="forum-subscribe"> <?php bbp_forum_subscription_link( array( 'forum_id' => $forum_id ) ); ?></li> <?php endif; ?> <?php echo '</ul>' ; echo '</div>' ; // end of <div class="bsp-st-title-container"> }March 27, 2020 at 3:28 pm #209748In reply to: Which widget is this
Robin W
Moderatorsorry I’m really busy at the moment – it would really help me if you could paste revised code 🙂
March 27, 2020 at 3:05 pm #209747In reply to: Which widget is this
Manuel Camargo
ParticipantAnother tweak (both for st and sf)
You could move from 556 to 562over the 555:
echo '</ul>' ; //end of '<ul class="bsp-st-info-list">'; ?>To have all “li” in the same “ul”
(Same in line 725)
Remember to close some of the
?>lingering afterwards 🙂March 27, 2020 at 2:42 pm #209745In reply to: Which widget is this
Manuel Camargo
Participant484 and 652
echo '<div class="widget bsp-st-title-container">';echo '<div class="widget bsp-sf-title-container">';March 26, 2020 at 4:57 pm #209720In reply to: Redirection after registration
Chuckie
ParticipantGreat! I also use Code Snippets for some things too. Well done.
March 26, 2020 at 4:52 pm #209719In reply to: Redirection after registration
ericsims
ParticipantHallelujah, it worked! Thank you so much!! I ended up using the Code Snippets plugin because I’m not super comfortable with php, child themes, etc.
March 26, 2020 at 2:48 pm #209717In reply to: TinyMCE will not display on site
007elt
ParticipantHi Annie, Thanks so much for your help and taking the time to write!!! I am going to try this. I also am not keen on adding any more plugins..I have too many already as it is. I am not a developer and don’t write code so it is really great when someone shares information like this.
All the best!March 26, 2020 at 2:19 pm #209716In reply to: TinyMCE will not display on site
AnnieBVT
ParticipantHi 007elt, After much searching and some testing I found a solution that converts the HTML version of the text editor into a basic TinyMCE editor. However, you must have FTP or cPanel access to the backend files in order to add code to your theme/child theme’s functions.php file. Otherwise a plugin is the only other resort, and I prefer not to load up on plugins.
If you have access, add these two code snippets. The first one will convert the text editor to a basic TinyMCE, and the second will strip out html code from content pasted into the text editor that was copied from another web page.
function bbp_enable_visual_editor( $args = array() ) {
$args[‘tinymce’] = true;
$args[‘quicktags’] = false;
return $args;
}
add_filter( ‘bbp_after_get_the_content_parse_args’, ‘bbp_enable_visual_editor’ );function bbp_tinymce_paste_plain_text( $plugins = array() ) {
$plugins[] = ‘paste’;
return $plugins;
}
add_filter( ‘bbp_get_tiny_mce_plugins’, ‘bbp_tinymce_paste_plain_text’ );And, if you want to get rid of the word “Private” that displays in the title of a forum that is set to private, put this code in your child theme’s functions.php file also:
function remove_private_prefix_from_title( $title ) {
return ‘%s’;
}
add_filter( ‘private_title_format’, ‘remove_private_prefix_from_title’ );March 26, 2020 at 1:12 pm #209712In reply to: Redirection after registration
Robin W
Moderatoror use
March 26, 2020 at 12:02 pm #209706In reply to: global auto unsubscribe method needed
Robin W
Moderatorthe problem is that there are dozens and dozens of membership plugins, each with its own bespoke code that it uses when members leave. Some will have a hook that a coder can link to, but it is specific to that plugin, some have no hook, so it can only be a manual process, or one linked to a daily routine.
Without knowing which membership plugin and knowing if it has a hook, it is impossible to answer this question.
in all cases it will be ‘custom code’ whether written by you or someone else 🙂
March 26, 2020 at 11:46 am #209705In reply to: global auto unsubscribe method needed
mrmillercoach
ParticipantI was wondering whether anyone had come up with a solution. This is not an unusual problem.
I did find this plugin https://en-gb.wordpress.org/plugins/bbp-toolkit/ which I will try.
I really do not want to generate custom code.
March 26, 2020 at 11:42 am #209704In reply to: global auto unsubscribe method needed
Robin W
Moderator@mrmillercoach – do you need help for you to code it, or someone to code it for you ?
March 25, 2020 at 2:51 pm #209690robertstaddon
ParticipantThis typo still exists, which continues to publicly display Private or Scheduled sticky posts in the latest version of bbPress 2.6.4.
It can be easily fixed by correcting line 404 of the “bbpress/includes/topics/template.php” file to set $sticky_query[‘perm’] instead of $sticky_query[‘post_status’].
This is the correct code that works:
// Allowed statuses, or lean on the 'perm' argument (probably 'readable') $sticky_query['perm'] = bbp_get_view_all( 'edit_others_topics' ) ? $r['post_status'] : $r['perm'];March 24, 2020 at 2:15 pm #209661In reply to: How can I create new user groups in bbpress?
Robin W
ModeratorMarch 24, 2020 at 6:08 am #209656In reply to: BBpress 2.6.1 translations issue
Robin W
ModeratorPut this in your child theme’s function file – or use
add_filter( 'gettext', 'rew_bbpress_translate', 20 , 3 ); add_filter( 'ngettext', 'rew_bbpress_translate' , 20 , 3 ); function rew_bbpress_translate( $translated, $text, $domain ) { if ($domain == 'bbpress') { $words = array( '%s day' => '%s jour', '%s days' => '%s jours', 'Last Post' => 'Dernier message', ); $translated = str_replace( array_keys($words), $words, $translated ); } return $translated; }March 24, 2020 at 2:42 am #209646oibc
Participant@jack_tyler
@wpweaver
I have the same and other problem.
would you pls help me?I am wondering if is there any existing feature on the BBPress to have a login, register, forgot password, email confirmation only in front-end? I know that there are [bbp-login], [bbp-register], and [bbp-lost-pass] short-codes that you can place in the page so that it will display on the front-end but the issue is when user enters an incorrect password or account, it will redirect to admin login. What I wanted is to stay always in the front-end. Or do you have any suggestion what plugin I can use that and compatible?
I like plugin “Weaver for bbPress” .
but some problems happens after I installed the plugin “Weaver for bbPress” .
May I ask?
1.It is OK that a new user(registered) logged in from frontend,and hide the wp-admin. But after logout ,”Sorry, you don’t have permission to view this profile.”shown on http://mysite.com/forums/users/oi/subscriptions/?loggedout=true
2. It is OK that admin logged in from frontend. But after logout ,”Sorry, you don’t have permission to view this profile.”shown on http://mysite.com /forums/users/oi/subscriptions/?loggedout=true .
3. when user enters an incorrect password or account, it will redirect to admin login.What I wanted is to stay always in the front-end. Or do you have any suggestion what plugin I can use that and compatible?
March 23, 2020 at 6:44 pm #209642winchester234
ParticipantHi,
My issue is that when I add the forum root at the forum settings, the page displays the following error in the header and the footer of the page:
Notice: Undefined property: WP_Post_Type::$post_type in /home1/smilingsun/public_html/vanlifemagazine.co/wp-content/plugins/td-composer/includes/shortcodes/vc_row.php on line 415
The page is at:
The theme I’m currently using is Newspaper by TagDiv.
Many thanks,
FrancescoMarch 23, 2020 at 9:04 am #209626In reply to: Threaded Replies – Still not working
levangelista2013
ParticipantSame problem: not possibile to replay to a replay. I get a message saying (I translate from Italian) ‘you don’t have the permissions. the variable does not match’. As I am unable to deal with the code, I will use a different plugin.
March 23, 2020 at 6:01 am #209618Topic: bbPress Required Profile Fields – What’s the code?
in forum Troubleshootingdrjohndimi
ParticipantI have searched online for days and I have not found how to make profile fields mandatory/required by users so that if they don’t complete those fields they cannot use the forum.
I’m sure there are code ninjas out there that have done this in their sleep or just know how to do it, so can you please the code and where to find/replace them?
Thank you so much.
JD
– If I have my way, I’d rather not have yet another plugin installed for this. Thanks.March 22, 2020 at 5:56 pm #209609In reply to: BBPress Notifications not Clearing Up
adishor22
ParticipantI have this problem too, and it also occurs on another, larger bbPress forum where I am a moderator.
I’ve asked someone who knows PHP to take a look at the code in bbpress/includes/extend/buddypress/notifications.php, but the couldn’t find any problem there.
I’m not sure if they were onto something or not, but they said the bug might originate in an incorrect reference to the database topic/post IDs, similarly to what @nikbond said above.
Robin’s solution above does not seem to work for me either.
-
AuthorSearch Results