Forum Replies Created
-
In principle it’s possible to do so by replacing all the template functions with custom functions that call a custom filter first, but it probably wouldn’t work out overall (not everyone would do it, plugins would still have to be written for forums without this, changes to the core would have to be replicated …).
Probably better to say that not all functions have _hooks_ or _filters_, since pluggable refers to them being overwritable with another function (see bb-includes/pluggable.php).
You could request this in trac I suppose. Might be quite a decent feature in the future.
In reply to: let’s build a poll plugin!And I thought this was actually about _building_ one. Ah well.
I suspect that you don’t actually need help using Google.
Ooh. Probably. Nice idea.
<?php
/*
Plugin Name: Freshlink
Description: Turns freshness into a link to the latest post
Author: tisme, fel64
*/
function freshness_latestlink( $fresh ) {
global $topic;
$felgtlpl = get_topic_last_post_link($topic->topic_id);
return "<a href='$felgtlpl'>$fresh</a>";
}
//add_filter('', 'freshness_latestlink', 101);
?>Unfortunately there doesn’t seem to be a filter for it – only for modifying the actual time, not the text output. Since topic_time() also directly writes to the HTML, you can’t modify it first. You have to change the template, from
<?php topic_time(); ?>
to
<?php echo freshness_latestlink( get_topic_time() ); ?>
In reply to: plugin: Markdown> I guess ‘>’ in front of every _paragraph_.
It’s still annoying somewhat annoying
. I don’t want to have to scroll through a wall of text looking for new paragraphs. Perhaps >>Quote …. << ? What would also be interesting is the ability to add the name of who you’re quoting. Name>>Quote<< or “Name blah”>>Quote<<? Although that’s starting to get a bit artificial.
It is an option to make this plugin rewrite the posts as they’re being read, but I was worried about the extra server load (although it’s pretty light code) and it’s playing pretty badly with the Allow Images plugin.
I don’t want to keep hosting it on my server, so I’ll take this down the next time I think about it. http://www.loinhead.net/files/felise
http://www.loinhead.net/files/felise.php is a working, non-bb copy of the script so you can test it (note that >>Name[post#] doesn’t work). Ignore the sucky name, I hate naming things and needed something just temporarily
In reply to: Why “favorites” ? Bad terminology choice?Yes it is ethical. Or are you planning on doing something unethical with it?
My point is, granting Keymasters the power to do so isn’t in itself unethical. (If it’s necessary is another question.) What’s wrong with that?
In reply to: Help with an if/then statement<?php if( #conditional# ) {
//some code
} ?>Unfortunately determining if this is the last page is a little bit difficult. You need code like this (taken from template-functions.php):
global $page, $topic;
$add = topic_pages_add();
$last_page = get_page_number( $topic->topic_posts + $add );
if( $page == $last_page ) {
//some code
}which is way more code than it should be. You should be able to use (but can’t yet)
if( bb_last_page() ) {
// some code
}so I’m submitting a trac ticket so that hopefully in the next version you can do that.
In your case, the
// some code
should be:print( '<h2 class="post-form">POST A REPLY</h2>' );
Worth noting, in PHP
strings
(ie. text in code) are marked by opening and closing with'
or"
. If you open a string with'
then"
will be ignored and the other way round, too. So you could have usedprint( "<h2 class='post-form'>POST A REPLY</h2>" );
Also in PHP functions have to be like this:
function_name( #arguments );
where #arguments can be things like a string, or a variable you set earlier. Some functions do without the brackets but all of them work fine with brackets, so it’s best to always use them.
In reply to: plugin: Markdownhttp://rapidshare.com/files/43804950/felise.php.html
Hmm. Still don’t know about a name. Ignore the name there and upload, activate.
In addition to what I said last post,
*bolded stuff* => bolded stuff
_italic words_ => italic words
**notbold** => *notbold*
__notitalic__ => _notitalic_
link@http://somerealurl… => link
“link text blah”@http://somerealurl… => link text blah
#, *, -, (1, 2, 3), (a, b, c) =
> <ul/ol><li> .... </li> .... </ul/ol>
(Numbers, letters need to be in order. Any punctuation after it will also be accepted.)>>Name[post#] => >> Name
(Not italicised or bolded in: u*blah*, _ blah_)
I believe that covers everything. I’ll have a look at Markdown, see if it does anything cool that I’d want too.
The last one is pretty neat but mostly for another plugin that I have on my site that’s also unreleased. Might ask for plugin space for that one now I guess.
Oh, also worth noting that standard behaviour for this plugin is ‘compiling’ the text when the post is saved. That means that it doesn’t make your forum any slower (all the work is done when the post is saved) and that if at any point you remove this plugin, old posts written with it will look exactly the same so you can do that anytime without problems.
[Edit] Markdown is … complicated. When I wrote this, I wrote it to go along with bbPress, so it’s a lot simpler. It doesn’t support stuff like paragraphing because bbPress already does that. And I wrote it so you wouldn’t have to remember anything, but so that the stuff you’d write anyway is formatted nice. No need to think what the syntax is or anything like that. I like what it did with blockquotes. I’ll put in some syntax for blockquotes, even if having to put
>
in front of every line sounds tiresome. But what do people think about italicising or bolding inside words? I took it out to avoid unintentional formatting, but Markdown has it in (for stuff like un*fucking*believable) and now I’m not so sure.I wrote a plugin to do that. Just upload and activate this.
<?php
/*
Plugin Name: Page »
Plugin URI:
Description: Adds » to the end of topic titles, linking to latest post.
Author: fel64
Version: 0.7
Author URI: http://www.loinhead.net/
*/
if (!function_exists('is_tags')) {
function is_tags()
{
return is_tag();
}
}
if (is_front() || is_forum() || is_tags()) {
add_filter('topic_title', 'fel_addlatestlink', 101);
}
function fel_addlatestlink($title)
{
global $topic;
$felgtlpl = get_topic_last_post_link($topic->topic_id);
$title = $title . ' <a href="' . $felgtlpl . '"> » </a>';
return $title;
}
?>In reply to: Few questions..1. Some dudes do, yeah. But it seems to be a minority; who can tell? Maybe bbPress does just have a few new users a week
2. Haven’t seen one. Believe there was some trouble with older converters somebody dug up.
3. New version is in development, and I expect there will be new versions in development for a while. Don’t let that stop you getting it now. There’s no release planned for the next week as far as I know.
4. It’s not in the core and there’s no indication that’s what’s being worked on right now. It’d have to be a plugin. Last I read they fixed their RSS problems? It will say in the plugin topic, anyway.
5. It’s one of the wp devs that’s developing bb at the moment. They all work for the same small company. I don’t think one release would ever break the other.
In reply to: Howto List the other forums on the forums pagesHow did you do it on front-page? I reckon code like this (taken direct from kakumei’s front-page) should work everwhere but I haven’t tried it – if you already have, sorry.
<?php if ( bb_forums() ) : ?>
<h2><?php _e('Forums'); ?></h2>
<table id="forumlist">
<tr>
<th><?php _e('Main Theme'); ?></th>
<th><?php _e('Topics'); ?></th>
<th><?php _e('Posts'); ?></th>
</tr>
<?php while ( bb_forum() ) : ?>
<tr<?php bb_forum_class(); ?>>
<td><?php bb_forum_pad( '<div class="nest">' ); ?><a href="<?php forum_link(); ?>"><?php forum_name(); ?></a><small><?php forum_description(); ?></small><?php bb_forum_pad( '</div>' ); ?></td>
<td class="num"><?php forum_topics(); ?></td>
<td class="num"><?php forum_posts(); ?></td>
</tr>
<?php endwhile; ?>
</table>
<?php endif; // bb_forums() ?>If it doesn’t work, chuck
<?php bb_forums(); ?>
somewhere before it and try again.In reply to: BBPress Integration with MY login sistemThe user login handling functions are all pluggable. They’re in bb-includes/pluggable.php, always check if a function of that name already exists before defining the default one, and is loaded after plugins are run. So you can overwrite any of them.
In reply to: plugin: MarkdownI don’t know. But do you know about the plugin I wrote that does things similar to markdown? No. No you don’t. Because I haven’t mentioned it yet. Basically it lets you italicise, bolden, and link in a very elegant way (although I think syntax-wise slightly different way to markdown). It respects code and it auto-converts the lists you only wrote casually (list items starting with #, -, *, (1, 2, 3 …), (a, b, c …)) into proper HTML. If I could think of a goddamned name I would have uploaded it yesterday. But it is a different, very likely smaller feature set to Markdown, and if you need Markdown then that’s no use at all to you. If you’re interested I’m happy to provide a copy of the script.
Have you tried these filters ck removed? https://bbpress.org/forums/topic/new-plugin-admin-post-anything Check for the last post because he made some changes, but those should be all.
In reply to: Missing Argument for Get_User_Profile_LinkI can’t remember which version added what, but make sure to activate your plugins in bb-Admin/Site Management or they won’t work.
Try this:
<?php $user = bb_get_user( topic_last_poster() );
get_user_profile_link( $user->ID ); ?>You can make it one line if you want but you need those semicolons.
In reply to: Title TagsOh, sorry. Yeah. I getchoo. Yes. The filter you want to use is bb_title. The way filters work is that you tell bbpress what you want to filter, bbpress gives you the input and you return the output. In this case:
<?php
/*
Plugin Name: Title Modifier
Author: You
*/
add_filter('bb_title', 'titlemodify');
function titlemodify( $title ) {
//your code that does something to $title;
return $title;
}
?>Paste this into an empty text file, save it as
whateveryouwant.php
, edit the code so it actually does something with$title
, then upload and activate.In reply to: Title TagsWhat do you mean by title tag? I don’t understand. Do you mean the text that appears next to the bb icon at the top of the page?
In reply to: Plugin: Admin Post AnythingCoolio cheers. Ripped the filters to remove for my own nefarious porpoises in bbSync.
In reply to: bbSyncCoolio. Few problems recently (apart from Sneaky
) so I uploaded. No topic for it yet but I expect there will be at https://bbpress.org/plugins/topic/56
[Edit] And it is! Rate it please
In reply to: BB_Query class and next version of bbPress?It is funkin’ brilliant. I hope you downloaded the latest release ( https://trac.bbpress.org/browser/trunk, at the bottom of the page is the Zip Archive link to the latest) because it has a bunch of fixes and changes.
Can you detail anything you had to do to make it work, for future people who want to do this stuff?
In reply to: WordPress/BBPress Single Sign OnThis means their bbpress login will mysteriously fail.
No it won’t. No matter what cookies users have, they will not prevent them logging in.
schmitt, must say I really liked your site. Not at all interested in things financial but it was engaging nonetheless.
You could put these lines at the top of your bb-login.php:
header('Location: http://www.example.com/');
exit;Obviously changing the URL to that of your wp-login.php. I don’t know how else you’d do that. This may have all sorts of crazy adverse effects because I haven’t tried it myself; maybe ck can say how he did it?
In reply to: Can we do includes?BBTHEMEDIR only takes you to the
my-templates
folder. I’m surprised that bb_load_template() didn’t work; ah well, you solved it anyhoo.In reply to: Missing Argument for Get_User_Profile_LinkYES! The newest version is ALWAYS really new. REALLY new. There is NEVER a situation where you shouldn’t upgrade.
You have a problem and you’re not running the latest version. What do you do? Go upgrade.
You don’t have a problem. You’re not running the latest version. What do you do? GO UPGRADE.
Upgrading might not even fix this problem, it’s not sure. But it does fix several security exploits and adds a bunch of featurs. Go upgrade!
What’s worst is that you’re on a support forum asking for help and you’re not even on the latest version. You clearly haven’t tried everything before making other people take time to help you. Then you’re advised to upgrade … GO UPGRADE already.
If I wasn’t clear … GO UPGRADE
In reply to: Punbb -> BBPressthe old cookie will never delete
bb logs you in for a week, wp if you set it to ‘remember me’ for a year I think.
If you take the forum software online before really knowing what it can do and what you need to do, that’s also your problem.
For the moderation tools, something you may have found useful is doing what all the automattic forums do – keeping an RSS feed of threads tagged, by members, ‘modlook’. But I don’t want to get into a debate on the relative merits of moderation mechanisms, this is just an aside.
I guess part of my concern is how casually it’s either told or assumed that BB integrates with WP, and that BB is ready for primetime. There’s good reason why it’s set at a pre-1.0 version number.
It _does_ integrate. It _is_ ready for a lot of primetime; look at wp.com and .org, 9rules and technorati. But if you think that means that it toasts your bagels too, you’re wrong (and it’s your fault for assuming or believing that). It _is_ a pre-1.0 release, and if you use it and expect a 1.0 feature set, you’ll inevitably be disappointed. I don’t really get your bitterness about it – or at least, what comes across to me as bitterness.
In reply to: Can we do includes?I think it’s BBTHEMEDIR. You could also use bb_load_template() I think, which tries to load the filename you give it from the active theme folder.
Yes. Your database info is wrong. Maybe you’re the supposedly 1% that needs to change the db host – does your hosting provider give any info on connecting to databases?
[Edit] Trent totally beat me to it, and better, too.
In reply to: WordPress/BBPress Single Sign OnExpected behaviour is that signing into one will sign you into the other.
Can you please do the following:
Clear your cookies.
Log into wordpress and record what cookies are set, including domain and path (properties of each cookie).
Clear your cookies again.
Log into bb. Again record the cookies set. Are you logged into wp?
Tell us the cookies set from each case.