Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 12,226 through 12,250 (of 32,504 total)
  • Author
    Search Results
  • #144601
    Robin W
    Moderator

    Ok, so my plugin I taking longer to develop than I thought – but they always do!

    But I have been through the code needed for what you are after, and it neatly cuts into a plugin of it’s own, so that is what I’ve done.

    The plugin and instructions are here

    bbp Private Forums Visibility

    Read you way through, and let me know if you have any difficulties.

    Because I have cut this for you, I haven’t made it very pretty as a plugin, so there aren’t settings for the permalink – you’ll see what I mean when you read the link.

    If this doesn’t do what you want or you find issues, please come back, I should be able to fix fairly easily whilst the code is fresh in my brain.

    Have a great weekend !

    #144589
    Robin W
    Moderator

    ‘…as I am not really firm in php code ‘ – your coding skills don’t look at all bad to me πŸ™‚

    Without testing, that looks fine to me – give it a go.

    You could choose to just edit that file, but if you do, keep a note of what you changed, as bbpress updates will overwrite it – purists will say you should never alter core files, but as this is already a plugin, I am less fussy (expecting to be criticised for this!), but do know what you’ve changed.

    To do it “properly” you’d need to either

    create these as new widgets by copying the code to your functions file and renaming it.
    create this as a plugin.

    If you need help in how to rename come back, and I’ll make a list of what you need to change, but you’ll need to be a bit patient, as I have loads of queries os, and you’ll need to join a queue !

    #144587

    In reply to: User Permission

    Robin W
    Moderator

    ‘Sorry still newbie to all these codes thing πŸ™‚ ‘ – Don’t worry I was there only last year, you’ll soon pick it up.

    Start with

    https://codex.wordpress.org/Functions_File_Explained

    So you need to add this to your theme’s function file.

    If you are using a main theme, then any updates to the theme may overwrite your addutions, so a child theme is better. However if you put it in your main theme, just keep a note of the changes so that you can add them back if needbe.

    Ideally you should create a child theme – google ‘child theme videos’ and you’ll see how to create this – it is very simple, and just lets you ‘add stuff’ to your main theme without any risk of losing it.

    Have fun !

    #144586

    In reply to: User Permission

    batmanfan
    Participant

    Oh. Where do I place this code. Sorry still newbie to all these codes thing πŸ™‚

    #144585

    In reply to: User Permission

    Robin W
    Moderator

    Try

    function annointed_admin_bar_remove() {
            global $wp_admin_bar;
    
            /* Remove their stuff */
            $wp_admin_bar->remove_menu('wp-logo');
    }
    
    add_action('wp_before_admin_bar_render', 'annointed_admin_bar_remove', 0);

    (stolen from the wordpress support forum, so haven’t tested)

    #144580

    In reply to: Private Messaging

    Stephen Edgar
    Keymaster

    Also BuddyPress, you need only enable the features you want to use πŸ™‚

    BuddyPress Components and Features

    #144569
    Nino
    Participant

    I think I found it at line 811:

    <a class="bbp-forum-title" href="<?php bbp_topic_permalink( $topic_id ); ?>"><?php bbp_topic_title( $topic_id ); ?></a>

    What do You mean (as I am not really firm in php code :-/ )? If I replace it by:

    <?php if ( is_user_logged_in() ) ?>
       //old code for logged in user
       <a class="bbp-forum-title" href="<?php bbp_topic_permalink( $topic_id ); ?>"><?php 
       bbp_topic_title( $topic_id ); ?></a>
    <?php else ?>
       //new code for NOT logged in user
       <a class="bbp-forum-title" href=""><?php bbp_topic_title( $topic_id ); ?></a>
    <?php endif ?>
    #144567
    Stephen Edgar
    Keymaster

    The [bbp-topic-index] shortcode will use the default 15 topics based on bbPress ‘Topics per page’ setting, upping this to 25 will show 25 topics per page on the topics view (example.com/topics), the topics page for each single forum and again the same for any place you use the above shortcode.

    #144565
    Stephen Edgar
    Keymaster

    I have yet to look closely at the code in each of the following plugin (I’m scared of Javascript, jQuery and AJAX ;)) though they might be a good starter for the functionality you are after.

    bbPress – Ajax Replies and bbPress – Ajax Topics

    #144564

    In reply to: Latest Topics

    Stephen Edgar
    Keymaster

    This is part of bbPress BTW, just open your site URL and add /topics eg example.com/topics

    #144559
    Nino
    Participant

    Same problem as me. I have today 5 projects and only one of them is an internetproject.

    But when I have time I will take a look at the code.

    And if someone else is interested: I think, this would be a nice feature with not so many work.
    If someone will make this, I would be very grateful and thankful πŸ™‚

    #144558
    Robin W
    Moderator

    I’m tinkering with a plugin as a challenge (by the time I’ve finished Stephen and JJJ will have written it into the core!) which I hopefully will finish in a week or so.

    In the meantime I documented a version that uses a Justin Tadlocks’ members plugin and Tehnik BBPress Permissions

    http://www.rewweb.co.uk/creating-bbpress-groups/

    This seems to work, but I would suggest you test the bbpress search functions (it’s on my list to do) to ensure it hides posts from search results. If not, and you can live without search, then just disable search in forums

    Layout and functionality – Examples you can use

    #144552
    Robin W
    Moderator

    and to answer Nino’s Q

    If you’re into coding, then yes

    the widgets code is held in

    bbpress/includes/common/widegets.php

    you could customise these and create them as new custom widgets

    For instance the topics widget starts on line 669, and line 811 does bbp_topic_permalink( $topic_id )

    You could add an if statement to create two different outputs logged in vs not logged in and alter not logged in to topic title.

    Not something I have time to do, but would be fun if you have the time

    #144537
    nirgalo
    Participant

    Hey, I want to set up the same kind of design bbpress support forum has for my site’s forum:
    – main page with latest topics (and page navigation), and forums as widgets on the left pane
    – when opening a forum : page with forum topics and forum info as widget on the left pane
    – topic page: topic as page and Topic info as widget

    How can I do that? Shortcodes do not seem to be enough. Like [bbp-topic-index] is only displaying the last 15 topics.

    #144535

    In reply to: Adsense Plugin

    Daniel J. Lewis
    Participant

    I would love to see this accept shortcodes, too. And it looks like I’m not the only one.

    #144531
    batmanfan
    Participant

    @hbombs86, you are good! thank you. This is what I did…

    // Output the topic tags
    		wp_tag_cloud( array(
    			'smallest' => 11,
    			'largest'  => 20,
    			'number'   => 80,
    			'taxonomy' => bbp_get_topic_tag_tax_id()
    

    however, the font size only show 11 on all – same size. Did I do something wrong? I thought it would randomly display 11 to 20?

    #144529
    Robin W
    Moderator

    If you’re into coding, then yes

    the widgets code is held in

    bbpress/includes/common/widegets.php

    you could customise these and create them as new custom widgets

    For instance the topics widget starts on line 669, and line 811 does bbp_topic_permalink( $topic_id )

    You could add an if statement to create two different outputs logged in vs not logged in and alter not logged in to topic title.

    Not something I have time to do, but would be fun if you have the time

    #144528

    In reply to: Tags

    batmanfan
    Participant

    Hi Stephen, I like to have it at the ‘sidebar’ please. I tried the code but I must have done it wrong (wrong paste) nothing happens πŸ™ help appreciated.
    Is there a plugin suitable for this?

    #144525
    Stephen Edgar
    Keymaster

    Basically take your original idea of using comments though substitute part of that idea with replies (or topics if you wanted new topics).

    bbPress has ‘mirror’ functions of WordPress for most things, if you could programmatically do ‘xyz’ with a comment in WordPress you can do the same ‘xyz’ function with a topic or reply in bbPress.

    Thats the easy bit by saying that, so either start reading our codex on what these functions are or look to hire a programmer who can do that for you. https://codex.bbpress.org/

    #144524
    Stephen Edgar
    Keymaster

    What you would want to do is create a page using the [bbp-forum-index] shortcode and then after that shortcode simply add the shortcode [bbp-topic-form]

    Check out the docs in the codex for how to start doing this:

    Codex

    Check out the bbPress conditional tags https://codex.bbpress.org/bbpress-conditional-tags/

    #144523
    Stephen Edgar
    Keymaster

    This started dues to an issue when importing from phpBB. If a user had depeted their own account on a phpBB forum, phpBB didn’t reattribute the post author to a different author, rather just removed the account from being able to login etc. phpBB stores the author name alongside each topic and reply so once said author has been deleted you have the option to also not delete the users topics or replies and when viewing said topic the original author’s name will still be attributed to the topic or reply.

    The goal was then to bbPress support this as when you import from a phpBB if the user doesn’t exist then we wouldn’t create a new user and as seen above if the user doesn’t exist then each topic and reply is attributed to the ‘Anonymous’ user.

    Over in bbPress Trac Ticket #2347 we came up with a solution.

    If you take a look at the patch I currently have sitting there (Keep in mind the current ‘Example.php’ customised importer you are using)

    https://bbpress.trac.wordpress.org/attachment/ticket/2347/2347.diff

    The first part in the phpBB.php section I added parts to import the topics user name, the replies username and then added a flag on the user that was being imported _bbp_phpbb_user_type. That gets enough of the data that we need into the WordPress database to enable us to manipulate that once the data has been imported.

    So at the moment if your Lotus DB has these details already attached to the topics and replies then adding this to your custom import would be the first step.

    Firstly in regards to Anonymous users in bbPress, an anonymous user CAN have a username and/or display and this is stored in wp_postmeta table as _bbp_anonymous_name and is what my comments in my previous reply were alluding to.

    Next up I added a new Repair Tool to basically post process this imported data, I create a query that joins all the topics data from wp_posts and wp_postmeta along with the topics old phpBB stored username. Once all that is in a SQL result table each topic that is by an ‘anonymous’ author is then updated to change the _bbp_anonymous_name associated with that particular topics store phpBB topic author name. Then the same process is repeated for each reply.

    So now we have deleted, closed, spammed users that were deleted or deactivated in some way form the legacy phpBB forum but the topics and replies were never deleted to keep the context of the original discussions.

    These are now all anonymous users in WordPress/bbPress but actually have the original display name/ user name keeping that same original context.

    So that is my theory I was getting to, make each of your imported Lotus users an anonymous user using their old original user/display name to keep that context of conversation.

    Now this is why you don’t need to worry about email addresses nor passwords as the accounts are not actual accounts just placeholders of the names from the original discussion.

    The next part of the puzzle is when your users now sign up to reactivate and participate in the new bbPress they are free to create there account, choose their username, customise their profile, pick a password, use any email address they choose etc etc.

    And the final part is now ‘Joe Blogs’ has created a new account on your site we just need a tool that will reattribute the posts currently under the anonymous user account ‘Joe Blogs’ to the now active user ‘Joe Blogs’ and the job is done. You can currently do just that with the standard WordPress User administration to delete a user and then reattribute that users posts to another user during the delete process. We just go and tweak that process to also allow/mimic/recreate that process to be able to reattribute the anonymous ‘Joe Blogs’ topics and replies to now active user ‘Joe Blogs’.

    So how’s all that sound? Clear as mud?

    I wrote another ‘post import’ repair tool yesterday that I had planned on integrating with the above tool today but time got away from me so hopefully I’ll have time in the morning to do this and will keep the scenario I outlined above in mind so it can be used for more than just imported phpBB forums and can be extended for other imported forums and custom imports.

    #144522
    myrko
    Participant

    I chose to show the topics by freshness at the forum root.

    How can I show the new-topipc form or at least a link to create a new topic there? (I don’t use any sidebars)

    Secondly, is there a php-code to determine if we’re looking at the forum root (forum homepage)? Thanks.

    Nino
    Participant

    Hello to all πŸ™‚

    I have a question is it possible to modify by code or by plugin the Widget (bbPress) Recent Topics that way:

    For logged in users links are on.
    For all not logged in the links are off. They only see the text.

    Does anyone has a hint for me? It is really important for me!

    Thanks and greetings

    Nino

    Stephen Edgar
    Keymaster

    Essentially you want a WordPress theme that works well on mobile (I haven’t looked at your site) and once that is sorted then replicate the CSS media queries that the theme uses for posts/pages etc for your bbPress templates.

    To get started modifying your CSS check out the codex docs https://codex.bbpress.org/

    #144516
    Stephen Edgar
    Keymaster

    Yes, the issue is fixed and will be released as part of WordPress 3.9 on 16th April.

    If you want to implement the fix yourself without waiting those 13 days you can grab the code from here and it it to your Twenty Fourteen themes style.css.

    https://core.trac.wordpress.org/changeset/27587

    EDIT: With or without the shortcodes it only works with the above patch.

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