Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'codes'

Viewing 25 results - 426 through 450 (of 1,700 total)
  • Author
    Search Results
  • #175077
    Schoelje
    Participant

    [Warning]: DO NOT DO THIS ON A PRODUCTION DATABASE!
    My apologies for the caps, but this is really important 😉

    [Assumptions]: Debian/Ubuntu developmachine with phpMyAdmin.

    [Note]: Obviously I haven’t tested all Apache/MySql versions. This was done on SolydK (Debian Jessie). It is also not perfect. So, if somebody can improve on the code. Please, let me know.

    After you’ve setup a development machine, imported the phpBB data and checked that everything is working fine, you still need to convert the phpBB internal links like “viewtopic.php?p=####” or “viewtopic.php?t=####” to the slugs that are being used by bbPress.

    Let’s start!

    1) First you’ll need to install and compile lib_mysqludf_preg.
    Create a bash file install_preg.sh with this content:

    #!/bin/bash
    apt-get update
    apt-get install libpcre3-dev libmysqlclient-dev build-essential libmysqld-dev libpcre3-dev
    wget https://github.com/mysqludf/lib_mysqludf_preg/archive/testing.zip
    unzip testing.zip
    cd lib_mysqludf_preg-testing
    ./configure
    make  install
    make MYSQL="mysql -p" installdb
    service mysql restart

    Make it executable:
    chmod +x install_preg.sh

    And run it:
    ./install_preg.sh

    2) Install the stored procedures.
    In phpMyAdmin, select the database and the SQL tab.
    Paste the following codes separately, creating three stored procedures on your database:

    DELIMITER $$
    CREATE PROCEDURE sp_cleanup_replies()
    BEGIN
      -- declare cursor for reply url change
      DECLARE reply_cursor CURSOR FOR 
      SELECT DISTINCT old_post_id, REPLACE(<code>xkcom_posts</code>.<code>guid</code>, 'http://yoursite.com', '') AS new_url
      FROM (SELECT CAST(CONVERT(PREG_CAPTURE('/#p([0-9]+)/i', <code>post_content</code>, 1) USING UTF8) AS UNSIGNED) AS old_post_id FROM <code>xkcom_posts</code>) AS t1
      INNER JOIN <code>xkcom_postmeta</code> ON <code>xkcom_postmeta</code>.<code>meta_value</code> = old_post_id
      INNER JOIN <code>xkcom_posts</code> ON <code>xkcom_posts</code>.<code>ID</code> = <code>xkcom_postmeta</code>.<code>post_id</code>
      WHERE <code>xkcom_postmeta</code>.<code>meta_key</code> = '_bbp_old_reply_id'
      AND old_post_id IS NOT NULL
      ORDER BY old_post_id DESC;
      
      SELECT 'sp_cleanup_replies: START';
      
      -- Change posts
      OPEN reply_cursor;
      BEGIN
        DECLARE old_reply_id MEDIUMINT;
        DECLARE new_url VARCHAR(255);
        DECLARE search_string VARCHAR(255);
        DECLARE done INT DEFAULT FALSE;
        DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
    
        read_loop: LOOP
          FETCH reply_cursor INTO old_reply_id, new_url;
          IF done THEN
    	LEAVE read_loop;
          END IF;
          
          SET search_string = CONCAT('|[a-z0-9\.\-:\/&=\?\+]+#p', old_reply_id, '|i');
          SELECT CONCAT('sp_cleanup_replies: replace ', search_string, CONCAT(' with ', new_url));
          
          -- Uncomment the following line if you want to test the regexp
          -- SELECT CONVERT(PREG_REPLACE(search_string, new_url, <code>post_content</code>) USING UTF8) FROM <code>xkcom_posts</code> WHERE INSTR(<code>post_content</code>, CONCAT('#p', old_reply_id)) > 0; LEAVE read_loop;
          
          UPDATE <code>xkcom_posts</code> SET <code>post_content</code>= CONVERT(PREG_REPLACE(search_string, new_url, <code>post_content</code>) USING UTF8) WHERE INSTR(<code>post_content</code>, CONCAT('#p', old_reply_id)) > 0;
        
        END LOOP;
      END;
      CLOSE reply_cursor;
      
      SELECT 'sp_cleanup_replies: DONE';
      
    END$$
    DELIMITER ;
    DELIMITER $$
    CREATE PROCEDURE sp_cleanup_topics()
    BEGIN 
      -- declare cursor for topic url change
      DECLARE topic_cursor CURSOR FOR 
      SELECT DISTINCT old_topic_id, REPLACE(<code>xkcom_posts</code>.<code>guid</code>, 'http://yoursite.com', '') AS new_url
      FROM (SELECT CAST(CONVERT(PREG_CAPTURE('/t=([0-9]+)/i', <code>post_content</code>, 1) USING UTF8) AS UNSIGNED) AS old_topic_id FROM <code>xkcom_posts</code>) AS t1
      INNER JOIN <code>xkcom_postmeta</code> ON <code>xkcom_postmeta</code>.<code>meta_value</code> = old_topic_id
      INNER JOIN <code>xkcom_posts</code> ON <code>xkcom_posts</code>.<code>ID</code> = <code>xkcom_postmeta</code>.<code>post_id</code>
      WHERE <code>xkcom_postmeta</code>.<code>meta_key</code> = '_bbp_old_topic_id'
      AND old_topic_id IS NOT NULL
      ORDER BY old_topic_id DESC;
      
      SELECT 'sp_cleanup_topics: START';
      
      -- Change topics
      OPEN topic_cursor;
      BEGIN
        DECLARE old_topic_id MEDIUMINT;
        DECLARE new_url VARCHAR(255);
        DECLARE search_string VARCHAR(255);
        DECLARE done INT DEFAULT FALSE;
        DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
    
        read_loop: LOOP
          FETCH topic_cursor INTO old_topic_id, new_url;
          IF done THEN
    	LEAVE read_loop;
          END IF;
          
          SET search_string = CONCAT('|[a-z0-9\.\-:\/&=\?\+]+t=', old_topic_id, '|i');
          SELECT CONCAT('sp_cleanup_topics: replace ', search_string, CONCAT(' with ', new_url));
          
          -- Uncomment the following line if you want to test the regexp
          -- SELECT CONVERT(PREG_REPLACE(search_string, new_url, <code>post_content</code>) USING UTF8) FROM <code>xkcom_posts</code> WHERE INSTR(<code>post_content</code>, CONCAT('t=', old_topic_id)) > 0; LEAVE read_loop;
          
          UPDATE <code>xkcom_posts</code> SET <code>post_content</code>= CONVERT(PREG_REPLACE(search_string, new_url, <code>post_content</code>) USING UTF8) WHERE INSTR(<code>post_content</code>, CONCAT('t=', old_topic_id)) > 0;
    
        END LOOP;
      END;
      CLOSE topic_cursor;
      
      SELECT 'sp_cleanup_topics: DONE';
      
    END$$
    DELIMITER ;
    DELIMITER $$
    CREATE PROCEDURE sp_cleanup_missing()
    BEGIN
      -- declare cursor for reply url change
      DECLARE missing_cursor CURSOR FOR 
      SELECT DISTINCT old_post_id
      FROM (SELECT CAST(CONVERT(PREG_CAPTURE('|/&[a-z0-9=\+]+#p([0-9]+)|i', <code>post_content</code>, 1) USING UTF8) AS UNSIGNED) AS old_post_id FROM <code>xkcom_posts</code>) AS t1
      WHERE old_post_id IS NOT NULL
      ORDER BY old_post_id DESC;
      
      SELECT 'sp_cleanup_missing: START';
      
      -- Change posts
      OPEN missing_cursor;
      BEGIN
        DECLARE missing_reply_id MEDIUMINT;
        DECLARE search_string VARCHAR(255);
        DECLARE done INT DEFAULT FALSE;
        DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
    
        read_loop: LOOP
          FETCH missing_cursor INTO missing_reply_id;
          IF done THEN
    	LEAVE read_loop;
          END IF;
          
          SET search_string = CONCAT('|[a-z0-9&=\+]+#p', missing_reply_id, '|i');
          SELECT CONCAT('sp_cleanup_missing: remove ', search_string);
          
          -- Uncomment the following line if you want to test the regexp
          -- SELECT CONVERT(PREG_REPLACE(search_string, '#', <code>post_content</code>) USING UTF8) FROM <code>xkcom_posts</code> WHERE INSTR(<code>post_content</code>, CONCAT('#p', missing_reply_id)) > 0; LEAVE read_loop;
          
          UPDATE <code>xkcom_posts</code> SET <code>post_content</code>= CONVERT(PREG_REPLACE(search_string, '#', <code>post_content</code>) USING UTF8) WHERE INSTR(<code>post_content</code>, CONCAT('#p', missing_reply_id)) > 0;
        
        END LOOP;
      END;
      CLOSE missing_cursor;
      
      SELECT 'sp_cleanup_missing: DONE';
      
    END$$
    DELIMITER ;

    3) Run the stored procedures from terminal.
    It is important that you check some example posts with links that need to change. First the post links like “viewtopic.php?some_parameters#p#####”, then topic links like “viewtopic.php?some_parameters&t=#####” and lastly the links to missing posts are removed.

    mysql -u root -p -e 'CALL sp_cleanup_replies()' my_database

    mysql -u root -p -e 'CALL sp_cleanup_topics()' my_database

    mysql -u root -p -e 'CALL sp_cleanup_missing()' my_database

    Now, check your posts and when you’re happy you can drop the stored procedures:

    DROP PROCEDURE IF EXISTS sp_cleanup_replies;
    DROP PROCEDURE IF EXISTS sp_cleanup_topics;
    DROP PROCEDURE IF EXISTS sp_cleanup_missing;

    Mod note: edited and changed dev site from contributer to yoursite.com

    Robin W
    Moderator

    Not really sure what you are doing.

    Can you give us a link to a page showing the issue, and post the content of that page – ie the shortcodes etc. that is creating it.

    Robin W
    Moderator

    try the shortcodes in my style pack

    [bsp-display-topic-index show=’5′]

    https://wordpress.org/plugins/bbp-style-pack/

    #175069
    pcpro178
    Participant

    Are there shortcodes for getting a member/user’s recent posts or comments? I don’t see anything like this in the documentation. It seems like a rather basic thing to have with a bulletin board or forum.

    #175030
    semperaye
    Participant

    Is there a way to allow bbpress users with the “participant” role to upload media by url only, i.e. disable the media library. I want my users to be able to put pictures into their post that are hosted other places without having to figure codes and such.

    Thank you!

    #174985
    Robin W
    Moderator

    bbpress has various widgets and well as shortcodes, so you can call it from pages, posts and sidebars

    check out the documentation !

    #174878
    mikeyb
    Participant

    Hi guys

    I know this is more an issue with another plugin, but I thought I would post here as well in case anyone had an ideas

    See original post here

    I’m using the NextScripts: Social Networks Auto-Poster and since setting it up 3 days ago, I’ve come in after the weekend and found it’s killed any pages I have using BBpress shortcodes (eg [bbp-forum-index]) The direct links to the forums are working fine, it’s just pages containing shortocdes.

    Does anyone have any ideas please?

    u_Oi
    Participant

    Hi Guys!

    I found the guide where are the codes for “Show status labels for bbPress Topics”… Well, I want to add a label for “Topics with No replies”, i tried do it by myself but It makes me crazy..

    Does anybody know which reference or functions should I use?

    Thanks.

    #174846
    Robkk
    Moderator

    Can you post a link to the page on your site that you put the search form shortcodes, so I could test and see what possibly could be the issue.

    #174840
    rateyourway
    Participant

    Hi!

    I am very new to bbpress and i’m trying to set it up on my site.

    I have created a bbpress forum page where i display shortcodes. The shortcode for the search shows up, but it won’t find any topic.

    Anyone has an idea of what i’m doing wrong?

    Thanks!

    #174765

    In reply to: Help needed

    sharingdiscount
    Participant

    Hi there,
    I’m getting the same issue with this for my website Sharing Discout & Popular Codes
    Looking for the solutions

    Best,

    #174702
    dani8519
    Participant

    Hi there

    here an picture i want my forum:

    thats what i want

    how i dit it?

    i get an new site and add shortcodes like [bbp-single-forum id=3234]

    now the breadcrumbs are linking on the “original” root “/forums” link… so i have think, ok, make an site with the perma link on /forums/ and add the shortcodes…

    but when i dit this, my site looks like this:

    site now:

    so, can you please help me change “only” the one breadcrumbs to my custom site, or what can i do the “originally” “/forums/” works correctly with the shortcodes?

    thank you very much

    greetz

    #174584

    In reply to: Forum List

    Robin W
    Moderator

    not quite sure what you are after.
    can you not use the shortcodes

    https://codex.bbpress.org/features/shortcodes/

    #174504
    zimmermann.c
    Participant

    I was not aware that shotcodes even existed for bbp.
    Further to your advice I seached and found the documentation of all the SC’s. This is a great step for me.
    Thank you for your help

    #174209
    cigar07
    Participant

    Hi,

    [bbp-topic-form] is not working. I am able to use others shortcodes and they work fine but not the new topic form.

    Please can someone tell me the cause this shortcode isn´t working?

    #174098
    Pascal Casier
    Moderator

    OK, now I see !
    How about [bbp-lost-pass] ?
    Check out https://codex.bbpress.org/features/shortcodes/

    Pascal.

    #173948
    Robkk
    Moderator

    Well not a bbPress specific plugin, but there are a few plugins that can work with custom post types (bbPress uses custom post types).

    A plugin I found and tested is called NS Featured Posts, but like I said many other plugins could possibly work too.

    After installing the plugin make sure to go to Settings > NS Featured Posts and make sure to add the topic custom post type from bbPress in the plugin’s settings.

    Now we can go to Topics > All Topics and see a new column that says Featured. Make sure to click the checkbox near the topic you would want to feature.

    Now we are going to make a custom view to display these featured topics in a topic list, and also be able to display them in pages with a shortcode.

    Add this php code snippet into your child themes functions.php or insert this snippet into a custom plugin like functionality.

    This function displays about 10 featured topics on a single page, change 10 to whatever you want.

    function rkk_register_featured_view() {
     bbp_register_view( 'featured', __( 'Featured Topics' ),  array( 'meta_key' => '_is_ns_featured_post', 'meta_value' => 'yes', 'posts_per_page' => '10', 'max_num_pages' => '1'), false );
    }
    add_action( 'bbp_register_views', 'rkk_register_featured_view' );

    Now in a custom page or widget area that has a widget text area that can handle shortcodes, insert this shortcode.

    [bbp-single-view id='featured']`

    #173857
    Stephen Edgar
    Keymaster

    Probably the most noticeable issue after the import are the attachments. They are basically a number with opening and closing ATTACH bbcodes.

    I’m not quite sure what to do with attachments as bbPress import system does not yet support attachments ¯\_(ツ)_/¯

    I could add some code to “hide” the BBCode whilst still keeping it as a refernce?

    Also I’ve added support for YouTube, Daily Motion and Vimeo BBCode conversion

    Then there are the quotes to other posts. These simply just come in as text and the post IDs don’t match those in bbpress. In xenForo, the quoted posts link back to the post that was quoted.

    I’ve added some styling to the quotes now, so it wraps that quotes in “blockquote” and cites the authors name, e.g “wendellh wrote:”

    For now we can’t link to the quoted post, this is on my radar to do but requires some pretty big changes, maybe bbPress 2.8.

    I’ve also noticed that soft deleted posts (only viewable by mods and admins) in xenForo are coming in as public posts.

    Ah, I didn’t know about these types of posts, I’ve now done this, for topics/threads replies/posts that were “soft deleted” these are now imported with bbPress/WordPress “pending” status.

    #173853
    gdelle
    Participant

    Im trying to create a sub forum list style.

    Ive tried the bbstyle plugin and the various codes I found searching here.

    Only one to work at all was this. But its not what I want. The theme is Kleo with bbpress/buddypress.

    .bbp-forum-info a.bbp-forum-link {
    display: block;
    }

    #173842
    Wendell
    Participant

    Hey Stephen,

    I really appreciate your help! 🙂

    Probably the most noticeable issue after the import are the attachments. They are basically a number with opening and closing ATTACH bbcodes. For example:
    [ATTACH=full]872[/ATTACH]
    In xenForo, this links to attachments/photo-jpg.872

    Then there are the quotes to other posts. These simply just come in as text and the post IDs don’t match those in bbpress. In xenForo, the quoted posts link back to the post that was quoted. For example, here is an imported post with a quote:
    http://surveyorconnect.com/portal/index.php/forums/topic/july-2015-photo-submittal/#post-1647874
    and here is the original post in xenForo:
    http://surveyorconnect.com/threads/july-2015-photo-submittal.323039/#post-331560

    I’ve also noticed that soft deleted posts (only viewable by mods and admins) in xenForo are coming in as public posts.

    I realize I may be asking for too much, but I figure it doesn’t hurt to ask. 😉 I do understand though if it’s just not possible. I’ll keep looking around for other bbcodes as well.

    Thanks!

    #173604
    Pascal Casier
    Moderator

    Hi Biorn,

    Create a standard WordPress page and put the slug ‘forums’. Creating this page will override the standard page that comes out.

    You can then add the [bbp-forum-index] shortcode on that page (see https://codex.bbpress.org/features/shortcodes/) and change the title of your page.

    Pascal.

    TKServer
    Participant

    Nice plugin you created. Do you think it would be possible to create shortcodes in the next update? My theme is so old it does not have widget areas LOL.

    Thanks, cool plugin BTW.

    That’s an interesting suggestion. It would not be hard but for the settings. Since the widget settings are set inside the widget itself, I’d have to redo the settings and make them part of the plugin settings.

    I’ll see what I can do…

    tech55541
    Participant

    Hey @tkserver,
    Nice plugin you created. Do you think it would be possible to create shortcodes in the next update? My theme is so old it does not have widget areas LOL.

    Thanks, cool plugin BTW.

    #173410
    Pascal Casier
    Moderator

    You can put any of these codes into your functions.php of your (child) theme.

    #173347
    tech55541
    Participant

    Thanks @robkk, that worked.

    I was aware of the shortcodes, I just did not know you could use that value there.

Viewing 25 results - 426 through 450 (of 1,700 total)
Skip to toolbar