Search Results for 'code'
-
AuthorSearch Results
-
September 16, 2010 at 4:59 pm #92615
In reply to: where is the problem? forum on wp page
kikko088
Memberthank you for the answer, I change the quotes but the problem persist

kikko088
September 16, 2010 at 4:27 pm #77150In reply to: Topic paging issue
_ck_
ParticipantHuh. The post numbering did reset. That is strange.
What theme is that – I’d have to see the post.php to see what function they are using between
<div class="postnumber"></div>I see a few people using neoease for bbPress but I can’t find it anywhere? Where did you get it? Or is that inove with your own modifications?
September 16, 2010 at 4:17 pm #77148In reply to: Topic paging issue
e-motion
ParticipantIt looks like I am missing something – when I changed post count on original thread from 81 to 80, all post numbers shifted and #24 is no longer missing. But anyway, I am OK with missing numbers, at least it lets people know where their posts are.
How can I check why my bbpress does not recount posts? Where is that function? I was messing around with some PHP and template codes (to ‘join’ forum to the page) so maybe I have done something…
September 16, 2010 at 4:02 pm #77144In reply to: Topic paging issue
_ck_
ParticipantThat query IS working properly on my test copy.
I purposely changed the topic_posts on a topic from 46 to 99.
Then ran this
INSERT INTO bb_topics (topic_id, topic_posts)
(SELECT topic_id, COUNT(post_status) as topic_posts
FROM bb_posts
WHERE post_status = '0' GROUP BY topic_id)
ON DUPLICATE KEY UPDATE topic_posts = VALUES(topic_posts);and it reverted it back to 46
So try changing the 80 to 81
then try the above query and see if it changes it back to 80 or not?
September 16, 2010 at 3:52 pm #77140In reply to: Topic paging issue
e-motion
ParticipantOK, so I was going thru the database and saw that bbpress holds post count in it. I just changed that to correct value and it seems like everything is good now. And post #24 is no longer missing, posts have shifted per one place.
Thank you for your help.
Anyway now we have discovered one more bug to fix.
September 16, 2010 at 3:50 pm #77139In reply to: Topic paging issue
_ck_
ParticipantThinking out loud here, don’t do anything yet on your own.
This is Sam’s new routine in 1.0.2 based on my alternate recount for bbpress 0.9
$sql = “INSERT INTO
$bbdb->topics(topic_id,topic_posts)(SELECT
topic_id, COUNT(post_status) astopic_postsFROM
$bbdb->postsWHERE
post_status= ‘0’ GROUP BYtopic_id)ON DUPLICATE KEY UPDATE
topic_posts= VALUES(topic_posts);“;
I will investigate further…
September 16, 2010 at 3:43 pm #77137In reply to: Topic paging issue
e-motion
ParticipantQuery returns 80 posts.
Definitely something is very wrong…September 16, 2010 at 3:39 pm #77136In reply to: Topic paging issue
_ck_
ParticipantI forgot to add the topic_id=12 and group by on my queries sorry.
Well the numbers are coming from post position.
But still something is very wrong, because bbpress is showing
81as the post count.You need to run the exact query that the recount function uses.
SELECT topic_id, COUNT(post_status) as topic_posts FROM bb_posts WHERE post_status=0 AND topic_id=12 GROUP BY topic_idSee if that gives 80 or 81
September 16, 2010 at 3:35 pm #94066In reply to: Parse error: functions.core.php
mr_pelle
ParticipantI’ve checked every BackPress version and none of them has
$endat line 244…. weird…The root of the problem is probably somewhere else.. no guess though..
September 16, 2010 at 3:30 pm #77133In reply to: Topic paging issue
e-motion
ParticipantThis query gave me an error:
#1140 - Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clauseSo I just did this:
SELECT * FROMbb_postsWHERE topic_id=12And the result is:
Showing rows 0 – 29 (80 total, Query took 0.0020 sec)
So now I’m wondering where is bbpress taking post count numbers from?
September 16, 2010 at 3:22 pm #77132In reply to: Topic paging issue
_ck_
ParticipantOkay we need to see if the query is failing somehow.
try this (assuming the table is bb_posts)
SELECT topic_id, COUNT(post_status) as topic_posts FROM bb_posts WHERE post_status=0 AND topic_id=12See if that gives 80 or 81
Then try this if that gives 81
SELECT topic_id, COUNT(*) as topic_posts FROM bb_posts WHERE post_status=0 AND topic_id=12(sorry I forgot to add AND topic_id=12)
September 16, 2010 at 2:59 pm #94058In reply to: Internal Server Error
zaerl
ParticipantCheck the server error log
logs/error_logand report the error.September 16, 2010 at 2:59 pm #94064In reply to: Parse error: functions.core.php
mr_pelle
ParticipantWhat version of bbPress are you on? There is no
$endat line 244 of that file, neither on the BackPress version shipped with bbPress 1.0.2 neither with trunk…September 16, 2010 at 2:25 pm #77125In reply to: Topic paging issue
_ck_
ParticipantI have a little trick to workaround this problem, at least when bbpress requests a link for the post that happens to be the last post in the topic.
I will write a filter for when
get_post_linkis requested, it will check the post id# – if it happens to be the last post in the topic (stored intopic_last_post_id) it will instead route the request to the more accurateget_topic_last_post_linkSeptember 16, 2010 at 2:16 pm #77124In reply to: Topic paging issue
_ck_
ParticipantHere’s a simplified example of what I think is happening internally.
Let’s say for ease of understanding there are TWO posts per page.
And there are 7 posts in this particular topic example
|
1 2| – |3 4| – |5 6| – |7|so there are 4 pages (each | | is a page)
In this example, the post numbers are also the post-position.
Now let’s say a mod deletes post number 4
|
1 2| – |3 5| – |6 7|Should only be three pages.
But bbPress is stupid by default, post-position is never recalculated so those post numbers still represent post position in this example.
bbPress DOES track number of posts in a topic, even when deleted.
So requesting a link to the last post in the topic, regardless of post-position, WILL be calculated correctly, and return page 3.
However, if it specifically asks for a direct link to post 7 and not the last post in the topic, this is what happens.
Post 7 is post-position 7
posts per page is 2 per page
ceil( $post_position / $per_page )7 / 2 = 3.5, ceil of 3.5 = 4
So it will ask for page 4
Page 4 does not exist in the topic.
The link may be created but the link is bogus and will not work, it will either return you to the first page of the topic, or maybe the front page of the entire forum.
September 16, 2010 at 1:42 pm #77122In reply to: Topic paging issue
_ck_
ParticipantYou know what, this is an inherit flaw with bbpress that I think I mentioned elsewhere years ago.
It never recalculates post-position when there are deleted posts, yet it relies on that post-position to find a specific posts’s page.
See this is how it calculates the page
function get_post_link( $post_id = 0 ) {
$bb_post = bb_get_post( get_post_id( $post_id ) );
>>>>>> $page = bb_get_page_number( $bb_post->post_position );
return apply_filters( 'get_post_link', get_topic_link( $bb_post->topic_id, $page ) . "#post-$bb_post->post_id", $bb_post->post_id );
}and this is how it calculates that page
return intval( ceil( $item / $per_page ) );so it’s
$bb_post->post_position / $per_pagealways, regardless if there are deleted posts in the way, which is why it can be “short” when calculating the last page(s) on a longer topic with deleted posts.
The solution is that post-position has to be recalculated when a post is deleted. The only side effect is that for admin, jumping directly to a deleted post would not work, you’d have to find it manually.
bbPress never, ever, re-calculates post-position, even on a recount, if I am not mistaken.
There is one tiny work-around we can do.
For the LAST POST calculation, we can intercept that and subtract the number of deleted posts from the post-position. Hmm, actually wait, is it subtract or add. I have to investigate this a bit and think out the logic.
September 16, 2010 at 1:24 pm #77121In reply to: Topic paging issue
_ck_
ParticipantI must be missing the problem here.
The “latest reply” link works.
When I am on page 3, the page 4 link works.
What specifically is not working?
Are you saying the problem is intermittent?
ps. I use an ebike with a custom lifepo4 battery

