Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 13,776 through 13,800 (of 32,519 total)
  • Author
    Search Results
  • #137145

    In reply to: Multiple Forums

    Stephen Edgar
    Keymaster

    Sure is possible 🙂

    Take a read of this to help you on your way https://codex.bbpress.org/getting-started-with-bbpress/

    Make a category (forum) called ‘Fruits’ and then make your sub forums ‘Apples’, ‘Oranges’ etc
    Make another category (forum) called ‘Vegetables’ and sub forums ‘Potatoe’, ‘Carrots’ etc

    Create a WordPress page for each of your categories ‘Fruits’ and ‘Vegetables’

    Use the [bbp-single-forum id=$forum_id] bbPress shortcode on each of these pages with the forum_id of each category.

    #137132
    Stephen Edgar
    Keymaster

    I haven’t got much else to add except I think you have tried everything to find ‘spot the difference’ 😉

    I am glad it is sorted though.

    If you have SSH access to your host go on a code hunt 😉

    grep -i -r 'bbp_list_forums' * and/or grep -i -r 'bbp-forums-list' *

    This will find any reference to the term ‘bbp_list_forums’, there might be some rogue hiding spot where this is being used as a custom function somewhere.

    #137129
    Stephen Edgar
    Keymaster

    Forum Section

    • Added Forum Display Order using wbb1_1_board.sortOrder
    • Added wbb1_1_board.boardType and callback method callback_forum_type where category =1 & forum = 0
    • wbb1_1_board.isClosed & callback method callback_forum_status where closed =1 & open = 0
    • (Are the above values correct for these DB fields? I have guessed these ;))

    Topic Section

    • Changed callback method for Topic Language from callback_topic_reply_count to callback_topic_language
    • Added topic author ip
    • Your SQL join for the topic content looks good

    Reply Section

    • Fixed ‘Reply parent forum id’ (we need the ‘parent forum’ here not the first ‘post id’, the inline docs were not very clear here)
    • Removed ‘Reply Unregistered Author name’ (See #2347for more info)

    User Section

    • Added ‘User Signature’ wcf1_user.signature

    Generally cleaned up the code and inline docs to match the other importers.

    The updated version here: https://gist.github.com/ntwb/41b8bb57df78d1a1bd01
    The differences between versions here: https://gist.github.com/ntwb/41b8bb57df78d1a1bd01/revisions

    #137122
    Kaliceos
    Participant

    As you can see on line 478 from the code you pasted, the <br /> is here, but I guess it’s not interpreted because it’s just at the end of the < li > element, which is displayed inline. These CSS properties are not easy to use. Maybe a plugin added a css that caused the issue.

    But your problem is solved, that’s the main thing 🙂

    #137118
    inspirationally
    Participant

    I’m too silly, damn. This is over my intelligence.
    I have the problem, that the posts have the wrong post_parent, so that two topics are merged curiously.

    For example Post ID 9257 from the WBB board is attached to Thread ID 9257 from the old board, and I cannot see what I have to change. Please please help!
    This took me now over 2 hours changing things and I haven’t found it. I guess it is this part, but I have no idea what to change:

    // Parent Post ID.
    		// Note: We join the posts table because this needs to be the fist post of a topic.
    		$this->field_map[] = array(
    			'from_tablename'  => 'wbb1_1_thread',
    			'from_fieldname'  => 'firstPostID',
    			'join_tablename'  => 'wbb1_1_post',
    			'join_type'       => 'INNER',
    			'join_expression' => 'USING (threadID) WHERE wbb1_1_thread.threadID = wbb1_1_post.threadID',
    			'to_type'         => 'reply',
    			'to_fieldname'    => 'post_parent',
    		);
    		

    I updated the wbb.txt above (where I also linked the WBB database structure).

    #137116
    inspirationally
    Participant

    Hmm…unfortunately, all the posts written by unregistered users are assigned to ME (UserID = 1) automatically. Is there any possibility to give them the user ID 0 (=Anonymous) and in that case also save the username in postmeta?

    // Reply unregistered author name (stored in postmeta)
    		$this->field_map[] = array(
    			'from_tablename'  => 'wbb1_1_post',
    			'from_fieldname'  => 'username',
    			'to_type'         => 'reply',
    			'to_fieldname'    => '_bbp_anonymous_name',
    		);
    		
    jenseo
    Participant

    Ok, I have partly found the problem!

    I’m relying on Google’s jQuery-packs since these load much faster. I’m having the following code in my functions.php file:

    	// Load jQuery
    	if ( !is_admin() ) {
    	   wp_deregister_script('jquery');
    	   wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"), false);
    	   wp_enqueue_script('jquery');
    	}

    When removing this line, it suddenly works. The problem is that I would like to keep using Googles libraries…

    Any suggestions?

    // Jens.

    #137105
    Kaliceos
    Participant

    I went to clan.wolflan.com and your source code looks like some paragraphs were added by your editor as I see some <p> and </p> in weird places. What software did you use to edit loop-single-forum.php or your functions.php ?

    I was not able to check because some of your forums are private, but what’s the html source code for the list of subforums ? (I mean in the browser) Is there a <br /> between the list of subforums ? Because, when I watch your screenshot, subforums are not separated by a comma, so I guess the function did his job, but your code may be broken because you used WordPress editor or an other editor that deleted the <br />.

    Anyway, in your case, the simplest solution may be using some CSS. And as you said, simple stuff first ! You wouldn’t need to change any php template. You may try something like that in your style.css or Custom CSS if you use Jetpack :

    #bbpress-forums .bbp-forums-list li {
      display: block;
    }

    If it works, I don’t know what was the problem with the bbp_list_forums() function, but you will not need to use it and you can delete the custom loop-single-forum.php that you copied to your theme’s directory if you had not made other edits.

    #137103
    palmdoc
    Participant

    I am pleased to report I managed to successfully upgrade to bbPress from legacy forums
    The proper code to put in the Forums page is:
    [bbp-topic-index]

    #137098
    Erlend
    Participant

    Thank you very much for chiming in Beau. Your points make sense, except the first one has me a bit confused. o2 is going to be a plugin, like bbPress. So isn’t “WordPress.com runs WordPress, not o2” just as true?

    the code will be open source, so you’re welcome to take pieces and apply it to bbPress as well.

    I sincerely hope that will be feasible. Excitedly looking forward to seeing o2 in action!

    #137097
    Beau Lebens
    Participant

    I suppose there are a few reasons for this, but the most immediate are:

    • Our primary goal is replacing our own internal communications platform (P2). That runs on WordPress.com, which runs WordPress, not bbPress (this is probably the biggest one).
    • We (the team working on it) are more natively WordPress developers than bbPress specifically.
    • Quite simply, we didn’t really think about it until we were already well along the way building it for WordPress.

    There are no plans to do anything related to bbPress, but the code will be open source, so you’re welcome to take pieces and apply it to bbPress as well.

    #137093
    Hansaplastique
    Participant

    Or is there an option to disable this feature?

    #137092
    Hansaplastique
    Participant

    I’m running 2.4 and WP 3.6.1.
    It seems that bbPress converts backticks to code tags …

    Can anyone please explain to me how I can post code that has backticks in it?
    I mean: the backticks are part of the actual code I’m trying to post in my forum? So they should NOT be converted.

    #137091
    Travis S.
    Participant

    My goal is to make multiple forums (around 10 when its all said and done). Each forum will be for different subjects but all related with each on a different page.

    Per example… one forum will be on a specific fruit. So apple, oranges, etc. but would all fall under the umbrella Fruit (not my actual plans, but this was easier to explain).

    Is this possible?

    I’m currently running one bbpress install on the twenty-13 theme. I know there is a shortcode to show specific topics on a page, but I want each forum to show on just one page.

    Note: ive been on wordpress.com for a little while and started over on the .org. So I’m completely knew to screwing around with php files. Not asking you to hold my hand through it all, but clear directions would be great. Sorry if this question is a repost and/or very basic and im just over thinking it.

    Thanks in advance,

    #137089

    In reply to: Allow HTML from users

    Amin
    Participant

    I’m using this, and it works fine:

    if ( !function_exists( 'ja_filter_bbpress_allowed_tags' ) ) {
    function ja_filter_bbpress_allowed_tags() {
    return array(
     
    // Links
    'a' => array(
    'href' => array(),
    'title' => array(),
    'rel' => array()
    ),
     
    // Quotes
    'blockquote' => array(
    'cite' => array()
    ),
     
    // Code
    'code' => array(),
    'pre' => array(),
     
    // Formatting
    'em' => array(),
    'strong' => array(),
    'del' => array(
    'datetime' => true,
    ),
    'span' => array(
    'lang' => array(),
    'style' => array()
    ),
    'p' => array(
    'dir' => array(),
    'style' => array()
    ),
    'div' => array(
    'class' => array()
    ),
    // Lists
    'ul' => array(),
    'ol' => array(
    'start' => true,
    ),
    'li' => array(),
     
    // Images
    'img' => array(
    'src' => true,
    'border' => true,
    'alt' => true,
    'height' => true,
    'width' => true,
    )
    );
    }
    }
    add_filter( 'bbp_kses_allowed_tags', 'ja_filter_bbpress_allowed_tags' );
    #137083
    jbuesking
    Participant

    When I run the script with the convert users option checked it throws the following error:

    WordPress database error: [Unknown column 'users.userid' in 'field list']
    SELECT convert(users.userid USING "utf8") AS userid,convert(users.password USING "utf8") AS password,convert(users.username USING "utf8") AS username,convert(users.email USING "utf8") AS email,convert(users.registerDate USING "utf8") AS registerDate FROM tvc4d_users AS users LIMIT 0, 100

    It appears to work if I don’t try to convert the users. I’ll dig into this later this evening but wanted to see if it’s something obvious?

    #137081
    inspirationally
    Participant

    Allright, another thing I need help with:

    In WBB, there's the field isClosed to create a WordPress status from it with this:
    // Topic status (Open or Closed)
    		$this->field_map[] = array(
    			'from_tablename'  => 'wbb1_1_thread',
    			'from_fieldname'  => 'isClosed',
    			'to_type'         => 'topic',
    			'to_fieldname'    => 'post_status',
    			'callback_method' => 'callback_topic_status'
    		);

    and

    public function callback_topic_status( $status = 0 ) {
    		switch ( $status ) {
    			case 1 :
    				$status = 'closed';
    				break;
    
    			case 0  :
    			default :
    				$status = 'publish';
    				break;
    		}
    		return $status;
    	}

    But there’s also a field called “isDeleted”, so I could also use

    `// Topic status (Deleted)
    $this->field_map[] = array(
    ‘from_tablename’ => ‘wbb1_1_thread’,
    ‘from_fieldname’ => ‘isDeleted’,
    ‘to_type’ => ‘topic’,
    ‘to_fieldname’ => ‘post_status’,
    ‘callback_method’ => ‘callback_trash_status’
    );`

    and

    public function callback_trash_status( $status = 1 ) {
    		switch ( $status ) {
    			case 1 :
    				$status = 'trash';
    				break;
    
    			case 0  :
    			default :
    				$status = 'publish';
    				break;
    		}
    		return $status;
    	}

    The second, though, would overwrite the first, so that even closed topics that are not trash have the status publish again. Is there any chance to combine these two?

    #137071
    jnarain
    Participant

    Hi,

    I realize that the old workarounds (Code, Plugins etc.) for enabling the TinyMCE Full editor does not work anymore.

    The newly added Post Formatting/ Add toolbar & buttons to textareas to help with HTML formatting option, does not enable the editor with full range of buttons and capabilities.

    Any solution to bring the editor in full?

    Regards,

    Jinobi

    #137067
    Stephen Edgar
    Keymaster

    3. some users are twice now (like myself..who have been admins of wordpress and users of the forum). Can I simply merge them with
    UPDATE wp_posts SET post_author = ’1′ WHERE post_author = ’2′; and it will count for the forum, too?

    If a user already exists in WordPress during the import a new user will be created called ‘Imported_Username’, you can go to wp-admins user panel and when you select ‘Delete User’ you will be prompted to delete all posts or attribute them to another user, select the later and all the topics/replies etc will be attributed to the user you selected.

    4. the passwords – in WBB they are hashed by this:
    $passwort = sha1($row->salt.sha1($row->salt.sha1($_POST[‘passwort’])));
    so what do I write at the end of wbb3.php
    public function authenticate_pass( $password, $serialized_pass ) {
    $pass_array = unserialize( $serialized_pass );
    return ( $pass_array[‘hash’] == md5( md5( $password ). $pass_array[‘salt’] ) );
    }
    or is this impossible and the users have to get the new password by mail?

    I am going to look at passwords next week for all the importers as my skills with PHP are only just beginning so this is all a bit tricky for me at the moment. 😉

    So the best workaround is to have the users reset their password by email for now.

    5. the imported users have no “Forum Role”. Is is “normal”? Is there any chance to automatically give them the forum role “Participant”?

    Go to bbPress tools and run the repair tool ‘Remap existing users to default forum roles’ and that will do the trick. https://codex.bbpress.org/repair-forums/

    6. do I have to keep the wbb3.php “forever” because of the passwords or can I delete it one day, even if not all members have com back yet?

    If the passwords are not being converted you do not need to keep it, though I don’t see any issues why you would need to delete it.

    Speaking of keeping it, can we include your WBB v3 Importer and distribute it with bbPress?

    7. until now we have everything like private messages, profiles, friends and especially user groups (Moderators, crew members) with hidden forums. Do I see correct, that I can install both, import bbpress and afterwards attach for example our “Mods Only” to the group “Moderators” as group forum?

    Currently bbPress only has: https://codex.bbpress.org/getting-started-with-bbpress/#creating-your-first-forum

    Visibility: decide whether your forum is public, private or hidden.
    Public – Anyone can see these forums
    Private – Only logged in registered users can see these forums
    Hidden: Only Moderators/Admins can see these forums

    I see that every user gets a new User ID – old IDs are saved in table _bbp_converter_translator – will that table be kept? Maybe by this I have a chance to later import – somehow – private messages for buddy press!?

    The translator table is not kept and the old user ID is stored in wp_usermeta as per this item in the ‘Example.php’ importer.

    https://bbpress.trac.wordpress.org/browser/trunk/includes/admin/converters/Example.php#L458

                    // Store old User id (Stored in usermeta)
    459	                $this->field_map[] = array(
    460	                        'from_tablename'  => 'users_table',
    461	                        'from_fieldname'  => 'the_users_id',
    462	                        'to_type'         => 'user',
    463	                        'to_fieldname'    => '_bbp_user_id'
    464	                );

    I’ll take closer look at the importer and structure you linked to over the weekend and post back with anything else I can think of.

    #137066
    Stephen Edgar
    Keymaster

    As far as I know there are no issues importing from phpBB v3.0.11

    This doc has any known issues when using the phpBB importer:
    https://codex.bbpress.org/import-forums/phpbb/

    Did your import fail at one point and you started the import again which would have caused duplicates?

    To debug the issue further I would need some detailed information, particularly some SQL examples would be helpful.

    If you still have issues after resting your forums and this constantly happpens please create a ticket on Trac https://bbpress.trac.wordpress.org/ with some detailed steps to reproduce the issue and I will take a look.

    #137063

    In reply to: SMF Import to bbPress

    Stephen Edgar
    Keymaster

    Joe,

    Thanks for looking at this I uploaded a new version with the fix above for the ‘to_type’ you mentioned above.

    I have not started with the passwords as of yet, this is next weeks job to look at all the importers passwords sections and begin writing custom callbacks for all of them. With my limited PHP skills this is going to be a challenge indeed. I will be calling heavily on the code found in the phpBB importer to base the code on and then changing any calculating/algorithms as needed.

    If you beat me to it, I could live with that 😉

    SysFailure0x5a
    Participant

    For some reason my last comment isnt showing up…

    No, I even stripped all the plugins and themes out of the install, and removed/reinstalled bbpress. Same issue. I don’t feel that I had anything abnormal installed for plugins. Most of the popular plugins, jetpack, basic functionality stuff like image resizing/fitting, stat tracking, google analytics, shortcode stuff…

    Here is another person who had the problem. I also found a thread on your bug tracking site regarding this issue for multisite from several versions back. Can’t find the link right now, but it said resolved… Not so sure that’s true.

    You do not have sufficient permissions to access this page.

    and another

    You do not have sufficient permissions to access this page.

    and another…

    Admin user: "You do not have sufficient permissions to access this page"

    It’s also broken for BRAND NEW sub sites with brand new admin usernames.

    #137056
    PureLoneWolf
    Participant

    Hi there

    I have bbPress (along with BuddyPress) on two, fundamentally, identical websites.

    However, on http://www.wolflan.com, I have no issues, but on clan.wolflan.com I have a couple of weird ones.

    They are both even using themes from the same author.

    On wolflan.com, I was able to use

    function custom_bbp_list_forums() {
      $args['separator'] = '<br />';
     
      return $args;
    }
     
    add_filter('bbp_before_list_forums_parse_args', 'custom_bbp_list_forums' );

    in my themes functions.php, and therefore get the sub-forums on their own line. Additionally, I was able to add individual forums to the site navigation menu (Appearance/Menus).

    On clan.wolflan.com I was able to get the sub-forums on their own line, up until I upgraded to 2.4. At which point, my private forums moved to the bottom and the code above stopped putting the sub-forums on their own line. Today, I decided that I would like to have forums on the navigation and noticed that I have no option for this.

    Both sites are running an identical plugin list, they are both on the latest versions of all plugins and are also running WP3.6.1 as of this morning.

    Would anyone have any ideas?

    I have linked to images that show the issue:

    wolflan.com
    Fully working, modded functions.php
    fullworkingfunctionsmod.png
    Fully working, wordpress menu editor
    fullworkingmenueditor.png

    clan.wolflan.com
    Not working, modded functions.php
    nonworkingfunctionsmod.png
    Not working, wordpress menu editor
    nonworkingmenueditor.png

    Would anyone have any ideas as to what I can do to solve these two issues?

    Many thanks
    Dave

    #137052

    In reply to: SMF Import to bbPress

    bigtreesjoe
    Participant

    By the way, shouldn’t this:

    		// User password verify class (Stored in usermeta for verifying password)
    		$this->field_map[] = array(
    			'to_type'      => 'members',
    			'to_fieldname' => '_bbp_class',
    			'default'      => 'SMF'
    		);
    
    be this instead:
    

    // User password verify class (Stored in usermeta for verifying password)
    $this->field_map[] = array(
    ‘to_type’ => ‘user’,
    ‘to_fieldname’ => ‘_bbp_class’,
    ‘default’ => ‘SMF’
    );

    #137048
    inspirationally
    Participant

    Hello,

    after exactly 10 years and over 500.000 posts with our board deppheads.com running with Woltlab Burning Board (right now version 3.1.8), social networks have sort of won – instead of 150 new posts the day we have now maximum 5 posts. WBB4 will be coming out soon, so this is the right time to sell my WBB license and move it all to my site johnny-depp.org, powered by WordPress. This is where I seek help.

    I already deleted inactive members, so that we now have “just” over 300, but I don’t want to delete all the written things like movie reviews and serious discussion, as this is still the home of many. So there are 500.000 posts and nearly 10.000 topics to be imported.

    I edited the example.php and so far it worked with importing members and forums (just on a test WordPress installation for now).

    However, there are some problems/questions I’ve come up with and I’m almost sure, there will be more following.

    1. there is, equally to phpBB, the problem, that there are topics and posts, and the first post of the topic has to become “topic content” of WBB.
    Here I used

    // Topic content.
    // Note: We join the posts table because topics do not have content.
    $this->field_map[] = array(
    'from_tablename' => 'wbb1_1_post',
    'from_fieldname' => 'message',
    'join_tablename' => 'topics',
    'join_type' => 'INNER',
    'join_expression' => 'USING (threadID) WHERE wbb1_1_post.postID = wbb1_1_thread.firstPostID',
    'to_type' => 'topic',
    'to_fieldname' => 'post_content',
    'callback_method' => 'callback_html'
    );

    Unfortunately, I get the error, that wbb1_1_post.message does not exist:

    WordPress database error: [Unknown column 'wbb1_1_post.message' in 'field list']
