Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 4,676 through 4,700 (of 32,518 total)
  • Author
    Search Results
  • Robin W
    Moderator

    I started with something very simple, so know the amount of work to publish a plugin and understand all the processes to that point – congratulations !!

    you can fix the broken part by only executing if the user is logged in eg

    change

    function bbp_profile_link_shortcode() {
    	
    		$link = bbp_get_user_profile_url( bbp_get_current_user_id() ) ;
    	
    	return $link;	
    }

    to

    function bbp_profile_link_shortcode() {
    	if (!is_user_logged_in())  return ;
    		$link = bbp_get_user_profile_url( bbp_get_current_user_id() ) ;
    	
    	return $link;	
    }

    This makes the function not display if the user isn’t logged in

    #189041
    Robin W
    Moderator

    use this in your functions file and change the address to what you want

    add_filter('bbp_get_do_not_reply_address','my_bbp_no_reply_email');
    function no_reply_email(){
        $email = 'noreply@yourdomain.com'; // any email you want
        return $email;
    }

    you can change that default to email address as well with :

    add_filter('bbp_subscription_to_email','my_bbp_subscription_to_email');
    function my_bbp_subscription_to_email(){
        $email = 'noreply@yourdomain.com'; // any email you want
        return $email;
    }
    Robin W
    Moderator

    just loaded that plugin to my test site, and with auto-embed on it works fine.

    This

    <p>https://photos.app.goo.gl/pOeSirvJb5oC7kFC2</p>

    displays the embed just fine.

    So all we now need to do is work out the difference between my test site and your staging site !!

    When you’ve come back on the Q’s above, I’ll do some more digging.

    #189012

    In reply to: Custom Topic Sorting

    Robin W
    Moderator

    untested by this should work

    //change topic order
    add_filter('bbp_before_has_topics_parse_args', 'rew_topic_order_by_meta');
    
    function rew_topic_order_by_meta ($args) {
    	$args['meta_key'] = 'put_meta_key_here' ;
    	$args['orderby']    = 'meta_value' ;
    	$args['order']     = 'DESC' ;  //or ASC if needed
    	return $args ;
    }

    just put your meta_key where it says

    #189001
    peter-hamilton
    Participant

    Hi @brent0r
    I made the following adjustment in my child-theme´s loop-single-forum.php and styled with CSS.
    This code will place all elements in the right order to have simple CSS adjustments make it all work as expected.

    <?php
    
    /**
     * Forums Loop - Single Forum
     *
     * @package bbPress
     * Theme OrganicSquare
     * Child-theme of TwentySixteen
     */
    
    ?>
    
    <ul id="bbp-forum-<?php bbp_forum_id(); ?>" <?php bbp_forum_class(); ?>>
    
    <li class="bbp-forum-info">
    	<div class="forumtitle">
    		<?php do_action( 'bbp_theme_before_forum_title' ); ?>
    
    		<a class="bbp-forum-title" href="<?php bbp_forum_permalink(); ?>" title="<?php bbp_forum_title(); ?>"><?php bbp_forum_title(); ?></a>
    
    		<?php do_action( 'bbp_theme_after_forum_title' ); ?>
    
    		<?php do_action( 'bbp_theme_before_forum_sub_forums' ); ?>
    
    		<div class="bbp-forum-content"><?php bbp_forum_content(); ?></div>
    		<?php do_action( 'bbp_theme_after_forum_sub_forums' ); ?>
    
    		<?php do_action( 'bbp_theme_before_forum_description' ); ?>
    
    		<?php do_action( 'bbp_theme_after_forum_description' ); ?>
    
    		<?php bbp_forum_row_actions(); ?></div>
    	</li>
    
    <li class="bbp-forum-topic-count">
    		<div class="topic-reply-counts">Topics: <span class="ismcounter"><?php bbp_forum_topic_count(); ?></span></div>
    		<div class="topic-reply-counts">Posts: <span class="ismcounter"><?php bbp_show_lead_topic() ? bbp_forum_reply_count() : bbp_forum_post_count(); ?></span></div>
    	</li>
    
    <li class="bbp-topic-freshness mob-hide-link-forum">
    	<?php do_action( 'bbp_theme_before_forum_freshness_link' ); ?>
    
    	<div class="freshness-author"><span class="fresh-avatar"><?php bbp_author_link( array( 'post_id' => bbp_get_forum_last_active_id(), 'type' => 'avatar', 'size' => '40' ) ); ?></span>
    
    	<div class="fresh"><h2><a href=" <?php bbp_forum_last_reply_url(); ?>" class="forumpostlink"><?php bbp_forum_last_reply_title(); ?></a></h2>
    	<span class="forumlist-name"><?php bbp_author_link( array( 'post_id' => bbp_get_forum_last_active_id(), 'type' => 'name' ) ); ?></span>
    	<span class="widgetlistdate"><?php bbp_forum_freshness_link(); ?></span></div>
    	<?php do_action( 'bbp_theme_after_forum_freshness_link' ); ?>
    	</div>
    </li>
    
    </ul><!-- #bbp-forum-<?php bbp_forum_id(); ?> -->
    #188991
    Robin W
    Moderator

    you have total height constrained by

    #bbpress-forums li.bbp-body ul.forum {
    	border-top: 0;
    	height: 90px;
    }

    so

    #bbpress-forums li.bbp-body ul.forum {
    	height: auto !important;
    }
    #188981
    Robin W
    Moderator

    Line 4255 of your theme Pixiehuge has

    #bbpress-forums li.bbp-body ul.forum li {
    	height: 100%;
    	display: flex;
    	display: -webkit-flex;
    	flex-direction: column;
    	-webkit-flex-direction: column;
    	justify-content: center;
    	-webkit-justify-content: center;
    }

    The height : 100% is the issue

    You need to put

    #bbpress-forums li.bbp-body ul.forum li {
    	height: auto;
    }

    or

    #bbpress-forums li.bbp-body ul.forum li {
    	height: auto !important;
    }

    (Try without the !important first)

    into your theme’s custom css, or the custom css part of my bbp style pack plugin

    Robin W
    Moderator

    you can simply filter this in your theme’s function file.

    not tested but

    add_filter( 'bbp_number_format', 'rew_number_format', 10 , 5) ;
    
    function rew_number_format ($number_format, $number, $decimals, $dec_point, $thousands_sep) {
    	$thousands_sep = '' ;
    return apply_filters( 'rew_number_format', number_format( $number, $decimals, $dec_point, $thousands_sep ), $number, $decimals, $dec_point, $thousands_sep );
    }
    #188951
    Robin W
    Moderator

    I’ve fixed that in the style pack plugin with version 3.7.2

    for anyone using the function above it should read

    function rew_forum_order_by_freshness ($args) {
    	$args['meta_key'] = '_bbp_last_active_time' ;
    	$args['orderby']    = 'meta_value' ;
    	$args['order']     = 'DESC' ;
    	return $args ;
    }
    
    add_filter('bbp_before_has_forums_parse_args', 'rew_forum_order_by_freshness');

    which just changes the order, rather than the previous function which overwrites all the parameters submitted by subscriptions

    #188950
    Robin W
    Moderator

    it’s caused by

    #bbpress-forums .reply {
      margin-left: 0 !important;
      width: auto !important;
    }

    which says it is inline code.

    The width: auto !important needs to be width :100% !important.

    Auto makes it only as wide as it needs to be, so for short sentences it truncates.

    But I’m also getting an error saying that your “sydney-child-theme/style.css could not be loaded”

    #188942
    posemotion
    Participant

    I was able to edit the style.css to get what I was looking for. Line 207. Compare and change.

    code,
    kbd,
    tt,
    var,
    samp,
    pre {
    	font-family: monospace, serif;
    	font-size: 10px;
    	-webkit-hyphens: none;
    	-moz-hyphens:    none;
    	-ms-hyphens:     none;
    	hyphens:         none;
    	line-height: 1.6;
    }
    
    code,
    pre {
    	border: 1px solid rgba(0, 0, 0, 0.1);
    	-webkit-box-sizing: border-box;
    	-moz-box-sizing:    border-box;
    	box-sizing:         border-box;
    	margin-bottom: 24px;
    	max-width: 100%;
    	overflow: auto;
    	padding: 12px;
    	white-space: pre;
    	white-space: pre-wrap;
    	word-wrap: break-word;
    }
    dobosalina
    Participant

    This is the code

    
    function bp_redirect($user)
      $redirect_url = "";
    
    if (defined('ICL_LANGUAGE_CODE')) {
        switch (ICL_LANGUAGE_CODE) {
    		
            case 'fr':
                $redirect_url = "https://volunteerteacher.org/fr/enregistrement-avec-succes/";
              break;
    
    		  default:
                  $redirect_url = 'https://volunteerteacher.org/registration-successful/"';
              break;
    		  
    		  
        }
    	bp_core_redirect($redirect_url);
    }
    return $redirect_url;
    }
    add_action('bp_core_signup_user', 'bp_redirect', 100, 1);
    
    
    dobosalina
    Participant

    Hello,

    I have a issue, I want to have a code who works like this:

    If user registered on English version – redirect to custom English registered successfully page
    If user registered on French version – redirect to custom French registered successfully page

    So far I have made this below:

    function bp_redirect($user)
    $redirect_url = “”;

    if (defined(‘ICL_LANGUAGE_CODE’)) {
    switch (ICL_LANGUAGE_CODE) {

    case ‘fr’:
    $redirect_url = “https://mysite.com/fr/enregistrement-avec-succes/&#8221;;
    break;

    default:
    $redirect_url = ‘https://mysite.com/registration-successful/”&#8216;;
    break;

    }
    bp_core_redirect($redirect_url);
    }
    return $redirect_url;
    }
    add_action(‘bp_core_signup_user’, ‘bp_redirect’, 100, 1);

    Unfortunately it is not working and I do not know what do do more to make it work.
    Language plugin is WPML the language pages are http://www.mysite.com/fr , http://www.mysite.com/es etc,

    Please help me, I really need this script to be working.

    Thank you so much

    #188924
    posemotion
    Participant

    The use of actual [code][/code] tags that everyone is familiar with. Smaller font or font size option for the code tags. Word wrap for the code tags.

    Thanks!

    #188923
    posemotion
    Participant

    I finally figured it out. No need to use the “Full Page Width” option or any other techniques found about the web. If you installed a bbPress forum and everything is set to its defaults. Just use the following…

    Select “Customize”
    Select “Additional CSS”
    Add/Paste the following…

    .bbpress #content-sidebar {      
    display: none;
    }
    
    #bbpress-forums {
      margin-left: auto !important;
      margin-right: auto !important;
      width: 170% !important;
    }

    Forum link in first post is incorrect now. A redirect is being setup though as that is my old link to another forum I use to use. New forum link is, http://www.posemotion.com/forums

    #188913
    tylertervooren
    Participant

    @aksteve – I had the same frustration. Try this simple plugin I just created. It’ll print the profile url via a shortcode so you can insert it anywhere you like.

    #188912
    tylertervooren
    Participant

    @sarwarc – I just created this very simple plugin to give you access to the user profile link via a shortcode. You can use it in conjunction with the Shortcodes in Menus plugin to add a link to the user’s profile page in your menu.

    #188911
    tylertervooren
    Participant

    Glad you got it figured out. I just created this very simple plugin to print the profile url via shortcode in case you find it useful

    #188910
    tylertervooren
    Participant

    I have also created a very simple plugin to give you access to the user profile url.

    #188908

    In reply to: User profile link

    tylertervooren
    Participant

    I just created this plugin. I think it will do exactly what you’re trying to achieve.

    tylertervooren
    Participant

    I’ll start by saying I have no idea what I’m doing and I can barely write php better than a toddler.

    I noticed that people have been asking for this (or something very similar to this) for years and it still isn’t part of core and no one’s written a plugin for it. I needed to figure it out on my own, so thought I’d finally make an attempt to contribute back to a platform that has given me so much.

    bbPress Profile Link Shortcode

    It doesn’t do anything fancy, but it does what it says. Hope you find it helpful!

    #188899
    HM
    Participant

    A charm! Thank you very much, very glad the code is safe now 🙂
    Again: merry Xmas and thanks a lot!

    #188895
    Robin W
    Moderator

    thanks, that was exactly the help I needed to get to the right code 🙂

    I’ve just released version 3.7.0 which has a filter you can use to change that link.

    If you update and then you add this code to your child theme‘s functions file

    add_filter ('bsp_new_topic_button', 'rew_change_button' ) ;
    add_filter ('bsp_create_new_topica', 'rew_change_button' ) ;
    
    function rew_change_button () {
    	$href = 'https://mysite/leden/forum/ledenforum/#bsptopic' ;
    	return $href ;	
    }

    then it won’t be affected.

    Please come back and confirm that it works for you.

    #188886
    saleemds
    Participant

    Hi All,

    I want to list all the most popular topics on the top. I am using the below shoetcode in my wp-admin page:

    [bbp-topic-index]

    It’s showing all the posts by ID descending order.

    Also, how I can add the symbol or icon for top five topics?

    Please help me guys.

    Thanks in advance!!!

    #188879

    Topic: Code Tag

    in forum Troubleshooting
    posemotion
    Participant

    The code tag doesn’t seem to work for me. I use MML data in code tags and it has been fine on other forums but seems to mess it up in bbPress. Would be nice for copy and paste options to for code tags. Here’s an example…

    ;[ Demo 3 | Copyright © 2015 | J. Baker ];
    
    CH1Verse_1.s = "t12 w4 o3 \2 v40 l8 <dced> dcge4 l4 \1 <d1> r8 l8 \2 dg l4 \1 <d1> l8 \2 dge \1 <d1> \2 dcdrr v+ <<dd>> v- r"
    
    CH2Verse_1.s = "t12 w4 o4 \1 v42 l8 >dcde< dcde#4 l4 >d1< l8 de l4 >f1 l8 ddfe1< dedfe dd r4"
Viewing 25 results - 4,676 through 4,700 (of 32,518 total)
Skip to toolbar