Oh wait, I see what you saying now
he problem vanished when one reply was written.
It will reappear when someone writes a reply last on that page.
so it’s an even/odd problem
if there are an even number of posts, it works,
if there is an uneven number, it does not work
Did you try the trick of deleting one post and then undeleting it?
There must be a bug in the way bbPress calculates post-position when there are deleted posts. I wonder if it’s specific to 1.x
September 16, 2010 at 1:09 pm #77120In reply to: Topic paging issue
e-motion
ParticipantNo, I do not. I have following plugins:
Akismet
Allow Images
Avatar Upload
BBcode Buttons Toolbar
BBcode Lite
bbPM
BBVideo
Bozo Users
Hello Louie
Human Test for bbPress
Instant Password
Skip Akismet
SourceCode Highlighter
September 16, 2010 at 9:31 am #92614In reply to: where is the problem? forum on wp page
mr_pelle
ParticipantI suppose the first echo should read:
echo "<tr><td>". $forum_id." > ".$result->forum_name."</td>";By the way, I suggest you to use double quotes for html tags (like you would do normally) and single quotes for php commands, unless you include vars in them. Like this:
echo '<td class="num">';More details here.
September 15, 2010 at 9:47 pm #35030Topic: where is the problem? forum on wp page
in forum Pluginskikko088
Member<table id=”latest”>
<tr>
<th>Forum</th>
<th>Discussioni</th>
<th>Messaggi</th>
</tr>
<?php
global $wpdb;
$query=”SELECT * FROM bb_forums WHERE topics!=0 ORDER BY forum_order ASC LIMIT 10″;
$results=$wpdb->get_results($query);
foreach ($results as $result) {
echo “<tr><td>forum_id.”‘>”.$result->forum_name.”</td>”;
echo “<td class=’num’>”.$result->forum_topics.”</td>”;
echo “<td class=’num’>”.$result->forum_posts.”</td></tr>”;
}
?>
</table>
why this code don’t display the number of discussions and posts?
kikko088
September 15, 2010 at 8:50 pm #94034In reply to: css input problem
kikko088
MemberSeptember 15, 2010 at 8:49 pm #76448In reply to: bbPress plugin September 15?
John James Jacoby
KeymasterSeptember 15, 2010 at 6:52 pm #80582nood
MemberAssuming you have permalinks set up, create a page with the permalink
forumsso the full url would be http://localhost/wordpress/forumsBecause the directory exists, when someone goes to the page they will end up on your forum.
September 15, 2010 at 11:17 am #76443In reply to: bbPress plugin September 15?
Rich Pedley
MemberAll sounds good, thanks for the update
September 15, 2010 at 10:25 am #76442In reply to: bbPress plugin September 15?
John James Jacoby
KeymasterI’ve been side tracked with BuddyPress bugs and paying work, so don’t expect anything official for a week or two. I have a few projects coming up fast that will need this working so while I’m missing my soft Sept 15 deadline, I don’t think it will be /too/ far off.
Sorry to disappoint, it’s no fun… and thanks for your patience with me and it.
For the record, I love bbPress. I have a few commits going into 1.1, and I have every intention of making bbPress be the best it can be as a WordPress plugin.
Regarding my motivation and priority, it’s to make great forum software that fits inside WordPress; nothing more and nothing less.
Regarding why I was able to step into this role, it’s because our peers believe I am capable, and I am willing to dedicate time and effort towards it getting it done.
Regarding any possible benefit BuddyPress might see, is a welcome bonus but not a priority. BuddyPress/bbPress processing times should decrease with BuddyPress 1.2.6, as a few tweaks have been made and a bug or two have been patched in that regard. Even still, nothing compares to the blazing fast speed of bbPress by itself, even in the slower 1.x branch.
Regarding everything else, I’m just here to write the best code I can, help make bbPress a great WordPress plugin, and have fun doing it all. So far, so good on my end.
-
AuthorSearch Results