You’d replace the topic_posts();
with the code that johnhiler wrote.
Is it worth running through that calculation for every listed post though? People on your forum would soon become familiar with Number of Posts rather than Replies to Post statistics.
I’ve just reported this issue of HTML characters being displayed in edit post in Trac. (https://trac.bbpress.org/ticket/1158).
It looks like a minor bug in bbP rather than an issue with the plugin… although it could affect people who are trying to type HTML characters out in their code examples. That rarely happens on my forum though.
This code won’t work on front-page.php but did you try it in forum.php? I’m running v1.0.1 and it’s working fine there.
For the front page you need to find the SQL query that gets called and replace it with your own, and ORDER BY topic_id
. Let me know how you get on. I’ll have a closer look tomorrow when I’m working from home.
Hi!
First of all, sorry for my bad english… I try to explain my intention as good as i can.
I tried to show this ” | ” before or after a php tag in my own template. For example my post.php contains this code
<div class="poststuff"><?php printf( __('Posted %s ago'), bb_get_post_time() ); ?> <a href="<?php post_anchor_link(); ?>">Permalink</a> <?php post_ip_link(); ?> <?php post_edit_link(); ?> <?php post_delete_link(); ?></div>
What i want is that e.g. before <?php post_ip_link(); ?> is displayed the above mentioned character. If i insert it before the php tag it also displayed to “normal users”. Normally the ip link is only displayed for admins. And so i´d like to see the | only as admin.
The output for normal users should look like this: Posted 38 minutes ago | Permalink
The output for admins should look like this: Posted 38 minutes ago | Permalink | 127.0.0.1 | Edit | Delete
If i add this “|” manually before the tags, for normal users it looks like this: Posted 38 minutes ago | Permalink | | |
Any ideas how this can be done?
Hi,
i’ve installed WP (not mu) 2.8.1 and bbPress 1.0.1 with user and cookie integration, users work without problem but the cookie not.
i’ve installed the bbpress integration plugin added the code to my wp-config.php but nothing change… the key are checked, i really don’t know how to resolve this… please help me… thanks!
Just noticed an issue when editing a post. If there is an apostrophe it get’s turned into HTML code. i.e. '
the preview code stops being generated… will look at this closer tomorrow. I suppose this only affects if the preview form has been added to edit post with (add_action('edit_form','add_live_comment_preview');
)
On both Chrome and Safari (latest stable on both, and up-to trunk on Chrome) these do not work for me:
– Adding/Removing from favorites ajax script within a viewed topic: Clicking on the span wrapped anchor shows animation but state unchanged.
– keymaster removal of posts: input box and animation plays, upon refreshing page (Manual F5) posts re-appear.
These situations do not occur with FireFox or I.E.
I’ve also replaced jQuery 1.2.6 with jQuery 1.3.2 (without errors, and requires a few php changes to the script loader) but this does not work. I had thought maybe there were fixes to 1.3.2 ajax code.
Still not discounting my own server config, and I haven’t fully debugged the javascript yet. I have jQuery debug up and running, just going to be a while.
Stack is: WPMU 2.8.1 >> BBPress 1.0.1
Anyone have similar issues?
Hey thanks _ck_
I found this snippet of code
<?php global $user_identity;
get_currentuserinfo();
if ($user_identity == ”) {
echo(‘Welcome Guest’);
} else {
echo(‘<img src=”/forum/avatars/’ . strtolower($user_identity) . ‘” alt=”avatar” />’);
}
?>
Which doesn’t cause an error but doesn’t display an image. I don’t think a file type is being declared which results in a 404 and then the alt text is displayed.
I did however come up with this, which is a modded version (to be used on a homepage)
<?php echo(‘<img src=”/forums/avatars/’ . $current_user->user_login . ‘.jpg” />’); ?>
<?php echo(‘<img src=”/forums/avatars/’ . $current_user->user_login . ‘.png” />’); ?>
<?php echo(‘<img src=”/forums/avatars/’ . $current_user->user_login . ‘.gif” />’); ?>
<?php echo(‘<img src=”/forums/avatars/’ . $current_user->user_login . ‘.jpeg” />’); ?>
I’m not sure how to find out the file extension via php so I just created 3 extra lines of code for the 4 types of files the form should accept.
If anyone wants to clean up my code I’d greatly appreciate it, I’m only just learning php (noob ) after playing with CSS and (x)HTML for a while. I know, the code will not be valid.
Thanks again, _ck_ ( I didn’t realize there was 2 help forums for that plugin)
good work.
though I changed the preview button to <p name='live_comment_preview_button' id='live_comment_preview_submit' value='".$label."' onclick='sendPostToPreview("".$live_comment_preview_path."" )' />Preview Post</p>
, styled accordingly with a cursor on hover and placed it on the post form itself (the submit button would try and submit the form).
add_action('post_form', 'add_live_comment_preview');
add_action('edit_form','add_live_comment_preview');
also added it to the edit post form.
I think get_topic_start_time();
will not echo it. You need to put topic_start_time();
I have fixed Live Comment Preview Plugin By Enrique Chavez aka Tmeister.
I have also added some new features like:
1) You don’t have to do any file editing, it will auto-insert itself.
2) Now, it will auto-refresh itself after 10 seconds. You can edit this in the js file (last line).
You can get it here:
http://www.mediafire.com/file/znyxze2mefw/live-comment-preview.zip
Hey! Plugin fixed
Posting the link in a few mins
I do this on one of my forums (a classified forum that I didn’t want users ‘bumping’ on constantly.) Just add
<?php
if ($forum_id == 3) {
$limit = bb_get_option('page_topics');
$offset = ($page-1)*$limit;
$forum_one_topics = $bbdb->get_results("SELECT * FROM $bbdb->topics WHERE forum_id = $forum_id AND topic_status = 0 AND topic_sticky = 0 ORDER BY topic_id DESC LIMIT $limit OFFSET $offset");
$forum_one_topic_posts = get_thread( $topic->topic_id);
$topics = $forum_one_topics;
}
?>
to the top of the forum.php file in your template. Take out the if ($forum_id == 3) {
and trailing }
if you want to apply it to all your forums.
To show topic creation date instead of freshness replace topic_time();
with get_topic_start_time();
in the forum.php, and front-page.php template files – though I haven’t tested that bit.
Puh … so easy.
In my theme for the profile menu was lost.
<?php if ( bb_is_profile() ) profile_menu(); ?>
Just finally got around to doing this. The .htaccess method worked awesomely.
To clarify for anyone else reading this, you’ll want to put the above .htaccess code in your WordPress .htaccess file, because that’s where the bbPress requests will still be hitting. You can remove the .htaccess file in your bbPress directory using this method.
Hey fellow bbPress enthusiasts,
I have just spent forever playing with PHP trying to get the name generated by “Last Poster” in Latest Discussions on Forum or Front-Page to link to THAT user’s bbPress profile.
My apologies if I am missing an easy “<a href=” command to surround the php in:
<td class="num"><?php topic_last_poster(); ?></td>
Nothing seems to work.
Many thanks as my brain has been fried working on this.
I think bb_head() calls bb_template_scripts() and I think bb_template_scripts() enqueues jquery when you are on the profile-edit.php page. So, I think just just need to ensure this is in your header.php in your template:
<?php bb_head() ;?>
If you already have that, then I’m not certain what the problem is. You could always hard code the call to jQuery, but that seems lame.
Shouldn’t it be:
define( 'BB_LANG', 'ja' );
Underscore between BB and LANG?
And, you should be installing the language file in a “my-languages” folder, on the same level as my-plugins and my-templates.
A little curiosity and trial and error will take you far when learning how to accomplish things.
If you look on front-page.php
you’ll see it uses forum_description()
so you can try
<?php forum_description(); ?>
in your topic.php
template.
If that doesn’t work, you may need to specify the $forum_id
<?php forum_description($forum_id); ?>
Yes, you’ll just have to fetch the username and then have the same username in bbPress and then edit your comments-template.php inside your WordPress template. I don’t have the time to fully explain it though, but i will do it myself soon actually so…
I’ve been digging through a lot of the bbPress code trying to find a way to do this with no success. I want to require people to have a certain email address (_____@certainwebsite.com) in order to register. I feel like this should be really easy to do, but I’m still not very skilled in both bbPress and PHP.
Since bbPress 1.0 is now making directories on it’s own from PHP it will cause problems for people on many hosts, because it will be created by the root/nobody owner and a local ftp will not be able to delete it because you don’t have the permissions as a regular user.
You’d need a short PHP program to delete those as the PHP owner.
<?php
rmdir("/var/www/vhosts/illuminatus.tv/httpdocs/illuminatus/bbpress/my-templates");
rmdir("/var/www/vhosts/illuminatus.tv/httpdocs/illuminatus/bbpress/my-plugins");
?>
I expect quite a bit of problems because of this from people on shared hosts.
The proper way for it to be done is with posix_setuid before file disk activity but I doubt they will ever do that (or just let people put the files in place like they did with 0.9)
ps. actually your directory names seem too long, what happens if you try to
rm /var/www/vhosts/illuminatus.tv/httpdocs/illuminatus/bbpress/my-templates
rm /var/www/vhosts/illuminatus.tv/httpdocs/illuminatus/bbpress/my-plugins
Apache has created these two directories with permission rwx r-x — I get the following when trying to delete them:
Error: Unable to remove file /httpdocs/illuminatus/bbpress//var/www/vhosts/illuminatus.tv/httpdocs/illuminatus/bbpress/my-templates: filemng failed: rm: cannot chdir from .' to
/var/www/vhosts/illuminatus.tv/httpdocs/illuminatus/bbpress/my-templates’: Permission denied
filemng: Error occured during /bin/rm command.
Error: Unable to remove file /httpdocs/illuminatus/bbpress//var/www/vhosts/illuminatus.tv/httpdocs/illuminatus/bbpress/my-plugins: filemng failed: rm: cannot chdir from .' to
/var/www/vhosts/illuminatus.tv/httpdocs/illuminatus/bbpress/my-plugins’: Permission denied
filemng: Error occured during /bin/rm command.
How do I delete them as Apache? Thanks in advance.
Hi,
I was wondering how I could display the bbPress plugin, Avatar Upload, in WordPress. Software: bbPress 1.0.1, WordPress 2.8.1
I am using bbPress as the profile’s home so to speak since I’d rather not use WordPress’ Dashboard and want to display the avatar of the user on the home page.
I have done deep integration both ways by using this snippet of code in [wp/bb]-config.php
if ( !defined( ‘ABSPATH’ ) ) {
include_once( ‘/home/path/to/forums/[bb/wp]-load.php’ );
}
Then pasted this bit of code where I want the avatar.
<?php avatarupload_get_avatar(ID); ?>
However, as I expected it doesn’t work with the error
Fatal error: Call to undefined function avatarupload_display() in blah3 on line x
I tried adding <?php bb-head ?> and <?php if ( bb_is_profile() ) profile_menu(); ?> to the header but both result in an error
I am no programmer but I don’t think bbPress is being load correctly. Can anyone offer a solution or some advice?