SELECT convert(wbb1_1_thread.threadID USING "utf8") AS threadID,convert(wbb1_1_thread.replies USING "utf8") AS replies,convert(wbb1_1_thread.boardID USING "utf8") AS boardID,convert(wbb1_1_thread.userID USING "utf8") AS userID,convert(wbb1_1_post.message USING "utf8") AS message,convert(wbb1_1_thread.topic USING "utf8") AS topic,convert(wbb1_1_thread.time USING "utf8") AS time,convert(wbb1_1_thread.lastPostTime USING "utf8") AS lastPostTime FROM wbb1_1_thread AS wbb1_1_thread LIMIT 0, 100

    But it does!
    I attached both, my wbb3.php import script and the database structure of the most important tables, here you go:
    http://deppheads.com/uploads/wbb.txt
    http://deppheads.com/uploads/database_structure.txt

    2. I hope/guess, this is also the reason that all topics (once I remove that passage that produces an error) are started either by Anonymous or by ME (although I haven’t done it)?

    3. some users are twice now (like myself..who have been admins of wordpress and users of the forum). Can I simply merge them with
    UPDATE wp_posts SET post_author = ‘1’ WHERE post_author = ‘2’; and it will count for the forum, too?

    4. the passwords – in WBB they are hashed by this:
    $passwort = sha1($row->salt.sha1($row->salt.sha1($_POST[‘passwort’])));
    so what do I write at the end of wbb3.php
    public function authenticate_pass( $password, $serialized_pass ) {
    $pass_array = unserialize( $serialized_pass );
    return ( $pass_array[‘hash’] == md5( md5( $password ). $pass_array[‘salt’] ) );
    }
    or is this impossible and the users have to get the new password by mail?

    5. the imported users have no “Forum Role”. Is is “normal”? Is there any chance to automatically give them the forum role “Participant”?

    6. do I have to keep the wbb3.php “forever” because of the passwords or can I delete it one day, even if not all members have com back yet?

    7. until now we have everything like private messages, profiles, friends and especially user groups (Moderators, crew members) with hidden forums. Do I see correct, that I can install both, import bbpress and afterwards attach for example our “Mods Only” to the group “Moderators” as group forum?

    8. I see that every user gets a new User ID – old IDs are saved in table _bbp_converter_translator – will that table be kept? Maybe by this I have a chance to later import – somehow – private messages for buddy press!?

    Alone if my first point is solved, I’d be thankful.

    Kind regards, inspirationally.

Viewing 25 results - 13,776 through 13,800 (of 32,519 total)
Skip to toolbar