Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 12,301 through 12,325 (of 32,504 total)
  • Author
    Search Results
  • #144293
    kvr28
    Participant

    copy loop-forums.php from plugins/bbpress/templates/default/bbpress into your theme directory, overwrite whats in the file with this code. bbpress will look for the file first in your theme before it looks in the bbpress directory, that way if bbpress updates, you won’t lose the file update. Should get the look you want

        <?php
         
        /**
         * Forums Loop
         *
         * @package bbPress
         * @subpackage Theme
         */
         
        ?>
         
        <?php do_action( 'bbp_template_before_forums_loop' ); ?>
         
        <?php while ( bbp_forums() ) : bbp_the_forum();
                       
                        /* We print the header only if we want to show a category or if it's the first item of a no-parent forum list */
                        if (bbp_is_forum_category() OR !$bbp_forums_noheader)
                                { ?>
         
                                <ul id="forums-list-<?php bbp_forum_id(); ?>" class="bbp-forums">
         
                                        <li class="bbp-header">
         
                                                <ul class="forum-titles">
                                                        <li class="bbp-forum-info"><?php if(bbp_is_forum_category()) { ?><a>"><?php bbp_forum_title(bbp_get_forum_parent_id()); ?></a><?php } else { _e( 'Forum', 'bbpress' ); } ?>
                                                        <li class="bbp-forum-topic-count"><?php _e( 'Topics', 'bbpress' ); ?>
                                                        <li class="bbp-forum-reply-count"><?php bbp_show_lead_topic() ? _e( 'Replies', 'bbpress' ) : _e( 'Posts', 'bbpress' ); ?>
                                                        <li class="bbp-forum-freshness"><?php _e( 'Freshness', 'bbpress' ); ?>
                                                
         
                                        <!-- .bbp-header -->
        <?php           } ?>
         
                                <li class="bbp-body">
               
        <?php           /* If the forum is a category, we're gonna make another loop to show its subforums and sub-subforums as if those were forums */
                                if(bbp_is_forum_category())
                                        {
         
                                        $temp_query = clone bbpress()->forum_query;
                                        bbp_has_forums('post_parent='.bbp_get_forum_id());
                                        while ( bbp_forums() ) : bbp_the_forum();
                                        bbp_get_template_part( 'loop', 'single-forum' );
                                        endwhile;
                                        bbpress()->forum_query = clone $temp_query;
         
                                        }
                                                else /* Otherwise, we print the forums the normal way */
                                        {      
         
                                        bbp_get_template_part( 'loop', 'single-forum' );
                                        $bbp_forums_noheader = 1; /* This prevents the header part to be printed again on next post in the loop */
         
                                        } ?>
         
                                <!-- .bbp-body -->
         
        <?php           /* Prints the footer only if :
                                        - it's a category
                                        - or if it's the last forum of a no-parent forum list
                                        - or if the next forum in the loop is a category */
         
                                if(     bbp_is_forum_category()
                                OR      (bbpress()->forum_query->current_post+1) == bbpress()->forum_query->post_count
                                OR      bbp_is_forum_category(bbpress()->forum_query->posts[ bbpress()->forum_query->current_post + 1 ]->ID))
                                { ?>
         
                                <li class="bbp-footer">
         
                                        <div class="tr">
                                                <p class="td colspan4">&nbsp;</p>
                                        </div><!-- .tr -->
         
                                <!-- .bbp-footer -->
         
                        <!-- .forums-directory -->
         
        <?php   unset($bbp_forums_noheader); /* Needed if we have 2+ no-parent forums with at least 1 category between them */
                        }  ?>
         
        <?php endwhile; ?>
         
         
        <?php do_action( 'bbp_template_after_forums_loop' ); ?>
    
    remymedranda
    Participant

    Hello,

    I am trying to make my Forum category index page at http://kylekushman.com/forum/

    have the same table separation and look as the topics list page…

    http://kylekushman.com/forum/forum/cannabis-cultivation/advanced-growing/

    Can anyone tell me what code I need to modify, add, or delete from the stylesheet to make this happen?

    #144279
    adressler
    Participant

    That sounds like the way to do it. I’m rather new to WordPress but I have a decent knowledge of PHP / MySQL. If it’s not too much of a pain, I’d really appreciate looking at some code to use as a starting point.

    #144276
    Robin W
    Moderator

    No problem – I spent several weeks getting my head around importing from a flat file database, in similar circumstances !

    The real issue here is whether you can get email addresses. If you can, then if you import users as per my previous, they can use “password lost” to re-do their passwords, and then it’ll all be fine.

    The problem otherwise is that posts link to user-id’s not names, so yes when they register they’ll get a new ID, and the old posts won’t show as theirs. Additionally logon names need to be unique so they can’t register with any existing username !

    OK so what would I do?

    I’d do as previous and create a user table to import, but call each user ‘old_xxx’ – you can do this before import, effectively your placeholder.

    As each user registers, you can run some code around the posts to remap them. You’ll get a registration notice, so if you cut some code, then you can just run this each time someone registers. Basically you would just enter there old username and their new one. The code would look up the old ID, the new ID, and then run through posts to remap to the new user. If you’d like help with that, just let me know and I’ll try and cut a quick loop code that you can run straight on the website (pw protected of course)

    #144272
    adressler
    Participant

    Thanks for the reply Robin,

    Ideally, it would be really nice not to have to manually register the 600 or so active members, but it’s doable if that is the only logical route.

    Long story short, the old site was built by a senior Lotus Notes dev, and he wrote so much custom code to get the site to do what it did. Whats worse is this guy passed away a couple years ago, and there is no commenting in the db. There is likely no way I can export all of the data, I consider myself lucky to have exported what I have now, which is just barely enough to get things converted to WP. This should be okay though, I can generate unique UserIDs and FKs with PHP and MySQL before importing into BBPress.

    My crazy idea that I had was to import these “old” authors as, effectively, name placeholders. Bogus/null values for user_pass and user_email, a php-generated user_login (something like “judygarland-old”, “abcdef12345-old” or similar), user_id (unique Auto Increment #), display_name (“Judy Garland”), and maybe user_nicename. These would only be used to show the Authors first + last name next to all of the old topics and replies I just imported from Lotus (they will not be logging in). When users re-register, they would create a completely new WP user (I’m using s2member to handle subscription info). I realize that “new” users will not be able to see their “old” user’s topic / reply counts, and total user counts will not be completely accurate, but that’s okay and manageable. At least they could create their new user accounts themselves, and I wouldn’t be responsible for making s2member link up properly with these old users.

    I guess I will try a few approaches and see which works best, and for anybody else doing something similar I will post my results. Thanks Robin for the ideas.

    Aaron

    #144268
    kvr28
    Participant

    check threads where you posted videos, if you used the embed codes, it will just show up blank, I noticed on some threads the original post was wrong, I’m getting some errors in my log whenever someone makes a post, I’m trying to work through that now

    you can see my forum here

    Forums

    you can keep the same tiered set up you you have now, just go under forums for bbpress, create a forum say cannabis cultivation and set it as a category under types in forum attributes, then take your soils, outdoor grows etc and set category as a parent, enter your orders for the forums to have the correct order displayed,

    that’s the biggest things I can think of right now

    #144267

    In reply to: Shotcodes not working

    yoshimitsu1234
    Participant

    I am using latest versions of all softwares and Plugins. Theme is wpzoom Gazeti.
    Example of error is http://www.desimedicos.com/forum
    Getting this 404 errors on all pages with any kind of bbpress shortcode irrespective of whether i am logged in or out.

    #144263

    In reply to: Block User

    Robin W
    Moderator

    It could with some coding, but this message probably applies to many situations eg not logged in

    Try this in your function file

    //This function changes oldtext to newtext
    function rchange_translate_text( $translated_text ) {
    	if ( $translated_text == 'oldtext' ) {
    	$translated_text = 'newtext'];
    	}
    	return $translated_text;
    }
    add_filter( 'gettext', 'rchange_translate_text', 20 );
    

    where old text is the old text, and new text the new.

    If you have more than one of these functions (seem to think I have given you this solution for another part), then just make sure the function name is unique eg this ones called rchange… so next time maybe call it schange… and change it in first and last lines to match.

    #144262

    In reply to: Shotcodes not working

    Robin W
    Moderator

    what shortcodes?
    what software versions of bbpress, buddypress and wordpress are you running?
    what theme?
    what plugins are you running?
    url of your site?
    when do you get 404 – logged in, not logged in?

    etc.

    We would love to help you, but give us a fighting chance of working out what is wrong by giving us some details 🙂

    Come back and we’ll do our best to hep you !

    #144250
    cliffrohde
    Participant

    I have a better than layman’s grasp of code, but not much better. Have read multiple threads. Is there an easy way to resolve the “Private: Private:” issue? I’d prefer there to be no “private” at all even though the forum is in fact private.

    #144247
    Robin W
    Moderator

    I imported from an access database (ditto conversion to sql) so know what you’re going through! see https://bbpress.org/forums/topic/documented-import-from-snitz-access-database/ for a blow by blow of how I did this and presume you’re already well into using custom importer https://codex.bbpress.org/import-forums/custom-import/

    Now given that you’re going to re-register users, then we only need the topics to be assigned to a user which exists, which then when they re-register you can set up properly.

    So for instance if you have a topic with the author name of “fred” – then you need a user fred to exist. This needs to be at ID level.

    So in essence you’ll need to import

    topic with author ID
    User with same ID

    Minimum info to create a user is (in theory – it may be less) ID, username, email and password.

    In my case they mapped from a snitz access forum (via sql) as follows

    MEMBER_ID _bbp_user_id
    M_NAME user_login
    M_PASSWORD _bbp_password
    M_EMAIL user_email

    So I would go about it this way.

    What we need to end up with is a topics/replies table that has a author ID (number) against each topic/reply.
    In a user table, we then need that same ID, together with name, password and email.

    So first I’d go back to my lotus notes and see if topics has an author ID. If not we’ll need to create one (we’ll do that in a minute).

    Then from the topics and replies lists create a set of autor names and (if it has them) ID’s

    Create a user table (in my case in excel, but presume you’re familiar with creating in lotus notes) with the following headings

    ID NAME PASSWORD EMAIL

    If your topics/replies doesn’t have user ID’s then you just need to populate this table with unique ones, I’m pretty sure that you can just start with 1 and increment them – wordpress will assign new ID numbers as they come across starting with the next number that wordpress is not using.

    For password, just put anything – and they can all be the same

    Emails must be unique in theory, but don’t need to exist so abc@def.com is fine (you’ll be fixing these as they register, so doesn’t matter). But as you’re importing directly into the database, I reckon you could get away with them all being a single fictitious one. But if you have the skills, I’d create them as increments eg abc1@def.com, abc2@def.com just in case

    so now you have a user table to import.

    If you topics and replies don’t have author ID’s, then now go back to the topics and replies tables and run macro to populate a new column using name against the user table you’ve just created to populate with id.

    Now we have topics with ID’s an da user table to import. Just check that column names match the importer, convert it all to sql, and off you go !

    #144246
    Juan
    Participant

    Finally I’ve written a small script to migrate kunena attachments to GD bbPress attachments. It is in a very early stage, any help are really wellcome. You must run the script as standalone and only after the kunena migration has been performend using the importer distributed with bbPress.

    Now I’d like to write a script to convert kunena BBCode into bbPress HTML because there are some bbcodes not converted.

    #144245
    yoshimitsu1234
    Participant

    I have added shortcodes to few pages on my site wit both bbpress and buddypress installed but i am getting 404 error on those pages. Is there any way to resolve this issue?

    #144240

    In reply to: Order of Topics

    RitaJoC
    Participant

    Thanks! I didn’t realize my question was answered. So, are you sure adding these codes won’t break the site? Thanks, again.

    #144235
    kvr28
    Participant

    well, looks like that stopped the errors, but it created another issue, every time you click on a different page in the forums, it just keeps reloading the most recent posts in that forum, it doesn’t happen in most recent topic page with shortcode, the pagination works fine there, any suggestions?

    #144233

    In reply to: Order of Topics

    batmanfan
    Participant

    @Stephen, newbie here. How and Where to add the above code please. Thank you so much.

    #144230
    Robin W
    Moderator

    This comes from your theme’s main style, in my case

    a:link { 
    color : #EEEEEE !important ; 
    }
    

    if you want to change this throughout your site, then drop this into your style.css (or amend the current setting)

    If you just want it in bbpress

    #bbpress-forums .bbp-author-name a:link { 
    color : #EEEEEE !important ; 
    }

    should work

    #144228
    Robin W
    Moderator

    No, nothing you can do, but I’ve just made an error in my plugin, and I think I have solved the problem above by chance !!

    The plugin will let you do this, but you’ll have to wait for the plugin though as it is still in dev – expect a week !

    I should be able to get content in as well with luck !

    Sorry can’t be sooner, but a lot of code to write properly now I know it works !

    and of course no guarantee that I won’t find some major flaw !

    #144223
    blessedtoes
    Participant

    It was there. I got one response which seemed – I’m not a coder, so I might have misunderstood – but seemed like my question was misunderstood, a redirect to a FB app developer page.

    It occurred to me to re-post over there but I don’t want to abuse the forum so decided to try here first. Thanks, Robin (and all).

    #144222
    adressler
    Participant

    I’m importing a large subscription forum from a custom-coded Lotus Notes / Domino database (*sigh*) which I converted to MySQL. The posts exported from Lotus include User’s first and last names, but no passwords, or email addresses. These old users won’t be able sign in, but their names should be displayed next to the posts they authored that were imported to the new WP site. I would like all users to re-register for the new site in order to post new topics, etc.

    So, is this even possible? Are email addresses/passwords required when importing Users based on the converter /plugins/bbpress/includes/admin/converters/Example.php? I’m really trying to avoid creating an Admin user named “Archived Author” to assign all 35,000 of these old topics/replies to.

    Thanks in advance.

    #144219
    Robin W
    Moderator

    ok, so that two posts I haven’t come back to you on !

    I had a dig, and this one is not a two minute answer, and I may not be able to solve it for you.

    However, I am working on a plugin for an entirely different use, but it is in the same code/function area, so as I am digging I try to see if I can work a fix for you.

    BUT, I may not within time available to me

    #144218
    Robin W
    Moderator

    do you mean no. 8 in the attached?

    bbPress Styling Crib

    #144214
    Robin W
    Moderator

    it means that someone has gained access to your site, and put some code into it.

    You really need to go through all of these to fully clean up the site and make sure any “backdoors” have been closed:
    https://wordpress.org/support/topic/268083#post-1065779

    How To Completely Clean Your Hacked WordPress Installation


    http://ottopress.com/2009/hacked-wordpress-backdoors/
    Additional Resources:
    http://sitecheck.sucuri.net/scanner/
    http://www.unmaskparasites.com/
    http://blog.sucuri.net/2012/03/wordpress-understanding-its-true-vulnerability.html

    or you can pay securi to fix it for you – see the link above !

    #144211
    virusek89
    Participant

    Hello @Robin Unfortunately, this code only changes the color of header
    and I want to change the color of the link which is next to the small avatar in freshness “link with the name of the author”

    #144210
    blessedtoes
    Participant

    Hi (again!) Robin-

    Thanks for the reply and for asking.

    It is for a blog. I’ve been using iFrames so I get the ad at the top and a goofy window people have to drag around (though I thought it cool), then I came to find out many object.

    I’d like to just have code to cap the title and a relevant image, just like posting a URL to FB.

    Thanks again,
    Matthew

Viewing 25 results - 12,301 through 12,325 (of 32,504 total)
Skip to toolbar