Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 14,401 through 14,425 (of 32,503 total)
  • Author
    Search Results
  • #133109
    Robin W
    Moderator

    I have also added it in a page by creating a shortcode
    In functions.php in my child theme I added

    //edit profile
    function profileedit() {
    return ‘Amend Profile/Change password‘ ;
    }
    add_shortcode(‘profileedit’, ‘profileedit’);

    Then in any page type [profileedit] and up comes the href with the current user correctly filed in.

    #133108
    AlexiousRahl
    Participant

    As the title says. There appears to be no way to do so. http://www.worldsfactory.net/forums

    I thought that maybe the form was not included in the theme (which is custom by the way) by the original designer, could that be the case? I tried with our current coder but he said that he found a place to add function to new topic form, but that function doesn’t seem to work.

    Can you help us? It’s a pretty big problem for us, basically stopping our community progress. Thanks in advance.

    #133104
    sulliwane2
    Participant

    Hello, I have the exact same problem :

    On /forum page I put this bbpress shortcode : [bbp-topic-form]

    And when non-admin user is logged-in, it displays the message “You cannot create new topics.

    Any workaround ?

    Thx

    #133084

    In reply to: Template Tags

    Robin W
    Moderator

    Not sure which bit of your site you plan to put this in, but the following php code will put up some text which they can click

    <a href="edit” >Amend Profile/Change password

    without the “edit”, it’ll take them to their profile page.

    #133083
    stickFinger
    Participant

    I guess i have the same problem as you my file is different from moebis´ and so i could not find the correct lines.

    I´m not a coder but i can assure you that i know how to copy and paste 🙂

    But you´re right, maybe i´ll start with BP 1.6.5 and use this Nice PLug to get the project as I wish for now. I have a similar project as Yours but very smaller

    A district site ( with maybe 4 to 10 ) and with subforums like Health, Education, Secutity, Traffic, etc.

    So for instance:

    Brooklyn:
    –Health
    –Education
    –Traffic

    Queens:
    –Health
    –Education
    –Traffic

    But i still have some concerns about future updates, you know. i´m a bit stucked 🙂

    #133081
    Fraternity
    Participant

    That second codeblock (lines 567-581) should read:

    `
    // Suppress subforums for now
    //add_filter( ‘bbp_get_forum_subforum_count’, ‘__return_false’ );

    // Set up forum data
    bbpress()->current_forum_id = $forum->ID;
    bbp_set_query_name( ‘bbp_single_forum’ ); ?>

    <?php

    // Remove the subforum suppression filter
    //remove_filter( 'bbp_get_forum_subforum_count', '__return_false' );
    `

    The fact that bbPress doesn't automatically encode text between the code tags I used is a bit of a concern 😀

    #133080
    Fraternity
    Participant

    moebis – just took a look at this, I may have a more recent version than you use in your fix above.

    Here is how to play with my hack in the latest trunk:

    EDIT: /bbpress/includes/extend/buddypress/group.php

    Delete lines 609-614 and add “?>” back to line 609.

    The code I have at these lines is this:

    <?php bbp_get_template_part( ‘form’, ‘topic’ ); ?>

    <?php else : ?>

    <?php bbp_get_template_part( ‘feedback’, ‘no-topics’ ); ?>

    Probably not what I want to comment out. What I did find though is this (lines 567-581):

    // Suppress subforums for now
    add_filter( ‘bbp_get_forum_subforum_count’, ‘__return_false’ );

    // Set up forum data
    bbpress()->current_forum_id = $forum->ID;
    bbp_set_query_name( ‘bbp_single_forum’ ); ?>

    <?php

    // Remove the subforum suppression filter
    remove_filter( 'bbp_get_forum_subforum_count', '__return_false' );

    Group Subforums

    I highlighted a few things:
    1) Topics are only being displayed from group subforum 2 (believe you mentioned this above). This should be easy enough to fix
    2) I thought I was posting in the Group Forum when I used the default form below, but clearly (as per highlight 3) this is now set to group subforum 2
    3) Default Create New Topic is set to Group Subforum 2. I assume this was the “last retrieved forum” and is probably easy enough to fix. In my case, I’ll probably be changing my group forums to a category anyway, so I don’t actually want people starting new topics from this page.

    #133060
    lucop1
    Participant

    Hi,

    i’ve just installed buddypress 1.7 and bbpress 2.2.4.

    I created a custom theme for bbpress doing the following steps:
    1. create a folder bbpress inside wp-content/themes/mytheme/
    2. moved all the php files that were inside plugins/bbpress/templates/default
    3. moved the css file inside wp-content/themes/mytheme/css/

    after that

    I turned on the functionality to include the bbpress forum inside buddypress groups but I found and issue with the topic subscription and add to favorites.

    Because when i click on that link in the single topic view it open a blank page.
    I checked the bbp-function.php files stored in plugins/bbpress/templates/default and I found that it enqueue all the ajax function for the topic subscribe option and add to favorite options.

    But when I go the forum page inside BuddyPress Group and open the source code I don’t see any enqueue ajax files or functions.

    So what should I do to let it works?

    thanks

    #133049
    jeffacubed
    Participant

    Hi @lamarant,

    This ‘anamoly’ nearly drover me bonkers, until I finally discovered the ‘BuddyPress Group Email Subscription’ (when activated) plugin lead to the ‘Subscribe’ & ‘“Notify me of follow-up replies via e-mail” button/links to disappearing in bbPress Topics. In my case I’m using BuddyPress 1.6.4 & bbPress 2.3 RC1 & WP 3.5.1

    I’m not sure is this could be your issue, but it 100% was mine. I still need to dig-into the code to see what’s really causing the conflict, but (for-now) DE-activating the ‘BuddyPress Group Email Subscription’ does resolve this issue for me.

    Hope that helps,

    -Jeff

    #133041
    neriokas
    Participant

    Hey guys, I just converted my wordpress to multisite and when I’m trying to add a new site I get the following errors:

    Warning: array_keys() expects parameter 1 to be array, boolean given in /home/omgl/public_html/wp-content/plugins/bbpress/includes/core/capabilities.php on line 453
    
    Warning: Invalid argument supplied for foreach() in /home/omgl/public_html/wp-content/plugins/bbpress/includes/core/capabilities.php on line 453
    
    Warning: array_keys() expects parameter 1 to be array, boolean given in /home/omgl/public_html/wp-content/plugins/bbpress/includes/core/capabilities.php on line 453
    
    Warning: Invalid argument supplied for foreach() in /home/omgl/public_html/wp-content/plugins/bbpress/includes/core/capabilities.php on line 453
    
    Warning: array_keys() expects parameter 1 to be array, boolean given in /home/omgl/public_html/wp-content/plugins/bbpress/includes/core/capabilities.php on line 453
    
    Warning: Invalid argument supplied for foreach() in /home/omgl/public_html/wp-content/plugins/bbpress/includes/core/capabilities.php on line 453
    
    Warning: array_keys() expects parameter 1 to be array, boolean given in /home/omgl/public_html/wp-content/plugins/bbpress/includes/core/capabilities.php on line 453
    
    Warning: Invalid argument supplied for foreach() in /home/omgl/public_html/wp-content/plugins/bbpress/includes/core/capabilities.php on line 453
    
    Warning: array_keys() expects parameter 1 to be array, boolean given in /home/omgl/public_html/wp-content/plugins/bbpress/includes/core/capabilities.php on line 453
    
    Warning: Invalid argument supplied for foreach() in /home/omgl/public_html/wp-content/plugins/bbpress/includes/core/capabilities.php on line 453
    
    Warning: Cannot modify header information - headers already sent by (output started at /home/omgl/public_html/wp-content/plugins/bbpress/includes/core/capabilities.php:453) in /home/omgl/public_html/wp-includes/pluggable.php on line 876

    Does anyone have any idea what’s going on? Seems to me like bbPress is the culprit and when I deactivate bbPress I’m able to add a new site, but with bbPress activated I get those errors..

    #133036
    Robin W
    Moderator

    Can you point me to the newer example, and i’ll code that for snitz so that it looks consistent and has help prompts in it, then I’ll ticket it to you.

    #133016
    Stephen Edgar
    Keymaster

    Many thanks for taking the time to write this and share with the community. 🙂

    I added a link to this post from https://codex.bbpress.org/import-forums/custom-import/

    #133008

    In reply to: topic output

    hallsy
    Participant

    I am not using any member plugins but I do have a bp-custom file which is locking my site down to members only except for the register and activate pages.

    this is the code i am using for the site lockdown http://pastebin.com/rgJ6BQc8

     

    Thanks

    #132915
    Robin W
    Moderator

    Converting a Snitz access database forum to BBpress

    This documents how I transferred from a website using Snitz and an access database to a new site with BBress using Mysql.

    This briefing assumes knowledge of
    • FTP programmes and uploading/downloading files
    • A way to access your wordpress database eg myphpadmin
    • A way to see your access database

    Introduction

    BBpress has a conversion tool that lets you import data from several other forum packages. However two things are needed for this to work.
    1. The data in a MySQL database format
    2. A convertor programme that understands the structure of the source (in this case Snitz) forum.

    If you already have a MySQL verison of Snitz (Snitz supports Access, MS SQL, and MySQL), then you’ll still need to fix the date, and run a specific Snitz converter, but don’t need the upload to MySql in step 2.

    Plan

    The plan therefore is to
    1. Fix date format (it is different between the two forums)
    2. Convert the data to sql format
    3. Run a snitz converter
    4. Run repair to fix the links

    Execution

    I can only describe how I achieved this, I suspect there are lots of ways, but this one worked.

    I had an access database on site x with hosting company a, and needed to transfer to a Mysql database on site y with hosting company b (basically I was taking over running someone else’s website management)

    Step 1 fixing the data format

    Snitz stores dates in the format yyyymmddhhmmss
    BBpress stores dates in the format yyyy-mm-dd hh:mm:ss

    You can fix this
    • before you transfer the data to sql,
    • after you have transferred it
    • or during conversion,

    this will depend on where you knowledge lies. But you will need to fix it. If you don’t fix this, all the entries you import will show as posted 2014 years ago (basically year 0)

    I converted before transferring to sql, as I an old and used to working with flat files! If you are more capable in sql, you could no doubt write a small programme to change the data format after you’ve uploaded to sql, and if more capable in php you could do it within the converter programme (see later)

    The Snitz database has two tables with dates in that need changing. These are :

    FORUM_TOPICS
    FORUM_REPLY

    This is how they showed in my Snitz database, but the prefix may be different with yours.

    In FORUM_TOPICS you need to change
    T_DATE
    T_LAST_POST

    In FORUM_REPLY you need to change
    T_REPLY

    I downloaded the access database from the old site to my PC. I then exported the two tables to an excel spreadsheet (in Access go to external data, and look for export to Excel. You’ll need to have created a blank spreadsheet with the name you want to use first) and ran the formula

    =CONCATENATE(MID(N2,1,4),"-",MID(N2,5,2),"-",MID(N2,7,2)," “,MID(N2,9,2),":",MID(N2,11,2),":",MID(N2,13,2))

    Where column N contained the old date.

    I then prefixed the original heading with OLD (eg heading T_DATE became OLDT_DATE) and headed the new column with the heading of the old one (eg T_DATE). I did this to a) preserve the original columns just in case, and b) to use for the clean slug in the conversion (see later).

    I then deleted the old table in access, and imported the two excel ones back into Access (as before external data, then import).

    I then had the same access database, but with the correct date formulas and a couple of extra columns with the old date format in them.

    Step 2 – Convert access database to MySql database

    The first thing you’ll need is a MySql database to upload to.

    You can use the one you presumably already have with WordPress/BBpress. However you’ll just need to check that none of the names co-incide. Since my Snitz database used capitals (I don’t know if they all Snitz databases do), and BBpress uses lower case, I suspect that there is no risk in doing this, but one for you to consider.

    I took the safety of creating a fresh blank database (my hosting package allows the creation of databases and manages them through phpMyadmin).
    There are numerous programmes on the web that do access to Mysql conversion, but for no particular reason I chose Bullzip http://www.bullzip.com/.

    However this needs a 32bit ODBC driver to work, so unless you already have Mysql on your local PC, you’ll need to download the driver from http://www.mysql.com/downloads/connector/odbc/ – choose the 32 bit one.

    Once installed it is a doddle to do the conversion.
    You’ll need :
    The access database on your pc
    The host address of your MySql database
    The database name
    The username
    The password.

    Run the wizard, and it’ll upload in minutes.

    Finally if you’re going to do the date conversion discussed in Step 1 at this stage, now’s the time to do it.

    Step 3 – Importing/converting the data

    This is easy once you’ve got your head around it, but initially it can be very frustrating.

    In essence you need to translate what one forum calls something to what the other needs.

    For Snitz, I used the following translation

    
    Forum section FORUM_FORUM forum
    Forum id	FORUM_ID	_bbp_forum_id
    Forum parent id	CAT_ID	_bbp_parent_id
    Forum title	F_SUBJECT	post_title
    Forum Slug  (see note 1)	FORUM_ID	post_name
    Forum description	F_DESCRIPTION	post_content
    Forum Display Order	F_ORDER	Menu_order
    Forum Date Update		Post_date
    		
    Topic section	FORUM_TOPICS	topic
    Topic id	TOPIC_ID	_bbp_topic_id
    Forum id 	FORUM_ID	_bbp_forum_id
    Topic author	T_AUTHOR	post_author
    Topic title	T_SUBJECT	post_title
    Topic Slug (see note 1)	T_DATE	post_name
    Forum id (if no parent 0) 	FORUM_ID	post_parent
    Topic date update 	T_DATE	post_date
    	T_DATE	post_date_gmt
    	T_LAST_POST_DATE	post_modified
    	T_LAST_POST_DATE	post_modified_gmt
    		
    Tags section		
    Ignored		
    		
    		
    Post section	FORUM_REPLY	reply
    Post id	REPLY_ID	_bbp_post_id
    Forum id	FORUM_ID	_bbp_forum_id
    Topic  id	TOPIC_ID	_bbp_topic_id
    Author ip	R_IP	_bbp_author_ip
    Post author	R_AUTHOR	post_author
    Topic slug	R_DATE	post_name
    Post Content	R_MESSAGE	post_content
    Topic id	TOPIC_ID	post_parent
    Topic date	R_DATE	post_date
    		
    User Section	FORUM_MEMBERS	user
    Store old user id	MEMBER_ID	_bbp_user_id
    	M_NAME	user_login
    	M_PASSWORD	_bbp_password
    	M_EMAIL	user_email
    	M_HOMEPAGE	user_url
    	M_AIM	aim
    	M_YAHOO	yim
    		
    

    [NOTE if you copy this and post in a word doc, you should be able to get a nice tabbed table]
    Note 1

    I used OLDR_DATE & OLDT_DATE from the step 1 as my clean slugs. A slug is what BBpress uses for a URL to reference a post. It needs to be clean – ie not have formatting, odd characters like spaces etc. in it. I did debate using the topic ID, but was unsure if this was unique for BBpress – it may well be fine. So I used the references above as I was pretty sure that with our forum being not that busy, that no two people would have posted in the same second. If you choose to use some other field, such as topic ID, you’ll need to change the field in the converter document – see below.

    This is then used against the example converter that BBpress supplies.

    Whilst initially looking daunting, this is fairly easy to change to get it to work.

    Step 3.1 Creating a Snitz.php

    Firstly go to your site. Using FTP go to web/wp-content/plugins/bbpress/includes/admin/converters and locate example.php. FTP this to your PC and using an editor (notepad ++ is good – download it from http://notepad-plus-plus.org/) you need to change the default “froms” to those above

    But first save it locally as “snitz.php”, and change the first couple of lines to read

    
    /**
     * Implementation of snitz converter.
     */
    class snitz extends BBP_Converter_Base
    

    If you don’t do this, the converter won’t recognise it.

    Then you need to work through each of the lines of code changing the “default” source database tables and names to the correct ones.

    So looking at you new snitz.php, you’ll see for instance the first conversion is :

    
    // Forum id. Stored in postmeta.
    $this->field_map[] = array(
    'from_tablename' => 'forum', 'from_fieldname' => 'forumid',
    'to_type' => 'forum', 'to_fieldname' => '_bbp_forum_id'
    

    So to get this to work for Snitz you need to change the source table from ‘forum’ to “FORUM_FORUM” and the from field needs changing from ‘forumd’ to’ _bbp_forum_id’

    Making the lines now read :

    
    // Forum id. Stored in postmeta.
    $this->field_map[] = array(
    'from_tablename' => 'FORUM_FORUM', 'from_fieldname' => 'FORUM_ID',
    'to_type' => 'forum', 'to_fieldname' => '_bbp_forum_id'
    

    Using the translation table above you work through each of the lines, doing the substitution.

    I commented out the tags section, as I couldn’t see that Snitz had tags. I also commented out the “
    Store old user salt” and “User password verify class” sections as passwords won’t come across – see later on this.

    CRITICALLY I also added the following as the example doesn’t had a bit that brings the actual topic content across !

    
    // Topic content.
    		// Note: We join the posts table because topics do not have content.
    		$this->field_map[] = array(
    			'from_tablename'  => 'FORUM_TOPICS',
    			'from_fieldname'  => 'T_MESSAGE',
    			'join_tablename'  => 'thread',
    			'join_type'       => 'INNER',
    			'join_expression' => 'USING (threadid) WHERE post.parentid = 0',
    			'to_type'         => 'topic',
    			'to_fieldname'    => 'post_content',
    			'callback_method' => 'callback_html'
    

    Once all that is done, save the file locally.

    Then using FTP upload it to the same directory that example came from
    Viz : web/wp-content/plugins/bbpress/includes/admin/converters
    Now you’re ready to run the conversion!

    You’ll need the following info
    Database server (localhost if your using you local Mysql database)
    Database name
    Database User
    Database password

    Then in Dashboard, go to tools>forums>import forums

    Select “snitz” from the converter list, and fill in the database info from above.

    Click to select users, presuming that you want to bring these across.

    Then click start, and sit back and watch. If you’ve got everything right, you’ll see a steady stream of lines such as “converting topics 1-100”

    If Fails :

    If it falls over, then you’ll need to work out which part of the snitz converter it doesn’t like (it’ll give you a line number). Usually you’ve got punctuations wrong, or called something by a wrong name. Remember snitz (in my case anyway) uses capitals, and bbpress needs lowercase, so ensure that’s all ok.

    If nothing comes through (it usually says “starting conversion…conversion complete”), then you have got the connection wrong, as it’s not finding the database and tables.

    If Success :

    Then you’ll need to repair the links (Dashboard>tools>forums>repair forums). Otherwise in my case the forum listings came through, but with no topics listed against them.

    Do as the tool suggests – I ran several at the same time, and wrote most of this document whilst waiting !

    Finally – users

    If you successfully imported your users, they’ll have accounts, but their passwords won’t work – Bbpress can’t bring these across.

    The easiest way is to tell them to click “lost password” and enter their email address and then they can reset their own.

    And that’s how it’s done !

    #132911
    Robin W
    Moderator

    Stephen,

    Thanks, that got me going in the right direction and I have achieved it.

    I’ll try and post the full method for future users – I found your custom stuff useful https://codex.bbpress.org/import-forums/custom-import/

    Working out the mapping and date formats took a bit of effort, but once there the rest is easy !

    Thanks again

    Unsal Korkmaz
    Participant

    This weeks question & answer: 

    Showcase, promotion and custom content types

    Question Summary: How to add PromotionBar and ShowCase feature to your custom post types?

    Solution: Its super simple;
    This code will activate PromotionBar and ShowCase features for your custom post type 🙂 For example for bbPress, you can activate those features for topic post type:

    add_filter('firmasite_pre_get_posts_ekle', "firmasite_custom_cpt_add");
    function firmasite_custom_cpt_add($array){ 
    	$array[]='topic'; 
    	return $array; 
    }
    #132679
    Stephen Edgar
    Keymaster

    No we are all good… I removed the stuff regarding the links as this is working correctly.

    Try creating a new WordPress page and add the bbPress shortcode [bbp-forum-index] to the page.

    #132663
    Stephen Edgar
    Keymaster

    That seemed to have worked ok, I no longer get the .htaccess error.

    That will indeed help now that you have a .htaccess file for permalinks and the most common permalink format is ‘Post name’ which it appears you are now using.

    Also, when I create a page and add the shortcode to it, it creates the tab for me, but it links to /forum-2, not forums. If I change the permalink, it just changes it back.

    Make sure you don’t have a deleted page named ‘forums’ in your trash.

    Also, when I view the forum via the “View” link in Dashboard>Forums it takes me to /forums/forum/general-discussion/, not forums/generaldiscussion.

    WordPress removes any ‘whitespace’ from the names and replaces them with a hyphen, URL’s may not contain spaces.

    #132662
    palmdoc
    Participant

    I added short code that to the original Forums page from Buddypress but the forum listing did nto show.
    I deleted the Forums page, recreated a new one called Forums again and now the page is completely blank! Help!
    http://mymobilefest.com/forums/

    The only content in the page is
    [bbp-topic-index]

    #132656
    Grubbi
    Participant

    Which is the best option to choose for permalinks?

    When I change the permalinks I get a message telling me to update my .htaccess file. Except I can’t find a .htaccess file on my FTP or server, so I created one, added the text it tells me to and copied it to my root folder. That seemed to have worked ok, I no longer get the .htaccess error.

    Also, when I create a page and add the shortcode to it, it creates the tab for me, but it links to /forum-2, not forums. If I change the permalink, it just changes it back.

    Also, when I view the forum via the “View” link in Dashboard>Forums it takes me to /forums/forum/general-discussion/, not forums/generaldiscussion.

    #132651
    Stephen Edgar
    Keymaster

    @palmdoc You can could create a new WordPress page and add the [bbp-topic-index] shortcode to it.

    #132643
    Stephen Edgar
    Keymaster

    Try all the things you above using the Twenty Eleven theme included with bbPress…

    Once you are happy that you have everything working with the Twenty Eleven theme as you expect it should then switch back to your custom theme and if needed contact the theme author asking why the theme doesn’t support xyz…

    #132641
    Stephen Edgar
    Keymaster

    I have tried http://vegansociety.co.il/forums and I see the error but I also see your current menu item ‘forums’ links to here.

    I am not sure how the Hebrew in the URL’s works in regards to WordPress & bbPress as I personally have not gone done this path before.

    What happens if you create a new WordPress page and add the bbPress shortcode [bbp-forum-index]

    Also apologies, your post had been marked as spam for the past week :/

    #132617
    palmdoc
    Participant

    Hi. I have just migrated my Buddypress legacy Group forums to bbPress using the guide here:
    https://codex.buddypress.org/user/buddypress-site-administration/migrating-from-old-forums-to-bbpress-2/
    and forums seem to be working

    I tried out the GD BBpress tools and quote/signature function is not working

    Can anyone please give some tips?

    Forum: http://mymobilefest.com/forums/

    Many thanks in advance

    #132616
    Todd Pettee
    Participant

    I wanted to add here that I tried creating another page, containing a shortcode, for the forum index:

    http://www.forgreenpeas.com/forum-index

    And that works fine. However, If I try to click on the “Forums” link in the breadcrumbs, it takes me to the other forums page that doesn’t work:

    http://www.forgreenpeas.com/forums

    Still not sure what’s causing this.

Viewing 25 results - 14,401 through 14,425 (of 32,503 total)
Skip to toolbar