Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 5,876 through 5,900 (of 32,505 total)
  • Author
    Search Results
  • #178304
    pawankumarr
    Participant

    $user = get_userdata( $user_id );
    $registerdate = $user->user_registered;
    echo date(“Y-m-d”, strtotime($registerdate));

    in this code please provide full code with bbpress user id

    there we can print actual date

    #178299
    Stephen Edgar
    Keymaster

    You’d need to first get the Discourse database converted to MySQL (I think it’s Postgres?)

    Once that’s taken care of a custom importer script could be created

    Custom Import

    I don’t know of anyone that has tried the above, but that method should work

    #178294
    traypup
    Participant

    Thanks @robkk — oddly, that didn’t do anything at all to the buttons. But, I added an !important and that did the trick. Thanks again!

    #178275
    Jon Fergus
    Participant

    Hi Robkk. I’m interested in allowing unrestricted html for certain known and approved members. I was able to use a User Role editor to allow specific users to post unrestricted html using the unfiltered_html capability, and when I log in with a test member (participant level), I can see the warning “Your account has the ability to post unrestricted HTML content” but when I make a reply with that member the reply doesn’t show up (after I click “submit” the page reloads but there’s no new reply). Seems like it’s being blocked from posting or something. Do you know what else I need to do in order to allow this member to reply with unrestricted html and have it actually work?

    p.s. I tried this https://gist.github.com/ntwb/7797990 but it didn’t solve the problem of regular members not being able to copy/paste from other programs (like Word) without the code showing up in the reply. See here: example of posting before and after adding code to functions.php to enable html formatting

    #178273
    Jon Fergus
    Participant

    When someone makes a reply to one of our topics, the automatic emails sent to subscribers of the topic contains style formatting that makes it very difficult to read.

    This is an example from a recent reply:

    <p class="MsoNormal">“The two schools of Buddha's doctrine, the esoteric and the exoteric, are respectively called the ‘Heart’ and the ‘Eye’ Doctrine. Bodhidharma called them in China — from whence the names reached Tibet — the <span style="font-family: 'Calibri','sans-serif';">Tsung-men</span> (esoteric) and <span style="font-family: 'Calibri','sans-serif';">Kiau-men</span> (exoteric school). It is so named, because it is the teaching which emanated from Gautama Buddha's <span style="font-family: 'Calibri','sans-serif';">heart</span>, whereas the ‘Eye’ Doctrine was the work of his head or brain. The ‘Heart Doctrine’ is also called ‘the seal of truth’ or the ‘true seal, a symbol found on the heading of almost all esoteric works.</p>
    <p class="MsoNormal">"Secret Heart" is the esoteric doctrine.</p>
    <p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; line-height: normal; mso-outline-level: 5;"><b><span style="font-size: 10.0pt; font-family: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman';">H. P. Blavatsky, The Voice</span><i><span style="font-size: 10.0pt; font-family: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman';"> of the Silence</span></i></b><b><span style="font-size: 10.0pt; font-family: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman';">, Fragment 11. The Two Paths. </span></b></p>
    <p class="MsoNormal">http://www.theosociety.org/pasadena/voice/voice2.htm#nn1</p>
    
    Post Link: http://nexus.universaltheosophy.com/groups/art-of-living-study-group/forum/topic/weekly-theme-for-contemplation-the-law-of-love/#post-3548

    This happens when people copy/paste into their reply from another program (i.e. Word, etc.). How can we strip this formatting in the emails?

    Details: we’re using the TinyMCE editor for replies, with “Text” and “Visual” field options. If members paste into the “text” field and then switch to the “visual” field before posting, there’s no issue, as wordpress cleans the content itself. But if people paste into the visual field, the formatting remains and gets sent as part of the auto email.
    Also, we’re currently running bbpress 2.5.10 and WordPress 4.6.1.

    #178256
    Scopique
    Participant

    I am trying to get bbPress to work with a theme that doesn’t have support for/within bbPress, and can fake it using custom Admin-created pages and shortcodes, and would also like to know this.

    #178249
    Robkk
    Moderator

    It could be a somewhat common CSS related issue where buttons have white text color in a theme.

    Try this custom css to see if it fixes it. Place the custom css in a custom css plugin or in a child themes style.css file.

    This is just an example and you might need additional css if the button background color changes on hover to something dark as well.

    #bbpress-forums .wp-editor-container .button {
      color: black;
    }
    #178247
    Robkk
    Moderator

    I personally do not need login info, because I think I know exactly what you are talking about. I am not sure who redacted your info, but know that it was to protect your site from untrusted users.

    What you are looking for is already part of bbPress, its just that the js code that it uses doesn’t quite work for all browsers, and only in IE.

    To fix the issue, you can create or copy the existing reply.js file in a folder called js that should be in the root of your child theme that consists of the new code that is in a trac ticket that fixes this issue.

    This guide will help with what you would need to do with the js file.

    Basically you create a folder called js in your child theme. And just place the new reply.js file.

    https://codex.bbpress.org/themes/theme-compatibility/

    Here is the code for the file. You can also just download the file.

    https://gist.github.com/robkk/e193a869a627f955b427440c13493fa6

    #178235
    Stephen Edgar
    Keymaster

    Ideally you should be using a child theme for your custom bbPress templates. That way you don’t have to worry about this issue 🙂

    Take a look on the docs codex for some help with getting started with custom templates:

    https://codex.bbpress.org/?s=child+theme

    With that said though, here is a link showing the changes from 2.5.9 to 2.5.10, it’s a single change to includes/users/template.php, and is quite important you upgrade your templates with this change.

    #178232
    Stephen Edgar
    Keymaster

    Hopefully some of the links on our codex docs page will help get you started:

    Codex

    #178231
    Robkk
    Moderator

    There are a few guides in the codex that might help.

    Are there any specific things you want to know how to customize??

    Customize is such a broad term, and relating to bbPress it can go from creating code snippets, installing plugins, to styling, to adjusting the bbPress theme to your needs in a child theme, or just creating a custom theme/theme package all together.

    #178206
    Robkk
    Moderator

    There is a few guides that might be helpful for you in the codex.

    Import Forums

    Custom Import

    Import Troubleshooting

    Share your custom import file here if you imported successfully, and maybe a detailed explanation for other users. If you need anymore help please reply back and someone will help you.

    #178180
    Don46
    Participant

    WP 4.6 BBpress plugin 2.5.10
    I am using some of the super BBpress code suggestions at https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/ and most work just fine ‘out of the box’ but I am not sure what I should be putting in place of ‘ my_nav_menu_profile_link’ in this one. If I put in the code as is….

    // Filter wp_nav_menu() to add profile link
    add_filter( 'wp_nav_menu_items', 'my_nav_menu_profile_link' );
    function my_nav_menu_profile_link($menu) {
        if (!is_user_logged_in())
            return $menu;
        else
            $current_user = wp_get_current_user();
            $user=$current_user->user_nicename ;
            $profilelink = '<li><a href="/forums/users/' . $user . '/edit">Edit Profile</a></li>';
            $menu = $menu . $profilelink;
            return $menu;
      
    }

    I get this when trying the menu link……
    Object not found!
    The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.
    If you think this is a server error, please contact the webmaster.
    Error 404
    localhost
    Apache/2.4.23 (Win32) OpenSSL/1.0.2h PHP/5.6.24

    If I replace the ‘ my_nav_menu_profile_link’ with the actual link like this…..

    /* Profile link in menu....................*/
    // Filter wp_nav_menu() to add profile link
    add_filter( 'wp_nav_menu_items', 'http://localhost/wordpress/wp-admin/profile.php' );
    function http://localhost/wordpress/wp-admin/profile.php($menu) {
        if (!is_user_logged_in())
            return $menu;
        else
            $current_user = wp_get_current_user();
            $user=$current_user->user_nicename ;
            $profilelink = '<li><a href="/forums/users/' . $user . '/edit">Edit Profile</a></li>';
            $menu = $menu . $profilelink;
            return $menu;
      
    }

    I get this as soon as I go to the site…

    Parse error: syntax error, unexpected ‘:’, expecting ‘(‘ in C:\xampp\htdocs\wordpress\wp-content\themes\twentytenchild\functions.php on line 49
    What should I be entering and when I move to a live site will it need to be further changed?

    #178177
    Robin W
    Moderator

    ok, I’ve spent several annoying hours trying to work out how to do this, and failed miserably!!

    I expect the answer is just a few brief lines of code, and linked to the way bbpress handles both templates and wp-rewrite, but can’t fathom it out in the files

    Sorry, but I am having to give up !

    #178173

    In reply to: Resizing avatar size?

    Robkk
    Moderator

    Here is for the revision log avatar fix. You can remove the custom CSS you added earlier that I think you tried to fix this issue with. The reply author avatars looked fine yesterday, now today they look small at 24px.

    use this code anywhere you can put custom css. I see that you are modifying the bbPress stylesheet, so hopefully you have placed that bbpress.css file in a child theme in a folder called css instead of editing core files.

    https://codex.bbpress.org/themes/theme-compatibility/

    #bbpress-forums p.bbp-topic-meta img.avatar, 
    #bbpress-forums ul.bbp-reply-revision-log img.avatar,
    #bbpress-forums ul.bbp-topic-revision-log img.avatar,
    #bbpress-forums div.bbp-template-notice img.avatar, 
    #bbpress-forums .widget_display_topics img.avatar, 
    #bbpress-forums .widget_display_replies img.avatar {
      float: none;
      margin: 0;
      vertical-align: middle;
      border: none;
      width: 14px;
      height: auto;
    }
    #178152
    Robkk
    Moderator

    I think you are using the bbPress moderation plugin, or a fork of it possibly.

    There might be a case you might not be using that plugin, and it could be the link limit bbPress uses that is located in the Discussion settings of your site.

    https://codex.bbpress.org/moderation-and-blacklisting/

    If the posts are pending it might be what I stated above, if its marked as spam, then of course its a spam plugin.

    #178149

    In reply to: topic post type issue

    Robkk
    Moderator

    You are probably going to have to rename the custom post type “topic” in bbPress then. And areas that might be needed to modify the topic post type.

    I think you need to check out the bbpress.php file in the bbPress plugin where the custom post types are registered. There might be a filter you can use that will make you be able to modify the code externally and safely without changing the core files internally, which I don’t suggest you do if you are a beginner in coding.

    #178147
    Robkk
    Moderator

    @darrenbergman93

    We also do not want another log in. We want them to be able to log into their profile in our student portal and that is it. They have access to the forum aswell and no additional login or registering, as right now we pre-create their profiles, no one registers.

    Like @netweb said bbPress and WordPress share user data, so as long as your student portal is compatible with WordPress it should be fine. You do not need a separate login for the forum as long as the student login, logs into your WordPress site.

    We need a forum that has all the features that a forum system includes, such as:
    Adding/Creating Threads by both Student and Admins. Instructors also need to be able to create them.
    We do not want external links like Share to facebook and such. As this is a forum in a portal and do not want anyone but Students having access to it.

    Ok, you can manually create users and assign different forum roles if need be. And you can create custom forum roles with help form a code snippet. You definitely need private forums, but I am not sure how private. Do you want private user groups for specific forums, only logged in users can see the forums, or only logged in users can see the whole site.

    We do not want a profiling. We already have a profile system where the profile in wordpress is their student profile which includes their address, email, username, phone number and also their student id. This information cannot be visible to other students.
    So either if this plugin gives an external profile system where it does not interact with the profile already made in the USERS area of wordpress it would work, but if it works with the USERS part of wordpress then the clickable link to view a profile, edit profile would need to be removed for our sake.

    There is a php code snippet around these forums to remove the author link in replies and topics from going to their profile and instead show up in the forum as text. Removing profile links in descriptions and a widget might need another code snippet, or it could be easily avoidable by not using a widget and removing the descriptions.

    bbPress doesn’t add any additional user meta fields if I remember correctly.

    Removing the profiles, I haven’t looked at what code you could possibly need, but it could be possibly avoidable by redirecting any user forum profiles (if users somehow reach them) to somewhere else.

    #178145
    Robkk
    Moderator

    Email address is required to post using anonymous/guest posting.

    In this stackoverflow topic, there is a php codesnippet/plugin you can use that might be helpful.

    http://wordpress.stackexchange.com/questions/131550/how-do-i-set-up-real-anonymous-posting-in-bbpress-forums

    #178141
    denisecontent
    Participant

    I have a client with a request that seems simple but I am having a dilly of a time figuring it out.

    They want to be able to charge users for premium posts. These posts will *not* appear at the top. Instead they will look different from other posts – bolded links, different color font – not at the users choice simply coded in by us. This will be a one time thing for a user – the users should not be able to do any other posts this way. I already set up the forum so that the client will approve all posts – he wants to be able to go in and click a button that will then style that post a different way.

    I can style the sticky to do this easily and have done so on my demo but am unsure how to proceed with his request. I do have a child theme.

    I know enough code to add stuff into functions and php pages. I am much better at HTML5 and CSS (can do animations).

    I have tried a few things I came up with on my own but they do not work and rather than show them I would rather hear your thoughts.

    Here is my demo – it is still pretty primitive… http://www.contentandsolutions.com/njywf/

    I am using
    Wordpress Version 4.6.1

    Customizr theme using child theme. Customizr Version: 3.4.23

    BBPress Plugin Version 2.5.10

    Code or a plugin (even a paid for plugin) if possible. Thank you!

    #178139
    Robin W
    Moderator

    Arguing with those trying to help you is probably not the best way forward.

    How to do a link is easily googled, but I’ve put one in here that you can add to the template

    <li>
    	<span class="vcard bbp-user-profile-link">
    		<a class="url fn n" href="www.mysite.com/read-this" title="read this">Read this</a>
    	</span>
    </li>
    #178138
    Dave
    Participant

    Why should that make a difference? Once I can find out how this is done I could add any content.

    To keep it simple, let’s just say hard coded text to display, when the user clicks on a link called “Read this”.

    Thanks.

    #178131
    giobby
    Participant

    Hi @senatorman , I think you’ve replied in the wrong topic (https://bbpress.org/forums/topic/bbpress-2-6-alpha-problem-importing-phpbb/page/2/#post-178123).

    Just to follow up on your error: I’ve copied and pasted my queries from a Ms Word document and something got broken.
    In fact you look at the single quotes in the queries they are all wrong (’ instead of ‘).

    I have fixed the query for you and you can find the new version below:

    
    /* Get all posts with wrong author and correspondent right author from translator table */
    
    create table TMP_ORPHANS as
    select
    <YOUR_SCHEMA>.wp_posts.ID,
    <YOUR_SCHEMA>.wp_posts.post_author,
    <YOUR_SCHEMA>.wp_bbp_converter_translator.value_id real_author,
    IFNULL(<YOUR_SCHEMA>.wp_posts.post_date, NULL) post_date,
    IFNULL(<YOUR_SCHEMA>.wp_posts.post_date_gmt, NULL) post_date_gmt,
    <YOUR_SCHEMA>.wp_posts.post_content,
    CASE
    WHEN <YOUR_SCHEMA>.wp_posts.post_type = 'reply'
    THEN (SELECT tmposts.post_title from <YOUR_SCHEMA>.wp_posts as tmposts where tmposts.id = <YOUR_SCHEMA>.wp_posts.post_parent)
    ELSE <YOUR_SCHEMA>.wp_posts.post_title
    END post_title,
    <YOUR_SCHEMA>.wp_posts.post_excerpt,
    <YOUR_SCHEMA>.wp_posts.post_status,
    <YOUR_SCHEMA>.wp_posts.comment_status,
    <YOUR_SCHEMA>.wp_posts.ping_status,
    <YOUR_SCHEMA>.wp_posts.post_password,
    <YOUR_SCHEMA>.wp_posts.post_name,
    <YOUR_SCHEMA>.wp_posts.to_ping,
    <YOUR_SCHEMA>.wp_posts.pinged,
    IFNULL(<YOUR_SCHEMA>.wp_posts.post_modified, NULL) post_modified,
    IFNULL(<YOUR_SCHEMA>.wp_posts.post_modified_gmt, NULL) post_modified_gmt,
    <YOUR_SCHEMA>.wp_posts.post_content_filtered,
    <YOUR_SCHEMA>.wp_posts.post_parent,
    <YOUR_SCHEMA>.wp_posts.guid,
    <YOUR_SCHEMA>.wp_posts.menu_order,
    <YOUR_SCHEMA>.wp_posts.post_type,
    <YOUR_SCHEMA>.wp_posts.post_mime_type,
    <YOUR_SCHEMA>.wp_posts.comment_count,
    (	select <YOUR_SCHEMA>.wp_postmeta.meta_value
    from <YOUR_SCHEMA>.wp_postmeta
    where
    <YOUR_SCHEMA>.wp_postmeta.meta_key = '_bbp_author_ip' and
    <YOUR_SCHEMA>.wp_postmeta.post_id = <YOUR_SCHEMA>.wp_posts.id
    ) user_ip
    from <YOUR_SCHEMA>.wp_posts
    left join <YOUR_SCHEMA>.wp_users on <YOUR_SCHEMA>.wp_posts.post_author = <YOUR_SCHEMA>.wp_users.id
    left join <YOUR_SCHEMA>.wp_bbp_converter_translator on <YOUR_SCHEMA>.wp_posts.post_author = <YOUR_SCHEMA>.wp_bbp_converter_translator.meta_value
    where
    <YOUR_SCHEMA>.wp_posts.post_type in ('forum', 'reply', 'topic') and
    (<YOUR_SCHEMA>.wp_users.id is null or
    <YOUR_SCHEMA>.wp_users.id = 1) and
    <YOUR_SCHEMA>.wp_bbp_converter_translator.value_type = 'user' and
    <YOUR_SCHEMA>.wp_bbp_converter_translator.meta_key = '_bbp_old_user_id';
    
    /* Do this to be able to create indexes later – some may not work */
    ALTER TABLE TMP_ORPHANS modify column post_date datetime default NULL;
    ALTER TABLE TMP_ORPHANS modify column post_date_gmt datetime default NULL;
    ALTER TABLE TMP_ORPHANS modify column post_modified datetime default NULL;
    ALTER TABLE TMP_ORPHANS modify column post_modified_gmt datetime default NULL;
    ALTER TABLE TMP_ORPHANS modify column user_ip varchar(40);
    ALTER TABLE TMP_ORPHANS modify column post_title varchar(255);
    
    /* we create indexes to speed up the update process */
    ALTER TABLE TMP_ORPHANS ADD INDEX(post_date);
    ALTER TABLE TMP_ORPHANS ADD INDEX(post_author);
    ALTER TABLE TMP_ORPHANS ADD INDEX(real_author);
    ALTER TABLE TMP_ORPHANS ADD INDEX(user_ip);
    ALTER TABLE TMP_ORPHANS ADD INDEX(post_title);
    
    /* Revert bad authors to good authors */
    UPDATE
    <YOUR_SCHEMA>.wp_postsINNER JOIN <YOUR_SCHEMA>.TMP_ORPHANS
    ON <YOUR_SCHEMA>.wp_posts.id = <YOUR_SCHEMA>.TMP_ORPHANS.id
    set <YOUR_SCHEMA>.wp_posts.post_author = <YOUR_SCHEMA>.TMP_ORPHANS.real_author
    where <YOUR_SCHEMA>.wp_posts.post_type in ('reply', 'topic') ;
    
    /* Drop TMP table */
    DROP TABLE <YOUR_SCHEMA>.TMP_ORPHANS;
    

    Please remember to execute each query individually and not all of them together.
    You can easily distinguish the queries as I have put a comment before each of them.

    #178122
    giobby
    Participant

    I try to post here the steps I did to import from PHPBB to BuddyPress v2.6 alpha.
    The concept is the same of what you’ve already read in my previous post but I think the SQL scripts are different.

    So first of all I’ve created manually all the missing columns in my PHPBB tables (I was converting from an old version of PHPBB and the converter was expecting some columns that didn’t exist – this could not be your case):

    ALTER TABLE forum_forums
    ADD forum_posts_approved numeric;

    ALTER TABLE forum_forums
    ADD forum_topics_approved numeric;

    ALTER TABLE forum_topics
    ADD topic_posts_approved numeric;

    ALTER TABLE forum_profile_fields_data
    ADD pf_phpbb_facebook varchar(255);

    ALTER TABLE forum_profile_fields_data
    ADD pf_phpbb_twitter varchar(255);

    ALTER TABLE forum_profile_fields_data
    ADD pf_phpbb_occupation varchar(255);

    ALTER TABLE forum_profile_fields_data
    ADD pf_phpbb_interests varchar(255);

    ALTER TABLE forum_profile_fields_data
    ADD pf_phpbb_location varchar(255);

    ALTER TABLE forum_profile_fields_data
    ADD pf_phpbb_youtube varchar(255);

    ALTER TABLE forum_profile_fields_data
    ADD pf_phpbb_skype varchar(255);

    ALTER TABLE forum_profile_fields_data
    ADD pf_phpbb_googleplus varchar(255);

    ALTER TABLE forum_profile_fields_data
    ADD pf_phpbb_website varchar(255);

    ALTER TABLE forum_profile_fields_data
    ADD pf_phpbb_aol varchar(255);

    ALTER TABLE forum_profile_fields_data
    ADD pf_phpbb_yahoo varchar(255);

    ALTER TABLE forum_profile_fields_data
    ADD pf_phpbb_icq varchar(255);

    ALTER TABLE forum_profile_fields_data
    ADD pf_phpbb_wlm varchar(255);

    Then I’ve performed this KEY STEP: insert a dummy row in the WP_USERS table with a very high userid (e.g.: 99999). This should be higher than the highest userid you have in your phpbb installation.
    In this way, when the users get converted, the system will assigned IDs starting from 100000 (again, if you have more than 100K users, then you need a higher value).
    This step is necessary, so you will always be able to distinguish the old id (PHPBB, < 100000) from the new one assigned after conversion (>= 100000).

    After that I’ve started the conversion (it took long).
    After converting, the authors of certain posts were wrong.
    There is a table that is generated after the conversion that maps the old IDs to the new ones.
    So I’ve execute the following scripts to readjust (cannot guarantee this would fix entirely the problem):

    /* Get all posts with wrong author and correspondent right author from translator table */

    create table TMP_ORPHANS as
    select
    <YOUR_SCHEMA>.wp_posts.ID,
    <YOUR_SCHEMA>.wp_posts.post_author,
    <YOUR_SCHEMA>.wp_bbp_converter_translator.value_id real_author,
    IFNULL(<YOUR_SCHEMA>.wp_posts.post_date, NULL) post_date,
    IFNULL(<YOUR_SCHEMA>.wp_posts.post_date_gmt, NULL) post_date_gmt,
    <YOUR_SCHEMA>.wp_posts.post_content,
    CASE
    WHEN <YOUR_SCHEMA>.wp_posts.post_type = ‘reply’
    THEN (SELECT tmposts.post_title from <YOUR_SCHEMA>.wp_posts as tmposts where tmposts.id = <YOUR_SCHEMA>.wp_posts.post_parent)
    ELSE <YOUR_SCHEMA>.wp_posts.post_title
    END post_title,
    <YOUR_SCHEMA>.wp_posts.post_excerpt,
    <YOUR_SCHEMA>.wp_posts.post_status,
    <YOUR_SCHEMA>.wp_posts.comment_status,
    <YOUR_SCHEMA>.wp_posts.ping_status,
    <YOUR_SCHEMA>.wp_posts.post_password,
    <YOUR_SCHEMA>.wp_posts.post_name,
    <YOUR_SCHEMA>.wp_posts.to_ping,
    <YOUR_SCHEMA>.wp_posts.pinged,
    IFNULL(<YOUR_SCHEMA>.wp_posts.post_modified, NULL) post_modified,
    IFNULL(<YOUR_SCHEMA>.wp_posts.post_modified_gmt, NULL) post_modified_gmt,
    <YOUR_SCHEMA>.wp_posts.post_content_filtered,
    <YOUR_SCHEMA>.wp_posts.post_parent,
    <YOUR_SCHEMA>.wp_posts.guid,
    <YOUR_SCHEMA>.wp_posts.menu_order,
    <YOUR_SCHEMA>.wp_posts.post_type,
    <YOUR_SCHEMA>.wp_posts.post_mime_type,
    <YOUR_SCHEMA>.wp_posts.comment_count,
    ( select <YOUR_SCHEMA>.wp_postmeta.meta_value
    from <YOUR_SCHEMA>.wp_postmeta
    where
    <YOUR_SCHEMA>.wp_postmeta.meta_key = ‘_bbp_author_ip’ and
    <YOUR_SCHEMA>.wp_postmeta.post_id = <YOUR_SCHEMA>.wp_posts.id
    ) user_ip
    from <YOUR_SCHEMA>.wp_posts
    left join <YOUR_SCHEMA>.wp_users on <YOUR_SCHEMA>.wp_posts.post_author = <YOUR_SCHEMA>.wp_users.id
    left join <YOUR_SCHEMA>.wp_bbp_converter_translator on <YOUR_SCHEMA>.wp_posts.post_author = <YOUR_SCHEMA>.wp_bbp_converter_translator.meta_value
    where
    <YOUR_SCHEMA>.wp_posts.post_type in (‘forum’, ‘reply’, ‘topic’) and
    (<YOUR_SCHEMA>.wp_users.id is null or
    <YOUR_SCHEMA>.wp_users.id = 1) and
    <YOUR_SCHEMA>.wp_bbp_converter_translator.value_type = ‘user’ and
    <YOUR_SCHEMA>.wp_bbp_converter_translator.meta_key = ‘_bbp_old_user_id’;

    /* Do this to be able to create indexes later – some may not work */
    ALTER TABLE TMP_ORPHANS modify column post_date datetime default NULL;
    ALTER TABLE TMP_ORPHANS modify column post_date_gmt datetime default NULL;
    ALTER TABLE TMP_ORPHANS modify column post_modified datetime default NULL;
    ALTER TABLE TMP_ORPHANS modify column post_modified_gmt datetime default NULL;
    ALTER TABLE TMP_ORPHANS modify column user_ip varchar(40);
    ALTER TABLE TMP_ORPHANS modify column post_title varchar(255);

    /* we create indexes to speed up the update process */
    ALTER TABLE TMP_ORPHANS ADD INDEX(post_date);
    ALTER TABLE TMP_ORPHANS ADD INDEX(post_author);
    ALTER TABLE TMP_ORPHANS ADD INDEX(real_author);
    ALTER TABLE TMP_ORPHANS ADD INDEX(user_ip);
    ALTER TABLE TMP_ORPHANS ADD INDEX(post_title);

    /* Revert bad authors to good authors */
    UPDATE
    <YOUR_SCHEMA>.wp_postsINNER JOIN <YOUR_SCHEMA>.TMP_ORPHANS
    ON <YOUR_SCHEMA>.wp_posts.id = <YOUR_SCHEMA>.TMP_ORPHANS.id
    set <YOUR_SCHEMA>.wp_posts.post_author = <YOUR_SCHEMA>.TMP_ORPHANS.real_author
    where <YOUR_SCHEMA>.wp_posts.post_type in (‘reply’, ‘topic’) ;

    DROP TABLE <YOUR_SCHEMA>.TMP_ORPHANS;

    I hope this helps.

    Gio

    #178113
    dandr69
    Participant

    I deactivated bbpress today, and the next thing all site is broke with HTTP code 500.
    I tried to reset plugins, reset themes, checked for htaccess entries, nothing.
    I put it back, no chance.

    Class ‘BBP_Theme_Compat’ not found in /home/sites/pcforum.ro/public_html/wp-content/themes/pcf/functions_bb.php on line 32

    Update – i fix it.
    Found the code and remove it. Thanks

Viewing 25 results - 5,876 through 5,900 (of 32,505 total)
Skip to toolbar