Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 11,326 through 11,350 (of 32,521 total)
  • Author
    Search Results
  • #149154
    Robin W
    Moderator

    can you come back and post your code for 2

    that’s why I need your to post your code, so that I can work out where it’s wrong πŸ™‚

    #149149
    pixelnated
    Participant

    If it helps anyone this will help you see all your bbpress duplicate topics at a glance with the duplicate ID
    ** Note these are just selects so they will not delete any data **

    
    select 
    		post_type
          , post_date
          , post_title
          , post_content
          , max(id) as dup_id, 
          count(*) as dupe_count
    from 
    		wp_posts 
    where 
    		post_type in ('forum', 'topic', 'reply')
    group by 
    		post_type
          , post_date
          , post_title
          , post_content
    having count(*) > 1
    order by post_type, post_date, dup_id
    

    We can then take a variation of that and have it give us the start and end duplicate ranges for each post_type with counts of rows we expect to be impacted.

    
    select post_type, min(dup_id) as start_dup, max(dup_id) as last_dup, count(*) as total_recs
    from 
    (
    select 
    		post_type
          , post_date
          , post_title
          , post_content
          , max(id) as dup_id, 
          count(*) as dupe_count
    from 
    		wp_posts 
    where 
    		post_type in ('forum', 'topic', 'reply')
    group by 
    		post_type
          , post_date
          , post_title
          , post_content
    having count(*) > 1
    ) i
    group by post_type
    

    of course you need to verify but this should help get you on your way

    #149146
    Leonyipa
    Participant

    I tried to remove the code, but I cannot figure out which piece of code I should remove :S

    #149145
    Robkk
    Moderator

    Amazing work man, thanks so much.

    your welcome πŸ˜€

    I need to figure out where to post each code in my theme,etc.

    Should I also put codes in bbPress plugin, or not? Since it might get deleted once updated, right?

    you copy bbpress templates into your child theme so its okay when bbpress updates, i explain exactly what template to copy and also i show you a snippet of where to put the code by the original code.

    you put custom css into anything that can handle custom css

    in bbpress.css in your child theme(you copy the original in your child theme)
    in your child themes css stylesheet
    the jetpack plugin module custom css
    a standalone custom css plugin

    #149144
    slayne76
    Participant

    Hi Stephen,
    thanks for the reply. I looked at the trac but it’s not strictly related, since it refers to the spam/trash/admin links on the front end.
    What I noticed instead, (and you can test yourself and let me know) is simply as this: in the backend (wordpress admin area) when a topic is in the trashcan, and you click untrash (the same thing you would do with posts, pages, custom post types when you put the in the trashcan) you get the default nonce wordpress error. You simply “CAN’T” untrash something directly inside wordpress.
    I was hoping that anyone else could try the same and give me confirmation that the issue exists (in the code i posted I was able to indentify the problem as well)

    If you, or anyone else, can confirm there is this issue, I (or you, or whoever wants to) can open a ticket in the trac so it gets fixed asap πŸ™‚

    #149143
    elaborate
    Participant

    I’m trying to find a way to display a given user’s raw subscription or favorites count in a fashion similar to how bbp_get_user_reply_count_raw() and bbp_get_user_topic_count_raw() work.

    I’ve tried to use an existing function like bbp_get_user_subscriptions() with a counter but I figure I need to query the database. I’m still learning PHP though so if anyone sees a way to do it like that then please let me know.

    Thank you.

    #149133
    acornale
    Participant

    At the moment, I have a standard WordPress search box on the top of my page. It seems to return posts and pages but not bbpress forums or topics.

    I can use the bbpress shortcodes to display a forum search but I don’t want two search boxes.

    Is there a way to extend the native wordpress search so it returns posts, pages, topics and forums?

    At the moment, it seems I can search bbpress OR search wordpress posts / pages. I want to search both?

    #149132
    Pavle123
    Participant

    Wow @Robkk

    Amazing work man, thanks so much. I will need few days to set everything up.

    I need to figure out where to post each code in my theme,etc.

    Should I also put codes in bbPress plugin, or not? Since it might get deleted once updated, right?

    #149128
    Robin W
    Moderator

    I’ve loaded all that, my display is slightly different, but that will be styling.

    When I click any ‘topic tools’ it’s just the first topic that displays, and this does so in a stacked fashion, so I can only see the first tool.

    However, I played a bit with the loop single reply, and would the following help?

    <div class="dropdown" id="dropdown">
    				<input type="checkbox" id="drop1" />
            <label for="drop1" class="dropdown_button">Topic Tools</label>
    		<?php if (bbp_is_topic(bbp_get_reply_id()) ) { ?>
    		<ul class="dropdown_content">
                <li class="active"></li>
                  <li> <?php echo bbp_get_reply_edit_link(); ?></li>
                  <li><?php echo bbp_get_reply_spam_link(); ?></li>
                  <li><?php echo bbp_get_reply_move_link(); ?></li>
            </ul>
    		<?php } ?>
    		<?php if (bbp_is_reply(bbp_get_reply_id()) ) { ?>
    		<ul class="dropdown_content">
             <li class="active"></li>
    			<li><?php echo bbp_get_reply_spam_link(); ?></li>
                 <li><?php echo bbp_get_reply_move_link(); ?></li>
             </ul>
    		<?php } ?>
            
        </div>

    basically it adds if-topic and if reply choices

    #149126

    In reply to: Deleting Log of edits

    Robin W
    Moderator

    Ok, the code works (just retested it on my site), but the link you supplied is not using it.

    are you sure you put

    /* =Revisions
    ————————————————————– */
    
    #bbpress-forums .bbp-topic-content ul.bbp-topic-revision-log,
     #bbpress-forums .bbp-reply-content ul.bbp-topic-revision-log,
     #bbpress-forums .bbp-reply-content ul.bbp-reply-revision-log {
     Display : none !important ;
     }
    

    in

    wp-content/themes/divi/style.css

    Do you have caching software running?

    #149123
    Robkk
    Moderator

    @netweb no problem

    ok i understand , idk why i posted the link to their images haha

    and i got it figured out , just wasnt showing up for some reason on my local site after i just changed the word new topic to new thread …was kind of weird.

    the last thing is just paste this code above
    <?php do_action( 'bbp_template_before_topics_index' ); ?>

    <a class="bbp-new-topic-button" href="#new-post">New Thead</a>

    it should show the droplink

    #149122
    Stephen Edgar
    Keymaster

    Nice work @robkk, looks really good and thanks for helping out, much appreciated πŸ™‚

    One thing, I did remove the link to the direct link to quicksprout envelope/mail images, more than happy to take inspiration of sites design and write awesome code as you have above. We should not be grabbing the sites image assets (or any assets actually) as they may not be open source and/or royalty free. There are plenty of resources on the net for open source/royalty free icons/images πŸ˜‰

    I’ll tell you the rest when im done , because right now im having some trouble

    What are you having trouble with? Anything I can help out here to get you sorted?

    #149118

    In reply to: Deleting Log of edits

    kimberlyywp
    Participant

    I just changed the code and put that in the style.css and I’m still seeing the edits: http://livessoonforgotten.com/members-3/user-groups/in-memorandum/forum/topic/test-memorial/

    #149116
    Robkk
    Moderator

    ok i havent gone too much far into this as you may think though

    but you can try it as it is now to test it out

    these are both in my functions.php in my child theme
    im just showing the reply link on both topics and replies, i have gd bbpress tools so there is also a quote link

    //change admin links displayed
    function change_admin_links ($r) {
    $r['links'] = apply_filters( 'rw_reply_admin_links', array(
    				'reply'  => bbp_get_reply_to_link ( $r )
    				
    			), $r['id'] );
    return $r['links'] ;
    }
    add_filter ('bbp_reply_admin_links', 'change_admin_links' ) ;
    
    //change admin links displayed
    function change_topic_admin_links ($r) {
    $r['links'] = apply_filters( 'rw_topic_admin_links', array(
    				'reply'  => bbp_get_topic_reply_link ( $r )
    				
    			), $r['id'] );
    return $r['links'] ;
    }
    add_filter ('bbp_topic_admin_links', 'change_topic_admin_links' ) ;

    I have this in my loop-single-reply.php at the bottom ,

    i havent added all the admin links, plus this doesnt work on replies it only works on the topic , i need to use a jquery on click function instead of all css dropdown menu

    <div class="dropdown" id="dropdown">
    				<input type="checkbox" id="drop1" />
            <label for="drop1" class="dropdown_button">Topic Tools</label>
            <ul class="dropdown_content">
                <li class="active"></li>
                  <li> <?php echo bbp_get_reply_edit_link(); ?></li>
                  <li><?php echo bbp_get_reply_spam_link(); ?></li>
                  <li><?php echo bbp_get_reply_move_link(); ?></li>
            </ul>
            
        </div>

    here is all my custom css , i have this in my themes custom css plugin

    .dropdown {
        display: inline-block;
        margin: 0px 10px;
        position: relative;
      float:right;
    }
    
    .dropdown .dropdown_button {
        cursor: pointer;
        width: auto;
        display: inline-block;
        padding: 2px 10px;
        border: 1px solid #AAA;
        border-radius: 0px;
        font-weight: bold;
        color: #222;
        line-height: 16px;
        text-decoration: none !important;
        background: none repeat scroll 0% 0% #FFF;
    }
    
    .dropdown input[type="checkbox"]:checked + .dropdown_button {
        border-width: 1px;
        border-style: solid;
        color: #222;
        background: #FFF;
    }
    
    .dropdown input[type="checkbox"] + .dropdown_button .arrow {
        display: inline-block;
        width: 0px;
        height: 0px;
        border-top: 5px solid #6B7FA7;
        border-right: 5px solid transparent;
        border-left: 5px solid transparent;
    }
    
    .dropdown input[type="checkbox"]:checked + .dropdown_button .arrow { border-color: white transparent transparent transparent }
    
    .dropdown .dropdown_content {
        position: absolute;
        border: 1px solid #777;
        padding: 0px;
        background: white;
        margin: 0;
        display: none;
    }
    
    .dropdown .dropdown_content li {
        list-style: none outside none;
        margin-left: 0px;
        line-height: 16px;
        border-top: 1px solid #FFF;
        border-bottom: 1px solid #FFF;
        margin-top: 2px;
        margin-bottom: 2px;
        width: 86px;
    }
    
    .dropdown .dropdown_content li:hover {
        background: #999;
      color:#222;
    }
    
    .dropdown .dropdown_content li a {
        display: block;
        padding: 2px 15px;
        color: #222;
        text-decoration: none !important;
        white-space: nowrap;
        background: #ffffff;
        border-bottom: 1px solid #999;
    }
    
    .dropdown .dropdown_content li:hover a {
        color: #222;
        text-decoration: none !important;
      background:#999;
    }
    
    .dropdown input[type="checkbox"]:checked ~ .dropdown_content { display: block }
    
    .dropdown input[type="checkbox"] { display: none }
    #149115

    In reply to: Deleting Log of edits

    kimberlyywp
    Participant

    I did drop that code in the style.css but it didn’t change anything. Is it possible that something is overwriting it?

    #149114

    In reply to: Deleting Log of edits

    Robin W
    Moderator

    yes, you have a choice

    1. You could put it in your style.css – that is a file called style.css that you will find in your theme

    wp-content/themes/%yourthemename%/stle.css

    where %yourthemename% is the name of your theme

    Just drop it at the end.

    This will then override the code in bbpress.css, and is the easiest way

    2. Otherwise you can create a directory called css in your theme

    /wp-content/themes/%yourthemename%/css

    and copy the existing bbpress.css across to get

    /wp-content/themes/%yourthemename%/css/bbpress.css

    but here’s the thing, you then need to find and edit the existing display lines, just adding code will give two sets, and your maybe won’t take preference

    the lines you are looking start at line 904 and say

    /* =Revisions
    -------------------------------------------------------------- */
    
    #bbpress-forums .bbp-topic-content ul.bbp-topic-revision-log,
    #bbpress-forums .bbp-reply-content ul.bbp-topic-revision-log,
    #bbpress-forums .bbp-reply-content ul.bbp-reply-revision-log {
    	border-top: 1px dotted #ddd;
    	width: 100%;
    	margin: 0;
    	padding: 8px 0 0 0;
    	font-size: 11px;
    	color: #aaa;
    }
    
    #bbpress-forums .bbp-topic-content ul.bbp-topic-revision-log li,
    #bbpress-forums .bbp-reply-content ul.bbp-topic-revision-log li,
    #bbpress-forums .bbp-reply-content ul.bbp-reply-revision-log li {
    	list-style-type: none;
    }
    
    

    you just need to edit that to

    `/* =Revisions
    ————————————————————– */

    #bbpress-forums .bbp-topic-content ul.bbp-topic-revision-log,
    #bbpress-forums .bbp-reply-content ul.bbp-topic-revision-log,
    #bbpress-forums .bbp-reply-content ul.bbp-reply-revision-log {
    Display : none ;
    }

    come back if we can help further

    #149113
    kimberlyywp
    Participant

    I found this from an old post
    “And for those that just want to hide the code edit your theme css and use this:

    .bbp-reply-revision-log {

    display: none !important;

    }”

    But I can’t figure out where to put that code, I have tried bbpress.css file but it didn’t work, can anyone point me in the right direction? Thanks in advance!

    #149112
    Robkk
    Moderator

    Thanks so much. I am not an expert in this, so I will wait until Sunday.

    haha im no expert , im just some guy helping out people on here the best i can

    -Login/Register buttons above the forum

    quicksprout has ajax login and its also in a popup window

    so if you want that install wp-modal-login

    after that copy your content-archive-forum.php to your child theme

    and make sure that is has this code inside of it , heres a snippet

    <?php do_action( 'bbp_template_before_forums_index' ); ?>
    
    	<?php if ( bbp_has_forums() ) : ?>
    	
    	<?php if ( is_user_logged_in() ) {
    
    } else { ?>
    
    <div class="bbp-modal-login"> 
    
     <?php add_modal_login_button( $login_text = 'Login', $logout_text = 'Logout', $logout_url = 'http://sitename', $show_admin = true ); ?>
     
     </div>
     
       <?php
    };
    ?>
    
    		<?php bbp_get_template_part( 'loop',     'forums'    ); ?>
    
    	<?php else : ?>
    
    		<?php bbp_get_template_part( 'feedback', 'no-forums' ); ?>
    
    	<?php endif; ?>

    style the link to whatever you want with custom css
    here is a template

    .bbp-modal-login a.login.wpml-btn.login-window {
    float: left;
    padding:5px;
    color:#fff;
    background:#333; 
    text-decoration:none;
    text-transform:uppercase;  
    }

    and like i said you could also do the shortcode version too

    nice round images of members

    i saw your site , and see you already have this

    images for read/unread posts

    if you want the images here

    the whole functionality of the unread posts on their forums is like 2 unread posts plugins from the wordpress plugin respository mixed together

    https://wordpress.org/plugins/bbpress-mark-as-read/
    https://wordpress.org/plugins/bbpress-unread-posts/

    i cant really help on this

    statistics at the bottom

    this should be the bottom of your content-archive-forum.php

    	<?php do_action( 'bbp_template_after_forums_index' ); ?>
    
    </div>
    
    <?php echo do_shortcode("[bbp-stats]"); ?>

    to style the bbpress statistics shortcode put content-statistics.php into your child theme

    this should be your entire content-statistics.php

    <?php
    
    /**
     * Statistics Content Part
     *
     * @package bbPress
     * @subpackage Theme
     */
    
    // Get the statistics
    $stats = bbp_get_statistics(); ?>
    
    	<?php do_action( 'bbp_before_statistics' ); ?>
    	
    	<div class="bbp-stats">
    	
    	<ul class="bbp_stats">
    
    	<li> <?php _e( 'Users', 'bbpress' ); ?></dt>
    		<strong><?php echo esc_html( $stats['user_count'] ); ?></strong></li> 
    
    	<li> <?php _e( 'Topics', 'bbpress' ); ?></dt>
    		<strong><?php echo esc_html( $stats['topic_count'] ); ?></strong></li> 
    
    	<li> <?php _e( 'Replies', 'bbpress' ); ?></dt>
    
    		<strong><?php echo esc_html( $stats['reply_count'] ); ?></strong></li> 
    		
    		 </ul>
    		 
    		 </div>
    		
    	<?php do_action( 'bbp_after_statistics' ); ?>
    
    </dl>
    
    <?php unset( $stats );

    add this for custom css

    .bbp-stats .bbp_stats {
        list-style-type: none;
        display: block;
        text-align: center;
        margin-left: 0px;
        float: none;
    }
    
    .bbp-stats .bbp_stats li {
        margin: 0;
        display: inline-block;
        padding: 5px;
    }

    β€œNew Thread button”

    this is just a drop link , example of a drop link would be to put #new-post at the end of the url of this topic and you will see that you will end up at the new topic/reply form

    copy content-archive-topic.php into your child theme right now then

    ILL tell you the rest when im done , because right now im having some trouble

    Jerry
    Participant

    Hi Robin. I’m on my way to the UK to support the Farnborough airshow, so I can’t access my home computer to replicate the error for another week. What I can tell you is; when I removed the switch_to_blog id input parameter and instead assigned a variable $cat to ‘post_parent’, and set $cat = $attr[‘id’];, I received no errors. I hard-coded to the blog site, then I can adjust the id to equal the forum id. So my feeling is that shortcodes cannot accept two inputs? If I’m wrong about that, then I will re-address this upon my return to the states.

    #149081
    Robkk
    Moderator

    I can’t post any code right now I’m on my cell , I’ll do it tomorrow , but its not really much though I just made a menu in HTML and put the admin links in each list .

    The only problem I have is just making the specific admin links show up on their specific post type.

    I can tell you other ideas I have thought to place the menu of links besides HTML but that might confuse you more.

    #149080
    Robin W
    Moderator

    ok, my brain is now mush, but I am still hooked.

    Can you post you solution so far, then I’ll put it in my test site

    So I need to know

    what code you put in your functions file

    what code you have in loop single reply (and starting where!)

    any other code you have, and where you’ve put it

    I’ll then have a play !

    Robin W
    Moderator

    you’ll need to have some logic in here

    eg

    if there are replies find latest reply, and then find that replies author and insert that.
    if there are no replies, then put in topic author

    At the moment you looking up the reply author for a topic, and that won’t work.

    just had a play and this seems to work, but only tested quickly, so you’d need to set up a few topics with and without single and multiple replies and check that it worksin all circumstances

    // Maybe get the topic author
    if ( ! empty( $settings['show_user'] ) ) {
    //see if there has been replies, and if so set to latest
    $replycheck = get_post_meta( $topic_id, '_bbp_last_reply_id',true);
    //if we have replies ie replycheck holds the latest reply number
    if (!empty ($replycheck)) 
    $author_link = bbp_get_reply_author_link( array( 'post_id' => $replycheck, 'type' => 'both', 'size' => 14 ) );
    else
    $author_link = bbp_get_topic_author_link( array( 'post_id' => $topic_id, 'type' => 'both', 'size' => 14 ) );
    				} ?>
    
    
    #149074
    localmarketingus
    Participant

    Because on a ‘conatact form” you can’t enter html or code like in bbpress.. thats why i asked the question.

    #149069
    Robkk
    Moderator

    If this confuses you wait til Sunday or if anyone knows what I ment and wants to properly describe every detail and post code

    #149068
    Robkk
    Moderator

    For login and register you could create individual pages for login and registration , you could use the login and register form short codes by bbpress and put them in your pages or if you use theme my login or something similar that creates custom frontend membership pages use that. And put an HTML link to both pages above loop-forums.php or above the call of loop-forums.php in archive-forum.php

    Round avatar images use border-radius:50%; or something like that , you could probably right click inspect element target the avatar image and get the CSS code right off of quick sprout and put that in your custom css

    Unread posts you have to wait til its sunday (time I will be home to see my desktop)

    Stats at bottom you could use the bbpress stats short code , if you want it in your templates use the php do shortcode function with the bbpress stats short code

    I don’t know how the new thread button fuctions , but you could create a page let’s say “new topic” and link to it the same as the login/register buttons

Viewing 25 results - 11,326 through 11,350 (of 32,521 total)
Skip to toolbar