Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 12,076 through 12,100 (of 32,504 total)
  • Author
    Search Results
  • #145230
    tharsheblows
    Participant

    I’m not quite clear on your code, so can’t help with the last piece.

    As I mentioned, I did it differently and specific to the forum I was working on which has categories with forums but no sub-forums and one single forum without a category. I don’t think this will help you unless you decide to try something different but this is what I did – in loop-forums.php replace the while loop with :

    <?php while ( bbp_forums() ) : bbp_the_forum(); ?>
       <?php if( !bbp_is_forum_category() ) {
         bbp_get_template_part( 'loop', 'single-forum' ); 
       } else {
         bbp_get_template_part( 'loop', 'single-categories' ); 
       } ?>
    <?php endwhile; ?>

    and then I made a loop-single-categories.php https://bbpress.trac.wordpress.org/attachment/ticket/1958/loop-single-categories.php

    #145229
    DeanGrey
    Participant

    What the image shows is already using Bob1nz’s provided code. Bob1nz’s seems to not correct the issue like Lynq’s does. I am aware that Lynq has made some code available on github but I don’t know what to modify to get those to go away. I have worked my way to getting everything else the way I want it, this is just the last piece.

    #145225
    tharsheblows
    Participant

    Yep – use get_post_time() – https://codex.wordpress.org/Template_Tags/get_post_time

    function mjj_post_reply_date(){
      printf('<div class="mjj-post-date">');
      $reply_id = bbp_get_reply_id( $reply_id );
      printf( get_post_time( get_option( 'date_format' ), false, $reply_id, true ) ); 
      printf('</div>');
    }
    
    add_action ('bbp_theme_before_reply_content', 'mjj_post_reply_date') ;
    #145223
    Majijiboo
    Participant

    Thanks. It works. Is there a way to only show the date and not the hour/minute? Maybe using code similar to the below could help?

    
    function short_freshness_time( $output) {
    $output = preg_replace( '/, .*[^ago]/', ' ', $output );
    return $output;
    }
    #145222
    tharsheblows
    Participant

    @Matoca it sounds like you’re still using tinyMCE? Do you have something like this in your functions file –

    function bbp_enable_visual_editor( $args = array() ) {
        $args['tinymce'] = true;
        return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );

    (from https://codex.bbpress.org/enable-visual-editor/ )

    I might be confused (if we had signatures and I used signatures on forums mine would be “I might be confused”) but I wouldn’t think you’d have a text / visual tab on the non-tinyMCE editor, would you?

    If it were me, I’d also try disabling “Post Formatting” in Settings -> Forums in the admin area. I have no clue whatsoever if that would work though, it’s just something I’d try.

    I’m really interested to see what works! My guess is that something will end up working but we’ll never quite know what did it.

    #145220
    tharsheblows
    Participant

    You can use bbp_reply_post_date for it – it will give you “August 4, 2012 at 2:37 pm”. I mean, it would give you that for posts on Aug 4, 2012 at 2.37pm and similar things for other dates.

    But you want to style it a bit, so something like:

    function mjj_post_reply_date(){
      printf('<div class="mjj-post-date">');
      bbp_reply_post_date(); 
      printf('</div>');
    }
    
    add_action ('bbp_theme_before_reply_content', 'mjj_post_reply_date') ;
    #145216
    tharsheblows
    Participant

    Oh good – I have this in a header – it’s about the same but $user_identity is the display name rather than the login. This explains the different global variables from get_currentuserinfo() – https://codex.wordpress.org/Function_Reference/get_currentuserinfo . Just in case you want the full reference – I hadn’t really looked at it before and noticed we used different variables and wondered why and thought you might be interested too. 🙂

    <?php if ( is_user_logged_in() ) { ?>
      <span class="break-me">
      Welcome, 
      <?php 
    	global $user_identity;
    	get_currentuserinfo();
    	printf('%s', $user_identity); ?>! 
      </span>
      <span class="break-me">
    	<a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="Logout">Log out?</a> &bull; <a href="<?php echo bbp_get_user_profile_url(get_current_user_id()); ?>" name="Your profile and posts">Your profile</a> 
      </span>
    <?php } ?>
    #145209
    Sascha.H
    Participant

    Well this is now my solution. Seems ok

    <?php
    if ( ! is_user_logged_in() ) {
        wp_nav_menu( array( 'theme_location' => 'Register or Login' ) ); 
    }  
    else {
        global $current_user;
        get_currentuserinfo();
        $current_user->user_login;
    				
        echo "Logged in as: ";?>                
        <a href="<?php echo get_edit_user_link(); ?>">
            <?php echo $current_user->user_login; ?>
        </a>				
    <?php }	?> 
    #145204
    bustel
    Participant

    After a long search I found a solution for my problem…

    instead of:
    $uri = bbp_get_reply_edit_url( $r['id'] );
    set:
    $uri = $_SERVER['REQUEST_URI'].( '/../../../give-reaction/' . $r['id'] . '?edit=1' );
    on line: 1923

    #145202
    bustel
    Participant

    And if i set it to:
    $uri = ( '?edit=1' );
    then I get the topic to change and not the reply….

    #145201
    bustel
    Participant

    It works for the topics but not for the replies, I don’t know why it doesn’t work…

    I have tested with
    1)
    $uri = ( '/?edit=1' );
    in the topic: http://www.mysite.com/?edit=1
    it isn’t correct
    it go to the home of the site, that’s it.

    2)
    $uri = bbp_get_reply_edit_url( $r['id'] ) . '?edit=1';
    in the topic: http://www.mysite.com/map/map/1827/edit/?edit=1
    and it isn’t correct eather…
    it says: The page you requested could not be found.

    #145189
    Majijiboo
    Participant

    Thanks for responding. I made the below code and unfortunately didn’t work. When you have time in a week or 2, would love to know what went wrong. Thanks.

    function post_time ( $output) {
    $output = preg_replace( '/, .*[^ago]/', ' ', $output );
    echo $output;
    }
    add_action ('bbp_theme_before_reply_content', 'post_time') ;
    #145185

    In reply to: change forum sidebar

    Robin W
    Moderator

    have you been through the step by step guides in

    Codex

    #145184
    Robin W
    Moderator

    basically you’d need to cut some code to display the date/time, put it in a function that echo’s it, and then hook it to the following action

    add_action (‘bbp_theme_before_reply_content’, ‘your_function’) ;

    see

    Step by step guide to setting up a bbPress forum – part 4

    sorry am up to my armpits in other code, or I’d cut it for you !

    #145174
    Robin W
    Moderator

    should read

    <p><a href="<?php bbp_user_profile_url( bbp_get_current_user_id() ); ?>edit" >Amend Profile/Change password</a></p>

    sorry, wordpress tends to not like code, and keeps trying to edit it !

    have amended the codex !

    #145172
    bustel
    Participant

    Do the same thing for:

    edit function: bbp-reply-edit-link
    in the file: wp-content/plugins/bbpress/includes/replies/template.php

    on line 1922

    // Get uri
    // $uri = bbp_get_reply_edit_url( $r['id'] );
    $uri = ( '?edit=1' );
    #145171
    bustel
    Participant
    // Get uri
    // $uri = bbp_get_topic_edit_url( $r['id'] );
    $uri = ( '?edit=1' );
    #145168
    Halo Diehard
    Participant

    @foxden-vixen That’s awesome you figured it out! Often it is hit and miss for me too.

    I use FireFox FireBug and right-click, “Inspect Element” anywhere on a webpage and it tells me what that element is called. The “Read More” element on your page is called a.readmore and the ‘display none’ css should work for that. Maybe:

    .forum-archive a.readmore {
         display: none;
    }

    I should encourage you to start a new thread for topics that don’t go with the topic you are in, though 🙂

    #145161

    In reply to: creating a child-theme

    Robin W
    Moderator

    which parts of the plugin do you want to re-write?

    You will always be prompted for bbpress updates, so no code you write will be lost by mistake.

    If it is templates that you want to alter, then copy only the ones you alter to

    wp-content/your-theme/bbpress

    see
    https://codex.bbpress.org/step-by-step-guide-to-setting-up-a-bbpress-forum-part-3/ section 3

    of it’s functions, then you should change these using filters see

    Step by step guide to setting up a bbPress forum – part 5

    #145160

    In reply to: creating a child-theme

    Sascha.H
    Participant

    Well the problem isnt that i cant install it. Actually i had installed both plugins but i dont want to rewrite the plugin code because when the plugins will be updated my code will be overwrited thats why i want a child-theme but i dont know which parts from the plugin in which folder.

    1. Thank you
    2. The Problem is the basic URL is http://www.myurl.de/forums/forum/test and when i disable the thickbox its http://www.myurl.de/forum/test. But i want zero tags before. And when i delete the forum field and save than it appears again.

    foxden-vixen
    Blocked

    The site is back up today and I tested it out. It did not work the way you wrote the code.

    .forum-archive DIV.sidebar.right, .bbpress .single-forum DIV.sidebar.right, .bbpress .single-topic DIV.sidebar.right {
    	display: none !important;
    }

    should be

    .forum-archive DIV.sidebar.right, .bbpress.single-forum DIV.sidebar.right, .bbpress.single-topic DIV.sidebar.right {
    	display: none !important;
    }

    Just taking out the spaces between bbpress and single worked. The syntax was incorrect.

    One other stupid question…at the bottom of the main page, which I guess now is called the archive page, there is the “read more” tag. How do I get rid of that? Doesn’t that have to do with the loop?

    #145155
    Robin W
    Moderator

    find your themes full width page template and then follow the instructions below to get bbpress to use it

    Step by step guide to setting up a bbPress forum – Part 1

    #145149
    Robin W
    Moderator

    I’d start by reviewing the layout and functionality

    Layout and functionality – Examples you can use

    the look at

    Step by step guide to setting up a bbPress forum – Part 1

    to get some widgets in your sidebars

    then

    bbPress Styling Crib

    to get some styling.

    Halo Diehard
    Participant

    @foxden-vixen try adding a comma and:

    .bbpress .single-forum DIV.sidebar.right, .bbpress .single-topic DIV.sidebar.right

    after where you already have in the css:

    .forum-archive DIV.sidebar.right

    so it says:

    .forum-archive DIV.sidebar.right, .bbpress .single-forum DIV.sidebar.right, .bbpress .single-topic DIV.sidebar.right {
    	display: none !important;
    }
Viewing 25 results - 12,076 through 12,100 (of 32,504 total)
Skip to toolbar