Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 4,726 through 4,750 (of 32,481 total)
  • Author
    Search Results
  • #188382
    peter-hamilton
    Participant

    Hi all, I have been playing on and off with WordPress, BBPress and Buddypress, mostly to build my own company website.

    I have almost completed my quest to make BBpress as functional and user friendly as any other major, paid for, forum software offers, and I think I have even improved to my own preference and proven that BBpress is capable to be better then any commercial package.

    Please review my website, I have a demo account as you need to be logged in for all the plugins and hacks to be visible.

    I have added quite a few plugins and function snippets, I do not know how to code php or javascript, just basic html and css for the rest I cut and paste until it works, although I do understand what I am looking at with php after 4 years of cut-and-paste…lol

    http://www.seedism.nl

    username: demo
    passowrd: demo2017

    Just to let you know, I breed hybrid strains of medicinal Cannabis so you will find this content on my website!!

    #188376
    AdventureRidingNZ
    Participant

    I know this is a topic dredge but would the same code work for excluding particular forums from search results?

    #188375
    AdventureRidingNZ
    Participant

    @adjunkten Did you find a fix for this? I am using the same code snippets to extend my search results but now want to exclude/hide some private group forums.

    Robin W
    Moderator

    Start with

    1. You should be aware that many spam filters strip messages that do not come from the correct address. So if your site is mysite.com and your email address in wordpress settings/general is fred@gmail.comthen it is likely that messages will be dumped in transit. You need to set up email to come from your site eg fred@mysite.com, your hosting provider can help if needed.
    2. Just bbpress?
    Then you need to see if this is wordpress wide or just bbpress.
    Try https://wordpress.org/plugins/check-email/
    3. Some people have fixed it with this plugin https://wordpress.org/plugins/asyncronous-bbpress-subscriptions/

    ahau
    Participant

    Hi,

    After a day of using the example.php to create a custom import form I finally tried to run it and all I get is Staring Conversion with the little spinner next to it and nothing else happens.

    I have stopped it and then chosen another converter just to see what it does and it does run past there telling me No fourms to convert etc …

    For curiousity I ran a different conversion and used the wrong username and it did tell me it couldn’t connect. I also did that again using the wrong database and it said it couldn’t connect tot he database. So I am guessing that this starting conversion, spinner, nothing (even after leaving it for 1/2 hour and I do not have a large forum to convert) must be an error after there is a database connection and before the main code runs.

    Here is basically what I have done

    Renamed example.php to Originalforum.php

    Changed Line 4 to * Originalforum converter base impoprter template for bbPress

    Changed line 9 to class Originalforum extends BBP_Converter_Base {

    Went through line by line and changed as needed, making sure that the case in the tables was the same in the file.

    Used example.php, mingle.php and vanilla.php to check each line. For example I used the vanilla.php dates code as the one I am doing has the same format as needed and the mingle.php to add in the bottom the public function callback_topic_status code.

    If anyone can point me in the right direction to get past the starting conversion – spinner – nothing else that would be most appreciated. I know once I am past that if there are sql / code errors I will be able to fix those – I just need to be able to get to that stage!

    Thank you for your time.

    #188347
    Robin W
    Moderator

    brilliant – thanks so much for posting the solution, and yes it looks like if you partner with a page and have multiple shortcodes then you may need to choose what the forum root should show.

    #188345
    Jason
    Participant

    I found this topic from 3 years ago, which helped me:

    Pagination broken when using shortcode for topic index

    It suggested changing the Forum setting “Forum root should show” to “Topics by Freshness.” I had it set to “Forum Index.” With this setting changed, my pagination works.

    Not sure why this setting would break pagination in bbpress topics index shortcode, but at least it works now.

    #188334
    Justin
    Participant

    I tried 2.6Rc3 and it did more, but still getting the same error along with a lot of others:

    Import Finished
    17: No threaded replies to import
    16: No anonymous reply authors to import
    WordPress database error: [Table 'db507177147.Comment' doesn't exist]
    SELECT convert(Comment.CommentID USING "utf8mb4") AS CommentID,convert(Comment.DiscussionID USING "utf8mb4") AS DiscussionID,convert(Comment.InsertIPAddress USING "utf8mb4") AS InsertIPAddress,convert(Comment.InsertUserID USING "utf8mb4") AS InsertUserID,convert(Comment.Body USING "utf8mb4") AS Body,convert(Comment.DateInserted USING "utf8mb4") AS DateInserted,convert(Comment.DateUpdated USING "utf8mb4") AS DateUpdated FROM Comment AS Comment WHERE Format != "Deleted" LIMIT 0, 100
    15: No replies to import
    14: No favorites to import
    13: No topic subscriptions to import
    WordPress database error: [Table 'db507177147.TagDiscussion' doesn't exist]
    SELECT convert(TagDiscussion.DiscussionID USING "utf8mb4") AS DiscussionID,convert(TagDiscussion.TagID USING "utf8mb4") AS TagID,convert(Tag.Name USING "utf8mb4") AS Name FROM TagDiscussion AS TagDiscussion INNER JOIN Tag AS Tag USING (tagid) LIMIT 0, 100
    12: No topic tags to import
    11: No closed topics to close
    Continuing Import
    Import Stopped (by User)
    10: No super stickies to stick
    9: No stickies to stick
    8: No anonymous topic authors to import
    WordPress database error: [Table 'db507177147.Discussion' doesn't exist]
    SELECT convert(Discussion.DiscussionID USING "utf8mb4") AS DiscussionID,convert(Discussion.CountComments USING "utf8mb4") AS CountComments,convert(Discussion.CategoryID USING "utf8mb4") AS CategoryID,convert(Discussion.InsertUserID USING "utf8mb4") AS InsertUserID,convert(Discussion.Name USING "utf8mb4") AS Name,convert(Discussion.Body USING "utf8mb4") AS Body,convert(Discussion.closed USING "utf8mb4") AS closed,convert(Discussion.InsertIPAddress USING "utf8mb4") AS InsertIPAddress,convert(Discussion.Announce USING "utf8mb4") AS Announce,convert(Discussion.DateInserted USING "utf8mb4") AS DateInserted,convert(Discussion.DateUpdated USING "utf8mb4") AS DateUpdated,convert(Discussion.DateLastComment USING "utf8mb4") AS DateLastComment FROM Discussion AS Discussion WHERE Format != "Deleted" LIMIT 0, 100
    7: No topics to import
    6: No forum subscriptions to import
    5: No forum parents to import
    WordPress database error: [Table 'db507177147.Category' doesn't exist]
    SELECT convert(Category.CategoryID USING "utf8mb4") AS CategoryID,convert(Category.ParentCategoryID USING "utf8mb4") AS ParentCategoryID,convert(Category.CountDiscussions USING "utf8mb4") AS CountDiscussions,convert(Category.CountComments USING "utf8mb4") AS CountComments,convert(Category.Name USING "utf8mb4") AS Name,convert(Category.Description USING "utf8mb4") AS Description,convert(Category.Sort USING "utf8mb4") AS Sort,convert(Category.DateInserted USING "utf8mb4") AS DateInserted,convert(Category.DateUpdated USING "utf8mb4") AS DateUpdated FROM Category AS Category WHERE Category.CategoryID > 0 LIMIT 0, 100
    4: No forums to import
    3: No passwords to clear
    WordPress database error: [Table 'db507177147.User' doesn't exist]
    SELECT convert(User.UserID USING "utf8mb4") AS UserID,convert(User.Password USING "utf8mb4") AS Password,convert(User.Name USING "utf8mb4") AS Name,convert(User.Email USING "utf8mb4") AS Email,convert(User.DateInserted USING "utf8mb4") AS DateInserted FROM User AS User WHERE Deleted !=1 LIMIT 0, 100
    2: No users to import
    1: Skipping sync-table clean-up
    WordPress database error: [Specified key was too long; max key length is 1000 bytes]
    CREATE TABLE GcuHRqrGbbp_converter_translator ( meta_id mediumint(8) unsigned not null auto_increment, value_type varchar(25) null, value_id bigint(20) unsigned not null default '0', meta_key varchar(191) null, meta_value varchar(191) null, PRIMARY KEY (meta_id), KEY value_id (value_id), KEY meta_join (meta_key(191), meta_value(191)) ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
    Starting Import
    Ready to go.

    Any suggestions? Is my database not allowing writes? I am using 1and1 as my web and database host.

    #188330
    ahau
    Participant

    Hi,

    I am moving an old site to WP and bbPress and need to convert my old forums. I understand I need to use the example.php in the converter folder and write a converter for each old forum – there are 3 I am gong to convert.

    And wouldn’t you know it, the 3 different forums use 3 different date formats!

    Here they are
    1415922411
    2004-09-13 19:25:59
    20080407181855

    From looking around in all of the converter files I see that forum dates are done 2 ways

    In example converter – I am guessing that I would use this format to convert the date like 20080407181855 ?

    // Forum dates.
    $this->field_map[] = array(
    'to_type' => 'forum',
    'to_fieldname' => 'post_date',
    'default' => date('Y-m-d H:i:s')
    );

    In vanilla converter – I am guessing I would use this format to convert the date like 2004-09-13 19:25:59 ?

    // Forum dates.
    $this->field_map[] = array(
    'from_tablename' => 'Category',
    'from_fieldname' => 'DateInserted',
    'to_type' => 'forum',
    'to_fieldname' => 'post_date',
    );

    Anyone know how I can convert a date such as 1415922411 to the correct date format – which I am guessing is Y-m-d H:i:s?

    Thank you for your time.

    #188326
    Robin W
    Moderator

    ok, I’ve got the login information and looked at the issue.

    On my test site, I can replicate a page with

    [bbp-topic-index]
    [bbp-forum-index]
    [bbp-topic-form]

    and have no problem in pagination. page 2 comes up as

    http://mysite.com/forums/page/2/

    This is with a twentyseventen clean theme.

    #188323
    Jason
    Participant

    Robin, I would like to give you login access so you can take a look at how the forums are working, but I don’t want to provide details here. Ideas?

    1. Yes, Forum index page is here: http://cathollowcondos.com/forums/ and it is the one that is generating invalid pagination links.
    2. Yes, the Forum index page has [bbp-forum-index] in it. In fact, I have [bbp-topic-index], [bbp-forum-index], and [bbp-topic-form] on the page, in that order. It looks like [bbp-topic-index] is the shortcode responsible for generating invalid pagination links.

    I have 3 categories/forums listed on the index page, and they have the following number of topics in each: 3, 13, and 1.

    **Important** – If I go to the General forum with 13 topics, there are 2 pages of topics; one with 15 topics, and a 2nd page with another 15 topics. So, it looks like the count is not being displayed properly. BUT, the pagination link to page 2 is working on the General forum page, but not on the main index page. Also, I’m not sure what the difference is between topics and posts shown on the Forums index page. Replies are listed separately. I think you really need to see it for yourself, but it’s a private site.

    #188316
    Robin W
    Moderator

    Thanks for that.

    The blogs per page should not affect the number of forums shown. This is set to 50 in bbpress unless changed by code, which would either be code you have done (and would know about), code from a plugin (but you have disabled and checked these) or your theme (which again you have checked).

    I’m not sure what else would be doing this

    Do you know how to access the database and look at items in it?

    #188312
    tkdoherty
    Participant

    I’d like to remove the date stamp from topics and responses. I found a couple of code suggestions trough Google searches but I haven’t gotten any to work. As a work around, I simply changed the wordpress general settings for date and time to Custom, and then left the custom field blank. This almost worked. The date/time stamp changed from, for instance, “11/25/2017 at 7:03 am” to just ” at “. My trouble is that “at”. I’ve been sniffing through the wordpress and theme php files to remove it or change it to a space, but cannot figure out where the “at” is. Can anyone tell me how I can change or remove it?

    #188274
    Robin W
    Moderator

    @zopfan – this code may be useful

    //redirect user to log in page if accessing forum from external link
    add_action( 'template_redirect', 'forum_redirect_from_external_link' );
    function forum_redirect_from_external_link() {
      $actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
      $actual_link = explode('/',$actual_link);
      if($actual_link[3]=="forums" && !is_user_logged_in() ) {
        wp_redirect( home_url('your-forum-log-in-page-here') ); 
          exit;
      }
    }
    #188273
    xfallseane
    Participant

    Hello i’m french and sorry for my english.

    I have modify the css and template of bbpress and i have copy the files in my host.
    But when i create a topic i have “teste Name of Topic“.

    In local i have check “Topics Loop – Single” and i have find “teste” i have delete this and prefix is deleted but in my host “teste” is not in Topics Loop – Single.
    I do not know what can create the prefix.

    I use bbp pack style and more plugins as bbpress2 bbcode, bp tools bp attachments.

    thank you in advance

    #188265
    Justin
    Participant

    I keep running into the following error when trying to import my Vanilla 2.x forum database. I’m using WordPress 4.9 and bbpress 2.5.14.

    Repair any missing information: Continue
    WordPress database error: [Specified key was too long; max key length is 1000 bytes]
    CREATE TABLE GcuHRqrGbbp_converter_translator ( meta_id mediumint(8) unsigned not null auto_increment, value_type varchar(25) null, value_id bigint(20) unsigned not null default '0', meta_key varchar(255) null, meta_value varchar(255) null, PRIMARY KEY (meta_id), KEY value_id (value_id), KEY meta_join (meta_key(191), meta_value(191)) ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    No data to cleanStarting Conversion

    Any ideas on what I need to do to get this error resolved?

    #188262

    Topic: Closed topics

    in forum Themes
    Ryendel Rocha
    Participant

    Hello.
    I would like to create a forum with closed topics. The person just will be able to see the topic the admin and the person who create. Is there any way to do that?

    And is possible to modify the new topics shortcode? I would like to remove the “Topic tag” and another options in some places. One time the topic are closed, there’s no function for this options.

    Thank you for your attention.

    #188258
    Robin W
    Moderator

    if you mean the login , then put this into the custom css of your theme

    #sidebar .bbp-login-form label {
    	width: 120px !important;
    }
    
    #188220
    Jakob Helmer
    Participant

    and in case if the plugin Buddypress is not installed, something like this might be useful:

    // redirect if the url contains the word 'user' and if you are not logged-in
    add_action('init', 'profile_redirect');
    function profile_redirect() {
    if(strpos($_SERVER['REQUEST_URI'], 'user') !== false &&  ! is_user_logged_in()) {
    	wp_redirect("https://www.whateversite.com/" . LOGIN_PAGE_NAME);
    	}
    }

    ‘LOGIN_PAGE_NAME’ = whatever page name you use to login.
    Change the word ‘user’ to your needs.

    #188197
    abufrank
    Participant

    For fixing the “page-not-found” when accessing a private forum, I found that when I placed Pascals code into the 404 page (great code by the way), the browser still flags the 404. So instead, I moved it to the functions.php file using the following:

    //redirect user to log in page if accessing forum from external link
    add_action( 'template_redirect', 'forum_redirect_from_external_link' );
    function forum_redirect_from_external_link() {
      $actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
      $actual_link = explode('/',$actual_link);
      if($actual_link[3]=="forums" && !is_user_logged_in() ) {
        wp_redirect( home_url('your-forum-log-in-page-here') ); 
          exit;
      }
    }

    I hope this was constructive… 🙂

    #188195
    michaellanfield
    Participant

    Hi. I have a few issues with bbpress. The page I need help with is https://www.thosecrazyvegans.net/forum/

    1. The top of the browser tab bar it says Forums Archive – Those Crazy Vegans
    however, I would like it to say Forum – ThoseCrazyVegans.net
    How do I fix this?

    2. When someone post a new topic they have to fill out the form at the bottom of the forum, however they cannot select a forum from the drop down menu. How to fix?

    3. The search bar does not have an search button. Why and how to fix?

    4. Is it possible to edit this page in X Theme Cornerstone. I am not able to.

    5. The HTML code that I added to the Forum page does not work. When the New Topic link at the top of the Forum page is clicked, I would like it to go to the New Topic form at the bottom of the page. However, the HTML code that I added does not seem to work. What is the full page code for this?

    Forum page code

    <a href="https://www.thosecrazyvegans.net/wp-login.php">Login</a>  <a href="https://www.thosecrazyvegans.net/register">Register</a>
    
    <a href="https://www.thosecrazyvegans/forum#newtopic">Create New Topic</a>
    
    [bbp-forum-index]
    
    <a href="#newtopic">[bbp-topic-form]</a>

    Thank you.

    #188172
    Jakob Helmer
    Participant

    Maybe you mean the buddypress profile page?
    in that case this piece of code in the functions.php of your theme might help:

    function sh_walled_garden()	{
    	global $bp;
    	if( bp_is_register_page() || bp_is_activation_page() )
    	return;
    	if( ! bp_is_blog_page() && ! is_user_logged_in() )
    	bp_core_redirect( $bp->root_domain .'/'. 'LOGIN_PAGE_NAME' );
    }
    add_action( 'get_header', 'sh_walled_garden' );

    ‘LOGIN_PAGE_NAME’ = whatever page name you use to login

    #188165
    Robin W
    Moderator

    either put this in your functions file

    add_filter( 'bbp_get_forum_archive_title', 'tcv_forum');
    
    function tcv_forum () {
    	Return 'whatever you want it to say' ;
    }

    or create a page called whatever you want it to say, and put this in the content
    [bbp-forum-index]

    #188164
    Robin W
    Moderator

    either put this in your functions file

    add_filter( 'bbp_get_forum_archive_title', 'tcv_forum');
    
    function tcv_forum () {
    	Return 'Forum' ;
    }

    or create a page called forum, and put this in the content, and then point your menu at this page
    [bbp-forum-index]

    #188145
    Mauro
    Participant

    I found the pieces and bits necessary to make this happen.

    
    // ALTER TinyMCE INIT FOR VISUAL EDITOR ON FORUM TOPICS AND REPLIES
    // SOURCE: https://bbpress.org/forums/topic/alter-mceinit-for-visual-editor-on-topics/
    
    // Enable visual editor on tinymce in bbPress
    function bbp_enable_visual_editor( $args = array() ) {
        $args['tinymce'] = true;
        return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );
    
    // Enable TinyMCE paste plugin
    function bbp_add_paste_plugin($args) {
      $args[] = 'paste';
      return $args;
    }
    add_filter( 'teeny_mce_plugins', 'bbp_add_paste_plugin');
    
    // ADDS A JQUERY PASTE PREPROCESSOR TO REMOVE DISALLOWED TAGS WHILE PASTING
    // SOURCE https://jonathannicol.com/blog/2015/02/19/clean-pasted-text-in-wordpress/
    function configure_tinymce($in) {
      $in['paste_preprocess'] = "function(plugin, args){
        // Strip all HTML tags except those we have whitelisted
        var whitelist = 'a,p,span,b,strong,i,em,h3,h4,h5,h6,ul,li,ol';
        var stripped = jQuery('<div>' + args.content + '</div>');
        var els = stripped.find('*').not(whitelist);
        for (var i = els.length - 1; i >= 0; i--) {
          var e = els[i];
          jQuery(e).replaceWith(e.innerHTML);
        }
        // Strip all class and id attributes
        stripped.find('*').removeAttr('id').removeAttr('class');
        // Return the clean HTML
        args.content = stripped.html();
      }";
      return $in;
    }
    add_filter('teeny_mce_before_init','configure_tinymce', 99999999999);
    
Viewing 25 results - 4,726 through 4,750 (of 32,481 total)
Skip to toolbar