Search Results for 'code'
-
AuthorSearch Results
-
May 23, 2014 at 9:45 pm #146929
In reply to: WP Symposium converter for bbPress
Stephen Edgar
KeymasterReply 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_parentfield, 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 , 100Working 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.
May 23, 2014 at 8:17 pm #146927Stephen Edgar
KeymasterI 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?May 23, 2014 at 6:46 pm #146925In reply to: Adding forum posts to activity stream…
dugfunny
Participanthere is the answer…
'bbp_topic_create'and'bbp_reply_create'May 23, 2014 at 5:07 pm #146924In reply to: Per Forum Permissions by Group
Tom Dyer
Participantas a side note, it’s probably worth utilising the
bbp_get_forum_post_type(),bbp_get_topic_post_type()andbbp_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.
May 23, 2014 at 1:57 pm #146911In reply to: bbpress sidebar
Robin W
ModeratorHave you set up using
if so did you use bbPress WP tweaks?
May 23, 2014 at 10:24 am #146900In reply to: Per Forum Permissions by Group
Robin W
ModeratorJust 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 !!!
May 23, 2014 at 9:30 am #146894In reply to: Per Forum Permissions by Group
Tom Dyer
ParticipantOk 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?May 23, 2014 at 8:46 am #146889In reply to: Per Forum Permissions by Group
Tom Dyer
ParticipantYep, confirmed. It didn’t like /topics/ either.
I’ve just tried putting a temporary limit of 100 on the
SELECTquery 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?
May 23, 2014 at 8:40 am #146888In reply to: Per Forum Permissions by Group
Robin W
Moderatorok, 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
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 !
May 23, 2014 at 8:29 am #146883In reply to: WP Symposium converter for bbPress
lagrou
ParticipantMerged 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…
May 23, 2014 at 8:27 am #146881In reply to: Per Forum Permissions by Group
Tom Dyer
Participantok – 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 1828Which 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.
May 23, 2014 at 8:07 am #146878In reply to: Newby a little lost
Robin W
Moderatoryes, you should be able to just have the index.
Check out
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.
May 23, 2014 at 8:02 am #146875In reply to: Per Forum Permissions by Group
Tom Dyer
ParticipantNope, 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?May 23, 2014 at 7:57 am #146873In reply to: Per Forum Permissions by Group
Tom Dyer
ParticipantIt’s the same – it seems that
$wpdb->get_col()is still AWOL…May 23, 2014 at 7:30 am #146868In reply to: Per Forum Permissions by Group
Tom Dyer
Participant– that’s if I’m checking it correctly. I tried this:
var_dump( property_exists( $wpdb, 'get_col' ) );Which returnedbool(false)Am I doing it right? I don’t understand how the object could be there, but the method not 🙁
May 23, 2014 at 7:25 am #146867In reply to: Per Forum Permissions by Group
Tom Dyer
ParticipantHaving 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() ?May 23, 2014 at 7:23 am #146866In reply to: Per Forum Permissions by Group
Stephen Edgar
KeymasterI 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:246May 23, 2014 at 7:03 am #146864In reply to: Per Forum Permissions by Group
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
May 23, 2014 at 6:32 am #146858In reply to: Per Forum Permissions by Group
Stephen Edgar
KeymasterJust to be clear on two things, first this is awesome the plugins you are writing and supporting Robin 🙂
Second https://codex.wordpress.org/Forum_Welcome#The_Bad_Stuff
* Forum members should not post their email addresses, ask others to post their email or solicit contacting people off of the forums.
* Plugin and theme authors may post their contact URL or even their email address in their own support sub-forum, but that should be a last resort thing.
* Forum members, including plugin and theme authors, should never ask for admin or FTP access to a server, MySQL, or WordPress installation.Thus far in this thread, nothing is ‘out of order’, these rules are designed to protect both user and supporter, if something does go horribly wrong and the ‘supporter’ breaks things really badly or the ‘user’ has a change of heart and accuses the ‘supporter’ of breaking their site things get ugly very quickly and neither party will be very happy.
These rules are designed to safeguard all parties and the vast majority of time things can be explained using just the forums, just take your time and explain it clearly so the other party can reproduce the issue, step by step with the resulting outcome and what you’d expect the outcome to be.
Edit: So carry on doing what your doing, I just thought I should point this out and probably should add this to our ‘create new topic form’ as a reminder…
May 23, 2014 at 5:20 am #146853Topic: Remove top pagination but keep bottom
in forum Troubleshootingdemonboy
ParticipantMildly baffled by this. I’m trying to remove the pagination at the top of the forum topic page but leave it at the bottom (see here for an example). I can remove both by commenting out the code in pagination-topics.php, or I can remove both with display:none, but how do I remove the top one and not the bottom one? They share exactly the same properties.
Thanks,
Jamie
May 23, 2014 at 5:18 am #146852In reply to: WP Symposium converter for bbPress
Stephen Edgar
KeymasterI considered that the content could at least be imported, then the admin would do whatever he wants to with that content. But maybe the groups ownership and membership will be impossible to mimick at bbPress level solely, so it’s better to avoid importing rather than making public content that was private to begin with…?
– Groups forums (either drop topics, leave them as parentless, or create hidden forums as per the group name)
I don’t think leaving them parentless is the best way to go, maybe creating a hidden forum might be the way to go. Let’s leave this out for now, we can revisit this in the future easily enough and get v1 out and revisit this for v2.
I’m adding a Users section to your own version of the converter module (based on other converters available). If we want to import user-related settings, like forums/topics subscriptions and favorites, is this possible ? WPS uses usermeta, and I would assume bbPress does so…?
– user meta (forum subscriptions, favorites)
Yes, mainly, I haven’t looked at importing subscriptions or favorites yet in any of the importers, will get there one day.
What you have added looks fine via your latest commit here.
WordPress database error: [Table ‘xxx.wp_bp_groups_groupmeta’ doesn’t exist]
You only get this error if you don’t have BuddyPress installed and activated, I need to add some inline docs for this and help docs.
How do you access a parentless topic in bbPress ? Could these be used for WP Symposium groups forum topics ?
You will see them in the topic list in the backend, you won’t see them on the front end unless you make them a sticky or know the url but they will be publicly accessible. Finding them in the backend is not so easy unless you know the title of the topic. Not the best experience, but also was never really planned for, it was just never enforced that a topic must have a forum either.
– Could you clarify what a forum and a category refer to, in bbPress terminology ? Is a category a subforum, which has necessarily a parent forum, while a forum has no parent ? In such a case, there should be a test over symposium_cats.cat_parent in callback_forum_type(), otherwise it can be simply disregarded…
Both a forum and a category can have sub forums or sub categories, forums can have topics, categories cannot have topics.
Thus
symposium_cats.cat_parentis already being used with_bbp_forum_parent_idand this is how we get the forums, sub-forums, categories etc all ordered correctly in their correct nested levels.I think we are good, I’ll grab the latest shortly and the patch to bbPress Trac Ticket #2603 and I’ll take it for a test drive then commit it and it will be part of bbPress v2.6.
May 23, 2014 at 2:49 am #146826In reply to: Per Forum Permissions by Group
Robin W
ModeratorNew version 1.6 available from wp-plugins
https://wordpress.org/plugins/bbp-private-groups/
or my site
This version fixes the [bbp-topic-form] shortcode so that it only displays allowed forums (previously it showed all forums, but only allowed posting in authorised).
@smileyriley21 – love, wealth and happiness should now abound ! 🙂May 23, 2014 at 2:41 am #146825In reply to: Forum still not working right…
Robin W
ModeratorGreat – glad you’re fixed, and thanks for posting the latest code needed ! 🙂
May 23, 2014 at 2:35 am #146824Stephen Edgar
KeymasterHmmmm…. Adding breadcrumbs to the ‘author’ details of topics and replies, that’s different, haven’t seen that done before 🙂
Not sure if at the end of this I will have any form of an eloquent solution here for you…
Technically it is actually working for you as the ‘include_current’ is the actual reply, not the topic, thus I presume if you set it to
trueyou results would be:Forums › Assignment Submissions › Assignment 24: 1st 24 hours in Crown Point, Tobago > 3256
Where the3256is the ID of the first reply in your thread linked above…And if you set it to true your breadcrumb for the first post, i.e. the actual topic would be:
Forums › Assignment Submissions › Assignment 24: 1st 24 hours in Crown Point, TobagoThe reasoning is that the breadcrumb function goes looking for ‘ancestors’ which includes the parent topic and any parent forums or categories in the hierarchy tree.
You could do something like this, downside is you still have a extra
>separator that you cannot hide without hiding all of them…a.bbp-breadcrumb-topic { display: none; }The alternative method would be to not use breadcrumbs at all for this and use something like this for the ‘parent’ forum link:
<a href="<?php bbp_forum_permalink(); ?>"><?php bbp_forum_title(); ?></a>May 23, 2014 at 12:26 am #146816In reply to: Give bbPress full editor by default?
Stephen Edgar
KeymasterYou can enable the full TinyMCE editor in bbPress, details are here.
-
AuthorSearch Results