Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 11,826 through 11,850 (of 32,585 total)
  • Author
    Search Results
  • #146955
    lagrou
    Participant

    Problem I see, is that with this version all of the replies are imported, including second-level ones which have the topic ID as parent instead of their parent ID. Not sure if this is related, but on my test install when there are second-level replies to import it messes bbPress list of replies. Whereas with no second-level replies in WPS forum, it works fine.

    To get only first-level replies, I have changed the above into:
    "SELECT s.* FROM wp_symposium_topics s INNER JOIN wp_symposium_topics t ON s.topic_parent = t.tid WHERE s.topic_parent != 0 AND s.topic_group = 0 AND t.topic_parent = 0"

    Which works fine as dumped in a PHP page. And then into:

    // Reply id (Stored in postmeta)
    $this->field_map[] = array(
    	'from_tablename'  => 'symposium_topics s',
    	'from_fieldname'  => 'tid',
    	'join_tablename'  => 'symposium_topics t',
    	'join_type'       => 'INNER',
    	'join_expression' => 'ON s.topic_parent = t.tid',
    	'from_expression' => 'WHERE s.topic_parent != 0 AND s.topic_group = 0 AND t.topic_parent = 0',
    	'to_type'         => 'reply',
    	'to_fieldname'    => '_bbp_post_id'
    );

    Unfortunately, it seems the converter doesn’t accept this…

    EDIT: do not believe I haven’t read your own posts LOL. I just wanted to describe the path I have followed in case it would bring some light on your side…

    #146948
    Robin W
    Moderator

    @trymedo – great really pleased !

    When you get a moment can you just try http://www.mysite.com/topics without my plugin. I just want to confirm that it is my ‘double sort’ that is causing your issue. If it is, then I’ll probably just add a keymaster and moderator check to ignore the ‘get col’ part so that it doesn’t do that if not needed. It would then mean that the server isn’t having to check every post for these groups, so would speed response for large forums such as yours. Then the code within the move.php could be re-instated, and I wouldn’t need to spend time working out what it does !

    At the moment keymasters & moderators can see all posts and forums, although I suspect that someone will want a moderator to only see and moderate a sub group of forums. I plan therefore to do the check to say if ‘keymaster’ or if ‘moderator without a group set’ then skip the for the ‘get_col’ filters, which would speed sorts for large forums such as yours and get round the issue of the double sort. Moderators with a group set would still go into the double sort, so would fall foul of the double sort if that’s how you would want them set. Give me feedback on this please, so I can work on what I should do !

    #146947
    ovizii
    Participant

    The plugin author of the plugin I mentioned coded What I asked for, you can find the thread here: https://wordpress.org/support/topic/need-some-help-getting-this-right-1

    Fixes the Recent Replies perfectly!!!

    #146942
    lagrou
    Participant

    Looking at this now, threaded replies are using the same topic_parent field, though they are using this as a pointer to the ‘reply parent’ rather than the topic parent.

    Confirmed. To select first-level replies only, that would be using SQL:

    "SELECT * FROM wp_symposium_topics WHERE topic_group = 0 AND topic_parent IN (SELECT tid FROM wp_symposium_topics WHERE topic_parent = 0)"

    And to select second-level replies only:

    "SELECT * FROM wp_symposium_topics WHERE topic_parent != 0 AND topic_group = 0 AND topic_parent NOT IN (SELECT tid FROM wp_symposium_topics WHERE topic_parent = 0)"

    Note that I’m excluding groups forum. Now, how to mimick this with the converter?

    #146941
    Nathan
    Participant

    Hi Christian,
    The code I ended up using was not my original idea. I didn’t hook into a new user creation. What this does is inverts the subscribe list. It turns it into an unsubscribe list. So any user should be subscribed to any new forum by default. Let me know if something is not working for you, and I’ll see what I can do!

    – Nathan

    #146939

    In reply to: CSS Plugin

    street2k
    Participant

    What would be a helpful idea is for people who has a customized css color template of the bbpress.css file to post an image of their theme with a copy of the css so anyone who would like to achieve the same or similar outcome as a guide. So the ppl who aren’t code savvy can use it for their forum. That way there is no need for a plugin to be created.

    #146934
    Robin W
    Moderator

    @trymedo

    yes that’s on my list together with a bunch of other code wrangling ! It always a balance between whether you release something because it’s good enough and whether you make it perfect, then release only to find that it still needs changing !

    Given limited time to work on these things, if I got it how I think it will eventually look, it would be another 3-4 months before I released version 1.

    But please keep feedback coming !

    #146929
    Stephen Edgar
    Keymaster

    Reply to Replies, I had a look and they are stored in symposium_topics like other replies, so we should have them with little effort. In case you’d like to give it a try on WPS side, and be able to test their import, they are activated using roles, “Forum comment roles” under “Forum” tab.

    I’ve added some ‘replies to replies’ to my test WPS forum before converting it… In bbPress, in the backend they are not displayed in the list of replies, although I do see ‘hidden’ replies in the count that I cannot access to. In the frontend, the forum topic does not show those replies, nor do the counters. However!! When dumping wp_posts table WHERE post_type = ‘reply’, they are there, so they were converted ok, it’s just that they don’t show. I did set bbPress threated replies 2 levels deep before conversion. Any advice…?

    Looking at this now, threaded replies are using the same topic_parent field, though they are using this as a pointer to the ‘reply parent’ rather than the topic parent.

    This is the reply query: (My test results) Notice the ‘threaded replies’ topic ID, it is not the actual topic ID it is the reply ID they are a reply to.

    
    SELECT CONVERT( symposium_topics.tid
    USING  "utf8" ) AS tid, CONVERT( symposium_topics.topic_category
    USING  "utf8" ) AS topic_category, CONVERT( symposium_topics.topic_parent
    USING  "utf8" ) AS topic_parent, CONVERT( symposium_topics.topic_owner
    USING  "utf8" ) AS topic_owner, CONVERT( symposium_topics.topic_post
    USING  "utf8" ) AS topic_post, CONVERT( symposium_topics.topic_started
    USING  "utf8" ) AS topic_started
    FROM wp_symposium_topics AS symposium_topics
    WHERE symposium_topics.topic_parent !=0
    LIMIT 0 , 100
    

    Working on tweaking the query now….

    I’ll be happy to contribute to the bbPress Codex as well, with issues etc.

    Appreciated 🙂

    Browsing other converters’ Codex, I do see where there will be issues with WP Symposium, [youtube], custom smilies {{cloud}}, etc.

    I haven’t looked at this yet, most of it should be easy enough from work on the other importers, just a matter of creating a list of all that is required.

    As far as groups forum topics, I would add ‘AND symposium_topics.topic_group = 0 ‘ to the ‘from_expression’ of both the topic ID and Reply ID sections to get rid of those posts. Cleaner until v2.

    I’ll add that shortly and do some tests.

    Stephen Edgar
    Keymaster

    I know some tables are named bb-something, but do the post have a “tell” ?

    This, you should not have ANY tables named bb-something, are you using the old v0.9x/1.x version of bbPress? The standalone version or are you using bbPress v2.x plugin for WordPress?

    #146925
    dugfunny
    Participant

    here is the answer…

    'bbp_topic_create' and 'bbp_reply_create'

    #146924
    Tom Dyer
    Participant

    as a side note, it’s probably worth utilising the bbp_get_forum_post_type(), bbp_get_topic_post_type() and bbp_get_reply_post_type() from bbPress instead of hard-coding the ‘forum’, ‘topic’ and ‘reply’ in there. It’s not affecting what I’m doing right now, but you can bet it’s going to upset somebody sometime 😉

    – You may already have that in mind but I just figured, since you want people testing it, that it’s worth pointing out.

    #146911

    In reply to: bbpress sidebar

    Robin W
    Moderator

    Have you set up using

    Step by step guide to setting up a bbPress forum – Part 1

    if so did you use bbPress WP tweaks?

    #146900
    Robin W
    Moderator

    Just taken a good look at form_reply_move.php and that calls a function that uses the bbp_has_topics with a ‘post__not_in’ parameter. My function uses a ‘post__in’ parameter, and wp-Query can’t handle both in one query, hense why it falls over.

    I’m already in trouble with my wife for still typing this, but try copying

    wp-content/bbpress/templates/default/bbpress/form_reply_move.php to a folder called bbpress within the root of your theme – ie wp-content/your-theme-name/bbpress/form_reply_move.php

    this will create a copy that is used instead of the default

    try

    changing

    line 45

    <?php if ( bbp_has_topics( array( 'show_stickies' => false, 'post_parent' => bbp_get_reply_forum_id( bbp_get_reply_id() ), 'post__not_in' => array( bbp_get_reply_topic_id( bbp_get_reply_id() ) ) ) ) ) : ?>
    
    

    to

    <?php //if ( bbp_has_topics( array( 'show_stickies' => false, 'post_parent' => bbp_get_reply_forum_id( bbp_get_reply_id() ), 'post__not_in' => array( bbp_get_reply_topic_id( bbp_get_reply_id() ) ) ) ) ) : ?>
    

    and line 63

    from

    <?php endif; ?>

    to

    <?php //endif; ?>

    This just takes that argument out and see how it runs then

    If that works, then I can play with what is needed – think I know, but am out of the door….now !!!

    #146894
    Tom Dyer
    Participant

    Ok thanks @netweb, it appears that the query grabs every topic, then looping through them to check that the user has permission to view them (by getting the forum ID for each post).

    This happens before bbp has even pulled the topics back from the database, so presumably if there’s pagination involved, theres a lot of work going on here that needn’t be.

    In regards to the http://www.site.com/topics/ issue:
    Would it be possible to instead add a filter to the topics that were pulled back from the query – so for example, if you’re on page one and that’s showing 20 topics – you only need to check the permissions for those 20 topics.

    In regards to the ‘move’ issue:
    This one is a bit different in that it does pull back all the topics – BUT if you’re moving a topic, then your going to be a moderator or a keymaster so we probably don’t need to check permissions in this case anyway.

    With those points in mind, do you know of any other filters that we could tap into instead of adding a filter to the bbp_before_has_topics_parse_args ?

    #146889
    Tom Dyer
    Participant

    Yep, confirmed. It didn’t like /topics/ either.

    I’ve just tried putting a temporary limit of 100 on the SELECT query and it fixed the issue, but obviously this isn’t an ideal solution. Do you have any ideas as to how I could fix this ‘properly’? I suppose coming up with a sensible limit could be a fix, but what would be the repercussions of doing that?

    Also, if a limit is what’s required, is this going to be something I have to do manually, or would it be an update to the plugin?

    #146888
    Robin W
    Moderator

    ok, so if it’s a memory thing then it’s filtering ok when you just have forums set up, as it filters to the displayed forum first, so has less of a list.

    The Topics.php is only used by two areas as far as I can remember. The first is if you simply do

    http://www.mysite.com/topics

    which lists all forum topics. I created the function to specifically sort out peoples ability to enter that url and get all topics listed, and so bypass whether they could see a forum.

    The second is the one you have discovered (and I didn’t realise was used there) and seems to be generating a memory issue.

    You could confirm this by typing your url with /topics after and it should fall over there as well.

    If this is the issue, then I’ll look closer at whether I can improve the code, or maybe Stephen has a solution !

    #146883
    lagrou
    Participant

    Merged your pull request…

    Reply to Replies, I had a look and they are stored in symposium_topics like other replies, so we should have them with little effort. In case you’d like to give it a try on WPS side, and be able to test their import, they are activated using roles, “Forum comment roles” under “Forum” tab.

    I’ll be happy to contribute to the bbPress Codex as well, with issues etc. Browsing other converters’ Codex, I do see where there will be issues with WP Symposium, [youtube], custom smilies {{cloud}}, etc.

    EDIT: oops fixed a copy/paste error in my prose…

    #146881
    Tom Dyer
    Participant

    ok – some more digging has brought this to the surface:

    Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 72 bytes) in /Users/tom/Sites/frenchentree/htdocs/wp-includes/wp-db.php on line 1828

    Which appears at the time $wpdb->get_col() is called. Could it be that we have too many forum topics? 🙁

    *edit* Currently we have 71,009 posts. Of which 70,728 are published.

    #146878

    In reply to: Newby a little lost

    Robin W
    Moderator

    yes, you should be able to just have the index.

    Check out

    Step by step guide to setting up a bbPress forum – Part 1

    and if that doesn’t directly help, come back with how you are set up – ie what does menu take you to, what is in that link/post/page/category etc.

    #146875
    Tom Dyer
    Participant

    Nope, I’ve not touched the Twenty fourteen theme since I added it. It’s been updated whenever required anyway though (I don’t like the seeing the update icon in the admin, so I tend to always keep things on the latest version whether I’m using it or not).

    This is a multisite install of WordPress though – Would that affect the $wpdb->get_col() visibility?

    #146873
    Tom Dyer
    Participant

    It’s the same – it seems that $wpdb->get_col() is still AWOL…

    #146868
    Tom Dyer
    Participant

    – that’s if I’m checking it correctly. I tried this:

    var_dump( property_exists( $wpdb, 'get_col' ) ); Which returned bool(false)

    Am I doing it right? I don’t understand how the object could be there, but the method not 🙁

    #146867
    Tom Dyer
    Participant

    Having poked around in the code myself, it appears to be falling over in inc/topics.php line 12.

    $post_ids=$wpdb->get_col("select ID from $wpdb->posts where post_type = 'topic'") ;

    I’ve checked and the $wpdb object is available, but it seems that the method get_col() is not… does anybody know why that might be? Or is there another method I could use to replace get_col() ?

    #146866
    Stephen Edgar
    Keymaster

    I have a huge affinity for the Roots theme, it is awesome, but it can catch you out, I just gave the latest v1.6 a run, using Twenty Fourteen as the theme everything works as expected as ‘keymaster’, moving a reply from one topic to another works as expected.

    The only errors I see are in the function pg_get_author_link (These are not related directly to @trymedo’s the issue though)

    Notice Undefined variable: args 1 wp-content/plugins/bbp-private-groups/includes/functions.php:245
    Notice Undefined variable: post_id 1 wp-content/plugins/bbp-private-groups/includes/functions.php:246

    #146864
    Tom Dyer
    Participant

    @robin-w Currently, the only error I’m seeing is this (which I can’t find a reference to within the bbp-private-groups plugin code):

    [23-May-2014 11:02:07 UTC] PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘blockusers_init’ not found or invalid function name in /Users/tom/Sites/frenchentree/htdocs/wp-includes/plugin.php on line 470

Viewing 25 results - 11,826 through 11,850 (of 32,585 total)
Skip to toolbar