Search Results for 'code'
-
AuthorSearch Results
-
September 16, 2008 at 4:02 pm #67664
In reply to: Displaying a small snippet of the most recent post
Clicknathan
ParticipantSo here’s what I found, though I wasn’t personally able to get it to work myself, I’m almost positive that someone with a bit more PHP knowledge would have been able to:
This plugin: https://bbpress.org/plugins/topic/forum-last-poster/#post-1538
+ _ck_’s advice in this post: https://bbpress.org/plugins/topic/forum-last-poster/#post-1546
He details how, using
substr
, you can truncate the amount of words being pulled from the any piece of content. Theoretically you could use:post_text(forum_last_topic_id());
But with the truncation method he mentions. I, unfortunately, just don’t know how.
September 16, 2008 at 2:10 am #66091In reply to: WordPress + bbPress Integration 101
nekita
MemberChris,
thanks for your reply. You are right, there’s not much general sense in that problem to begin with.
Unfortunately the issue already starts with the use of a relative vs. an absolute path because the absolute variant isn’t even recognized. The only two options available seem to be either the relative take with
require_once(‘../wp-blog-header.php’);
or something that could be called absolute, but is pretty inconvenient to use:
define(‘WPPATH’, dirname(dirname(__FILE__)) . ‘/’);
require_once(WPPATH . ‘wp-blog-header.php’);
Both of these result in the availability of WP commands like get_header etc. which would be needed to visually integrate bbP with WP, but with the major problem that all my accounts in bbP are Inactive for some weird reason.
Every other attempt where the path to wp-blog-header.php would really be false would just result in the forum link to not work any longer. Therefore it does seem much more likely that different elements of bbP are more or less able to deal with this way of WP integration or access to that file. I would love to give you more detailed error information about the 500 error but I’m not sure where to aquire it.
Furthermore, that problem with Inactive accounts doesn’t seem to be entirely new. I did some research via google and it does pop up every now and then, here’s an example even from way back in 2006: http://comox.textdrive.com/pipermail/bbdev/2006-September/000719.html
> > > There is an issue with posting:
> > > bbpress shows the users (admin) as Inactive. This lets me login, but
> > > I cannot post since the post form is hidden.
> >
> > You must have integrated an old bbPress install with WP (that is, you
> > must have run the bbPress install script before integrating the
> > two). If that's the case, none of your bbPress users exist anymore
> > (they're not defined in WP's user table), and your admin account is
> > inactive. To fix your admin account, you'll have to change the usermeta
> >
> > bb_capabilities = a:1:{s:8:"inactive";b:1;}
> >
> > to
> >
> > bb_capabilities = a:1:{s:9:"keymaster";b:1;}
> >
> > for your admin account. (Where 'bb_' is your $bb_table_prefix.)Unfortunately the usermeta in my database is already set as a:1:{s:9:”keymaster”;b:1;}, but it’s still acting as if users are inactive.
It really is pretty tiresome and after many many database restores and bbP reinstalls I come to the conclusion that integration of WP Functions is somewhat poorly treated so far.
For now my best bet seems to be to either try and replicate my WP scheme within bbP which would take a lot of double work and maintenance when I apply changes to my blog or go with a different forum solution altogether. : /
September 16, 2008 at 1:03 am #67673In reply to: bbPress 1.0 Stable
_ck_
ParticipantThat roadmap is wildly inaccurate and just guesses.
Not only does 1.0 gut huge sections of code that were perfectly working under 0.9 and need to be replaced but it also replaces entire concepts (like the new object cache). There is a huge amount of work to do and I don’t envy Sam and Michael’s jobs right now. Then it will need lots of testing and debugging.
Then there is plugin stability since everything is in a state of flux. I can’t even keep up with the changes anymore, I’ve stopped updating my plugins until things settle down a bit.
Sam is currently working on trackbacks (pingbacks) now which was suppose to be the big new “feature” for 1.0 IMHO it’s a huge waste of time that could be spent elsewhere in the code but pingbacks on forums was something Matt wanted, so he gets what he wants obviously. However it will be the first feature I delete (not just disable, but delete) since XML-RPC was the #1 security problem with WordPress over the years. It’s also going to be a spammer’s delight.
September 15, 2008 at 11:53 pm #67635In reply to: Fulltext searching very slow
_ck_
ParticipantActually, the best thing to do is completely replace the search facility. That’s what I do in Super Search. bbPress’s search is very weak, so weak that there wasn’t even a link to it on any page in 0.9 (it’s similar to WordPress’s search, which also sucks, it’s the ugly truth no one seems to talk about).
I assume you are using the bb-benchmark plugin to watch those queries happen (if not, you should be).
Stupid question but you DO have the mysql cache turned on? I only ask because on many server configs (like CPANEL) it’s turned off by default. What does your
my.cnf
look like? (do acat /etc/my.cnf
in your shell)Try going into phpmyadmin (or command line) and test that first test query against adding
AND post_text REGEXP ':<:%test%:>:'
to the query like so:SELECT p.*, 0 AS search_score, MAX(post_time) AS post_time FROM bb_posts AS p JOIN bb_topics as t ON ( t.topic_id = p.topic_id ) WHERE p.post_text LIKE '%test%' AND p.post_text REGEXP ':<:%test%:>:' AND p.post_status = '0' AND t.topic_status = '0' GROUP BY t.topic_id ORDER BY p.post_time DESC LIMIT 5;
I suspect in the end due to your huge db size you are going to need to completely replace the search functions with something like this http://sphinxsearch.com which has a PHP api. Fortunately in bbPress it’s very simple to hook the internal search and bypass it entirely without even template hacks. A quick google shows that a few WordPress plugins have sphinxsearch support so that would be easy to copy over to bbPress. If you find the keyword “sphinxsearch” on this source for example, you can see how it’s done: http://svn.scriblio.net/plugin/trunk/scriblio.php
September 15, 2008 at 10:01 pm #67672In reply to: bbPress 1.0 Stable
cartmanffc
MemberI hope we’ll get the stable version from Santa
September 15, 2008 at 9:37 pm #66090In reply to: WordPress + bbPress Integration 101
chrishajer
ParticipantHmm – that makes no sense to me. What is the exact error you get if you do not include the
if (file_exists
statement?September 15, 2008 at 9:33 pm #67670In reply to: Can’t see posts if not logged in
Clicknathan
ParticipantMy fault, the problem is that I’m a big dumb idiot.
I had an if statement that wasn’t being closed at the right spot. Thanks for your help chris!
September 15, 2008 at 9:32 pm #67633In reply to: Fulltext searching very slow
Mark Barnes
MemberI tested this on a very large database under very low load. The standard bbpress search creates two queries, namely:
SELECT p.*, 0 AS search_score, MAX(post_time) AS post_time FROM bb_posts AS p JOIN bb_topics as t ON ( t.topic_id = p.topic_id ) WHERE p.post_text LIKE '%test%' AND p.post_status = '0' AND t.topic_status = '0' GROUP BY t.topic_id ORDER BY p.post_time DESC LIMIT 5;
and
SELECT t.*, MIN(p.post_id) as post_id, GROUP_CONCAT(p.post_text SEPARATOR ' ') AS post_text, 0 AS search_score FROM bb_topics AS t JOIN bb_posts as p ON ( t.topic_id = p.topic_id ) WHERE t.topic_status = '0' AND p.post_status = '0' AND ( (t.topic_title LIKE '%test%') OR p.post_text LIKE '%test%' ) GROUP BY t.topic_id ORDER BY t.topic_time DESC LIMIT 30
I ran both queries five times with different search terms. On my very large database, with no optimisation, the first query took (167s, 104s, 36s, 29.7s, 24s), the second (33s, 21s, 22s, 20s, 21s).
September 15, 2008 at 9:06 pm #67671In reply to: bbPress 1.0 Stable
September 15, 2008 at 8:09 pm #66088In reply to: WordPress + bbPress Integration 101
chrishajer
ParticipantNekita – the reason that works is because it’s not including the wp-blog-header.php (can’t find it), but it doesn’t error out because you’re saying “if it’s there, then include it”: otherwise, just continue on, but it’s not included.
So, it errors out when you don’t have the conditional, but with the conditional there, do you have access to WordPress functions, or you can just access specific theme files? Accessing the theme files would not require integration. But using the functions like get_header, get_sidebar, get_footer would all rely on integration being correct.
This assumes that the errors are the same as doyle640:
PHP Fatal error: require_once() [function.require]:
Failed opening required '../wp-config.php'
September 15, 2008 at 5:34 pm #67666In reply to: Can’t see posts if not logged in
chrishajer
ParticipantWhat plugins are you using? Are you using any that would restrict access to certain forums? Like the hidden forums or private forums plugins?
You didn’t make all your forums categories in the admin, did you?
Also, this error is shown when accessing the forum:
SELECT COUNT(*) FROM bb_privatemessages WHERE seen = 0 AND id_receiver =
September 15, 2008 at 5:31 pm #66085In reply to: WordPress + bbPress Integration 101
chrishajer
ParticipantIs the wp-config.php actually located at ../ ?
Also, you could try the absolute path rather than a relative one. I have heard before that that might be a problem (although I’ve never seen that. I don’t use MAMP though.)
First verify if the wp-config.php is located ../ from bb-config.php. If it is, try the full absolute path rather than a relative one. Something like
/Applications/MAMP/htdocs/wp-config.php
.September 15, 2008 at 12:52 am #67614In reply to: Integrated WP Installation – Can’t Login
nekita
MemberNarrowing down on the problem, I’m now able to log in even with the integration code added (by using the exact same setting for WordPress address and Blog address as used in General Settings), however the account is extremely limited in use.
It’s basically the same issue described by user doyle640 here (https://bbpress.org/forums/topic/wordpress-and-bbpress-integration-101/page/3), the Admin screen is unaccessable (blank page) as well as the Profile edit options, even the form to add a new topic is completely missing.
This is true for the Admin account as well as any user account.
Once the line “require_once(‘../wp-blog-header.php’);” is deleted from bb-config.php, everything is accessable as usual.
The login synchronization now works both ways as it should though.
September 14, 2008 at 6:15 pm #67586In reply to: bbPress Top 100 September '08 update
_ck_
ParticipantI did say “or regions” which should cover Europe
“Europe” is triggered by the use of the .eu domain
September 14, 2008 at 6:01 pm #67609_ck_
ParticipantWell you’ll have to test to make sure a wikipost isn’t created yet on that topic (and that topic hasn’t been made yet, and they don’t edit the link to change the topic name,link, etc.).
But adding bbcode style parsing to posts is very straightforward. You’ll need to use
preg_match_all
on the$post->post_text
something like this:
add_filter('post_text', 'make_wiki_links'); // you can also try 'pre_post' which will make it only process the text once during save and not everytime it's displayed
function make_wiki_links($text) {
if (preg_match_all("/[wiki](.*?)[/wiki]/sim", $text, $wiki_links)) {
foreach ($wiki_links[0] as $wiki_link) {
// do whatever you want to each $wiki_link here
}
}
return $text;
}You’ve got about a dozen problems to handle with this technique, including replacing the [wiki] parts afterwards with another preg_replace, good luck.
September 14, 2008 at 5:39 pm #67585In reply to: bbPress Top 100 September '08 update
Shagalaga
Member15. Europe
He? Europe is a continent not a country
September 14, 2008 at 11:52 am #67584In reply to: bbPress Top 100 September '08 update
Mark Barnes
MemberSlightly intrigued to come across this. I’m behind find-answers.net although it’s not in my profile, because (a) it’s not a personal site, and (b) it’s not officially released.
_ck_ How did you find it? I’ve not linked to it nor told anyone about it! Check the administrator profile, you’ll find the site has only been up four days! (So it wasn’t even live when the September top 100 was put up.) That is one reason I’m not yet sharing the code. Quite simply, it doesn’t work properly yet.
The other reason I’m not yet able to share the code is that I need to make sure the licence I want to use is compatible with the licences of the borrowed nntp libraries.
If it’s any interest, one of the forums currently has around 475,000 posts. That equates to 411Mb of MySQL data in all the bbpress tables (including indices). The posts table has 208Mb of data and a 162Mb index.
_ck_ They’re not fake sub-domains. I’ve simply grouped forums into helpful ‘clusters’ and added a subdomain (actually a separate bbpress installation) for each cluster (why buy a new domain for each site?). They look fake because find-answers.net just contains a tiny bit of php code which scans my database tables for the separate installations and presents it in a forum like view. But each site is a separate installation.
Finally, the main purpose of this was to present data from non-propagating newsgroups which most people can’t access. It was largely curiosity that led to me create subdomains for publicly accessible newsgroups. I’ve no idea whether Google will like it or not. There’s certainly other NNTP mirrors out there that do get indexed.
And you’re quite right about me needing the SuperSearch plugin! It is me that you’re talking to here: https://bbpress.org/forums/topic/fulltext-searching-very-slow
September 14, 2008 at 11:14 am #67608benzilla069
MemberAh sorry I explained what I want wrong.
I already have the wikipost section sorted out, when someone puts something in [wiki]pagename[/wiki] I wan’t it to create a new topic that will be wiki enabled. Just like in mediawiki when you use the pagename and it creates a new page.
September 14, 2008 at 9:25 am #67607_ck_
ParticipantOh I see you want to turn any post into a wiki by wrapping the text in [wiki]. There is a huge problem with your logic as the wikipost plugin allows anyone to edit a post by assigning a generic user to the post, which is the trigger. Replacing that with bbcode as the trigger instead would be far more difficult.
bbPress would not have any way to know to let another user edit the post until it scans the post_text for [wiki]. That’s going to be a huge problem.
by the way is translated to
<strong>
not<center>
September 14, 2008 at 8:41 am #67632In reply to: Fulltext searching very slow
_ck_
ParticipantI’m curious about this issue as performance problems always intrigue me. You must be using 0.9 as 1.0 has an index on stickies by default.
As far as fulltext search there is a trick I use because of the multiple issues with fulltext (not only speed but fulltext can’t do words less than 4 characters until you customize and rebuild mysql). The trick is to use regex and do a two pass query where you first exclude all the posts without the words and then allow mysql to do a regular scan of the remaining posts.
Query example from my Super-Search plugin:
WHERE post_text LIKE '%".$term."%'" AND post_text REGEXP ':<:".$term.":>:[^']' "
Compare the performance of that against a fulltext search that uses
"MATCH post_text AGAINST $term"
I don’t have enough data to do a huge benchmark but some simple tests with the cache off shows 0.4 seconds for the trick and 0.9 for the fulltext.The only downside to the trick is you cannot do partial word searches that way. ie.
$term="cat"
will only return posts with the exact word “cat” and not “cats” or “category”. But it should be way faster.Searching a huge number of posts is a non-trivial problem. It’s been known to crush other forums like vbulletin which has fancy code to prevent users from searching too often/too quickly and even disable search temporarily on high server load. Sites like Wikipedia have to go through several technically complex tricks to keep the search fast on that much data.
Many large sites end up using sphinxsearch to replace fulltext search. You could interface it to bbPress via their PHP api.
You can read more workarounds on the mysql fulltext search page (with far more knowledgeable people than me) http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html
September 14, 2008 at 4:26 am #66080In reply to: WordPress + bbPress Integration 101
isaacgreenspan
Member@ck:
based on my recollections, as i’m on a road trip and can’t readily pull up the code, WP2.6 (maybe older, too, i don’t know), in the midst of their new cookies, has an action hook that can be tapped at cookie-creation to make an additional cookie for bbPress to read (in my instance, bbPress is in /forums/ so the new cookie is restricted to that path). the function that destroys the cookies at logout doesn’t have an action hook, so it has to be overridden (it’s pluggable). on the bbPress end, it’s virtually identical–use an action hook at login to create the various cookies that WP expects, override the pluggable cookie-destroying function.
there’s also some work in syncing up all the various secrets.
it’s worth noting that the cookie that’s now restricted to wp-admin/ in WP2.6.x is the same cookie that was unrestricted in path previously, so the mechanics of the cookie contents and whatnot aren’t any different, just the path restrictions.
September 13, 2008 at 2:13 pm #67581In reply to: bbPress Top 100 September '08 update
_ck_
ParticipantSeptember also features the first site to be purposely excluded from the listings. Not that I am passing judgement on it as there are other sites far more dubious that are in the list where the content is not their own.
find-answers.net
It’s impressive in that someone wrote a bbPress to Usenet gateway. But its not right to include it on the list since there will be millions of posts in no time at all and they use a fake subdomain for each group.
At least it proves bbPress can handle such a load. They are going to really want my Super Search plugin (not released yet).
I do wish they’d share the code they made to accomplish that however, especially considering they seem to be using my theme, my plugins, my favicon, etc.
(What I really want is a Mailman to bbPress gateway!)
September 12, 2008 at 5:42 pm #67565In reply to: WordPress Forums Theme
contoaberto
Participantthank u very much, Chris.
I thought you integrated themes with them.
anyway, it would be great of you if you could offer it for dummies.
It’s an elegant theme.
September 12, 2008 at 2:32 pm #67616In reply to: Punaji.com Art and Stuff
thion
MemberFirst impression – “where should I click? What the heck this website is about? I’m living…”
Second impression – “StumbleUpon – first impression count” and in the moment you’re reading this I’m 20 sites away
.
September 12, 2008 at 10:46 am #67606benzilla069
MemberWell I just want it to detect when [wiki]pagename[/wiki] is used so I can run a bit of code(I’m currently modifying your wikipost script to be more of a wiki system.) I want it to create a new post and link to that post.
Looking at the code again I’m starting to wrap my head around what’s going on.
$simple = array('b' => 'strong',); // cut and copied example
Turns all instances of into the html equivalent <center></center> but I just want it to recognise all instances of [wiki]wikipagename[/wiki] and then allow me to run code. I’ve been tinkering with the code most of the day but most of the time it seems to want to run the code I’ve written for all the posts and not just one 😡
-
AuthorSearch Results