Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 11,401 through 11,425 (of 32,521 total)
  • Author
    Search Results
  • #148872
    Robkk
    Moderator
    <?php if ( bbp_is_topic() ) 
    echo bbp_get_topic_reply_link(); ?>
    <?php if ( bbp_is_topic() ) 
    return bbp_get_topic_reply_link(); ?>

    these dont show an error but it wont show the link

    #148870
    Robkk
    Moderator

    oh yeah in loop-single-reply i have my admin links on the very bottom of the template and i have this code right above it

    #148869
    Robin W
    Moderator

    where are you putting this code – is it in a bbpress template?

    #148868
    Robkk
    Moderator

    @robin-w i couldnt get the if ( bbp_is_topic function working

    i wanted to test out if i could do this , took code from this

    <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_to_link(); ?></li>
                  <li><?php if ( bbp_is_topic( $r['id'] ) ) {
    echo bbp_get_topic_reply_link(); ?></li>
                  <li><?php if ( bbp_is_topic( $r['id'] ) ) {
    return bbp_get_topic_reply_link(); ?></li>
            </ul>
            
        </div>

    then make a dropdown menu from that i guess , but im just swinging the dark not really getting a exactly great way of doing what i want to achieve.

    plus i might have to go to a jquery menu template like this

    because the css menus arent working on all replies.

    Jerry
    Participant

    All css changes are within my child theme. For my child-theme’s style.css, I added this at the very bottom:

    /*Changes made to accommodate plugin recent-bbpress-changes*/
    #content ul {
    padding: 0;
    margin-left: 0;
    margin-right: 0;
    list-style: none;
    }

    For my bbpress.css in my child-theme, I added this around line 158 or so:

    li.bbp-topic-title {
    	float: left;
    	text-align: left;
    	width: 20%;

    One note on bbpress.css. The original bbpress.css had some combined lines that I separated. For example, I think that li.bbp-topic-title was combined with li.bbp-forum-info, as in the following manner:

    li.bbp-forum-info,
    li.bbp-topic-title {
    	float: left;
    	text-align: left;
    	width: 20%;

    But I could be wrong. Doesn’t matter. Separating them appears to be just fine.

    #148861
    Robkk
    Moderator

    you want to change the

    links that come up with a topic or reply so that only some show, and others are in a dropdown list.

    is that correct?

    yes

    This also gives you the ability to add a new link

    yeah i added the topic favorite link to see if it worked and it did with the ajax too
    and also a mark topic as read from the bbpress go to first unread plugin

    You’ll also see that this function checks if it is a topic on line 1825

    i used this as a filter for the topic admin links

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

    i tried using this function to post a single admin link for a topic
    and also just by replacing return with echo
    but i cant seem to get that to work

    if ( bbp_is_topic( $r['id'] ) ) {
    			return bbp_get_name_of_link();
    		}
    
    		if ( !bbp_is_reply( $r['id'] ) ) {
    			return bbp_get_name_of_link() ;
    		}
    #148860
    Robin W
    Moderator
    if (is_bbpress()) :
     div class=”abc”
    else :
     div class=”xyz”
    endif;

    translates to

    if you are on a bbpress screen/page/display [as opposed to a wordpress blog post or page, a home page or anything that isn’t bbpress]

    the use div class abc

    if you are on any other type of page use class xyz.

    Many themes use if statements checking against ‘conditional tags’ to style areas for instance the conditional tag is_home() checks whether this is the home or index page.

    #148858
    ninjaunmatched
    Participant

    Okay I found the code which is on this site actually.

    click here

    But the code mentioned:

    if (is_bbpress()) :
    div class=”abc”
    else :
    div class=”xyz”
    endif;

    Still would not make sense to everyone. So I’m thinking the first part is the main part. After the colon you would change the div class to whatever you want change which would be some of the classes mentioned in this thread to another class that you create which simply just changes the font size.

    I’m thinking this way you would have to create your own classs for each thing you want to change in bbpress whether it was the reply text, the header text, or the content text. If I am off a bit or a lot just chime in. Hope it helps.

    Jerry
    Participant

    Got it solved! First, sorry for all the responses. I got lazy in posting the above instead of searching for the solution in the wordpress codex first. Turns out there is a function to return to the current blog, which I inserted within the “if” statement. Specifically, it is “restore_current_blog();”. Here is the working code:

    <?php
    /* 
    		Plugin Name: Recent bbpress Topics
    		Plugin URI: http://whosgotbooks.com/wp-content/plugins
    		Description: A plugin to display recent bbpress topics across the network
    		Version: 1.0.0
    		Author: Jerry Caldwell
    		Author URI: http://whosgotbooks.com
    		License: Open Source
    */ 
    /*
    Here is the shortcode required [recent-bbpress-topic]
    */
    function recent_bbpress_topics_shortcode() {                  
      recent_bbpress_topics(); }
      add_shortcode( 'recent-bbpress-topics', 'recent_bbpress_topics_shortcode' );
    
    //Add Recent Topics to BBPress
    function recent_bbpress_topics() {
    		switch_to_blog(9);
      if ( bbp_has_topics( array( 'author' => 0, 'show_stickies' => false, 'order' => 'DESC', 'post_parent' => 'any', 'posts_per_page' => 7 ) ) ) { 
          bbp_get_template_part( 'bbpress/loop', 'topics' );
          restore_current_blog();
          }
    // Hook into action
    add_action('bbp_template_after_forums_loop','recent_bbpress_topics');
    } ?>

    For anyone who wants to use this, a few more points. One, don’t forget the formatting for style.css. Two, I changed that formatting within a child theme. Three, I can’t guarantee you will have the same results with your formatting as I have made many other formatting changes the past few months for my site. Lastly, I did not “network activate” my plugin. I only activated it on the main site.
    As I get time I will add comments and try to increase the functionality of this plugin. Right now it is very basic. Maybe I’ll get good enough to publish it?

    #148856
    ninjaunmatched
    Participant

    I know it does cascade but if you are not familiar with writting the code to STYLE over attribiutes you can go looking for lines that alter font sizes. One way you could try is to get Notepad++. This text editer is just the greatest. Never edit code without it or something like it. You can use it to search for code. In this case I would try to search for “font-size:” within the CSS file being referred to in this thread. It will find every line where the font-size is being changed.

    Trying it now it finds 28 hits in the bbpress.css file I have in one of my sites. This I think will get you started. May not be the best way though. Just looking at the hits I can see some of the IDs or Classes also have a SPAN tag in them. Whichs tell me that the default span font settings would also have to be changed.

    I’m not sure where your HTML knowledge is but the SPAN tag when used is like a commenting or caption section (sort of) for text and it tends to be in a smaller font.

    for example:

    While jumping around the hits I see this:

    li.bbp-header div.bbp-topic-content span#subscription-toggle,
    li.bbp-header div.bbp-topic-content span#favorite-toggle,
    li.bbp-header div.bbp-reply-content span#subscription-toggle,
    li.bbp-header div.bbp-reply-content span#favorite-toggle {
    float: right;

    You may be able to get the look you want by just changing any

    font-size:

    entry you find but if things or some things still look too small for you then that span tag may be what you need to change to get it the way you want.

    Now I’m still just maybe a intermediate in my kowledge of things. I know what I was taught by learning myself and having taken Wed Design and Development I and II at a local college. But I am no developer. So I can read through css and understand what is going on. But because of the cascading way of CSS you can make changes that will not stick due to a higher level attribute being set so you have to play detective which wastes alot of time.

    I do agree though as the responses are too vague. Looking for the same answer I find this thread and so I am sharing what I have done so far to figure this one out. I did find something that mentions being able to use an IF statement on the themes main style sheet (CSS file) that will find all bbpress related entries and change whatever attribute you designate which in this case would be the font size. Now someone mentioned this in this thread without stating how which is close to pointless if the intention is to help you solve it. At least when you make the suggestion state it in a simple way so its understood by all. I ran into this code during my research on it but I am currently here. I will copy paste the code if I can find it again. By now I assume you found the answer but for anyone else that runs into this thread. (which by the way showed up on top of a google search in like its own special section).

    Jerry
    Participant

    Update on this. It turns out my code was insufficient. If have fixed it, sort of, which has led to another problem. First, here is the updated code:

    <?php
    /* 
    		Plugin Name: Recent bbpress Topics
    		Plugin URI: http://whosgotbooks.com/wp-content/plugins
    		Description: A plugin to display recent bbpress topics across the network
    		Version: 1.0.0
    		Author: Jerry Caldwell
    		Author URI: http://whosgotbooks.com
    		License: Open Source
    */ 
    function recent_bbpress_topics_shortcode() {                  
      recent_bbpress_topics(); }
      add_shortcode( 'recent-bbpress-topics', 'recent_bbpress_topics_shortcode' );
    
    //Add Recent Topics to BBPress
    function recent_bbpress_topics() {
    	switch_to_blog(9);
      if ( bbp_has_topics( array( 'author' => 0, 'show_stickies' => false, 'order' => 'DESC', 'post_parent' => 'any', 'posts_per_page' => 7 ) ) ) { 
          bbp_get_template_part( 'bbpress/loop', 'topics' );
          }
    // Hook into action
    add_action('bbp_template_after_forums_loop','recent_bbpress_topics');
    } ?>

    Using the line “switch_to_blog(9);” works great to get the topics from site 9 to the main site. But now my problem is; it brings some unwanted behavior. The main content looks great, but the sidebars change to the format of site 9. Perhaps this has become a wordpress issue and not a bbpress issue? Perhaps I need to use code in addition to “switch_to_blog(9);” that prevents the unwanted behavior? If I need to change this to a wordpress thread, please let me know and I will. Otherwise, if you can provide a solution, that would be great.

    Jerry
    Participant

    Thanks Robin! Thanks Peter! After some trouble-shooting, the answer is as follows:

    #content ul {
    padding: 0;
    margin-left: 0;
    list-style: none;
    }

    For some reason, if I use “ul” twice after “#content”, it doesn’t quite work.
    I was using firebug, and had identified line 118 in style.css, but just didn’t make the exact connection on how to change it. I used firebug again this morning, and learned how to use it better, so thanks for leading me to a great lesson!
    Robin; if you want to make this into a plugin where the user gets some options on the back-end, I will be happy to help with the grunt work and you can post it and get the credit. Just let me know, and give me some direction.
    Thanks again…

    PS For anyone who uses this code, I made the css changes in my style.css within my Child Theme, not the main style.css.

    #148852
    mattmatt88
    Participant

    I already have a multisite with subdomains:

    myurl.com
    page1.myurl.com
    page2.myurl.com
    page3.myurl.com

    Now I want, that the same forum content is used for every page.
    So the same forum should be available for every page:

    myurl.com/forum
    page1.myurl.com/forum

    For example, I’ve got a points system plugin that is multisite compatible (mycred).
    I just have to set it on the main page (myurl.com) and the points logs are the same on every page. That’s what I would need for the forum.

    Why I need it on every page and I’m not just linking to the main page forum:
    e.g. because I want to use shortcodes/widgets to show the user the most recent forum topics, doesn’t matter if he is on a subsite (e.g. page2.myurl.com/forum).

    Thanks a lot

    #148849

    In reply to: Remove Private Tag

    Robin W
    Moderator

    yes put this code in your functions file

    add_filter('protected_title_format', 'ntwb_remove_protected_title');
    function ntwb_remove_protected_title($title) {
    	return '%s';
    }
     
    add_filter('private_title_format', 'ntwb_remove_private_title');
    function ntwb_remove_private_title($title) {
    	return '%s';
    }

    for information on functions files see

    Functions files and child themes – explained !

    #148844
    peter-hamilton
    Participant

    Thanks for checking it out, is there a way you could upload an image of how it shows, and what screen resolution do you use cause my @media css is not complete.

    Yep I am redoing all CSS from scratch and added the essential plugins hardcoded to make them less bulky on code.

    Again I really appreciate all input to make this a reasonable theme for all to use.

    Peter Hamilton

    Jerry
    Participant

    I have been working for about 5 days to get topics from a forum on one site to show on my main page, which is a separate site. I’m running current versions of wordpress multisite, bbpress, and buddypress on my main page.

    I found some code via my searches and created a simple plugin. It works to display topics from a separate site on my main page. That was a victory for sure. The problem I am now having is the formatting! Arrghh! I cannot get it to format correctly.

    I know that others have been wanting to do this, so perhaps someone else can get me to the final step and we can publish a good plugin. Here is the code:

    <?php
    /* 
    		Plugin Name: Recent bbpress Topics
    		Plugin URI: http://whosgotbooks.com/wp-content/plugins
    		Description: A plugin to display recent bbpress topics across the network
    		Version: 1.0.0
    		Author: Jerry Caldwell
    		Author URI: http://whosgotbooks.com
    		License: Open Source 
    */ 
    
    function recent_bbpress_topics_shortcode() {                  
      recent_bbpress_topics(); }
      add_shortcode( 'recent-bbpress-topics', 'recent_bbpress_topics_shortcode' );
    
    // ! // Add Recent Topics to BBPress
    function recent_bbpress_topics() {
      if ( bbp_has_topics( array( 'author' => 0, 'show_stickies' => false, 'order' => 'DESC', 'post_parent' => 'any', 'posts_per_page' => 8 ) ) ) { 
          //bbp_get_template_part( 'bbpress/loop', 'topics' );
          bbp_get_template_part( 'loop', 'topics' );
          }
    // Hook into action
    add_action('bbp_template_after_forums_loop','recent_bbpress_topics');
    
    } ?>

    I have been trying to get this to format with bbpress.css. I managed to changed the css on one of my sites to get things how I want, but I can’t with this function. Here is a link of how I want things to look: http://whosgotbooks.com/book-reviews/
    And here is the link of the main page, where I can’t quite get it the way I want it: http://whosgotbooks.com/

    Here is the bbpress.css that worked on the review page, but doesn’t work for the main page:

    li.bbp-topic-title {
    	float: left;
    	text-align: left;
      overflow: hidden;
    	width: 75%;
    }
    #bbpress-forums li.bbp-body ul.topic {
    /*	border-top: 1px solid #7D573A; */ 
      border-top: transparent;
    	overflow: hidden; 
      display: inline-table;  
    	padding: 8px;
      width: 22%;
    }

    To get the books somewhat organized on the main page, I had to change width to 20% on the bbp-topic-title class above, and the bbp-body ul.topic changes do not help on the main page.
    This is the extent of my abilities. I would love to get rid of those annoying dots as well. Hopefully someone can help me get the rest of the way.
    Thanks…

    #148823
    Robin W
    Moderator

    If you’ve cracked the code for the submenu, then groups are a buddypress thing, so their forum might be better.

    But from total ignorance try….

    If you’ve phpmyadmin access, you could set up a user for a group, and see what changes in the usermeta, and then use this to create your filter

    eg
    if say you found that buddypress_group was what was used for groups, you could set the group using

    $current_user = wp_get_current_user();
    $group=get_user_meta( $current_user , 'buddypress_group', true);
    

    then dependant on group

    if ($group==22) then...
    if ($group==23) then....
    
    #148821
    Robin W
    Moderator

    In essence if I understand it you want to change the

    reply/edit/merge/trash/close/trash/reply links that come up with a topic or reply so that only some show, and others are in a dropdown list.

    is that correct?

    if so then

    my goal with this is to call each admin link individually and make only 2 or 3 to be visible
    (reply,edit,maybe quote link from gd bbpress tools)

    simply requires you to filter for those you want to display

    open up

    bbpress/includes/replies/template.php

    and you’ll see the admin links function line starting at line 1811

    On lines 1840 to 1848 you’ll see the default links are added.

    So lets create a function to just have the first two

    you’ll see a filter in line 1841 (‘apply_filters’) and we can hook to that

    so

    //change admin links displayed
    function change_admin_links ($r) {
    $r['links'] = apply_filters( 'rw_reply_admin_links', array(
    				'edit'  => bbp_get_reply_edit_link ( $r ),
    				'move'  => bbp_get_reply_move_link ( $r )
    			), $r['id'] );
    return $r['links'] ;
    }
    add_filter ('bbp_reply_admin_links', 'change_admin_links' ) ;
    
    

    just leaves us with edit and move.

    This also gives you the ability to add a new link, with say your dropdown list.

    You’ll also see that this function checks if it is a topic on line 1825, and you’ll need to similarly create a function for that – I’ll leave you to work that one out.

    Come back if you need more help, and when you crack this, can you post the finished code to this site so we can see what it looks like.

    #148818
    Robin W
    Moderator

    no the file is one that belongs to your theme called just functions.php

    you’ll find it at

    wp-content/themes/%yourthemename%/functions.php

    where %yourthemename% is the name of your theme.

    If you don’t have a child theme, then you should create one, see

    Functions files and child themes – explained !

    #148812
    Robin W
    Moderator

    yes, drop this into your functions file.

    Functions files and child themes – explained !

    This will send users to the /forums/ page whenever they log out -whether private or public forum or on a topic or reply, or anywhere within bbpress. If you logout, you’re saying your done, so taking you back to the index seems a logical place to end up !

    You can change the $url to say ‘/home/’ if you want the home page,

    //sends the user to $url - in this case '/forums/'  
    function rw_logout ($redirect_to) {
    	$url='/forums/' ;
    	$redirect_to = '<a href="' . wp_logout_url( $url ) . '" class="button logout-link">' . esc_html__( 'Log Out', 'bbpress' ) . '</a>' ;
    	return $redirect_to ;
    	}
    	
    	add_filter ('bbp_get_logout_link', 'rw_logout') ;
    	
    #148800
    Robin W
    Moderator

    It could be coded, but it’s not possible at the moment.

    My private groups plugin is probably the closest – it lets you assign users to forums, but as the name suggests keeps the forums private. http://www.rewweb.co.uk/bbp-private-groups/

    I don’t currently have plans to offer that possibility.

    #148779
    Sam Rohn
    Participant

    the separate bbpress dynamic caps have been very frustrating for me, i had actually been able to rig something up as the OP described a few years ago with user role editor plugin, but it was broken by the caps change in 2.2 🙁

    Roles and Capabilities in bbPress 2.2

    an interface to set granular permissions per forum by user or user role for bbpress would be a HUGE boon, this is a core feature of all other forum software i am aware of

    otherwise, here is an article on customizing bbpress dynamic caps, haven’t tried this one yet

    http://gawainlynch.com/customising-dynamic-roles-in-bbpress-2-2/

    i have seen robin’s new plugin too, might do almost what i need but i haven’t had a chance to test it yet, but ultimately my goal would be the ability to create different forums for different customized (custom code or URE etc) member roles which are auto-assigned by s2 member

    sam

    #148778

    In reply to: Forum Structure error

    Stephen Edgar
    Keymaster

    If you can’t change the slug to forum and it stays as forum-2 check the trash folder, the permalink won’t be released until the deleted item is removed from the trash 😉

    #148776
    davidslessmaccom
    Participant

    Hi,

    Looking at our error log, we get a recurrent error generated by bbpress which has led to 502 errors. We are using WordPress 3.9 and bbpress Version 2.5.4. would you please advise us on this:

    Thank you. http://communication.org.au

    The error log looks like this:
    [Sun Jul 06 00:49:32 2014] [error] [client 124.191.29.124] LONG QUERY (1540 characters long generated in /nas/wp/www/cluster-1417/davidsless/wp-content/plugins/bbpress/includes/users/functions.php:1531):

    
    SELECT 
    COUNT(NULLIF(meta_value LIKE '%"administrator"%', false)), 
    COUNT(NULLIF(meta_value LIKE '%"editor"%', false)), 
    COUNT(NULLIF(meta_value LIKE '%"author"%', false)), 
    COUNT(NULLIF(meta_value LIKE '%"contributor"%', false)), 
    COUNT(NULLIF(meta_value LIKE '%"subscriber"%', false)), 
    COUNT(NULLIF(meta_value LIKE '%"bbp\\_keymaster"%', false)), 
    COUNT(NULLIF(meta_value LIKE '%"bbp\\_spectator"%', false)), 
    COUNT(NULLIF(meta_value LIKE '%"bbp\\_blocked"%', false)), 
    COUNT(NULLIF(meta_value LIKE '%"bbp\\_moderator"%', false)), 
    COUNT(NULLIF(meta_value LIKE '%"bbp\\_participant"%', false)), 
    COUNT(NULLIF(meta_value LIKE '%"shop\\_accountant"%', false)), 
    COUNT(NULLIF(meta_value LIKE '%"shop\\_worker"%', false)), 
    COUNT(NULLIF(meta_value LIKE '%"shop\\_vendor"%', false)), 
    COUNT(NULLIF(meta_value LIKE '%"customer"%', false)), 
    COUNT(NULLIF(meta_value LIKE '%"shop\\_manager"%', false)), 
    COUNT(NULLIF(meta_value LIKE '%"s2member\\_level1″%', false)), 
    COUNT(NULLIF(meta_value LIKE '%"s2member\\_level2″%', false)), 
    COUNT(NULLIF(meta_value LIKE '%"s2member\\_level3″%', false)), 
    COUNT(NULLIF(meta_value LIKE '%"s2member\\_level4″%', false)), 
    COUNT(NULLIF(meta_value LIKE '%"s2member\\_level5″%', false)), 
    COUNT(NULLIF(meta_value LIKE '%"s2member\\_level6″%', false)), 
    COUNT(NULLIF(meta_value LIKE '%"s2member\\_level7″%', false)), 
    COUNT(NULLIF(meta_value LIKE '%"s2member\\_level8″%', false)), 
    COUNT(NULLIF(meta_value LIKE '%"s2member\\_level9″%', false)), 
    COUNT(*) 
    FROM wp_usermeta 
    WHERE meta_key = "wp_capabilities", referer:
    

    Communication Research Institute

    #148775
    Stephen Edgar
    Keymaster

    Uncheck the bbPress setting “Forum Prefix – Prefix all forum content with the Forum Root slug” will be as close as you get giving you mydomain.com/blog/forum/

    The thing here is bbPress is a WordPress plugin so it ‘runs under’ WordPress.

    I am quite sure with a few tweaks of how your WordPress install is configured (you might also need some .htaccess rewrite rules) I think you could achieve what you are looking for though.

    See the following link on where I would start, will take a bit of planning and backups or course

    https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

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