Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 12,751 through 12,775 (of 32,521 total)
  • Author
    Search Results
  • #142217

    In reply to: Menu link to Profile

    lee990
    Participant

    hi I used a plug in called theme my log in by amending the code it only displays when the user is logged in. I don’t know if it works with other login modules or the same theory applies, but only took 10mins to do and I know nothing about php.

    Good luck

    and the added the code as suggested by Robin W on this thread

    <p>edit” >Amend Profile/Change password</p>

    I edited the file in theme my login, wp-content/plugins/theme-my-login/templates/user-panel.php
    and added the code in, so the whole file looks like;

    <?php

    /*

    If you would like to edit this file, copy it to your current theme’s directory and edit it there.

    Theme My Login will always look in your theme’s directory first, before using this default template.

    */

    ?>

    <div class=”login” id=”theme-my-login<?php $template->the_instance(); ?>”>

    <?php if ( $template->options[‘show_gravatar’] ) : ?>

    <div class=”tml-user-avatar”><?php $template->the_user_avatar(); ?></div>
    <p></BR>edit” >Amend Profile / Change password</p>

    <?php endif; ?>

    <?php $template->the_user_links(); ?>

    <?php do_action( ‘tml_user_panel’ ); ?>

    </div>

    it looks really good, well I think so.

    #142215
    Kris35
    Participant

    I’m having the same problem. Have a coder on it so will post the results hopefully when its fixed. The only thing I can think of is I redid my forum categoroes the other day. I changed them from being forums of a parent forum into being forums with no parent. I made them stand alone forums and those are the ones Im having trouble with.

    #142214
    Darth
    Participant

    Thank you so much! I looked through code for over an hour last night trying to find it. :/

    For now, I’ll just change it in the code. Simpler to re-do it with updates than to try and figure out how to code a child theme, lol.

    #142213
    Robin W
    Moderator

    If you’re reasonable at php, download a plugin I wrote for adding town and county to bbpress, and crack this open.

    bbPress town and county plugin

    It has the code to add two fields (town and county) to profile, which displays under the avatar on topics and replies. But you can alter and use this code to add any fields the users profile so that they can edit and update.

    #142212
    Robin W
    Moderator

    There are probably much cleverer ways to do this but find the following file

    wp-content/plugins/bbpress/templates/default/bbpress/loop-forums.php

    On line 19 you’ll find the following

    <li class="bbp-forum-info"><?php _e( 'Forum', 'bbpress' ); ?></li>

    change the ‘Forum’ to whatever you want it to read.

    If you just change it in this location, it will be overwritten each time bbpress updates.

    What you really need to do is to put it into your theme – see

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

    item 3 for how to do this, and part 2 of the guide (go to the codex home for this) discusses how to set up a child theme

    #142211
    Darth
    Participant

    How do I change the word “Forum” (Next to “Topics” and “Posts”) on the main forum page?

    I identified the code using Firebug, but I am not a coder so I have no idea where to find the code to change it:

    <li class=”bbp-forum-info”>Forum

    Thank you!

    #142205
    JeremyCh
    Participant

    The idea that I got from https://bbpress.org/forums/topic/profile-user-specified-fields/#post-2670 is not working. Following is the function that I have added in my theme’s functions.php

    function get_profile_info_keys_personal() {
    	return array(	
    		'first_name' => array(1, __('First name')),
    		'last_name' => array(1, __('Last name')),
    		'nickname' => array(1, __('Nickname')),
    		'display_name' => array(1, __('Display name')),
    		'telephone' => array(0, __('Telephone')), 
    		'city' => array(1, __('City')), 
    		'facebook' => array(0, __('Facebook')), 
    		'linkedin' => array(0, __('Linked In')), 
    		'user_url' => array(0, __('Website')), 
    		'signature' => array(0, __('Signature')),
    		'dob' => array(1, __('Date of Birth')), 
    		'state' => array(1, __('Home State')), 
    		'occupation' => array(1, __('Occupation')), 
    		'organization' => array(0, __('Organization')), 
    		'income' => array(1, __('Monthly Income')), 
    		'education' => array(1, __('Education')), 
    		'degree' => array(1, __('Degree')), 
    		'profession' => array(1, __('Profession')), 
    		'description' => array(0, __('Biographical Info')), 
    		'user_login' => array(1, __('Username')), 				
    		'email' => array(0, __('Email')), 
    		'pass1' => array(0, __('Password')) 
    	);
    }
    add_filter('get_profile_info_keys',	'get_profile_info_keys_personal');

    And the second question goes, what would be the corresponding page for adding new members ?

    Thanks a lot for all your help.
    Best.

    #142187
    FlyFishersCorner
    Participant

    EDIT note: Running bbPress 2.5.3 on WordPress 3.8.1
    My theme does not support sidebar widgets, so I instead created a page to house my forums. Additionally, I like the idea of being able to add some content above the forum index. I am running everything through a child theme.

    EDIT note: The breadcrumbs display in the bottom right of the header, in case it’s not obvious when looking.

    As it stands, I’ve added a login box and some content to the page, then used the [bbp-forum-index] shortcode to add my forum index. See the page here.

    Clicking into the first forum, “General Fishing Discussion” (my site is a fly fishing related one), I have no issues. The breadcrumbs can get me perfectly back to the page where the index resides. See here.

    Finally, I have created a couple test topics. Once I click on one of those topics, this is where my problem arises. Instead of the breadcrumbs being Forum>General Fishing Discussion>Topic Title, they switch to Home>Topic>Topic Title. Clicking the Topic link takes me to a 404 page. See it here.

    I’ve been tinkering with this for days, trying several different solutions from this site that I thought might work. The most recent was a fix suggested about two weeks ago whereby I copy the page.php file from my theme folder and rename it to bbPress.php to force bbPress to use it. I have seen no change. I will note that I tried placing it in the theme-child folder as well as the theme-child\bbPress\default folder. Neither worked.

    The other fix I tried that I thought might get me there was one posted here about 4 months ago that offered a replacement code for the loop-forums.php. Unfortunately, that didn’t work either.

    Does anyone have any other ideas? I really appreciate any help you guys can offer! I love the look and integration of bbPress, I just can’t have users running into walls after reading a topic and trying to navigate back out to other forums.

    Thanks in advance!

    #142182
    Robin W
    Moderator

    create new is at the bottom of a forum page – not always that obvious

    I created a page titled “add new topic” with the content of

    [bbp-topic-form]
    

    – the shortcode for creating a topic.

    I then use a text widget in the sidebar with the content of

    <a href="/add-new-topic/">Create a new topic</a>
    
    

    the “/add-new-topic/” is the permalink to the page.

    #142177

    Exciting news!

    The forum was imported successfully to a test development site.

    I used the plugin “Export Users 2 CSV” by Yoast ( https://wordpress.org/plugins/users-to-csv/ ) to import users.

    Then I used a modified version of Import Users by DagonDesign ( http://www.dagondesign.com/articles/import-users-plugin-for-wordpress/ ) to import the users.

    Important Note: When importing users with this plugin it WILL send notification emails to the Admin and the User. I ALMOST pressed “go” on importing 2,200 users — but then I decided to check the plugin code just in case; sure enough there’s this line of code wp_new_user_notification($user_id, $password); you should delete or comment out.

    Yes, the users will have to re-create their passwords. We will instruct them how to do that on the new forum. That’s perhaps the only drawback of this method. But since out of the 2,200 users there are perhaps only 100 current active users, it shouldn’t be too much of a hassle.

    I did have to write a custom PHP script to help this user export/import process, because the import and export plugins do not match in formatting. You can either do this custom in CSV or make a simple PHP script (took me 10 minutes) to take data from the export CSV and reformat it to meet the delimiters and the stricture of the import CSV. I can help people with this, just ask.

    This user import/export had to be a separate process because using bbPress Export and Import by PippinsPlugins ( https://github.com/pippinsplugins/bbPress-Export-and-Import ) did not properly attribute users to posts if it had to create the user. (It attributed the admin to most of the posts.)

    After the users were imported, I imported my 20 CSV files (~2,000 rows each file) and after much scrutiny in examination, I find that all users have been properly attributed to posts.

    Now all that’s left is performing this process again onto the live site, the fresh bbpress install. (Remember, always back up your site and database before you do this stuff.)

    #142154
    Robin W
    Moderator

    look at

    bbPress Styling Crib

    and see

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

    for where to put the changes if you’re not certain.

    #142144
    shauny007
    Participant

    I managed to remove the area at the header of the forum which states this topic has x amount of details etc by placing this code in functions.php

    add_filter( ‘bbp_get_single_forum_description’, ‘ja_return_blank’ );

    add_filter( ‘bbp_get_single_topic_description’, ‘ja_return_blank’ );

    function ja_return_blank() {

    return ”;

    }

    Is there a similar method to now remove voices. I just want post count to show in this area.

    Thanks, Shaun.

    maxasher
    Participant

    Hello, for security concerns on creation of my site I renamed my wp-content folder to something else. Now upon installation of BBpress I don’t see any of the options in the dashboard. It looks like in the plugin itself its coded to search for wp-content. Is there a way to override this so it can find it and function properly?

    Thanks for help.

    #142137
    malkah
    Participant

    Hi Gautam

    Im rather new to this.
    in wordpress dashboard I went to appearance>editor>Theme Functions (functions.php)

    where exactly in the code should I enter the code you indicated?

    thanks.

    #142136
    Gautam Gupta
    Participant

    I’d not suggest running anything like this but if it works well in your specific case, this should work:

    DELETE bad_rows.*
    from wp_posts as bad_rows
    inner join (
    select post_title, MIN(id) as min_id
    from wp_posts
    group by post_title
    having count(*) > 1
    ) as good_rows on good_rows.post_title = bad_rows.post_title
    and good_rows.min_id <> bad_rows.id and bad_rows.post_type NOT IN ('forum', 'topic', 'reply');
    #142135
    Gautam Gupta
    Participant

    You’re welcome. And the explanation:

    First I got undifined Variable for $topic_id so I added the $topic_id = 0; at the code, Zero stands for getting the topic ID from the loop ?

    Where the bbp_new_topic hook is called, the line says:

    do_action( 'bbp_new_topic', $topic_id );

    It calls all the functions hooked to bbp_new_topic and also passes the $topic_id parameter, which in our case is:

    function shmoo_auto_save_tags( $topic_id ) {

    During this stage, I do not think we’re in the loop (I maybe wrong, I haven’t checked). The topic id internally would be something different at the point of insertion, that’s why in our function we’re now passing the variable to other functions:

    $bbp_topic_content = bbp_get_topic_content( $topic_id );

    On a side note, you had done $topic_id = 0; at the very beginning of the function. Due to that, whatever topic id was being passed was being disregarded and instead set to 0.

    More on actions and filters: https://codex.wordpress.org/Plugin_API#Hooks.2C_Actions_and_Filters

    #142132
    gatelli
    Participant

    I followed the steps from http://codex.buddypress.org/getting-started/guides/migrating-from-old-forums-to-bbpress-2/ to migrate from Buddypress to bbpress.
    At step 6 (Repair bbPress 2 forum relationships) I can’t tick any box. Despite selecting one by one I the box remains blank…
    Please help ?
    WP 3.8 buddypress 1.9 and bbpress 2.5.3.

    #142130
    Shmoo
    Participant

    This is what I have right now,

    http://pastebin.com/4FGpJpvn

    First I got undifined Variable for $topic_id so I added the $topic_id = 0; at the code, Zero stands for getting the topic ID from the loop ?

    #142129
    Gautam Gupta
    Participant

    Paste the full code again?

    #142118
    shauny007
    Participant

    Actually that was naive of me, and I now have figured out the problem, but not the fix. Here is what actually happens:

    I upload items to website also, but sometimes in future the same exact item may be in the update, I would then end up with domain-name/item domain-name/item2 domain-name/item3 These are duplicates, I simply delete all these by running this code:

    DELETE bad_rows.*
    from wp_posts as bad_rows
    inner join (
    select post_title, MIN(id) as min_id
    from wp_posts
    group by post_title
    having count(*) > 1
    ) as good_rows on good_rows.post_title = bad_rows.post_title
    and good_rows.min_id <> bad_rows.id;

    This is what is deleting all the forum posts 100%, checked and tested it. The only thing is, I do need to run this. Is there a way to exclude in this code bbpress posts, or something?

    #142104
    marky_uk
    Participant

    Hey hey … I can’t go back to edit my code … the second piece of code … the first line has just got one & and should have TWO!

    So it should read:

    if ( true === $r['hierarchical'] && 1==2) {
    	$walker      = new BBP_Walker_Reply;
    	$total_pages = ceil( (int) $walker->get_number_of_root_elements( $bbp->reply_query->posts ) / (int) $replies_per_page );
    } else {
    	$total_pages = ceil( (int) $bbp->reply_query->found_posts / (int) $replies_per_page );

    And don’t forget this is totally an experiment at my end here … but it’s working well on two local dev installations and our dev server setup 🙂

    #142095
    Gautam Gupta
    Participant

    Just realized that the ‘similar’ thing for topics doesn’t exist. Your method for topics is correct, and you’ll need something like this after you’ve the $words array:

    $words = array_unique( array_merge( $words, wp_get_post_terms( $topic_id, bbp_get_topic_tag_tax_id(), array( 'fields' => 'names' ) ) ) );
    if ( !empty( $words ) )
         wp_set_post_terms( $topic_id, $words, bbp_get_topic_tag_tax_id(), true );

    The top of the code should read as (to accept the $topic_id passed by do_action):

    add_action( 'bbp_new_topic',  'shmoo_auto_save_tags', 10, 1 );
    add_action( 'bbp_edit_topic', 'shmoo_auto_save_tags', 10, 1 );
    
    function shmoo_auto_save_tags( $topic_id ) {

    Again, untested, but should work in principle.

    #142093
    Gautam Gupta
    Participant

    Better hook it to bbp_new_reply_pre_set_terms here: https://bbpress.trac.wordpress.org/browser/trunk/includes/replies/functions.php#L371 and return the $words array after joining in the supplied $terms array. Similarly for topic.

    I’d also suggest to have this at the very beginning:

    if ( !bbp_allow_topic_tags() || !current_user_can( 'assign_topic_tags' ) )
    return $terms;
    #142091
    shearamariz
    Participant

    Hi bbpress Admin,

    I am having a problem with the bbpress pagination.
    Especially when I call the shortcode [bbp-topic-index].
    The thing is it must be showing all the posts and yet when you click the 2/page 2 you are redirected to a 404 error.

    I hope someone could help me.

    Thanks.

    #142086
    Shmoo
    Participant

    Okay as the title says I need a little help finishing a small bbPress plugin.

    Right now it checks each topic content against the bbPress topic-tags created from the back-end ( only those are assigned not empty tags ) and if there are matches between the tags and content it echo’s those matches found.

    The only deal-breaker here is how to add those matches found the $word Variable to each topic tags when you create a new topic or edit a topic fron the front-end.

    I believe you have to work with those two actions:

    
    add_action( 'bbp_new_topic',  'function_name', 10, 5 );
    add_action( 'bbp_edit_topic', 'function_name', 10, 5 );
    

    But how do you make the connection to the database table or how it’s called.

    This is the code I already made.
    http://pastebin.com/d7ZEifNb

    This Plugin was an idea because of this topic.

    Opinion: Tags in bbPress, do you like it or frustration to maintain?

    Some help from anybody who knows PHP and creating WP Plugins would be very cool.

    Thanks..

Viewing 25 results - 12,751 through 12,775 (of 32,521 total)
Skip to toolbar